diff options
Diffstat (limited to 'public')
| -rw-r--r-- | public/bundle.js | 38 | ||||
| -rw-r--r-- | public/bundle.js.map | 2 |
2 files changed, 28 insertions, 12 deletions
diff --git a/public/bundle.js b/public/bundle.js index d8335da..6710809 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -2192,57 +2192,73 @@ var AugmentationGrid = function (_Component) { value: function render() { var _this2 = this; + var _props = this.props, + make = _props.make, + take = _props.take, + checkpoint = _props.checkpoint, + onTrain = _props.onTrain, + onAugment = _props.onAugment; + var _state = this.state, + x = _state.x, + y = _state.y, + sum = _state.sum; + var rows = []; return (0, _preact.h)( _group2.default, { className: 'augmentationGrid' }, (0, _preact.h)(_buttonGrid2.default, { - x: this.props.make, - y: this.props.take, + x: make, + y: take, max: 5000, onHover: function onHover(x, y) { return _this2.setState({ x: x, y: y }); }, onClick: function onClick(x, y) { - _this2.setState({ sum: _this2.state.sum + x * y }); - _this2.props.onAugment(y, x); + _this2.setState({ sum: sum + x * y }); + onAugment(y, x); } }), (0, _preact.h)( _param2.default, + { title: 'Name' }, + checkpoint.name + ), + (0, _preact.h)( + _param2.default, { title: 'Take' }, - this.state.y + y ), (0, _preact.h)( _param2.default, { title: 'Make' }, - this.state.x + x ), (0, _preact.h)( _param2.default, { title: 'Will add to dataset' }, - this.state.x * this.state.y + x * y ), (0, _preact.h)( _param2.default, { title: 'Total added this epoch' }, - this.state.sum + sum ), (0, _preact.h)( _param2.default, { title: 'Sequence length' }, - this.state.checkpoint.sequenceCount + checkpoint.sequenceCount ), (0, _preact.h)( _param2.default, { title: 'Dataset size' }, - this.state.checkpoint.datasetCount + checkpoint.datasetCount ), (0, _preact.h)( _button2.default, { onClick: function onClick() { _this2.setState({ sum: 0 }); - _this2.props.onTrain(); + onTrain(); } }, 'Train' ) diff --git a/public/bundle.js.map b/public/bundle.js.map index 64fb5f1..2512ac8 100644 --- a/public/bundle.js.map +++ b/public/bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"bundle.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/client/actions.js","webpack:///./app/client/api/crud.actions.js","webpack:///./app/client/api/crud.fetch.js","webpack:///./app/client/api/crud.types.js","webpack:///./app/client/api/crud.upload.js","webpack:///./app/client/api/index.js","webpack:///./app/client/api/parser.js","webpack:///./app/client/audio/lib/draw.js","webpack:///./app/client/audio/lib/index.js","webpack:///./app/client/audio/lib/output.js","webpack:///./app/client/audio/lib/spectrum.js","webpack:///./app/client/audio/lib/startAudioContext.js","webpack:///./app/client/audio/pix2wav.js","webpack:///./app/client/audio/wav2pix.js","webpack:///./app/client/common/audioPlayer/audioPlayer.actions.js","webpack:///./app/client/common/audioPlayer/audioPlayer.component.js","webpack:///./app/client/common/audioPlayer/audioPlayer.reducer.js","webpack:///./app/client/common/augmentationGrid.component.js","webpack:///./app/client/common/button.component.js","webpack:///./app/client/common/buttonGrid.component.js","webpack:///./app/client/common/checkbox.component.js","webpack:///./app/client/common/currentTask.component.js","webpack:///./app/client/common/fileList.component.js","webpack:///./app/client/common/fileUpload.component.js","webpack:///./app/client/common/folderList.component.js","webpack:///./app/client/common/gallery.component.js","webpack:///./app/client/common/group.component.js","webpack:///./app/client/common/header.component.js","webpack:///./app/client/common/index.js","webpack:///./app/client/common/loading.component.js","webpack:///./app/client/common/numberInput.component.js","webpack:///./app/client/common/param.component.js","webpack:///./app/client/common/paramGroup.component.js","webpack:///./app/client/common/player.component.js","webpack:///./app/client/common/progress.component.js","webpack:///./app/client/common/select.component.js","webpack:///./app/client/common/selectGroup.component.js","webpack:///./app/client/common/slider.component.js","webpack:///./app/client/common/taskList.component.js","webpack:///./app/client/common/textInput.component.js","webpack:///./app/client/common/views/index.js","webpack:///./app/client/common/views/new.view.js","webpack:///./app/client/dashboard/dashboard.actions.js","webpack:///./app/client/dashboard/dashboard.component.js","webpack:///./app/client/dashboard/dashboard.reducer.js","webpack:///./app/client/dashboard/dashboardheader.component.js","webpack:///./app/client/dataset/dataset.actions.js","webpack:///./app/client/dataset/dataset.component.js","webpack:///./app/client/dataset/dataset.form.js","webpack:///./app/client/dataset/dataset.loader.js","webpack:///./app/client/dataset/dataset.new.js","webpack:///./app/client/dataset/dataset.reducer.js","webpack:///./app/client/dataset/upload.reducer.js","webpack:///./app/client/dataset/upload.status.js","webpack:///./app/client/index.jsx","webpack:///./app/client/live/live.actions.js","webpack:///./app/client/live/live.reducer.js","webpack:///./app/client/live/player.js","webpack:///./app/client/live/whammy.js","webpack:///./app/client/modules/index.js","webpack:///./app/client/modules/module.reducer.js","webpack:///./app/client/modules/morph/index.js","webpack:///./app/client/modules/morph/morph.actions.js","webpack:///./app/client/modules/morph/morph.module.js","webpack:///./app/client/modules/morph/morph.reducer.js","webpack:///./app/client/modules/morph/morph.tasks.js","webpack:///./app/client/modules/morph/views/morph.app.js","webpack:///./app/client/modules/pix2pix/index.js","webpack:///./app/client/modules/pix2pix/pix2pix.actions.js","webpack:///./app/client/modules/pix2pix/pix2pix.module.js","webpack:///./app/client/modules/pix2pix/pix2pix.reducer.js","webpack:///./app/client/modules/pix2pix/pix2pix.tasks.js","webpack:///./app/client/modules/pix2pix/views/pix2pix.live.js","webpack:///./app/client/modules/pix2pix/views/pix2pix.new.js","webpack:///./app/client/modules/pix2pix/views/pix2pix.show.js","webpack:///./app/client/modules/pix2pixhd/index.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.actions.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.module.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.reducer.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.tasks.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.live.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.new.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.results.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.show.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.train.js","webpack:///./app/client/modules/pix2wav/index.js","webpack:///./app/client/modules/pix2wav/pix2wav.actions.js","webpack:///./app/client/modules/pix2wav/pix2wav.module.js","webpack:///./app/client/modules/pix2wav/pix2wav.reducer.js","webpack:///./app/client/modules/pix2wav/pix2wav.tasks.js","webpack:///./app/client/modules/pix2wav/views/pix2wav.live.js","webpack:///./app/client/modules/pix2wav/views/pix2wav.new.js","webpack:///./app/client/modules/pix2wav/views/pix2wav.show.js","webpack:///./app/client/modules/pix2wav/views/spectrogram.upload.js","webpack:///./app/client/modules/samplernn/index.js","webpack:///./app/client/modules/samplernn/samplernn.actions.js","webpack:///./app/client/modules/samplernn/samplernn.module.js","webpack:///./app/client/modules/samplernn/samplernn.reducer.js","webpack:///./app/client/modules/samplernn/samplernn.tasks.js","webpack:///./app/client/modules/samplernn/views/samplernn.graph.js","webpack:///./app/client/modules/samplernn/views/samplernn.import.js","webpack:///./app/client/modules/samplernn/views/samplernn.new.js","webpack:///./app/client/modules/samplernn/views/samplernn.results.js","webpack:///./app/client/modules/samplernn/views/samplernn.show.js","webpack:///./app/client/queue/queue.actions.js","webpack:///./app/client/queue/queue.reducer.js","webpack:///./app/client/socket/index.js","webpack:///./app/client/socket/socket.actions.js","webpack:///./app/client/socket/socket.api.js","webpack:///./app/client/socket/socket.connection.js","webpack:///./app/client/socket/socket.live.js","webpack:///./app/client/socket/socket.system.js","webpack:///./app/client/socket/socket.task.js","webpack:///./app/client/store.js","webpack:///./app/client/system/system.actions.js","webpack:///./app/client/system/system.component.js","webpack:///./app/client/system/system.reducer.js","webpack:///./app/client/types.js","webpack:///./app/client/util/format.js","webpack:///./app/client/util/hidpi-canvas.js","webpack:///./app/client/util/index.js","webpack:///./app/client/util/math.js","webpack:///./app/client/util/sort.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/buffer/node_modules/isarray/index.js","webpack:///./node_modules/core-util-is/lib/util.js","webpack:///./node_modules/events/events.js","webpack:///./node_modules/fbjs/lib/emptyFunction.js","webpack:///./node_modules/fbjs/lib/invariant.js","webpack:///./node_modules/fbjs/lib/warning.js","webpack:///./node_modules/fetch-jsonp/build/fetch-jsonp.js","webpack:///./node_modules/fft.js/lib/fft.js","webpack:///./node_modules/file-saver/FileSaver.js","webpack:///./node_modules/history/DOMUtils.js","webpack:///./node_modules/history/LocationUtils.js","webpack:///./node_modules/history/PathUtils.js","webpack:///./node_modules/history/createBrowserHistory.js","webpack:///./node_modules/history/createHashHistory.js","webpack:///./node_modules/history/createMemoryHistory.js","webpack:///./node_modules/history/createTransitionManager.js","webpack:///./node_modules/history/es/DOMUtils.js","webpack:///./node_modules/history/es/LocationUtils.js","webpack:///./node_modules/history/es/PathUtils.js","webpack:///./node_modules/history/es/createBrowserHistory.js","webpack:///./node_modules/history/es/createHashHistory.js","webpack:///./node_modules/history/es/createMemoryHistory.js","webpack:///./node_modules/history/es/createTransitionManager.js","webpack:///./node_modules/history/es/index.js","webpack:///./node_modules/hoist-non-react-statics/index.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/immediate/lib/browser.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./node_modules/invariant/browser.js","webpack:///./node_modules/jszip/lib/base64.js","webpack:///./node_modules/jszip/lib/compressedObject.js","webpack:///./node_modules/jszip/lib/compressions.js","webpack:///./node_modules/jszip/lib/crc32.js","webpack:///./node_modules/jszip/lib/defaults.js","webpack:///./node_modules/jszip/lib/external.js","webpack:///./node_modules/jszip/lib/flate.js","webpack:///./node_modules/jszip/lib/generate/ZipFileWorker.js","webpack:///./node_modules/jszip/lib/generate/index.js","webpack:///./node_modules/jszip/lib/index.js","webpack:///./node_modules/jszip/lib/load.js","webpack:///./node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js","webpack:///./node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js","webpack:///./node_modules/jszip/lib/nodejsUtils.js","webpack:///./node_modules/jszip/lib/object.js","webpack:///./node_modules/jszip/lib/readable-stream-browser.js","webpack:///./node_modules/jszip/lib/reader/ArrayReader.js","webpack:///./node_modules/jszip/lib/reader/DataReader.js","webpack:///./node_modules/jszip/lib/reader/NodeBufferReader.js","webpack:///./node_modules/jszip/lib/reader/StringReader.js","webpack:///./node_modules/jszip/lib/reader/Uint8ArrayReader.js","webpack:///./node_modules/jszip/lib/reader/readerFor.js","webpack:///./node_modules/jszip/lib/signature.js","webpack:///./node_modules/jszip/lib/stream/ConvertWorker.js","webpack:///./node_modules/jszip/lib/stream/Crc32Probe.js","webpack:///./node_modules/jszip/lib/stream/DataLengthProbe.js","webpack:///./node_modules/jszip/lib/stream/DataWorker.js","webpack:///./node_modules/jszip/lib/stream/GenericWorker.js","webpack:///./node_modules/jszip/lib/stream/StreamHelper.js","webpack:///./node_modules/jszip/lib/support.js","webpack:///./node_modules/jszip/lib/utf8.js","webpack:///./node_modules/jszip/lib/utils.js","webpack:///./node_modules/jszip/lib/zipEntries.js","webpack:///./node_modules/jszip/lib/zipEntry.js","webpack:///./node_modules/jszip/lib/zipObject.js","webpack:///./node_modules/jszip/node_modules/core-js/library/fn/set-immediate.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_a-function.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_an-object.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_cof.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_core.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_ctx.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_descriptors.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_dom-create.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_export.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_fails.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_global.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_hide.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_html.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_ie8-dom-define.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_invoke.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_is-object.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_object-dp.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_property-desc.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_task.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_to-primitive.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/web.immediate.js","webpack:///./node_modules/lie/lib/browser.js","webpack:///./node_modules/lodash-es/_Symbol.js","webpack:///./node_modules/lodash-es/_baseGetTag.js","webpack:///./node_modules/lodash-es/_freeGlobal.js","webpack:///./node_modules/lodash-es/_getPrototype.js","webpack:///./node_modules/lodash-es/_getRawTag.js","webpack:///./node_modules/lodash-es/_objectToString.js","webpack:///./node_modules/lodash-es/_overArg.js","webpack:///./node_modules/lodash-es/_root.js","webpack:///./node_modules/lodash-es/isObjectLike.js","webpack:///./node_modules/lodash-es/isPlainObject.js","webpack:///./node_modules/moment/min/moment.min.js","webpack:///./node_modules/node-fetch/browser.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/pako/index.js","webpack:///./node_modules/pako/lib/deflate.js","webpack:///./node_modules/pako/lib/inflate.js","webpack:///./node_modules/pako/lib/utils/common.js","webpack:///./node_modules/pako/lib/utils/strings.js","webpack:///./node_modules/pako/lib/zlib/adler32.js","webpack:///./node_modules/pako/lib/zlib/constants.js","webpack:///./node_modules/pako/lib/zlib/crc32.js","webpack:///./node_modules/pako/lib/zlib/deflate.js","webpack:///./node_modules/pako/lib/zlib/gzheader.js","webpack:///./node_modules/pako/lib/zlib/inffast.js","webpack:///./node_modules/pako/lib/zlib/inflate.js","webpack:///./node_modules/pako/lib/zlib/inftrees.js","webpack:///./node_modules/pako/lib/zlib/messages.js","webpack:///./node_modules/pako/lib/zlib/trees.js","webpack:///./node_modules/pako/lib/zlib/zstream.js","webpack:///./node_modules/preact-compat/dist/preact-compat.es.js","webpack:///./node_modules/preact/dist/preact.esm.js","webpack:///./node_modules/process-nextick-args/index.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/react-redux/es/components/Provider.js","webpack:///./node_modules/react-redux/es/components/connectAdvanced.js","webpack:///./node_modules/react-redux/es/connect/connect.js","webpack:///./node_modules/react-redux/es/connect/mapDispatchToProps.js","webpack:///./node_modules/react-redux/es/connect/mapStateToProps.js","webpack:///./node_modules/react-redux/es/connect/mergeProps.js","webpack:///./node_modules/react-redux/es/connect/selectorFactory.js","webpack:///./node_modules/react-redux/es/connect/verifySubselectors.js","webpack:///./node_modules/react-redux/es/connect/wrapMapToProps.js","webpack:///./node_modules/react-redux/es/index.js","webpack:///./node_modules/react-redux/es/utils/PropTypes.js","webpack:///./node_modules/react-redux/es/utils/Subscription.js","webpack:///./node_modules/react-redux/es/utils/shallowEqual.js","webpack:///./node_modules/react-redux/es/utils/verifyPlainObject.js","webpack:///./node_modules/react-redux/es/utils/warning.js","webpack:///./node_modules/react-router-dom/es/BrowserRouter.js","webpack:///./node_modules/react-router-dom/es/HashRouter.js","webpack:///./node_modules/react-router-dom/es/Link.js","webpack:///./node_modules/react-router-dom/es/MemoryRouter.js","webpack:///./node_modules/react-router-dom/es/NavLink.js","webpack:///./node_modules/react-router-dom/es/Prompt.js","webpack:///./node_modules/react-router-dom/es/Redirect.js","webpack:///./node_modules/react-router-dom/es/Route.js","webpack:///./node_modules/react-router-dom/es/Router.js","webpack:///./node_modules/react-router-dom/es/StaticRouter.js","webpack:///./node_modules/react-router-dom/es/Switch.js","webpack:///./node_modules/react-router-dom/es/index.js","webpack:///./node_modules/react-router-dom/es/matchPath.js","webpack:///./node_modules/react-router-dom/es/withRouter.js","webpack:///./node_modules/react-router-redux/lib/actions.js","webpack:///./node_modules/react-router-redux/lib/index.js","webpack:///./node_modules/react-router-redux/lib/middleware.js","webpack:///./node_modules/react-router-redux/lib/reducer.js","webpack:///./node_modules/react-router-redux/lib/sync.js","webpack:///./node_modules/react-router/es/MemoryRouter.js","webpack:///./node_modules/react-router/es/Prompt.js","webpack:///./node_modules/react-router/es/Redirect.js","webpack:///./node_modules/react-router/es/Route.js","webpack:///./node_modules/react-router/es/Router.js","webpack:///./node_modules/react-router/es/StaticRouter.js","webpack:///./node_modules/react-router/es/Switch.js","webpack:///./node_modules/react-router/es/matchPath.js","webpack:///./node_modules/react-router/es/withRouter.js","webpack:///./node_modules/react-router/node_modules/isarray/index.js","webpack:///./node_modules/react-router/node_modules/path-to-regexp/index.js","webpack:///./node_modules/readable-stream/duplex-browser.js","webpack:///./node_modules/readable-stream/lib/_stream_duplex.js","webpack:///./node_modules/readable-stream/lib/_stream_passthrough.js","webpack:///./node_modules/readable-stream/lib/_stream_readable.js","webpack:///./node_modules/readable-stream/lib/_stream_transform.js","webpack:///./node_modules/readable-stream/lib/_stream_writable.js","webpack:///./node_modules/readable-stream/lib/internal/streams/BufferList.js","webpack:///./node_modules/readable-stream/lib/internal/streams/destroy.js","webpack:///./node_modules/readable-stream/lib/internal/streams/stream-browser.js","webpack:///./node_modules/readable-stream/node_modules/isarray/index.js","webpack:///./node_modules/readable-stream/passthrough.js","webpack:///./node_modules/readable-stream/readable-browser.js","webpack:///./node_modules/readable-stream/transform.js","webpack:///./node_modules/readable-stream/writable-browser.js","webpack:///./node_modules/redux-thunk/lib/index.js","webpack:///./node_modules/redux/es/redux.js","webpack:///./node_modules/resolve-pathname/index.js","webpack:///./node_modules/safe-buffer/index.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/signal-windows/index.js","webpack:///./node_modules/signal-windows/src/framer.js","webpack:///./node_modules/signal-windows/src/windows.js","webpack:///./node_modules/sprintf-js/src/sprintf.js","webpack:///./node_modules/stream-browserify/index.js","webpack:///./node_modules/string_decoder/lib/string_decoder.js","webpack:///./node_modules/symbol-observable/es/index.js","webpack:///./node_modules/symbol-observable/es/ponyfill.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./node_modules/tone/build/Tone.js","webpack:///./node_modules/util-deprecate/browser.js","webpack:///./node_modules/uuid/lib/bytesToUuid.js","webpack:///./node_modules/uuid/lib/rng-browser.js","webpack:///./node_modules/uuid/v1.js","webpack:///./node_modules/value-equal/index.js","webpack:///./node_modules/warning/browser.js","webpack:///(webpack)/buildin/amd-define.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///(webpack)/buildin/module.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/client/index.jsx\");\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _redux = require('redux');\n\nvar _api = require('./api');\n\nvar _live = require('./live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('./queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _system = require('./system/system.actions');\n\nvar systemActions = _interopRequireWildcard(_system);\n\nvar _socket = require('./socket/socket.actions');\n\nvar socketActions = _interopRequireWildcard(_socket);\n\nvar _dataset = require('./dataset/dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _audioPlayer = require('./common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _store = require('./store');\n\nfunction _interopRequireWildcard(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; } }\n\nexports.default = Object.keys(_api.actions).map(function (a) {\n return [a, _api.actions[a]];\n}).concat([['live', liveActions], ['queue', queueActions], ['system', systemActions], ['dataset', datasetActions], ['audioPlayer', audioPlayerActions]]).map(function (p) {\n return [p[0], (0, _redux.bindActionCreators)(p[1], _store.store.dispatch)];\n}).concat([['socket', socketActions]]).reduce(function (a, b) {\n return (a[b[0]] = b[1]) && a;\n}, {});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.crud_action = undefined;\nexports.crud_actions = crud_actions;\n\nvar _crud = require('./crud.fetch');\n\nvar _crud2 = require('./crud.types');\n\nvar _crud3 = require('./crud.upload');\n\nfunction crud_actions(type) {\n var fetch_type = (0, _crud.crud_fetch)(type);\n return ['index', 'show', 'create', 'update', 'destroy'].reduce(function (lookup, param) {\n lookup[param] = crud_action(type, param, function (q) {\n return fetch_type[param](q);\n });\n return lookup;\n }, {\n action: function action(method, fn) {\n return crud_action(type, method, fn);\n },\n upload: function upload(id, fd) {\n return (0, _crud3.upload_action)(type, id, fd);\n }\n });\n}\n\nvar crud_action = exports.crud_action = function crud_action(type, method, fn) {\n return function (q) {\n return function (dispatch) {\n return new Promise(function (resolve, reject) {\n dispatch({ type: (0, _crud2.as_type)(type, method + '_loading') });\n fn(q).then(function (data) {\n dispatch({ type: (0, _crud2.as_type)(type, method), data: data });\n resolve(data);\n }).catch(function (e) {\n dispatch({ type: (0, _crud2.as_type)(type, method + '_error') });\n reject(e);\n });\n });\n };\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.crud_fetch = crud_fetch;\nexports.postBody = postBody;\n\nvar _nodeFetch = require('node-fetch');\n\nvar _nodeFetch2 = _interopRequireDefault(_nodeFetch);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction crud_fetch(type, tag) {\n var uri = '/api/' + type + '/' + (tag || '');\n return {\n index: function index(q) {\n return (0, _nodeFetch2.default)(_get_url(uri, q), _get_headers()).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n show: function show(id) {\n return (0, _nodeFetch2.default)(uri + id).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n create: function create(data) {\n return (0, _nodeFetch2.default)(uri, post(data)).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n update: function update(data) {\n return (0, _nodeFetch2.default)(uri + data.id, put(data)).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n destroy: function destroy(data) {\n return (0, _nodeFetch2.default)(uri + data.id, _destroy(data)).then(function (req) {\n return req.json();\n }).catch(error);\n }\n };\n}\n\nfunction _get_url(_url, data) {\n var url = new URL(window.location.origin + _url);\n if (data) {\n Object.keys(data).forEach(function (key) {\n return url.searchParams.append(key, data[key]);\n });\n }\n return url;\n}\nfunction _get_headers() {\n return {\n method: 'GET',\n headers: {\n 'Accept': 'application/json'\n }\n };\n}\nfunction post(data) {\n return {\n method: 'POST',\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n}\nfunction postBody(data) {\n return {\n method: 'POST',\n body: data,\n headers: {\n 'Accept': 'application/json'\n }\n };\n}\nfunction put(data) {\n return {\n method: 'PUT',\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n}\nfunction _destroy(data) {\n return {\n method: 'DELETE',\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n}\nfunction error(err) {\n console.warn(err);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar as_type = exports.as_type = function as_type(a, b) {\n return [a, b].join('_').toUpperCase();\n};\n\nvar with_type = exports.with_type = function with_type(type, actions) {\n return actions.reduce(function (a, b) {\n return (a[b] = as_type(type, b)) && a;\n }, {});\n};\n\nvar crud_type = exports.crud_type = function crud_type(type) {\n var actions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return with_type(type, actions.concat(['index_loading', 'index', 'index_error', 'show_loading', 'show', 'show_error', 'create_loading', 'create', 'create_error', 'update_loading', 'update', 'update_error', 'destroy_loading', 'destroy', 'destroy_error', 'upload_loading', 'upload_progress', 'upload_waiting', 'upload_complete', 'upload_error', 'sort']));\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.upload_action = undefined;\nexports.crud_upload = crud_upload;\n\nvar _crud = require('./crud.types');\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction crud_upload(type, fd, data, dispatch) {\n return new Promise(function (resolve, reject) {\n var id = data.id;\n\n Object.keys(data).forEach(function (key) {\n if (key !== 'id') {\n fd.append(key, data[key]);\n }\n });\n\n console.log('/api/' + type + '/' + id + '/upload/');\n\n var xhr = new XMLHttpRequest();\n xhr.upload.addEventListener(\"progress\", uploadProgress, false);\n xhr.addEventListener(\"load\", uploadComplete, false);\n xhr.addEventListener(\"error\", uploadFailed, false);\n xhr.addEventListener(\"abort\", uploadCancelled, false);\n xhr.open(\"POST\", '/api/' + type + '/' + id + '/upload/');\n xhr.send(fd);\n\n dispatch && dispatch({ type: (0, _crud.as_type)(type, 'upload_loading') });\n\n var complete = false;\n\n function uploadProgress(e) {\n if (e.lengthComputable) {\n var percent = Math.round(e.loaded * 100 / e.total) || 0;\n if (percent > 99) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_waiting'),\n percent: percent\n }, type, id));\n } else {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_progress'),\n percent: percent\n }, type, id));\n }\n } else {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'unable to compute upload progress'\n }, type, id));\n }\n }\n\n function uploadComplete(e) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(e.target.responseText);\n } catch (e) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'upload failed'\n }, type, id));\n reject(e);\n return;\n }\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_complete'),\n data: parsed\n }, type, id));\n if (parsed.files && parsed.files.length) {\n parsed.files.forEach(function (file) {\n console.log(file);\n dispatch && dispatch({\n type: (0, _crud.as_type)('file', 'create'),\n data: file\n });\n });\n }\n resolve(parsed);\n }\n\n function uploadFailed(evt) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'upload failed'\n }, type, id));\n reject(evt);\n }\n\n function uploadCancelled(evt) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'upload cancelled'\n }, type, id));\n reject(evt);\n }\n });\n}\n\nvar upload_action = exports.upload_action = function upload_action(type, id, fd) {\n return function (dispatch) {\n return crud_upload(type, id, fd, dispatch);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.actions = exports.parser = exports.util = undefined;\n\nvar _crud = require('./crud.actions');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _parser = require('./parser');\n\nvar parser = _interopRequireWildcard(_parser);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*\nfor our crud events, create corresponding actions\nthe actions fire a 'loading' event, call the underlying api method, and then resolve.\nso you can do ... \n import { folderActions } from '../../api'\n folderActions.index({ module: 'samplernn' })\n folderActions.show(12)\n folderActions.create({ module: 'samplernn', name: 'foo' })\n folderActions.update(12, { module: 'pix2pix' })\n folderActions.destroy(12, { confirm: true })\n folderActions.upload(12, form_data)\n*/\n\nexports.util = _util2.default;\nexports.parser = parser;\nvar actions = exports.actions = ['folder', 'file', 'dataset', 'task', 'user'].reduce(function (a, b) {\n return (a[b] = (0, _crud.crud_actions)(b)) && a;\n}, {});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.tumblr = exports.thumbnail = exports.loadImage = exports.tag = exports.parse = exports.lookup = exports.integrations = undefined;\n\nvar _nodeFetch = require('node-fetch');\n\nvar _nodeFetch2 = _interopRequireDefault(_nodeFetch);\n\nvar _fetchJsonp = require('fetch-jsonp');\n\nvar _fetchJsonp2 = _interopRequireDefault(_fetchJsonp);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar integrations = exports.integrations = [{\n type: 'image',\n regex: /\\.(jpeg|jpg|gif|png|svg)(\\?.*)?$/i,\n fetch: function fetch(url, done) {\n var img = new Image();\n img.onload = function () {\n if (!img) return;\n var width = img.naturalWidth,\n height = img.naturalHeight;\n img = null;\n done({\n url: url,\n type: \"image\",\n token: \"\",\n thumbnail: \"\",\n title: \"\",\n width: width,\n height: height\n });\n };\n img.src = url;\n if (img.complete) {\n img.onload();\n }\n },\n tag: function tag(media) {\n return '<img src=\"' + media.url + '\">';\n }\n}, {\n type: 'video',\n regex: /\\.(mp4|webm)(\\?.*)?$/i,\n fetch: function fetch(url, done) {\n var video = document.createElement(\"video\");\n var url_parts = url.replace(/\\?.*$/, \"\").split(\"/\");\n var filename = url_parts[url_parts.length - 1];\n video.addEventListener(\"loadedmetadata\", function () {\n var width = video.videoWidth,\n height = video.videoHeight;\n video = null;\n done({\n url: url,\n type: \"video\",\n token: url,\n thumbnail: \"/public/assets/img/video-thumbnail.png\",\n title: filename,\n width: width,\n height: height\n });\n });\n video.src = url;\n video.load();\n },\n tag: function tag(media) {\n return '<video src=\"' + media.url + '\">';\n }\n}, {\n type: 'audio',\n regex: /\\.(wav|mp3)(\\?.*)?$/i,\n fetch: function fetch(url, done) {\n var audio = document.createElement(\"audio\");\n var url_parts = url.replace(/\\?.*$/, \"\").split(\"/\");\n var filename = url_parts[url_parts.length - 1];\n audio.addEventListener(\"loadedmetadata\", function () {\n var duration = audio.duration;\n audio = null;\n done({\n url: url,\n type: \"audio\",\n token: url,\n thumbnail: \"/public/assets/img/audio-thumbnail.png\",\n title: filename,\n duration: duration\n });\n });\n audio.src = url;\n audio.load();\n },\n tag: function tag(media) {\n return '<audio src=\"' + media.url + '\">';\n }\n}, {\n type: 'youtube',\n regex: /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i,\n fetch: function fetch(url, done) {\n var id = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0];\n var thumb = \"https://i.ytimg.com/vi/\" + id + \"/hqdefault.jpg\";\n\n var jsonp_url = new URL('https://www.googleapis.com/youtube/v3/videos');\n var data = {\n id: id,\n key: \"AIzaSyCaLRGY-hxs92045X-Jew7w1FgQPkStHgc\",\n part: \"id,contentDetails,snippet,status\"\n };\n Object.keys(data).forEach(function (key) {\n return jsonp_url.searchParams.append(key, data[key]);\n });\n\n (0, _fetchJsonp2.default)(jsonp_url.toString()).then(function (result) {\n return result.json();\n }).then(function (result) {\n if (!result || !result.items.length) {\n return alert(\"Sorry, this video URL is invalid.\");\n }\n var res = result.items[0];\n // console.log(res)\n\n var dd = res.contentDetails.duration.match(/\\d+/g).map(function (i) {\n return parseInt(i);\n });\n var duration = 0;\n if (dd.length == 3) {\n duration = dd[0] * 60 + dd[1] * 60 + dd[2];\n } else if (dd.length == 2) {\n duration = dd[0] * 60 + dd[1];\n } else {\n duration = dd[0];\n }\n\n [\"maxres\", \"high\", \"medium\", \"standard\", \"default\"].some(function (t) {\n if (res.snippet.thumbnails[t]) {\n thumb = res.snippet.thumbnails[t].url;\n return true;\n }\n return false;\n });\n\n done({\n url: url,\n type: \"youtube\",\n token: id,\n thumbnail: thumb,\n title: res.snippet.title,\n duration: duration,\n width: 640,\n height: 360\n });\n });\n },\n tag: function tag(media) {\n // return '<img class=\"video\" type=\"youtube\" vid=\"'+media.token+'\" src=\"'+media.thumbnail+'\"><span class=\"playvid\">▶</span>';\n return '<div class=\"video\" style=\"width: ' + media.width + 'px; height: ' + media.height + 'px; overflow: hidden; position: relative;\"><iframe frameborder=\"0\" scrolling=\"no\" seamless=\"seamless\" webkitallowfullscreen=\"webkitAllowFullScreen\" mozallowfullscreen=\"mozallowfullscreen\" allowfullscreen=\"allowfullscreen\" id=\"okplayer\" width=\"' + media.width + '\" height=\"' + media.height + '\" src=\"https://youtube.com/embed/' + media.token + '?showinfo=0\" style=\"position: absolute; top: 0px; left: 0px; width: ' + media.width + 'px; height: ' + media.height + 'px;\"></iframe></div>';\n }\n}, {\n type: 'vimeo',\n regex: /vimeo.com\\/\\d+$/i,\n fetch: function fetch(url, done) {\n var id = url.match(/\\d+$/i)[0];\n (0, _nodeFetch2.default)('https://vimeo.com/api/v2/video/' + id + '.json').then(function (result) {\n return result.json();\n }).then(function (result) {\n if (result.length == 0) {\n return done(id, \"\", 640, 360);\n }\n var res = result[0];\n if (res.embed_privacy != \"anywhere\") {\n alert(\"Sorry, the author of this video has marked it private, preventing it from being embedded.\", function () {});\n return;\n }\n done({\n url: url,\n type: \"vimeo\",\n token: id,\n thumbnail: res.thumbnail_large,\n duration: res.duration,\n title: res.title,\n width: res.width,\n height: res.height\n });\n });\n },\n tag: function tag(media) {\n // return '<img class=\"video\" type=\"vimeo\" vid=\"'+media.token+'\" src=\"'+media.thumbnail+'\"><span class=\"playvid\">▶</span>';\n return '<div class=\"video\" style=\"width: ' + media.width + 'px; height: ' + media.height + 'px; overflow: hidden; position: relative;\"><iframe frameborder=\"0\" scrolling=\"no\" seamless=\"seamless\" webkitallowfullscreen=\"webkitAllowFullScreen\" mozallowfullscreen=\"mozallowfullscreen\" allowfullscreen=\"allowfullscreen\" id=\"okplayer\" src=\"https://player.vimeo.com/video/' + media.token + '?api=1&title=0&byline=0&portrait=0&playbar=0&player_id=okplayer&loop=0&autoplay=0\" width=\"' + media.width + '\" height=\"' + media.height + '\" style=\"position: absolute; top: 0px; left: 0px; width: ' + media.width + 'px; height: ' + media.height + 'px;\"></iframe></div>';\n }\n},\n// {\n// type: 'soundcloud',\n// regex: /soundcloud.com\\/[-a-zA-Z0-9]+\\/[-a-zA-Z0-9]+\\/?$/i,\n// fetch: function (url, done) {\n// fetch('https://api.soundcloud.com/resolve.json?url=' \n// + url\n// + '&client_id=' \n// + '0673fbe6fc794a7750f680747e863b10')\n// .then(result => result.json())\n// .then(result => {\n// console.log(result)\n// done({\n// url: url,\n// type: \"soundcloud\",\n// token: result.id,\n// thumbnail: result.artwork_url || result.user.avatar_url,\n// title: result.user.username + \" - \" + result.title,\n// duration: result.duration,\n// width: 166,\n// height: 166,\n// })\n// })\n// },\n// tag: function (media) {\n// return '<iframe width=\"166\" height=\"166\" scrolling=\"no\" frameborder=\"no\"' +\n// 'src=\"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/' + media.token +\n// '&color=ff6600&auto_play=false&show_artwork=true\"></iframe>'\n// }\n// },\n{\n type: 'link',\n regex: /^http.+/i,\n fetch: function fetch(url, done) {\n done({\n url: url,\n type: \"link\",\n token: \"\",\n thumbnail: \"\",\n title: \"\",\n width: 100,\n height: 100\n });\n },\n tag: function tag(media) {\n return '<a href=\"' + media.url + '\" target=\"_blank\">' + media.url + '</a>';\n }\n}];\n\nvar lookup = exports.lookup = integrations.reduce(function (a, b) {\n return (a[b.type] = b) && a;\n}, {});\n\nvar parse = exports.parse = function parse(url, cb) {\n var matched = integrations.some(function (integration) {\n if (integration.regex.test(url)) {\n integration.fetch(url, function (res) {\n cb(res);\n });\n return true;\n }\n return false;\n });\n if (!matched) {\n cb(null);\n }\n};\n\nvar tag = exports.tag = function tag(media) {\n if (media.type in lookup) {\n return lookup[media.type].tag(media);\n }\n return \"\";\n};\n\nvar loadImage = exports.loadImage = function loadImage(url, cb, error) {\n if (lookup.image.regex.test(url)) {\n lookup.image.fetch(url, function (media) {\n cb(media);\n });\n } else error && error();\n};\n\nvar thumbnail = exports.thumbnail = function thumbnail(media) {\n return '<img src=\"' + (media.thumbnail || media.url) + '\" class=\"thumb\">';\n};\n\nvar tumblr = exports.tumblr = function tumblr(url, cb) {\n var domain = url.replace(/^https?:\\/\\//, \"\").split(\"/\")[0];\n if (domain.indexOf(\".\") == -1) {\n domain += \".tumblr.com\";\n }\n (0, _fetchJsonp2.default)(\"http://\" + domain + \"/api/read\").then(function (data) {\n // const blog = data.tumblelog\n var media_list = data.posts.reduce(parseTumblrPost, []);\n cb(media_list);\n });\n};\n\nfunction parseTumblrPost(media_list, post) {\n var media = void 0,\n caption = void 0,\n url = void 0;\n switch (post.type) {\n case 'photo':\n caption = stripHTML(post['photo-caption']);\n if (post.photos.length) {\n post.photos.forEach(function (photo) {\n media = {\n url: photo['photo-url-1280'],\n type: \"image\",\n token: \"\",\n thumbnail: photo['photo-url-500'],\n description: caption,\n width: parseInt(photo.width),\n height: parseInt(photo.height)\n };\n media_list.push(media);\n });\n } else {\n media = {\n url: post['photo-url-1280'],\n type: \"image\",\n token: \"\",\n thumbnail: post['photo-url-500'],\n description: caption,\n width: parseInt(post.width),\n height: parseInt(post.height)\n };\n media_list.push(media);\n }\n break;\n case 'video':\n url = post['video-source'];\n if (url.indexOf(\"http\") !== 0) {\n break;\n }\n if (lookup.youtube.regex.test(url)) {\n var id = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0];\n var thumb = \"https://i.ytimg.com/vi/\" + id + \"/hqdefault.jpg\";\n media = {\n url: post['video-source'],\n type: \"youtube\",\n token: id,\n thumbnail: thumb,\n title: stripHTML(post['video-caption']),\n width: 640,\n height: 360\n };\n media_list.push(media);\n }\n break;\n default:\n break;\n }\n return media_list;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.spectrum = spectrum;\nexports.raw_spectrum = raw_spectrum;\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar scratch = document.createElement('canvas');\nvar scratchCtx = scratch.getContext('2d-lodpi');\n\nvar w = 256;\nvar h = 256;\n\nfunction spectrum(spec, x0, y0, ww, hh) {\n var data = spec.data;\n var fft_size = spec.fft_size;\n var half_fft_size = spec.fft_size / 2;\n var spec_len = data.length;\n\n scratch.width = data.length;\n scratch.height = half_fft_size;\n\n var imageData = ctx.createImageData(scratch.width, scratch.height);\n var pixels = imageData.data;\n\n var i = void 0,\n j = void 0,\n u = void 0,\n v = void 0,\n _r = void 0,\n _i = void 0,\n col = void 0,\n hsl = void 0;\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n\n for (j = 0; j < half_fft_size; j++) {\n u = ((half_fft_size - j) * spec_len + i) * 4;\n v = j * 2;\n _r = col[v];\n _i = mod(col[v + 1], Math.PI * 2) / (Math.PI * 2);\n hsl = color.hsl2rgb((_i + 1) / 2, 1.0, 1 - Math.abs(_r / 10));\n // red - real part\n // pixels[u] = _r * 127 + 127\n // // green - imag part\n // pixels[u+1] = _i * 127 + 127\n // // blue - magnitude\n // pixels[u+2] = Math.sqrt(Math.pow(_r, 2) + Math.pow(_i, 2)) * 128 + 127\n // pixels[u+3] = 255\n pixels[u] = hsl[0];\n pixels[u + 1] = hsl[1];\n pixels[u + 2] = hsl[2];\n pixels[u + 3] = 255;\n }\n }\n\n scratchCtx.putImageData(imageData, 0, 0);\n\n var pcm_length = spec.fft_overlap * spec_len;\n\n x0 = x0 * devicePixelRatio || 0;\n y0 = y0 * devicePixelRatio || Math.floor(h / 4);\n ww = ww * devicePixelRatio || w;\n hh = hh * devicePixelRatio || h / 4;\n\n var width = Math.round(pcm_length / spec.sr * pixels_per_second);\n var height = Math.floor(hh);\n\n ctx.save();\n clear(1, x0, y0, w, height);\n ctx.drawImage(scratch, x0, y0, width, height);\n ctx.restore();\n}\n\nfunction raw_spectrum(spec, x0, y0, ww, hh, def_min_r, def_min_i) {\n var data = spec.data;\n var fft_size = spec.fft_size;\n var half_fft_size = spec.fft_size / 2;\n var spec_len = data.length;\n\n var _scratch = document.createElement('canvas');\n var _scratchCtx = _scratch.getContext('2d-lodpi');\n _scratch.width = data.length;\n _scratch.height = half_fft_size;\n // console.log(\"spectrum w/h:\", _scratch.width, _scratch.height)\n\n var imageData = _scratchCtx.createImageData(_scratch.width, _scratch.height);\n var pixels = imageData.data;\n\n var i = void 0,\n j = void 0,\n u = void 0,\n v = void 0,\n _r = void 0,\n _i = void 0,\n col = void 0,\n hsl = void 0;\n // let min_r = Infinity, max_r = -Infinity\n // let min_i = Infinity, max_i = -Infinity\n\n // determined empirically..\n // let min_r = -60.4894057005308\n // let max_r = 107.23800966675353\n // let min_i = -59.4894057005308\n // let max_i = 108.23800966675353\n var min_r = -def_min_r;\n var max_r = def_min_r;\n var min_i = -def_min_i;\n var max_i = def_min_i;\n var delta_r = max_r - min_r;\n var delta_i = max_i - min_i;\n var mean_r = 0;\n var mean_i = 0;\n var sum_mean_r = 0,\n sum_mean_i = 0;\n var real = void 0,\n imag = void 0;\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n mean_r = 0;\n mean_i = 0;\n\n for (j = 0; j < half_fft_size; j++) {\n u = (j * spec_len + i) * 4;\n v = j * 2;\n real = col[v];\n imag = col[v + 1];\n mean_r += real;\n mean_i += imag;\n _r = _util2.default.clamp((real - min_r) / delta_r * 255, 0, 255);\n _i = _util2.default.clamp((imag - min_i) / delta_i * 255, 0, 255);\n\n // hsl = color.hsl2rgb((_i + 1) / 2, 1.0, 1 - Math.abs(_r / 10))\n pixels[u + 0] = _r;\n pixels[u + 1] = _i;\n pixels[u + 2] = 127; // hsl[2]\n pixels[u + 3] = 255;\n\n // min_r = Math.min(min_r, col[v])\n // max_r = Math.max(max_r, col[v])\n // min_i = Math.min(min_i, col[v]+1)\n // max_i = Math.max(max_i, col[v]+1)\n }\n mean_r /= half_fft_size;\n mean_i /= half_fft_size;\n sum_mean_r += mean_r;\n sum_mean_i += mean_i;\n }\n\n sum_mean_r /= spec_len;\n sum_mean_i /= spec_len;\n // console.log(sum_mean_r, sum_mean_i)\n // console.log(\"r:\", min_r, max_r)\n // console.log(\"i:\", min_i, max_i)\n _scratchCtx.putImageData(imageData, 0, 0);\n\n return { canvas: _scratch, imageData: imageData };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.requestAudioContext = requestAudioContext;\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _startAudioContext = require('./startAudioContext');\n\nvar _startAudioContext2 = _interopRequireDefault(_startAudioContext);\n\nvar _util = require('../../util');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction requestAudioContext(fn) {\n if (_util.is_mobile) {\n var container = document.createElement('div');\n var button = document.createElement('div');\n button.innerHTML = 'Tap to start - please unmute your phone';\n Object.assign(container.style, {\n display: 'block',\n position: 'absolute',\n width: '100%',\n height: '100%',\n zIndex: '10000',\n top: '0px',\n left: '0px',\n backgroundColor: 'rgba(0, 0, 0, 0.8)'\n });\n Object.assign(button.style, {\n display: 'block',\n position: 'absolute',\n left: '50%',\n top: '50%',\n padding: '20px',\n backgroundColor: '#7F33ED',\n color: 'white',\n fontFamily: 'monospace',\n borderRadius: '3px',\n transform: 'translate3D(-50%,-50%,0)',\n textAlign: 'center',\n lineHeight: '1.5',\n width: '150px'\n });\n container.appendChild(button);\n document.body.appendChild(container);\n _startAudioContext2.default.setContext(_tone2.default.context);\n _startAudioContext2.default.on(button);\n _startAudioContext2.default.onStarted(function (_) {\n container.remove();\n fn();\n });\n } else {\n fn();\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// const compressor = new Tone.Compressor(-30, 3).toMaster()\n\nvar compressor = new _tone2.default.Compressor(-30, 3).toMaster();\nvar gain = new _tone2.default.Gain(1).connect(compressor);\n\nexports.default = gain;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _util = require('../../util');\n\nvar _signalWindows = require('signal-windows');\n\nvar _fft = require('fft.js');\n\nvar _fft2 = _interopRequireDefault(_fft);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fft_size = 512;\nvar fft_overlap = fft_size / 4;\n\nvar fft = new _fft2.default(fft_size);\n\nfunction toSpectrum(pcm, sr) {\n sr = sr || 44100;\n var ham = _signalWindows.windows.construct('ham', fft_size);\n var pcm_in = new Array(fft_size);\n var pcm_length = pcm.length;\n var pcm_q_length = Math.ceil(pcm_length / fft_size) * fft_size;\n var i = void 0,\n j = void 0,\n fft_out = void 0,\n data = [];\n for (i = -fft_size; i < pcm_q_length; i += fft_overlap) {\n for (j = 0; j < fft_size; j++) {\n pcm_in[j] = pcm[i + j] * ham[j] || 0;\n }\n fft_out = fft.createComplexArray();\n fft.realTransform(fft_out, pcm_in);\n fft.completeSpectrum(fft_out);\n data.push(fft_out);\n }\n return {\n data: data,\n sr: sr,\n fft_size: fft_size,\n fft_overlap: fft_overlap\n };\n}\n\nfunction fromSpectrum(spec) {\n var data = spec.data;\n var sr = spec.sr;\n var fft_size = spec.fft_size;\n var fft_overlap = spec.fft_overlap;\n var spec_len = data.length;\n\n var ham = _signalWindows.windows.construct('ham', fft_size);\n var out = fft.createComplexArray();\n var pcm_length = fft_overlap * spec_len;\n\n var audioBuffer = _tone2.default.context.createBuffer(1, pcm_length, sr);\n var pcm = audioBuffer.getChannelData(0);\n\n var i = void 0,\n j = void 0,\n u = void 0,\n col = void 0;\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n // for (j = fft_size; j < fft_size << 1; j++) {\n // col[j] = 0\n // }\n // if (i == 0) console.log(col)\n fft.inverseTransform(out, col);\n u = i * fft_overlap;\n for (j = 0; j < fft_size; j++) {\n pcm[u + j] += out[j * 2] * ham[j] || 0;\n }\n }\n\n fadeInOut(pcm, fft_size);\n // console.log(pcm)\n return audioBuffer;\n}\n\nfunction fromImageData(imageData, sr, _r, _i) {\n var pixels = imageData.data;\n var w = imageData.width;\n var h = imageData.height;\n var data = new Array(w);\n var x = void 0,\n y = void 0,\n u = void 0,\n v = void 0,\n v2 = void 0;\n for (y = 0; y < h; y++) {\n var col = data[y] = new Float32Array(h * 4);\n for (x = 0; x < w; x++) {\n u = (x * w + y) * 4;\n v = x * 2;\n col[v] = (pixels[u] / 255 - 0.5) * _r;\n col[v + 1] = (pixels[u + 1] / 255 - 0.5) * _i;\n v2 = (h - y + h) * 2;\n col[v2] = col[v];\n col[v2 + 1] = 0; // col[v+1]\n }\n col[h * 2] = col[h * 2 + 1] = col[h * 2 - 1] = col[h * 2 - 2] = 0;\n }\n var spec = {\n data: data,\n sr: sr,\n fft_size: fft_size, fft_overlap: fft_overlap\n };\n return spec;\n}\n\nfunction binToHz(spec, i) {\n return i / spec.fft_size * spec.sr;\n}\n\nfunction fadeInOut(pcm, fade_size) {\n var pcm_length = pcm.length;\n var fade = 0,\n i = void 0;\n for (i = 0; i < fade_size; i++) {\n fade = i / fade_size;\n fade *= fade;\n pcm[i] *= fade;\n pcm[pcm_length - i] *= fade;\n }\n}\nfunction rotatePhase(spec, theta) {\n var data = spec.data,\n fft_size = spec.fft_size;\n\n var i = void 0,\n j = void 0,\n col = void 0,\n len = data.length;\n for (i = 0; i < len; i++) {\n col = data[i];\n for (j = 0; j < fft_size; j++) {\n col[j * 2 + 1] += theta;\n }\n }\n return spec;\n}\n\nfunction linearBins(spec, n) {\n n = n || 1;\n\n var bins = [],\n i = void 0,\n q_i = void 0;\n for (q_i = 0; q_i < n; q_i++) {\n bins[q_i] = [];\n }\n var step = Math.floor(spec.fft_size / n);\n var len_quantize_n = (0, _util.quantize)(spec.fft_size, n);\n for (i = 0; i < len_quantize_n; i++) {\n q_i = Math.floor(i / step);\n bins[q_i] = bins[q_i] || [];\n bins[q_i].push(i);\n }\n // leftover bins get put at end\n for (; i < spec.fft_size; i++) {\n bins[q_i].push(i);\n }\n return bins;\n}\nfunction logarithmicBins(spec) {\n var bins = [],\n i = void 0,\n j = void 0,\n q_i = void 0;\n var binCount = Math.log2(spec.fft_size) - 1;\n for (i = 0, q_i = 0, j = 0; i < binCount; i++) {\n j += 1 << i;\n bins[i] = [];\n for (; q_i < j; q_i++) {\n bins[i].push(q_i);\n }\n }\n return bins;\n}\nfunction concatBins(bins) {\n return bins.reduce(function (acc, cv) {\n return acc.concat(cv);\n }, []);\n}\nfunction reverseBins(bins) {\n return bins.map(function (bin) {\n return bin.reverse();\n });\n}\nfunction minBins(bins) {\n return bins.map(function (bin) {\n var b = bin[0];\n return bin.map(function () {\n return b;\n });\n });\n}\nfunction maxBins(bins) {\n return bins.map(function (bin) {\n var b = bin[bin.length - 1];\n return bin.map(function () {\n return b;\n });\n });\n}\nfunction rotateSpectrum(spec, n) {\n var fft_size = spec.fft_size;\n\n if (n && n < 1) {\n n -= 0.5;\n n *= fft_size;\n }\n n = Math.floor(n);\n var order = new Array(fft_size),\n i = void 0;\n for (i = 0; i < fft_size; i++) {\n order[i] = (0, _util.mod)(i + n, fft_size / 2);\n }\n return reorderBins(spec, order);\n}\nfunction cloneSpectrum(spec) {\n var data = spec.data,\n fft_size = spec.fft_size,\n sr = spec.sr,\n fft_overlap = spec.fft_overlap;\n\n var spec_len = data.length;\n\n var new_data = new Array(spec_len);\n var i = void 0;\n for (i = 0; i < spec_len; i++) {\n new_data[i] = data[i].concat();\n new_data[i][2] = 0;\n }\n\n return {\n data: new_data,\n fft_size: fft_size,\n sr: sr, fft_overlap: fft_overlap\n };\n}\nfunction reverseSpectrum(spec) {\n var new_spec = cloneSpectrum(spec);\n new_spec.data = new_spec.data.reverse();\n return new_spec;\n}\nfunction shuffleSpectrum(spec) {\n var fft_size = spec.fft_size;\n\n var order = new Array(fft_size),\n i = void 0;\n for (i = 0; i < fft_size; i++) {\n order[i] = i;\n }\n (0, _util.shuffle)(order);\n return reorderBins(spec, order);\n}\nfunction invertSpectrum(spec) {\n var fft_size = spec.fft_size;\n\n var order = new Array(fft_size),\n i = void 0;\n for (i = 0; i < fft_size; i++) {\n order[i] = fft_size - i - 1;\n }\n return reorderBins(spec, order);\n}\nfunction reorderBins(spec, order) {\n var new_spec = cloneSpectrum(spec);\n var data = spec.data,\n sr = spec.sr,\n fft_size = spec.fft_size,\n fft_overlap = spec.fft_overlap;\n\n var spec_len = data.length;\n var new_data = new_spec.data;\n\n\n var i = void 0,\n j = void 0,\n col = void 0,\n new_col = void 0;\n for (j = order.length; j < fft_size; j++) {\n order[j] = j;\n }\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n new_col = new_data[i] = data[i].concat();\n col[0] = 0;\n col[2] = 0;\n col[4] = 0;\n for (j = 0; j < fft_size / 2; j++) {\n new_col[j * 2] = col[order[j] * 2];\n new_col[j * 2 + 1] = col[order[j] * 2 + 1];\n }\n for (; j < fft_size; j++) {\n new_col[j * 2] = 0;\n new_col[j * 2 + 1] = 0;\n }\n }\n\n return {\n data: new_data,\n sr: sr, fft_size: fft_size, fft_overlap: fft_overlap\n };\n}\n\nexports.default = {\n fft_size: fft_size, fft_overlap: fft_overlap,\n toSpectrum: toSpectrum, fromSpectrum: fromSpectrum, fromImageData: fromImageData, binToHz: binToHz,\n fadeInOut: fadeInOut,\n cloneSpectrum: cloneSpectrum,\n reverseSpectrum: reverseSpectrum, shuffleSpectrum: shuffleSpectrum, invertSpectrum: invertSpectrum, rotateSpectrum: rotateSpectrum,\n reorderBins: reorderBins,\n linearBins: linearBins, logarithmicBins: logarithmicBins,\n concatBins: concatBins,\n reverseBins: reverseBins, minBins: minBins, maxBins: maxBins,\n rotatePhase: rotatePhase\n};","\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * StartAudioContext.js\n * @author Yotam Mann\n * @license http://opensource.org/licenses/MIT MIT License\n * @copyright 2016 Yotam Mann\n */\n(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = factory();\n } else {\n root.StartAudioContext = factory();\n }\n})(undefined, function () {\n\n /**\n * The StartAudioContext object\n */\n var StartAudioContext = {\n /**\n * The audio context passed in by the user\n * @type {AudioContext}\n */\n context: null,\n /**\n * The TapListeners bound to the elements\n * @type {Array}\n * @private\n */\n _tapListeners: [],\n /**\n * Callbacks to invoke when the audio context is started\n * @type {Array}\n * @private\n */\n _onStarted: []\n };\n\n /**\n * Set the context\n * @param {AudioContext} ctx\n * @returns {StartAudioContext}\n */\n StartAudioContext.setContext = function (ctx) {\n StartAudioContext.context = ctx;\n return StartAudioContext;\n };\n\n /**\n * Add a tap listener to the audio context\n * @param {Array|Element|String|jQuery} element\n * @returns {StartAudioContext}\n */\n StartAudioContext.on = function (element) {\n if (Array.isArray(element) || NodeList && element instanceof NodeList) {\n for (var i = 0; i < element.length; i++) {\n StartAudioContext.on(element[i]);\n }\n } else if (typeof element === \"string\") {\n StartAudioContext.on(document.querySelectorAll(element));\n } else if (element.jquery && typeof element.toArray === \"function\") {\n StartAudioContext.on(element.toArray());\n } else if (Element && element instanceof Element) {\n //if it's an element, create a TapListener\n var tap = new TapListener(element, onTap);\n StartAudioContext._tapListeners.push(tap);\n }\n return StartAudioContext;\n };\n\n /**\n * Bind a callback to when the audio context is started. \n * @param {Function} cb\n * @return {StartAudioContext}\n */\n StartAudioContext.onStarted = function (cb) {\n //if it's already started, invoke the callback\n if (StartAudioContext.isStarted()) {\n cb();\n } else {\n StartAudioContext._onStarted.push(cb);\n }\n return StartAudioContext;\n };\n\n /**\n * returns true if the context is started\n * @return {Boolean}\n */\n StartAudioContext.isStarted = function () {\n return StartAudioContext.context !== null && StartAudioContext.context.state === \"running\";\n };\n\n /**\n * @class Listens for non-dragging tap ends on the given element\n * @param {Element} element\n * @internal\n */\n var TapListener = function TapListener(element) {\n\n this._dragged = false;\n\n this._element = element;\n\n this._bindedMove = this._moved.bind(this);\n this._bindedEnd = this._ended.bind(this);\n\n element.addEventListener(\"touchmove\", this._bindedMove);\n element.addEventListener(\"touchend\", this._bindedEnd);\n element.addEventListener(\"mouseup\", this._bindedEnd);\n };\n\n /**\n * drag move event\n */\n TapListener.prototype._moved = function (e) {\n this._dragged = true;\n };\n\n /**\n * tap ended listener\n */\n TapListener.prototype._ended = function (e) {\n if (!this._dragged) {\n onTap();\n }\n this._dragged = false;\n };\n\n /**\n * remove all the bound events\n */\n TapListener.prototype.dispose = function () {\n this._element.removeEventListener(\"touchmove\", this._bindedMove);\n this._element.removeEventListener(\"touchend\", this._bindedEnd);\n this._element.removeEventListener(\"mouseup\", this._bindedEnd);\n this._bindedMove = null;\n this._bindedEnd = null;\n this._element = null;\n };\n\n /**\n * Invoked the first time of the elements is tapped.\n * Creates a silent oscillator when a non-dragging touchend \n * event has been triggered.\n */\n function onTap() {\n //start the audio context with a silent oscillator\n if (StartAudioContext.context && !StartAudioContext.isStarted()) {\n var osc = StartAudioContext.context.createOscillator();\n var silent = StartAudioContext.context.createGain();\n silent.gain.value = 0;\n osc.connect(silent);\n silent.connect(StartAudioContext.context.destination);\n var now = StartAudioContext.context.currentTime;\n osc.start(now);\n osc.stop(now + 0.5);\n }\n\n //dispose all the tap listeners\n if (StartAudioContext._tapListeners) {\n for (var i = 0; i < StartAudioContext._tapListeners.length; i++) {\n StartAudioContext._tapListeners[i].dispose();\n }\n StartAudioContext._tapListeners = null;\n }\n //the onstarted callbacks\n if (StartAudioContext._onStarted) {\n for (var j = 0; j < StartAudioContext._onStarted.length; j++) {\n StartAudioContext._onStarted[j]();\n }\n StartAudioContext._onStarted = null;\n }\n }\n\n return StartAudioContext;\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.play = play;\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _draw = require('./lib/draw');\n\nvar draw = _interopRequireWildcard(_draw);\n\nvar _output = require('./lib/output');\n\nvar _output2 = _interopRequireDefault(_output);\n\nvar _spectrum = require('./lib/spectrum');\n\nvar _spectrum2 = _interopRequireDefault(_spectrum);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _r = 8;\nvar _i = 8;\n\nfunction play(frame) {\n // const { canvas, imageData } = draw.raw_spectrum(fft, 0, 256, 0, 256, 1, 1)\n // console.log(_r, _i)\n // const { canvas, imageData } = draw.raw_spectrum(player.fft, 0, 256, 0, 256, _r, _i)\n var new_fft = _spectrum2.default.fromImageData(frame.imageData, 44100, _r, _i);\n // gallery.innerHTML = ''\n\n // console.log(player.fft.data, new_fft.data)\n var buf = _spectrum2.default.fromSpectrum(new_fft);\n var _p = new _tone2.default.Player(buf);\n _p.connect(_output2.default);\n _p.start(_tone2.default.now());\n // redraw(new_fft)\n}\n// function redraw(new_fft){\n// const { canvas, imageData } = draw.raw_spectrum(new_fft, 0, 256, 0, 256, _r, _i)\n// }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.buildZip = exports.renderFrames = exports.loadPCM = exports.loadBuffer = exports.spectrum = exports.FRAME_STEP = exports.FRAME_LENGTH = undefined;\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _jszip = require('jszip');\n\nvar _jszip2 = _interopRequireDefault(_jszip);\n\nvar _sprintfJs = require('sprintf-js');\n\nvar _draw = require('./lib/draw');\n\nvar draw = _interopRequireWildcard(_draw);\n\nvar _output = require('./lib/output');\n\nvar _output2 = _interopRequireDefault(_output);\n\nvar _spectrum = require('./lib/spectrum');\n\nvar _spectrum2 = _interopRequireDefault(_spectrum);\n\nvar _lib = require('./lib');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar FRAME_LENGTH = exports.FRAME_LENGTH = 126 * 255;\nvar FRAME_STEP = exports.FRAME_STEP = Math.round(FRAME_LENGTH / 4);\n\nvar _r = 8;\nvar _i = 8;\n\nexports.spectrum = _spectrum2.default;\n// requestAudioContext(() => {})\n\nvar loadBuffer = exports.loadBuffer = function loadBuffer(file) {\n return new Promise(function (resolve, reject) {\n var url = URL.createObjectURL(file);\n var buffer = new _tone2.default.Buffer(url, loadBuffer, function (err) {\n console.error('err', err);\n reject(err);\n });\n function loadBuffer() {\n URL.revokeObjectURL(url);\n resolve(buffer);\n }\n });\n};\n\nvar loadPCM = exports.loadPCM = function loadPCM(file) {\n return new Promise(function (resolve, reject) {\n // if we've already fetched this file...\n if (file.pcm) {\n return resolve(file);\n }\n loadBuffer(file).then(function (buffer) {\n var pcm = buffer._buffer.getChannelData(0);\n var sr = buffer._buffer.sampleRate;\n if (!pcm) return reject();\n console.log(pcm.length, sr);\n resolve({ file: file, buffer: buffer, pcm: pcm, sr: sr });\n });\n });\n};\n\nvar renderFrames = exports.renderFrames = function renderFrames(file, _ref) {\n var _ref$frame_step = _ref.frame_step,\n frame_step = _ref$frame_step === undefined ? FRAME_STEP : _ref$frame_step,\n _ref$frame_start = _ref.frame_start,\n frame_start = _ref$frame_start === undefined ? 0 : _ref$frame_start,\n _ref$max = _ref.max,\n max = _ref$max === undefined ? 12 : _ref$max;\n return function (dispatch) {\n return new Promise(function (resolve, reject) {\n loadPCM(file).then(function (pcmProps) {\n var file = pcmProps.file,\n buffer = pcmProps.buffer,\n pcm = pcmProps.pcm,\n sr = pcmProps.sr;\n\n dispatch({ type: _types2.default.wav2pix.load });\n var frames = [];\n var count = 0;\n var _len = pcm.length - FRAME_LENGTH;\n var offset = Math.round(_len * frame_start);\n for (; offset < _len && count < max; offset += frame_step, count += 1) {\n frames.push(render(pcm.slice(offset, offset + FRAME_LENGTH), sr, count));\n }\n dispatch({ type: _types2.default.wav2pix.finish, message: 'Rendered ' + count + ' images' });\n resolve({ pcm: pcmProps, frames: frames });\n });\n });\n };\n};\n\nvar buildZip = exports.buildZip = function buildZip(name, file, _ref2) {\n var _ref2$frame_step = _ref2.frame_step,\n frame_step = _ref2$frame_step === undefined ? FRAME_STEP : _ref2$frame_step,\n _ref2$frame_start = _ref2.frame_start,\n frame_start = _ref2$frame_start === undefined ? 0 : _ref2$frame_start,\n _ref2$max = _ref2.max,\n max = _ref2$max === undefined ? 10000 : _ref2$max;\n return function (dispatch) {\n return new Promise(function (resolve, reject) {\n loadPCM(file).then(function (_ref3) {\n var buffer = _ref3.buffer,\n pcm = _ref3.pcm,\n sr = _ref3.sr;\n\n dispatch({ type: _types2.default.wav2pix.load });\n\n var zip = new _jszip2.default();\n var zip_folder = zip.folder(\"wav2pix_\" + name);\n\n var steps = (pcm.length - FRAME_LENGTH) / frame_step;\n console.log(steps);\n\n var count = 0;\n var _len = pcm.length - FRAME_LENGTH;\n var offset = Math.round(_len * frame_start);\n for (; offset < _len && count < max; offset += frame_step, count += 1) {\n if (count % 10 === 0) {\n dispatch({ type: _types2.default.wav2pix.progress, progress: { i: count / max * 6, n: 6 } });\n }\n render(pcm.slice(offset, offset + FRAME_LENGTH), sr, count, zip_folder);\n }\n\n // dispatch event\n dispatch({ type: _types2.default.wav2pix.finish, message: 'Rendered ' + count + ' images' });\n zip.generateAsync({ type: \"blob\" }).then(function (content) {\n dispatch({ type: _types2.default.wav2pix.zip, size: content.size });\n // FileSaver.saveAs(content, \"wav2pix_\" + name + \".zip\")\n resolve({\n zip: content,\n filename: \"wav2pix_\" + name + \".zip\",\n count: count\n });\n });\n });\n });\n };\n};\n\nfunction render(pcm, sr, count, zip) {\n var fft = _spectrum2.default.toSpectrum(pcm, sr);\n // console.log('render', fft)\n // const pcm_rev = pcm.slice().reverse()\n // const spec_rev = spectrum.toSpectrum(pcm_rev, spec.sr)\n\n var _draw$raw_spectrum = draw.raw_spectrum(fft, 0, 256, 0, 256, _r, _i),\n canvas = _draw$raw_spectrum.canvas,\n imageData = _draw$raw_spectrum.imageData;\n\n if (zip) {\n var name = (0, _sprintfJs.sprintf)('frame_%05d.png', count);\n var dataURL = canvas.toDataURL(\"image/png\");\n zip.file(name, dataURL.split(',')[1], { base64: true });\n }\n return { fft: fft, canvas: canvas, imageData: imageData };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.enqueue = exports.resume = exports.pause = exports.play = undefined;\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar play = exports.play = function play(file) {\n return { type: _types2.default.audioPlayer.play, file: file };\n};\nvar pause = exports.pause = function pause() {\n return { type: _types2.default.audioPlayer.pause };\n};\nvar resume = exports.resume = function resume() {\n return { type: _types2.default.audioPlayer.resume };\n};\nvar enqueue = exports.enqueue = function enqueue(file) {\n return { type: _types2.default.audioPlayer.enqueue, file: file };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _audioPlayer = require('./audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar AudioPlayer = function (_Component) {\n _inherits(AudioPlayer, _Component);\n\n function AudioPlayer(props) {\n _classCallCheck(this, AudioPlayer);\n\n var _this = _possibleConstructorReturn(this, (AudioPlayer.__proto__ || Object.getPrototypeOf(AudioPlayer)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(AudioPlayer, [{\n key: 'handleClick',\n value: function handleClick(e) {\n var _props = this.props,\n audioPlayer = _props.audioPlayer,\n actions = _props.actions;\n\n if (audioPlayer.playing) {\n actions.pause();\n } else {\n actions.resume();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var audioPlayer = this.props.audioPlayer;\n\n return (0, _preact.h)(\n 'div',\n { className: 'audioPlayer' },\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'button',\n {\n onClick: this.handleClick\n },\n audioPlayer.playing ? '▶' : '~'\n )\n );\n }\n }]);\n\n return AudioPlayer;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n audioPlayer: state.audioPlayer\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AudioPlayer);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar audioPlayerInitialState = {\n loading: false,\n error: null,\n status: '',\n current: null,\n index: -1,\n playlist: []\n};\n\nvar audio = document.createElement('audio');\n\nvar audioPlayerReducer = function audioPlayerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : audioPlayerInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.audioPlayer.play:\n if (!action.file.url) {\n return state;\n }\n audio.src = action.file.url;\n audio.play();\n return _extends({}, state, {\n playing: true,\n current: action.file\n });\n case _types2.default.audioPlayer.pause:\n audio.pause();\n return _extends({}, state, {\n playing: false\n });\n case _types2.default.audioPlayer.resume:\n audio.play();\n return _extends({}, state, {\n playing: true\n });\n default:\n return state;\n }\n};\n\nexports.default = audioPlayerReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _group = require('./group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('./param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _button = require('./button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _buttonGrid = require('./buttonGrid.component');\n\nvar _buttonGrid2 = _interopRequireDefault(_buttonGrid);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar AugmentationGrid = function (_Component) {\n _inherits(AugmentationGrid, _Component);\n\n function AugmentationGrid() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, AugmentationGrid);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AugmentationGrid.__proto__ || Object.getPrototypeOf(AugmentationGrid)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n x: 0, y: 0, sum: 0\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(AugmentationGrid, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var rows = [];\n return (0, _preact.h)(\n _group2.default,\n { className: 'augmentationGrid' },\n (0, _preact.h)(_buttonGrid2.default, {\n x: this.props.make,\n y: this.props.take,\n max: 5000,\n onHover: function onHover(x, y) {\n return _this2.setState({ x: x, y: y });\n },\n onClick: function onClick(x, y) {\n _this2.setState({ sum: _this2.state.sum + x * y });\n _this2.props.onAugment(y, x);\n }\n }),\n (0, _preact.h)(\n _param2.default,\n { title: 'Take' },\n this.state.y\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Make' },\n this.state.x\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Will add to dataset' },\n this.state.x * this.state.y\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Total added this epoch' },\n this.state.sum\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Sequence length' },\n this.state.checkpoint.sequenceCount\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Dataset size' },\n this.state.checkpoint.datasetCount\n ),\n (0, _preact.h)(\n _button2.default,\n { onClick: function onClick() {\n _this2.setState({ sum: 0 });\n _this2.props.onTrain();\n } },\n 'Train'\n )\n );\n }\n }]);\n\n return AugmentationGrid;\n}(_preact.Component);\n\nexports.default = AugmentationGrid;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Button = function (_Component) {\n _inherits(Button, _Component);\n\n function Button(props) {\n _classCallCheck(this, Button);\n\n var _this = _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Button, [{\n key: 'handleClick',\n value: function handleClick(e) {\n this.props.onClick && this.props.onClick();\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'button param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'button',\n {\n onClick: this.handleClick\n },\n this.props.value || this.props.children\n )\n )\n );\n }\n }]);\n\n return Button;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Button);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar ButtonGrid = function (_Component) {\n _inherits(ButtonGrid, _Component);\n\n function ButtonGrid() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, ButtonGrid);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ButtonGrid.__proto__ || Object.getPrototypeOf(ButtonGrid)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n x: 0, y: 0\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(ButtonGrid, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _state = this.state,\n _x = _state.x,\n _y = _state.y;\n var _props = this.props,\n X = _props.x,\n Y = _props.y,\n _props$max = _props.max,\n max = _props$max === undefined ? Infinity : _props$max,\n _onClick = _props.onClick,\n onHover = _props.onHover;\n\n return (0, _preact.h)(\n 'table',\n { className: 'buttonGrid' },\n (0, _preact.h)(\n 'tr',\n { className: 'row' },\n (0, _preact.h)(\n 'th',\n null,\n \" \"\n ),\n X.map(function (x) {\n return (0, _preact.h)(\n 'th',\n { className: x === _x && 'bold' },\n x\n );\n })\n ),\n Y.map(function (y) {\n return (0, _preact.h)(\n 'tr',\n { className: 'row' },\n (0, _preact.h)(\n 'th',\n { className: y === _y && 'bold' },\n y\n ),\n X.map(function (x) {\n return (0, _preact.h)(\n 'td',\n null,\n x * y > max ? \" \" : (0, _preact.h)(\n 'button',\n {\n onClick: function onClick() {\n return _onClick(x, y);\n },\n onMouseEnter: function onMouseEnter() {\n _this2.setState({ x: x, y: y });\n onHover(x, y);\n }\n },\n \" \"\n )\n );\n })\n );\n })\n );\n }\n }]);\n\n return ButtonGrid;\n}(_preact.Component);\n\nexports.default = ButtonGrid;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Checkbox = function (_Component) {\n _inherits(Checkbox, _Component);\n\n function Checkbox(props) {\n _classCallCheck(this, Checkbox);\n\n var _this = _possibleConstructorReturn(this, (Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Checkbox, [{\n key: 'handleClick',\n value: function handleClick(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.checked;\n this.props.onToggle && this.props.onToggle(new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var checked = this.props.value;\n var dim = !this.props.noDim;\n return (0, _preact.h)(\n 'div',\n { className: 'checkbox param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: 'checkbox',\n onClick: this.handleClick,\n checked: checked\n })\n )\n );\n }\n }]);\n\n return Checkbox;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n // actions: bindActionCreators(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Checkbox);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// import { Loading, CurrentTask, FileList, FileRow } from '../../../common'\n\nfunction CurrentTask(_ref) {\n var cpu = _ref.cpu,\n gpu = _ref.gpu,\n processor = _ref.processor;\n\n var processor_name = void 0;\n if (processor) {\n processor_name = processor === 'cpu' ? 'cpu' : 'gpu';\n } else if (gpu.status !== 'IDLE') {\n processor_name = 'gpu';\n } else if (cpu.status !== 'IDLE') {\n processor_name = 'cpu';\n }\n var p = processor_name === 'cpu' ? cpu : gpu;\n if (!p) return (0, _preact.h)('div', null);\n if (p.status === 'IDLE') {\n return (0, _preact.h)(\n 'div',\n null,\n processor_name,\n ' idle'\n );\n }\n var last_message = p.last_message,\n pid = p.pid,\n task = p.task;\n var activity = task.activity,\n epoch = task.epoch,\n epochs = task.epochs,\n dataset = task.dataset,\n module = task.module;\n\n return (0, _preact.h)(\n 'div',\n { className: 'currentTask' },\n '#',\n pid,\n ': ',\n (0, _preact.h)(\n 'b',\n null,\n module,\n ' ',\n activity\n ),\n ' ',\n (0, _preact.h)(\n 'i',\n null,\n dataset\n ),\n !!epochs ? (0, _preact.h)(\n 'span',\n null,\n epochs,\n ' epoch',\n _util2.default.courtesy_s(epochs)\n ) : \"\",\n epoch ? (0, _preact.h)(\n 'span',\n null,\n '(currently #',\n epoch,\n ')'\n ) : \"\",\n (0, _preact.h)('br', null),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'div',\n { 'class': 'quiet' },\n last_message\n )\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return state.system.runner;\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n // actions: bindActionCreators(samplernnActions, dispatch),\n // remote: bindActionCreators(samplernnTasks, dispatch),\n // audioPlayer: bindActionCreators(audioPlayerActions, dispatch),\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(CurrentTask);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FileRow = exports.FileList = undefined;\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fieldSet = _util2.default.fieldSet(new Set(['name', 'date', 'size']));\n\nvar FileList = exports.FileList = function FileList(props) {\n var files = props.files,\n fields = props.fields,\n sort = props.sort,\n title = props.title,\n linkFiles = props.linkFiles,\n onClick = props.onClick,\n onDelete = props.onDelete,\n _props$orderBy = props.orderBy,\n orderBy = _props$orderBy === undefined ? 'name asc' : _props$orderBy,\n _props$className = props.className,\n className = _props$className === undefined ? '' : _props$className,\n _props$fileListClassN = props.fileListClassName,\n fileListClassName = _props$fileListClassN === undefined ? 'filelist' : _props$fileListClassN,\n _props$rowClassName = props.rowClassName,\n rowClassName = _props$rowClassName === undefined ? 'row file' : _props$rowClassName;\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn(orderBy),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var fileList = (files || []).filter(function (f) {\n return !!f;\n }).map(mapFn).sort(sortFn).map(function (pair) {\n return (0, _preact.h)(FileRow, {\n file: pair[1],\n fields: fieldSet(fields),\n className: rowClassName,\n linkFiles: linkFiles,\n onDelete: onDelete,\n onClick: onClick\n });\n });\n if (!fileList || !fileList.length) {\n return (0, _preact.h)(\n 'div',\n { className: 'rows ' + className },\n (0, _preact.h)(\n 'div',\n { 'class': 'row heading' },\n (0, _preact.h)(\n 'h4',\n { 'class': 'noFiles' },\n 'No files'\n )\n )\n );\n }\n // console.log(files)\n return (0, _preact.h)(\n 'div',\n { className: 'rows ' + className },\n title && (0, _preact.h)(\n 'div',\n { 'class': 'row heading' },\n (0, _preact.h)(\n 'h3',\n null,\n title\n ),\n '}'\n ),\n (0, _preact.h)(\n 'div',\n { className: 'rows ' + fileListClassName },\n fileList\n )\n );\n};\n\nvar FileRow = exports.FileRow = function FileRow(props) {\n var file = props.file,\n linkFiles = props.linkFiles,\n onDelete = props.onDelete,\n _onClick = props.onClick,\n _props$className2 = props.className,\n className = _props$className2 === undefined ? 'row file' : _props$className2,\n _props$username = props.username,\n username = _props$username === undefined ? '' : _props$username;\n\n var fields = fieldSet(props.fields);\n\n var size = _util2.default.hush_size(file.size);\n var date = file.date || file.created_at;\n var epoch = file.epoch || file.epochs || 0;\n var count = file.count || 0;\n\n var name = void 0;\n var key = void 0;\n if (file.name) {\n name = file.name;\n key = name;\n } else if (file.url) {\n if (file.opt && file.opt.type) {\n name = file.opt.type + ': ' + file.opt.title;\n key = file.opt.token;\n } else {\n name = file.url.replace(/^https?:\\/\\//, '');\n key = name;\n }\n }\n\n return (0, _preact.h)(\n 'div',\n { 'class': className, key: key },\n fields.has('name') && (0, _preact.h)(\n 'div',\n { className: 'filename', title: file.name || file.url },\n file.persisted === false ? (0, _preact.h)(\n 'span',\n { className: 'unpersisted' },\n name\n ) : linkFiles && file.url ? (0, _preact.h)(\n 'a',\n { target: '_blank', onClick: function onClick(e) {\n if (!(e.metaKey || e.ctrlKey || e.altKey) && _onClick) {\n e.preventDefault();_onClick && _onClick(file, e);\n }\n }, href: file.url },\n name\n ) : (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick(e) {\n return _onClick && _onClick(file, e);\n } },\n name\n )\n ),\n fields.has('age') && (0, _preact.h)(\n 'div',\n { className: \"age \" + _util2.default.carbon_date(date) },\n _util2.default.get_age(date)\n ),\n fields.has('username') && (0, _preact.h)(\n 'div',\n { className: \"username\" },\n username\n ),\n fields.has('epoch') && (0, _preact.h)(\n 'div',\n { className: \"epoch \" + _util2.default.hush_null(epoch)[0] },\n epoch > 0 ? 'ep. ' + epoch : ''\n ),\n fields.has('date') && (0, _preact.h)(\n 'div',\n { className: \"date \" + _util2.default.carbon_date(date) },\n (0, _moment2.default)(date).format(\"YYYY-MM-DD\")\n ),\n fields.has('datetime') && (0, _preact.h)(\n 'div',\n { className: \"datetime \" + _util2.default.carbon_date(date) },\n (0, _moment2.default)(date).format(\"YYYY-MM-DD h:mm a\")\n ),\n fields.has('size') && (0, _preact.h)(\n 'div',\n { className: \"size \" + size[0] },\n size[1]\n ),\n fields.has('count') && (0, _preact.h)(\n 'div',\n { className: \"count \" + _util2.default.hush_null(count)[0] },\n count > 0 ? count + ' files' : ''\n ),\n (fields.has('activity') || fields.has('module')) && (0, _preact.h)(\n 'div',\n { className: 'activity' },\n fields.has('activity') && file.activity,\n fields.has('module') && file.module\n ),\n fields.has('delete') && onDelete && file.id && (0, _preact.h)(\n 'div',\n { className: 'destroy', onClick: function onClick(e) {\n return onDelete(file);\n } },\n 'x'\n ),\n props.options && props.options(file)\n );\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar FileUpload = function (_Component) {\n _inherits(FileUpload, _Component);\n\n function FileUpload(props) {\n _classCallCheck(this, FileUpload);\n\n var _this = _possibleConstructorReturn(this, (FileUpload.__proto__ || Object.getPrototypeOf(FileUpload)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(FileUpload, [{\n key: 'handleChange',\n value: function handleChange(e) {\n this.props.onChange && this.props.onChange();\n e.stopPropagation();\n e.preventDefault();\n this.setState({ thumbnails: [], images: [] });\n var files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n var i = void 0,\n f = void 0;\n for (i = 0, f; i < files.length; i++) {\n f = files[i];\n if (!f) continue;\n break;\n // if (!f.type.match(this.props.mime)) continue\n }\n this.props.onUpload && this.props.onUpload(f);\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'fileUpload param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: 'file',\n accept: this.props.accept || '*/*',\n multiple: this.props.multiple,\n onChange: this.handleChange\n }),\n (0, _preact.h)(\n 'button',\n null,\n this.props.label || 'Choose file...'\n )\n )\n );\n }\n }]);\n\n return FileUpload;\n}(_preact.Component);\n\nexports.default = FileUpload;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.default = FolderList;\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _group = require('./group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('./param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _loading = require('./loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction FolderList(_ref) {\n var db = _ref.db,\n path = _ref.path,\n emptyText = _ref.emptyText,\n activity = _ref.activity;\n\n if (!db) return null;\n if (db.loading || !db.data) {\n return (0, _preact.h)(\n 'div',\n { 'class': 'col folderList' },\n (0, _preact.h)(_loading2.default, { progress: db.progress })\n );\n }\n var folderList = db.data.folders;\n if (activity) {\n folderList = folderList.filter(function (f) {\n return f.activity === activity;\n });\n }\n if (!folderList.length && emptyText) {\n return (0, _preact.h)(\n 'div',\n { 'class': 'col folderList' },\n emptyText\n );\n }\n console.log(folders);\n var folders = folderList.map(function (raw_folder) {\n var folder = db.data.folderLookup[raw_folder.id];\n var fileCount = folder.files ? folder.files.length : 0;\n\n var _util$hush_null = _util2.default.hush_null(fileCount),\n _util$hush_null2 = _slicedToArray(_util$hush_null, 2),\n className = _util$hush_null2[0],\n size = _util$hush_null2[1];\n\n return (0, _preact.h)(\n _param2.default,\n { title: (0, _preact.h)(\n _reactRouterDom.Link,\n { to: path + folder.id + '/' },\n folder.name\n ) },\n (0, _preact.h)(\n 'span',\n { className: className },\n fileCount,\n ' file',\n _util2.default.courtesy_s(fileCount)\n )\n );\n });\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'col folderList' },\n (0, _preact.h)(\n _group2.default,\n { title: 'Projects' },\n folders\n )\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\t\tvalue: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Gallery = function (_Component) {\n\t\t_inherits(Gallery, _Component);\n\n\t\tfunction Gallery(props) {\n\t\t\t\t_classCallCheck(this, Gallery);\n\n\t\t\t\treturn _possibleConstructorReturn(this, (Gallery.__proto__ || Object.getPrototypeOf(Gallery)).call(this));\n\t\t}\n\n\t\t_createClass(Gallery, [{\n\t\t\t\tkey: 'render',\n\t\t\t\tvalue: function render() {\n\t\t\t\t\t\tvar _props = this.props,\n\t\t\t\t\t\t title = _props.title,\n\t\t\t\t\t\t images = _props.images;\n\n\t\t\t\t\t\tvar imageList = images.map(function (image) {\n\t\t\t\t\t\t\t\treturn (0, _preact.h)(\n\t\t\t\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t(0, _preact.h)('img', { src: image.url })\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn (0, _preact.h)(\n\t\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t\t{ 'class': 'gallery' },\n\t\t\t\t\t\t\t\timageList\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t}]);\n\n\t\treturn Gallery;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n\t\treturn {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n\t\treturn {\n\t\t\t\t// actions: bindActionCreators(liveActions, dispatch)\n\t\t};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Gallery);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Group;\n\nvar _preact = require('preact');\n\nfunction Group(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'group' },\n this.props.title && (0, _preact.h)(\n 'h3',\n null,\n this.props.title\n ),\n this.props.children\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _system = require('../system/system.actions');\n\nvar systemActions = _interopRequireWildcard(_system);\n\nvar _modules = require('../modules');\n\nvar _modules2 = _interopRequireDefault(_modules);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\nfunction NavLink(props) {\n if (!props.to) {\n return (0, _preact.h)(\n 'span',\n null,\n props.children\n );\n }\n var children = props.to === props.location.pathname ? (0, _preact.h)(\n 'b',\n null,\n props.children\n ) : props.children;\n return (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: props.to },\n children\n )\n );\n}\n\nfunction Header(props) {\n var site = props.site,\n app = props.app,\n fps = props.fps,\n playing = props.playing,\n actions = props.actions,\n location = props.location,\n history = props.history;\n\n var tool_list = Object.keys(_modules2.default).map(function (name, i) {\n var label = name.replace(/_/, \" \");\n return (0, _preact.h)(\n 'option',\n { value: name, key: i },\n label\n );\n });\n var tool = _modules2.default[app.tool];\n var links = tool.links().map(function (link, i) {\n return (0, _preact.h)(\n NavLink,\n { key: i, location: location, to: link.url },\n link.name\n );\n });\n return (0, _preact.h)(\n 'header',\n null,\n (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)(\n 'b',\n null,\n site.name,\n ' cortex'\n )\n ),\n (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)(\n 'select',\n { onChange: function onChange(e) {\n var path = window.location.pathname.split(\"/\");\n path.shift();\n console.log(path);\n if (path[0] in _modules2.default && path[1]) {\n history.push('/' + e.target.value + '/' + path[1] + '/');\n }\n actions.changeTool(e.target.value, true);\n }, value: app.tool },\n tool_list\n )\n ),\n (0, _preact.h)(\n NavLink,\n { location: location, to: '/system' },\n 'system'\n ),\n (0, _preact.h)(\n NavLink,\n { location: location, to: '/dashboard' },\n 'dashboard'\n ),\n (0, _preact.h)(\n 'span',\n null,\n links\n ),\n playing && (0, _preact.h)(\n 'span',\n null,\n fps,\n ' fps'\n )\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n site: state.system.site,\n app: state.system.app,\n fps: state.live.fps,\n playing: state.live.playing\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(systemActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Header);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AugmentationGrid = exports.ButtonGrid = exports.TaskList = exports.CurrentTask = exports.Checkbox = exports.Button = exports.SelectGroup = exports.Select = exports.Slider = exports.NumberInput = exports.TextInput = exports.Param = exports.ParamGroup = exports.Group = exports.Player = exports.Gallery = exports.FileUpload = exports.FileRow = exports.FileList = exports.FolderList = exports.Header = exports.Progress = exports.Loading = exports.Views = undefined;\n\nvar _augmentationGrid = require('./augmentationGrid.component');\n\nvar _augmentationGrid2 = _interopRequireDefault(_augmentationGrid);\n\nvar _button = require('./button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _buttonGrid = require('./buttonGrid.component');\n\nvar _buttonGrid2 = _interopRequireDefault(_buttonGrid);\n\nvar _checkbox = require('./checkbox.component');\n\nvar _checkbox2 = _interopRequireDefault(_checkbox);\n\nvar _currentTask = require('./currentTask.component');\n\nvar _currentTask2 = _interopRequireDefault(_currentTask);\n\nvar _fileList = require('./fileList.component');\n\nvar _fileUpload = require('./fileUpload.component');\n\nvar _fileUpload2 = _interopRequireDefault(_fileUpload);\n\nvar _folderList = require('./folderList.component');\n\nvar _folderList2 = _interopRequireDefault(_folderList);\n\nvar _gallery = require('./gallery.component');\n\nvar _gallery2 = _interopRequireDefault(_gallery);\n\nvar _group = require('./group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _header = require('./header.component');\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _loading = require('./loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _numberInput = require('./numberInput.component');\n\nvar _numberInput2 = _interopRequireDefault(_numberInput);\n\nvar _param = require('./param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _paramGroup = require('./paramGroup.component');\n\nvar _paramGroup2 = _interopRequireDefault(_paramGroup);\n\nvar _player = require('./player.component');\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _progress = require('./progress.component');\n\nvar _progress2 = _interopRequireDefault(_progress);\n\nvar _select = require('./select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _selectGroup = require('./selectGroup.component');\n\nvar _selectGroup2 = _interopRequireDefault(_selectGroup);\n\nvar _slider = require('./slider.component');\n\nvar _slider2 = _interopRequireDefault(_slider);\n\nvar _textInput = require('./textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nvar _taskList = require('./taskList.component');\n\nvar _taskList2 = _interopRequireDefault(_taskList);\n\nvar _views = require('./views');\n\nvar Views = _interopRequireWildcard(_views);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.Views = Views;\nexports.Loading = _loading2.default;\nexports.Progress = _progress2.default;\nexports.Header = _header2.default;\nexports.FolderList = _folderList2.default;\nexports.FileList = _fileList.FileList;\nexports.FileRow = _fileList.FileRow;\nexports.FileUpload = _fileUpload2.default;\nexports.Gallery = _gallery2.default;\nexports.Player = _player2.default;\nexports.Group = _group2.default;\nexports.ParamGroup = _paramGroup2.default;\nexports.Param = _param2.default;\nexports.TextInput = _textInput2.default;\nexports.NumberInput = _numberInput2.default;\nexports.Slider = _slider2.default;\nexports.Select = _select2.default;\nexports.SelectGroup = _selectGroup2.default;\nexports.Button = _button2.default;\nexports.Checkbox = _checkbox2.default;\nexports.CurrentTask = _currentTask2.default;\nexports.TaskList = _taskList2.default;\nexports.ButtonGrid = _buttonGrid2.default;\nexports.AugmentationGrid = _augmentationGrid2.default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Loading;\n\nvar _preact = require('preact');\n\nvar _progress = require('./progress.component');\n\nvar _progress2 = _interopRequireDefault(_progress);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Loading(_ref) {\n var progress = _ref.progress;\n\n return (0, _preact.h)(\n 'div',\n { className: 'loading' },\n 'Loading',\n (0, _preact.h)('br', null),\n progress && (0, _preact.h)(_progress2.default, { progress: progress })\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar NumberInput = function (_Component) {\n _inherits(NumberInput, _Component);\n\n function NumberInput(props) {\n _classCallCheck(this, NumberInput);\n\n var _this = _possibleConstructorReturn(this, (NumberInput.__proto__ || Object.getPrototypeOf(NumberInput)).call(this, props));\n\n _this.state = { value: null, changed: false };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(NumberInput, [{\n key: 'handleInput',\n value: function handleInput(e) {\n this.setState({\n value: e.target.value,\n changed: true\n });\n this.props.onInput && this.props.onInput(e.target.value, e.target.name);\n this.props.onChange && this.props.onChange(e.target.name, e.target.value);\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n if (e.keyCode === 13) {\n this.setState({\n value: e.target.value,\n changed: false\n });\n this.props.onSave && this.props.onSave(e.target.value, e.target.name);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'numberInput param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: 'number',\n name: this.props.name || 'number',\n value: this.state.changed ? this.state.value : this.props.value,\n onInput: this.handleInput,\n onKeydown: this.handleKeydown,\n placeholder: this.props.placeholder,\n autofocus: this.props.autofocus,\n min: this.props.min,\n max: this.props.max,\n step: this.props.step || this.props.type === 'int' ? 1 : 0.01\n })\n )\n );\n }\n }]);\n\n return NumberInput;\n}(_preact.Component);\n\nexports.default = NumberInput;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Param = function (_Component) {\n _inherits(Param, _Component);\n\n function Param(props) {\n _classCallCheck(this, Param);\n\n return _possibleConstructorReturn(this, (Param.__proto__ || Object.getPrototypeOf(Param)).call(this, props));\n }\n\n _createClass(Param, [{\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'button param' },\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'span',\n null,\n this.props.children\n )\n );\n }\n }]);\n\n return Param;\n}(_preact.Component);\n\nexports.default = Param;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar ParamGroup = function (_Component) {\n _inherits(ParamGroup, _Component);\n\n function ParamGroup(props) {\n _classCallCheck(this, ParamGroup);\n\n var _this = _possibleConstructorReturn(this, (ParamGroup.__proto__ || Object.getPrototypeOf(ParamGroup)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(ParamGroup, [{\n key: 'handleClick',\n value: function handleClick(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.checked;\n this.props.actions.set_param(this.props.name, new_value);\n this.props.onToggle && this.props.onToggle(new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var checked = this.props.opt[this.props.name];\n var toggle = !this.props.noToggle;\n var dim = !this.props.noDim;\n var className = !dim || !toggle || checked ? 'paramGroup active' : 'paramGroup inactive';\n return (0, _preact.h)(\n 'div',\n { className: className },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'h3',\n null,\n this.props.title\n ),\n toggle ? (0, _preact.h)('input', {\n type: 'checkbox',\n onClick: this.handleClick,\n checked: checked\n }) : null\n ),\n this.props.children\n );\n }\n }]);\n\n return ParamGroup;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n opt: state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ParamGroup);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nfunction Player(props) {\n var className = props.fullscreen ? 'player fullscreen' : 'player';\n return (0, _preact.h)(\n 'div',\n { className: className },\n (0, _preact.h)('canvas', { width: props.width, height: props.height })\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Player);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Progress;\n\nvar _preact = require('preact');\n\nfunction Progress(_ref) {\n var progress = _ref.progress;\n\n if (!progress) return;\n var i = progress.i,\n n = progress.n;\n\n var a = [];\n for (var j = 0; j < n; j++) {\n a.push((0, _preact.h)('div', { key: j, className: j < i ? 'x' : 'o' }));\n }\n return (0, _preact.h)(\n 'div',\n { className: 'progress' },\n a\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Select = function (_Component) {\n _inherits(Select, _Component);\n\n function Select(props) {\n _classCallCheck(this, Select);\n\n var _this = _possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(Select, [{\n key: 'handleChange',\n value: function handleChange(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.value;\n if (new_value === 'PLACEHOLDER') return;\n this.props.onChange && this.props.onChange(this.props.name, new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var currentValue = this.props.live ? this.props.opt[this.props.name] : this.props.value;\n var lastValue = void 0;\n var options = (this.props.options || []).map(function (key, i) {\n var name = void 0,\n value = void 0;\n if (typeof key === 'string') {\n name = key.length < 2 ? key.toUpperCase() : key;\n value = key;\n } else if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object') {\n if (key.length) {\n var _key = _slicedToArray(key, 2);\n\n name = _key[0];\n value = _key[1];\n } else if (key.count) {\n var frames = Math.round(key.count / 30) + ' s.';\n name = key.name.replace(/_/g, ' ') + ' (' + frames + ')';\n value = key.name;\n } else {\n name = key.name;\n value = key.value || key.name;\n }\n }\n lastValue = value;\n return (0, _preact.h)(\n 'option',\n { value: value, key: i },\n name\n );\n });\n return (0, _preact.h)(\n 'div',\n { className: 'select param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'select',\n {\n onChange: this.handleChange,\n value: currentValue || lastValue\n },\n this.props.placeholder && (0, _preact.h)(\n 'option',\n { value: 'PLACEHOLDER' },\n this.props.placeholder\n ),\n options\n )\n ),\n this.props.children\n );\n }\n }]);\n\n return Select;\n}(_preact.Component);\n\nfunction capitalize(s) {\n return (s || \"\").replace(/(?:^|\\s)\\S/g, function (a) {\n return a.toUpperCase();\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state, props) {\n return {\n opt: props.opt || state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Select);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SelectGroup = function (_Component) {\n _inherits(SelectGroup, _Component);\n\n function SelectGroup(props) {\n _classCallCheck(this, SelectGroup);\n\n var _this = _possibleConstructorReturn(this, (SelectGroup.__proto__ || Object.getPrototypeOf(SelectGroup)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(SelectGroup, [{\n key: 'handleChange',\n value: function handleChange(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.value;\n if (new_value === 'PLACEHOLDER') return;\n this.props.onChange && this.props.onChange(this.props.name, new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var currentValue = this.props.live ? this.props.opt[this.props.name] : this.props.value;\n var lastValue = void 0;\n var options = (this.props.options || []).map(function (group, i) {\n var groupName = group.name;\n var children = group.options.map(function (key) {\n var name = key.length < 2 ? key.toUpperCase() : key;\n name = name.replace(/_/g, ' ');\n var value = key;\n lastValue = value;\n return (0, _preact.h)(\n 'option',\n { value: value, key: value },\n name\n );\n });\n return (0, _preact.h)(\n 'optgroup',\n { label: groupName, key: groupName },\n children\n );\n });\n return (0, _preact.h)(\n 'div',\n { className: 'select param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'select',\n {\n onChange: this.handleChange,\n value: currentValue || lastValue\n },\n this.props.placeholder && (0, _preact.h)(\n 'option',\n { value: 'PLACEHOLDER' },\n this.props.placeholder\n ),\n options\n )\n ),\n this.props.children\n );\n }\n }]);\n\n return SelectGroup;\n}(_preact.Component);\n\nfunction capitalize(s) {\n return (s || \"\").replace(/(?:^|\\s)\\S/g, function (a) {\n return a.toUpperCase();\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state, props) {\n return {\n opt: props.opt || state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SelectGroup);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SLIDER_THROTTLE_TIME = 100;\n\nvar Slider = function (_Component) {\n _inherits(Slider, _Component);\n\n function Slider(props) {\n _classCallCheck(this, Slider);\n\n var _this = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, props));\n\n _this.timeout = 0;\n _this.state = {\n value: props.live ? props.opt[props.name] : props.value\n };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleRange = _this.handleRange.bind(_this);\n return _this;\n }\n\n _createClass(Slider, [{\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n var next_value = nextProps.value || nextProps.opt[nextProps.name];\n if (next_value !== this.state.value) {\n this.setState({ value: next_value });\n }\n }\n }, {\n key: 'handleInput',\n value: function handleInput(e) {\n var _props = this.props,\n name = _props.name,\n opt = _props.opt;\n\n var old_value = opt[name];\n var new_value = e.target.value;\n if (new_value === '') {\n new_value = this.props.defaultValue || (this.props.max - this.props.min) / 2;\n } else if (this.props.type === 'int') {\n new_value = parseInt(new_value);\n } else if (this.props.type === 'odd') {\n new_value = parseInt(Math.floor(new_value / 2) * 2 + 1);\n }\n if (old_value !== new_value) {\n this.setState({ value: new_value });\n this.props.live && this.props.actions.set_param(this.props.name, new_value);\n this.props.onChange && this.props.onChange(new_value);\n }\n clearTimeout(this.timeout);\n }\n }, {\n key: 'handleRange',\n value: function handleRange(e) {\n var _this2 = this;\n\n clearTimeout(this.timeout);\n var new_value = e.target.value;\n if (this.props.type === 'int') {\n new_value = parseInt(new_value);\n }\n if (this.props.type === 'odd') {\n new_value = parseInt(Math.floor(new_value / 2) * 2 + 1);\n }\n if (this.props.type === 'list') {\n new_value = this.props.options[new_value] || this.props.options[0];\n }\n this.setState({ value: new_value });\n this.timeout = setTimeout(function () {\n _this2.props.live && _this2.props.actions.set_param(_this2.props.name, new_value);\n _this2.props.onChange && _this2.props.onChange(new_value);\n }, SLIDER_THROTTLE_TIME);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n name = _props2.name,\n title = _props2.title;\n\n var value = this.state.value;\n if (typeof value === 'undefined') {\n value = this.props.min;\n }\n var text_value = value;\n var step = void 0;\n var min = this.props.min || 0;\n var max = this.props.max || 0;\n if (this.props.type === 'int') {\n step = 1;\n } else if (this.props.type === 'list') {\n min = 0;\n max = this.props.options.length - 1;\n step = 1;\n value = this.props.options.indexOf(value);\n } else {\n step = (this.props.max - this.props.min) / 100;\n text_value = parseFloat(value).toFixed(2);\n }\n return (0, _preact.h)(\n 'div',\n { 'class': 'slider param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n title || name.replace(/_/g, ' ')\n ),\n (0, _preact.h)('input', { type: 'text', value: text_value, onBlur: this.handleInput })\n ),\n (0, _preact.h)('input', {\n type: 'range',\n min: min,\n max: max,\n step: step,\n value: value,\n onInput: this.handleRange\n })\n );\n }\n }]);\n\n return Slider;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n opt: state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Slider);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar TaskList = function (_Component) {\n _inherits(TaskList, _Component);\n\n function TaskList(props) {\n _classCallCheck(this, TaskList);\n\n return _possibleConstructorReturn(this, (TaskList.__proto__ || Object.getPrototypeOf(TaskList)).call(this));\n }\n\n _createClass(TaskList, [{\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate(nextProps) {\n if (nextProps.tasks.length !== this.props.tasks.length) {\n return true;\n }\n if (nextProps.tasks[0] !== this.props.tasks[0]) {\n return true;\n }\n return false;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n title = _props.title,\n tasks = _props.tasks;\n\n var time = 0;\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn(this.props.sort || 'date desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var taskList = tasks.map(mapFn).sort(sortFn).map(function (pair) {\n var task = pair[1];\n var dataset = task.dataset;\n\n var dataset_link = void 0,\n label = dataset;\n // console.log(task)\n switch (task.activity) {\n case 'train':\n if (task.epoch === 0) {\n label += ', latest';\n } else {\n label += ', ' + task.epoch;\n }\n label += ' + ' + task.epochs;\n break;\n case 'augment':\n try {\n var opt = JSON.parse(task.opt);\n label += ', ' + opt.augment_take + ' x ' + opt.augment_make;\n } catch (e) {\n //\n }\n default:\n break;\n }\n if (task.folder_id) {\n var href = '/' + task.module + '/' + (task.module === 'samplernn' ? 'datasets' : 'sequences') + '/' + task.folder_id + '/';\n dataset_link = (0, _preact.h)(\n _reactRouterDom.Link,\n { to: href },\n label\n );\n } else {\n dataset_link = label;\n }\n return (0, _preact.h)(\n 'div',\n { 'class': 'row' },\n (0, _preact.h)(\n 'div',\n { 'class': 'activity' },\n task.activity,\n ' ',\n task.module\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'dataset' },\n dataset_link\n ),\n (0, _preact.h)(\n 'div',\n { className: \"age \" + _util2.default.carbon_date(task.updated_at) },\n _util2.default.get_age(task.updated_at)\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'options' },\n (0, _preact.h)(\n 'span',\n { 'class': 'destroy', onClick: function onClick() {\n return _this2.handleDestroy(task);\n } },\n 'x'\n )\n )\n );\n });\n return (0, _preact.h)(\n 'div',\n { 'class': 'tasklist rows' },\n taskList\n );\n }\n }, {\n key: 'handleDestroy',\n value: function handleDestroy(task) {\n var yes = confirm('Are you sure you want to delete this task?');\n if (yes) {\n _actions2.default.task.destroy(task);\n }\n }\n }]);\n\n return TaskList;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n // actions: bindActionCreators(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(TaskList);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar TextInput = function (_Component) {\n _inherits(TextInput, _Component);\n\n function TextInput(props) {\n _classCallCheck(this, TextInput);\n\n var _this = _possibleConstructorReturn(this, (TextInput.__proto__ || Object.getPrototypeOf(TextInput)).call(this, props));\n\n _this.state = { value: null, changed: false };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(TextInput, [{\n key: 'handleInput',\n value: function handleInput(e) {\n this.setState({\n value: e.target.value,\n changed: true\n });\n this.props.onInput && this.props.onInput(e.target.value, e.target.name);\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n if (e.keyCode === 13) {\n this.setState({\n value: e.target.value,\n changed: false\n });\n this.props.onSave && this.props.onSave(e.target.value, e.target.name);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'textInput param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: this.props.type || 'text',\n name: this.props.name || 'text',\n value: this.state.changed ? this.state.value : this.props.value,\n onInput: this.handleInput,\n onKeydown: this.handleKeydown,\n placeholder: this.props.placeholder,\n autofocus: this.props.autofocus,\n className: this.props.className || ''\n })\n )\n );\n }\n }]);\n\n return TextInput;\n}(_preact.Component);\n\nexports.default = TextInput;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.New = undefined;\n\nvar _newView = require('./new.view.js');\n\nvar _newView2 = _interopRequireDefault(_newView);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar New = exports.New = _newView2.default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _group = require('../group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('../param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _loading = require('../loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _folderList = require('../folderList.component');\n\nvar _folderList2 = _interopRequireDefault(_folderList);\n\nvar _dataset = require('../../dataset/dataset.new');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar NewView = function (_Component) {\n _inherits(NewView, _Component);\n\n function NewView(props) {\n _classCallCheck(this, NewView);\n\n var _this = _possibleConstructorReturn(this, (NewView.__proto__ || Object.getPrototypeOf(NewView)).call(this, props));\n\n console.log(props);\n if (!props.db.data) {\n props.actions.load_directories();\n }\n return _this;\n }\n\n _createClass(NewView, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n module = _props.module,\n history = _props.history,\n db = _props.db,\n path = _props.path;\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'app new-view ' + module.name },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n module.displayName || module.name\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'col narrow' },\n (0, _preact.h)(_dataset2.default, {\n module: module,\n history: history\n }),\n (0, _preact.h)(_folderList2.default, {\n db: db,\n path: path,\n activity: 'dataset',\n emptyText: (0, _preact.h)(\n 'i',\n null,\n 'No projects yet. Please create one~'\n )\n })\n )\n );\n }\n }]);\n\n return NewView;\n}(_preact.Component);\n\nexports.default = NewView;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load = exports.load = function load() {\n return function (dispatch) {\n _util2.default.allProgress([_actions2.default.task.index({ limit: 40, orderBy: 'created_at desc' }), _actions2.default.folder.index({ activity: 'dataset' }), _actions2.default.file.index({ module: 'samplernn', generated: 1, limit: 15, orderBy: 'created_at desc' }), _actions2.default.file.index({ module: 'pix2pixhd', generated: 1, limit: 15, orderBy: 'created_at desc' }), _actions2.default.file.index({ module: 'morph', generated: 1, limit: 15, orderBy: 'created_at desc' })], function (percent, i, n) {\n // console.log('dashboard load progress', i, n)\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'dashboard' }\n });\n }).then(function (res) {\n var _res = _slicedToArray(res, 5),\n tasks = _res[0],\n folders = _res[1],\n samplernn = _res[2],\n pix2pixhd = _res[3],\n morph = _res[4];\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn('date desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var foldersByModule = folders.map(mapFn).sort(sortFn).reduce(function (a, b) {\n var module = b[1].module;\n a[module] = a[module] || [];\n a[module].push(b[1]);\n return a;\n }, {});\n dispatch({\n type: _types2.default.dashboard.load,\n data: {\n tasks: tasks,\n folders: folders,\n foldersByModule: foldersByModule,\n renders: {\n samplernn: samplernn,\n pix2pixhd: pix2pixhd,\n morph: morph\n }\n }\n });\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _player = require('../common/player.component');\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _group = require('../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _slider = require('../common/slider.component');\n\nvar _slider2 = _interopRequireDefault(_slider);\n\nvar _select = require('../common/select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _button = require('../common/button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _dashboardheader = require('./dashboardheader.component');\n\nvar _dashboardheader2 = _interopRequireDefault(_dashboardheader);\n\nvar _common = require('../common');\n\nvar _dashboard = require('./dashboard.actions');\n\nvar dashboardActions = _interopRequireWildcard(_dashboard);\n\nvar _audioPlayer = require('../common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _modules = require('../modules');\n\nvar _modules2 = _interopRequireDefault(_modules);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Dashboard = function (_Component) {\n _inherits(Dashboard, _Component);\n\n function Dashboard(props) {\n _classCallCheck(this, Dashboard);\n\n // console.log(props)\n var _this = _possibleConstructorReturn(this, (Dashboard.__proto__ || Object.getPrototypeOf(Dashboard)).call(this));\n\n props.actions.load();\n return _this;\n }\n\n _createClass(Dashboard, [{\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n // if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n // this.props.actions.list_epochs(nextProps.opt.checkpoint_name)\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n loading = _props.loading,\n progress = _props.progress,\n site = _props.site,\n foldersByModule = _props.foldersByModule,\n renders = _props.renders,\n queue = _props.queue,\n images = _props.images;\n\n if (loading) {\n return (0, _preact.h)(_common.Loading, { progress: progress });\n }\n var tasks = queue.tasks;\n\n var folders = foldersByModule && Object.keys(_modules2.default).sort().map(function (key) {\n var path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/';\n var folder_list = (foldersByModule[key] || []).map(function (folder) {\n return (0, _preact.h)(\n 'div',\n { key: folder.id },\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: path + folder.id + '/' },\n folder.name\n )\n );\n });\n\n var files = renders[key] && (0, _preact.h)(_common.FileList, {\n linkFiles: true,\n files: renders[key],\n orderBy: 'date desc',\n fields: 'name date epoch size',\n onClick: key === 'samplernn' ? function (file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n _this2.handlePick(file);\n } : null\n });\n\n return (0, _preact.h)(\n 'div',\n { className: 'dashboardModule', key: key },\n (0, _preact.h)(\n 'div',\n { className: 'row moduleHeading' },\n (0, _preact.h)(\n 'h3',\n null,\n key\n ),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: '/' + key + '/new/' },\n 'new'\n )\n ),\n folder_list\n ),\n files\n );\n }).filter(function (a) {\n return !!a;\n });\n return (0, _preact.h)(\n 'div',\n { className: 'app dashboard' },\n (0, _preact.h)(_dashboardheader2.default, null),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n !!queue.queue.length && (0, _preact.h)(\n _group2.default,\n { title: 'Upcoming Tasks' },\n (0, _preact.h)(_common.TaskList, { tasks: queue.queue.map(function (id) {\n return tasks[id];\n }) })\n ),\n !!queue.completed.length && (0, _preact.h)(\n _group2.default,\n { title: 'Completed Tasks' },\n (0, _preact.h)(_common.TaskList, { tasks: queue.completed.map(function (id) {\n return tasks[id];\n }) })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n folders\n )\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n this.props.audioPlayer.play(file);\n }\n }]);\n\n return Dashboard;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n loading: state.dashboard.loading,\n progress: state.dashboard.progress,\n site: state.system.site,\n foldersByModule: state.dashboard.data.foldersByModule,\n renders: state.dashboard.data.renders,\n images: state.dashboard.images,\n files: state.dashboard.files,\n queue: state.queue\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(dashboardActions, dispatch),\n audioPlayer: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Dashboard);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar FileSaver = require('file-saver');\n\nvar dashboardInitialState = {\n loading: false,\n progress: null,\n error: null,\n data: {},\n images: [],\n files: []\n};\n\nvar dashboardReducer = function dashboardReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : dashboardInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.app.load_progress:\n if (!action.data || action.data.module !== 'dashboard') {\n return state;\n }\n return _extends({}, state, {\n loading: true,\n progress: action.progress\n });\n case _types2.default.dashboard.load:\n return _extends({}, state, {\n loading: false,\n error: null,\n data: action.data\n });\n default:\n return state;\n }\n};\n\nexports.default = dashboardReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar DashboardHeader = function (_Component) {\n _inherits(DashboardHeader, _Component);\n\n function DashboardHeader(props) {\n _classCallCheck(this, DashboardHeader);\n\n var _this = _possibleConstructorReturn(this, (DashboardHeader.__proto__ || Object.getPrototypeOf(DashboardHeader)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(DashboardHeader, [{\n key: 'handleClick',\n value: function handleClick(e) {\n this.props.onClick && this.props.onClick();\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n site = _props.site,\n runner = _props.runner;\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'dashboardHeader heading' },\n (0, _preact.h)(\n 'h1',\n null,\n site.name,\n ' cortex'\n ),\n this.renderStatus(\"GPU\", runner.gpu),\n this.renderStatus(\"CPU\", runner.cpu)\n );\n }\n }, {\n key: 'renderStatus',\n value: function renderStatus(name, gpu) {\n if (gpu.status === 'IDLE') {\n return (0, _preact.h)(\n 'div',\n null,\n name,\n ' idle'\n );\n }\n var task = gpu.task;\n var activityPhrase = void 0,\n liveMessage = void 0;\n if (task.activity === 'live') {\n return (0, _preact.h)(\n 'div',\n null,\n name,\n ' running ',\n (0, _preact.h)(\n 'b',\n null,\n task.module\n ),\n ' live on \"',\n task.dataset,\n '\"'\n );\n } else {\n return (0, _preact.h)(\n 'div',\n null,\n name,\n ' ',\n _util2.default.gerund(task.activity),\n ' ',\n (0, _preact.h)(\n 'b',\n null,\n task.module\n ),\n ' on ',\n (0, _preact.h)(\n 'b',\n null,\n task.dataset\n ),\n !!task.epoch && (0, _preact.h)(\n 'span',\n null,\n 'Epoch: ',\n task.epoch,\n ' / ',\n task.epochs,\n (0, _preact.h)('br', null)\n )\n );\n }\n }\n }]);\n\n return DashboardHeader;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n runner: state.system.runner,\n site: state.system.site\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(DashboardHeader);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uploadFiles = exports.fetchURL = exports.uploadFile = exports.updateFolder = exports.createFolder = undefined;\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _api = require('../api');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createFolder = exports.createFolder = function createFolder(module, name) {\n return function (dispatch) {\n return _actions2.default.folder.create({\n // username... should get added inside the API\n module: module.name,\n datatype: module.datatype,\n activity: 'dataset',\n name: name\n });\n };\n}; // import socket from '../socket'\nvar updateFolder = exports.updateFolder = function updateFolder(module, folder, name) {\n var opt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return function (dispatch) {\n if (!folder || !folder.id) {\n return null;\n }\n return _actions2.default.folder.update({\n id: folder.id,\n module: module.name,\n datatype: module.datatype,\n activity: 'dataset',\n name: name,\n opt: opt\n });\n };\n};\n\nvar uploadFile = exports.uploadFile = function uploadFile(module, folder, file, filename, opt) {\n return function (dispatch) {\n var fd = new FormData();\n fd.append('file', file, filename);\n _actions2.default.folder.upload(fd, {\n id: folder.id,\n module: module.name,\n activity: 'file',\n epoch: 0,\n processed: false,\n generated: false,\n opt: opt\n });\n };\n};\n\nvar fetchURL = exports.fetchURL = function fetchURL(module, folder, url) {\n return function (dispatch) {\n // name url\n // mime datatype\n // duration analysis\n // size activity\n // opt created_at updated_at\n console.log(module, folder, url);\n var seenURL = folder.files.some(function (file) {\n return file.url === url;\n });\n console.log(seenURL);\n if (seenURL) {\n console.log('already seen this url');\n return;\n }\n _api.parser.parse(url, function (media) {\n if (!media) return;\n console.log('media', media);\n _actions2.default.file.create({\n folder_id: folder.id,\n name: (media.title || \"\").replace(/\\.[^.]+$/g, '').replace(/[^a-zA-Z0-9_]/g, '_').replace(/\\s+/g, '_').replace(/_+/g, '_'),\n module: module.name,\n dataset: media.token,\n activity: 'url',\n duration: parseInt(media.duration) || 0,\n epoch: 0,\n processed: false,\n generated: false,\n opt: media,\n url: url\n });\n });\n };\n};\n\nvar uploadFiles = exports.uploadFiles = function uploadFiles(files) {\n return { type: _types2.default.dataset.upload_files };\n};\n\n// export const uploadFiles = (files) => {\n// return dispatch => {\n// // return { type: types.dataset.upload_files }\n// }\n// }\n\n// export const fetchURL = (url) => { type: types.dataset.fetch_url }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _fileList = require('../common/fileList.component');\n\nvar _loading = require('../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar fieldSet = _util2.default.fieldSet(new Set(['input', 'status', 'checkpoint', 'output']));\n\nvar DatasetComponent = function (_Component) {\n _inherits(DatasetComponent, _Component);\n\n function DatasetComponent() {\n _classCallCheck(this, DatasetComponent);\n\n return _possibleConstructorReturn(this, (DatasetComponent.__proto__ || Object.getPrototypeOf(DatasetComponent)).apply(this, arguments));\n }\n\n _createClass(DatasetComponent, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n loading = _props.loading,\n progress = _props.progress,\n fields = _props.fields,\n module = _props.module,\n data = _props.data,\n folder = _props.folder,\n match = _props.match,\n history = _props.history;\n\n if (loading) {\n return (0, _preact.h)(_loading2.default, { progress: progress });\n }\n if (!data.folders.length) {\n console.log('no folders, redirect to /new');\n return history.push('/' + module.name + '/new/');\n }\n if (!folder || !folder.name) return;\n fields = fieldSet(fields);\n return (0, _preact.h)(\n 'div',\n { 'class': 'rows params datasets' },\n (0, _preact.h)(\n 'div',\n { 'class': 'row row-heading dataset' },\n fields.has('input') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'input'\n ),\n fields.has('status') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'status'\n ),\n fields.has('checkpoint') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'checkpoint'\n ),\n fields.has('output') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'output'\n )\n ),\n this.renderGroups()\n );\n }\n }, {\n key: 'renderGroups',\n value: function renderGroups() {\n var _this2 = this;\n\n var _props2 = this.props,\n module = _props2.module,\n data = _props2.data,\n folder = _props2.folder,\n fields = _props2.fields,\n runner = _props2.runner,\n onPickDataset = _props2.onPickDataset,\n onPickFile = _props2.onPickFile,\n datasetActions = _props2.datasetActions;\n\n fields = fieldSet(fields);\n var datasetLookup = data.datasetLookup,\n fileLookup = data.fileLookup;\n\n if (!datasetLookup) {\n return (0, _preact.h)('div', null);\n }\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn('date desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var moduleOnCPU = runner && runner.cpu.task && runner.cpu.task.module === module.name;\n var moduleOnGPU = runner && runner.gpu.task && runner.gpu.task.module === module.name;\n var datasets = folder.datasets.map(function (name) {\n return datasetLookup[name];\n }).map(mapFn).sort(sortFn).map(function (pair) {\n var dataset = pair[1];\n var status = '';\n var isProcessing = false,\n isFetching = false;\n if (moduleOnGPU && runner.gpu.task.dataset === dataset) {\n status = _util2.default.gerund(runner.gpu.task.activity);\n isProcessing = true;\n } else if (moduleOnCPU && runner.cpu.task.activity === 'fetch' && runner.cpu.task.opt.file_id === dataset.input[0]) {\n isProcessing = true;\n isFetching = true;\n }\n return (0, _preact.h)(\n 'div',\n { key: dataset.name, className: 'row dataset', onClick: function onClick() {\n return onPickDataset && onPickDataset(dataset);\n } },\n _this2.props.beforeRow && _this2.props.beforeRow(dataset),\n fields.has('input') && (0, _preact.h)(\n 'div',\n { className: 'col' },\n !!dataset.input.length && (0, _preact.h)(_fileList.FileList, {\n files: dataset.input.map(function (id) {\n return fileLookup[id];\n }),\n className: 'input_files',\n fileListClassName: '',\n rowClassName: 'input_file',\n fields: 'name date size delete',\n linkFiles: true,\n onClick: onPickFile,\n onDelete: function onDelete(file) {\n return _this2.onDeleteFile(file);\n }\n })\n ),\n fields.has('status') && (0, _preact.h)(\n 'div',\n { className: ['col', 'quiet', dataset.isBuilt ? 'built' : 'not_built', isProcessing ? 'processing' : 'not_processing'].join(' ') },\n _this2.props.datasetActions && _this2.props.datasetActions(dataset, isFetching, isProcessing),\n status\n ),\n fields.has('checkpoint') && (0, _preact.h)(\n 'div',\n { className: 'col checkpoint' },\n !!dataset.checkpoints.length && (0, _preact.h)(_fileList.FileRow, {\n file: dataset.checkpoints[0],\n fields: 'name date epoch',\n className: 'row checkpoint'\n })\n ),\n fields.has('output') && (0, _preact.h)(\n 'div',\n { className: 'col' },\n !!dataset.output.length && (0, _preact.h)(_fileList.FileList, {\n files: dataset.output.map(function (id) {\n return fileLookup[id];\n }),\n orderBy: 'epoch desc',\n fields: 'name date epoch size',\n linkFiles: true,\n onClick: onPickFile,\n onDelete: function onDelete(file) {\n return _this2.onDeleteFile(file);\n }\n })\n ),\n _this2.props.afterRow && _this2.props.afterRow(dataset)\n );\n });\n return datasets;\n }\n }, {\n key: 'onDeleteFile',\n value: function onDeleteFile(file) {\n var yes = confirm('Are you sure you want to delete this file?');\n if (yes) {\n console.log('delete: confirmed');\n if (this.props.onDeleteFile) {\n console.log('calling custom deletefile function');\n this.props.onDeleteFile(file);\n } else {\n _actions2.default.file.destroy(file);\n }\n }\n }\n }]);\n\n return DatasetComponent;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n runner: state.system.runner\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(DatasetComponent);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _dataset = require('./dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _group = require('../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('../common/param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _fileList = require('../common/fileList.component');\n\nvar _fileUpload = require('../common/fileUpload.component');\n\nvar _fileUpload2 = _interopRequireDefault(_fileUpload);\n\nvar _textInput = require('../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar DatasetForm = function (_Component) {\n _inherits(DatasetForm, _Component);\n\n function DatasetForm() {\n _classCallCheck(this, DatasetForm);\n\n return _possibleConstructorReturn(this, (DatasetForm.__proto__ || Object.getPrototypeOf(DatasetForm)).apply(this, arguments));\n }\n\n _createClass(DatasetForm, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n loading = _props.loading,\n status = _props.status,\n error = _props.error,\n module = _props.module,\n folder = _props.folder,\n _props$title = _props.title,\n title = _props$title === undefined ? 'Dataset' : _props$title,\n canRename = _props.canRename,\n canUpload = _props.canUpload,\n canAddURL = _props.canAddURL;\n // sort files??\n\n if (!folder.id) {\n return (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n this.renderFolderNameInput(folder.name)\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n { className: 'form params row' },\n (0, _preact.h)(\n 'div',\n { className: 'col' },\n (0, _preact.h)(\n _group2.default,\n null,\n canRename && this.renderFolderNameInput(folder.name),\n canUpload && this.renderUploadInput(),\n canAddURL && this.renderURLInput()\n )\n )\n );\n }\n }, {\n key: 'curry',\n value: function curry(action) {\n var _props2 = this.props,\n module = _props2.module,\n folder = _props2.folder;\n\n return function (param) {\n return action(module, folder, param);\n };\n }\n }, {\n key: 'renderFolderNameInput',\n value: function renderFolderNameInput(name) {\n return (0, _preact.h)(_textInput2.default, {\n title: 'Dataset name',\n value: name,\n onSave: this.curry(this.props.actions.dataset.updateFolder)\n });\n }\n }, {\n key: 'renderUploadInput',\n value: function renderUploadInput() {\n return (0, _preact.h)(_fileUpload2.default, {\n title: 'Upload a file',\n mime: 'image.*',\n onUpload: this.curry(this.props.actions.dataset.uploadFile)\n });\n }\n }, {\n key: 'renderURLInput',\n value: function renderURLInput() {\n return (0, _preact.h)(_textInput2.default, {\n title: 'Fetch a URL',\n placeholder: 'http://',\n onSave: this.curry(this.props.actions.dataset.fetchURL)\n });\n }\n }]);\n\n return DatasetForm;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return state.upload;\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n dataset: (0, _redux.bindActionCreators)(datasetActions, dispatch)\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(DatasetForm);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load = exports.getDataset = exports.emptyDataset = exports.unsortedFolder = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar unsortedFolders = {};\n\nvar unsortedFolder = exports.unsortedFolder = function unsortedFolder(module) {\n var instantiate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!unsortedFolders[module] || instantiate) {\n var folder = {\n id: 0,\n module: module,\n name: 'unsorted',\n files: [],\n datasets: []\n };\n unsortedFolders[module] = folder;\n }\n return unsortedFolders[module];\n};\n\nvar emptyDataset = exports.emptyDataset = function emptyDataset(module, datasetLookup, name, folder) {\n var dataset = {\n name: name,\n input: [],\n checkpoints: [],\n output: []\n };\n datasetLookup[name] = dataset;\n folder = folder || unsortedFolder(module);\n folder.datasets.push(name);\n return dataset;\n};\n\nvar getDataset = exports.getDataset = function getDataset(module, datasetLookup, name, folder, date) {\n name = name.toLowerCase();\n var dataset = datasetLookup[name] || emptyDataset(module, datasetLookup, name, folder);\n // folder = folder || unsortedFolder(module)\n if (date) {\n dataset.date = dataset.date && !isNaN(dataset.date) ? Math.max(+new Date(date), dataset.date) : +new Date(date);\n }\n return dataset;\n};\n\nvar load = exports.load = function load(module) {\n console.log(module);\n return Promise.all([_actions2.default.folder.index({ module: module, limit: 0 }), _actions2.default.file.index({ module: module, limit: 0 }), _actions2.default.task.index({ module: module })]).then(function (res) {\n var _res = _slicedToArray(res, 3),\n folders = _res[0],\n files = _res[1],\n tasks = _res[2];\n\n var datasetLookup = {};\n var folderLookup = {};\n var fileLookup = {};\n\n var resultsFolder = void 0;\n\n // take all of the folders and put them in a lookup\n folderLookup = folders.reduce(function (folderLookup, folder) {\n folderLookup[folder.id] = {\n id: folder.id,\n name: folder.name,\n folder: folder,\n files: [],\n datasets: []\n };\n if (folder.name === 'results') {\n resultsFolder = folder;\n }\n return folderLookup;\n }, {\n unsorted: unsortedFolder(module, true)\n });\n\n if (!resultsFolder) {\n console.log('creating results folder...');\n _actions2.default.folder.create({\n module: module,\n name: 'results',\n activity: 'results'\n }).then(function (folder) {\n console.log('created folder', folder);\n folderLookup.results = folder;\n });\n } else {\n console.log('got results folder', resultsFolder);\n }\n\n // prepare the files by splitting into two groups\n var generatedFiles = files.filter(function (file) {\n return file.generated;\n });\n var ungeneratedFiles = files.filter(function (file) {\n return !file.generated;\n });\n\n // build the initial dataset lookup table using the ungenerated files\n ungeneratedFiles.reduce(function (datasetLookup, file) {\n fileLookup[file.id] = file;\n if (!file.name) {\n if (file.opt && file.opt.media && file.opt.media.token) {\n file.name = file.opt.media.token;\n } else {\n file.name = file.url.replace(/^https?:\\/\\/(www.)?/, '').replace(/[^a-zA-Z0-9_]/g, '_').replace(/_+/g, '_') || 'unknown_' + Math.floor(1000 * Math.random());\n }\n }\n var name = (file.name || 'unsorted').split('.')[0];\n var folder = folderLookup[file.folder_id] || unsortedFolder(module);\n var dataset = getDataset(module, datasetLookup, file.dataset || name, folder, file.date || file.created_at);\n if (file.url.match(file.name)) file.persisted = true;\n dataset.input.push(file.id);\n folder.files.push(file.id);\n return datasetLookup;\n }, datasetLookup);\n\n // go over the generated files and add addl datasets (if the files were deleted)\n generatedFiles.map(function (file) {\n fileLookup[file.id] = file;\n var pair = file.name.split('.')[0].split('-');\n var folder = folderLookup[file.folder_id] || unsortedFolder(module);\n var dataset = getDataset(module, datasetLookup, file.dataset || pair[0], folder, file.date || file.created_at);\n dataset.output.push(file.id);\n folder.files.push(file.id);\n file.epoch = file.epoch || pair[1];\n });\n\n return {\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders,\n files: files,\n unsortedFolder: folderLookup.unsorted,\n resultsFolder: resultsFolder\n };\n }).catch(function (e) {\n console.error(e);\n });\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _dataset = require('./dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _loading = require('../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _textInput = require('../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\nfunction NewDatasetForm(props) {\n var loading = props.loading,\n status = props.status,\n error = props.error,\n history = props.history,\n actions = props.actions,\n module = props.module;\n\n if (loading) return (0, _preact.h)(_loading2.default, null);\n console.log(props);\n return (0, _preact.h)(\n 'div',\n { 'class': 'opaque' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'h2',\n null,\n 'Create a new ',\n module.displayName,\n ' project'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'params' },\n (0, _preact.h)(_textInput2.default, {\n autofocus: true,\n title: 'Name your project',\n onSave: function onSave(name) {\n actions.createFolder(module, name).then(function (folder) {\n window.location.href = '/' + module.name + '/datasets/' + folder.id + '/';\n });\n }\n })\n )\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(datasetActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(NewDatasetForm);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*\n Note:\n This is a sub-reducer intended to process the folder-file API output from the DB.\n Please run this from inside your module reducers :) \n*/\n\nvar datasetInitialState = function datasetInitialState() {\n return {\n loading: true,\n progress: null,\n error: null,\n data: null,\n folder_id: 0\n };\n};\n\nvar datasetReducer = function datasetReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : datasetInitialState();\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.app.load_progress:\n return _extends({}, state, {\n progress: action.progress\n });\n\n case _types2.default.dataset.load:\n return _extends({}, state, {\n loading: false,\n data: action.data\n });\n\n case _types2.default.dataset.set_folder:\n return _extends({}, state, {\n folder_id: action.data.folder_id\n });\n\n case _types2.default.folder.create:\n return _extends({}, state, {\n loading: false,\n data: {\n folders: state.data.folders.concat([action.data.id]),\n folderLookup: _extends({}, state.data.folderLookup, _defineProperty({}, action.data.id, action.data))\n }\n });\n return state;\n\n case _types2.default.file.create:\n return handleFileCreate(state, action);\n\n case _types2.default.file.update:\n return handleFileUpdate(state, action);\n\n case _types2.default.file.destroy:\n return handleFileDestroy(state, action);\n\n case _types2.default.dataset.list_epochs:\n return _extends({}, state, {\n data: _extends({}, state.data, {\n epochs: action.data.epochs\n })\n });\n\n default:\n return state;\n }\n};\n\nfunction handleFileCreate(state, action) {\n console.log(action.data);\n if (!state.data || !state.data.datasetLookup) return state;\n var dataset = void 0,\n old_dataset = void 0,\n folder = void 0,\n old_folder = void 0;\n var dataset_name = void 0;\n if (action.data.dataset) {\n dataset_name = action.data.dataset;\n } else if (action.data.name) {\n dataset_name = action.data.name.split('.')[0];\n } else if (action.data.url) {\n dataset_name = action.data.url;\n } else {\n dataset_name = null;\n }\n if (dataset_name in state.data.datasetLookup) {\n old_dataset = state.data.datasetLookup[dataset_name];\n dataset = _extends({}, old_dataset, {\n input: action.data.generated ? old_dataset.input : [action.data.id].concat(old_dataset.input),\n output: !action.data.generated ? old_dataset.output : [action.data.id].concat(old_dataset.output)\n });\n } else {\n console.log(action.data.created_at, action.data.date);\n dataset = {\n name: dataset_name,\n date: action.data.created_at || action.data.date,\n input: action.data.generated ? [] : [action.data.id],\n checkpoints: [],\n output: !action.data.generated ? [] : [action.data.id]\n };\n }\n old_folder = state.data.folderLookup[action.data.folder_id];\n folder = _extends({}, old_folder, {\n datasets: old_folder.datasets.concat([dataset_name]),\n files: old_folder.files.concat([action.data.id])\n });\n return _extends({}, state, {\n loading: false,\n data: _extends({}, state.data, {\n files: state.data.files.concat([action.data.id]),\n folderLookup: _extends({}, state.data.folderLookup, _defineProperty({}, action.data.folder_id, folder)),\n fileLookup: _extends({}, state.data.fileLookup, _defineProperty({}, action.data.id, action.data)),\n datasetLookup: _extends({}, state.data.datasetLookup, _defineProperty({}, dataset_name, dataset))\n })\n });\n}\n\nfunction handleFileUpdate(state, action) {\n var _extends6;\n\n var old_dataset = void 0;\n var new_dataset = state.data.datasetLookup[action.data.dataset];\n var old_file = state.data.fileLookup[action.data.id];\n var new_dataset_update = void 0;\n if (old_file && action.data.dataset !== old_file.dataset) {\n if (state.data.datasetLookup[old_file.dataset]) {\n old_dataset = state.data.datasetLookup[old_file.dataset];\n old_dataset_update = _extends({}, old_dataset, {\n input: old_dataset.input.filter(function (id) {\n return id !== action.data.id;\n }),\n output: old_dataset.output.filter(function (id) {\n return id !== action.data.id;\n })\n });\n }\n new_dataset_update = _extends({}, new_dataset, {\n input: action.data.generated ? [] : [action.data.id],\n output: !action.data.generated ? [] : [action.data.id]\n });\n }\n console.log('old_dataset', old_dataset_update.name);\n console.log('new_dataset', new_dataset_update.name);\n return _extends({}, state, {\n loading: false,\n data: _extends({}, state.data, {\n datasetLookup: old_dataset ? _extends({}, state.data.datasetLookup, (_extends6 = {}, _defineProperty(_extends6, old_dataset.name, old_dataset_update), _defineProperty(_extends6, new_dataset.name, new_dataset_update), _extends6)) : new_dataset_update ? _extends({}, state.data.datasetLookup, _defineProperty({}, new_dataset.name, new_dataset_update)) : state.data.datasetLookup,\n fileLookup: _extends({}, state.data.fileLookup, _defineProperty({}, action.data.id, action.data))\n })\n });\n return state;\n}\n\nfunction handleFileDestroy(state, action) {\n if (!state.data) return state;\n // delete the key from fileLookup\n var fileLookup = _extends({}, state.data.fileLookup);\n var datasetLookup = _extends({}, state.data.datasetLookup);\n var folderLookup = _extends({}, state.data.folderLookup);\n var old_file = fileLookup[action.data.id];\n if (!old_file) return state;\n var old_dataset = state.data.datasetLookup[old_file.dataset];\n var dataset = void 0;\n if (old_dataset) {\n dataset = _extends({}, old_dataset, {\n input: old_dataset.input.filter(function (id) {\n return id !== old_file.id;\n }),\n output: old_dataset.output.filter(function (id) {\n return id !== old_file.id;\n })\n });\n if (!dataset.input.length && !dataset.checkpoints.length && !dataset.output.length) {\n delete datasetLookup[old_file.dataset];\n var old_folder = folderLookup[old_file.folder_id];\n folderLookup[old_file.folder_id] = _extends({}, old_folder, {\n datasets: old_folder.datasets.filter(function (name) {\n return name !== old_file.dataset;\n })\n });\n } else {\n console.log('dataset just needs sweeping');\n datasetLookup[old_file.dataset] = dataset;\n }\n }\n delete fileLookup[old_file.id];\n\n return _extends({}, state, {\n loading: false,\n data: _extends({}, state.data, {\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup\n })\n });\n}\n\nexports.default = datasetReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar uploadInitialState = {\n loading: false,\n error: null,\n status: ''\n};\n\nvar uploadReducer = function uploadReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : uploadInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.folder.upload_loading:\n return {\n error: null,\n loading: true,\n status: 'Loading...'\n };\n case _types2.default.folder.upload_error:\n return {\n error: null,\n loading: false,\n status: 'Error uploading :('\n };\n case _types2.default.folder.upload_progress:\n return {\n error: null,\n loading: true,\n status: 'Upload progress ' + action.percent + '%'\n };\n case _types2.default.folder.upload_waiting:\n return {\n error: null,\n loading: true,\n status: 'Waiting for server to finish processing...'\n };\n case _types2.default.folder.upload_complete:\n return {\n error: null,\n loading: false,\n status: 'Upload complete'\n };\n case _types2.default.file.create_loading:\n return {\n error: null,\n loading: true,\n status: 'Creating file...'\n };\n default:\n return state;\n }\n};\n\nexports.default = uploadReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _loading = require('../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction UploadStatus(props) {\n return (0, _preact.h)(\n 'div',\n { 'class': 'status' },\n props.status\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return state.upload;\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(UploadStatus);","'use strict';\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _store = require('./store');\n\nvar _socket = require('./socket');\n\nvar socket = _interopRequireWildcard(_socket);\n\nvar _util = require('./util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _header = require('./common/header.component');\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _audioPlayer = require('./common/audioPlayer/audioPlayer.component');\n\nvar _audioPlayer2 = _interopRequireDefault(_audioPlayer);\n\nvar _system = require('./system/system.component');\n\nvar _system2 = _interopRequireDefault(_system);\n\nvar _dashboard = require('./dashboard/dashboard.component');\n\nvar _dashboard2 = _interopRequireDefault(_dashboard);\n\nvar _modules = require('./modules');\n\nvar _modules2 = _interopRequireDefault(_modules);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\n// import client from './client'\n\nvar module_list = Object.keys(_modules2.default).map(function (name) {\n var module = _modules2.default[name];\n return (0, _preact.h)(_reactRouterDom.Route, { path: '/' + module.name, component: module.router });\n});\n\nvar app = (0, _preact.h)(\n _reactRedux.Provider,\n { store: _store.store },\n (0, _preact.h)(\n _reactRouterDom.BrowserRouter,\n null,\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/', component: _dashboard2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { path: '/system/', component: _system2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { path: '/dashboard/', component: _dashboard2.default }),\n module_list,\n (0, _preact.h)(_reactRouterDom.Route, { path: '/', component: _header2.default }),\n (0, _preact.h)(_audioPlayer2.default, null)\n )\n )\n);\n\n(0, _preact.render)(app, document.getElementById('container'));","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.play = exports.pause = exports.seek = exports.load_epoch = exports.load_sequence = exports.list_sequences = exports.list_epochs = exports.list_checkpoints = exports.set_fullscreen = exports.set_param = exports.get_params = undefined;\n\nvar _socket = require('../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _player = require('./player');\n\nvar player = _interopRequireWildcard(_player);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar get_params = exports.get_params = function get_params() {\n _socket2.default.live.get_params();\n return { type: _types2.default.player.get_params };\n};\n\nvar set_param = exports.set_param = function set_param(key, value) {\n console.log('set param', key, value);\n _socket2.default.live.set_param(key, value);\n return { type: _types2.default.player.set_param, key: key, value: value };\n};\n\nvar set_fullscreen = exports.set_fullscreen = function set_fullscreen(value) {\n return { type: _types2.default.player.set_fullscreen, value: value };\n};\n\nvar list_checkpoints = exports.list_checkpoints = function list_checkpoints(module) {\n _socket2.default.live.list_checkpoints(module);\n return { type: _types2.default.player.loading_checkpoints };\n};\n\nvar list_epochs = exports.list_epochs = function list_epochs(module, checkpoint) {\n _socket2.default.live.list_epochs(module, checkpoint);\n return { type: _types2.default.player.loading_epochs };\n};\n\nvar list_sequences = exports.list_sequences = function list_sequences(module) {\n _socket2.default.live.list_sequences(module);\n return { type: _types2.default.player.loading_sequences };\n};\n\nvar load_sequence = exports.load_sequence = function load_sequence(sequence_name) {\n _socket2.default.live.load_sequence(sequence_name);\n return { type: _types2.default.player.loading_sequence, sequence_name: sequence_name };\n};\n\nvar load_epoch = exports.load_epoch = function load_epoch(checkpoint_name, epoch) {\n _socket2.default.live.load_epoch(checkpoint_name, epoch);\n return { type: _types2.default.player.loading_checkpoint, checkpoint_name: checkpoint_name, epoch: epoch };\n};\n\nvar seek = exports.seek = function seek(frame) {\n _socket2.default.live.seek(frame);\n return { type: _types2.default.player.seeking };\n};\n\nvar pause = exports.pause = function pause(frame) {\n _socket2.default.live.pause(pause);\n player.toggleFPS(false);\n return { type: _types2.default.player.pausing };\n};\n\nvar play = exports.play = function play(frame) {\n _socket2.default.live.play();\n player.toggleFPS(true);\n return { type: _types2.default.player.playing };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _fileSaver = require('file-saver');\n\nvar _fileSaver2 = _interopRequireDefault(_fileSaver);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar liveInitialState = {\n loading: false,\n error: null,\n opt: {\n hue: 0, saturation: 0, luminosity: 0,\n sequence_playing: true, sequence_step: 1,\n recurse_roll: 0, rotate: 0, scale: 0, process_frac: 0.5,\n view_mode: 'b'\n },\n all_checkpoints: [],\n checkpoints: [],\n epochs: ['latest'],\n sequences: [],\n fps: 0,\n playing: false,\n last_message: '',\n fullscreen: false,\n frame: { i: 0, sequence_i: 0, sequence_len: '1' }\n};\n\nvar liveReducer = function liveReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : liveInitialState;\n var action = arguments[1];\n\n var results = void 0;\n switch (action.type) {\n case _types2.default.socket.load_params:\n if (!action.opt || !Object.keys(action.opt).length) {\n return state;\n }\n return _extends({}, state, {\n loading: false,\n error: null,\n opt: action.opt\n });\n\n case _types2.default.player.set_param:\n return _extends({}, state, {\n opt: _extends({}, state.opt, _defineProperty({}, action.key, action.value))\n });\n\n case _types2.default.player.set_fullscreen:\n return _extends({}, state, {\n fullscreen: action.value\n });\n\n case _types2.default.socket.list_checkpoints:\n return _extends({}, state, {\n checkpoints: action.checkpoints,\n epochs: []\n });\n\n case _types2.default.socket.list_all_checkpoints:\n return _extends({}, state, {\n all_checkpoints: action.all_checkpoints,\n epochs: []\n });\n\n case _types2.default.socket.list_epochs:\n console.log(action);\n if (action.epochs === \"not found\") return _extends({}, state, { epochs: [] });\n return _extends({}, state, {\n epochs: (action.epochs || []).map(function (a) {\n return [a == 'latest' ? Infinity : a, a];\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).map(function (a) {\n return a[1];\n })\n });\n\n case _types2.default.socket.list_sequences:\n return _extends({}, state, {\n sequences: action.sequences\n });\n\n case _types2.default.player.loading_sequence:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n sequence_name: action.sequence_name\n })\n });\n\n case _types2.default.player.loading_checkpoint:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n checkpoint_name: action.checkpoint_name,\n epoch: action.epoch\n })\n });\n\n case _types2.default.player.set_fps:\n return _extends({}, state, {\n fps: action.fps\n });\n\n case _types2.default.system.stdout:\n if (action.data.processor === 'gpu') {\n return _extends({}, state, {\n last_message: action.data.data\n });\n }\n return state;\n\n case _types2.default.player.current_frame:\n return action.meta ? _extends({}, state, {\n frame: action.meta\n }) : state;\n\n case _types2.default.player.pausing:\n return _extends({}, state, {\n playing: false\n });\n\n case _types2.default.player.playing:\n return _extends({}, state, {\n playing: true\n });\n\n case _types2.default.player.start_recording:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n recording: true\n })\n });\n case _types2.default.player.add_record_frame:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n recordFrames: (state.opt.recordFrames || 0) + 1\n })\n });\n case _types2.default.player.save_frame:\n _fileSaver2.default.saveAs(action.blob, state.opt.checkpoint_name + \"_\" + state.opt.sequence + \"_\" + (0, _moment2.default)().format(\"YYYYMMDD_HHmm\") + \".png\");\n return state;\n\n case _types2.default.player.saving_video:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n savingVideo: true\n })\n });\n case _types2.default.player.save_video:\n _fileSaver2.default.saveAs(action.blob, state.opt.checkpoint_name + \"_\" + state.opt.sequence + \"_\" + (0, _moment2.default)().format(\"YYYYMMDD_HHmm\") + \".webm\");\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n recording: false,\n savingVideo: false,\n recordFrames: 0\n })\n });\n\n default:\n return state;\n }\n};\n\nexports.default = liveReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.startSynthesizing = startSynthesizing;\nexports.stopSynthesizing = stopSynthesizing;\nexports.startRecording = startRecording;\nexports.stopRecording = stopRecording;\nexports.saveFrame = saveFrame;\nexports.onFrame = onFrame;\nexports.toggleFPS = toggleFPS;\nexports.startWatchingFPS = startWatchingFPS;\nexports.stopWatchingFPS = stopWatchingFPS;\n\nvar _store = require('../store');\n\nvar _whammy = require('./whammy');\n\nvar _whammy2 = _interopRequireDefault(_whammy);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _pix2wav = require('../audio/pix2wav');\n\nvar pix2wav = _interopRequireWildcard(_pix2wav);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fps = 0,\n last_frame = void 0;\nvar recording = false,\n saving = false,\n synthesizing = false;\nvar videoWriter = void 0;\n\nfunction startSynthesizing() {\n synthesizing = true;\n}\nfunction stopSynthesizing() {\n synthesizing = false;\n}\n\nfunction startRecording() {\n videoWriter = new _whammy2.default.Video(25, 0.95);\n recording = true;\n _store.store.dispatch({\n type: _types2.default.player.start_recording\n });\n}\n\nfunction stopRecording() {\n if (!recording) return;\n recording = false;\n _store.store.dispatch({\n type: _types2.default.player.saving_video\n });\n videoWriter.compile(false, function (blob) {\n // console.log(blob)\n _store.store.dispatch({\n type: _types2.default.player.save_video,\n blob: blob\n });\n });\n}\n\nfunction saveFrame() {\n saving = true;\n}\n\nfunction onFrame(data) {\n var blob = new Blob([data.frame], { type: 'image/jpg' });\n var url = URL.createObjectURL(blob);\n var img = new Image();\n var canvas = document.querySelector('.player canvas');\n if (!canvas) return console.error('no canvas for frame');\n img.onload = function () {\n img.onload = null;\n last_frame = data.meta;\n URL.revokeObjectURL(url);\n var ctx = canvas.getContext('2d-lodpi');\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n if (synthesizing) {\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n pix2wav.play({ imageData: imageData });\n }\n if (recording) {\n console.log('record frame');\n videoWriter.add(canvas);\n _store.store.dispatch({\n type: _types2.default.player.add_record_frame\n });\n }\n if (saving) {\n saving = false;\n canvas.toBlob(function (blob) {\n _store.store.dispatch({\n type: _types2.default.player.save_frame,\n blob: blob\n });\n });\n }\n fps += 1;\n };\n img.src = url;\n}\n\nvar previousValue = void 0,\n currentValue = void 0;\nfunction toggleFPS(state) {\n currentValue = typeof state !== 'undefined' ? state : _store.store.getState().live.playing;\n if (previousValue !== currentValue) {\n if (currentValue) {\n startWatchingFPS();\n } else {\n stopWatchingFPS();\n }\n }\n previousValue = currentValue;\n}\n\nvar fpsInterval = void 0;\n\nfunction startWatchingFPS() {\n clearInterval(fpsInterval);\n fpsInterval = setInterval(function () {\n _store.store.dispatch({\n type: _types2.default.player.set_fps,\n fps: fps\n });\n _store.store.dispatch({\n type: _types2.default.player.current_frame,\n meta: last_frame\n });\n fps = 0;\n }, 1000);\n}\nfunction stopWatchingFPS() {\n clearInterval(fpsInterval);\n}","\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nmodule.exports = function () {\n // in this case, frames has a very specific meaning, which will be\n // detailed once i finish writing the code\n\n function toWebM(frames, outputAsArray) {\n var info = checkFrames(frames);\n\n //max duration by cluster in milliseconds\n var CLUSTER_MAX_DURATION = 30000;\n\n var EBML = [{\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [{\n \"data\": 1,\n \"id\": 0x4286 // EBMLVersion\n }, {\n \"data\": 1,\n \"id\": 0x42f7 // EBMLReadVersion\n }, {\n \"data\": 4,\n \"id\": 0x42f2 // EBMLMaxIDLength\n }, {\n \"data\": 8,\n \"id\": 0x42f3 // EBMLMaxSizeLength\n }, {\n \"data\": \"webm\",\n \"id\": 0x4282 // DocType\n }, {\n \"data\": 2,\n \"id\": 0x4287 // DocTypeVersion\n }, {\n \"data\": 2,\n \"id\": 0x4285 // DocTypeReadVersion\n }]\n }, {\n \"id\": 0x18538067, // Segment\n \"data\": [{\n \"id\": 0x1549a966, // Info\n \"data\": [{\n \"data\": 1e6, //do things in millisecs (num of nanosecs for duration scale)\n \"id\": 0x2ad7b1 // TimecodeScale\n }, {\n \"data\": \"whammy\",\n \"id\": 0x4d80 // MuxingApp\n }, {\n \"data\": \"whammy\",\n \"id\": 0x5741 // WritingApp\n }, {\n \"data\": doubleToString(info.duration),\n \"id\": 0x4489 // Duration\n }]\n }, {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [{\n \"id\": 0xae, // TrackEntry\n \"data\": [{\n \"data\": 1,\n \"id\": 0xd7 // TrackNumber\n }, {\n \"data\": 1,\n \"id\": 0x73c5 // TrackUID\n }, {\n \"data\": 0,\n \"id\": 0x9c // FlagLacing\n }, {\n \"data\": \"und\",\n \"id\": 0x22b59c // Language\n }, {\n \"data\": \"V_VP8\",\n \"id\": 0x86 // CodecID\n }, {\n \"data\": \"VP8\",\n \"id\": 0x258688 // CodecName\n }, {\n \"data\": 1,\n \"id\": 0x83 // TrackType\n }, {\n \"id\": 0xe0, // Video\n \"data\": [{\n \"data\": info.width,\n \"id\": 0xb0 // PixelWidth\n }, {\n \"data\": info.height,\n \"id\": 0xba // PixelHeight\n }]\n }]\n }]\n }, {\n \"id\": 0x1c53bb6b, // Cues\n \"data\": [\n //cue insertion point\n ]\n\n //cluster insertion point\n }]\n }];\n\n var segment = EBML[1];\n var cues = segment.data[2];\n\n //Generate clusters (max duration)\n var frameNumber = 0;\n var clusterTimecode = 0;\n while (frameNumber < frames.length) {\n\n var cuePoint = {\n \"id\": 0xbb, // CuePoint\n \"data\": [{\n \"data\": Math.round(clusterTimecode),\n \"id\": 0xb3 // CueTime\n }, {\n \"id\": 0xb7, // CueTrackPositions\n \"data\": [{\n \"data\": 1,\n \"id\": 0xf7 // CueTrack\n }, {\n \"data\": 0, // to be filled in when we know it\n \"size\": 8,\n \"id\": 0xf1 // CueClusterPosition\n }]\n }]\n };\n\n cues.data.push(cuePoint);\n\n var clusterFrames = [];\n var clusterDuration = 0;\n do {\n clusterFrames.push(frames[frameNumber]);\n clusterDuration += frames[frameNumber].duration;\n frameNumber++;\n } while (frameNumber < frames.length && clusterDuration < CLUSTER_MAX_DURATION);\n\n var clusterCounter = 0;\n var cluster = {\n \"id\": 0x1f43b675, // Cluster\n \"data\": [{\n \"data\": Math.round(clusterTimecode),\n \"id\": 0xe7 // Timecode\n }].concat(clusterFrames.map(function (webp) {\n var block = makeSimpleBlock({\n discardable: 0,\n frame: webp.data.slice(4),\n invisible: 0,\n keyframe: 1,\n lacing: 0,\n trackNum: 1,\n timecode: Math.round(clusterCounter)\n });\n clusterCounter += webp.duration;\n return {\n data: block,\n id: 0xa3\n };\n }))\n\n //Add cluster to segment\n };segment.data.push(cluster);\n clusterTimecode += clusterDuration;\n }\n\n //First pass to compute cluster positions\n var position = 0;\n for (var i = 0; i < segment.data.length; i++) {\n if (i >= 3) {\n cues.data[i - 3].data[1].data[1].data = position;\n }\n var data = generateEBML([segment.data[i]], outputAsArray);\n position += data.size || data.byteLength || data.length;\n if (i != 2) {\n // not cues\n //Save results to avoid having to encode everything twice\n segment.data[i] = data;\n }\n }\n\n return generateEBML(EBML, outputAsArray);\n }\n\n // sums the lengths of all the frames and gets the duration, woo\n\n function checkFrames(frames) {\n var width = frames[0].width,\n height = frames[0].height,\n duration = frames[0].duration;\n for (var i = 1; i < frames.length; i++) {\n if (frames[i].width != width) throw \"Frame \" + (i + 1) + \" has a different width\";\n if (frames[i].height != height) throw \"Frame \" + (i + 1) + \" has a different height\";\n if (frames[i].duration < 0 || frames[i].duration > 0x7fff) throw \"Frame \" + (i + 1) + \" has a weird duration (must be between 0 and 32767)\";\n duration += frames[i].duration;\n }\n return {\n duration: duration,\n width: width,\n height: height\n };\n }\n\n function numToBuffer(num) {\n var parts = [];\n while (num > 0) {\n parts.push(num & 0xff);\n num = num >> 8;\n }\n return new Uint8Array(parts.reverse());\n }\n\n function numToFixedBuffer(num, size) {\n var parts = new Uint8Array(size);\n for (var i = size - 1; i >= 0; i--) {\n parts[i] = num & 0xff;\n num = num >> 8;\n }\n return parts;\n }\n\n function strToBuffer(str) {\n // return new Blob([str]);\n\n var arr = new Uint8Array(str.length);\n for (var i = 0; i < str.length; i++) {\n arr[i] = str.charCodeAt(i);\n }\n return arr;\n // this is slower\n // return new Uint8Array(str.split('').map(function(e){\n // return e.charCodeAt(0)\n // }))\n }\n\n //sorry this is ugly, and sort of hard to understand exactly why this was done\n // at all really, but the reason is that there's some code below that i dont really\n // feel like understanding, and this is easier than using my brain.\n\n function bitsToBuffer(bits) {\n var data = [];\n var pad = bits.length % 8 ? new Array(1 + 8 - bits.length % 8).join('0') : '';\n bits = pad + bits;\n for (var i = 0; i < bits.length; i += 8) {\n data.push(parseInt(bits.substr(i, 8), 2));\n }\n return new Uint8Array(data);\n }\n\n function generateEBML(json, outputAsArray) {\n var ebml = [];\n for (var i = 0; i < json.length; i++) {\n if (!('id' in json[i])) {\n //already encoded blob or byteArray\n ebml.push(json[i]);\n continue;\n }\n\n var data = json[i].data;\n if ((typeof data === \"undefined\" ? \"undefined\" : _typeof(data)) == 'object') data = generateEBML(data, outputAsArray);\n if (typeof data == 'number') data = 'size' in json[i] ? numToFixedBuffer(data, json[i].size) : bitsToBuffer(data.toString(2));\n if (typeof data == 'string') data = strToBuffer(data);\n\n if (data.length) {\n var z = z;\n }\n\n var len = data.size || data.byteLength || data.length;\n var zeroes = Math.ceil(Math.ceil(Math.log(len) / Math.log(2)) / 8);\n var size_str = len.toString(2);\n var padded = new Array(zeroes * 7 + 7 + 1 - size_str.length).join('0') + size_str;\n var size = new Array(zeroes).join('0') + '1' + padded;\n\n //i actually dont quite understand what went on up there, so I'm not really\n //going to fix this, i'm probably just going to write some hacky thing which\n //converts that string into a buffer-esque thing\n\n ebml.push(numToBuffer(json[i].id));\n ebml.push(bitsToBuffer(size));\n ebml.push(data);\n }\n\n //output as blob or byteArray\n if (outputAsArray) {\n //convert ebml to an array\n var buffer = toFlatArray(ebml);\n return new Uint8Array(buffer);\n } else {\n return new Blob(ebml, { type: \"video/webm\" });\n }\n }\n\n function toFlatArray(arr, outBuffer) {\n if (outBuffer == null) {\n outBuffer = [];\n }\n for (var i = 0; i < arr.length; i++) {\n if (_typeof(arr[i]) == 'object') {\n //an array\n toFlatArray(arr[i], outBuffer);\n } else {\n //a simple element\n outBuffer.push(arr[i]);\n }\n }\n return outBuffer;\n }\n\n //OKAY, so the following two functions are the string-based old stuff, the reason they're\n //still sort of in here, is that they're actually faster than the new blob stuff because\n //getAsFile isn't widely implemented, or at least, it doesn't work in chrome, which is the\n // only browser which supports get as webp\n\n //Converting between a string of 0010101001's and binary back and forth is probably inefficient\n //TODO: get rid of this function\n function toBinStr_old(bits) {\n var data = '';\n var pad = bits.length % 8 ? new Array(1 + 8 - bits.length % 8).join('0') : '';\n bits = pad + bits;\n for (var i = 0; i < bits.length; i += 8) {\n data += String.fromCharCode(parseInt(bits.substr(i, 8), 2));\n }\n return data;\n }\n\n function generateEBML_old(json) {\n var ebml = '';\n for (var i = 0; i < json.length; i++) {\n var data = json[i].data;\n if ((typeof data === \"undefined\" ? \"undefined\" : _typeof(data)) == 'object') data = generateEBML_old(data);\n if (typeof data == 'number') data = toBinStr_old(data.toString(2));\n\n var len = data.length;\n var zeroes = Math.ceil(Math.ceil(Math.log(len) / Math.log(2)) / 8);\n var size_str = len.toString(2);\n var padded = new Array(zeroes * 7 + 7 + 1 - size_str.length).join('0') + size_str;\n var size = new Array(zeroes).join('0') + '1' + padded;\n\n ebml += toBinStr_old(json[i].id.toString(2)) + toBinStr_old(size) + data;\n }\n return ebml;\n }\n\n //woot, a function that's actually written for this project!\n //this parses some json markup and makes it into that binary magic\n //which can then get shoved into the matroska comtainer (peaceably)\n\n function makeSimpleBlock(data) {\n var flags = 0;\n if (data.keyframe) flags |= 128;\n if (data.invisible) flags |= 8;\n if (data.lacing) flags |= data.lacing << 1;\n if (data.discardable) flags |= 1;\n if (data.trackNum > 127) {\n throw \"TrackNumber > 127 not supported\";\n }\n var out = [data.trackNum | 0x80, data.timecode >> 8, data.timecode & 0xff, flags].map(function (e) {\n return String.fromCharCode(e);\n }).join('') + data.frame;\n\n return out;\n }\n\n // here's something else taken verbatim from weppy, awesome rite?\n\n function parseWebP(riff) {\n var VP8 = riff.RIFF[0].WEBP[0];\n\n var frame_start = VP8.indexOf('\\x9d\\x01\\x2a'); //A VP8 keyframe starts with the 0x9d012a header\n for (var i = 0, c = []; i < 4; i++) {\n c[i] = VP8.charCodeAt(frame_start + 3 + i);\n }var width, horizontal_scale, height, vertical_scale, tmp;\n\n //the code below is literally copied verbatim from the bitstream spec\n tmp = c[1] << 8 | c[0];\n width = tmp & 0x3FFF;\n horizontal_scale = tmp >> 14;\n tmp = c[3] << 8 | c[2];\n height = tmp & 0x3FFF;\n vertical_scale = tmp >> 14;\n return {\n width: width,\n height: height,\n data: VP8,\n riff: riff\n };\n }\n\n // i think i'm going off on a riff by pretending this is some known\n // idiom which i'm making a casual and brilliant pun about, but since\n // i can't find anything on google which conforms to this idiomatic\n // usage, I'm assuming this is just a consequence of some psychotic\n // break which makes me make up puns. well, enough riff-raff (aha a\n // rescue of sorts), this function was ripped wholesale from weppy\n\n function parseRIFF(string) {\n var offset = 0;\n var chunks = {};\n\n while (offset < string.length) {\n var id = string.substr(offset, 4);\n chunks[id] = chunks[id] || [];\n if (id == 'RIFF' || id == 'LIST') {\n var len = parseInt(string.substr(offset + 4, 4).split('').map(function (i) {\n var unpadded = i.charCodeAt(0).toString(2);\n return new Array(8 - unpadded.length + 1).join('0') + unpadded;\n }).join(''), 2);\n var data = string.substr(offset + 4 + 4, len);\n offset += 4 + 4 + len;\n chunks[id].push(parseRIFF(data));\n } else if (id == 'WEBP') {\n // Use (offset + 8) to skip past \"VP8 \"/\"VP8L\"/\"VP8X\" field after \"WEBP\"\n chunks[id].push(string.substr(offset + 8));\n offset = string.length;\n } else {\n // Unknown chunk type; push entire payload\n chunks[id].push(string.substr(offset + 4));\n offset = string.length;\n }\n }\n return chunks;\n }\n\n // here's a little utility function that acts as a utility for other functions\n // basically, the only purpose is for encoding \"Duration\", which is encoded as\n // a double (considerably more difficult to encode than an integer)\n function doubleToString(num) {\n return [].slice.call(new Uint8Array(new Float64Array([num]) //create a float64 array\n .buffer) //extract the array buffer\n , 0) // convert the Uint8Array into a regular array\n .map(function (e) {\n //since it's a regular array, we can now use map\n return String.fromCharCode(e); // encode all the bytes individually\n }).reverse() //correct the byte endianness (assume it's little endian for now)\n .join(''); // join the bytes in holy matrimony as a string\n }\n\n function WhammyVideo(speed, quality) {\n // a more abstract-ish API\n this.frames = [];\n this.duration = 1000 / speed;\n this.quality = quality || 0.8;\n }\n\n WhammyVideo.prototype.add = function (frame, duration) {\n if (typeof duration != 'undefined' && this.duration) throw \"you can't pass a duration if the fps is set\";\n if (typeof duration == 'undefined' && !this.duration) throw \"if you don't have the fps set, you need to have durations here.\";\n if (frame.canvas) {\n //CanvasRenderingContext2D\n frame = frame.canvas;\n }\n if (frame.toDataURL) {\n // frame = frame.toDataURL('image/webp', this.quality);\n // quickly store image data so we don't block cpu. encode in compile method.\n frame = frame.getContext('2d-lodpi').getImageData(0, 0, frame.width, frame.height);\n } else if (typeof frame != \"string\") {\n throw \"frame must be a a HTMLCanvasElement, a CanvasRenderingContext2D or a DataURI formatted string\";\n }\n if (typeof frame === \"string\" && !/^data:image\\/webp;base64,/ig.test(frame)) {\n throw \"Input must be formatted properly as a base64 encoded DataURI of type image/webp\";\n }\n this.frames.push({\n image: frame,\n duration: duration || this.duration\n });\n };\n\n // deferred webp encoding. Draws image data to canvas, then encodes as dataUrl\n WhammyVideo.prototype.encodeFrames = function (callback) {\n\n if (this.frames[0].image instanceof ImageData) {\n\n var frames = this.frames;\n var tmpCanvas = document.createElement('canvas');\n var tmpContext = tmpCanvas.getContext('2d-lodpi');\n tmpCanvas.width = this.frames[0].image.width;\n tmpCanvas.height = this.frames[0].image.height;\n\n var encodeFrame = function (index) {\n console.log('encodeFrame', index);\n var frame = frames[index];\n tmpContext.putImageData(frame.image, 0, 0);\n frame.image = tmpCanvas.toDataURL('image/webp', this.quality);\n if (index < frames.length - 1) {\n setTimeout(function () {\n encodeFrame(index + 1);\n }, 1);\n } else {\n callback();\n }\n }.bind(this);\n\n encodeFrame(0);\n } else {\n callback();\n }\n };\n\n WhammyVideo.prototype.compile = function (outputAsArray, callback) {\n\n this.encodeFrames(function () {\n var width = 0;\n var height = 0;\n var webm = new toWebM(this.frames.map(function (frame) {\n var webp = parseWebP(parseRIFF(atob(frame.image.slice(23))));\n webp.duration = frame.duration;\n if (!webp || !webp.width || !webp.height) return null;\n if (!width) width = webp.width;else if (width !== webp.width) return null;\n if (!height) height = webp.height;else if (height !== webp.height) return null;\n return webp;\n }).filter(function (frame) {\n return !!frame;\n }), outputAsArray);\n callback(webm);\n }.bind(this));\n };\n\n return {\n Video: WhammyVideo,\n fromImageArray: function fromImageArray(images, fps, outputAsArray) {\n return toWebM(images.map(function (image) {\n var webp = parseWebP(parseRIFF(atob(image.slice(23))));\n webp.duration = 1000 / fps;\n return webp;\n }), outputAsArray);\n },\n toWebM: toWebM\n // expose methods of madness\n };\n}();","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _morph = require('./morph');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nvar _pix2pix = require('./pix2pix');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nvar _pix2pixhd = require('./pix2pixhd');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nvar _pix2wav = require('./pix2wav');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nvar _samplernn = require('./samplernn');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = {\n morph: _morph2.default, pix2pix: _pix2pix2.default, pix2pixhd: _pix2pixhd2.default, pix2wav: _pix2wav2.default, samplernn: _samplernn2.default\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.moduleReducer = undefined;\n\nvar _redux = require('redux');\n\nvar _morph = require('./morph/morph.reducer');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nvar _pix2pix = require('./pix2pix/pix2pix.reducer');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nvar _pix2pixhd = require('./pix2pixhd/pix2pixhd.reducer');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nvar _pix2wav = require('./pix2wav/pix2wav.reducer');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nvar _samplernn = require('./samplernn/samplernn.reducer');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar moduleReducer = exports.moduleReducer = (0, _redux.combineReducers)({\n morph: _morph2.default,\n pix2pix: _pix2pix2.default,\n pix2pixhd: _pix2pixhd2.default,\n pix2wav: _pix2wav2.default,\n samplernn: _samplernn2.default\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _morph = require('./views/morph.app');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('morph');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('morph');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/morph/app/', component: _morph2.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/morph/app/', name: 'morph' }];\n}\n\nexports.default = {\n name: 'morph',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load_data = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _morph = require('./morph.module');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_data = exports.load_data = function load_data(id) {\n return function (dispatch) {\n var module = _morph2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_sequences({ module: 'pix2pixhd', dir: 'sequences' }), _actions2.default.socket.list_directory({ module: module, dir: 'renders' })], function (percent, i, n) {\n console.log('morph load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'morph' }\n });\n }).then(function (res) {\n var _res = _slicedToArray(res, 3),\n datasetApiReport = _res[0],\n sequences = _res[1],\n renders = _res[2];\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder,\n resultsFolder = datasetApiReport.resultsFolder;\n\n\n dispatch({\n type: _types2.default.morph.load,\n data: datasetApiReport,\n app: {\n resultsFolder: resultsFolder,\n files: files,\n sequences: sequences,\n renders: renders\n }\n });\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar morphModule = {\n name: 'morph',\n displayName: 'Morph',\n datatype: 'video'\n};\n\nexports.default = morphModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar morphInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folder_id: 0,\n data: null,\n app: null\n};\n\nvar morphReducer = function morphReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : morphInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'morph') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.morph.load:\n console.log('morph load', action.app);\n return _extends({}, state, {\n app: action.app,\n loading: false,\n data: action.data\n });\n case _types2.default.file.create:\n console.log(action);\n if (action.data.module !== 'morph') return state;\n return _extends({}, state, {\n app: state.app && _extends({}, state.app, {\n files: [action.data].concat(state.app.files)\n })\n });\n default:\n return state;\n }\n};\n\nexports.default = morphReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.morph_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _morph = require('./morph.module');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar morph_task = exports.morph_task = function morph_task(state, folder) {\n return function (dispatch) {\n if (state.a === 'PLACEHOLDER' || state.b === 'PLACEHOLDER') return;\n var task = {\n module: _morph2.default.name,\n activity: 'morph',\n dataset: state.a,\n folder_id: folder.id,\n opt: state\n };\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _morph = require('../morph.actions');\n\nvar morphActions = _interopRequireWildcard(_morph);\n\nvar _morph2 = require('../morph.tasks');\n\nvar morphTasks = _interopRequireWildcard(_morph2);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _common = require('../../../common');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar yes_count = 0;\n\nvar MorphResults = function (_Component) {\n _inherits(MorphResults, _Component);\n\n function MorphResults(props) {\n _classCallCheck(this, MorphResults);\n\n var _this = _possibleConstructorReturn(this, (MorphResults.__proto__ || Object.getPrototypeOf(MorphResults)).call(this));\n\n _this.state = {\n dataset_module: 'pix2pixhd',\n a: \"PLACEHOLDER\",\n b: \"PLACEHOLDER\",\n a_offset: 0,\n a_duration: 1,\n a_pos: 0,\n b_offset: 0,\n b_duration: 1,\n b_pos: 0,\n steps: 16,\n dilate: 2,\n frames: 32,\n padding: 3,\n smooth: true,\n mode: 'mix'\n };\n if (!props.morph.data) props.actions.load_data();\n return _this;\n }\n\n _createClass(MorphResults, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n yes_count = 0;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (!this.props.morph.app) return (0, _preact.h)(_loading2.default, { progress: this.props.morph.progress });\n\n var _props$morph$app = this.props.morph.app,\n resultsFolder = _props$morph$app.resultsFolder,\n sequences = _props$morph$app.sequences,\n renders = _props$morph$app.renders,\n files = _props$morph$app.files;\n\n var sequence_options = sequences.map(function (sequence) {\n return [sequence.name.split(\"_\").slice(0, 3).join(\" \") + \"~ (\" + sequence.count + \")\", sequence.name];\n });\n var sequenceLookup = sequences.reduce(function (a, b) {\n return a[b.name] = b, a;\n }, {});\n\n var totalLength = this.state.frames / 25;\n var lengthWarning = void 0;\n if (this.state.steps / this.state.dilate > 64 && this.state.mode === 'mix') {\n lengthWarning = (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)('br', null),\n 'warning, this will take a while'\n );\n }\n\n return (0, _preact.h)(\n 'div',\n { className: 'app morph' },\n (0, _preact.h)(\n 'div',\n { className: 'heading row middle' },\n (0, _preact.h)(\n 'h1',\n null,\n 'Morph'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'rows params renders' },\n (0, _preact.h)(\n 'div',\n { 'class': 'column' },\n (0, _preact.h)(\n _common.Group,\n { title: 'From' },\n (0, _preact.h)(_common.Select, {\n title: 'Starting sequence',\n placeholder: 'Please choose a video',\n value: this.state.a,\n options: sequence_options,\n onChange: function onChange(name, key) {\n return _this2.setState({ a: key, a_duration: sequenceLookup[key].count, a_pos: 0, a_offset: 0 });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n title: 'Offset',\n value: this.state.a_pos,\n min: 0, max: 1, step: 0.01,\n onChange: function onChange(key) {\n return _this2.setState({ a_pos: key, a_offset: Math.floor(key * (_this2.state.a_duration - _this2.state.frames)) });\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'To' },\n (0, _preact.h)(_common.Select, {\n title: 'Ending sequence',\n placeholder: 'Please choose a video',\n value: this.state.b,\n options: sequence_options,\n onChange: function onChange(name, key) {\n return _this2.setState({ b: key, b_duration: sequenceLookup[key].count, b_pos: 0, b_offset: 0 });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n title: 'Offset',\n value: this.state.b_pos,\n min: 0, max: 1, step: 0.01,\n onChange: function onChange(key) {\n return _this2.setState({ b_pos: key, b_offset: Math.floor(key * (_this2.state.b_duration - _this2.state.frames)) });\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Morph Settings' },\n (0, _preact.h)(_common.Select, {\n title: \"Mode\",\n value: this.state.mode,\n options: ['mix', 'average', 'mix_images'],\n onChange: function onChange(name, key) {\n return _this2.setState({ mode: key });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n type: 'list',\n title: 'Steps',\n value: this.state.steps,\n options: [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096],\n onChange: function onChange(key) {\n return _this2.setState({ steps: key, frames: key * _this2.state.dilate });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n type: 'list',\n title: 'Dilate',\n value: this.state.dilate,\n options: [1, 2, 4, 8, 16, 32],\n onChange: function onChange(key) {\n return _this2.setState({ dilate: key, frames: _this2.state.steps * key });\n }\n }),\n (0, _preact.h)(_common.Checkbox, {\n title: 'Smooth',\n value: this.state.smooth,\n onToggle: function onToggle(key) {\n return _this2.setState({ smooth: key });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n type: 'int',\n title: 'Padding (in seconds)',\n value: this.state.padding,\n min: 0, max: 30, step: 1,\n onChange: function onChange(key) {\n return _this2.setState({ padding: key });\n }\n }),\n (0, _preact.h)(_common.Button, {\n title: 'Run task',\n value: 'Morph!',\n onClick: function onClick() {\n return _this2.props.remote.morph_task(_this2.state, resultsFolder);\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n _common.Param,\n { title: 'Total length' },\n totalLength.toFixed(1) + \" seconds\"\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Total frames' },\n this.state.frames + \" frames\"\n ),\n lengthWarning,\n (0, _preact.h)('br', null),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(\n 'h3',\n null,\n 'morphed videos'\n ),\n (0, _preact.h)(_common.FileList, {\n linkFiles: true,\n files: files,\n orderBy: 'date desc',\n fields: 'name datetime size delete',\n onDelete: function onDelete(file) {\n var yes = void 0;\n if (yes_count < 3) {\n yes = confirm('Are you sure you want to delete this file?');\n } else {\n yes = true;\n }\n if (yes) {\n yes_count += 1;\n console.log('delete: confirmed');\n _actions2.default.file.destroy(file);\n }\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'h3',\n null,\n 'renders on server'\n ),\n (0, _preact.h)(_common.FileList, {\n files: renders,\n orderBy: 'date desc',\n fields: 'name datetime time size',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a result', file);\n _this2.handlePick(file);\n }\n })\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n // this.props.audioPlayer.play(file)\n }\n }]);\n\n return MorphResults;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n morph: state.module.morph\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(morphActions, dispatch),\n remote: (0, _redux.bindActionCreators)(morphTasks, dispatch)\n // audioPlayer: bindActionCreators(audioPlayerActions, dispatch),\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(MorphResults);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pix = require('./views/pix2pix.new');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nvar _pix2pix3 = require('./views/pix2pix.show');\n\nvar _pix2pix4 = _interopRequireDefault(_pix2pix3);\n\nvar _pix2pix5 = require('./views/pix2pix.live');\n\nvar _pix2pix6 = _interopRequireDefault(_pix2pix5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('pix2pix');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #fde, #ffe)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('pix2pix');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #fde, #ffe)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/new/', component: _pix2pix2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/sequences/', component: _pix2pix4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/sequences/:id/', component: _pix2pix4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/live/', component: _pix2pix6.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/pix2pix/new/', name: 'new' }, { url: '/pix2pix/sequences/', name: 'sequences' }, { url: '/pix2pix/live/', name: 'live' }];\n}\n\nexports.default = {\n name: 'pix2pix',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pix = require('./pix2pix.module');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _pix2pix2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: module, dir: 'sequences/pix2pix/' }), _actions2.default.socket.list_directory({ module: module, dir: 'datasets/pix2pix/' }), _actions2.default.socket.list_directory({ module: module, dir: 'checkpoints/pix2pix/' })], function (percent, i, n) {\n console.log('pix2pix load progress', i, n);\n dispatch({ type: _types2.default.app.load_progress, progress: { i: i, n: n } });\n }).then(function (res) {\n var _res = _slicedToArray(res, 4),\n datasetApiReport = _res[0],\n sequences = _res[1],\n datasets = _res[2],\n checkpoints = _res[3]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder;\n // console.log(datasetUsage)\n\n var sequenceDirectories = sequences.filter(function (s) {\n return s.dir;\n });\n // console.log(sequenceDirectories)\n sequenceDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.isBuilt = true;\n // console.log(dir.name, dataset)\n });\n\n datasets.filter(function (s) {\n return s.dir;\n }).forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasDataset = true;\n });\n\n var checkpointDirectories = checkpoints.filter(function (s) {\n return s.dir;\n });\n checkpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dataset.checkpoints = [dir];\n });\n\n // console.log(res)\n\n // flatDatasets.forEach(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const name = file.name.split('.')[0]\n // const dataset = datasetLoader.getDataset(module, datasetLookup, name, unsortedFolder, file.date)\n // file.persisted = false\n // dataset.input.push(file.uuid)\n // })\n\n // // exp:coccokit_3-frame_sizes:8,2-n_rnn:2-dataset:coccokit_3\n // const checkpoints = results.filter(s => s.dir).map(s => {\n // const checkpoint = s.name\n // .split('-')\n // .map(s => s.split(':'))\n // .filter(b => b.length && b[1])\n // .reduce((a,b) => (a[b[0]] = b[1]) && a, {})\n // checkpoint.name = checkpoint.name || checkpoint.dataset || checkpoint.exp\n // checkpoint.date = s.date\n // checkpoint.dir = s\n // checkpoint.persisted = false\n // const dataset = datasetLoader.getDataset(module, datasetLookup, checkpoint.name, unsortedFolder, checkpoint.date)\n // const loss = lossReport[checkpoint.name]\n // if (loss) {\n // dataset.epoch = checkpoint.epoch = loss.length\n // checkpoint.training_loss = loss\n // }\n // dataset.checkpoints.push(checkpoint)\n // return checkpoint\n // })\n\n // output.map(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const pair = file.name.split('.')[0].split('-')\n // const dataset = datasetLoader.getDataset(module, datasetLookup, pair[0], unsortedFolder, file.date)\n // file.persisted = false\n // file.epoch = parseInt(file.epoch || pair[1].replace(/^\\D+/, '')) || 0\n // dataset.epoch = Math.max(file.epoch, dataset.epoch || 0)\n // // here check if the file exists in dataset, if so just check that it's persisted\n // const found = dataset.output.some(file_id => {\n // // if (f.name === \n // if (fileLookup[file_id].name === file.name) {\n // fileLookup[file_id].persisted = true\n // return true\n // }\n // return false\n // })\n // if (! found) {\n // dataset.output.push(file.uuid)\n // }\n // })\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n sequences: sequenceDirectories,\n datasets: datasets,\n checkpoints: checkpointDirectories\n }\n });\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar pix2pixModule = {\n name: 'pix2pix',\n displayName: 'Pix2Pix',\n datatype: 'video'\n};\n\nexports.default = pix2pixModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar pix2pixInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folder_id: 0,\n data: null\n};\n\nvar pix2pixReducer = function pix2pixReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : pix2pixInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'pix2pix') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexports.default = pix2pixReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.train_task = exports.live_task = exports.fetch_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fetch_task = exports.fetch_task = function fetch_task(url, file_id, dataset) {\n return function (dispatch) {\n if (!url) return console.log('input file inaccessible (no url)');\n var task = {\n module: 'pix2pix',\n activity: 'fetch',\n dataset: dataset,\n opt: {\n url: url,\n file_id: file_id,\n dataset: dataset\n }\n };\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar live_task = exports.live_task = function live_task(sequence, checkpoint) {\n return function (dispatch) {\n var task = {\n module: 'pix2pix',\n activity: 'live',\n dataset: sequence,\n checkpoint: checkpoint,\n opt: {\n poll_delay: 0.09\n }\n };\n console.log(task);\n console.log('add live task');\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar train_task = exports.train_task = function train_task(dataset, folder_id) {\n var epochs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n return function (dispatch) {\n var task = {\n module: 'pix2pix',\n activity: 'train',\n dataset: dataset.name,\n epoch: 0,\n epochs: epochs,\n opt: {\n folder_id: folder_id,\n load_size: 264 // switch to 256 for pix2wav\n }\n };\n console.log(task);\n return _actions2.default.queue.add_task(task);\n };\n};\n// export const log_task = (dataset) => dispatch => {\n// const task = {\n// module: 'samplernn',\n// activity: 'log',\n// dataset: dataset.name,\n// }\n// return actions.queue.add_task(task)\n// }\n// export const clear_cache_task = (dataset) => dispatch => {\n// const task = {\n// module: 'samplernn',\n// activity: 'clear_cache',\n// dataset: dataset.name,\n// }\n// return actions.queue.add_task(task)\n// }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _common = require('../../../common/');\n\nvar _player = require('../../../live/player');\n\nvar _live = require('../../../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../../../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _pix2pix = require('../pix2pix.tasks');\n\nvar pix2pixTasks = _interopRequireWildcard(_pix2pix);\n\nvar _pix2pix2 = require('../pix2pix.actions');\n\nvar pix2pixActions = _interopRequireWildcard(_pix2pix2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixLive = function (_Component) {\n _inherits(Pix2PixLive, _Component);\n\n function Pix2PixLive(props) {\n _classCallCheck(this, Pix2PixLive);\n\n // if (! props.pix2pix || ! props.pix2pix.data) {\n var _this = _possibleConstructorReturn(this, (Pix2PixLive.__proto__ || Object.getPrototypeOf(Pix2PixLive)).call(this));\n\n props.actions.pix2pix.load_directories();\n // }\n props.actions.live.get_params();\n // props.actions.live.list_checkpoints('pix2pix')\n // props.actions.live.list_sequences('pix2pix')\n _this.changeCheckpoint = _this.changeCheckpoint.bind(_this);\n _this.changeEpoch = _this.changeEpoch.bind(_this);\n _this.changeSequence = _this.changeSequence.bind(_this);\n _this.seek = _this.seek.bind(_this);\n _this.togglePlaying = _this.togglePlaying.bind(_this);\n _this.toggleRecording = _this.toggleRecording.bind(_this);\n return _this;\n }\n\n _createClass(Pix2PixLive, [{\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n this.props.actions.live.list_epochs('pix2pix', nextProps.opt.checkpoint_name);\n }\n }\n }, {\n key: 'changeCheckpoint',\n value: function changeCheckpoint(field, checkpoint_name) {\n this.props.actions.live.load_epoch(checkpoint_name, 'latest');\n }\n }, {\n key: 'changeEpoch',\n value: function changeEpoch(field, epoch_name) {\n this.props.actions.live.load_epoch(this.props.opt.checkpoint_name, epoch_name);\n }\n }, {\n key: 'changeSequence',\n value: function changeSequence(field, sequence) {\n console.log('load sequence', sequence);\n this.props.actions.live.load_sequence(sequence);\n }\n }, {\n key: 'seek',\n value: function seek(percentage) {\n var frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1);\n console.log(\"seek to frame\", percentage, frame);\n this.props.actions.live.seek(frame);\n }\n }, {\n key: 'start',\n value: function start() {\n // console.log(this.props)\n var sequence = this.props.pix2pix.data.sequences[0].name;\n var checkpoint = this.props.pix2pix.data.checkpoints[0].name;\n console.log('starting up!', sequence, checkpoint);\n this.props.actions.tasks.live_task(sequence, checkpoint);\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'togglePlaying',\n value: function togglePlaying() {\n if (this.props.opt.processing) {\n this.props.actions.live.pause();\n } else {\n this.props.actions.live.play();\n }\n }\n }, {\n key: 'toggleRecording',\n value: function toggleRecording() {\n if (this.props.opt.recording) {\n (0, _player.stopRecording)();\n this.props.actions.live.pause();\n } else {\n (0, _player.startRecording)();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n // console.log(this.props)\n if (this.props.pix2pix.loading) {\n return (0, _preact.h)(_common.Loading, null);\n }\n return (0, _preact.h)(\n 'div',\n { className: 'app centered' },\n (0, _preact.h)(_common.Player, { width: 424, height: 256 }),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Playback',\n noToggle: true\n },\n (0, _preact.h)(_common.Select, {\n name: 'send_image',\n title: 'view mode',\n options: ['a', 'b', 'sequence', 'recursive'],\n onChange: this.props.actions.live.set_param\n }),\n (0, _preact.h)(_common.Select, {\n name: 'sequence_name',\n title: 'sequence',\n options: this.props.pix2pix.data.sequences.map(function (file) {\n return file.name;\n }),\n onChange: this.changeSequence\n }),\n (0, _preact.h)(_common.Select, {\n name: 'checkpoint_name',\n title: 'checkpoint',\n options: this.props.pix2pix.data.checkpoints.map(function (file) {\n return file.name;\n }),\n onChange: this.changeCheckpoint\n }),\n (0, _preact.h)(_common.Select, {\n name: 'epoch',\n title: 'epoch',\n options: this.props.epochs,\n onChange: this.changeEpoch\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'position',\n min: 0.0, max: 1.0, type: 'float',\n value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1),\n onChange: this.seek\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'frame_delay',\n min: 0.05, max: 2.0, type: 'float'\n }),\n this.renderRestartButton(),\n (0, _preact.h)(\n _common.Button,\n {\n title: this.props.opt.savingVideo ? 'Saving video...' : this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames / 25) + ')' : 'Record video',\n onClick: this.toggleRecording\n },\n this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Save frame',\n onClick: _player.saveFrame\n },\n 'Save'\n ),\n (0, _preact.h)(_common.ParamGroup, {\n title: 'Render on server',\n name: 'store_b',\n onToggle: function onToggle(value) {\n // now storing frames on server...\n }\n }),\n (0, _preact.h)(\n 'p',\n { 'class': 'last_message' },\n this.props.last_message\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transition',\n name: 'transition'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_period',\n min: 10, max: 5000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_min',\n min: 0.001, max: 0.2, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_max',\n min: 0.1, max: 1.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Recursion',\n name: 'recursive'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recursive_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll',\n min: -64, max: 64, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll_axis',\n min: 0, max: 1, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Sequence',\n name: 'sequence'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'sequence_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'process_frac',\n min: 0, max: 1, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Clahe',\n name: 'clahe'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'clip_limit',\n min: 1.0, max: 4.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Posterize',\n name: 'posterize'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'spatial_window',\n min: 2, max: 128, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'color_window',\n min: 2, max: 128, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Blur',\n name: 'blur'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_radius',\n min: 3, max: 7, type: 'odd'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_sigma',\n min: 0, max: 2, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Canny Edge Detection',\n name: 'canny'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_lo',\n min: 10, max: 200, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_hi',\n min: 10, max: 200, type: 'int'\n })\n )\n )\n )\n );\n }\n }, {\n key: 'renderRestartButton',\n value: function renderRestartButton() {\n var _this2 = this;\n\n if (this.props.runner.gpu.status === 'IDLE') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Idle',\n onClick: function onClick() {\n return _this2.start();\n }\n },\n 'Start'\n );\n }\n if (this.props.runner.gpu.task.module !== 'pix2pix') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n );\n }\n if (!this.props.opt.processing) {\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Not processing',\n onClick: this.togglePlaying\n },\n 'Restart'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Processing',\n onClick: this.togglePlaying\n },\n 'Stop'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n }]);\n\n return Pix2PixLive;\n}(_preact.Component);\n\nfunction timeInSeconds(n) {\n return n.toFixed(1) + ' s.';\n}\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n last_message: state.live.last_message,\n opt: state.live.opt,\n frame: state.live.frame,\n checkpoints: state.live.checkpoints,\n epochs: state.live.epochs,\n sequences: state.live.sequences,\n runner: state.system.runner,\n pix2pix: state.module.pix2pix\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n live: (0, _redux.bindActionCreators)(liveActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n pix2pix: (0, _redux.bindActionCreators)(pix2pixActions, dispatch),\n tasks: (0, _redux.bindActionCreators)(pix2pixTasks, dispatch), s: s\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixLive);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _common = require('../../../common');\n\nvar _pix2pix = require('../pix2pix.actions');\n\nvar pix2pixActions = _interopRequireWildcard(_pix2pix);\n\nvar _pix2pix2 = require('../pix2pix.module');\n\nvar _pix2pix3 = _interopRequireDefault(_pix2pix2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Pix2PixNew(props) {\n return (0, _preact.h)(_common.Views.New, {\n db: props.pix2pix,\n path: '/pix2pix/sequences/',\n actions: props.actions,\n module: _pix2pix3.default,\n history: props.history\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pix: state.module.pix2pix\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixNew);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pix = require('../pix2pix.actions');\n\nvar pix2pixActions = _interopRequireWildcard(_pix2pix);\n\nvar _pix2pix2 = require('../pix2pix.tasks');\n\nvar pix2pixTasks = _interopRequireWildcard(_pix2pix2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2pix3 = require('../pix2pix.module');\n\nvar _pix2pix4 = _interopRequireDefault(_pix2pix3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2pixShow = function (_Component) {\n _inherits(Pix2pixShow, _Component);\n\n function Pix2pixShow(props) {\n _classCallCheck(this, Pix2pixShow);\n\n var _this = _possibleConstructorReturn(this, (Pix2pixShow.__proto__ || Object.getPrototypeOf(Pix2pixShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(Pix2pixShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2pix.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2pix = _props.pix2pix,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2pix.last_id', id);\n if (!pix2pix.folder || pix2pix.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2pix/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n pix2pix = _props2.pix2pix,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = pix2pix.data || {},\n folderLookup = _ref.folderLookup;\n\n var folder = (folderLookup || {})[pix2pix.folder_id] || {};\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pix' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'div',\n { 'class': 'spaced' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_common.Loading, null)\n ),\n (0, _preact.h)(_upload2.default, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n folder && folder.name && folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, {\n title: 'Add Files',\n module: _pix2pix4.default,\n folder: folder,\n canUpload: true, canAddURL: true\n }),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_upload2.default, null),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(_dataset6.default, {\n loading: pix2pix.loading,\n progress: pix2pix.progress,\n id: pix2pix.folder_id,\n module: _pix2pix4.default,\n data: pix2pix.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n pix2pix = _props3.pix2pix,\n remote = _props3.remote;\n\n var input = pix2pix.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n console.log(dataset);\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 5);\n } },\n '5x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 10);\n } },\n '10x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 20);\n } },\n '20x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 50);\n } },\n '50x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'rm'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }]);\n\n return Pix2pixShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pix: state.module.pix2pix\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2pixShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('./views/pix2pixhd.new');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nvar _pix2pixhd3 = require('./views/pix2pixhd.show');\n\nvar _pix2pixhd4 = _interopRequireDefault(_pix2pixhd3);\n\nvar _pix2pixhd5 = require('./views/pix2pixhd.results');\n\nvar _pix2pixhd6 = _interopRequireDefault(_pix2pixhd5);\n\nvar _pix2pixhd7 = require('./views/pix2pixhd.train');\n\nvar _pix2pixhd8 = _interopRequireDefault(_pix2pixhd7);\n\nvar _pix2pixhd9 = require('./views/pix2pixhd.live');\n\nvar _pix2pixhd10 = _interopRequireDefault(_pix2pixhd9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('pix2pixhd');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('pix2pixhd');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/new/', component: _pix2pixhd2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/sequences/', component: _pix2pixhd4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/sequences/:id/', component: _pix2pixhd4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/train/', component: _pix2pixhd8.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/results/', component: _pix2pixhd6.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/live/', component: _pix2pixhd10.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/pix2pixhd/new/', name: 'folders' }, { url: '/pix2pixhd/sequences/', name: 'sequences' }, { url: '/pix2pixhd/train/', name: 'checkpoints' }, { url: '/pix2pixhd/results/', name: 'results' }, { url: '/pix2pixhd/live/', name: 'live' }];\n}\n\nexports.default = {\n name: 'pix2pixhd',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.count_dataset = exports.list_epochs = exports.load_results = exports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('./pix2pixhd.module');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: module, dir: 'sequences' }), _actions2.default.socket.list_directory({ module: module, dir: 'datasets' }), _actions2.default.socket.list_directory({ module: module, dir: 'checkpoints' })], function (percent, i, n) {\n console.log('pix2pixhd load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'pix2pixhd' }\n });\n }).then(function (res) {\n var _res = _slicedToArray(res, 4),\n datasetApiReport = _res[0],\n sequences = _res[1],\n datasets = _res[2],\n checkpoints = _res[3]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder,\n resultsFolder = datasetApiReport.resultsFolder;\n // console.log(datasetUsage)\n\n var sequenceDirectories = sequences.filter(function (s) {\n return s.dir;\n });\n // console.log(sequenceDirectories)\n sequenceDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.isBuilt = true;\n // console.log(dir.name, dataset)\n });\n\n datasets.filter(function (s) {\n return s.dir;\n }).forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasDataset = true;\n });\n\n var checkpointDirectories = checkpoints.filter(function (s) {\n return s.dir;\n });\n checkpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dataset.checkpoints = [dir];\n });\n\n // console.log(res)\n\n // flatDatasets.forEach(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const name = file.name.split('.')[0]\n // const dataset = datasetLoader.getDataset(module, datasetLookup, name, unsortedFolder, file.date)\n // file.persisted = false\n // dataset.input.push(file.uuid)\n // })\n\n // // exp:coccokit_3-frame_sizes:8,2-n_rnn:2-dataset:coccokit_3\n // const checkpoints = results.filter(s => s.dir).map(s => {\n // const checkpoint = s.name\n // .split('-')\n // .map(s => s.split(':'))\n // .filter(b => b.length && b[1])\n // .reduce((a,b) => (a[b[0]] = b[1]) && a, {})\n // checkpoint.name = checkpoint.name || checkpoint.dataset || checkpoint.exp\n // checkpoint.date = s.date\n // checkpoint.dir = s\n // checkpoint.persisted = false\n // const dataset = datasetLoader.getDataset(module, datasetLookup, checkpoint.name, unsortedFolder, checkpoint.date)\n // const loss = lossReport[checkpoint.name]\n // if (loss) {\n // dataset.epoch = checkpoint.epoch = loss.length\n // checkpoint.training_loss = loss\n // }\n // dataset.checkpoints.push(checkpoint)\n // return checkpoint\n // })\n\n // output.map(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const pair = file.name.split('.')[0].split('-')\n // const dataset = datasetLoader.getDataset(module, datasetLookup, pair[0], unsortedFolder, file.date)\n // file.persisted = false\n // file.epoch = parseInt(file.epoch || pair[1].replace(/^\\D+/, '')) || 0\n // dataset.epoch = Math.max(file.epoch, dataset.epoch || 0)\n // // here check if the file exists in dataset, if so just check that it's persisted\n // const found = dataset.output.some(file_id => {\n // // if (f.name === \n // if (fileLookup[file_id].name === file.name) {\n // fileLookup[file_id].persisted = true\n // return true\n // }\n // return false\n // })\n // if (! found) {\n // dataset.output.push(file.uuid)\n // }\n // })\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n sequences: sequenceDirectories,\n datasets: datasets,\n checkpoints: checkpointDirectories,\n resultsFolder: resultsFolder\n }\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};\n\nvar load_results = exports.load_results = function load_results(id) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _util2.default.allProgress([_actions2.default.folder.index({ name: 'results' }), _actions2.default.file.index({ module: module, generated: 1 }), _actions2.default.socket.list_sequences({ module: module, dir: 'results' }), _actions2.default.socket.list_directory({ module: module, dir: 'renders' })], function (percent, i, n) {\n console.log('pix2pixhd load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'pix2pixhd' }\n });\n }).then(function (res) {\n var _res2 = _slicedToArray(res, 4),\n folders = _res2[0],\n files = _res2[1],\n results = _res2[2],\n renders = _res2[3]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n console.log(files, results, renders);\n dispatch({\n type: _types2.default.pix2pixhd.load_results,\n results: {\n resultsFolder: folders[0],\n files: files,\n results: results,\n renders: renders\n }\n });\n });\n };\n};\n\nvar G_NET_REGEXP = new RegExp('_net_G.pth$');\n\nvar list_epochs = exports.list_epochs = function list_epochs(checkpoint_name) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _actions2.default.socket.list_directory({ module: module, dir: 'checkpoints/' + checkpoint_name }).then(function (files) {\n // console.log(files)\n var epochs = files.map(function (f) {\n if (!f.name.match(G_NET_REGEXP)) return null;\n return f.name.replace(G_NET_REGEXP, '');\n }).filter(function (f) {\n return !!f;\n });\n // console.log(epochs)\n dispatch({\n type: _types2.default.dataset.list_epochs,\n data: {\n epochs: epochs,\n module: module\n }\n });\n });\n };\n};\n\nvar count_dataset = exports.count_dataset = function count_dataset(checkpoint_name) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _util2.default.allProgress([_actions2.default.socket.count_directory({ module: module, dir: 'sequences/' + checkpoint_name + '/' }), _actions2.default.socket.count_directory({ module: module, dir: 'datasets/' + checkpoint_name + '/train_A/' })], function (percent, i, n) {\n console.log('pix2pixhd load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'pix2pixhd' }\n });\n }).then(function (res) {\n var _res3 = _slicedToArray(res, 2),\n sequenceCount = _res3[0],\n datasetCount = _res3[1]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n console.log(sequenceCount, datasetCount);\n dispatch({\n type: _types2.default.pix2pixhd.load_dataset_count,\n data: {\n name: checkpoint_name,\n sequenceCount: sequenceCount,\n datasetCount: datasetCount\n }\n });\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar pix2pixhdModule = {\n name: 'pix2pixhd',\n displayName: 'Pix2PixHD',\n datatype: 'video'\n};\n\nexports.default = pix2pixhdModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar pix2pixhdInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folder_id: 0,\n data: null,\n results: null,\n checkpoint: {\n name: '',\n sequenceCount: 0,\n datasetCount: 0\n }\n};\n\nvar pix2pixhdReducer = function pix2pixhdReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : pix2pixhdInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'pix2pixhd') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.pix2pixhd.load_results:\n return _extends({}, state, {\n results: action.results\n });\n case _types2.default.pix2pixhd.load_dataset_count:\n return _extends({}, state, {\n checkpoint: action.data\n });\n case _types2.default.file.destroy:\n console.log('file destroy', state.results);\n return _extends({}, state, {\n results: _extends({}, state.results, {\n files: state.results.files.filter(function (f) {\n return f.id !== action.data.id;\n })\n })\n });\n default:\n return state;\n }\n};\n\nexports.default = pix2pixhdReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.clear_recursive_task = exports.augment_task = exports.live_task = exports.train_task = exports.fetch_task = undefined;\n\nvar _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; };\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _pix2pixhd = require('./pix2pixhd.module');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fetch_task = exports.fetch_task = function fetch_task(url, file_id, dataset) {\n return function (dispatch) {\n if (!url) return console.log('input file inaccessible (no url)');\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'fetch',\n dataset: dataset,\n opt: {\n url: url,\n file_id: file_id,\n dataset: dataset\n }\n };\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar train_task = exports.train_task = function train_task(dataset, folder_id) {\n var epochs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'train',\n dataset: dataset.name || dataset,\n epoch: 0,\n epochs: epochs,\n opt: {\n folder_id: folder_id\n }\n };\n if (!task.dataset) {\n console.error(\"train task: no dataset specified\");\n return;\n }\n console.log(task);\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar live_task = exports.live_task = function live_task(sequence, checkpoint, opt) {\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'live',\n dataset: sequence,\n checkpoint: checkpoint,\n opt: _extends({}, opt, {\n poll_delay: 0.01\n })\n };\n console.log(task);\n console.log('add live task');\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar augment_task = exports.augment_task = function augment_task(dataset, opt) {\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'augment',\n dataset: dataset,\n folder_id: opt.folder_id,\n opt: _extends({}, opt)\n };\n console.log(task);\n console.log('add augment task');\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar clear_recursive_task = exports.clear_recursive_task = function clear_recursive_task(dataset) {\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'clear_recursive',\n dataset: dataset\n };\n console.log(task);\n console.log('add clear recursive task');\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _common = require('../../../common/');\n\nvar _player = require('../../../live/player');\n\nvar _live = require('../../../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../../../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _pix2pixhd = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixHDLive = function (_Component) {\n _inherits(Pix2PixHDLive, _Component);\n\n function Pix2PixHDLive(props) {\n _classCallCheck(this, Pix2PixHDLive);\n\n // if (! props.pix2pixhd || ! props.pix2pixhd.data) {\n var _this = _possibleConstructorReturn(this, (Pix2PixHDLive.__proto__ || Object.getPrototypeOf(Pix2PixHDLive)).call(this));\n\n props.actions.pix2pixhd.load_directories();\n // }\n props.actions.live.get_params();\n // props.actions.live.list_checkpoints('pix2pixhd')\n // props.actions.live.list_sequences('pix2pixhd')\n _this.changeCheckpoint = _this.changeCheckpoint.bind(_this);\n _this.changeEpoch = _this.changeEpoch.bind(_this);\n _this.changeSequence = _this.changeSequence.bind(_this);\n _this.seek = _this.seek.bind(_this);\n _this.togglePlaying = _this.togglePlaying.bind(_this);\n _this.toggleRecording = _this.toggleRecording.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(Pix2PixHDLive, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n document.addEventListener('keydown', this.handleKeydown);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.handleKeydown);\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n console.log('listing epochs');\n this.props.actions.live.list_epochs('pix2pixhd', nextProps.opt.checkpoint_name);\n }\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n console.log(e.keyCode);\n if (e.altKey || e.ctrlKey || e.metaKey) return;\n switch (e.keyCode) {\n case 27:\n // esc\n e.preventDefault();\n this.props.actions.live.set_fullscreen(!this.props.fullscreen);\n break;\n default:\n break;\n }\n }\n }, {\n key: 'changeCheckpoint',\n value: function changeCheckpoint(field, checkpoint_name) {\n this.props.actions.live.load_epoch(checkpoint_name, 'latest');\n }\n }, {\n key: 'changeEpoch',\n value: function changeEpoch(field, epoch_name) {\n this.props.actions.live.load_epoch(this.props.opt.checkpoint_name, epoch_name);\n }\n }, {\n key: 'changeSequence',\n value: function changeSequence(field, sequence) {\n console.log('load sequence', sequence);\n this.props.actions.live.load_sequence(sequence);\n }\n }, {\n key: 'seek',\n value: function seek(percentage) {\n var frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1);\n console.log(\"seek to frame\", percentage, frame);\n this.props.actions.live.seek(frame);\n }\n }, {\n key: 'start',\n value: function start() {\n console.log(this.props.opt);\n var sequence = this.props.opt.sequence_name || this.props.pix2pixhd.data.sequences[0].name;\n var checkpoint = this.props.opt.checkpoint_name || this.props.pix2pixhd.data.checkpoints[0].name;\n console.log('starting up!', sequence, checkpoint);\n this.props.actions.tasks.live_task(sequence, checkpoint, {\n folder_id: this.props.pix2pixhd.data.resultsFolder.id\n });\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'togglePlaying',\n value: function togglePlaying() {\n if (this.props.opt.processing) {\n this.props.actions.live.pause();\n } else {\n this.props.actions.live.play();\n }\n }\n }, {\n key: 'toggleRecording',\n value: function toggleRecording() {\n if (this.props.opt.recording) {\n (0, _player.stopRecording)();\n this.props.actions.live.pause();\n } else {\n (0, _player.startRecording)();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n // console.log(this.props)\n if (this.props.pix2pixhd.loading) {\n return (0, _preact.h)(_common.Loading, { progress: this.props.pix2pixhd.progress });\n }\n var _props$pix2pixhd$data = this.props.pix2pixhd.data,\n folderLookup = _props$pix2pixhd$data.folderLookup,\n datasetLookup = _props$pix2pixhd$data.datasetLookup,\n sequences = _props$pix2pixhd$data.sequences;\n\n\n var sequenceLookup = sequences.reduce(function (a, b) {\n a[b.name] = true;\n return a;\n }, {});\n\n var sequenceGroups = Object.keys(folderLookup).map(function (id) {\n var folder = _this2.props.pix2pixhd.data.folderLookup[id];\n if (folder.name === 'results') return;\n var datasets = folder.datasets.map(function (name) {\n var sequence = sequenceLookup[name];\n if (sequence) {\n return name;\n }\n return null;\n }).filter(function (n) {\n return !!n;\n });\n return {\n name: folder.name,\n options: datasets.sort()\n };\n }).filter(function (n) {\n return !!n && !!n.options.length;\n }).sort(function (a, b) {\n return a.name.localeCompare(b.name);\n });\n\n var checkpointGroups = Object.keys(folderLookup).map(function (id) {\n var folder = _this2.props.pix2pixhd.data.folderLookup[id];\n if (folder.name === 'results') return;\n var datasets = folder.datasets.map(function (name) {\n var dataset = datasetLookup[name];\n if (dataset.checkpoints.length) {\n return name;\n }\n return null;\n }).filter(function (n) {\n return !!n;\n });\n return {\n name: folder.name,\n options: datasets.sort()\n };\n }).filter(function (n) {\n return !!n && !!n.options.length;\n }).sort(function (a, b) {\n return a.name.localeCompare(b.name);\n });\n\n return (0, _preact.h)(\n 'div',\n { className: 'app live centered' },\n (0, _preact.h)(_common.Player, { width: 424, height: 256, fullscreen: this.props.fullscreen }),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Network',\n noToggle: true\n },\n (0, _preact.h)(_common.Select, { live: true,\n name: 'send_image',\n title: 'view mode',\n options: ['a', 'b', 'sequence', 'recursive'],\n onChange: this.props.actions.live.set_param\n }),\n (0, _preact.h)(_common.SelectGroup, { live: true,\n name: 'sequence_name',\n title: 'sequence',\n options: sequenceGroups,\n onChange: this.changeSequence\n }),\n (0, _preact.h)(_common.SelectGroup, { live: true,\n name: 'checkpoint_name',\n title: 'checkpoint',\n options: checkpointGroups,\n onChange: this.changeCheckpoint\n }),\n (0, _preact.h)(_common.Select, { live: true,\n name: 'epoch',\n title: 'epoch',\n options: this.props.epochs,\n onChange: this.changeEpoch\n })\n ),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Playback',\n name: 'sequence_playing'\n },\n (0, _preact.h)(_common.Slider, {\n name: 'position',\n min: 0.0, max: 1.0, type: 'float',\n value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1),\n onChange: this.seek\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n title: 'playback rate',\n name: 'sequence_step',\n min: -4.0, max: 4.0, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n title: 'skip frames',\n name: 'sequence_skip',\n min: 0, max: 1000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n title: 'fade sequence',\n name: 'fade_sequence',\n min: 0, max: 4.0, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'frame_delay',\n min: 0.0, max: 2.0, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n _common.Group,\n null,\n this.renderRestartButton(),\n this.renderLiveButtons(),\n this.renderRecordButton(),\n (0, _preact.h)(\n 'p',\n { 'class': 'last_message' },\n this.props.last_message\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transition',\n name: 'transition'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_period',\n min: 10, max: 5000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_min',\n min: 0.001, max: 0.2, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_max',\n min: 0.1, max: 1.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Recursion',\n name: 'recursive'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recursive_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll',\n min: -64, max: 64, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll_axis',\n min: 0, max: 1, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Sequence',\n name: 'sequence'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'sequence_frac',\n min: 0.0, max: 1.0, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'process_frac',\n min: 0, max: 1, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transform',\n name: 'transform'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'rotate',\n min: -1, max: 1, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'scale',\n min: 0.9, max: 1.1, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Clahe',\n name: 'clahe'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'clip_limit',\n min: 1.0, max: 4.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Posterize',\n name: 'posterize'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'spatial_window',\n min: 2, max: 128, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'color_window',\n min: 2, max: 128, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Blur',\n name: 'blur'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_radius',\n min: 3, max: 7, type: 'odd'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_sigma',\n min: 0, max: 2, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Canny Edge Detection',\n name: 'canny'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_lo',\n min: 10, max: 200, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_hi',\n min: 10, max: 200, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Hue / Saturation',\n name: 'hsl'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'hue',\n min: -127, max: 127, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'saturation',\n min: -255, max: 255, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'luminosity',\n min: -255, max: 255, type: 'int'\n })\n )\n )\n )\n );\n }\n }, {\n key: 'renderRestartButton',\n value: function renderRestartButton() {\n var _this3 = this;\n\n // console.log(this.props.runner.gpu)\n if (this.props.runner.gpu.status === 'IDLE') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Idle',\n onClick: function onClick() {\n return _this3.start();\n }\n },\n 'Start'\n );\n }\n if (this.props.runner.gpu.task.module !== 'pix2pixhd') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this3.interrupt();\n }\n },\n 'Interrupt'\n );\n }\n if (!this.props.opt.processing) {\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Not processing',\n onClick: this.togglePlaying\n },\n 'Restart'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this3.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Processing',\n onClick: this.togglePlaying\n },\n 'Stop'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this3.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n }, {\n key: 'renderRecordButton',\n value: function renderRecordButton() {\n return null;\n // return (\n // <Button\n // title={\n // this.props.opt.savingVideo\n // ? 'Saving video...'\n // : this.props.opt.recording\n // ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames/25) +')'\n // : 'Record video'\n // }\n // onClick={this.toggleRecording}\n // >\n // {this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'}\n // </Button>\n // )\n }\n }, {\n key: 'renderLiveButtons',\n value: function renderLiveButtons() {\n var _this4 = this;\n\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Save frame',\n onClick: _player.saveFrame\n },\n 'Save'\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Record video',\n name: 'store_b',\n noDim: true,\n onToggle: function onToggle(value) {\n // now storing frames on server...\n }\n },\n (0, _preact.h)(_common.TextInput, {\n title: 'Video name',\n name: 'final_tag',\n value: this.props.opt.final_tag,\n onSave: function onSave(value) {\n _this4.props.actions.live.set_param('final_tag', value);\n }\n })\n )\n );\n }\n }]);\n\n return Pix2PixHDLive;\n}(_preact.Component);\n\nfunction timeInSeconds(n) {\n return n.toFixed(1) + ' s.';\n}\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n last_message: state.live.last_message,\n fullscreen: state.live.fullscreen,\n opt: state.live.opt,\n frame: state.live.frame,\n checkpoints: state.live.checkpoints,\n epochs: state.live.epochs,\n sequences: state.live.sequences,\n runner: state.system.runner,\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n live: (0, _redux.bindActionCreators)(liveActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n pix2pixhd: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n tasks: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch), s: s\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDLive);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _common = require('../../../common');\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.module');\n\nvar _pix2pixhd3 = _interopRequireDefault(_pix2pixhd2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Pix2PixHDNew(props) {\n return (0, _preact.h)(_common.Views.New, {\n db: props.pix2pixhd,\n path: '/pix2pixhd/sequences/',\n actions: props.actions,\n module: _pix2pixhd3.default,\n history: props.history\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDNew);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd2);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _fileList = require('../../../common/fileList.component');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar yes_count = 0;\n\nvar Pix2pixHDResults = function (_Component) {\n _inherits(Pix2pixHDResults, _Component);\n\n function Pix2pixHDResults(props) {\n _classCallCheck(this, Pix2pixHDResults);\n\n var _this = _possibleConstructorReturn(this, (Pix2pixHDResults.__proto__ || Object.getPrototypeOf(Pix2pixHDResults)).call(this));\n\n if (!props.pix2pixhd.results) props.actions.load_results();\n return _this;\n }\n\n _createClass(Pix2pixHDResults, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n yes_count = 0;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (!this.props.pix2pixhd.results) return (0, _preact.h)(_loading2.default, { progress: this.props.pix2pixhd.progress });\n\n var _props$pix2pixhd$resu = this.props.pix2pixhd.results,\n resultsFolder = _props$pix2pixhd$resu.resultsFolder,\n results = _props$pix2pixhd$resu.results,\n renders = _props$pix2pixhd$resu.renders,\n files = _props$pix2pixhd$resu.files;\n // console.log(resultsFolder, results)\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pixhd' },\n (0, _preact.h)(\n 'div',\n { className: 'heading row middle' },\n (0, _preact.h)(\n 'h1',\n null,\n 'Pix2PixHD Results'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'rows params renders' },\n (0, _preact.h)(_fileList.FileList, {\n linkFiles: true,\n files: files,\n orderBy: 'date desc',\n fields: 'name date size delete',\n onDelete: function onDelete(file) {\n var yes = void 0;\n if (yes_count < 3) {\n yes = confirm('Are you sure you want to delete this file?');\n } else {\n yes = true;\n }\n if (yes) {\n yes_count += 1;\n console.log('delete: confirmed');\n _actions2.default.file.destroy(file);\n }\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'h3',\n null,\n 'renders on server'\n ),\n (0, _preact.h)(_fileList.FileList, {\n files: renders,\n orderBy: 'date desc',\n fields: 'name date size',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a result', file);\n _this2.handlePick(file);\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'h3',\n null,\n 'folders on server'\n ),\n (0, _preact.h)(_fileList.FileList, {\n files: results,\n orderBy: 'date desc',\n fields: 'name date count',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a result', file);\n _this2.handlePick(file);\n }\n })\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n // this.props.audioPlayer.play(file)\n }\n }]);\n\n return Pix2pixHDResults;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch)\n // audioPlayer: bindActionCreators(audioPlayerActions, dispatch),\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2pixHDResults);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2pixhd3 = require('../pix2pixhd.module');\n\nvar _pix2pixhd4 = _interopRequireDefault(_pix2pixhd3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixHDShow = function (_Component) {\n _inherits(Pix2PixHDShow, _Component);\n\n function Pix2PixHDShow(props) {\n _classCallCheck(this, Pix2PixHDShow);\n\n var _this = _possibleConstructorReturn(this, (Pix2PixHDShow.__proto__ || Object.getPrototypeOf(Pix2PixHDShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(Pix2PixHDShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2pixhd.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2pixhd = _props.pix2pixhd,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2pixhd.last_id', id);\n if (!pix2pixhd.folder || pix2pixhd.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2pixhd/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n pix2pixhd = _props2.pix2pixhd,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = pix2pixhd.data || {},\n folderLookup = _ref.folderLookup;\n\n var folder = (folderLookup || {})[pix2pixhd.folder_id] || {};\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pixhd' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'div',\n { 'class': 'spaced' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_common.Loading, null)\n ),\n (0, _preact.h)(_upload2.default, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n folder && folder.name && folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, {\n title: 'Add Files',\n module: _pix2pixhd4.default,\n folder: folder,\n canUpload: true, canAddURL: true\n }),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_upload2.default, null),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(_dataset6.default, {\n loading: pix2pixhd.loading,\n progress: pix2pixhd.progress,\n id: pix2pixhd.folder_id,\n module: _pix2pixhd4.default,\n data: pix2pixhd.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n pix2pixhd = _props3.pix2pixhd,\n remote = _props3.remote;\n\n var input = pix2pixhd.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 5);\n } },\n '5x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 10);\n } },\n '10x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 20);\n } },\n '20x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 50);\n } },\n '50x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'rm'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }]);\n\n return Pix2PixHDShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2pixhd3 = require('../pix2pixhd.module');\n\nvar _pix2pixhd4 = _interopRequireDefault(_pix2pixhd3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixHDTrain = function (_Component) {\n _inherits(Pix2PixHDTrain, _Component);\n\n function Pix2PixHDTrain(props) {\n _classCallCheck(this, Pix2PixHDTrain);\n\n var _this = _possibleConstructorReturn(this, (Pix2PixHDTrain.__proto__ || Object.getPrototypeOf(Pix2PixHDTrain)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n _this.state = {\n checkpoint_name: 'PLACEHOLDER',\n epoch: 'latest',\n augment_name: '',\n augment_take: 100,\n augment_make: 20\n };\n return _this;\n }\n\n _createClass(Pix2PixHDTrain, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2pixhd.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2pixhd = _props.pix2pixhd,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2pixhd.last_id', id);\n if (!pix2pixhd.folder || pix2pixhd.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2pixhd/new/');\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n if (prevState.checkpoint_name !== this.state.checkpoint_name) {\n this.setState({ epoch: 'latest' });\n this.props.actions.list_epochs(this.state.checkpoint_name);\n this.props.actions.count_dataset(this.state.checkpoint_name);\n }\n }\n }, {\n key: 'handleChange',\n value: function handleChange(name, value) {\n console.log('name', name, 'value', value);\n this.setState(_defineProperty({}, name, value));\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (this.props.pix2pixhd.loading) {\n return (0, _preact.h)(_common.Loading, { progress: this.props.pix2pixhd.progress });\n }\n var _props2 = this.props,\n pix2pixhd = _props2.pix2pixhd,\n match = _props2.match,\n history = _props2.history,\n queue = _props2.queue;\n\n var _ref = pix2pixhd.data || {},\n folderLookup = _ref.folderLookup,\n datasetLookup = _ref.datasetLookup;\n\n var folder = (folderLookup || {})[pix2pixhd.folder_id] || {};\n // console.log(pix2pixhd)\n\n var checkpointGroups = Object.keys(folderLookup).map(function (id) {\n var folder = _this2.props.pix2pixhd.data.folderLookup[id];\n if (folder.name === 'results') return;\n var datasets = folder.datasets.map(function (name) {\n var dataset = datasetLookup[name];\n if (dataset.checkpoints.length) {\n return name;\n }\n return null;\n }).filter(function (n) {\n return !!n;\n });\n return {\n name: folder.name,\n options: datasets.sort()\n };\n }).filter(function (n) {\n return !!n && !!n.options.length;\n }).sort(function (a, b) {\n return a.name.localeCompare(b.name);\n });\n\n // console.log('state', this.props.pix2pixhd.data.epochs)\n // console.log(this.state.checkpoint_name, this.state.epoch)\n // console.log(queue)\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pixhd' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n 'pix2pixhd training'\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'columns' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Dataset' },\n (0, _preact.h)(_common.SelectGroup, {\n name: 'checkpoint_name',\n title: 'Dataset',\n options: checkpointGroups,\n onChange: this.handleChange,\n placeholder: 'Pick a dataset',\n value: this.state.checkpoint_name\n }),\n (0, _preact.h)(_common.Select, {\n title: 'Epoch',\n name: 'epoch',\n options: this.props.pix2pixhd.data.epochs,\n onChange: this.handleChange,\n value: this.state.epoch\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Augment' },\n (0, _preact.h)(_common.NumberInput, {\n name: 'augment_take',\n title: 'Pick N random frames',\n value: this.state.augment_take,\n onChange: this.handleChange,\n type: 'int',\n min: '1',\n max: '1000'\n }),\n (0, _preact.h)(_common.NumberInput, {\n name: 'augment_make',\n title: 'Generate N recursively',\n value: this.state.augment_make,\n onChange: this.handleChange,\n type: 'int',\n min: '1',\n max: '1000'\n }),\n (0, _preact.h)(_common.Button, {\n title: 'Augment dataset',\n value: 'Augment',\n onClick: function onClick() {\n return _this2.props.remote.augment_task(_this2.state.checkpoint_name, _this2.state);\n }\n }),\n (0, _preact.h)(_common.Button, {\n title: 'Make a movie without augmenting',\n value: 'Generate',\n onClick: function onClick() {\n _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, {\n no_symlinks: true,\n mov: true,\n folder_id: _this2.props.pix2pixhd.data.resultsFolder.id\n }));\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Augmentation Grid' },\n (0, _preact.h)(_common.AugmentationGrid, {\n checkpoint: this.props.pix2pixhd.checkpoint,\n take: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200, 300, 400, 500, 1000],\n make: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200],\n onAugment: function onAugment(augment_take, augment_make) {\n _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, {\n augment_take: augment_take,\n augment_make: augment_make\n }));\n },\n onTrain: function onTrain() {\n _this2.props.remote.train_task(_this2.state.checkpoint_name, pix2pixhd.folder_id, 1);\n setTimeout(function () {\n // auto-generate epoch demo\n _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, {\n augment_take: 10,\n augment_make: 150,\n no_symlinks: true,\n mov: true,\n folder_id: _this2.props.pix2pixhd.data.resultsFolder.id\n }));\n }, 250);\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Status' },\n (0, _preact.h)(_common.Button, {\n title: 'GPU',\n value: this.props.runner.gpu.status === 'IDLE' ? \"Idle\" : \"Interrupt\",\n onClick: function onClick() {\n return _this2.interrupt();\n }\n }),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Upcoming Tasks' },\n (0, _preact.h)(_common.TaskList, { tasks: queue.queue.map(function (id) {\n return queue.tasks[id];\n }), sort: 'date asc' })\n )\n )\n )\n );\n }\n }]);\n\n return Pix2PixHDTrain;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd,\n runner: state.system.runner,\n queue: state.queue\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDTrain);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('./views/pix2wav.new');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nvar _pix2wav3 = require('./views/pix2wav.show');\n\nvar _pix2wav4 = _interopRequireDefault(_pix2wav3);\n\nvar _pix2wav5 = require('./views/pix2wav.live');\n\nvar _pix2wav6 = _interopRequireDefault(_pix2wav5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('pix2wav');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #bdf, #def)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('pix2wav');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #bdf, #def)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/new/', component: _pix2wav2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/datasets/', component: _pix2wav4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/datasets/:id/', component: _pix2wav4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/live/', component: _pix2wav6.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/pix2wav/new/', name: 'new' }, { url: '/pix2wav/datasets/', name: 'datasets' }, { url: '/pix2wav/live/', name: 'live' }];\n}\n\nexports.default = {\n name: 'pix2wav',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('./pix2wav.module');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _pix2wav2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'sequences/pix2wav/' }), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'datasets/pix2wav/' }), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'checkpoints/pix2wav/' }), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'checkpoints/pix2pix/' })], function (percent, i, n) {\n console.log('progress', i, n);\n dispatch({ type: _types2.default.app.load_progress, progress: { i: i, n: n } });\n }).then(function (res) {\n var _res = _slicedToArray(res, 5),\n datasetApiReport = _res[0],\n sequences = _res[1],\n datasets = _res[2],\n checkpoints = _res[3],\n pix2pixCheckpoints = _res[4];\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder;\n\n\n var sequenceDirectories = sequences.filter(function (s) {\n return s.dir;\n });\n sequenceDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.isBuilt = true;\n });\n\n datasets.filter(function (s) {\n return s.dir;\n }).forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasDataset = true;\n });\n\n var checkpointDirectories = checkpoints.filter(function (s) {\n return s.dir;\n });\n checkpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dir.module = 'pix2wav';\n });\n\n var pix2pixCheckpointDirectories = pix2pixCheckpoints.filter(function (s) {\n return s.dir;\n });\n pix2pixCheckpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dir.module = 'pix2pix';\n });\n\n console.log(res);\n console.log(checkpointDirectories);\n console.log(pix2pixCheckpointDirectories);\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n sequences: sequenceDirectories,\n datasets: datasets,\n checkpoints: checkpointDirectories.concat(pix2pixCheckpointDirectories)\n }\n });\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar pix2wavModule = {\n name: 'pix2wav',\n displayName: 'Pix2Wav',\n datatype: 'spectrogram'\n};\n\nexports.default = pix2wavModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar pix2wavInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n status: '',\n error: null,\n folder_id: 0,\n data: null\n};\n\nvar pix2wavReducer = function pix2wavReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : pix2wavInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'pix2wav') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.wav2pix.load:\n return _extends({}, state, {\n status: 'Loaded buffer'\n });\n case _types2.default.wav2pix.progress:\n return _extends({}, state, {\n status: 'Rendering frame ' + action.count\n });\n case _types2.default.wav2pix.finish:\n return _extends({}, state, {\n status: action.message || 'Render complete'\n });\n case _types2.default.wav2pix.zip:\n return _extends({}, state, {\n status: 'Built zip file ' + _util2.default.hush_size(state.size)[1]\n });\n case _types2.default.wav2pix.uploading:\n return _extends({}, state, {\n status: 'Uploading zip file'\n });\n default:\n return state;\n }\n};\n\nexports.default = pix2wavReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.live_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar live_task = exports.live_task = function live_task(sequence, checkpoint) {\n return function (dispatch) {\n var task = {\n module: 'pix2wav',\n activity: 'live',\n dataset: sequence,\n checkpoint: checkpoint,\n opt: {\n poll_delay: 0.2\n }\n };\n console.log(task);\n console.log('add live task');\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _common = require('../../../common/');\n\nvar _player = require('../../../live/player');\n\nvar playerActions = _interopRequireWildcard(_player);\n\nvar _live = require('../../../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../../../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _pix2wav = require('../pix2wav.tasks');\n\nvar pix2wavTasks = _interopRequireWildcard(_pix2wav);\n\nvar _pix2wav2 = require('../pix2wav.actions');\n\nvar pix2wavActions = _interopRequireWildcard(_pix2wav2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2WavLive = function (_Component) {\n _inherits(Pix2WavLive, _Component);\n\n function Pix2WavLive(props) {\n _classCallCheck(this, Pix2WavLive);\n\n var _this = _possibleConstructorReturn(this, (Pix2WavLive.__proto__ || Object.getPrototypeOf(Pix2WavLive)).call(this));\n\n props.actions.pix2wav.load_directories();\n props.actions.live.get_params();\n _this.changeCheckpoint = _this.changeCheckpoint.bind(_this);\n _this.changeEpoch = _this.changeEpoch.bind(_this);\n _this.changeSequence = _this.changeSequence.bind(_this);\n _this.seek = _this.seek.bind(_this);\n _this.togglePlaying = _this.togglePlaying.bind(_this);\n _this.toggleRecording = _this.toggleRecording.bind(_this);\n return _this;\n }\n\n _createClass(Pix2WavLive, [{\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n console.log('fetch checkpoint', nextProps.opt.checkpoint_name);\n this.props.actions.live.list_epochs('pix2wav', nextProps.opt.checkpoint_name);\n }\n }\n }, {\n key: 'changeCheckpoint',\n value: function changeCheckpoint(field, checkpoint_name) {\n this.props.actions.live.load_epoch(checkpoint_name, 'latest');\n }\n }, {\n key: 'changeEpoch',\n value: function changeEpoch(field, epoch_name) {\n this.props.actions.live.load_epoch(this.props.opt.checkpoint_name, epoch_name);\n }\n }, {\n key: 'changeSequence',\n value: function changeSequence(field, sequence) {\n console.log('got sequence', sequence);\n this.props.actions.live.load_sequence(sequence);\n }\n }, {\n key: 'seek',\n value: function seek(percentage) {\n var frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1);\n this.props.actions.live.seek(frame);\n }\n }, {\n key: 'start',\n value: function start() {\n // console.log(this.props)\n console.log(this.props.pix2wav.data);\n var sequence = this.props.pix2wav.data.sequences[0].name || '';\n var checkpoint = this.props.pix2wav.data.checkpoints[0].name || '';\n console.log('starting up!', sequence, checkpoint);\n this.props.actions.tasks.live_task(sequence, checkpoint);\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'exit',\n value: function exit() {\n this.props.actions.queue.stop_task('gpu', { sigkill: true });\n }\n }, {\n key: 'togglePlaying',\n value: function togglePlaying() {\n if (this.props.opt.processing) {\n this.props.actions.live.pause();\n } else {\n this.props.actions.live.play();\n }\n }\n }, {\n key: 'toggleRecording',\n value: function toggleRecording() {\n if (this.props.opt.recording) {\n (0, _player.stopRecording)();\n this.props.actions.live.pause();\n } else {\n (0, _player.startRecording)();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n // console.log(this.props)\n if (this.props.pix2wav.loading) {\n return (0, _preact.h)(_common.Loading, null);\n }\n // console.log('sequence', this.props.opt)\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2wav centered' },\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(_common.Player, { width: 256, height: 256 })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'params column audioParams' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Audio playback' },\n (0, _preact.h)(\n _common.Button,\n { title: 'Start playback',\n onClick: function onClick() {\n return playerActions.startSynthesizing();\n }\n },\n 'Start'\n ),\n (0, _preact.h)(\n _common.Button,\n { title: 'Stop playback',\n onClick: function onClick() {\n return playerActions.stopSynthesizing();\n }\n },\n 'Stop'\n )\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Playback',\n noToggle: true\n },\n (0, _preact.h)(_common.Select, {\n name: 'send_image',\n title: 'view mode',\n options: ['a', 'b', 'sequence', 'recursive'],\n onChange: this.props.actions.live.set_param\n }),\n (0, _preact.h)(_common.Select, {\n name: 'sequence_name',\n title: 'sequence',\n options: this.props.pix2wav.data.sequences,\n onChange: this.changeSequence\n }),\n (0, _preact.h)(_common.Select, {\n name: 'output_format',\n title: 'format',\n options: ['JPEG', 'PNG']\n }),\n (0, _preact.h)(_common.Select, {\n name: 'checkpoint_name',\n title: 'checkpoint',\n options: this.props.pix2wav.data.checkpoints,\n onChange: this.changeCheckpoint\n }),\n (0, _preact.h)(_common.Select, {\n name: 'epoch',\n title: 'epoch',\n options: this.props.epochs,\n onChange: this.changeEpoch\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'position',\n min: 0.0, max: 1.0, type: 'float',\n value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1),\n onChange: this.seek\n }),\n this.renderRestartButton(),\n (0, _preact.h)(\n _common.Button,\n {\n title: this.props.opt.savingVideo ? 'Saving video...' : this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames) + ')' : 'Record video',\n onClick: this.toggleRecording\n },\n this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Save frame',\n onClick: _player.saveFrame\n },\n 'Save'\n ),\n (0, _preact.h)(\n 'p',\n { 'class': 'last_message' },\n this.props.last_message\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transition',\n name: 'transition'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_period',\n min: 10, max: 5000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_min',\n min: 0.001, max: 0.2, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_max',\n min: 0.1, max: 1.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Recursion',\n name: 'recursive'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recursive_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll',\n min: -64, max: 64, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll_axis',\n min: 0, max: 1, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Sequence',\n name: 'sequence'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'sequence_frac',\n min: 0.0, max: 1, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'process_frac',\n min: 0, max: 1, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Clahe',\n name: 'clahe'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'clip_limit',\n min: 1.0, max: 4.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Posterize',\n name: 'posterize'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'spatial_window',\n min: 2, max: 128, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'color_window',\n min: 2, max: 128, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Blur',\n name: 'blur'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_radius',\n min: 3, max: 7, type: 'odd'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_sigma',\n min: 0, max: 2, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Canny Edge Detection',\n name: 'canny'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_lo',\n min: 10, max: 200, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_hi',\n min: 10, max: 200, type: 'int'\n })\n )\n )\n )\n );\n }\n }, {\n key: 'renderRestartButton',\n value: function renderRestartButton() {\n var _this2 = this;\n\n if (this.props.runner.gpu.status === 'IDLE') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Idle',\n onClick: function onClick() {\n return _this2.start();\n }\n },\n 'Start'\n );\n }\n if (this.props.runner.gpu.task.module !== 'pix2pix' && this.props.runner.gpu.task.module !== 'pix2wav') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n );\n }\n if (!this.props.opt.processing) {\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Not processing',\n onClick: this.togglePlaying\n },\n 'Restart'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Last resort',\n onClick: function onClick() {\n return _this2.exit();\n }\n },\n 'Exit'\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Processing',\n onClick: this.togglePlaying\n },\n 'Pause'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Last resort',\n onClick: function onClick() {\n return _this2.exit();\n }\n },\n 'Exit'\n )\n );\n }\n }]);\n\n return Pix2WavLive;\n}(_preact.Component);\n\nfunction timeInSeconds(n) {\n return (n / 10).toFixed(1) + ' s.';\n}\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n last_message: state.live.last_message,\n opt: state.live.opt,\n frame: state.live.frame,\n checkpoints: state.live.checkpoints,\n epochs: state.live.epochs,\n sequences: state.live.sequences,\n runner: state.system.runner,\n pix2wav: state.module.pix2wav\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n live: (0, _redux.bindActionCreators)(liveActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n pix2wav: (0, _redux.bindActionCreators)(pix2wavActions, dispatch),\n tasks: (0, _redux.bindActionCreators)(pix2wavTasks, dispatch), s: s\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2WavLive);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Pix2WavNew;\n\nvar _preact = require('preact');\n\nvar _dataset = require('../../../dataset/dataset.new');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _pix2wav = require('../pix2wav.module');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Pix2WavNew(_ref) {\n var history = _ref.history;\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'app pix2wav' },\n (0, _preact.h)(_dataset2.default, { module: _pix2wav2.default, history: history })\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('../pix2wav.actions');\n\nvar pix2wavActions = _interopRequireWildcard(_pix2wav);\n\nvar _pix2wav2 = require('../pix2wav.tasks');\n\nvar pix2wavTasks = _interopRequireWildcard(_pix2wav2);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _fileList = require('../../../common/fileList.component');\n\nvar _spectrogram = require('./spectrogram.upload');\n\nvar _spectrogram2 = _interopRequireDefault(_spectrogram);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2wav3 = require('../pix2wav.module');\n\nvar _pix2wav4 = _interopRequireDefault(_pix2wav3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2wavShow = function (_Component) {\n _inherits(Pix2wavShow, _Component);\n\n function Pix2wavShow(props) {\n _classCallCheck(this, Pix2wavShow);\n\n var _this = _possibleConstructorReturn(this, (Pix2wavShow.__proto__ || Object.getPrototypeOf(Pix2wavShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(Pix2wavShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2wav.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2wav = _props.pix2wav,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2wav.last_id', id);\n if (!pix2wav.folder || pix2wav.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2wav/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n pix2wav = _props2.pix2wav,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = pix2wav.data || {},\n folderLookup = _ref.folderLookup;\n\n var folder = (folderLookup || {})[pix2wav.folder_id] || {};\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2wav' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'div',\n { 'class': 'spaced' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_loading2.default, null)\n ),\n (0, _preact.h)(_upload2.default, null)\n )\n ),\n (0, _preact.h)(_spectrogram2.default, {\n loading: pix2wav.loading,\n progress: pix2wav.progress,\n id: pix2wav.folder_id,\n module: _pix2wav4.default,\n data: pix2wav.data,\n folder: folder\n }),\n (0, _preact.h)(_dataset6.default, {\n loading: pix2wav.loading,\n progress: pix2wav.progress,\n id: pix2wav.folder_id,\n module: _pix2wav4.default,\n data: pix2wav.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n pix2wav = _props3.pix2wav,\n remote = _props3.remote;\n\n var input = pix2wav.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 2);\n } },\n '2x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 4);\n } },\n '4x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 6);\n } },\n '6x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 18);\n } },\n '18x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'rm'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }]);\n\n return Pix2wavShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2wav: state.module.pix2wav\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2wavActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2wavTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2wavShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('../pix2wav.actions');\n\nvar pix2wavActions = _interopRequireWildcard(_pix2wav);\n\nvar _pix2wav2 = require('../pix2wav.tasks');\n\nvar pix2wavTasks = _interopRequireWildcard(_pix2wav2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _wav2pix = require('../../../audio/wav2pix');\n\nvar wav2pixActions = _interopRequireWildcard(_wav2pix);\n\nvar _pix2wav3 = require('../../../audio/pix2wav');\n\nvar pix2wavPlayer = _interopRequireWildcard(_pix2wav3);\n\nvar _pix2wav4 = require('../pix2wav.module');\n\nvar _pix2wav5 = _interopRequireDefault(_pix2wav4);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar date_stamp = function date_stamp() {\n return (0, _moment2.default)().format(\"_YYYYMMDD_HHmm\");\n};\n\nvar SpectrogramUpload = function (_Component) {\n _inherits(SpectrogramUpload, _Component);\n\n function SpectrogramUpload(props) {\n _classCallCheck(this, SpectrogramUpload);\n\n var _this = _possibleConstructorReturn(this, (SpectrogramUpload.__proto__ || Object.getPrototypeOf(SpectrogramUpload)).call(this, props));\n\n _this.state = {\n file: null,\n pcm: null,\n name: \"\",\n datasetName: \"\",\n frames: [],\n frame_start: 0,\n max: 1000,\n preview_count: 8 * 4,\n frame_step: wav2pixActions.FRAME_STEP\n };\n var audioElement = document.createElement('audio');\n audioElement.addEventListener('loadedmetadata', function () {\n var duration = audioElement.duration;\n var total_frame_count = Math.floor((duration * 44100 - wav2pixActions.FRAME_LENGTH) / _this.state.frame_step);\n _this.setState({\n duration: duration,\n max: Math.min(_this.state.max, total_frame_count, 1000)\n });\n });\n _this.audioElement = audioElement;\n return _this;\n }\n\n _createClass(SpectrogramUpload, [{\n key: 'pickFile',\n value: function pickFile(file) {\n var _this2 = this;\n\n var name = file.name.split('.')[0].replace(/\\s+/g, '_').replace(/-/g, '_').replace(/_+/g, '_');\n this.setState({\n file: file,\n name: name + date_stamp(),\n datasetName: name,\n pcm: ''\n }, function () {\n _this2.rebuildFrames();\n });\n this.audioElement.src = URL.createObjectURL(file);\n }\n }, {\n key: 'rebuildFrames',\n value: function rebuildFrames() {\n var _this3 = this;\n\n var _state = this.state,\n file = _state.file,\n pcm = _state.pcm,\n frame_step = _state.frame_step,\n frame_start = _state.frame_start,\n preview_count = _state.preview_count;\n\n this.props.wav2pix.renderFrames(pcm || file, { frame_start: frame_start, frame_step: frame_step, max: preview_count }).then(function (data) {\n console.log('got frames', data.frames.length);\n _this3.setState(_extends({}, _this3.state, {\n frames: data.frames,\n pcm: data.pcm\n }));\n });\n }\n }, {\n key: 'buildZip',\n value: function buildZip() {\n var _this4 = this;\n\n var _state2 = this.state,\n pcm = _state2.pcm,\n file = _state2.file,\n max = _state2.max,\n frame_step = _state2.frame_step,\n frame_start = _state2.frame_start;\n\n this.props.wav2pix.buildZip(this.state.name, pcm || file, { frame_start: frame_start, frame_step: frame_step, max: max }).then(function (_ref) {\n var zip = _ref.zip,\n filename = _ref.filename,\n count = _ref.count;\n\n _this4.props.datasetActions.uploadFile(_this4.props.module, _this4.props.folder, zip, filename, { count: count, max: max, frame_step: frame_step, frame_size: wav2pixActions.FRAME_LENGTH / 44100 });\n });\n }\n }, {\n key: 'playFrame',\n value: function playFrame(i) {\n var _this5 = this;\n\n return function () {\n var frame = _this5.state.frames[i];\n pix2wavPlayer.play(frame);\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _this6 = this;\n\n // loading={pix2wav.loading}\n // progress={pix2wav.progress}\n // id={pix2wav.folder_id}\n // module={pix2wavModule}\n // data={pix2wav.data}\n // folder={folder}\n var _state3 = this.state,\n file = _state3.file,\n frames = _state3.frames,\n preview_count = _state3.preview_count;\n\n var canvases = [];\n for (var i = 0, _len = preview_count; i < _len; i++) {\n canvases.push((0, _preact.h)('canvas', { key: i, onClick: this.playFrame(i) }));\n }\n return (0, _preact.h)(\n 'div',\n { className: 'row' },\n (0, _preact.h)(\n 'div',\n { className: 'col spectrogramBuilder' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Spectrogram Builder' },\n (0, _preact.h)(\n 'p',\n null,\n \"Convert your sounds into spectrograms. \",\n \"Sound files can be WAV, MP3, AIFF, or FLAC. \"\n ),\n (0, _preact.h)(_common.FileUpload, {\n title: 'Choose a sound file',\n accept: 'audio/*',\n onUpload: function onUpload(file) {\n return _this6.pickFile(file);\n }\n }),\n file && this.renderMetadata(file)\n )\n ),\n (0, _preact.h)(\n 'div',\n { ref: function ref(c) {\n _this6.canvases = c;\n }, className: 'thumbs', id: 'pix2wav_canvases' },\n canvases\n )\n );\n }\n }, {\n key: 'renderMetadata',\n value: function renderMetadata(file) {\n var _this7 = this;\n\n var _state4 = this.state,\n duration = _state4.duration,\n preview_count = _state4.preview_count;\n\n var size = _util2.default.hush_size(file.size);\n var total_frame_count = Math.floor((duration * 44100 - wav2pixActions.FRAME_LENGTH) / this.state.frame_step);\n var frame_size = Math.round(wav2pixActions.FRAME_LENGTH / 44100 * 1000) + ' ms.';\n var frame_step = Math.round(this.state.frame_step / 44100 * 1000) + ' ms.';\n return (0, _preact.h)(\n 'div',\n { className: 'fileMetadata' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Metadata' },\n (0, _preact.h)(\n _common.Param,\n { title: 'Name' },\n file.name\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Type' },\n file.type\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Size' },\n (0, _preact.h)(\n 'span',\n { className: size[0] },\n size[1]\n )\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Date' },\n (0, _moment2.default)(file.lastModifiedDate).format(\"YYYY-MM-DD h:mm a\")\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Duration' },\n Math.floor(duration) + ' s.'\n ),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n _common.Param,\n { title: 'Frames' },\n total_frame_count\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Frame Size' },\n frame_size\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Frame Step' },\n frame_step\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'FFT Size' },\n wav2pixActions.spectrum.fft_size\n ),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n _common.Param,\n { title: 'Status' },\n this.props.pix2wav.status\n ),\n (0, _preact.h)('br', null)\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Data settings' },\n (0, _preact.h)(_common.TextInput, {\n title: 'Dataset name',\n onChange: function onChange(e) {\n return _this7.setState({ name: e.target.value });\n },\n value: this.state.name\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'Starting Frame',\n min: 0, max: 1, type: 'float',\n value: this.state.frame_start,\n defaultValue: 0,\n onChange: function onChange(frame_start) {\n _this7.setState({\n frame_start: frame_start\n }, function () {\n _this7.rebuildFrames();\n });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'No. Frames',\n min: 10, max: Math.min(total_frame_count, 1000), type: 'int',\n value: this.state.max,\n defaultValue: Math.min(total_frame_count, 300),\n onChange: function onChange(max) {\n return _this7.setState({ max: max });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'Frame step',\n min: 10, max: 20000, type: 'int',\n value: this.state.frame_step,\n defaultValue: wav2pixActions.FRAME_STEP,\n onChange: function onChange(frame_step) {\n var total_frame_count = Math.floor((duration * 44100 - wav2pixActions.FRAME_LENGTH) / frame_step);\n _this7.setState({\n name: _this7.state.datasetName + '_step_' + frame_step + date_stamp(),\n frame_step: frame_step,\n max: Math.min(_this7.state.max, total_frame_count)\n }, function () {\n _this7.rebuildFrames();\n });\n }\n }),\n (0, _preact.h)(\n _common.Button,\n {\n onClick: function onClick() {\n return _this7.buildZip();\n }\n },\n 'Upload Frames'\n )\n ),\n (0, _preact.h)(_common.Progress, null)\n );\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n var _this8 = this;\n\n (this.state.frames || []).map(function (frame, i) {\n var canvas = _this8.canvases.children[i];\n var ctx = canvas.getContext('2d-lodpi');\n canvas.width = frame.canvas.width;\n canvas.height = frame.canvas.height;\n ctx.drawImage(frame.canvas, 0, 0);\n });\n }\n }]);\n\n return SpectrogramUpload;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2wav: state.module.pix2wav,\n upload: state.upload\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n datasetActions: (0, _redux.bindActionCreators)(datasetActions, dispatch),\n actions: (0, _redux.bindActionCreators)(pix2wavActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2wavTasks, dispatch),\n wav2pix: (0, _redux.bindActionCreators)(wav2pixActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SpectrogramUpload);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('./views/samplernn.new');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nvar _samplernn3 = require('./views/samplernn.show');\n\nvar _samplernn4 = _interopRequireDefault(_samplernn3);\n\nvar _samplernn5 = require('./views/samplernn.import');\n\nvar _samplernn6 = _interopRequireDefault(_samplernn5);\n\nvar _samplernn7 = require('./views/samplernn.results');\n\nvar _samplernn8 = _interopRequireDefault(_samplernn7);\n\nvar _samplernn9 = require('./views/samplernn.graph');\n\nvar _samplernn10 = _interopRequireDefault(_samplernn9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('samplernn');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #eef, #fef)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('samplernn');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #eef, #fef)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/new', component: _samplernn2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/datasets', component: _samplernn4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/datasets/:id', component: _samplernn4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/import', component: _samplernn6.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/results', component: _samplernn8.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/graph', component: _samplernn10.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/samplernn/new/', name: 'new' }, { url: '/samplernn/datasets/', name: 'datasets' }, { url: '/samplernn/graph/', name: 'graph' }, { url: '/samplernn/results/', name: 'results' }];\n}\n\nexports.default = {\n name: 'samplernn',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.import_files = exports.load_loss = exports.load_graph = exports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('./samplernn.module');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _samplernn2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: module, dir: 'datasets' }), _actions2.default.socket.list_directory({ module: module, dir: 'results' }), _actions2.default.socket.list_directory({ module: module, dir: 'output' }), _actions2.default.socket.disk_usage({ module: module, dir: 'datasets' }), load_loss()(dispatch)], function (percent, i, n) {\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'samplernn' }\n });\n }).then(function (res) {\n // console.log(res)\n var _res = _slicedToArray(res, 6),\n datasetApiReport = _res[0],\n datasets = _res[1],\n results = _res[2],\n output = _res[3],\n datasetUsage = _res[4],\n lossReport = _res[5];\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder;\n\n console.log(datasetUsage);\n\n // also show the various flat audio files we have, in the input area..\n var flatDatasets = datasets.filter(function (s) {\n return s.name.match(/(wav|aiff?|flac|mp3)$/) && !s.dir;\n });\n var builtDatasets = datasets.filter(function (s) {\n return s.dir;\n });\n builtDatasets.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name, unsortedFolder, dir.date);\n dataset.isBuilt = true;\n });\n\n flatDatasets.forEach(function (file) {\n file.uuid = (0, _v2.default)();\n fileLookup[file.uuid] = file;\n var name = file.name.split('.')[0];\n var dataset = datasetLoader.getDataset(module, datasetLookup, name, unsortedFolder, file.date);\n file.persisted = false;\n dataset.input.push(file.uuid);\n });\n\n // exp:coccokit_3-frame_sizes:8,2-n_rnn:2-dataset:coccokit_3\n var checkpoints = results.filter(function (s) {\n return s.dir;\n }).map(function (s) {\n var checkpoint = s.name.split('-').map(function (s) {\n return s.split(':');\n }).filter(function (b) {\n return b.length && b[1];\n }).reduce(function (a, b) {\n return (a[b[0]] = b[1]) && a;\n }, {});\n checkpoint.name = checkpoint.name || checkpoint.dataset || checkpoint.exp;\n checkpoint.date = s.date;\n checkpoint.dir = s;\n checkpoint.persisted = false;\n var dataset = datasetLoader.getDataset(module, datasetLookup, checkpoint.name, unsortedFolder, checkpoint.date);\n var loss = lossReport[checkpoint.name];\n if (loss) {\n dataset.epoch = checkpoint.epoch = loss.length;\n checkpoint.training_loss = loss;\n }\n dataset.checkpoints.push(checkpoint);\n return checkpoint;\n });\n\n output.map(function (file) {\n file.uuid = (0, _v2.default)();\n fileLookup[file.uuid] = file;\n var pair = file.name.split('.')[0].split('-');\n var dataset = datasetLoader.getDataset(module, datasetLookup, pair[0], unsortedFolder, file.date);\n file.persisted = false;\n file.epoch = parseInt(file.epoch || pair[1].replace(/^\\D+/, '')) || 0;\n dataset.epoch = Math.max(file.epoch, dataset.epoch || 0);\n // here check if the file exists in dataset, if so just check that it's persisted\n var found = dataset.output.some(function (file_id) {\n // if (f.name === \n if (fileLookup[file_id].name === file.name) {\n fileLookup[file_id].persisted = true;\n return true;\n }\n return false;\n });\n if (!found) {\n dataset.output.push(file.uuid);\n }\n });\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n checkpoints: checkpoints,\n output: output\n }\n });\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};\n\nvar load_graph = exports.load_graph = function load_graph() {\n return function (dispatch) {\n var module = _samplernn2.default.name;\n _util2.default.allProgress([load_loss()(dispatch), _actions2.default.socket.list_directory({ module: module, dir: 'results' })], function (percent, i, n) {\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'samplernn' }\n });\n }).then(function (res) {\n var _res2 = _slicedToArray(res, 2),\n lossReport = _res2[0],\n results = _res2[1];\n\n dispatch({\n type: _types2.default.samplernn.load_graph,\n lossReport: lossReport,\n results: results\n });\n });\n };\n};\n\nvar load_loss = exports.load_loss = function load_loss() {\n return function (dispatch) {\n return _actions2.default.socket.run_script({ module: 'samplernn', activity: 'report' }).then(function (report) {\n var lossReport = {};\n report.stdout.split('\\n\\n').filter(function (a) {\n return !!a;\n }).forEach(function (data) {\n var _data$split = data.split('\\n'),\n _data$split2 = _toArray(_data$split),\n name = _data$split2[0],\n lines = _data$split2.slice(1);\n\n lossReport[name] = lines.map(function (s) {\n return s.split('\\t').reduce(function (a, s) {\n var b = s.split(': ');\n a[b[0]] = b[1];\n return a;\n }, {});\n });\n // console.log(data, name, lossReport[name])\n });\n dispatch({\n type: _types2.default.samplernn.load_loss,\n lossReport: lossReport\n });\n return lossReport;\n });\n };\n};\n\nvar import_files = exports.import_files = function import_files(state, datasetLookup, fileLookup) {\n return function (dispatch) {\n var selected = state.selected,\n folder_id = state.folder_id,\n url_base = state.url_base,\n import_action = state.import_action;\n\n var names = Object.keys(selected).filter(function (k) {\n return selected[k];\n });\n var promises = void 0;\n switch (import_action) {\n case 'Hotlink':\n // in this case, create a new file for each file we see.\n promises = names.reduce(function (a, name) {\n return datasetLookup[name].output.map(function (id) {\n return fileLookup[id];\n }).map(function (file) {\n var partz = file.name.split('.');\n var ext = partz.pop();\n return _actions2.default.file.create({\n folder_id: folder_id,\n name: file.name,\n url: url_base + file.name,\n mime: 'audio/' + ext,\n epoch: file.epoch,\n size: file.size,\n module: 'samplernn',\n dataset: name,\n activity: 'train',\n datatype: 'audio',\n generated: true,\n created_at: new Date(file.date),\n updated_at: new Date(file.date)\n });\n }).concat(a);\n }, []);\n break;\n case 'Upload':\n promises = names.reduce(function (a, name) {\n return datasetLookup[name].input.map(function (id) {\n return fileLookup[id];\n }).map(function (file) {\n if (file.persisted) return null;\n var partz = file.name.split('.');\n var ext = partz.pop();\n if (ext === 'wav' || ext === 'flac') return;\n console.log(file);\n return _actions2.default.socket.upload_file({\n folder_id: folder_id,\n module: 'samplernn',\n activity: 'train',\n path: 'datasets',\n filename: file.name,\n generated: false,\n processed: false,\n datatype: 'audio',\n ttl: 60000\n });\n }).concat(a);\n }, []).filter(function (a) {\n return !!a;\n });\n break;\n default:\n break;\n }\n console.log(promises);\n return Promise.all(promises).then(function (data) {\n console.log(data);\n window.location.href = '/samplernn/datasets/' + folder_id + '/';\n }).catch(function (e) {\n console.error(e);\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar samplernnModule = {\n name: 'samplernn',\n displayName: 'SampleRNN',\n datatype: 'audio'\n};\n\nexports.default = samplernnModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar samplernnInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folders: [],\n folder_id: 0,\n data: null,\n lossReport: null,\n results: null\n};\n\nvar samplernnReducer = function samplernnReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : samplernnInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'samplernn') {\n return (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.samplernn.load_loss:\n return _extends({}, state, {\n lossReport: action.lossReport\n });\n case _types2.default.samplernn.load_graph:\n return _extends({}, state, {\n lossReport: action.lossReport,\n results: action.results\n });\n default:\n return state;\n }\n};\n\nexports.default = samplernnReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.clear_cache_task = exports.log_task = exports.fetch_task = exports.train_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar train_task = exports.train_task = function train_task(dataset, folder_id) {\n var epochs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n return function (dispatch) {\n var task = {\n module: 'samplernn',\n activity: 'train',\n dataset: dataset.name,\n epoch: dataset.checkpoints.length ? dataset.checkpoints[0].epoch || 0 : 0,\n epochs: epochs,\n folder_id: folder_id,\n opt: {\n sample_length: 44100 * 5,\n n_samples: 6,\n keep_old_checkpoints: false\n }\n };\n console.log(task);\n return _actions2.default.queue.add_task(task);\n };\n};\nvar fetch_task = exports.fetch_task = function fetch_task(url, folder_id, file_id, dataset) {\n return function (dispatch) {\n if (!url) return console.log('input file inaccessible (no url)');\n var task = {\n module: 'samplernn',\n activity: 'fetch',\n dataset: dataset,\n folder_id: folder_id,\n opt: {\n url: url,\n file_id: file_id,\n dataset: dataset\n }\n };\n return _actions2.default.queue.add_task(task);\n };\n};\nvar log_task = exports.log_task = function log_task(dataset) {\n return function (dispatch) {\n var task = {\n module: 'samplernn',\n activity: 'log',\n dataset: dataset.name\n };\n return _actions2.default.queue.add_task(task);\n };\n};\nvar clear_cache_task = exports.clear_cache_task = function clear_cache_task(dataset) {\n return function (dispatch) {\n var task = {\n module: 'samplernn',\n activity: 'clear_cache',\n dataset: dataset.name\n };\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _group = require('../../../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _slider = require('../../../common/slider.component');\n\nvar _slider2 = _interopRequireDefault(_slider);\n\nvar _select = require('../../../common/select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _button = require('../../../common/button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _fileList = require('../../../common/fileList.component');\n\nvar _textInput = require('../../../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar lerp = _util2.default.lerp,\n norm = _util2.default.norm,\n randint = _util2.default.randint,\n randrange = _util2.default.randrange;\n\nvar SampleRNNGraph = function (_Component) {\n _inherits(SampleRNNGraph, _Component);\n\n function SampleRNNGraph(props) {\n _classCallCheck(this, SampleRNNGraph);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNGraph.__proto__ || Object.getPrototypeOf(SampleRNNGraph)).call(this));\n\n props.actions.load_graph();\n return _this;\n }\n\n _createClass(SampleRNNGraph, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n this.refs = {};\n return (0, _preact.h)(\n 'div',\n { className: 'app lossGraph' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h3',\n null,\n 'SampleRNN Loss Graph'\n ),\n (0, _preact.h)('canvas', { ref: function ref(_ref) {\n return _this2.refs['canvas'] = _ref;\n } })\n )\n );\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n var _props$samplernn = this.props.samplernn,\n lossReport = _props$samplernn.lossReport,\n results = _props$samplernn.results;\n\n if (!lossReport || !results) return;\n var canvas = this.refs.canvas;\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n canvas.style.width = canvas.width + 'px';\n canvas.style.height = canvas.height + 'px';\n\n var ctx = canvas.getContext('2d');\n var w = canvas.width;\n var h = canvas.height;\n ctx.clearRect(0, 0, w, h);\n\n var resultsByDate = results.map(function (file) {\n if (!file.name.match(/^exp:/)) return null;\n var dataset = file.name.split(\"-\")[3].split(\":\")[1];\n return [+new Date(file.date), dataset];\n }).filter(function (a) {\n return !!a;\n }).sort(function (a, b) {\n return a[0] - a[1];\n });\n\n var keys = Object.keys(lossReport).filter(function (k) {\n return !!lossReport[k].length;\n });\n var scaleMax = 0;\n var scaleMin = Infinity;\n var epochsMax = 0;\n keys.forEach(function (key) {\n var loss = lossReport[key];\n epochsMax = Math.max(loss.length, epochsMax);\n loss.forEach(function (a) {\n var v = parseFloat(a.training_loss);\n if (!v) return;\n scaleMax = Math.max(v, scaleMax);\n scaleMin = Math.min(v, scaleMin);\n });\n });\n // scaleMax *= 10\n // console.log(scaleMax, scaleMin, epochsMax)\n\n scaleMax = 3;\n scaleMin = 0;\n var margin = 0;\n var wmin = 0;\n var wmax = w / 2;\n var hmin = 0;\n var hmax = h / 2;\n var epochsScaleFactor = 1; // 3/2\n\n ctx.save();\n var X = void 0,\n Y = void 0;\n for (var ii = 0; ii < epochsMax; ii++) {\n X = lerp(ii / (epochsMax / epochsScaleFactor) * epochsScaleFactor, wmin, wmax);\n ctx.strokeStyle = 'rgba(0,0,0,0.3)';\n ctx.beginPath(0, 0);\n ctx.moveTo(X, 0);\n ctx.lineTo(X, h);\n ctx.lineWidth = 0.5;\n // ctx.stroke()\n if ((ii + 1) % 6 === 0) {\n ctx.lineWidth = 0.5;\n ctx.stroke();\n var fontSize = 12;\n ctx.font = 'italic ' + fontSize + 'px \"Georgia\"';\n ctx.fillStyle = 'rgba(0,12,28,0.6)';\n ctx.fillText(ii / 5 * 6, X + 8, h - (fontSize + 4));\n }\n }\n for (var ii = scaleMin; ii < scaleMax; ii += 1) {\n Y = lerp(ii / scaleMax, hmin, hmax);\n // ctx.strokeStyle = 'rgba(255,255,255,1.0)'\n ctx.beginPath(0, 0);\n ctx.moveTo(0, h - Y);\n ctx.lineTo(w, h - Y);\n ctx.lineWidth = 1;\n // ctx.stroke() \n // if ( (ii % 1) < 0.1) {\n // ctx.strokeStyle = 'rgba(255,255,255,1.0)'\n ctx.lineWidth = 2;\n ctx.setLineDash([4, 4]);\n ctx.stroke();\n ctx.stroke();\n ctx.stroke();\n ctx.setLineDash([1, 1]);\n var _fontSize = 12;\n ctx.font = 'italic ' + _fontSize + 'px \"Georgia\"';\n ctx.fillStyle = 'rgba(0,12,28,0.6)';\n ctx.fillText(ii.toFixed(1), w - 50, h - Y + _fontSize + 10);\n // }\n }\n ctx.lineWidth = 1;\n ctx.restore();\n\n var min_date = resultsByDate[0][0];\n var max_date = resultsByDate[resultsByDate.length - 1][0];\n resultsByDate.forEach(function (pair) {\n var date = pair[0];\n var key = pair[1];\n var loss = lossReport[key];\n if (!key || !loss || !loss.length) return;\n var vf = parseFloat(loss[loss.length - 1].training_loss) || 0;\n var vg = parseFloat(loss[0].training_loss) || 5;\n // console.log(vf)\n var vv = 1 - norm(vf, scaleMin, scaleMax / 2);\n ctx.lineWidth = (1 - norm(vf, scaleMin, scaleMax)) * 4;\n // ctx.lineWidth = norm(date, min_date, max_date) * 3\n // console.log(date, min_date, max_date)\n ctx.strokeStyle = 'rgba(' + [randrange(30, 190), randrange(30, 150), randrange(60, 120)].join(',') + ',' + 0.8 + ')';\n var begun = false;\n loss.forEach(function (a, i) {\n var v = parseFloat(a.training_loss);\n if (!v) return;\n var x = lerp(i / (epochsMax / epochsScaleFactor) * epochsScaleFactor, wmin, wmax);\n var y = lerp(norm(v, scaleMin, scaleMax), hmax, hmin);\n if (!begun) {\n begun = true;\n ctx.beginPath(0, 0);\n ctx.moveTo(x, y);\n } else {\n ctx.lineTo(x, y);\n // ctx.stroke()\n }\n });\n ctx.stroke();\n var i = loss.length - 1;\n var v = parseFloat(loss[i].training_loss);\n var x = lerp(i / (epochsMax / epochsScaleFactor) * epochsScaleFactor, wmin, wmax);\n var y = lerp(norm(v, scaleMin, scaleMax), hmax, hmin);\n var fontSize = 9;\n ctx.font = 'italic ' + fontSize + 'px \"Georgia\"';\n ctx.fillStyle = 'rgba(0,12,28,0.6)';\n ctx.fillText(key, x + 4, y + fontSize / 2);\n });\n }\n }]);\n\n return SampleRNNGraph;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNGraph);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _select = require('../../../common/select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _textInput = require('../../../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nvar _button = require('../../../common/button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _dataset = require('../../../dataset/dataset.component');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar samplernnModule = {\n name: 'samplernn',\n datatype: 'audio'\n};\n\nvar SampleRNNImport = function (_Component) {\n _inherits(SampleRNNImport, _Component);\n\n function SampleRNNImport() {\n _classCallCheck(this, SampleRNNImport);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNImport.__proto__ || Object.getPrototypeOf(SampleRNNImport)).call(this));\n\n _this.state = {\n folder_id: 1,\n import_action: 'Hotlink',\n url_base: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4279/',\n selected: {}\n };\n return _this;\n }\n\n _createClass(SampleRNNImport, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('samplernn.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n samplernn = _props.samplernn,\n samplernnActions = _props.samplernnActions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('samplernn.last_id', id);\n if (!samplernn.folder || samplernn.folder.id !== id) {\n this.props.actions.load_directories(id);\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var samplernn = this.props.samplernn;\n\n var datasets = [],\n folder = void 0;\n if (this.props.samplernn.data) {\n datasets = (this.props.samplernn.data.folders || []).map(function (folder) {\n return [folder.name, folder.id];\n });\n folder = this.props.samplernn.data.folderLookup.unsorted;\n }\n return (0, _preact.h)(\n 'div',\n { className: 'app top' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n 'Import'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'params form row datasets' },\n (0, _preact.h)(\n 'div',\n { 'class': 'row dataset' },\n (0, _preact.h)('div', { 'class': 'col' }),\n (0, _preact.h)('div', { 'class': 'col' }),\n (0, _preact.h)('div', { 'class': 'col' }),\n (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n (0, _preact.h)(\n 'h2',\n null,\n 'Import to dataset'\n ),\n (0, _preact.h)(_select2.default, {\n title: 'Destination dataset',\n options: datasets,\n name: 'folder_id',\n opt: this.state,\n onChange: function onChange(name, value) {\n return _this2.setState({ folder_id: value });\n }\n }),\n (0, _preact.h)(_select2.default, {\n title: 'Import action',\n options: ['Hotlink', 'Upload'],\n name: 'import_action',\n opt: this.state,\n onChange: function onChange(name, value) {\n return _this2.setState({ import_action: value });\n }\n }),\n (0, _preact.h)(_textInput2.default, {\n title: 'Remote URL base',\n value: this.state.url_base,\n placeholder: 'http://',\n onSave: function onSave(value) {\n return _this2.setState({ url_base: value });\n }\n }),\n (0, _preact.h)(\n _button2.default,\n {\n title: '',\n onClick: function onClick() {\n return _this2.doImport();\n }\n },\n 'Import'\n )\n )\n )\n ),\n (0, _preact.h)(_dataset2.default, {\n loading: samplernn.loading,\n progress: samplernn.progress,\n module: samplernnModule,\n data: samplernn.data,\n id: 'unsorted',\n folder: folder,\n history: this.props.history,\n onPickDataset: function onPickDataset(dataset) {\n return _this2.toggle(dataset.name, _this2.state.selected[name]);\n },\n beforeRow: function beforeRow(dataset) {\n return _this2.beforeRow(dataset);\n },\n afterRow: function afterRow(dataset) {\n return _this2.afterRow(dataset);\n }\n })\n );\n }\n }, {\n key: 'toggle',\n value: function toggle(name) {\n this.setState(_extends({}, this.state, {\n selected: _extends({}, this.state.selected, _defineProperty({}, name, !this.state.selected[name]))\n }));\n }\n }, {\n key: 'beforeRow',\n value: function beforeRow(dataset) {\n // console.log(dataset)\n }\n }, {\n key: 'afterRow',\n value: function afterRow(dataset) {\n var name = dataset.name;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)('input', {\n type: 'checkbox',\n value: name,\n checked: !!this.state.selected[name]\n })\n );\n }\n }, {\n key: 'doImport',\n value: function doImport() {\n var samplernn = this.props.samplernn;\n\n console.log(this.state);\n this.props.actions.import_files(this.state, samplernn.data.datasetLookup, samplernn.data.fileLookup);\n }\n }]);\n\n return SampleRNNImport;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn,\n runner: state.system.runner,\n task: state.task\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNImport);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _common = require('../../../common');\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _samplernn2 = require('../samplernn.module');\n\nvar _samplernn3 = _interopRequireDefault(_samplernn2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction SampleRNNNew(props) {\n return (0, _preact.h)(_common.Views.New, {\n db: props.samplernn,\n path: '/samplernn/datasets/',\n actions: props.actions,\n module: _samplernn3.default,\n history: props.history\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNNew);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _audioPlayer = require('../../../common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _fileList = require('../../../common/fileList.component');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SampleRNNResults = function (_Component) {\n _inherits(SampleRNNResults, _Component);\n\n function SampleRNNResults(props) {\n _classCallCheck(this, SampleRNNResults);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNResults.__proto__ || Object.getPrototypeOf(SampleRNNResults)).call(this));\n\n if (!props.samplernn.data) props.actions.load_directories();\n return _this;\n }\n\n _createClass(SampleRNNResults, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (this.props.samplernn.loading) return (0, _preact.h)(_loading2.default, { progress: this.props.samplernn.progress });\n var _props$samplernn$data = this.props.samplernn.data,\n folderLookup = _props$samplernn$data.folderLookup,\n fileLookup = _props$samplernn$data.fileLookup,\n datasetLookup = _props$samplernn$data.datasetLookup;\n // const { folderLookup } = samplernn\n\n var renders = Object.keys(folderLookup).sort(_util2.default.sort.stringSort.asc).map(function (key) {\n var folder = folderLookup[key];\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn('epoch desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var datasetPairs = folder.datasets.map(function (name) {\n return datasetLookup[name];\n }).map(mapFn).sort(sortFn);\n var bestRenders = datasetPairs.map(function (pair) {\n return pair[1];\n }).filter(function (dataset) {\n return dataset.output.length;\n }).map(function (dataset) {\n var output = dataset.output;\n\n return output.map(function (id) {\n return fileLookup[id];\n }).map(mapFn).sort(sortFn)[0][1];\n });\n // console.log(bestRenders.map(r => r.epoch))\n var path = folder.name === 'unsorted' ? \"/samplernn/import/\" : \"/samplernn/datasets/\" + folder.id + \"/\";\n return (0, _preact.h)(\n 'div',\n { className: 'col bestRenders' },\n (0, _preact.h)(\n 'h3',\n null,\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: path },\n folder.name\n )\n ),\n (0, _preact.h)(_fileList.FileList, {\n linkFiles: true,\n files: bestRenders,\n orderBy: 'date desc',\n fields: 'name date epoch size',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n _this2.handlePick(file);\n }\n })\n );\n });\n\n return (0, _preact.h)(\n 'div',\n { className: 'app samplernn' },\n (0, _preact.h)(\n 'div',\n { className: 'heading row middle' },\n (0, _preact.h)(\n 'h1',\n null,\n 'SampleRNN Results'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'rows params renders' },\n renders\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n this.props.audioPlayer.play(file);\n }\n }]);\n\n return SampleRNNResults;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch),\n audioPlayer: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNResults);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _samplernn2 = require('../samplernn.tasks');\n\nvar samplernnTasks = _interopRequireWildcard(_samplernn2);\n\nvar _audioPlayer = require('../../../common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset3 = require('../../../dataset/dataset.component');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _samplernn3 = require('../samplernn.module');\n\nvar _samplernn4 = _interopRequireDefault(_samplernn3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SampleRNNShow = function (_Component) {\n _inherits(SampleRNNShow, _Component);\n\n function SampleRNNShow(props) {\n _classCallCheck(this, SampleRNNShow);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNShow.__proto__ || Object.getPrototypeOf(SampleRNNShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(SampleRNNShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('samplernn.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n samplernn = _props.samplernn,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('samplernn.last_id', id);\n if (!samplernn.folder || samplernn.folder.id !== id) {\n // console.log('looooooooooad', id)\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/samplernn/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props2 = this.props,\n samplernn = _props2.samplernn,\n runner = _props2.runner,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = samplernn.data || {},\n folderLookup = _ref.folderLookup;\n // console.log(runner)\n\n\n var folder = (folderLookup || {})[samplernn.folder_id] || {};\n return (0, _preact.h)(\n 'div',\n { className: 'app samplernn' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_common.Loading, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n folder && folder.name && folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, {\n title: 'Add Files',\n module: _samplernn4.default,\n folder: folder,\n canUpload: true, canAddURL: true\n }),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_upload2.default, null),\n (0, _preact.h)(_common.CurrentTask, { processor: 'gpu' })\n )\n ),\n (0, _preact.h)(_dataset4.default, {\n loading: samplernn.loading,\n progress: samplernn.progress,\n id: samplernn.folder_id,\n module: _samplernn4.default,\n data: samplernn.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n // console.log('picked a file', file)\n _this2.handlePick(file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n samplernn = _props3.samplernn,\n remote = _props3.remote;\n\n var input = samplernn.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 2);\n } },\n '2x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 4);\n } },\n '4x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 6);\n } },\n '6x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 18);\n } },\n '18x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'x'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, samplernn.folder_id, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n // console.log(file)\n this.props.audioPlayer.play(file);\n }\n }]);\n\n return SampleRNNShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn,\n runner: state.system.runner\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch),\n remote: (0, _redux.bindActionCreators)(samplernnTasks, dispatch),\n audioPlayer: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.stop_queue = exports.start_queue = exports.add_task = exports.stop_task = exports.start_task = undefined;\n\nvar _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; };\n\nvar _socket = require('../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar start_task = exports.start_task = function start_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.start_task(task, opt);\n return _extends({ type: _types2.default.task.starting_task, task: task }, opt);\n};\n\nvar stop_task = exports.stop_task = function stop_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.stop_task(task, opt);\n return _extends({ type: _types2.default.task.stopping_task, task: task }, opt);\n};\n\nvar add_task = exports.add_task = function add_task(new_task) {\n return function (dispatch) {\n _actions2.default.task.create(new_task).then(function (task) {\n _socket2.default.task.add_task(task);\n });\n };\n};\n\nvar start_queue = exports.start_queue = function start_queue(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.start_queue(task, opt);\n return _extends({ type: _types2.default.task.starting_queue, task: task }, opt);\n};\n\nvar stop_queue = exports.stop_queue = function stop_queue(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.stop_queue(task, opt);\n return _extends({ type: _types2.default.task.stopping_queue, task: task }, opt);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar queueInitialState = {\n loading: false,\n error: null,\n tasks: {},\n queue: [],\n completed: []\n};\n\nvar dateSort = _util2.default.sort.orderByFn('updated_at desc');\nvar prioritySort = _util2.default.sort.orderByFn('priority asc');\n\nvar queueReducer = function queueReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : queueInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.task.index:\n return _extends({}, state, {\n tasks: action.data.reduce(function (a, b) {\n return a[b.id] = b, a;\n }, {}),\n queue: action.data.filter(function (a) {\n return !a.completed;\n }).map(dateSort.mapFn).sort(dateSort.sortFn).map(function (pair) {\n return pair[1].id;\n }),\n completed: action.data.filter(function (a) {\n return a.completed;\n }).map(prioritySort.mapFn).sort(prioritySort.sortFn).map(function (pair) {\n return pair[1].id;\n })\n });\n case _types2.default.task.create:\n console.log(action.data);\n return _extends({}, state, {\n tasks: _extends({}, state.tasks, _defineProperty({}, action.data.id, action.data)),\n queue: state.queue.concat([action.data.id])\n });\n case _types2.default.task.update:\n return _extends({}, state, {\n tasks: _extends({}, state.tasks, _defineProperty({}, action.data.id, action.data))\n });\n case _types2.default.task.destroy:\n var _state$tasks = state.tasks,\n deletedTask = _state$tasks[action.data.id],\n taskLookup = _objectWithoutProperties(_state$tasks, [action.data.id]);\n\n return _extends({}, state, {\n queue: state.queue.filter(function (id) {\n return id !== deletedTask.id;\n }),\n completed: state.completed.filter(function (id) {\n return id !== deletedTask.id;\n }),\n tasks: taskLookup\n });\n case _types2.default.task.task_finish:\n return _extends({}, state, {\n queue: state.queue.filter(function (a) {\n return a !== action.task.id;\n }),\n completed: [action.task.id].concat(state.completed)\n });\n default:\n return state;\n }\n};\n\nexports.default = queueReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nvar _socket2 = require('./socket.actions');\n\nvar actions = _interopRequireWildcard(_socket2);\n\nvar _socket3 = require('./socket.system');\n\nvar system = _interopRequireWildcard(_socket3);\n\nvar _socket4 = require('./socket.live');\n\nvar live = _interopRequireWildcard(_socket4);\n\nvar _socket5 = require('./socket.task');\n\nvar task = _interopRequireWildcard(_socket5);\n\nvar _socket6 = require('./socket.api');\n\nvar api = _interopRequireWildcard(_socket6);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = {\n socket: _socket.socket,\n actions: actions,\n system: system,\n live: live,\n task: task,\n api: api\n};\n\n\n_socket.socket.on('status', function (data) {\n console.log('got status', data.key, data.value);\n _store.store.dispatch(_extends({ type: _types2.default.socket.status }, data));\n switch (data.key) {\n case 'processing':\n _store.store.dispatch(_extends({\n type: 'SET_PARAM'\n }, data));\n break;\n default:\n break;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.syscall_async = exports.upload_file = exports.run_script = exports.list_sequences = exports.count_directory = exports.list_directory = exports.disk_usage = exports.run_system_command = undefined;\n\nvar _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; };\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar run_system_command = exports.run_system_command = function run_system_command(opt) {\n return syscall_async('run_system_command', opt);\n};\nvar disk_usage = exports.disk_usage = function disk_usage(opt) {\n return syscall_async('run_system_command', _extends({ cmd: 'du' }, opt));\n};\nvar list_directory = exports.list_directory = function list_directory(opt) {\n return syscall_async('list_directory', opt).then(function (res) {\n return res.files;\n });\n};\nvar count_directory = exports.count_directory = function count_directory(opt) {\n return syscall_async('count_directory', opt).then(function (res) {\n return res.count;\n });\n};\nvar list_sequences = exports.list_sequences = function list_sequences(opt) {\n return syscall_async('list_sequences', opt).then(function (res) {\n return res.sequences;\n });\n};\nvar run_script = exports.run_script = function run_script(opt) {\n return syscall_async('run_script', opt);\n};\nvar upload_file = exports.upload_file = function upload_file(opt) {\n return syscall_async('upload_file', opt);\n};\n\nvar syscall_async = exports.syscall_async = function syscall_async(tag, payload) {\n var ttl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10000;\n\n ttl = payload.ttl || ttl;\n return new Promise(function (resolve, reject) {\n var uuid = (0, _v2.default)();\n var timeout = setTimeout(function () {\n _socket.socket.off('system_res', cb);\n reject('timeout');\n }, ttl);\n var cb = function cb(data) {\n if (!data.uuid) return;\n if (data.uuid === uuid) {\n clearTimeout(timeout);\n _socket.socket.off('system_res', cb);\n resolve(data);\n }\n };\n _socket.socket.emit('system', { cmd: tag, payload: payload, uuid: uuid });\n _socket.socket.on('system_res', cb);\n });\n};","'use strict';\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_socket.socket.on('api_res', function (data) {\n // console.log('system response', data)\n data = parse(data);\n var type = _types2.default[data.datatype];\n console.log('api_res', data.type, data.datatype);\n if (!type) return console.error('socket:api_res bad datatype', data.datatype);\n switch (data.type) {\n case 'create':\n return (0, _store.dispatch)({\n type: type.create,\n source: 'socket',\n data: data.data\n });\n case 'update':\n return (0, _store.dispatch)({\n type: type.update,\n source: 'socket',\n data: data.data\n });\n case 'destroy':\n return (0, _store.dispatch)({\n type: type.destroy,\n source: 'socket',\n data: data.data\n });\n default:\n break;\n }\n});\n\nfunction parse(s) {\n if (typeof s === 'string') {\n try {\n var d = JSON.parse(s);\n return d;\n } catch (e) {\n console.error('not valid json');\n return s;\n }\n }\n return s;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.socket = undefined;\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar socket = exports.socket = io.connect('/client');\n\n// SOCKET ACTIONS\n\nsocket.on('connect', function () {\n return _store.store.dispatch({ type: _types2.default.socket.connect });\n});\nsocket.on('connect_error', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.connect_error, error: error });\n});\nsocket.on('reconnect', function (attempt) {\n return _store.store.dispatch({ type: _types2.default.socket.reconnect, attempt: attempt });\n});\nsocket.on('reconnecting', function () {\n return _store.store.dispatch({ type: _types2.default.socket.reconnecting });\n});\nsocket.on('reconnect_error', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.reconnect_error, error: error });\n});\nsocket.on('reconnect_failed', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.reconnect_failed, error: error });\n});\nsocket.on('disconnect', function () {\n return _store.store.dispatch({ type: _types2.default.socket.disconnect });\n});\nsocket.on('error', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.error, error: error });\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.list_checkpoints = list_checkpoints;\nexports.list_all_checkpoints = list_all_checkpoints;\nexports.list_epochs = list_epochs;\nexports.list_sequences = list_sequences;\nexports.load_epoch = load_epoch;\nexports.load_sequence = load_sequence;\nexports.seek = seek;\nexports.pause = pause;\nexports.play = play;\nexports.get_params = get_params;\nexports.set_param = set_param;\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _player = require('../live/player');\n\nvar player = _interopRequireWildcard(_player);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_socket.socket.on('res', function (data) {\n // console.log('socket:', data.cmd)\n switch (data.cmd) {\n case 'get_last_frame':\n if (data.res !== 'working') {\n _socket.socket.emit('cmd', {\n cmd: 'get_last_frame'\n });\n }\n break;\n case 'get_params':\n data.res && (0, _store.dispatch)({\n type: _types2.default.socket.load_params,\n opt: data.res\n });\n data.res && player.toggleFPS(data.res.processing);\n break;\n case 'list_checkpoints':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_checkpoints,\n checkpoints: data.res\n });\n break;\n case 'list_all_checkpoints':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_all_checkpoints,\n checkpoints: data.res\n });\n break;\n case 'list_epochs':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_epochs,\n epochs: data.res\n });\n break;\n case 'list_sequences':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_sequences,\n sequences: data.res\n });\n break;\n default:\n break;\n }\n // console.log(data)\n});\n\n_socket.socket.on('frame', player.onFrame);\n\nfunction list_checkpoints(module) {\n _socket.socket.emit('cmd', {\n cmd: 'list_checkpoints',\n payload: module\n });\n}\nfunction list_all_checkpoints(module) {\n _socket.socket.emit('cmd', {\n cmd: 'list_all_checkpoints',\n payload: module\n });\n}\nfunction list_epochs(module, checkpoint_name) {\n _socket.socket.emit('cmd', {\n cmd: 'list_epochs',\n payload: module === 'pix2pix' || module === 'pix2wav' ? module + '/' + checkpoint_name : checkpoint_name\n });\n}\nfunction list_sequences(module) {\n _socket.socket.emit('cmd', {\n cmd: 'list_sequences',\n payload: module\n });\n}\nfunction load_epoch(checkpoint_name, epoch) {\n console.log(\">> SWITCH CHECKPOINT\", checkpoint_name, epoch);\n _socket.socket.emit('cmd', {\n cmd: 'load_epoch',\n payload: checkpoint_name + ':' + epoch\n });\n}\nfunction load_sequence(sequence) {\n _socket.socket.emit('cmd', {\n cmd: 'load_sequence',\n payload: sequence\n });\n}\nfunction seek(frame) {\n _socket.socket.emit('cmd', {\n cmd: 'seek',\n payload: frame\n });\n}\nfunction pause(frame) {\n _socket.socket.emit('cmd', {\n cmd: 'pause'\n });\n}\nfunction play(frame) {\n _socket.socket.emit('cmd', {\n cmd: 'play'\n });\n}\nfunction get_params() {\n _socket.socket.emit('cmd', {\n cmd: 'get_params'\n });\n}\nfunction set_param(key, value) {\n _socket.socket.emit('cmd', {\n cmd: 'set_param',\n payload: {\n 'key': key,\n 'value': value\n }\n });\n}","'use strict';\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_socket.socket.on('system_res', function (data) {\n // console.log('system response', data)\n switch (data.type) {\n case 'relay_connected':\n return (0, _store.dispatch)({\n type: _types2.default.system.relay_connected\n });\n case 'relay_disconnected':\n return (0, _store.dispatch)({\n type: _types2.default.system.relay_disconnected\n });\n case 'rpc_connected':\n return (0, _store.dispatch)({\n type: _types2.default.system.rpc_connected,\n runner: data.runner\n });\n case 'rpc_disconnected':\n return (0, _store.dispatch)({\n type: _types2.default.system.rpc_disconnected\n });\n case 'relay_status':\n return (0, _store.dispatch)({\n type: data.rpc_connected ? _types2.default.system.rpc_connected : _types2.default.system.rpc_disconnected,\n runner: data.runner\n });\n case 'site':\n return (0, _store.dispatch)({\n type: _types2.default.system.load_site,\n site: data.site\n });\n default:\n break;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.stop_queue = exports.start_queue = exports.stop_task = exports.start_task = exports.remove_task = exports.add_task = undefined;\n\nvar _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; };\n\nexports.emit = emit;\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar finishTimeout = void 0;\n\n_socket.socket.on('task_res', function (raw_data) {\n // does not like the nested task object for some reason..\n var data = void 0;\n try {\n if (typeof raw_data === 'string') {\n data = JSON.parse(raw_data);\n if (typeof data === 'string') {\n data = JSON.parse(data);\n }\n } else {\n data = raw_data;\n }\n } catch (e) {\n console.warn('problem with json', e);\n return;\n }\n if (data.task) {\n (0, _store.dispatch)({ type: _types2.default.task.update, data: data.task });\n }\n // console.log('task', data.type)\n switch (data.type) {\n case 'start':\n // return dispatch({ type: types.system.rpc_connected, runner: data.runner })\n break;\n case 'stop':\n break;\n // begin and finish calls often arrive out of order, if the old task was preempted\n case 'task_begin':\n (0, _store.dispatch)({ type: _types2.default.task.task_begin, task: data.task });\n break;\n case 'task_finish':\n (0, _store.dispatch)({ type: _types2.default.task.task_finish, task: data.task });\n break;\n case 'kill':\n break;\n case 'stdout':\n return (0, _store.dispatch)({ type: _types2.default.system.stdout, data: data });\n break;\n case 'stderr':\n return (0, _store.dispatch)({ type: _types2.default.system.stderr, data: data });\n break;\n case 'add':\n break;\n case 'remove':\n break;\n case 'start_queue':\n break;\n case 'stop_queue':\n break;\n case 'list':\n break;\n case 'set_priority':\n break;\n case 'progress':\n (0, _store.dispatch)({ type: _types2.default.task.progress, task: data.task });\n break;\n case 'epoch':\n (0, _store.dispatch)({ type: _types2.default.task.epoch, task: data.task });\n break;\n case 'task_error':\n return console.log('task error', data);\n default:\n console.log(data);\n return console.log('no such task command', data.type);\n }\n});\n\nfunction emit(type) {\n var task = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var opt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _socket.socket.emit('task', _extends({ type: type, task: task }, opt));\n}\n\nvar add_task = exports.add_task = function add_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('add', task, opt);\n};\nvar remove_task = exports.remove_task = function remove_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('remove', task, opt);\n};\nvar start_task = exports.start_task = function start_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('start', task, opt);\n};\nvar stop_task = exports.stop_task = function stop_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('stop', task, opt);\n};\nvar start_queue = exports.start_queue = function start_queue() {\n var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return emit('start_queue', {}, opt);\n};\nvar stop_queue = exports.stop_queue = function stop_queue() {\n var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return emit('stop_queue', {}, opt);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dispatch = exports.store = exports.history = undefined;\n\nvar _redux = require('redux');\n\nvar _reactRouterRedux = require('react-router-redux');\n\nvar _reduxThunk = require('redux-thunk');\n\nvar _reduxThunk2 = _interopRequireDefault(_reduxThunk);\n\nvar _createBrowserHistory = require('history/createBrowserHistory');\n\nvar _createBrowserHistory2 = _interopRequireDefault(_createBrowserHistory);\n\nvar _system = require('./system/system.reducer');\n\nvar _system2 = _interopRequireDefault(_system);\n\nvar _dashboard = require('./dashboard/dashboard.reducer');\n\nvar _dashboard2 = _interopRequireDefault(_dashboard);\n\nvar _live = require('./live/live.reducer');\n\nvar _live2 = _interopRequireDefault(_live);\n\nvar _upload = require('./dataset/upload.reducer');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _queue = require('./queue/queue.reducer');\n\nvar _queue2 = _interopRequireDefault(_queue);\n\nvar _audioPlayer = require('./common/audioPlayer/audioPlayer.reducer');\n\nvar _audioPlayer2 = _interopRequireDefault(_audioPlayer);\n\nvar _module = require('./modules/module.reducer');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar appReducer = (0, _redux.combineReducers)({\n system: _system2.default,\n dashboard: _dashboard2.default,\n live: _live2.default,\n upload: _upload2.default,\n queue: _queue2.default,\n router: _reactRouterRedux.routerReducer,\n module: _module.moduleReducer,\n audioPlayer: _audioPlayer2.default\n});\n\n// import navReducer from './nav.reducer'\nvar history = exports.history = (0, _createBrowserHistory2.default)();\nvar store = exports.store = (0, _redux.createStore)(appReducer, (0, _redux.compose)((0, _redux.applyMiddleware)(\n// createLogger(),\n_reduxThunk2.default, (0, _reactRouterRedux.routerMiddleware)(history))));\n\nvar dispatch = exports.dispatch = store.dispatch;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.enqueue_test_task = exports.changeTool = exports.countDirectory = exports.listDirectory = exports.run = undefined;\n\nvar _socket = require('../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// import actions from '../actions'\n\nvar run = exports.run = function run(cmd) {\n return function (dispatch) {\n dispatch({ type: _types2.default.system.running_command, cmd: cmd });\n _socket2.default.actions.run_system_command({ cmd: cmd }).then(function (data) {\n dispatch({\n type: _types2.default.system.command_output,\n data: data\n });\n });\n };\n};\n\nvar listDirectory = exports.listDirectory = function listDirectory(opt) {\n return function (dispatch) {\n dispatch({ type: _types2.default.system.listing_directory, opt: opt });\n _socket2.default.actions.list_directory(opt).then(function (data) {\n dispatch({\n type: _types2.default.system.list_directory,\n data: data\n });\n });\n };\n};\n\nvar countDirectory = exports.countDirectory = function countDirectory(opt) {\n return function (dispatch) {\n dispatch({ type: _types2.default.system.counting_directory, opt: opt });\n _socket2.default.actions.count_directory(opt).then(function (data) {\n dispatch({\n type: _types2.default.system.count_directory,\n data: data\n });\n });\n };\n};\n\nvar changeTool = exports.changeTool = function changeTool(tool) {\n localStorage.setItem('system.last_tool', tool);\n return { type: _types2.default.app.change_tool, tool: tool };\n};\n\nvar enqueue_test_task = exports.enqueue_test_task = function enqueue_test_task(dataset) {\n return function (dispatch) {\n var task = {\n module: 'test',\n activity: 'cpu',\n dataset: dataset\n // return actions.queue.add_task(task)\n };\n };\n};\n\nwindow.addEventListener('keyDown', function (e) {\n if (e.altKey) {\n switch (e.keyCode) {\n case 192:\n // tilde - switch tool\n break;\n case 49:\n // 1\n break;\n case 50:\n // 2\n break;\n case 51:\n // 3\n break;\n case 52:\n // 4\n break;\n case 53:\n // 5\n break;\n case 54:\n // 6\n break;\n case 55:\n // 7\n break;\n case 56:\n // 8\n break;\n case 57:\n // 9\n break;\n case 48:\n // 0\n break;\n }\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _group = require('../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('../common/param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _system = require('./system.actions');\n\nvar systemActions = _interopRequireWildcard(_system);\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar cpu_test_task = {\n activity: 'cpu',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar gpu_test_task = {\n activity: 'gpu',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar live_test_task = {\n activity: 'live',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar wait_test_task = {\n activity: 'wait',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar fruits = [\"apple\", \"pear\", \"orange\", \"strawberry\"];\nfunction choice(a) {\n return a[Math.floor(Math.random() * a.length)];\n}\n\nvar System = function (_Component) {\n _inherits(System, _Component);\n\n function System(props) {\n _classCallCheck(this, System);\n\n return _possibleConstructorReturn(this, (System.__proto__ || Object.getPrototypeOf(System)).call(this));\n }\n\n _createClass(System, [{\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n if (this._screen.scrollHeight > this._screen.scrollTop - this._screen.offsetHeight + 100) {\n this._screen.scrollTop = this._screen.scrollHeight;\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n site = _props.site,\n server = _props.server,\n relay = _props.relay,\n runner = _props.runner,\n rpc = _props.rpc,\n actions = _props.actions;\n\n return (0, _preact.h)(\n 'div',\n { className: 'app system' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n site.name,\n ' system'\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row params' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _group2.default,\n { title: 'Status' },\n (0, _preact.h)(\n _param2.default,\n { title: 'Server' },\n server.status\n ),\n server.error && (0, _preact.h)(\n _param2.default,\n { title: 'Server error' },\n server.error.message\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Relay' },\n relay.status\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'RPC' },\n rpc.status\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'CPU' },\n this.renderStatus(runner.cpu)\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'GPU' },\n this.renderStatus(runner.gpu)\n )\n ),\n (0, _preact.h)(\n _group2.default,\n { title: 'Diagnostics' },\n (0, _preact.h)(\n _param2.default,\n { title: 'Check GPU' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('nvidia-smi');\n } },\n 'nvidia-smi'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'List processes' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('ps');\n } },\n 'ps'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'List users' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('w');\n } },\n 'w'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Disk free space' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('df');\n } },\n 'df'\n )\n )\n ),\n (0, _preact.h)(\n _group2.default,\n { title: 'Tasks' },\n (0, _preact.h)(\n _param2.default,\n { title: 'Kill task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task('cpu');\n } },\n 'CPU'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task('gpu');\n } },\n 'GPU'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Queue' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_queue();\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_queue();\n } },\n 'Stop'\n )\n )\n ),\n (0, _preact.h)(\n _group2.default,\n { title: 'Test' },\n (0, _preact.h)(\n _param2.default,\n { title: 'CPU Test Task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(cpu_test_task, { preempt: true, watch: true });\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task(runner.cpu.task);\n } },\n 'Stop'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'GPU Test Task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(gpu_test_task, { preempt: true, watch: true });\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task(runner.gpu.task);\n } },\n 'Stop'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Live Test Task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(live_test_task, { preempt: true, watch: true });\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task(runner.cpu.task);\n } },\n 'Stop'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Test Live RPC' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.live.get_params();\n } },\n 'Get'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.live.set_param('fruit', choice(fruits));\n } },\n 'Set'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Queue Tests' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.enqueue_test_task(choice(fruits));\n } },\n '+Add test task'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: '' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(wait_test_task, { preempt: true, watch: true });\n } },\n 'Wait and Buzz'\n )\n )\n )\n ),\n this.renderCommandOutput()\n )\n );\n }\n }, {\n key: 'renderStatus',\n value: function renderStatus(processor) {\n if (!processor) {\n return 'unknown';\n }\n if (processor.status === 'IDLE') {\n return 'idle';\n }\n var task = processor.task;\n return task.activity + ' ' + task.module;\n }\n }, {\n key: 'renderCommandOutput',\n value: function renderCommandOutput() {\n var _this2 = this;\n\n var _props2 = this.props,\n cmd = _props2.cmd,\n stdout = _props2.stdout,\n stderr = _props2.stderr;\n\n var output = void 0;\n if (cmd.loading) {\n output = 'Loading: ' + cmd.name;\n } else if (cmd.loaded) {\n if (cmd.error) {\n output = 'Error: ' + cmd.name + '\\n\\n' + JSON.stringify(cmd.error, null, 2);\n } else {\n output = cmd.stdout;\n if (cmd.stderr) {\n output += '\\n\\n_________________________________\\n\\n';\n output += cmd.stderr;\n }\n }\n } else {\n output = stdout;\n if (stderr.length) {\n output += '\\n\\n_________________________________\\n\\n';\n output += stderr;\n }\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { ref: function ref(_ref) {\n return _this2._screen = _ref;\n }, className: 'screen' },\n output\n )\n );\n }\n }]);\n\n return System;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return _extends({}, state.system, state.live);\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n system: (0, _redux.bindActionCreators)(systemActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n live: (0, _redux.bindActionCreators)(liveActions, dispatch)\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(System);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar FileSaver = require('file-saver');\n\nvar systemInitialState = {\n loading: false,\n error: null,\n\n site: {\n name: 'loading'\n },\n app: {\n tool: localStorage.getItem('system.last_tool') || 'pix2pix'\n },\n server: {\n connected: false,\n status: \"disconnected\",\n error: null\n },\n relay: {\n connected: false,\n status: \"unknown\",\n error: null\n },\n rpc: {\n connected: false,\n status: \"disconnected\",\n error: null\n },\n cmd: {\n loading: false,\n loaded: false,\n name: null,\n error: null,\n stdout: \"\",\n stderr: \"\"\n },\n runner: {\n cpu: { status: 'IDLE', task: {} },\n gpu: { status: 'IDLE', task: {} }\n },\n stdout: \"\",\n stderr: \"\"\n};\n\nvar modules = ['pix2pix', 'samplernn', 'pix2wav'].reduce(function (a, b) {\n return a[b] = b, a;\n}, {});\n\nvar systemReducer = function systemReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : systemInitialState;\n var action = arguments[1];\n\n // console.log(action.type)\n var processor = null;\n switch (action.type) {\n case _types2.default.socket.connect:\n case _types2.default.socket.reconnecting:\n return _extends({}, state, {\n server: {\n status: 'connected',\n connected: true,\n error: null\n }\n });\n case _types2.default.socket.reconnect:\n return _extends({}, state, {\n server: {\n status: 'reconnecting (attempt ' + action.attempt + ')',\n connected: false,\n error: null\n }\n });\n case _types2.default.socket.connect_error:\n case _types2.default.socket.reconnect_error:\n case _types2.default.socket.disconnect:\n case _types2.default.socket.reconnect_failed:\n return _extends({}, state, {\n server: {\n status: 'disconnected',\n connected: false,\n error: action.error || null\n }\n });\n case _types2.default.socket.error:\n return _extends({}, state, {\n server: _extends({}, state.socket, {\n error: action.error\n })\n });\n case _types2.default.system.relay_connected:\n return _extends({}, state, {\n relay: {\n status: 'connected',\n connected: true,\n error: null\n }\n });\n case _types2.default.system.relay_disconnected:\n return _extends({}, state, {\n relay: {\n status: 'disconnected',\n connected: false,\n error: null\n },\n rpc: {\n status: 'disconnected',\n connected: false,\n error: null\n }\n });\n case _types2.default.system.rpc_connected:\n return _extends({}, state, {\n rpc: {\n status: 'connected',\n connected: true,\n error: null\n },\n runner: action.runner\n });\n case _types2.default.system.rpc_disconnected:\n return _extends({}, state, {\n rpc: {\n status: 'disconnected',\n connected: false,\n error: null\n },\n runner: action.runner || state.runner\n });\n case _types2.default.system.load_site:\n document.querySelector('title').innerHTML = action.site.name + '.cortex';\n var tool = state.app.tool;\n var path = window.location.pathname.split('/')[1];\n if (path in modules) {\n tool = path;\n }\n return _extends({}, state, {\n site: action.site,\n app: _extends({}, state.app, {\n tool: tool\n })\n });\n case _types2.default.system.running_command:\n return _extends({}, state, {\n cmd: {\n loading: true,\n loaded: false,\n name: action.cmd,\n error: null,\n stdout: null,\n stderr: null\n }\n });\n case _types2.default.system.command_output:\n return _extends({}, state, {\n cmd: {\n loading: false,\n loaded: true,\n name: action.data.cmd,\n error: action.data.error,\n stdout: action.data.stdout,\n stderr: action.data.stderr\n }\n });\n case _types2.default.task.task_begin:\n console.log('task begin', action.task, action.task.processor);\n return _extends({}, state, {\n runner: _extends({}, state.runner, _defineProperty({}, action.task.processor, { status: 'RUNNING', task: action.task })),\n cmd: _extends({}, state.cmd, {\n loaded: false,\n stdout: \"\",\n stderr: \"\"\n }),\n stdout: \"\",\n stderr: \"\"\n });\n case _types2.default.task.task_finish:\n if (action.task.processor === 'cpu' || state.runner.cpu.task && state.runner.cpu.task.uuid === action.task.uuid) {\n processor = 'cpu';\n } else if (action.task.processor === 'gpu' || state.runner.gpu.task && state.runner.gpu.task.uuid === action.task.uuid) {\n processor = 'gpu';\n } else {\n processor = null;\n }\n console.log('task finish', action);\n return _extends({}, state, {\n rpc: {\n connected: false,\n status: \"disconnected\",\n error: null\n },\n runner: processor ? _extends({}, state.runner, _defineProperty({}, processor, { status: 'IDLE', task: {} })) : state.runner\n });\n case _types2.default.app.change_tool:\n return _extends({}, state, {\n app: _extends({}, state.app, {\n tool: action.tool\n })\n });\n case _types2.default.system.stdout:\n if (action.data.processor && state.runner[action.data.processor]) {\n return _extends({}, state, {\n runner: _extends({}, state.runner, _defineProperty({}, action.data.processor, _extends({}, state.runner[action.data.processor], {\n last_message: action.data.data\n }))),\n stdout: state.stdout + action.data.data\n });\n }\n return _extends({}, state, {\n stdout: state.stdout + action.data.data\n });\n case _types2.default.system.stderr:\n return _extends({}, state, {\n last_message: action.data.data,\n stderr: state.stderr + action.data.data\n });\n default:\n return state;\n }\n};\n\nexports.default = systemReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _crud = require('./api/crud.types');\n\nexports.default = {\n\tsystem: {\n\t\tload_site: 'SYSTEM_LOAD_SITE',\n\t\trunning_command: 'SYSTEM_RUNNING_COMMAND',\n\t\tcommand_output: 'SYSTEM_COMMAND_OUTPUT',\n\t\trelay_connected: 'SYSTEM_RELAY_CONNECTED',\n\t\trelay_disconnected: 'SYSTEM_RELAY_DISCONNECTED',\n\t\trpc_connected: 'SYSTEM_RPC_CONNECTED',\n\t\trpc_disconnected: 'SYSTEM_RPC_DISCONNECTED',\n\t\tlist_directory: 'SYSTEM_LIST_DIRECTORY',\n\t\tlisting_directory: 'SYSTEM_LISTING_DIRECTORY',\n\t\tcount_directory: 'SYSTEM_COUNT_DIRECTORY',\n\t\tcounting_directory: 'SYSTEM_COUNTING_DIRECTORY',\n\t\tstdout: 'SYSTEM_STDOUT',\n\t\tstderr: 'SYSTEM_STDERR'\n\t},\n\tapp: {\n\t\tchange_tool: \"APP_CHANGE_TOOL\",\n\t\tload_progress: \"APP_LOAD_PROGRESS\"\n\t},\n\tfolder: (0, _crud.crud_type)('folder', []),\n\tfile: (0, _crud.crud_type)('file', []),\n\ttask: (0, _crud.crud_type)('task', ['starting_task', 'stopping_task', 'task_begin', 'task_finish', 'start_queue', 'stop_queue', 'starting_queue', 'stopping_queue', 'progress', 'epoch']),\n\tsocket: {\n\t\tconnect: 'SOCKET_CONNECT',\n\t\tconnect_error: 'SOCKET_CONNECT_ERROR',\n\t\treconnect: 'SOCKET_RECONNECT',\n\t\treconnecting: 'SOCKET_RECONNECTING',\n\t\treconnect_error: 'SOCKET_RECONNECT_ERROR',\n\t\treconnect_failed: 'SOCKET_RECONNECT_FAILED',\n\t\tdisconnect: 'SOCKET_DISCONNECT',\n\t\terror: 'SOCKET_ERROR',\n\t\tstatus: 'SOCKET_STATUS',\n\n\t\tload_params: 'SOCKET_LOAD_PARAMS',\n\t\tlist_checkpoints: 'SOCKET_LIST_CHECKPOINTS',\n\t\tlist_sequences: 'SOCKET_LIST_SEQUENCES',\n\t\tlist_epochs: 'SOCKET_LIST_EPOCHS'\n\t},\n\tplayer: {\n\t\tget_params: 'GET_PARAMS',\n\t\tset_param: 'SET_PARAM',\n\n\t\tloading_checkpoints: 'LOADING_CHECKPOINTS',\n\t\tloading_checkpoint: 'LOADING_CHECKPOINT',\n\t\tlist_checkpoints: 'LIST_CHECKPOINTS',\n\n\t\tloading_sequences: 'LOADING_SEQUENCES',\n\t\tloading_sequence: 'LOADING_SEQUENCE',\n\t\tload_sequence: 'LOAD_SEQUENCE',\n\n\t\tloading_epochs: 'LOADING_EPOCHS',\n\t\tload_epoch: 'LOAD_EPOCH',\n\n\t\tset_fps: 'SET_FPS',\n\t\tseeking: 'SEEKING',\n\t\tpausing: 'PAUSING',\n\t\tplaying: 'PLAYING',\n\t\tcurrent_frame: 'CURRENT_FRAME',\n\t\tstart_recording: 'START_RECORDING',\n\t\tadd_record_frame: 'ADD_RECORD_FRAME',\n\t\tsave_frame: 'SAVE_FRAME',\n\t\tsaving_video: 'SAVING_VIDEO',\n\t\tsave_video: 'SAVE_VIDEO',\n\n\t\tset_fullscreen: 'SET_FULLSCREEN'\n\t},\n\taudioPlayer: {\n\t\tplay: 'AUDIO_PLAY',\n\t\tpause: 'AUDIO_PAUSE',\n\t\tresume: 'AUDIO_RESUME',\n\t\tenqueue: 'AUDIO_ENQUEUE'\n\t},\n\tdataset: {\n\t\tload: 'DATASET_LOAD',\n\t\tset_folder: 'DATASET_SET_FOLDER',\n\t\tupload_files: 'DATASET_UPLOAD_FILES',\n\t\tfile_progress: 'DATASET_FILE_PROGRESS',\n\t\tfile_uploaded: 'DATASET_FILE_UPLOADED',\n\t\tfetch_url: 'DATASET_FETCH_URL',\n\t\tfetch_progress: 'DATASET_FETCH_PROGRESS',\n\t\tlist_epochs: 'DATASET_LIST_EPOCHS'\n\t},\n\tsamplernn: {\n\t\tinit: 'SAMPLERNN_INIT',\n\t\tset_folder: 'SAMPLERNN_SET_FOLDER',\n\t\tload_loss: 'SAMPLERNN_LOAD_LOSS',\n\t\tload_graph: 'SAMPLERNN_LOAD_GRAPH'\n\t\t// queue and train\n\t\t// update checkpoint settings\n\t\t// reset checkpoint settings\n\t\t// queue new checkpoint\n\t},\n\tpix2pix: (0, _crud.with_type)('pix2pix', ['init', 'set_folder']),\n\tpix2pixhd: (0, _crud.with_type)('pix2pixhd', ['init', 'set_folder', 'load_results', 'load_dataset_count']),\n\tpix2wav: (0, _crud.with_type)('pix2wav', ['init', 'set_folder']),\n\twav2pix: (0, _crud.with_type)('wav2pix', ['load', 'progress', 'finish', 'zip', 'uploading']),\n\tdashboard: (0, _crud.with_type)('dashboard', ['load']),\n\tmorph: (0, _crud.with_type)('morph', ['load'])\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.timeInSeconds = timeInSeconds;\nexports.gerund = gerund;\nexports.commatize = commatize;\nexports.carbon_date = carbon_date;\nexports.hush_views = hush_views;\nexports.hush_threads = hush_threads;\nexports.hush_size = hush_size;\nexports.hush_null = hush_null;\nexports.get_age = get_age;\nexports.courtesy_s = courtesy_s;\nfunction timeInSeconds(n) {\n return (n / 10).toFixed(1) + ' s.';\n}\nfunction gerund(s) {\n return s.replace(/e?$/, 'ing');\n}\nfunction commatize(n, radix) {\n radix = radix || 1024;\n var nums = [],\n i,\n counter = 0,\n r = Math.floor;\n if (n > radix) {\n n /= radix;\n nums.unshift(r(n * 10 % 10));\n nums.unshift(\".\");\n }\n do {\n i = n % 10;\n n = r(n / 10);\n if (n && !(++counter % 3)) {\n i = ' ' + r(i);\n }\n nums.unshift(r(i));\n } while (n);\n return nums.join(\"\");\n}\nfunction carbon_date(date, no_bold) {\n var span = (+new Date() - new Date(date)) / 1000,\n color;\n if (!no_bold && span < 86400) // modified today\n {\n color = \"new\";\n } else if (span < 604800) // modifed this week\n {\n color = \"recent\";\n } else if (span < 1209600) // modifed 2 weeks ago\n {\n color = \"med\";\n } else if (span < 3024000) // modifed 5 weeks ago\n {\n color = \"old\";\n } else if (span < 12315200) // modifed 6 months ago\n {\n color = \"older\";\n } else {\n color = \"quiet\";\n }\n return color;\n}\nfunction hush_views(n, bias, no_bold) {\n var txt = commatize(n, 1000);\n bias = bias || 1;\n n = n || 0;\n if (n < 30) {\n return [\"quiet\", n + \" v.\"];\n }\n if (n < 200) {\n return [\"quiet\", txt + \" v.\"];\n } else if (n < 500) {\n return [\"quiet\", txt + \" v.\"];\n } else if (n < 1000) {\n return [\"old\", txt + \" v.\"];\n } else if (n < 5000) {\n return [\"med\", txt + \" kv.\"];\n } else if (no_bold || n < 10000) {\n return [\"recent\", txt + \" kv.\"];\n } else {\n return [\"new\", txt + \" kv.\"];\n }\n}\nfunction hush_threads(n, bias, no_bold) {\n var txt = commatize(n, 1000);\n bias = bias || 1;\n n = n || 0;\n if (n < 10) {\n return [\"quiet\", n + \" t.\"];\n } else if (n < 25) {\n return [\"old\", txt + \" t.\"];\n } else if (n < 50) {\n return [\"med\", txt + \" t.\"];\n } else if (no_bold || n < 100) {\n return [\"recent\", txt + \" t.\"];\n } else {\n return [\"new\", txt + \" t.\"];\n }\n}\nfunction hush_size(n, bias, no_bold) {\n var txt = commatize(Math.round(n / 1024));\n bias = 1 || bias;\n n = n || 0;\n if (!n) {\n return ['', ''];\n }\n if (n < 1000) {\n return [\"quiet\", n + \" b.\"];\n }\n if (n < 1000000) {\n return [\"quiet\", txt + \" kb.\"];\n } else if (n < 20000000 / bias) {\n return [\"quiet\", txt + \" mb.\"];\n } else if (n < 50000000 / bias) {\n return [\"old\", txt + \" mb.\"];\n } else if (n < 80000000 / bias) {\n return [\"med\", txt + \" mb.\"];\n } else if (no_bold || n < 170000000 / bias) {\n return [\"recent\", txt + \" mb.\"];\n } else {\n return [\"new\", txt + \" mb.\"];\n }\n}\nfunction hush_null(n, unit, no_bold) {\n var s = unit ? n + \" \" + unit + \".\" : n;\n if (n < 3) {\n return [\"quiet\", s];\n } else if (n < 6) {\n return [\"older\", s];\n } else if (n < 10) {\n return [\"old\", s];\n } else if (n < 16) {\n return [\"med\", s];\n } else if (no_bold || n < 21) {\n return [\"recent\", s];\n } else {\n return [\"new\", s];\n }\n}\nfunction get_age(t) {\n var age = Math.abs(+Date.now() - new Date(t)) / 1000;\n var r = Math.floor;\n var m;\n if (age < 5) {\n return \"now\";\n }\n if (age < 60) {\n return r(age) + \"s\";\n }\n age /= 60;\n if (age < 60) {\n return r(age) + \"m\";\n }\n m = r(age % 60);\n age /= 60;\n if (m > 0 && age < 2) {\n return r(age) + \"h\" + m + \"m\";\n }\n if (age < 24) {\n return r(age) + \"h\";\n }\n age /= 24;\n if (age < 7) {\n return r(age) + \"d\";\n }\n age /= 7;\n if (age < 12) {\n return r(age) + \"w\";\n }\n age /= 4;\n if (age < 12) {\n return r(age) + \"m\";\n }\n age /= 12;\n return r(age) + \"y\";\n}\nfunction courtesy_s(n, s) {\n return n == 1 ? \"\" : s || \"s\";\n}","'use strict';\n\n/**\n * HiDPI Canvas Polyfill (1.0.10)\n *\n * Author: Jonathan D. Johnson (http://jondavidjohn.com)\n * Homepage: https://github.com/jondavidjohn/hidpi-canvas-polyfill\n * Issue Tracker: https://github.com/jondavidjohn/hidpi-canvas-polyfill/issues\n * License: Apache-2.0\n*/\n(function (prototype) {\n\n var pixelRatio = function () {\n var canvas = window.document.createElement('canvas'),\n context = canvas.getContext('2d'),\n backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;\n\n return (window.devicePixelRatio || 1) / backingStore;\n }(),\n forEach = function forEach(obj, func) {\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n func(obj[p], p);\n }\n }\n },\n ratioArgs = {\n 'fillRect': 'all',\n 'clearRect': 'all',\n 'strokeRect': 'all',\n 'moveTo': 'all',\n 'lineTo': 'all',\n 'arc': [0, 1, 2],\n 'arcTo': 'all',\n 'bezierCurveTo': 'all',\n 'isPointinPath': 'all',\n 'isPointinStroke': 'all',\n 'quadraticCurveTo': 'all',\n 'rect': 'all',\n 'translate': 'all',\n 'createRadialGradient': 'all',\n 'createLinearGradient': 'all'\n };\n\n if (pixelRatio === 1) return;\n\n forEach(ratioArgs, function (value, key) {\n prototype[key] = function (_super) {\n return function () {\n var i,\n len,\n args = Array.prototype.slice.call(arguments);\n\n if (value === 'all') {\n args = args.map(function (a) {\n return a * pixelRatio;\n });\n } else if (Array.isArray(value)) {\n for (i = 0, len = value.length; i < len; i++) {\n args[value[i]] *= pixelRatio;\n }\n }\n\n return _super.apply(this, args);\n };\n }(prototype[key]);\n });\n\n // Stroke lineWidth adjustment\n prototype.stroke = function (_super) {\n return function () {\n this.lineWidth *= pixelRatio;\n _super.apply(this, arguments);\n this.lineWidth /= pixelRatio;\n };\n }(prototype.stroke);\n\n // Text\n //\n prototype.fillText = function (_super) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n\n args[1] *= pixelRatio; // x\n args[2] *= pixelRatio; // y\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m * pixelRatio + u;\n });\n\n _super.apply(this, args);\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m / pixelRatio + u;\n });\n };\n }(prototype.fillText);\n\n prototype.strokeText = function (_super) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n\n args[1] *= pixelRatio; // x\n args[2] *= pixelRatio; // y\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m * pixelRatio + u;\n });\n\n _super.apply(this, args);\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m / pixelRatio + u;\n });\n };\n }(prototype.strokeText);\n})(window.CanvasRenderingContext2D.prototype);\n;(function (prototype) {\n prototype.getContext = function (_super) {\n return function (type) {\n var backingStore, ratio, context;\n\n if (type == '2d-lodpi') {\n context = _super.call(this, '2d');\n } else if (type === '2d') {\n context = _super.call(this, '2d');\n\n backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;\n\n ratio = (window.devicePixelRatio || 1) / backingStore;\n\n if (ratio > 1) {\n this.style.height = this.height + 'px';\n this.style.width = this.width + 'px';\n this.width *= ratio;\n this.height *= ratio;\n }\n } else {\n context = _super.call(this, type);\n }\n\n return context;\n };\n }(prototype.getContext);\n})(window.HTMLCanvasElement.prototype);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _sort = require('./sort');\n\nvar sort = _interopRequireWildcard(_sort);\n\nvar _format = require('./format');\n\nvar format = _interopRequireWildcard(_format);\n\nvar _math = require('./math');\n\nvar maths = _interopRequireWildcard(_math);\n\nrequire('./hidpi-canvas');\n\nfunction _interopRequireWildcard(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; } }\n\nvar is_iphone = !!(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i));\nvar is_ipad = !!navigator.userAgent.match(/iPad/i);\nvar is_android = !!navigator.userAgent.match(/Android/i);\nvar is_mobile = is_iphone || is_ipad || is_android;\nvar is_desktop = !is_mobile;\n\nvar htmlClassList = document.body.parentNode.classList;\nhtmlClassList.add(is_desktop ? 'desktop' : 'mobile');\nhtmlClassList.remove('loading');\n\n// window.debug = false\n\nvar allProgress = function allProgress(promises, progress_cb) {\n var d = 0;\n progress_cb(0, 0, promises.length);\n promises.forEach(function (p) {\n p.then(function (s) {\n d += 1;\n progress_cb(Math.floor(d * 100 / promises.length), d, promises.length);\n return s;\n });\n });\n return Promise.all(promises);\n};\n\ndocument.body.style.backgroundImage = 'linear-gradient(' + (maths.randint(40) + 40) + 'deg, #fde, #ffe)';\n\nvar fieldSet = function fieldSet(defaultFields) {\n return function (fields) {\n if (fields) {\n if (fields instanceof Set) {\n return fields;\n }\n return new Set(fields.split(' '));\n }\n return defaultFields;\n };\n};\n\nexports.default = _extends({}, maths, format, {\n sort: sort,\n allProgress: allProgress, fieldSet: fieldSet,\n is_iphone: is_iphone, is_ipad: is_ipad, is_android: is_android, is_mobile: is_mobile, is_desktop: is_desktop\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.randrange = randrange;\nexports.randsign = randsign;\nexports.choice = choice;\nexports.angle = angle;\nexports.dist = dist;\nexports.xor = xor;\nexports.quantize = quantize;\nexports.shuffle = shuffle;\nexports.gaussian = gaussian;\nvar mod = exports.mod = function mod(n, m) {\n return n - m * Math.floor(n / m);\n};\nvar clamp = exports.clamp = function clamp(n, a, b) {\n return n < a ? a : n < b ? n : b;\n};\nvar norm = exports.norm = function norm(n, a, b) {\n return (n - a) / (b - a);\n};\nvar lerp = exports.lerp = function lerp(n, a, b) {\n return (b - a) * n + a;\n};\nvar mix = exports.mix = function mix(n, a, b) {\n return a * (1 - n) + b * n;\n};\nvar randint = exports.randint = function randint(n) {\n return Math.floor(Math.random() * n);\n};\nfunction randrange(a, b) {\n return Math.random() * (b - a) + a;\n}\nfunction randsign() {\n return Math.random() >= 0.5 ? -1 : 1;\n}\nfunction choice(a) {\n return a[Math.floor(Math.random() * a.length)];\n}\nfunction angle(x0, y0, x1, y1) {\n return Math.atan2(y1 - y0, x1 - x0);\n}\nfunction dist(x0, y0, x1, y1) {\n return Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));\n}\nfunction xor(a, b) {\n a = !!a;b = !!b;return (a || b) && !(a && b);\n}\nfunction quantize(a, b) {\n return Math.floor(a / b) * b;\n}\nfunction shuffle(a) {\n for (var i = a.length; i > 0; i--) {\n var r = randint(i);\n var swap = a[i - 1];\n a[i - 1] = a[r];\n a[r] = swap;\n }\n return a;\n}\n// returns a gaussian random function with the given mean and stdev.\nfunction gaussian(mean, stdev) {\n var y2 = void 0;\n var use_last = false;\n return function () {\n var y1 = void 0;\n if (use_last) {\n y1 = y2;\n use_last = false;\n } else {\n var x1 = void 0,\n x2 = void 0,\n w = void 0;\n do {\n x1 = 2.0 * Math.random() - 1.0;\n x2 = 2.0 * Math.random() - 1.0;\n w = x1 * x1 + x2 * x2;\n } while (w >= 1.0);\n w = Math.sqrt(-2.0 * Math.log(w) / w);\n y1 = x1 * w;\n y2 = x2 * w;\n use_last = true;\n }\n\n var retval = mean + stdev * y1;\n if (retval > 0) return retval;\n return -retval;\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar numericSort = exports.numericSort = {\n asc: function asc(a, b) {\n return a[0] - b[0];\n },\n desc: function desc(a, b) {\n return b[0] - a[0];\n }\n};\nvar stringSort = exports.stringSort = {\n asc: function asc(a, b) {\n return a[0].localeCompare(b[0]);\n },\n desc: function desc(a, b) {\n return b[0].localeCompare(a[0]);\n }\n};\nvar orderByFn = exports.orderByFn = function orderByFn() {\n var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'name asc';\n\n var _s$split = s.split(' '),\n _s$split2 = _slicedToArray(_s$split, 2),\n _s$split2$ = _s$split2[0],\n field = _s$split2$ === undefined ? 'name' : _s$split2$,\n _s$split2$2 = _s$split2[1],\n direction = _s$split2$2 === undefined ? 'asc' : _s$split2$2;\n\n var mapFn = void 0,\n sortFn = void 0;\n switch (field) {\n case 'epoch':\n mapFn = function mapFn(a) {\n return [parseInt(a.epoch || a.epochs) || 0, a];\n };\n sortFn = numericSort[direction];\n break;\n case 'size':\n mapFn = function mapFn(a) {\n return [parseInt(a.size) || 0, a];\n };\n sortFn = numericSort[direction];\n break;\n case 'date':\n mapFn = function mapFn(a) {\n return [+new Date(a.date || a.created_at), a];\n };\n sortFn = numericSort[direction];\n break;\n case 'updated_at':\n mapFn = function mapFn(a) {\n return [+new Date(a.updated_at), a];\n };\n sortFn = numericSort[direction];\n break;\n case 'priority':\n mapFn = function mapFn(a) {\n return [parseInt(a.priority) || parseInt(a.id) || 1000, a];\n };\n sortFn = numericSort[direction];\n case 'name':\n default:\n mapFn = function mapFn(a) {\n return [a.name || \"\", a];\n };\n sortFn = stringSort[direction];\n break;\n }\n return { mapFn: mapFn, sortFn: sortFn };\n};","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n if (script) {\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n if (options.charset) {\n jsonpScript.setAttribute('charset', options.charset);\n }\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + _url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n window[callbackFunction] = function () {\n clearFunction(callbackFunction);\n };\n }, timeout);\n\n // Caught if got 404/500\n jsonpScript.onerror = function () {\n reject(new Error('JSONP request to ' + _url + ' failed'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n if (timeoutId) clearTimeout(timeoutId);\n };\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","'use strict';\n\nfunction FFT(size) {\n this.size = size | 0;\n if (this.size <= 1 || (this.size & (this.size - 1)) !== 0)\n throw new Error('FFT size must be a power of two and bigger than 1');\n\n this._csize = size << 1;\n\n // NOTE: Use of `var` is intentional for old V8 versions\n var table = new Array(this.size * 2);\n for (var i = 0; i < table.length; i += 2) {\n const angle = Math.PI * i / this.size;\n table[i] = Math.cos(angle);\n table[i + 1] = -Math.sin(angle);\n }\n this.table = table;\n\n // Find size's power of two\n var power = 0;\n for (var t = 1; this.size > t; t <<= 1)\n power++;\n\n // Calculate initial step's width:\n // * If we are full radix-4 - it is 2x smaller to give inital len=8\n // * Otherwise it is the same as `power` to give len=4\n this._width = power % 2 === 0 ? power - 1 : power;\n\n // Pre-compute bit-reversal patterns\n this._bitrev = new Array(1 << this._width);\n for (var j = 0; j < this._bitrev.length; j++) {\n this._bitrev[j] = 0;\n for (var shift = 0; shift < this._width; shift += 2) {\n var revShift = this._width - shift - 2;\n this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\n }\n }\n\n this._out = null;\n this._data = null;\n this._inv = 0;\n}\nmodule.exports = FFT;\n\nFFT.prototype.fromComplexArray = function fromComplexArray(complex, storage) {\n var res = storage || new Array(complex.length >>> 1);\n for (var i = 0; i < complex.length; i += 2)\n res[i >>> 1] = complex[i];\n return res;\n};\n\nFFT.prototype.createComplexArray = function createComplexArray() {\n const res = new Array(this._csize);\n for (var i = 0; i < res.length; i++)\n res[i] = 0;\n return res;\n};\n\nFFT.prototype.toComplexArray = function toComplexArray(input, storage) {\n var res = storage || this.createComplexArray();\n for (var i = 0; i < res.length; i += 2) {\n res[i] = input[i >>> 1];\n res[i + 1] = 0;\n }\n return res;\n};\n\nFFT.prototype.completeSpectrum = function completeSpectrum(spectrum) {\n var size = this._csize;\n var half = size >>> 1;\n for (var i = 2; i < half; i += 2) {\n spectrum[size - i] = spectrum[i];\n spectrum[size - i + 1] = -spectrum[i + 1];\n }\n};\n\nFFT.prototype.transform = function transform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._out = out;\n this._data = data;\n this._inv = 0;\n this._transform4();\n this._out = null;\n this._data = null;\n};\n\nFFT.prototype.realTransform = function realTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._out = out;\n this._data = data;\n this._inv = 0;\n this._realTransform4();\n this._out = null;\n this._data = null;\n};\n\nFFT.prototype.inverseTransform = function inverseTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._out = out;\n this._data = data;\n this._inv = 1;\n this._transform4();\n for (var i = 0; i < out.length; i++)\n out[i] /= this.size;\n this._out = null;\n this._data = null;\n};\n\n// radix-4 implementation\n//\n// NOTE: Uses of `var` are intentional for older V8 version that do not\n// support both `let compound assignments` and `const phi`\nFFT.prototype._transform4 = function _transform4() {\n var out = this._out;\n var size = this._csize;\n\n // Initial step (permute and transform)\n var width = this._width;\n var step = 1 << width;\n var len = (size / step) << 1;\n\n var outOff;\n var t;\n var bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleTransform2(outOff, off, step);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleTransform4(outOff, off, step);\n }\n }\n\n // Loop through steps in decreasing order\n var inv = this._inv ? -1 : 1;\n var table = this.table;\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n var quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n var limit = outOff + quarterLen;\n for (var i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n // Middle values\n const MAr = Ar;\n const MAi = Ai;\n\n const tableBr = table[k];\n const tableBi = inv * table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = table[2 * k];\n const tableCi = inv * table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = table[3 * k];\n const tableDi = inv * table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = MAr + MCr;\n const T0i = MAi + MCi;\n const T1r = MAr - MCr;\n const T1i = MAi - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n const FAr = T0r + T2r;\n const FAi = T0i + T2i;\n\n const FCr = T0r - T2r;\n const FCi = T0i - T2i;\n\n const FBr = T1r + T3i;\n const FBi = T1i - T3r;\n\n const FDr = T1r - T3i;\n const FDi = T1i + T3r;\n\n out[A] = FAr;\n out[A + 1] = FAi;\n out[B] = FBr;\n out[B + 1] = FBi;\n out[C] = FCr;\n out[C + 1] = FCi;\n out[D] = FDr;\n out[D + 1] = FDi;\n }\n }\n }\n};\n\n// radix-2 implementation\n//\n// NOTE: Only called for len=4\nFFT.prototype._singleTransform2 = function _singleTransform2(outOff, off,\n step) {\n const out = this._out;\n const data = this._data;\n\n const evenR = data[off];\n const evenI = data[off + 1];\n const oddR = data[off + step];\n const oddI = data[off + step + 1];\n\n const leftR = evenR + oddR;\n const leftI = evenI + oddI;\n const rightR = evenR - oddR;\n const rightI = evenI - oddI;\n\n out[outOff] = leftR;\n out[outOff + 1] = leftI;\n out[outOff + 2] = rightR;\n out[outOff + 3] = rightI;\n};\n\n// radix-4\n//\n// NOTE: Only called for len=8\nFFT.prototype._singleTransform4 = function _singleTransform4(outOff, off,\n step) {\n const out = this._out;\n const data = this._data;\n const inv = this._inv ? -1 : 1;\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Ai = data[off + 1];\n const Br = data[off + step];\n const Bi = data[off + step + 1];\n const Cr = data[off + step2];\n const Ci = data[off + step2 + 1];\n const Dr = data[off + step3];\n const Di = data[off + step3 + 1];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T0i = Ai + Ci;\n const T1r = Ar - Cr;\n const T1i = Ai - Ci;\n const T2r = Br + Dr;\n const T2i = Bi + Di;\n const T3r = inv * (Br - Dr);\n const T3i = inv * (Bi - Di);\n\n // Final values\n const FAr = T0r + T2r;\n const FAi = T0i + T2i;\n\n const FBr = T1r + T3i;\n const FBi = T1i - T3r;\n\n const FCr = T0r - T2r;\n const FCi = T0i - T2i;\n\n const FDr = T1r - T3i;\n const FDi = T1i + T3r;\n\n out[outOff] = FAr;\n out[outOff + 1] = FAi;\n out[outOff + 2] = FBr;\n out[outOff + 3] = FBi;\n out[outOff + 4] = FCr;\n out[outOff + 5] = FCi;\n out[outOff + 6] = FDr;\n out[outOff + 7] = FDi;\n};\n\n// Real input radix-4 implementation\nFFT.prototype._realTransform4 = function _realTransform4() {\n var out = this._out;\n var size = this._csize;\n\n // Initial step (permute and transform)\n var width = this._width;\n var step = 1 << width;\n var len = (size / step) << 1;\n\n var outOff;\n var t;\n var bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleRealTransform2(outOff, off >>> 1, step >>> 1);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleRealTransform4(outOff, off >>> 1, step >>> 1);\n }\n }\n\n // Loop through steps in decreasing order\n var inv = this._inv ? -1 : 1;\n var table = this.table;\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n var halfLen = len >>> 1;\n var quarterLen = halfLen >>> 1;\n var hquarterLen = quarterLen >>> 1;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n for (var i = 0, k = 0; i <= hquarterLen; i += 2, k += step) {\n var A = outOff + i;\n var B = A + quarterLen;\n var C = B + quarterLen;\n var D = C + quarterLen;\n\n // Original values\n var Ar = out[A];\n var Ai = out[A + 1];\n var Br = out[B];\n var Bi = out[B + 1];\n var Cr = out[C];\n var Ci = out[C + 1];\n var Dr = out[D];\n var Di = out[D + 1];\n\n // Middle values\n var MAr = Ar;\n var MAi = Ai;\n\n var tableBr = table[k];\n var tableBi = inv * table[k + 1];\n var MBr = Br * tableBr - Bi * tableBi;\n var MBi = Br * tableBi + Bi * tableBr;\n\n var tableCr = table[2 * k];\n var tableCi = inv * table[2 * k + 1];\n var MCr = Cr * tableCr - Ci * tableCi;\n var MCi = Cr * tableCi + Ci * tableCr;\n\n var tableDr = table[3 * k];\n var tableDi = inv * table[3 * k + 1];\n var MDr = Dr * tableDr - Di * tableDi;\n var MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n var T0r = MAr + MCr;\n var T0i = MAi + MCi;\n var T1r = MAr - MCr;\n var T1i = MAi - MCi;\n var T2r = MBr + MDr;\n var T2i = MBi + MDi;\n var T3r = inv * (MBr - MDr);\n var T3i = inv * (MBi - MDi);\n\n // Final values\n var FAr = T0r + T2r;\n var FAi = T0i + T2i;\n\n var FBr = T1r + T3i;\n var FBi = T1i - T3r;\n\n out[A] = FAr;\n out[A + 1] = FAi;\n out[B] = FBr;\n out[B + 1] = FBi;\n\n // Output final middle point\n if (i === 0) {\n var FCr = T0r - T2r;\n var FCi = T0i - T2i;\n out[C] = FCr;\n out[C + 1] = FCi;\n continue;\n }\n\n // Do not overwrite ourselves\n if (i === hquarterLen)\n continue;\n\n // In the flipped case:\n // MAi = -MAi\n // MBr=-MBi, MBi=-MBr\n // MCr=-MCr\n // MDr=MDi, MDi=MDr\n var ST0r = T1r;\n var ST0i = -T1i;\n var ST1r = T0r;\n var ST1i = -T0i;\n var ST2r = -inv * T3i;\n var ST2i = -inv * T3r;\n var ST3r = -inv * T2i;\n var ST3i = -inv * T2r;\n\n var SFAr = ST0r + ST2r;\n var SFAi = ST0i + ST2i;\n\n var SFBr = ST1r + ST3i;\n var SFBi = ST1i - ST3r;\n\n var SA = outOff + quarterLen - i;\n var SB = outOff + halfLen - i;\n\n out[SA] = SFAr;\n out[SA + 1] = SFAi;\n out[SB] = SFBr;\n out[SB + 1] = SFBi;\n }\n }\n }\n};\n\n// radix-2 implementation\n//\n// NOTE: Only called for len=4\nFFT.prototype._singleRealTransform2 = function _singleRealTransform2(outOff,\n off,\n step) {\n const out = this._out;\n const data = this._data;\n\n const evenR = data[off];\n const oddR = data[off + step];\n\n const leftR = evenR + oddR;\n const rightR = evenR - oddR;\n\n out[outOff] = leftR;\n out[outOff + 1] = 0;\n out[outOff + 2] = rightR;\n out[outOff + 3] = 0;\n};\n\n// radix-4\n//\n// NOTE: Only called for len=8\nFFT.prototype._singleRealTransform4 = function _singleRealTransform4(outOff,\n off,\n step) {\n const out = this._out;\n const data = this._data;\n const inv = this._inv ? -1 : 1;\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Br = data[off + step];\n const Cr = data[off + step2];\n const Dr = data[off + step3];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T1r = Ar - Cr;\n const T2r = Br + Dr;\n const T3r = inv * (Br - Dr);\n\n // Final values\n const FAr = T0r + T2r;\n\n const FBr = T1r;\n const FBi = -T3r;\n\n const FCr = T0r - T2r;\n\n const FDr = T1r;\n const FDi = T3r;\n\n out[outOff] = FAr;\n out[outOff + 1] = 0;\n out[outOff + 2] = FBr;\n out[outOff + 3] = FBi;\n out[outOff + 4] = FCr;\n out[outOff + 5] = 0;\n out[outOff + 6] = FDr;\n out[outOff + 7] = FDi;\n};\n","/* FileSaver.js\n * A saveAs() FileSaver implementation.\n * 1.3.2\n * 2016-06-16 18:25:19\n *\n * By Eli Grey, http://eligrey.com\n * License: MIT\n * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n */\n\n/*global self */\n/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */\n\n/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */\n\nvar saveAs = saveAs || (function(view) {\n\t\"use strict\";\n\t// IE <10 is explicitly unsupported\n\tif (typeof view === \"undefined\" || typeof navigator !== \"undefined\" && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n\t\treturn;\n\t}\n\tvar\n\t\t doc = view.document\n\t\t // only get URL when necessary in case Blob.js hasn't overridden it yet\n\t\t, get_URL = function() {\n\t\t\treturn view.URL || view.webkitURL || view;\n\t\t}\n\t\t, save_link = doc.createElementNS(\"http://www.w3.org/1999/xhtml\", \"a\")\n\t\t, can_use_save_link = \"download\" in save_link\n\t\t, click = function(node) {\n\t\t\tvar event = new MouseEvent(\"click\");\n\t\t\tnode.dispatchEvent(event);\n\t\t}\n\t\t, is_safari = /constructor/i.test(view.HTMLElement) || view.safari\n\t\t, is_chrome_ios =/CriOS\\/[\\d]+/.test(navigator.userAgent)\n\t\t, throw_outside = function(ex) {\n\t\t\t(view.setImmediate || view.setTimeout)(function() {\n\t\t\t\tthrow ex;\n\t\t\t}, 0);\n\t\t}\n\t\t, force_saveable_type = \"application/octet-stream\"\n\t\t// the Blob API is fundamentally broken as there is no \"downloadfinished\" event to subscribe to\n\t\t, arbitrary_revoke_timeout = 1000 * 40 // in ms\n\t\t, revoke = function(file) {\n\t\t\tvar revoker = function() {\n\t\t\t\tif (typeof file === \"string\") { // file is an object URL\n\t\t\t\t\tget_URL().revokeObjectURL(file);\n\t\t\t\t} else { // file is a File\n\t\t\t\t\tfile.remove();\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetTimeout(revoker, arbitrary_revoke_timeout);\n\t\t}\n\t\t, dispatch = function(filesaver, event_types, event) {\n\t\t\tevent_types = [].concat(event_types);\n\t\t\tvar i = event_types.length;\n\t\t\twhile (i--) {\n\t\t\t\tvar listener = filesaver[\"on\" + event_types[i]];\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener.call(filesaver, event || filesaver);\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthrow_outside(ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t, auto_bom = function(blob) {\n\t\t\t// prepend BOM for UTF-8 XML and text/* types (including HTML)\n\t\t\t// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n\t\t\tif (/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n\t\t\t\treturn new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});\n\t\t\t}\n\t\t\treturn blob;\n\t\t}\n\t\t, FileSaver = function(blob, name, no_auto_bom) {\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\t// First try a.download, then web filesystem, then object URLs\n\t\t\tvar\n\t\t\t\t filesaver = this\n\t\t\t\t, type = blob.type\n\t\t\t\t, force = type === force_saveable_type\n\t\t\t\t, object_url\n\t\t\t\t, dispatch_all = function() {\n\t\t\t\t\tdispatch(filesaver, \"writestart progress write writeend\".split(\" \"));\n\t\t\t\t}\n\t\t\t\t// on any filesys errors revert to saving with object URLs\n\t\t\t\t, fs_error = function() {\n\t\t\t\t\tif ((is_chrome_ios || (force && is_safari)) && view.FileReader) {\n\t\t\t\t\t\t// Safari doesn't allow downloading of blob urls\n\t\t\t\t\t\tvar reader = new FileReader();\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');\n\t\t\t\t\t\t\tvar popup = view.open(url, '_blank');\n\t\t\t\t\t\t\tif(!popup) view.location.href = url;\n\t\t\t\t\t\t\turl=undefined; // release reference before dispatching\n\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\tdispatch_all();\n\t\t\t\t\t\t};\n\t\t\t\t\t\treader.readAsDataURL(blob);\n\t\t\t\t\t\tfilesaver.readyState = filesaver.INIT;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// don't create more object URLs than needed\n\t\t\t\t\tif (!object_url) {\n\t\t\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t\t}\n\t\t\t\t\tif (force) {\n\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar opened = view.open(object_url, \"_blank\");\n\t\t\t\t\t\tif (!opened) {\n\t\t\t\t\t\t\t// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html\n\t\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t}\n\t\t\t;\n\t\t\tfilesaver.readyState = filesaver.INIT;\n\n\t\t\tif (can_use_save_link) {\n\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsave_link.href = object_url;\n\t\t\t\t\tsave_link.download = name;\n\t\t\t\t\tclick(save_link);\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs_error();\n\t\t}\n\t\t, FS_proto = FileSaver.prototype\n\t\t, saveAs = function(blob, name, no_auto_bom) {\n\t\t\treturn new FileSaver(blob, name || blob.name || \"download\", no_auto_bom);\n\t\t}\n\t;\n\t// IE 10+ (native saveAs)\n\tif (typeof navigator !== \"undefined\" && navigator.msSaveOrOpenBlob) {\n\t\treturn function(blob, name, no_auto_bom) {\n\t\t\tname = name || blob.name || \"download\";\n\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\treturn navigator.msSaveOrOpenBlob(blob, name);\n\t\t};\n\t}\n\n\tFS_proto.abort = function(){};\n\tFS_proto.readyState = FS_proto.INIT = 0;\n\tFS_proto.WRITING = 1;\n\tFS_proto.DONE = 2;\n\n\tFS_proto.error =\n\tFS_proto.onwritestart =\n\tFS_proto.onprogress =\n\tFS_proto.onwrite =\n\tFS_proto.onabort =\n\tFS_proto.onerror =\n\tFS_proto.onwriteend =\n\t\tnull;\n\n\treturn saveAs;\n}(\n\t typeof self !== \"undefined\" && self\n\t|| typeof window !== \"undefined\" && window\n\t|| this.content\n));\n// `self` is undefined in Firefox for Android content script context\n// while `this` is nsIContentFrameMessageManager\n// with an attribute `content` that corresponds to the window\n\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports.saveAs = saveAs;\n} else if ((typeof define !== \"undefined\" && define !== null) && (define.amd !== null)) {\n define(\"FileSaver.js\", function() {\n return saveAs;\n });\n}\n","'use strict';\n\nexports.__esModule = true;\nvar canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nvar addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {\n return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);\n};\n\nvar removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {\n return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);\n};\n\nvar getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) {\n return callback(window.confirm(message));\n}; // eslint-disable-line no-alert\n\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\nvar supportsHistory = exports.supportsHistory = function supportsHistory() {\n var ua = window.navigator.userAgent;\n\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n\n return window.history && 'pushState' in window.history;\n};\n\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\nvar supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n};\n\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\nvar supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n};\n\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\nvar isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n};","'use strict';\n\nexports.__esModule = true;\nexports.locationsAreEqual = exports.createLocation = undefined;\n\nvar _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; };\n\nvar _resolvePathname = require('resolve-pathname');\n\nvar _resolvePathname2 = _interopRequireDefault(_resolvePathname);\n\nvar _valueEqual = require('value-equal');\n\nvar _valueEqual2 = _interopRequireDefault(_valueEqual);\n\nvar _PathUtils = require('./PathUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) {\n var location = void 0;\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = (0, _PathUtils.parsePath)(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n};\n\nvar locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state);\n};","'use strict';\n\nexports.__esModule = true;\nvar addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n};\n\nvar stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n};\n\nvar hasBasename = exports.hasBasename = function hasBasename(path, prefix) {\n return new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path);\n};\n\nvar stripBasename = exports.stripBasename = function stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n};\n\nvar stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n};\n\nvar parsePath = exports.parsePath = function parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n\n var hashIndex = pathname.indexOf('#');\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nvar createPath = exports.createPath = function createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n\n\n var path = pathname || '/';\n\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;\n\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;\n\n return path;\n};","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _PathUtils = require('./PathUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nvar _DOMUtils = require('./DOMUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nvar getHistoryState = function getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n};\n\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\nvar createBrowserHistory = function createBrowserHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM');\n\n var globalHistory = window.history;\n var canUseHistory = (0, _DOMUtils.supportsHistory)();\n var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)();\n\n var _props$forceRefresh = props.forceRefresh,\n forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,\n _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';\n\n var getDOMLocation = function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n\n\n var path = pathname + search + hash;\n\n (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = (0, _PathUtils.stripBasename)(path, basename);\n\n return (0, _LocationUtils.createLocation)(path, state, key);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var handlePopState = function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return;\n\n handlePop(getDOMLocation(event.state));\n };\n\n var handleHashChange = function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n };\n\n var forceNextPop = false;\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allKeys.indexOf(fromLocation.key);\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return basename + (0, _PathUtils.createPath)(location);\n };\n\n var push = function push(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.pushState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextKeys.push(location.key);\n allKeys = nextKeys;\n\n setState({ action: action, location: location });\n }\n } else {\n (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n\n window.location.href = href;\n }\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.replaceState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n\n setState({ action: action, location: location });\n }\n } else {\n (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n\n window.location.replace(href);\n }\n });\n };\n\n var go = function go(n) {\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createBrowserHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _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; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _PathUtils = require('./PathUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nvar _DOMUtils = require('./DOMUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HashChangeEvent = 'hashchange';\n\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: _PathUtils.stripLeadingSlash,\n decodePath: _PathUtils.addLeadingSlash\n },\n slash: {\n encodePath: _PathUtils.addLeadingSlash,\n decodePath: _PathUtils.addLeadingSlash\n }\n};\n\nvar getHashPath = function getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n};\n\nvar pushHashPath = function pushHashPath(path) {\n return window.location.hash = path;\n};\n\nvar replaceHashPath = function replaceHashPath(path) {\n var hashIndex = window.location.href.indexOf('#');\n\n window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);\n};\n\nvar createHashHistory = function createHashHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM');\n\n var globalHistory = window.history;\n var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();\n\n var _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,\n _props$hashType = props.hashType,\n hashType = _props$hashType === undefined ? 'slash' : _props$hashType;\n\n var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';\n\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n\n var getDOMLocation = function getDOMLocation() {\n var path = decodePath(getHashPath());\n\n (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = (0, _PathUtils.stripBasename)(path, basename);\n\n return (0, _LocationUtils.createLocation)(path);\n };\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var forceNextPop = false;\n var ignorePath = null;\n\n var handleHashChange = function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n\n if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n\n handlePop(location);\n }\n };\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation));\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation));\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n // Ensure the hash is encoded properly before doing anything else.\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) replaceHashPath(encodedPath);\n\n var initialLocation = getDOMLocation();\n var allPaths = [(0, _PathUtils.createPath)(initialLocation)];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return '#' + encodePath(basename + (0, _PathUtils.createPath)(location));\n };\n\n var push = function push(path, state) {\n (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = (0, _PathUtils.createPath)(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n\n var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location));\n var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextPaths.push(path);\n allPaths = nextPaths;\n\n setState({ action: action, location: location });\n } else {\n (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');\n\n setState();\n }\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = (0, _PathUtils.createPath)(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location));\n\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');\n\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createHashHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _PathUtils = require('./PathUtils');\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar clamp = function clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n};\n\n/**\n * Creates a history object that stores locations in memory.\n */\nvar createMemoryHistory = function createMemoryHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var getUserConfirmation = props.getUserConfirmation,\n _props$initialEntries = props.initialEntries,\n initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries,\n _props$initialIndex = props.initialIndex,\n initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey());\n });\n\n // Public interface\n\n var createHref = _PathUtils.createPath;\n\n var push = function push(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n\n var nextEntries = history.entries.slice(0);\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n history.entries[history.index] = location;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n\n var action = 'POP';\n var location = history.entries[nextIndex];\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var canGo = function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n };\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n return transitionManager.setPrompt(prompt);\n };\n\n var listen = function listen(listener) {\n return transitionManager.appendListener(listener);\n };\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createMemoryHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createTransitionManager = function createTransitionManager() {\n var prompt = null;\n\n var setPrompt = function setPrompt(nextPrompt) {\n (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');\n\n prompt = nextPrompt;\n\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n };\n\n var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');\n\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n };\n\n var listeners = [];\n\n var appendListener = function appendListener(fn) {\n var isActive = true;\n\n var listener = function listener() {\n if (isActive) fn.apply(undefined, arguments);\n };\n\n listeners.push(listener);\n\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n };\n\n var notifyListeners = function notifyListeners() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(undefined, args);\n });\n };\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n};\n\nexports.default = createTransitionManager;","export var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nexport var addEventListener = function addEventListener(node, event, listener) {\n return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);\n};\n\nexport var removeEventListener = function removeEventListener(node, event, listener) {\n return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);\n};\n\nexport var getConfirmation = function getConfirmation(message, callback) {\n return callback(window.confirm(message));\n}; // eslint-disable-line no-alert\n\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\nexport var supportsHistory = function supportsHistory() {\n var ua = window.navigator.userAgent;\n\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n\n return window.history && 'pushState' in window.history;\n};\n\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\nexport var supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n};\n\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\nexport var supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n};\n\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\nexport var isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n};","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; };\n\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport { parsePath } from './PathUtils';\n\nexport var createLocation = function createLocation(path, state, key, currentLocation) {\n var location = void 0;\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n};\n\nexport var locationsAreEqual = function locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n};","export var addLeadingSlash = function addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n};\n\nexport var stripLeadingSlash = function stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n};\n\nexport var hasBasename = function hasBasename(path, prefix) {\n return new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path);\n};\n\nexport var stripBasename = function stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n};\n\nexport var stripTrailingSlash = function stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n};\n\nexport var parsePath = function parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n\n var hashIndex = pathname.indexOf('#');\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nexport var createPath = function createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n\n\n var path = pathname || '/';\n\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;\n\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;\n\n return path;\n};","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport { createLocation } from './LocationUtils';\nimport { addLeadingSlash, stripTrailingSlash, hasBasename, stripBasename, createPath } from './PathUtils';\nimport createTransitionManager from './createTransitionManager';\nimport { canUseDOM, addEventListener, removeEventListener, getConfirmation, supportsHistory, supportsPopStateOnHashChange, isExtraneousPopstateEvent } from './DOMUtils';\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nvar getHistoryState = function getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n};\n\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\nvar createBrowserHistory = function createBrowserHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n invariant(canUseDOM, 'Browser history needs a DOM');\n\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n\n var _props$forceRefresh = props.forceRefresh,\n forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,\n _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n var getDOMLocation = function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n\n\n var path = pathname + search + hash;\n\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = stripBasename(path, basename);\n\n return createLocation(path, state, key);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var transitionManager = createTransitionManager();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var handlePopState = function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n\n handlePop(getDOMLocation(event.state));\n };\n\n var handleHashChange = function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n };\n\n var forceNextPop = false;\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allKeys.indexOf(fromLocation.key);\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return basename + createPath(location);\n };\n\n var push = function push(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.pushState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextKeys.push(location.key);\n allKeys = nextKeys;\n\n setState({ action: action, location: location });\n }\n } else {\n warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n\n window.location.href = href;\n }\n });\n };\n\n var replace = function replace(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.replaceState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n\n setState({ action: action, location: location });\n }\n } else {\n warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n\n window.location.replace(href);\n }\n });\n };\n\n var go = function go(n) {\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n addEventListener(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) addEventListener(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n removeEventListener(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) removeEventListener(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexport default createBrowserHistory;","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; };\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport { createLocation, locationsAreEqual } from './LocationUtils';\nimport { addLeadingSlash, stripLeadingSlash, stripTrailingSlash, hasBasename, stripBasename, createPath } from './PathUtils';\nimport createTransitionManager from './createTransitionManager';\nimport { canUseDOM, addEventListener, removeEventListener, getConfirmation, supportsGoWithoutReloadUsingHash } from './DOMUtils';\n\nvar HashChangeEvent = 'hashchange';\n\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nvar getHashPath = function getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n};\n\nvar pushHashPath = function pushHashPath(path) {\n return window.location.hash = path;\n};\n\nvar replaceHashPath = function replaceHashPath(path) {\n var hashIndex = window.location.href.indexOf('#');\n\n window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);\n};\n\nvar createHashHistory = function createHashHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n invariant(canUseDOM, 'Hash history needs a DOM');\n\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n\n var _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? getConfirmation : _props$getUserConfirm,\n _props$hashType = props.hashType,\n hashType = _props$hashType === undefined ? 'slash' : _props$hashType;\n\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n\n var getDOMLocation = function getDOMLocation() {\n var path = decodePath(getHashPath());\n\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = stripBasename(path, basename);\n\n return createLocation(path);\n };\n\n var transitionManager = createTransitionManager();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var forceNextPop = false;\n var ignorePath = null;\n\n var handleHashChange = function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n\n if (!forceNextPop && locationsAreEqual(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n\n handlePop(location);\n }\n };\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n // Ensure the hash is encoded properly before doing anything else.\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) replaceHashPath(encodedPath);\n\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return '#' + encodePath(basename + createPath(location));\n };\n\n var push = function push(path, state) {\n warning(state === undefined, 'Hash history cannot push state; it is ignored');\n\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextPaths.push(path);\n allPaths = nextPaths;\n\n setState({ action: action, location: location });\n } else {\n warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');\n\n setState();\n }\n });\n };\n\n var replace = function replace(path, state) {\n warning(state === undefined, 'Hash history cannot replace state; it is ignored');\n\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');\n\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n addEventListener(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n removeEventListener(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexport default createHashHistory;","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nimport warning from 'warning';\nimport { createPath } from './PathUtils';\nimport { createLocation } from './LocationUtils';\nimport createTransitionManager from './createTransitionManager';\n\nvar clamp = function clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n};\n\n/**\n * Creates a history object that stores locations in memory.\n */\nvar createMemoryHistory = function createMemoryHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var getUserConfirmation = props.getUserConfirmation,\n _props$initialEntries = props.initialEntries,\n initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries,\n _props$initialIndex = props.initialIndex,\n initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n\n var transitionManager = createTransitionManager();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n });\n\n // Public interface\n\n var createHref = createPath;\n\n var push = function push(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n\n var nextEntries = history.entries.slice(0);\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n };\n\n var replace = function replace(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n history.entries[history.index] = location;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n\n var action = 'POP';\n var location = history.entries[nextIndex];\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var canGo = function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n };\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n return transitionManager.setPrompt(prompt);\n };\n\n var listen = function listen(listener) {\n return transitionManager.appendListener(listener);\n };\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexport default createMemoryHistory;","import warning from 'warning';\n\nvar createTransitionManager = function createTransitionManager() {\n var prompt = null;\n\n var setPrompt = function setPrompt(nextPrompt) {\n warning(prompt == null, 'A history supports only one prompt at a time');\n\n prompt = nextPrompt;\n\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n };\n\n var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message');\n\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n };\n\n var listeners = [];\n\n var appendListener = function appendListener(fn) {\n var isActive = true;\n\n var listener = function listener() {\n if (isActive) fn.apply(undefined, arguments);\n };\n\n listeners.push(listener);\n\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n };\n\n var notifyListeners = function notifyListeners() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(undefined, args);\n });\n };\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n};\n\nexport default createTransitionManager;","import _createBrowserHistory from './createBrowserHistory';\nexport { _createBrowserHistory as createBrowserHistory };\nimport _createHashHistory from './createHashHistory';\nexport { _createHashHistory as createHashHistory };\nimport _createMemoryHistory from './createMemoryHistory';\nexport { _createMemoryHistory as createMemoryHistory };\n\nexport { createLocation, locationsAreEqual } from './LocationUtils';\nexport { parsePath, createPath } from './PathUtils';","/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.hoistNonReactStatics = factory());\n}(this, (function () {\n 'use strict';\n \n var REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n };\n \n var KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n };\n \n var defineProperty = Object.defineProperty;\n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertySymbols = Object.getOwnPropertySymbols;\n var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var getPrototypeOf = Object.getPrototypeOf;\n var objectPrototype = getPrototypeOf && getPrototypeOf(Object);\n \n return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n \n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n \n var keys = getOwnPropertyNames(sourceComponent);\n \n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n \n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try { // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n \n return targetComponent;\n }\n \n return targetComponent;\n };\n})));\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","'use strict';\nvar utils = require('./utils');\nvar support = require('./support');\n// private property\nvar _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n\n// public method for encoding\nexports.encode = function(input) {\n var output = [];\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0, len = input.length, remainingBytes = len;\n\n var isArray = utils.getTypeOf(input) !== \"string\";\n while (i < input.length) {\n remainingBytes = len - i;\n\n if (!isArray) {\n chr1 = input.charCodeAt(i++);\n chr2 = i < len ? input.charCodeAt(i++) : 0;\n chr3 = i < len ? input.charCodeAt(i++) : 0;\n } else {\n chr1 = input[i++];\n chr2 = i < len ? input[i++] : 0;\n chr3 = i < len ? input[i++] : 0;\n }\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = remainingBytes > 1 ? (((chr2 & 15) << 2) | (chr3 >> 6)) : 64;\n enc4 = remainingBytes > 2 ? (chr3 & 63) : 64;\n\n output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4));\n\n }\n\n return output.join(\"\");\n};\n\n// public method for decoding\nexports.decode = function(input) {\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0, resultIndex = 0;\n\n var dataUrlPrefix = \"data:\";\n\n if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) {\n // This is a common error: people give a data url\n // (data:image/png;base64,iVBOR...) with a {base64: true} and\n // wonders why things don't work.\n // We can detect that the string input looks like a data url but we\n // *can't* be sure it is one: removing everything up to the comma would\n // be too dangerous.\n throw new Error(\"Invalid base64 input, it looks like a data url.\");\n }\n\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n var totalLength = input.length * 3 / 4;\n if(input.charAt(input.length - 1) === _keyStr.charAt(64)) {\n totalLength--;\n }\n if(input.charAt(input.length - 2) === _keyStr.charAt(64)) {\n totalLength--;\n }\n if (totalLength % 1 !== 0) {\n // totalLength is not an integer, the length does not match a valid\n // base64 content. That can happen if:\n // - the input is not a base64 content\n // - the input is *almost* a base64 content, with a extra chars at the\n // beginning or at the end\n // - the input uses a base64 variant (base64url for example)\n throw new Error(\"Invalid base64 input, bad content length.\");\n }\n var output;\n if (support.uint8array) {\n output = new Uint8Array(totalLength|0);\n } else {\n output = new Array(totalLength|0);\n }\n\n while (i < input.length) {\n\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output[resultIndex++] = chr1;\n\n if (enc3 !== 64) {\n output[resultIndex++] = chr2;\n }\n if (enc4 !== 64) {\n output[resultIndex++] = chr3;\n }\n\n }\n\n return output;\n};\n","'use strict';\n\nvar external = require(\"./external\");\nvar DataWorker = require('./stream/DataWorker');\nvar DataLengthProbe = require('./stream/DataLengthProbe');\nvar Crc32Probe = require('./stream/Crc32Probe');\nvar DataLengthProbe = require('./stream/DataLengthProbe');\n\n/**\n * Represent a compressed object, with everything needed to decompress it.\n * @constructor\n * @param {number} compressedSize the size of the data compressed.\n * @param {number} uncompressedSize the size of the data after decompression.\n * @param {number} crc32 the crc32 of the decompressed file.\n * @param {object} compression the type of compression, see lib/compressions.js.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the compressed data.\n */\nfunction CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) {\n this.compressedSize = compressedSize;\n this.uncompressedSize = uncompressedSize;\n this.crc32 = crc32;\n this.compression = compression;\n this.compressedContent = data;\n}\n\nCompressedObject.prototype = {\n /**\n * Create a worker to get the uncompressed content.\n * @return {GenericWorker} the worker.\n */\n getContentWorker : function () {\n var worker = new DataWorker(external.Promise.resolve(this.compressedContent))\n .pipe(this.compression.uncompressWorker())\n .pipe(new DataLengthProbe(\"data_length\"));\n\n var that = this;\n worker.on(\"end\", function () {\n if(this.streamInfo['data_length'] !== that.uncompressedSize) {\n throw new Error(\"Bug : uncompressed data size mismatch\");\n }\n });\n return worker;\n },\n /**\n * Create a worker to get the compressed content.\n * @return {GenericWorker} the worker.\n */\n getCompressedWorker : function () {\n return new DataWorker(external.Promise.resolve(this.compressedContent))\n .withStreamInfo(\"compressedSize\", this.compressedSize)\n .withStreamInfo(\"uncompressedSize\", this.uncompressedSize)\n .withStreamInfo(\"crc32\", this.crc32)\n .withStreamInfo(\"compression\", this.compression)\n ;\n }\n};\n\n/**\n * Chain the given worker with other workers to compress the content with the\n * given compresion.\n * @param {GenericWorker} uncompressedWorker the worker to pipe.\n * @param {Object} compression the compression object.\n * @param {Object} compressionOptions the options to use when compressing.\n * @return {GenericWorker} the new worker compressing the content.\n */\nCompressedObject.createWorkerFrom = function (uncompressedWorker, compression, compressionOptions) {\n return uncompressedWorker\n .pipe(new Crc32Probe())\n .pipe(new DataLengthProbe(\"uncompressedSize\"))\n .pipe(compression.compressWorker(compressionOptions))\n .pipe(new DataLengthProbe(\"compressedSize\"))\n .withStreamInfo(\"compression\", compression);\n};\n\nmodule.exports = CompressedObject;\n","'use strict';\n\nvar GenericWorker = require(\"./stream/GenericWorker\");\n\nexports.STORE = {\n magic: \"\\x00\\x00\",\n compressWorker : function (compressionOptions) {\n return new GenericWorker(\"STORE compression\");\n },\n uncompressWorker : function () {\n return new GenericWorker(\"STORE decompression\");\n }\n};\nexports.DEFLATE = require('./flate');\n","'use strict';\n\nvar utils = require('./utils');\n\n/**\n * The following functions come from pako, from pako/lib/zlib/crc32.js\n * released under the MIT license, see pako https://github.com/nodeca/pako/\n */\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n\n crc = crc ^ (-1);\n\n for (var i = pos; i < end; i++ ) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n// That's all for the pako functions.\n\n/**\n * Compute the crc32 of a string.\n * This is almost the same as the function crc32, but for strings. Using the\n * same function for the two use cases leads to horrible performances.\n * @param {Number} crc the starting value of the crc.\n * @param {String} str the string to use.\n * @param {Number} len the length of the string.\n * @param {Number} pos the starting position for the crc32 computation.\n * @return {Number} the computed crc32.\n */\nfunction crc32str(crc, str, len, pos) {\n var t = crcTable, end = pos + len;\n\n crc = crc ^ (-1);\n\n for (var i = pos; i < end; i++ ) {\n crc = (crc >>> 8) ^ t[(crc ^ str.charCodeAt(i)) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\nmodule.exports = function crc32wrapper(input, crc) {\n if (typeof input === \"undefined\" || !input.length) {\n return 0;\n }\n\n var isArray = utils.getTypeOf(input) !== \"string\";\n\n if(isArray) {\n return crc32(crc|0, input, input.length, 0);\n } else {\n return crc32str(crc|0, input, input.length, 0);\n }\n};\n","'use strict';\nexports.base64 = false;\nexports.binary = false;\nexports.dir = false;\nexports.createFolders = true;\nexports.date = null;\nexports.compression = null;\nexports.compressionOptions = null;\nexports.comment = null;\nexports.unixPermissions = null;\nexports.dosPermissions = null;\n","/* global Promise */\n'use strict';\n\n// load the global object first:\n// - it should be better integrated in the system (unhandledRejection in node)\n// - the environment may have a custom Promise implementation (see zone.js)\nvar ES6Promise = null;\nif (typeof Promise !== \"undefined\") {\n ES6Promise = Promise;\n} else {\n ES6Promise = require(\"lie\");\n}\n\n/**\n * Let the user use/change some implementations.\n */\nmodule.exports = {\n Promise: ES6Promise\n};\n","'use strict';\nvar USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');\n\nvar pako = require(\"pako\");\nvar utils = require(\"./utils\");\nvar GenericWorker = require(\"./stream/GenericWorker\");\n\nvar ARRAY_TYPE = USE_TYPEDARRAY ? \"uint8array\" : \"array\";\n\nexports.magic = \"\\x08\\x00\";\n\n/**\n * Create a worker that uses pako to inflate/deflate.\n * @constructor\n * @param {String} action the name of the pako function to call : either \"Deflate\" or \"Inflate\".\n * @param {Object} options the options to use when (de)compressing.\n */\nfunction FlateWorker(action, options) {\n GenericWorker.call(this, \"FlateWorker/\" + action);\n\n this._pako = null;\n this._pakoAction = action;\n this._pakoOptions = options;\n // the `meta` object from the last chunk received\n // this allow this worker to pass around metadata\n this.meta = {};\n}\n\nutils.inherits(FlateWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nFlateWorker.prototype.processChunk = function (chunk) {\n this.meta = chunk.meta;\n if (this._pako === null) {\n this._createPako();\n }\n this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false);\n};\n\n/**\n * @see GenericWorker.flush\n */\nFlateWorker.prototype.flush = function () {\n GenericWorker.prototype.flush.call(this);\n if (this._pako === null) {\n this._createPako();\n }\n this._pako.push([], true);\n};\n/**\n * @see GenericWorker.cleanUp\n */\nFlateWorker.prototype.cleanUp = function () {\n GenericWorker.prototype.cleanUp.call(this);\n this._pako = null;\n};\n\n/**\n * Create the _pako object.\n * TODO: lazy-loading this object isn't the best solution but it's the\n * quickest. The best solution is to lazy-load the worker list. See also the\n * issue #446.\n */\nFlateWorker.prototype._createPako = function () {\n this._pako = new pako[this._pakoAction]({\n raw: true,\n level: this._pakoOptions.level || -1 // default compression\n });\n var self = this;\n this._pako.onData = function(data) {\n self.push({\n data : data,\n meta : self.meta\n });\n };\n};\n\nexports.compressWorker = function (compressionOptions) {\n return new FlateWorker(\"Deflate\", compressionOptions);\n};\nexports.uncompressWorker = function () {\n return new FlateWorker(\"Inflate\", {});\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar GenericWorker = require('../stream/GenericWorker');\nvar utf8 = require('../utf8');\nvar crc32 = require('../crc32');\nvar signature = require('../signature');\n\n/**\n * Transform an integer into a string in hexadecimal.\n * @private\n * @param {number} dec the number to convert.\n * @param {number} bytes the number of bytes to generate.\n * @returns {string} the result.\n */\nvar decToHex = function(dec, bytes) {\n var hex = \"\", i;\n for (i = 0; i < bytes; i++) {\n hex += String.fromCharCode(dec & 0xff);\n dec = dec >>> 8;\n }\n return hex;\n};\n\n/**\n * Generate the UNIX part of the external file attributes.\n * @param {Object} unixPermissions the unix permissions or null.\n * @param {Boolean} isDir true if the entry is a directory, false otherwise.\n * @return {Number} a 32 bit integer.\n *\n * adapted from http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute :\n *\n * TTTTsstrwxrwxrwx0000000000ADVSHR\n * ^^^^____________________________ file type, see zipinfo.c (UNX_*)\n * ^^^_________________________ setuid, setgid, sticky\n * ^^^^^^^^^________________ permissions\n * ^^^^^^^^^^______ not used ?\n * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only\n */\nvar generateUnixExternalFileAttr = function (unixPermissions, isDir) {\n\n var result = unixPermissions;\n if (!unixPermissions) {\n // I can't use octal values in strict mode, hence the hexa.\n // 040775 => 0x41fd\n // 0100664 => 0x81b4\n result = isDir ? 0x41fd : 0x81b4;\n }\n return (result & 0xFFFF) << 16;\n};\n\n/**\n * Generate the DOS part of the external file attributes.\n * @param {Object} dosPermissions the dos permissions or null.\n * @param {Boolean} isDir true if the entry is a directory, false otherwise.\n * @return {Number} a 32 bit integer.\n *\n * Bit 0 Read-Only\n * Bit 1 Hidden\n * Bit 2 System\n * Bit 3 Volume Label\n * Bit 4 Directory\n * Bit 5 Archive\n */\nvar generateDosExternalFileAttr = function (dosPermissions, isDir) {\n\n // the dir flag is already set for compatibility\n return (dosPermissions || 0) & 0x3F;\n};\n\n/**\n * Generate the various parts used in the construction of the final zip file.\n * @param {Object} streamInfo the hash with informations about the compressed file.\n * @param {Boolean} streamedContent is the content streamed ?\n * @param {Boolean} streamingEnded is the stream finished ?\n * @param {number} offset the current offset from the start of the zip file.\n * @param {String} platform let's pretend we are this platform (change platform dependents fields)\n * @param {Function} encodeFileName the function to encode the file name / comment.\n * @return {Object} the zip parts.\n */\nvar generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) {\n var file = streamInfo['file'],\n compression = streamInfo['compression'],\n useCustomEncoding = encodeFileName !== utf8.utf8encode,\n encodedFileName = utils.transformTo(\"string\", encodeFileName(file.name)),\n utfEncodedFileName = utils.transformTo(\"string\", utf8.utf8encode(file.name)),\n comment = file.comment,\n encodedComment = utils.transformTo(\"string\", encodeFileName(comment)),\n utfEncodedComment = utils.transformTo(\"string\", utf8.utf8encode(comment)),\n useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,\n useUTF8ForComment = utfEncodedComment.length !== comment.length,\n dosTime,\n dosDate,\n extraFields = \"\",\n unicodePathExtraField = \"\",\n unicodeCommentExtraField = \"\",\n dir = file.dir,\n date = file.date;\n\n\n var dataInfo = {\n crc32 : 0,\n compressedSize : 0,\n uncompressedSize : 0\n };\n\n // if the content is streamed, the sizes/crc32 are only available AFTER\n // the end of the stream.\n if (!streamedContent || streamingEnded) {\n dataInfo.crc32 = streamInfo['crc32'];\n dataInfo.compressedSize = streamInfo['compressedSize'];\n dataInfo.uncompressedSize = streamInfo['uncompressedSize'];\n }\n\n var bitflag = 0;\n if (streamedContent) {\n // Bit 3: the sizes/crc32 are set to zero in the local header.\n // The correct values are put in the data descriptor immediately\n // following the compressed data.\n bitflag |= 0x0008;\n }\n if (!useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment)) {\n // Bit 11: Language encoding flag (EFS).\n bitflag |= 0x0800;\n }\n\n\n var extFileAttr = 0;\n var versionMadeBy = 0;\n if (dir) {\n // dos or unix, we set the dos dir flag\n extFileAttr |= 0x00010;\n }\n if(platform === \"UNIX\") {\n versionMadeBy = 0x031E; // UNIX, version 3.0\n extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir);\n } else { // DOS or other, fallback to DOS\n versionMadeBy = 0x0014; // DOS, version 2.0\n extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir);\n }\n\n // date\n // @see http://www.delorie.com/djgpp/doc/rbinter/it/52/13.html\n // @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html\n // @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html\n\n dosTime = date.getUTCHours();\n dosTime = dosTime << 6;\n dosTime = dosTime | date.getUTCMinutes();\n dosTime = dosTime << 5;\n dosTime = dosTime | date.getUTCSeconds() / 2;\n\n dosDate = date.getUTCFullYear() - 1980;\n dosDate = dosDate << 4;\n dosDate = dosDate | (date.getUTCMonth() + 1);\n dosDate = dosDate << 5;\n dosDate = dosDate | date.getUTCDate();\n\n if (useUTF8ForFileName) {\n // set the unicode path extra field. unzip needs at least one extra\n // field to correctly handle unicode path, so using the path is as good\n // as any other information. This could improve the situation with\n // other archive managers too.\n // This field is usually used without the utf8 flag, with a non\n // unicode path in the header (winrar, winzip). This helps (a bit)\n // with the messy Windows' default compressed folders feature but\n // breaks on p7zip which doesn't seek the unicode path extra field.\n // So for now, UTF-8 everywhere !\n unicodePathExtraField =\n // Version\n decToHex(1, 1) +\n // NameCRC32\n decToHex(crc32(encodedFileName), 4) +\n // UnicodeName\n utfEncodedFileName;\n\n extraFields +=\n // Info-ZIP Unicode Path Extra Field\n \"\\x75\\x70\" +\n // size\n decToHex(unicodePathExtraField.length, 2) +\n // content\n unicodePathExtraField;\n }\n\n if(useUTF8ForComment) {\n\n unicodeCommentExtraField =\n // Version\n decToHex(1, 1) +\n // CommentCRC32\n decToHex(crc32(encodedComment), 4) +\n // UnicodeName\n utfEncodedComment;\n\n extraFields +=\n // Info-ZIP Unicode Path Extra Field\n \"\\x75\\x63\" +\n // size\n decToHex(unicodeCommentExtraField.length, 2) +\n // content\n unicodeCommentExtraField;\n }\n\n var header = \"\";\n\n // version needed to extract\n header += \"\\x0A\\x00\";\n // general purpose bit flag\n header += decToHex(bitflag, 2);\n // compression method\n header += compression.magic;\n // last mod file time\n header += decToHex(dosTime, 2);\n // last mod file date\n header += decToHex(dosDate, 2);\n // crc-32\n header += decToHex(dataInfo.crc32, 4);\n // compressed size\n header += decToHex(dataInfo.compressedSize, 4);\n // uncompressed size\n header += decToHex(dataInfo.uncompressedSize, 4);\n // file name length\n header += decToHex(encodedFileName.length, 2);\n // extra field length\n header += decToHex(extraFields.length, 2);\n\n\n var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields;\n\n var dirRecord = signature.CENTRAL_FILE_HEADER +\n // version made by (00: DOS)\n decToHex(versionMadeBy, 2) +\n // file header (common to file and central directory)\n header +\n // file comment length\n decToHex(encodedComment.length, 2) +\n // disk number start\n \"\\x00\\x00\" +\n // internal file attributes TODO\n \"\\x00\\x00\" +\n // external file attributes\n decToHex(extFileAttr, 4) +\n // relative offset of local header\n decToHex(offset, 4) +\n // file name\n encodedFileName +\n // extra field\n extraFields +\n // file comment\n encodedComment;\n\n return {\n fileRecord: fileRecord,\n dirRecord: dirRecord\n };\n};\n\n/**\n * Generate the EOCD record.\n * @param {Number} entriesCount the number of entries in the zip file.\n * @param {Number} centralDirLength the length (in bytes) of the central dir.\n * @param {Number} localDirLength the length (in bytes) of the local dir.\n * @param {String} comment the zip file comment as a binary string.\n * @param {Function} encodeFileName the function to encode the comment.\n * @return {String} the EOCD record.\n */\nvar generateCentralDirectoryEnd = function (entriesCount, centralDirLength, localDirLength, comment, encodeFileName) {\n var dirEnd = \"\";\n var encodedComment = utils.transformTo(\"string\", encodeFileName(comment));\n\n // end of central dir signature\n dirEnd = signature.CENTRAL_DIRECTORY_END +\n // number of this disk\n \"\\x00\\x00\" +\n // number of the disk with the start of the central directory\n \"\\x00\\x00\" +\n // total number of entries in the central directory on this disk\n decToHex(entriesCount, 2) +\n // total number of entries in the central directory\n decToHex(entriesCount, 2) +\n // size of the central directory 4 bytes\n decToHex(centralDirLength, 4) +\n // offset of start of central directory with respect to the starting disk number\n decToHex(localDirLength, 4) +\n // .ZIP file comment length\n decToHex(encodedComment.length, 2) +\n // .ZIP file comment\n encodedComment;\n\n return dirEnd;\n};\n\n/**\n * Generate data descriptors for a file entry.\n * @param {Object} streamInfo the hash generated by a worker, containing informations\n * on the file entry.\n * @return {String} the data descriptors.\n */\nvar generateDataDescriptors = function (streamInfo) {\n var descriptor = \"\";\n descriptor = signature.DATA_DESCRIPTOR +\n // crc-32 4 bytes\n decToHex(streamInfo['crc32'], 4) +\n // compressed size 4 bytes\n decToHex(streamInfo['compressedSize'], 4) +\n // uncompressed size 4 bytes\n decToHex(streamInfo['uncompressedSize'], 4);\n\n return descriptor;\n};\n\n\n/**\n * A worker to concatenate other workers to create a zip file.\n * @param {Boolean} streamFiles `true` to stream the content of the files,\n * `false` to accumulate it.\n * @param {String} comment the comment to use.\n * @param {String} platform the platform to use, \"UNIX\" or \"DOS\".\n * @param {Function} encodeFileName the function to encode file names and comments.\n */\nfunction ZipFileWorker(streamFiles, comment, platform, encodeFileName) {\n GenericWorker.call(this, \"ZipFileWorker\");\n // The number of bytes written so far. This doesn't count accumulated chunks.\n this.bytesWritten = 0;\n // The comment of the zip file\n this.zipComment = comment;\n // The platform \"generating\" the zip file.\n this.zipPlatform = platform;\n // the function to encode file names and comments.\n this.encodeFileName = encodeFileName;\n // Should we stream the content of the files ?\n this.streamFiles = streamFiles;\n // If `streamFiles` is false, we will need to accumulate the content of the\n // files to calculate sizes / crc32 (and write them *before* the content).\n // This boolean indicates if we are accumulating chunks (it will change a lot\n // during the lifetime of this worker).\n this.accumulate = false;\n // The buffer receiving chunks when accumulating content.\n this.contentBuffer = [];\n // The list of generated directory records.\n this.dirRecords = [];\n // The offset (in bytes) from the beginning of the zip file for the current source.\n this.currentSourceOffset = 0;\n // The total number of entries in this zip file.\n this.entriesCount = 0;\n // the name of the file currently being added, null when handling the end of the zip file.\n // Used for the emited metadata.\n this.currentFile = null;\n\n\n\n this._sources = [];\n}\nutils.inherits(ZipFileWorker, GenericWorker);\n\n/**\n * @see GenericWorker.push\n */\nZipFileWorker.prototype.push = function (chunk) {\n\n var currentFilePercent = chunk.meta.percent || 0;\n var entriesCount = this.entriesCount;\n var remainingFiles = this._sources.length;\n\n if(this.accumulate) {\n this.contentBuffer.push(chunk);\n } else {\n this.bytesWritten += chunk.data.length;\n\n GenericWorker.prototype.push.call(this, {\n data : chunk.data,\n meta : {\n currentFile : this.currentFile,\n percent : entriesCount ? (currentFilePercent + 100 * (entriesCount - remainingFiles - 1)) / entriesCount : 100\n }\n });\n }\n};\n\n/**\n * The worker started a new source (an other worker).\n * @param {Object} streamInfo the streamInfo object from the new source.\n */\nZipFileWorker.prototype.openedSource = function (streamInfo) {\n this.currentSourceOffset = this.bytesWritten;\n this.currentFile = streamInfo['file'].name;\n\n var streamedContent = this.streamFiles && !streamInfo['file'].dir;\n\n // don't stream folders (because they don't have any content)\n if(streamedContent) {\n var record = generateZipParts(streamInfo, streamedContent, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);\n this.push({\n data : record.fileRecord,\n meta : {percent:0}\n });\n } else {\n // we need to wait for the whole file before pushing anything\n this.accumulate = true;\n }\n};\n\n/**\n * The worker finished a source (an other worker).\n * @param {Object} streamInfo the streamInfo object from the finished source.\n */\nZipFileWorker.prototype.closedSource = function (streamInfo) {\n this.accumulate = false;\n var streamedContent = this.streamFiles && !streamInfo['file'].dir;\n var record = generateZipParts(streamInfo, streamedContent, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);\n\n this.dirRecords.push(record.dirRecord);\n if(streamedContent) {\n // after the streamed file, we put data descriptors\n this.push({\n data : generateDataDescriptors(streamInfo),\n meta : {percent:100}\n });\n } else {\n // the content wasn't streamed, we need to push everything now\n // first the file record, then the content\n this.push({\n data : record.fileRecord,\n meta : {percent:0}\n });\n while(this.contentBuffer.length) {\n this.push(this.contentBuffer.shift());\n }\n }\n this.currentFile = null;\n};\n\n/**\n * @see GenericWorker.flush\n */\nZipFileWorker.prototype.flush = function () {\n\n var localDirLength = this.bytesWritten;\n for(var i = 0; i < this.dirRecords.length; i++) {\n this.push({\n data : this.dirRecords[i],\n meta : {percent:100}\n });\n }\n var centralDirLength = this.bytesWritten - localDirLength;\n\n var dirEnd = generateCentralDirectoryEnd(this.dirRecords.length, centralDirLength, localDirLength, this.zipComment, this.encodeFileName);\n\n this.push({\n data : dirEnd,\n meta : {percent:100}\n });\n};\n\n/**\n * Prepare the next source to be read.\n */\nZipFileWorker.prototype.prepareNextSource = function () {\n this.previous = this._sources.shift();\n this.openedSource(this.previous.streamInfo);\n if (this.isPaused) {\n this.previous.pause();\n } else {\n this.previous.resume();\n }\n};\n\n/**\n * @see GenericWorker.registerPrevious\n */\nZipFileWorker.prototype.registerPrevious = function (previous) {\n this._sources.push(previous);\n var self = this;\n\n previous.on('data', function (chunk) {\n self.processChunk(chunk);\n });\n previous.on('end', function () {\n self.closedSource(self.previous.streamInfo);\n if(self._sources.length) {\n self.prepareNextSource();\n } else {\n self.end();\n }\n });\n previous.on('error', function (e) {\n self.error(e);\n });\n return this;\n};\n\n/**\n * @see GenericWorker.resume\n */\nZipFileWorker.prototype.resume = function () {\n if(!GenericWorker.prototype.resume.call(this)) {\n return false;\n }\n\n if (!this.previous && this._sources.length) {\n this.prepareNextSource();\n return true;\n }\n if (!this.previous && !this._sources.length && !this.generatedError) {\n this.end();\n return true;\n }\n};\n\n/**\n * @see GenericWorker.error\n */\nZipFileWorker.prototype.error = function (e) {\n var sources = this._sources;\n if(!GenericWorker.prototype.error.call(this, e)) {\n return false;\n }\n for(var i = 0; i < sources.length; i++) {\n try {\n sources[i].error(e);\n } catch(e) {\n // the `error` exploded, nothing to do\n }\n }\n return true;\n};\n\n/**\n * @see GenericWorker.lock\n */\nZipFileWorker.prototype.lock = function () {\n GenericWorker.prototype.lock.call(this);\n var sources = this._sources;\n for(var i = 0; i < sources.length; i++) {\n sources[i].lock();\n }\n};\n\nmodule.exports = ZipFileWorker;\n","'use strict';\n\nvar compressions = require('../compressions');\nvar ZipFileWorker = require('./ZipFileWorker');\n\n/**\n * Find the compression to use.\n * @param {String} fileCompression the compression defined at the file level, if any.\n * @param {String} zipCompression the compression defined at the load() level.\n * @return {Object} the compression object to use.\n */\nvar getCompression = function (fileCompression, zipCompression) {\n\n var compressionName = fileCompression || zipCompression;\n var compression = compressions[compressionName];\n if (!compression) {\n throw new Error(compressionName + \" is not a valid compression method !\");\n }\n return compression;\n};\n\n/**\n * Create a worker to generate a zip file.\n * @param {JSZip} zip the JSZip instance at the right root level.\n * @param {Object} options to generate the zip file.\n * @param {String} comment the comment to use.\n */\nexports.generateWorker = function (zip, options, comment) {\n\n var zipFileWorker = new ZipFileWorker(options.streamFiles, comment, options.platform, options.encodeFileName);\n var entriesCount = 0;\n try {\n\n zip.forEach(function (relativePath, file) {\n entriesCount++;\n var compression = getCompression(file.options.compression, options.compression);\n var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};\n var dir = file.dir, date = file.date;\n\n file._compressWorker(compression, compressionOptions)\n .withStreamInfo(\"file\", {\n name : relativePath,\n dir : dir,\n date : date,\n comment : file.comment || \"\",\n unixPermissions : file.unixPermissions,\n dosPermissions : file.dosPermissions\n })\n .pipe(zipFileWorker);\n });\n zipFileWorker.entriesCount = entriesCount;\n } catch (e) {\n zipFileWorker.error(e);\n }\n\n return zipFileWorker;\n};\n","'use strict';\n\n/**\n * Representation a of zip file in js\n * @constructor\n */\nfunction JSZip() {\n // if this constructor is used without `new`, it adds `new` before itself:\n if(!(this instanceof JSZip)) {\n return new JSZip();\n }\n\n if(arguments.length) {\n throw new Error(\"The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.\");\n }\n\n // object containing the files :\n // {\n // \"folder/\" : {...},\n // \"folder/data.txt\" : {...}\n // }\n this.files = {};\n\n this.comment = null;\n\n // Where we are in the hierarchy\n this.root = \"\";\n this.clone = function() {\n var newObj = new JSZip();\n for (var i in this) {\n if (typeof this[i] !== \"function\") {\n newObj[i] = this[i];\n }\n }\n return newObj;\n };\n}\nJSZip.prototype = require('./object');\nJSZip.prototype.loadAsync = require('./load');\nJSZip.support = require('./support');\nJSZip.defaults = require('./defaults');\n\n// TODO find a better way to handle this version,\n// a require('package.json').version doesn't work with webpack, see #327\nJSZip.version = \"3.1.5\";\n\nJSZip.loadAsync = function (content, options) {\n return new JSZip().loadAsync(content, options);\n};\n\nJSZip.external = require(\"./external\");\nmodule.exports = JSZip;\n","'use strict';\nvar utils = require('./utils');\nvar external = require(\"./external\");\nvar utf8 = require('./utf8');\nvar utils = require('./utils');\nvar ZipEntries = require('./zipEntries');\nvar Crc32Probe = require('./stream/Crc32Probe');\nvar nodejsUtils = require(\"./nodejsUtils\");\n\n/**\n * Check the CRC32 of an entry.\n * @param {ZipEntry} zipEntry the zip entry to check.\n * @return {Promise} the result.\n */\nfunction checkEntryCRC32(zipEntry) {\n return new external.Promise(function (resolve, reject) {\n var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe());\n worker.on(\"error\", function (e) {\n reject(e);\n })\n .on(\"end\", function () {\n if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {\n reject(new Error(\"Corrupted zip : CRC32 mismatch\"));\n } else {\n resolve();\n }\n })\n .resume();\n });\n}\n\nmodule.exports = function(data, options) {\n var zip = this;\n options = utils.extend(options || {}, {\n base64: false,\n checkCRC32: false,\n optimizedBinaryString: false,\n createFolders: false,\n decodeFileName: utf8.utf8decode\n });\n\n if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {\n return external.Promise.reject(new Error(\"JSZip can't accept a stream when loading a zip file.\"));\n }\n\n return utils.prepareContent(\"the loaded zip file\", data, true, options.optimizedBinaryString, options.base64)\n .then(function(data) {\n var zipEntries = new ZipEntries(options);\n zipEntries.load(data);\n return zipEntries;\n }).then(function checkCRC32(zipEntries) {\n var promises = [external.Promise.resolve(zipEntries)];\n var files = zipEntries.files;\n if (options.checkCRC32) {\n for (var i = 0; i < files.length; i++) {\n promises.push(checkEntryCRC32(files[i]));\n }\n }\n return external.Promise.all(promises);\n }).then(function addFiles(results) {\n var zipEntries = results.shift();\n var files = zipEntries.files;\n for (var i = 0; i < files.length; i++) {\n var input = files[i];\n zip.file(input.fileNameStr, input.decompressed, {\n binary: true,\n optimizedBinaryString: true,\n date: input.date,\n dir: input.dir,\n comment : input.fileCommentStr.length ? input.fileCommentStr : null,\n unixPermissions : input.unixPermissions,\n dosPermissions : input.dosPermissions,\n createFolders: options.createFolders\n });\n }\n if (zipEntries.zipComment.length) {\n zip.comment = zipEntries.zipComment;\n }\n\n return zip;\n });\n};\n","\"use strict\";\n\nvar utils = require('../utils');\nvar GenericWorker = require('../stream/GenericWorker');\n\n/**\n * A worker that use a nodejs stream as source.\n * @constructor\n * @param {String} filename the name of the file entry for this stream.\n * @param {Readable} stream the nodejs stream.\n */\nfunction NodejsStreamInputAdapter(filename, stream) {\n GenericWorker.call(this, \"Nodejs stream input adapter for \" + filename);\n this._upstreamEnded = false;\n this._bindStream(stream);\n}\n\nutils.inherits(NodejsStreamInputAdapter, GenericWorker);\n\n/**\n * Prepare the stream and bind the callbacks on it.\n * Do this ASAP on node 0.10 ! A lazy binding doesn't always work.\n * @param {Stream} stream the nodejs stream to use.\n */\nNodejsStreamInputAdapter.prototype._bindStream = function (stream) {\n var self = this;\n this._stream = stream;\n stream.pause();\n stream\n .on(\"data\", function (chunk) {\n self.push({\n data: chunk,\n meta : {\n percent : 0\n }\n });\n })\n .on(\"error\", function (e) {\n if(self.isPaused) {\n this.generatedError = e;\n } else {\n self.error(e);\n }\n })\n .on(\"end\", function () {\n if(self.isPaused) {\n self._upstreamEnded = true;\n } else {\n self.end();\n }\n });\n};\nNodejsStreamInputAdapter.prototype.pause = function () {\n if(!GenericWorker.prototype.pause.call(this)) {\n return false;\n }\n this._stream.pause();\n return true;\n};\nNodejsStreamInputAdapter.prototype.resume = function () {\n if(!GenericWorker.prototype.resume.call(this)) {\n return false;\n }\n\n if(this._upstreamEnded) {\n this.end();\n } else {\n this._stream.resume();\n }\n\n return true;\n};\n\nmodule.exports = NodejsStreamInputAdapter;\n","'use strict';\n\nvar Readable = require('readable-stream').Readable;\n\nvar utils = require('../utils');\nutils.inherits(NodejsStreamOutputAdapter, Readable);\n\n/**\n* A nodejs stream using a worker as source.\n* @see the SourceWrapper in http://nodejs.org/api/stream.html\n* @constructor\n* @param {StreamHelper} helper the helper wrapping the worker\n* @param {Object} options the nodejs stream options\n* @param {Function} updateCb the update callback.\n*/\nfunction NodejsStreamOutputAdapter(helper, options, updateCb) {\n Readable.call(this, options);\n this._helper = helper;\n\n var self = this;\n helper.on(\"data\", function (data, meta) {\n if (!self.push(data)) {\n self._helper.pause();\n }\n if(updateCb) {\n updateCb(meta);\n }\n })\n .on(\"error\", function(e) {\n self.emit('error', e);\n })\n .on(\"end\", function () {\n self.push(null);\n });\n}\n\n\nNodejsStreamOutputAdapter.prototype._read = function() {\n this._helper.resume();\n};\n\nmodule.exports = NodejsStreamOutputAdapter;\n","'use strict';\n\nmodule.exports = {\n /**\n * True if this is running in Nodejs, will be undefined in a browser.\n * In a browser, browserify won't include this file and the whole module\n * will be resolved an empty object.\n */\n isNode : typeof Buffer !== \"undefined\",\n /**\n * Create a new nodejs Buffer from an existing content.\n * @param {Object} data the data to pass to the constructor.\n * @param {String} encoding the encoding to use.\n * @return {Buffer} a new Buffer.\n */\n newBufferFrom: function(data, encoding) {\n // XXX We can't use `Buffer.from` which comes from `Uint8Array.from`\n // in nodejs v4 (< v.4.5). It's not the expected implementation (and\n // has a different signature).\n // see https://github.com/nodejs/node/issues/8053\n // A condition on nodejs' version won't solve the issue as we don't\n // control the Buffer polyfills that may or may not be used.\n return new Buffer(data, encoding);\n },\n /**\n * Create a new nodejs Buffer with the specified size.\n * @param {Integer} size the size of the buffer.\n * @return {Buffer} a new Buffer.\n */\n allocBuffer: function (size) {\n if (Buffer.alloc) {\n return Buffer.alloc(size);\n } else {\n return new Buffer(size);\n }\n },\n /**\n * Find out if an object is a Buffer.\n * @param {Object} b the object to test.\n * @return {Boolean} true if the object is a Buffer, false otherwise.\n */\n isBuffer : function(b){\n return Buffer.isBuffer(b);\n },\n\n isStream : function (obj) {\n return obj &&\n typeof obj.on === \"function\" &&\n typeof obj.pause === \"function\" &&\n typeof obj.resume === \"function\";\n }\n};\n","'use strict';\nvar utf8 = require('./utf8');\nvar utils = require('./utils');\nvar GenericWorker = require('./stream/GenericWorker');\nvar StreamHelper = require('./stream/StreamHelper');\nvar defaults = require('./defaults');\nvar CompressedObject = require('./compressedObject');\nvar ZipObject = require('./zipObject');\nvar generate = require(\"./generate\");\nvar nodejsUtils = require(\"./nodejsUtils\");\nvar NodejsStreamInputAdapter = require(\"./nodejs/NodejsStreamInputAdapter\");\n\n\n/**\n * Add a file in the current folder.\n * @private\n * @param {string} name the name of the file\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file\n * @param {Object} originalOptions the options of the file\n * @return {Object} the new file.\n */\nvar fileAdd = function(name, data, originalOptions) {\n // be sure sub folders exist\n var dataType = utils.getTypeOf(data),\n parent;\n\n\n /*\n * Correct options.\n */\n\n var o = utils.extend(originalOptions || {}, defaults);\n o.date = o.date || new Date();\n if (o.compression !== null) {\n o.compression = o.compression.toUpperCase();\n }\n\n if (typeof o.unixPermissions === \"string\") {\n o.unixPermissions = parseInt(o.unixPermissions, 8);\n }\n\n // UNX_IFDIR 0040000 see zipinfo.c\n if (o.unixPermissions && (o.unixPermissions & 0x4000)) {\n o.dir = true;\n }\n // Bit 4 Directory\n if (o.dosPermissions && (o.dosPermissions & 0x0010)) {\n o.dir = true;\n }\n\n if (o.dir) {\n name = forceTrailingSlash(name);\n }\n if (o.createFolders && (parent = parentFolder(name))) {\n folderAdd.call(this, parent, true);\n }\n\n var isUnicodeString = dataType === \"string\" && o.binary === false && o.base64 === false;\n if (!originalOptions || typeof originalOptions.binary === \"undefined\") {\n o.binary = !isUnicodeString;\n }\n\n\n var isCompressedEmpty = (data instanceof CompressedObject) && data.uncompressedSize === 0;\n\n if (isCompressedEmpty || o.dir || !data || data.length === 0) {\n o.base64 = false;\n o.binary = true;\n data = \"\";\n o.compression = \"STORE\";\n dataType = \"string\";\n }\n\n /*\n * Convert content to fit.\n */\n\n var zipObjectContent = null;\n if (data instanceof CompressedObject || data instanceof GenericWorker) {\n zipObjectContent = data;\n } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {\n zipObjectContent = new NodejsStreamInputAdapter(name, data);\n } else {\n zipObjectContent = utils.prepareContent(name, data, o.binary, o.optimizedBinaryString, o.base64);\n }\n\n var object = new ZipObject(name, zipObjectContent, o);\n this.files[name] = object;\n /*\n TODO: we can't throw an exception because we have async promises\n (we can have a promise of a Date() for example) but returning a\n promise is useless because file(name, data) returns the JSZip\n object for chaining. Should we break that to allow the user\n to catch the error ?\n\n return external.Promise.resolve(zipObjectContent)\n .then(function () {\n return object;\n });\n */\n};\n\n/**\n * Find the parent folder of the path.\n * @private\n * @param {string} path the path to use\n * @return {string} the parent folder, or \"\"\n */\nvar parentFolder = function (path) {\n if (path.slice(-1) === '/') {\n path = path.substring(0, path.length - 1);\n }\n var lastSlash = path.lastIndexOf('/');\n return (lastSlash > 0) ? path.substring(0, lastSlash) : \"\";\n};\n\n/**\n * Returns the path with a slash at the end.\n * @private\n * @param {String} path the path to check.\n * @return {String} the path with a trailing slash.\n */\nvar forceTrailingSlash = function(path) {\n // Check the name ends with a /\n if (path.slice(-1) !== \"/\") {\n path += \"/\"; // IE doesn't like substr(-1)\n }\n return path;\n};\n\n/**\n * Add a (sub) folder in the current folder.\n * @private\n * @param {string} name the folder's name\n * @param {boolean=} [createFolders] If true, automatically create sub\n * folders. Defaults to false.\n * @return {Object} the new folder.\n */\nvar folderAdd = function(name, createFolders) {\n createFolders = (typeof createFolders !== 'undefined') ? createFolders : defaults.createFolders;\n\n name = forceTrailingSlash(name);\n\n // Does this folder already exist?\n if (!this.files[name]) {\n fileAdd.call(this, name, null, {\n dir: true,\n createFolders: createFolders\n });\n }\n return this.files[name];\n};\n\n/**\n* Cross-window, cross-Node-context regular expression detection\n* @param {Object} object Anything\n* @return {Boolean} true if the object is a regular expression,\n* false otherwise\n*/\nfunction isRegExp(object) {\n return Object.prototype.toString.call(object) === \"[object RegExp]\";\n}\n\n// return the actual prototype of JSZip\nvar out = {\n /**\n * @see loadAsync\n */\n load: function() {\n throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\");\n },\n\n\n /**\n * Call a callback function for each entry at this folder level.\n * @param {Function} cb the callback function:\n * function (relativePath, file) {...}\n * It takes 2 arguments : the relative path and the file.\n */\n forEach: function(cb) {\n var filename, relativePath, file;\n for (filename in this.files) {\n if (!this.files.hasOwnProperty(filename)) {\n continue;\n }\n file = this.files[filename];\n relativePath = filename.slice(this.root.length, filename.length);\n if (relativePath && filename.slice(0, this.root.length) === this.root) { // the file is in the current root\n cb(relativePath, file); // TODO reverse the parameters ? need to be clean AND consistent with the filter search fn...\n }\n }\n },\n\n /**\n * Filter nested files/folders with the specified function.\n * @param {Function} search the predicate to use :\n * function (relativePath, file) {...}\n * It takes 2 arguments : the relative path and the file.\n * @return {Array} An array of matching elements.\n */\n filter: function(search) {\n var result = [];\n this.forEach(function (relativePath, entry) {\n if (search(relativePath, entry)) { // the file matches the function\n result.push(entry);\n }\n\n });\n return result;\n },\n\n /**\n * Add a file to the zip file, or search a file.\n * @param {string|RegExp} name The name of the file to add (if data is defined),\n * the name of the file to find (if no data) or a regex to match files.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded\n * @param {Object} o File options\n * @return {JSZip|Object|Array} this JSZip object (when adding a file),\n * a file (when searching by string) or an array of files (when searching by regex).\n */\n file: function(name, data, o) {\n if (arguments.length === 1) {\n if (isRegExp(name)) {\n var regexp = name;\n return this.filter(function(relativePath, file) {\n return !file.dir && regexp.test(relativePath);\n });\n }\n else { // text\n var obj = this.files[this.root + name];\n if (obj && !obj.dir) {\n return obj;\n } else {\n return null;\n }\n }\n }\n else { // more than one argument : we have data !\n name = this.root + name;\n fileAdd.call(this, name, data, o);\n }\n return this;\n },\n\n /**\n * Add a directory to the zip file, or search.\n * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders.\n * @return {JSZip} an object with the new directory as the root, or an array containing matching folders.\n */\n folder: function(arg) {\n if (!arg) {\n return this;\n }\n\n if (isRegExp(arg)) {\n return this.filter(function(relativePath, file) {\n return file.dir && arg.test(relativePath);\n });\n }\n\n // else, name is a new folder\n var name = this.root + arg;\n var newFolder = folderAdd.call(this, name);\n\n // Allow chaining by returning a new object with this folder as the root\n var ret = this.clone();\n ret.root = newFolder.name;\n return ret;\n },\n\n /**\n * Delete a file, or a directory and all sub-files, from the zip\n * @param {string} name the name of the file to delete\n * @return {JSZip} this JSZip object\n */\n remove: function(name) {\n name = this.root + name;\n var file = this.files[name];\n if (!file) {\n // Look for any folders\n if (name.slice(-1) !== \"/\") {\n name += \"/\";\n }\n file = this.files[name];\n }\n\n if (file && !file.dir) {\n // file\n delete this.files[name];\n } else {\n // maybe a folder, delete recursively\n var kids = this.filter(function(relativePath, file) {\n return file.name.slice(0, name.length) === name;\n });\n for (var i = 0; i < kids.length; i++) {\n delete this.files[kids[i].name];\n }\n }\n\n return this;\n },\n\n /**\n * Generate the complete zip file\n * @param {Object} options the options to generate the zip file :\n * - compression, \"STORE\" by default.\n * - type, \"base64\" by default. Values are : string, base64, uint8array, arraybuffer, blob.\n * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file\n */\n generate: function(options) {\n throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\");\n },\n\n /**\n * Generate the complete zip file as an internal stream.\n * @param {Object} options the options to generate the zip file :\n * - compression, \"STORE\" by default.\n * - type, \"base64\" by default. Values are : string, base64, uint8array, arraybuffer, blob.\n * @return {StreamHelper} the streamed zip file.\n */\n generateInternalStream: function(options) {\n var worker, opts = {};\n try {\n opts = utils.extend(options || {}, {\n streamFiles: false,\n compression: \"STORE\",\n compressionOptions : null,\n type: \"\",\n platform: \"DOS\",\n comment: null,\n mimeType: 'application/zip',\n encodeFileName: utf8.utf8encode\n });\n\n opts.type = opts.type.toLowerCase();\n opts.compression = opts.compression.toUpperCase();\n\n // \"binarystring\" is prefered but the internals use \"string\".\n if(opts.type === \"binarystring\") {\n opts.type = \"string\";\n }\n\n if (!opts.type) {\n throw new Error(\"No output type specified.\");\n }\n\n utils.checkSupport(opts.type);\n\n // accept nodejs `process.platform`\n if(\n opts.platform === 'darwin' ||\n opts.platform === 'freebsd' ||\n opts.platform === 'linux' ||\n opts.platform === 'sunos'\n ) {\n opts.platform = \"UNIX\";\n }\n if (opts.platform === 'win32') {\n opts.platform = \"DOS\";\n }\n\n var comment = opts.comment || this.comment || \"\";\n worker = generate.generateWorker(this, opts, comment);\n } catch (e) {\n worker = new GenericWorker(\"error\");\n worker.error(e);\n }\n return new StreamHelper(worker, opts.type || \"string\", opts.mimeType);\n },\n /**\n * Generate the complete zip file asynchronously.\n * @see generateInternalStream\n */\n generateAsync: function(options, onUpdate) {\n return this.generateInternalStream(options).accumulate(onUpdate);\n },\n /**\n * Generate the complete zip file asynchronously.\n * @see generateInternalStream\n */\n generateNodeStream: function(options, onUpdate) {\n options = options || {};\n if (!options.type) {\n options.type = \"nodebuffer\";\n }\n return this.generateInternalStream(options).toNodejsStream(onUpdate);\n }\n};\nmodule.exports = out;\n","/*\n * This file is used by module bundlers (browserify/webpack/etc) when\n * including a stream implementation. We use \"readable-stream\" to get a\n * consistent behavior between nodejs versions but bundlers often have a shim\n * for \"stream\". Using this shim greatly improve the compatibility and greatly\n * reduce the final size of the bundle (only one stream implementation, not\n * two).\n */\nmodule.exports = require(\"stream\");\n","'use strict';\nvar DataReader = require('./DataReader');\nvar utils = require('../utils');\n\nfunction ArrayReader(data) {\n DataReader.call(this, data);\n\tfor(var i = 0; i < this.data.length; i++) {\n\t\tdata[i] = data[i] & 0xFF;\n\t}\n}\nutils.inherits(ArrayReader, DataReader);\n/**\n * @see DataReader.byteAt\n */\nArrayReader.prototype.byteAt = function(i) {\n return this.data[this.zero + i];\n};\n/**\n * @see DataReader.lastIndexOfSignature\n */\nArrayReader.prototype.lastIndexOfSignature = function(sig) {\n var sig0 = sig.charCodeAt(0),\n sig1 = sig.charCodeAt(1),\n sig2 = sig.charCodeAt(2),\n sig3 = sig.charCodeAt(3);\n for (var i = this.length - 4; i >= 0; --i) {\n if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {\n return i - this.zero;\n }\n }\n\n return -1;\n};\n/**\n * @see DataReader.readAndCheckSignature\n */\nArrayReader.prototype.readAndCheckSignature = function (sig) {\n var sig0 = sig.charCodeAt(0),\n sig1 = sig.charCodeAt(1),\n sig2 = sig.charCodeAt(2),\n sig3 = sig.charCodeAt(3),\n data = this.readData(4);\n return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3];\n};\n/**\n * @see DataReader.readData\n */\nArrayReader.prototype.readData = function(size) {\n this.checkOffset(size);\n if(size === 0) {\n return [];\n }\n var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = ArrayReader;\n","'use strict';\nvar utils = require('../utils');\n\nfunction DataReader(data) {\n this.data = data; // type : see implementation\n this.length = data.length;\n this.index = 0;\n this.zero = 0;\n}\nDataReader.prototype = {\n /**\n * Check that the offset will not go too far.\n * @param {string} offset the additional offset to check.\n * @throws {Error} an Error if the offset is out of bounds.\n */\n checkOffset: function(offset) {\n this.checkIndex(this.index + offset);\n },\n /**\n * Check that the specified index will not be too far.\n * @param {string} newIndex the index to check.\n * @throws {Error} an Error if the index is out of bounds.\n */\n checkIndex: function(newIndex) {\n if (this.length < this.zero + newIndex || newIndex < 0) {\n throw new Error(\"End of data reached (data length = \" + this.length + \", asked index = \" + (newIndex) + \"). Corrupted zip ?\");\n }\n },\n /**\n * Change the index.\n * @param {number} newIndex The new index.\n * @throws {Error} if the new index is out of the data.\n */\n setIndex: function(newIndex) {\n this.checkIndex(newIndex);\n this.index = newIndex;\n },\n /**\n * Skip the next n bytes.\n * @param {number} n the number of bytes to skip.\n * @throws {Error} if the new index is out of the data.\n */\n skip: function(n) {\n this.setIndex(this.index + n);\n },\n /**\n * Get the byte at the specified index.\n * @param {number} i the index to use.\n * @return {number} a byte.\n */\n byteAt: function(i) {\n // see implementations\n },\n /**\n * Get the next number with a given byte size.\n * @param {number} size the number of bytes to read.\n * @return {number} the corresponding number.\n */\n readInt: function(size) {\n var result = 0,\n i;\n this.checkOffset(size);\n for (i = this.index + size - 1; i >= this.index; i--) {\n result = (result << 8) + this.byteAt(i);\n }\n this.index += size;\n return result;\n },\n /**\n * Get the next string with a given byte size.\n * @param {number} size the number of bytes to read.\n * @return {string} the corresponding string.\n */\n readString: function(size) {\n return utils.transformTo(\"string\", this.readData(size));\n },\n /**\n * Get raw data without conversion, <size> bytes.\n * @param {number} size the number of bytes to read.\n * @return {Object} the raw data, implementation specific.\n */\n readData: function(size) {\n // see implementations\n },\n /**\n * Find the last occurence of a zip signature (4 bytes).\n * @param {string} sig the signature to find.\n * @return {number} the index of the last occurence, -1 if not found.\n */\n lastIndexOfSignature: function(sig) {\n // see implementations\n },\n /**\n * Read the signature (4 bytes) at the current position and compare it with sig.\n * @param {string} sig the expected signature\n * @return {boolean} true if the signature matches, false otherwise.\n */\n readAndCheckSignature: function(sig) {\n // see implementations\n },\n /**\n * Get the next date.\n * @return {Date} the date.\n */\n readDate: function() {\n var dostime = this.readInt(4);\n return new Date(Date.UTC(\n ((dostime >> 25) & 0x7f) + 1980, // year\n ((dostime >> 21) & 0x0f) - 1, // month\n (dostime >> 16) & 0x1f, // day\n (dostime >> 11) & 0x1f, // hour\n (dostime >> 5) & 0x3f, // minute\n (dostime & 0x1f) << 1)); // second\n }\n};\nmodule.exports = DataReader;\n","'use strict';\nvar Uint8ArrayReader = require('./Uint8ArrayReader');\nvar utils = require('../utils');\n\nfunction NodeBufferReader(data) {\n Uint8ArrayReader.call(this, data);\n}\nutils.inherits(NodeBufferReader, Uint8ArrayReader);\n\n/**\n * @see DataReader.readData\n */\nNodeBufferReader.prototype.readData = function(size) {\n this.checkOffset(size);\n var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = NodeBufferReader;\n","'use strict';\nvar DataReader = require('./DataReader');\nvar utils = require('../utils');\n\nfunction StringReader(data) {\n DataReader.call(this, data);\n}\nutils.inherits(StringReader, DataReader);\n/**\n * @see DataReader.byteAt\n */\nStringReader.prototype.byteAt = function(i) {\n return this.data.charCodeAt(this.zero + i);\n};\n/**\n * @see DataReader.lastIndexOfSignature\n */\nStringReader.prototype.lastIndexOfSignature = function(sig) {\n return this.data.lastIndexOf(sig) - this.zero;\n};\n/**\n * @see DataReader.readAndCheckSignature\n */\nStringReader.prototype.readAndCheckSignature = function (sig) {\n var data = this.readData(4);\n return sig === data;\n};\n/**\n * @see DataReader.readData\n */\nStringReader.prototype.readData = function(size) {\n this.checkOffset(size);\n // this will work because the constructor applied the \"& 0xff\" mask.\n var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = StringReader;\n","'use strict';\nvar ArrayReader = require('./ArrayReader');\nvar utils = require('../utils');\n\nfunction Uint8ArrayReader(data) {\n ArrayReader.call(this, data);\n}\nutils.inherits(Uint8ArrayReader, ArrayReader);\n/**\n * @see DataReader.readData\n */\nUint8ArrayReader.prototype.readData = function(size) {\n this.checkOffset(size);\n if(size === 0) {\n // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].\n return new Uint8Array(0);\n }\n var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = Uint8ArrayReader;\n","'use strict';\n\nvar utils = require('../utils');\nvar support = require('../support');\nvar ArrayReader = require('./ArrayReader');\nvar StringReader = require('./StringReader');\nvar NodeBufferReader = require('./NodeBufferReader');\nvar Uint8ArrayReader = require('./Uint8ArrayReader');\n\n/**\n * Create a reader adapted to the data.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data to read.\n * @return {DataReader} the data reader.\n */\nmodule.exports = function (data) {\n var type = utils.getTypeOf(data);\n utils.checkSupport(type);\n if (type === \"string\" && !support.uint8array) {\n return new StringReader(data);\n }\n if (type === \"nodebuffer\") {\n return new NodeBufferReader(data);\n }\n if (support.uint8array) {\n return new Uint8ArrayReader(utils.transformTo(\"uint8array\", data));\n }\n return new ArrayReader(utils.transformTo(\"array\", data));\n};\n","'use strict';\nexports.LOCAL_FILE_HEADER = \"PK\\x03\\x04\";\nexports.CENTRAL_FILE_HEADER = \"PK\\x01\\x02\";\nexports.CENTRAL_DIRECTORY_END = \"PK\\x05\\x06\";\nexports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = \"PK\\x06\\x07\";\nexports.ZIP64_CENTRAL_DIRECTORY_END = \"PK\\x06\\x06\";\nexports.DATA_DESCRIPTOR = \"PK\\x07\\x08\";\n","'use strict';\n\nvar GenericWorker = require('./GenericWorker');\nvar utils = require('../utils');\n\n/**\n * A worker which convert chunks to a specified type.\n * @constructor\n * @param {String} destType the destination type.\n */\nfunction ConvertWorker(destType) {\n GenericWorker.call(this, \"ConvertWorker to \" + destType);\n this.destType = destType;\n}\nutils.inherits(ConvertWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nConvertWorker.prototype.processChunk = function (chunk) {\n this.push({\n data : utils.transformTo(this.destType, chunk.data),\n meta : chunk.meta\n });\n};\nmodule.exports = ConvertWorker;\n","'use strict';\n\nvar GenericWorker = require('./GenericWorker');\nvar crc32 = require('../crc32');\nvar utils = require('../utils');\n\n/**\n * A worker which calculate the crc32 of the data flowing through.\n * @constructor\n */\nfunction Crc32Probe() {\n GenericWorker.call(this, \"Crc32Probe\");\n this.withStreamInfo(\"crc32\", 0);\n}\nutils.inherits(Crc32Probe, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nCrc32Probe.prototype.processChunk = function (chunk) {\n this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0);\n this.push(chunk);\n};\nmodule.exports = Crc32Probe;\n","'use strict';\n\nvar utils = require('../utils');\nvar GenericWorker = require('./GenericWorker');\n\n/**\n * A worker which calculate the total length of the data flowing through.\n * @constructor\n * @param {String} propName the name used to expose the length\n */\nfunction DataLengthProbe(propName) {\n GenericWorker.call(this, \"DataLengthProbe for \" + propName);\n this.propName = propName;\n this.withStreamInfo(propName, 0);\n}\nutils.inherits(DataLengthProbe, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nDataLengthProbe.prototype.processChunk = function (chunk) {\n if(chunk) {\n var length = this.streamInfo[this.propName] || 0;\n this.streamInfo[this.propName] = length + chunk.data.length;\n }\n GenericWorker.prototype.processChunk.call(this, chunk);\n};\nmodule.exports = DataLengthProbe;\n\n","'use strict';\n\nvar utils = require('../utils');\nvar GenericWorker = require('./GenericWorker');\n\n// the size of the generated chunks\n// TODO expose this as a public variable\nvar DEFAULT_BLOCK_SIZE = 16 * 1024;\n\n/**\n * A worker that reads a content and emits chunks.\n * @constructor\n * @param {Promise} dataP the promise of the data to split\n */\nfunction DataWorker(dataP) {\n GenericWorker.call(this, \"DataWorker\");\n var self = this;\n this.dataIsReady = false;\n this.index = 0;\n this.max = 0;\n this.data = null;\n this.type = \"\";\n\n this._tickScheduled = false;\n\n dataP.then(function (data) {\n self.dataIsReady = true;\n self.data = data;\n self.max = data && data.length || 0;\n self.type = utils.getTypeOf(data);\n if(!self.isPaused) {\n self._tickAndRepeat();\n }\n }, function (e) {\n self.error(e);\n });\n}\n\nutils.inherits(DataWorker, GenericWorker);\n\n/**\n * @see GenericWorker.cleanUp\n */\nDataWorker.prototype.cleanUp = function () {\n GenericWorker.prototype.cleanUp.call(this);\n this.data = null;\n};\n\n/**\n * @see GenericWorker.resume\n */\nDataWorker.prototype.resume = function () {\n if(!GenericWorker.prototype.resume.call(this)) {\n return false;\n }\n\n if (!this._tickScheduled && this.dataIsReady) {\n this._tickScheduled = true;\n utils.delay(this._tickAndRepeat, [], this);\n }\n return true;\n};\n\n/**\n * Trigger a tick a schedule an other call to this function.\n */\nDataWorker.prototype._tickAndRepeat = function() {\n this._tickScheduled = false;\n if(this.isPaused || this.isFinished) {\n return;\n }\n this._tick();\n if(!this.isFinished) {\n utils.delay(this._tickAndRepeat, [], this);\n this._tickScheduled = true;\n }\n};\n\n/**\n * Read and push a chunk.\n */\nDataWorker.prototype._tick = function() {\n\n if(this.isPaused || this.isFinished) {\n return false;\n }\n\n var size = DEFAULT_BLOCK_SIZE;\n var data = null, nextIndex = Math.min(this.max, this.index + size);\n if (this.index >= this.max) {\n // EOF\n return this.end();\n } else {\n switch(this.type) {\n case \"string\":\n data = this.data.substring(this.index, nextIndex);\n break;\n case \"uint8array\":\n data = this.data.subarray(this.index, nextIndex);\n break;\n case \"array\":\n case \"nodebuffer\":\n data = this.data.slice(this.index, nextIndex);\n break;\n }\n this.index = nextIndex;\n return this.push({\n data : data,\n meta : {\n percent : this.max ? this.index / this.max * 100 : 0\n }\n });\n }\n};\n\nmodule.exports = DataWorker;\n","'use strict';\n\n/**\n * A worker that does nothing but passing chunks to the next one. This is like\n * a nodejs stream but with some differences. On the good side :\n * - it works on IE 6-9 without any issue / polyfill\n * - it weights less than the full dependencies bundled with browserify\n * - it forwards errors (no need to declare an error handler EVERYWHERE)\n *\n * A chunk is an object with 2 attributes : `meta` and `data`. The former is an\n * object containing anything (`percent` for example), see each worker for more\n * details. The latter is the real data (String, Uint8Array, etc).\n *\n * @constructor\n * @param {String} name the name of the stream (mainly used for debugging purposes)\n */\nfunction GenericWorker(name) {\n // the name of the worker\n this.name = name || \"default\";\n // an object containing metadata about the workers chain\n this.streamInfo = {};\n // an error which happened when the worker was paused\n this.generatedError = null;\n // an object containing metadata to be merged by this worker into the general metadata\n this.extraStreamInfo = {};\n // true if the stream is paused (and should not do anything), false otherwise\n this.isPaused = true;\n // true if the stream is finished (and should not do anything), false otherwise\n this.isFinished = false;\n // true if the stream is locked to prevent further structure updates (pipe), false otherwise\n this.isLocked = false;\n // the event listeners\n this._listeners = {\n 'data':[],\n 'end':[],\n 'error':[]\n };\n // the previous worker, if any\n this.previous = null;\n}\n\nGenericWorker.prototype = {\n /**\n * Push a chunk to the next workers.\n * @param {Object} chunk the chunk to push\n */\n push : function (chunk) {\n this.emit(\"data\", chunk);\n },\n /**\n * End the stream.\n * @return {Boolean} true if this call ended the worker, false otherwise.\n */\n end : function () {\n if (this.isFinished) {\n return false;\n }\n\n this.flush();\n try {\n this.emit(\"end\");\n this.cleanUp();\n this.isFinished = true;\n } catch (e) {\n this.emit(\"error\", e);\n }\n return true;\n },\n /**\n * End the stream with an error.\n * @param {Error} e the error which caused the premature end.\n * @return {Boolean} true if this call ended the worker with an error, false otherwise.\n */\n error : function (e) {\n if (this.isFinished) {\n return false;\n }\n\n if(this.isPaused) {\n this.generatedError = e;\n } else {\n this.isFinished = true;\n\n this.emit(\"error\", e);\n\n // in the workers chain exploded in the middle of the chain,\n // the error event will go downward but we also need to notify\n // workers upward that there has been an error.\n if(this.previous) {\n this.previous.error(e);\n }\n\n this.cleanUp();\n }\n return true;\n },\n /**\n * Add a callback on an event.\n * @param {String} name the name of the event (data, end, error)\n * @param {Function} listener the function to call when the event is triggered\n * @return {GenericWorker} the current object for chainability\n */\n on : function (name, listener) {\n this._listeners[name].push(listener);\n return this;\n },\n /**\n * Clean any references when a worker is ending.\n */\n cleanUp : function () {\n this.streamInfo = this.generatedError = this.extraStreamInfo = null;\n this._listeners = [];\n },\n /**\n * Trigger an event. This will call registered callback with the provided arg.\n * @param {String} name the name of the event (data, end, error)\n * @param {Object} arg the argument to call the callback with.\n */\n emit : function (name, arg) {\n if (this._listeners[name]) {\n for(var i = 0; i < this._listeners[name].length; i++) {\n this._listeners[name][i].call(this, arg);\n }\n }\n },\n /**\n * Chain a worker with an other.\n * @param {Worker} next the worker receiving events from the current one.\n * @return {worker} the next worker for chainability\n */\n pipe : function (next) {\n return next.registerPrevious(this);\n },\n /**\n * Same as `pipe` in the other direction.\n * Using an API with `pipe(next)` is very easy.\n * Implementing the API with the point of view of the next one registering\n * a source is easier, see the ZipFileWorker.\n * @param {Worker} previous the previous worker, sending events to this one\n * @return {Worker} the current worker for chainability\n */\n registerPrevious : function (previous) {\n if (this.isLocked) {\n throw new Error(\"The stream '\" + this + \"' has already been used.\");\n }\n\n // sharing the streamInfo...\n this.streamInfo = previous.streamInfo;\n // ... and adding our own bits\n this.mergeStreamInfo();\n this.previous = previous;\n var self = this;\n previous.on('data', function (chunk) {\n self.processChunk(chunk);\n });\n previous.on('end', function () {\n self.end();\n });\n previous.on('error', function (e) {\n self.error(e);\n });\n return this;\n },\n /**\n * Pause the stream so it doesn't send events anymore.\n * @return {Boolean} true if this call paused the worker, false otherwise.\n */\n pause : function () {\n if(this.isPaused || this.isFinished) {\n return false;\n }\n this.isPaused = true;\n\n if(this.previous) {\n this.previous.pause();\n }\n return true;\n },\n /**\n * Resume a paused stream.\n * @return {Boolean} true if this call resumed the worker, false otherwise.\n */\n resume : function () {\n if(!this.isPaused || this.isFinished) {\n return false;\n }\n this.isPaused = false;\n\n // if true, the worker tried to resume but failed\n var withError = false;\n if(this.generatedError) {\n this.error(this.generatedError);\n withError = true;\n }\n if(this.previous) {\n this.previous.resume();\n }\n\n return !withError;\n },\n /**\n * Flush any remaining bytes as the stream is ending.\n */\n flush : function () {},\n /**\n * Process a chunk. This is usually the method overridden.\n * @param {Object} chunk the chunk to process.\n */\n processChunk : function(chunk) {\n this.push(chunk);\n },\n /**\n * Add a key/value to be added in the workers chain streamInfo once activated.\n * @param {String} key the key to use\n * @param {Object} value the associated value\n * @return {Worker} the current worker for chainability\n */\n withStreamInfo : function (key, value) {\n this.extraStreamInfo[key] = value;\n this.mergeStreamInfo();\n return this;\n },\n /**\n * Merge this worker's streamInfo into the chain's streamInfo.\n */\n mergeStreamInfo : function () {\n for(var key in this.extraStreamInfo) {\n if (!this.extraStreamInfo.hasOwnProperty(key)) {\n continue;\n }\n this.streamInfo[key] = this.extraStreamInfo[key];\n }\n },\n\n /**\n * Lock the stream to prevent further updates on the workers chain.\n * After calling this method, all calls to pipe will fail.\n */\n lock: function () {\n if (this.isLocked) {\n throw new Error(\"The stream '\" + this + \"' has already been used.\");\n }\n this.isLocked = true;\n if (this.previous) {\n this.previous.lock();\n }\n },\n\n /**\n *\n * Pretty print the workers chain.\n */\n toString : function () {\n var me = \"Worker \" + this.name;\n if (this.previous) {\n return this.previous + \" -> \" + me;\n } else {\n return me;\n }\n }\n};\n\nmodule.exports = GenericWorker;\n","'use strict';\n\nvar utils = require('../utils');\nvar ConvertWorker = require('./ConvertWorker');\nvar GenericWorker = require('./GenericWorker');\nvar base64 = require('../base64');\nvar support = require(\"../support\");\nvar external = require(\"../external\");\n\nvar NodejsStreamOutputAdapter = null;\nif (support.nodestream) {\n try {\n NodejsStreamOutputAdapter = require('../nodejs/NodejsStreamOutputAdapter');\n } catch(e) {}\n}\n\n/**\n * Apply the final transformation of the data. If the user wants a Blob for\n * example, it's easier to work with an U8intArray and finally do the\n * ArrayBuffer/Blob conversion.\n * @param {String} type the name of the final type\n * @param {String|Uint8Array|Buffer} content the content to transform\n * @param {String} mimeType the mime type of the content, if applicable.\n * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format.\n */\nfunction transformZipOutput(type, content, mimeType) {\n switch(type) {\n case \"blob\" :\n return utils.newBlob(utils.transformTo(\"arraybuffer\", content), mimeType);\n case \"base64\" :\n return base64.encode(content);\n default :\n return utils.transformTo(type, content);\n }\n}\n\n/**\n * Concatenate an array of data of the given type.\n * @param {String} type the type of the data in the given array.\n * @param {Array} dataArray the array containing the data chunks to concatenate\n * @return {String|Uint8Array|Buffer} the concatenated data\n * @throws Error if the asked type is unsupported\n */\nfunction concat (type, dataArray) {\n var i, index = 0, res = null, totalLength = 0;\n for(i = 0; i < dataArray.length; i++) {\n totalLength += dataArray[i].length;\n }\n switch(type) {\n case \"string\":\n return dataArray.join(\"\");\n case \"array\":\n return Array.prototype.concat.apply([], dataArray);\n case \"uint8array\":\n res = new Uint8Array(totalLength);\n for(i = 0; i < dataArray.length; i++) {\n res.set(dataArray[i], index);\n index += dataArray[i].length;\n }\n return res;\n case \"nodebuffer\":\n return Buffer.concat(dataArray);\n default:\n throw new Error(\"concat : unsupported type '\" + type + \"'\");\n }\n}\n\n/**\n * Listen a StreamHelper, accumulate its content and concatenate it into a\n * complete block.\n * @param {StreamHelper} helper the helper to use.\n * @param {Function} updateCallback a callback called on each update. Called\n * with one arg :\n * - the metadata linked to the update received.\n * @return Promise the promise for the accumulation.\n */\nfunction accumulate(helper, updateCallback) {\n return new external.Promise(function (resolve, reject){\n var dataArray = [];\n var chunkType = helper._internalType,\n resultType = helper._outputType,\n mimeType = helper._mimeType;\n helper\n .on('data', function (data, meta) {\n dataArray.push(data);\n if(updateCallback) {\n updateCallback(meta);\n }\n })\n .on('error', function(err) {\n dataArray = [];\n reject(err);\n })\n .on('end', function (){\n try {\n var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n dataArray = [];\n })\n .resume();\n });\n}\n\n/**\n * An helper to easily use workers outside of JSZip.\n * @constructor\n * @param {Worker} worker the worker to wrap\n * @param {String} outputType the type of data expected by the use\n * @param {String} mimeType the mime type of the content, if applicable.\n */\nfunction StreamHelper(worker, outputType, mimeType) {\n var internalType = outputType;\n switch(outputType) {\n case \"blob\":\n case \"arraybuffer\":\n internalType = \"uint8array\";\n break;\n case \"base64\":\n internalType = \"string\";\n break;\n }\n\n try {\n // the type used internally\n this._internalType = internalType;\n // the type used to output results\n this._outputType = outputType;\n // the mime type\n this._mimeType = mimeType;\n utils.checkSupport(internalType);\n this._worker = worker.pipe(new ConvertWorker(internalType));\n // the last workers can be rewired without issues but we need to\n // prevent any updates on previous workers.\n worker.lock();\n } catch(e) {\n this._worker = new GenericWorker(\"error\");\n this._worker.error(e);\n }\n}\n\nStreamHelper.prototype = {\n /**\n * Listen a StreamHelper, accumulate its content and concatenate it into a\n * complete block.\n * @param {Function} updateCb the update callback.\n * @return Promise the promise for the accumulation.\n */\n accumulate : function (updateCb) {\n return accumulate(this, updateCb);\n },\n /**\n * Add a listener on an event triggered on a stream.\n * @param {String} evt the name of the event\n * @param {Function} fn the listener\n * @return {StreamHelper} the current helper.\n */\n on : function (evt, fn) {\n var self = this;\n\n if(evt === \"data\") {\n this._worker.on(evt, function (chunk) {\n fn.call(self, chunk.data, chunk.meta);\n });\n } else {\n this._worker.on(evt, function () {\n utils.delay(fn, arguments, self);\n });\n }\n return this;\n },\n /**\n * Resume the flow of chunks.\n * @return {StreamHelper} the current helper.\n */\n resume : function () {\n utils.delay(this._worker.resume, [], this._worker);\n return this;\n },\n /**\n * Pause the flow of chunks.\n * @return {StreamHelper} the current helper.\n */\n pause : function () {\n this._worker.pause();\n return this;\n },\n /**\n * Return a nodejs stream for this helper.\n * @param {Function} updateCb the update callback.\n * @return {NodejsStreamOutputAdapter} the nodejs stream.\n */\n toNodejsStream : function (updateCb) {\n utils.checkSupport(\"nodestream\");\n if (this._outputType !== \"nodebuffer\") {\n // an object stream containing blob/arraybuffer/uint8array/string\n // is strange and I don't know if it would be useful.\n // I you find this comment and have a good usecase, please open a\n // bug report !\n throw new Error(this._outputType + \" is not supported by this method\");\n }\n\n return new NodejsStreamOutputAdapter(this, {\n objectMode : this._outputType !== \"nodebuffer\"\n }, updateCb);\n }\n};\n\n\nmodule.exports = StreamHelper;\n","'use strict';\n\nexports.base64 = true;\nexports.array = true;\nexports.string = true;\nexports.arraybuffer = typeof ArrayBuffer !== \"undefined\" && typeof Uint8Array !== \"undefined\";\nexports.nodebuffer = typeof Buffer !== \"undefined\";\n// contains true if JSZip can read/generate Uint8Array, false otherwise.\nexports.uint8array = typeof Uint8Array !== \"undefined\";\n\nif (typeof ArrayBuffer === \"undefined\") {\n exports.blob = false;\n}\nelse {\n var buffer = new ArrayBuffer(0);\n try {\n exports.blob = new Blob([buffer], {\n type: \"application/zip\"\n }).size === 0;\n }\n catch (e) {\n try {\n var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;\n var builder = new Builder();\n builder.append(buffer);\n exports.blob = builder.getBlob('application/zip').size === 0;\n }\n catch (e) {\n exports.blob = false;\n }\n }\n}\n\ntry {\n exports.nodestream = !!require('readable-stream').Readable;\n} catch(e) {\n exports.nodestream = false;\n}\n","'use strict';\n\nvar utils = require('./utils');\nvar support = require('./support');\nvar nodejsUtils = require('./nodejsUtils');\nvar GenericWorker = require('./stream/GenericWorker');\n\n/**\n * The following functions come from pako, from pako/lib/utils/strings\n * released under the MIT license, see pako https://github.com/nodeca/pako/\n */\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new Array(256);\nfor (var i=0; i<256; i++) {\n _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);\n}\n_utf8len[254]=_utf8len[254]=1; // Invalid sequence start\n\n// convert string to array (typed, when possible)\nvar string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {\n c2 = str.charCodeAt(m_pos+1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n if (support.uint8array) {\n buf = new Uint8Array(buf_len);\n } else {\n buf = new Array(buf_len);\n }\n\n // convert\n for (i=0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {\n c2 = str.charCodeAt(m_pos+1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nvar utf8border = function(buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max-1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Fuckup - very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means vuffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\n// convert array to string\nvar buf2string = function (buf) {\n var str, i, out, c, c_len;\n var len = buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len*2);\n\n for (out=0, i=0; i<len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n // shrinkBuf(utf16buf, out)\n if (utf16buf.length !== out) {\n if(utf16buf.subarray) {\n utf16buf = utf16buf.subarray(0, out);\n } else {\n utf16buf.length = out;\n }\n }\n\n // return String.fromCharCode.apply(null, utf16buf);\n return utils.applyFromCharCode(utf16buf);\n};\n\n\n// That's all for the pako functions.\n\n\n/**\n * Transform a javascript string into an array (typed if possible) of bytes,\n * UTF-8 encoded.\n * @param {String} str the string to encode\n * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string.\n */\nexports.utf8encode = function utf8encode(str) {\n if (support.nodebuffer) {\n return nodejsUtils.newBufferFrom(str, \"utf-8\");\n }\n\n return string2buf(str);\n};\n\n\n/**\n * Transform a bytes array (or a representation) representing an UTF-8 encoded\n * string into a javascript string.\n * @param {Array|Uint8Array|Buffer} buf the data de decode\n * @return {String} the decoded string.\n */\nexports.utf8decode = function utf8decode(buf) {\n if (support.nodebuffer) {\n return utils.transformTo(\"nodebuffer\", buf).toString(\"utf-8\");\n }\n\n buf = utils.transformTo(support.uint8array ? \"uint8array\" : \"array\", buf);\n\n return buf2string(buf);\n};\n\n/**\n * A worker to decode utf8 encoded binary chunks into string chunks.\n * @constructor\n */\nfunction Utf8DecodeWorker() {\n GenericWorker.call(this, \"utf-8 decode\");\n // the last bytes if a chunk didn't end with a complete codepoint.\n this.leftOver = null;\n}\nutils.inherits(Utf8DecodeWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nUtf8DecodeWorker.prototype.processChunk = function (chunk) {\n\n var data = utils.transformTo(support.uint8array ? \"uint8array\" : \"array\", chunk.data);\n\n // 1st step, re-use what's left of the previous chunk\n if (this.leftOver && this.leftOver.length) {\n if(support.uint8array) {\n var previousData = data;\n data = new Uint8Array(previousData.length + this.leftOver.length);\n data.set(this.leftOver, 0);\n data.set(previousData, this.leftOver.length);\n } else {\n data = this.leftOver.concat(data);\n }\n this.leftOver = null;\n }\n\n var nextBoundary = utf8border(data);\n var usableData = data;\n if (nextBoundary !== data.length) {\n if (support.uint8array) {\n usableData = data.subarray(0, nextBoundary);\n this.leftOver = data.subarray(nextBoundary, data.length);\n } else {\n usableData = data.slice(0, nextBoundary);\n this.leftOver = data.slice(nextBoundary, data.length);\n }\n }\n\n this.push({\n data : exports.utf8decode(usableData),\n meta : chunk.meta\n });\n};\n\n/**\n * @see GenericWorker.flush\n */\nUtf8DecodeWorker.prototype.flush = function () {\n if(this.leftOver && this.leftOver.length) {\n this.push({\n data : exports.utf8decode(this.leftOver),\n meta : {}\n });\n this.leftOver = null;\n }\n};\nexports.Utf8DecodeWorker = Utf8DecodeWorker;\n\n/**\n * A worker to endcode string chunks into utf8 encoded binary chunks.\n * @constructor\n */\nfunction Utf8EncodeWorker() {\n GenericWorker.call(this, \"utf-8 encode\");\n}\nutils.inherits(Utf8EncodeWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nUtf8EncodeWorker.prototype.processChunk = function (chunk) {\n this.push({\n data : exports.utf8encode(chunk.data),\n meta : chunk.meta\n });\n};\nexports.Utf8EncodeWorker = Utf8EncodeWorker;\n","'use strict';\n\nvar support = require('./support');\nvar base64 = require('./base64');\nvar nodejsUtils = require('./nodejsUtils');\nvar setImmediate = require('core-js/library/fn/set-immediate');\nvar external = require(\"./external\");\n\n\n/**\n * Convert a string that pass as a \"binary string\": it should represent a byte\n * array but may have > 255 char codes. Be sure to take only the first byte\n * and returns the byte array.\n * @param {String} str the string to transform.\n * @return {Array|Uint8Array} the string in a binary format.\n */\nfunction string2binary(str) {\n var result = null;\n if (support.uint8array) {\n result = new Uint8Array(str.length);\n } else {\n result = new Array(str.length);\n }\n return stringToArrayLike(str, result);\n}\n\n/**\n * Create a new blob with the given content and the given type.\n * @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use\n * an Uint8Array because the stock browser of android 4 won't accept it (it\n * will be silently converted to a string, \"[object Uint8Array]\").\n *\n * Use only ONE part to build the blob to avoid a memory leak in IE11 / Edge:\n * when a large amount of Array is used to create the Blob, the amount of\n * memory consumed is nearly 100 times the original data amount.\n *\n * @param {String} type the mime type of the blob.\n * @return {Blob} the created blob.\n */\nexports.newBlob = function(part, type) {\n exports.checkSupport(\"blob\");\n\n try {\n // Blob constructor\n return new Blob([part], {\n type: type\n });\n }\n catch (e) {\n\n try {\n // deprecated, browser only, old way\n var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;\n var builder = new Builder();\n builder.append(part);\n return builder.getBlob(type);\n }\n catch (e) {\n\n // well, fuck ?!\n throw new Error(\"Bug : can't construct the Blob.\");\n }\n }\n\n\n};\n/**\n * The identity function.\n * @param {Object} input the input.\n * @return {Object} the same input.\n */\nfunction identity(input) {\n return input;\n}\n\n/**\n * Fill in an array with a string.\n * @param {String} str the string to use.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated).\n * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.\n */\nfunction stringToArrayLike(str, array) {\n for (var i = 0; i < str.length; ++i) {\n array[i] = str.charCodeAt(i) & 0xFF;\n }\n return array;\n}\n\n/**\n * An helper for the function arrayLikeToString.\n * This contains static informations and functions that\n * can be optimized by the browser JIT compiler.\n */\nvar arrayToStringHelper = {\n /**\n * Transform an array of int into a string, chunk by chunk.\n * See the performances notes on arrayLikeToString.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.\n * @param {String} type the type of the array.\n * @param {Integer} chunk the chunk size.\n * @return {String} the resulting string.\n * @throws Error if the chunk is too big for the stack.\n */\n stringifyByChunk: function(array, type, chunk) {\n var result = [], k = 0, len = array.length;\n // shortcut\n if (len <= chunk) {\n return String.fromCharCode.apply(null, array);\n }\n while (k < len) {\n if (type === \"array\" || type === \"nodebuffer\") {\n result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));\n }\n else {\n result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));\n }\n k += chunk;\n }\n return result.join(\"\");\n },\n /**\n * Call String.fromCharCode on every item in the array.\n * This is the naive implementation, which generate A LOT of intermediate string.\n * This should be used when everything else fail.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.\n * @return {String} the result.\n */\n stringifyByChar: function(array){\n var resultStr = \"\";\n for(var i = 0; i < array.length; i++) {\n resultStr += String.fromCharCode(array[i]);\n }\n return resultStr;\n },\n applyCanBeUsed : {\n /**\n * true if the browser accepts to use String.fromCharCode on Uint8Array\n */\n uint8array : (function () {\n try {\n return support.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;\n } catch (e) {\n return false;\n }\n })(),\n /**\n * true if the browser accepts to use String.fromCharCode on nodejs Buffer.\n */\n nodebuffer : (function () {\n try {\n return support.nodebuffer && String.fromCharCode.apply(null, nodejsUtils.allocBuffer(1)).length === 1;\n } catch (e) {\n return false;\n }\n })()\n }\n};\n\n/**\n * Transform an array-like object to a string.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.\n * @return {String} the result.\n */\nfunction arrayLikeToString(array) {\n // Performances notes :\n // --------------------\n // String.fromCharCode.apply(null, array) is the fastest, see\n // see http://jsperf.com/converting-a-uint8array-to-a-string/2\n // but the stack is limited (and we can get huge arrays !).\n //\n // result += String.fromCharCode(array[i]); generate too many strings !\n //\n // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2\n // TODO : we now have workers that split the work. Do we still need that ?\n var chunk = 65536,\n type = exports.getTypeOf(array),\n canUseApply = true;\n if (type === \"uint8array\") {\n canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array;\n } else if (type === \"nodebuffer\") {\n canUseApply = arrayToStringHelper.applyCanBeUsed.nodebuffer;\n }\n\n if (canUseApply) {\n while (chunk > 1) {\n try {\n return arrayToStringHelper.stringifyByChunk(array, type, chunk);\n } catch (e) {\n chunk = Math.floor(chunk / 2);\n }\n }\n }\n\n // no apply or chunk error : slow and painful algorithm\n // default browser on android 4.*\n return arrayToStringHelper.stringifyByChar(array);\n}\n\nexports.applyFromCharCode = arrayLikeToString;\n\n\n/**\n * Copy the data from an array-like to an other array-like.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated.\n * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array.\n */\nfunction arrayLikeToArrayLike(arrayFrom, arrayTo) {\n for (var i = 0; i < arrayFrom.length; i++) {\n arrayTo[i] = arrayFrom[i];\n }\n return arrayTo;\n}\n\n// a matrix containing functions to transform everything into everything.\nvar transform = {};\n\n// string to ?\ntransform[\"string\"] = {\n \"string\": identity,\n \"array\": function(input) {\n return stringToArrayLike(input, new Array(input.length));\n },\n \"arraybuffer\": function(input) {\n return transform[\"string\"][\"uint8array\"](input).buffer;\n },\n \"uint8array\": function(input) {\n return stringToArrayLike(input, new Uint8Array(input.length));\n },\n \"nodebuffer\": function(input) {\n return stringToArrayLike(input, nodejsUtils.allocBuffer(input.length));\n }\n};\n\n// array to ?\ntransform[\"array\"] = {\n \"string\": arrayLikeToString,\n \"array\": identity,\n \"arraybuffer\": function(input) {\n return (new Uint8Array(input)).buffer;\n },\n \"uint8array\": function(input) {\n return new Uint8Array(input);\n },\n \"nodebuffer\": function(input) {\n return nodejsUtils.newBufferFrom(input);\n }\n};\n\n// arraybuffer to ?\ntransform[\"arraybuffer\"] = {\n \"string\": function(input) {\n return arrayLikeToString(new Uint8Array(input));\n },\n \"array\": function(input) {\n return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength));\n },\n \"arraybuffer\": identity,\n \"uint8array\": function(input) {\n return new Uint8Array(input);\n },\n \"nodebuffer\": function(input) {\n return nodejsUtils.newBufferFrom(new Uint8Array(input));\n }\n};\n\n// uint8array to ?\ntransform[\"uint8array\"] = {\n \"string\": arrayLikeToString,\n \"array\": function(input) {\n return arrayLikeToArrayLike(input, new Array(input.length));\n },\n \"arraybuffer\": function(input) {\n return input.buffer;\n },\n \"uint8array\": identity,\n \"nodebuffer\": function(input) {\n return nodejsUtils.newBufferFrom(input);\n }\n};\n\n// nodebuffer to ?\ntransform[\"nodebuffer\"] = {\n \"string\": arrayLikeToString,\n \"array\": function(input) {\n return arrayLikeToArrayLike(input, new Array(input.length));\n },\n \"arraybuffer\": function(input) {\n return transform[\"nodebuffer\"][\"uint8array\"](input).buffer;\n },\n \"uint8array\": function(input) {\n return arrayLikeToArrayLike(input, new Uint8Array(input.length));\n },\n \"nodebuffer\": identity\n};\n\n/**\n * Transform an input into any type.\n * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer.\n * If no output type is specified, the unmodified input will be returned.\n * @param {String} outputType the output type.\n * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert.\n * @throws {Error} an Error if the browser doesn't support the requested output type.\n */\nexports.transformTo = function(outputType, input) {\n if (!input) {\n // undefined, null, etc\n // an empty string won't harm.\n input = \"\";\n }\n if (!outputType) {\n return input;\n }\n exports.checkSupport(outputType);\n var inputType = exports.getTypeOf(input);\n var result = transform[inputType][outputType](input);\n return result;\n};\n\n/**\n * Return the type of the input.\n * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.\n * @param {Object} input the input to identify.\n * @return {String} the (lowercase) type of the input.\n */\nexports.getTypeOf = function(input) {\n if (typeof input === \"string\") {\n return \"string\";\n }\n if (Object.prototype.toString.call(input) === \"[object Array]\") {\n return \"array\";\n }\n if (support.nodebuffer && nodejsUtils.isBuffer(input)) {\n return \"nodebuffer\";\n }\n if (support.uint8array && input instanceof Uint8Array) {\n return \"uint8array\";\n }\n if (support.arraybuffer && input instanceof ArrayBuffer) {\n return \"arraybuffer\";\n }\n};\n\n/**\n * Throw an exception if the type is not supported.\n * @param {String} type the type to check.\n * @throws {Error} an Error if the browser doesn't support the requested type.\n */\nexports.checkSupport = function(type) {\n var supported = support[type.toLowerCase()];\n if (!supported) {\n throw new Error(type + \" is not supported by this platform\");\n }\n};\n\nexports.MAX_VALUE_16BITS = 65535;\nexports.MAX_VALUE_32BITS = -1; // well, \"\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\" is parsed as -1\n\n/**\n * Prettify a string read as binary.\n * @param {string} str the string to prettify.\n * @return {string} a pretty string.\n */\nexports.pretty = function(str) {\n var res = '',\n code, i;\n for (i = 0; i < (str || \"\").length; i++) {\n code = str.charCodeAt(i);\n res += '\\\\x' + (code < 16 ? \"0\" : \"\") + code.toString(16).toUpperCase();\n }\n return res;\n};\n\n/**\n * Defer the call of a function.\n * @param {Function} callback the function to call asynchronously.\n * @param {Array} args the arguments to give to the callback.\n */\nexports.delay = function(callback, args, self) {\n setImmediate(function () {\n callback.apply(self || null, args || []);\n });\n};\n\n/**\n * Extends a prototype with an other, without calling a constructor with\n * side effects. Inspired by nodejs' `utils.inherits`\n * @param {Function} ctor the constructor to augment\n * @param {Function} superCtor the parent constructor to use\n */\nexports.inherits = function (ctor, superCtor) {\n var Obj = function() {};\n Obj.prototype = superCtor.prototype;\n ctor.prototype = new Obj();\n};\n\n/**\n * Merge the objects passed as parameters into a new one.\n * @private\n * @param {...Object} var_args All objects to merge.\n * @return {Object} a new object with the data of the others.\n */\nexports.extend = function() {\n var result = {}, i, attr;\n for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers\n for (attr in arguments[i]) {\n if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === \"undefined\") {\n result[attr] = arguments[i][attr];\n }\n }\n }\n return result;\n};\n\n/**\n * Transform arbitrary content into a Promise.\n * @param {String} name a name for the content being processed.\n * @param {Object} inputData the content to process.\n * @param {Boolean} isBinary true if the content is not an unicode string\n * @param {Boolean} isOptimizedBinaryString true if the string content only has one byte per character.\n * @param {Boolean} isBase64 true if the string content is encoded with base64.\n * @return {Promise} a promise in a format usable by JSZip.\n */\nexports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {\n\n // if inputData is already a promise, this flatten it.\n var promise = external.Promise.resolve(inputData).then(function(data) {\n \n \n var isBlob = support.blob && (data instanceof Blob || ['[object File]', '[object Blob]'].indexOf(Object.prototype.toString.call(data)) !== -1);\n\n if (isBlob && typeof FileReader !== \"undefined\") {\n return new external.Promise(function (resolve, reject) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n resolve(e.target.result);\n };\n reader.onerror = function(e) {\n reject(e.target.error);\n };\n reader.readAsArrayBuffer(data);\n });\n } else {\n return data;\n }\n });\n\n return promise.then(function(data) {\n var dataType = exports.getTypeOf(data);\n\n if (!dataType) {\n return external.Promise.reject(\n new Error(\"Can't read the data of '\" + name + \"'. Is it \" +\n \"in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?\")\n );\n }\n // special case : it's way easier to work with Uint8Array than with ArrayBuffer\n if (dataType === \"arraybuffer\") {\n data = exports.transformTo(\"uint8array\", data);\n } else if (dataType === \"string\") {\n if (isBase64) {\n data = base64.decode(data);\n }\n else if (isBinary) {\n // optimizedBinaryString === true means that the file has already been filtered with a 0xFF mask\n if (isOptimizedBinaryString !== true) {\n // this is a string, not in a base64 format.\n // Be sure that this is a correct \"binary string\"\n data = string2binary(data);\n }\n }\n }\n return data;\n });\n};\n","'use strict';\nvar readerFor = require('./reader/readerFor');\nvar utils = require('./utils');\nvar sig = require('./signature');\nvar ZipEntry = require('./zipEntry');\nvar utf8 = require('./utf8');\nvar support = require('./support');\n// class ZipEntries {{{\n/**\n * All the entries in the zip file.\n * @constructor\n * @param {Object} loadOptions Options for loading the stream.\n */\nfunction ZipEntries(loadOptions) {\n this.files = [];\n this.loadOptions = loadOptions;\n}\nZipEntries.prototype = {\n /**\n * Check that the reader is on the specified signature.\n * @param {string} expectedSignature the expected signature.\n * @throws {Error} if it is an other signature.\n */\n checkSignature: function(expectedSignature) {\n if (!this.reader.readAndCheckSignature(expectedSignature)) {\n this.reader.index -= 4;\n var signature = this.reader.readString(4);\n throw new Error(\"Corrupted zip or bug: unexpected signature \" + \"(\" + utils.pretty(signature) + \", expected \" + utils.pretty(expectedSignature) + \")\");\n }\n },\n /**\n * Check if the given signature is at the given index.\n * @param {number} askedIndex the index to check.\n * @param {string} expectedSignature the signature to expect.\n * @return {boolean} true if the signature is here, false otherwise.\n */\n isSignature: function(askedIndex, expectedSignature) {\n var currentIndex = this.reader.index;\n this.reader.setIndex(askedIndex);\n var signature = this.reader.readString(4);\n var result = signature === expectedSignature;\n this.reader.setIndex(currentIndex);\n return result;\n },\n /**\n * Read the end of the central directory.\n */\n readBlockEndOfCentral: function() {\n this.diskNumber = this.reader.readInt(2);\n this.diskWithCentralDirStart = this.reader.readInt(2);\n this.centralDirRecordsOnThisDisk = this.reader.readInt(2);\n this.centralDirRecords = this.reader.readInt(2);\n this.centralDirSize = this.reader.readInt(4);\n this.centralDirOffset = this.reader.readInt(4);\n\n this.zipCommentLength = this.reader.readInt(2);\n // warning : the encoding depends of the system locale\n // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.\n // On a windows machine, this field is encoded with the localized windows code page.\n var zipComment = this.reader.readData(this.zipCommentLength);\n var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n // To get consistent behavior with the generation part, we will assume that\n // this is utf8 encoded unless specified otherwise.\n var decodeContent = utils.transformTo(decodeParamType, zipComment);\n this.zipComment = this.loadOptions.decodeFileName(decodeContent);\n },\n /**\n * Read the end of the Zip 64 central directory.\n * Not merged with the method readEndOfCentral :\n * The end of central can coexist with its Zip64 brother,\n * I don't want to read the wrong number of bytes !\n */\n readBlockZip64EndOfCentral: function() {\n this.zip64EndOfCentralSize = this.reader.readInt(8);\n this.reader.skip(4);\n // this.versionMadeBy = this.reader.readString(2);\n // this.versionNeeded = this.reader.readInt(2);\n this.diskNumber = this.reader.readInt(4);\n this.diskWithCentralDirStart = this.reader.readInt(4);\n this.centralDirRecordsOnThisDisk = this.reader.readInt(8);\n this.centralDirRecords = this.reader.readInt(8);\n this.centralDirSize = this.reader.readInt(8);\n this.centralDirOffset = this.reader.readInt(8);\n\n this.zip64ExtensibleData = {};\n var extraDataSize = this.zip64EndOfCentralSize - 44,\n index = 0,\n extraFieldId,\n extraFieldLength,\n extraFieldValue;\n while (index < extraDataSize) {\n extraFieldId = this.reader.readInt(2);\n extraFieldLength = this.reader.readInt(4);\n extraFieldValue = this.reader.readData(extraFieldLength);\n this.zip64ExtensibleData[extraFieldId] = {\n id: extraFieldId,\n length: extraFieldLength,\n value: extraFieldValue\n };\n }\n },\n /**\n * Read the end of the Zip 64 central directory locator.\n */\n readBlockZip64EndOfCentralLocator: function() {\n this.diskWithZip64CentralDirStart = this.reader.readInt(4);\n this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8);\n this.disksCount = this.reader.readInt(4);\n if (this.disksCount > 1) {\n throw new Error(\"Multi-volumes zip are not supported\");\n }\n },\n /**\n * Read the local files, based on the offset read in the central part.\n */\n readLocalFiles: function() {\n var i, file;\n for (i = 0; i < this.files.length; i++) {\n file = this.files[i];\n this.reader.setIndex(file.localHeaderOffset);\n this.checkSignature(sig.LOCAL_FILE_HEADER);\n file.readLocalPart(this.reader);\n file.handleUTF8();\n file.processAttributes();\n }\n },\n /**\n * Read the central directory.\n */\n readCentralDir: function() {\n var file;\n\n this.reader.setIndex(this.centralDirOffset);\n while (this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER)) {\n file = new ZipEntry({\n zip64: this.zip64\n }, this.loadOptions);\n file.readCentralPart(this.reader);\n this.files.push(file);\n }\n\n if (this.centralDirRecords !== this.files.length) {\n if (this.centralDirRecords !== 0 && this.files.length === 0) {\n // We expected some records but couldn't find ANY.\n // This is really suspicious, as if something went wrong.\n throw new Error(\"Corrupted zip or bug: expected \" + this.centralDirRecords + \" records in central dir, got \" + this.files.length);\n } else {\n // We found some records but not all.\n // Something is wrong but we got something for the user: no error here.\n // console.warn(\"expected\", this.centralDirRecords, \"records in central dir, got\", this.files.length);\n }\n }\n },\n /**\n * Read the end of central directory.\n */\n readEndOfCentral: function() {\n var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);\n if (offset < 0) {\n // Check if the content is a truncated zip or complete garbage.\n // A \"LOCAL_FILE_HEADER\" is not required at the beginning (auto\n // extractible zip for example) but it can give a good hint.\n // If an ajax request was used without responseType, we will also\n // get unreadable data.\n var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER);\n\n if (isGarbage) {\n throw new Error(\"Can't find end of central directory : is this a zip file ? \" +\n \"If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html\");\n } else {\n throw new Error(\"Corrupted zip: can't find end of central directory\");\n }\n\n }\n this.reader.setIndex(offset);\n var endOfCentralDirOffset = offset;\n this.checkSignature(sig.CENTRAL_DIRECTORY_END);\n this.readBlockEndOfCentral();\n\n\n /* extract from the zip spec :\n 4) If one of the fields in the end of central directory\n record is too small to hold required data, the field\n should be set to -1 (0xFFFF or 0xFFFFFFFF) and the\n ZIP64 format record should be created.\n 5) The end of central directory record and the\n Zip64 end of central directory locator record must\n reside on the same disk when splitting or spanning\n an archive.\n */\n if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) {\n this.zip64 = true;\n\n /*\n Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from\n the zip file can fit into a 32bits integer. This cannot be solved : JavaScript represents\n all numbers as 64-bit double precision IEEE 754 floating point numbers.\n So, we have 53bits for integers and bitwise operations treat everything as 32bits.\n see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators\n and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5\n */\n\n // should look for a zip64 EOCD locator\n offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);\n if (offset < 0) {\n throw new Error(\"Corrupted zip: can't find the ZIP64 end of central directory locator\");\n }\n this.reader.setIndex(offset);\n this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);\n this.readBlockZip64EndOfCentralLocator();\n\n // now the zip64 EOCD record\n if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) {\n // console.warn(\"ZIP64 end of central directory not where expected.\");\n this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);\n if (this.relativeOffsetEndOfZip64CentralDir < 0) {\n throw new Error(\"Corrupted zip: can't find the ZIP64 end of central directory\");\n }\n }\n this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);\n this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);\n this.readBlockZip64EndOfCentral();\n }\n\n var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize;\n if (this.zip64) {\n expectedEndOfCentralDirOffset += 20; // end of central dir 64 locator\n expectedEndOfCentralDirOffset += 12 /* should not include the leading 12 bytes */ + this.zip64EndOfCentralSize;\n }\n\n var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset;\n\n if (extraBytes > 0) {\n // console.warn(extraBytes, \"extra bytes at beginning or within zipfile\");\n if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) {\n // The offsets seem wrong, but we have something at the specified offset.\n // So… we keep it.\n } else {\n // the offset is wrong, update the \"zero\" of the reader\n // this happens if data has been prepended (crx files for example)\n this.reader.zero = extraBytes;\n }\n } else if (extraBytes < 0) {\n throw new Error(\"Corrupted zip: missing \" + Math.abs(extraBytes) + \" bytes.\");\n }\n },\n prepareReader: function(data) {\n this.reader = readerFor(data);\n },\n /**\n * Read a zip file and create ZipEntries.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.\n */\n load: function(data) {\n this.prepareReader(data);\n this.readEndOfCentral();\n this.readCentralDir();\n this.readLocalFiles();\n }\n};\n// }}} end of ZipEntries\nmodule.exports = ZipEntries;\n","'use strict';\nvar readerFor = require('./reader/readerFor');\nvar utils = require('./utils');\nvar CompressedObject = require('./compressedObject');\nvar crc32fn = require('./crc32');\nvar utf8 = require('./utf8');\nvar compressions = require('./compressions');\nvar support = require('./support');\n\nvar MADE_BY_DOS = 0x00;\nvar MADE_BY_UNIX = 0x03;\n\n/**\n * Find a compression registered in JSZip.\n * @param {string} compressionMethod the method magic to find.\n * @return {Object|null} the JSZip compression object, null if none found.\n */\nvar findCompression = function(compressionMethod) {\n for (var method in compressions) {\n if (!compressions.hasOwnProperty(method)) {\n continue;\n }\n if (compressions[method].magic === compressionMethod) {\n return compressions[method];\n }\n }\n return null;\n};\n\n// class ZipEntry {{{\n/**\n * An entry in the zip file.\n * @constructor\n * @param {Object} options Options of the current file.\n * @param {Object} loadOptions Options for loading the stream.\n */\nfunction ZipEntry(options, loadOptions) {\n this.options = options;\n this.loadOptions = loadOptions;\n}\nZipEntry.prototype = {\n /**\n * say if the file is encrypted.\n * @return {boolean} true if the file is encrypted, false otherwise.\n */\n isEncrypted: function() {\n // bit 1 is set\n return (this.bitFlag & 0x0001) === 0x0001;\n },\n /**\n * say if the file has utf-8 filename/comment.\n * @return {boolean} true if the filename/comment is in utf-8, false otherwise.\n */\n useUTF8: function() {\n // bit 11 is set\n return (this.bitFlag & 0x0800) === 0x0800;\n },\n /**\n * Read the local part of a zip file and add the info in this object.\n * @param {DataReader} reader the reader to use.\n */\n readLocalPart: function(reader) {\n var compression, localExtraFieldsLength;\n\n // we already know everything from the central dir !\n // If the central dir data are false, we are doomed.\n // On the bright side, the local part is scary : zip64, data descriptors, both, etc.\n // The less data we get here, the more reliable this should be.\n // Let's skip the whole header and dash to the data !\n reader.skip(22);\n // in some zip created on windows, the filename stored in the central dir contains \\ instead of /.\n // Strangely, the filename here is OK.\n // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes\n // or APPNOTE#4.4.17.1, \"All slashes MUST be forward slashes '/'\") but there are a lot of bad zip generators...\n // Search \"unzip mismatching \"local\" filename continuing with \"central\" filename version\" on\n // the internet.\n //\n // I think I see the logic here : the central directory is used to display\n // content and the local directory is used to extract the files. Mixing / and \\\n // may be used to display \\ to windows users and use / when extracting the files.\n // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394\n this.fileNameLength = reader.readInt(2);\n localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir\n // the fileName is stored as binary data, the handleUTF8 method will take care of the encoding.\n this.fileName = reader.readData(this.fileNameLength);\n reader.skip(localExtraFieldsLength);\n\n if (this.compressedSize === -1 || this.uncompressedSize === -1) {\n throw new Error(\"Bug or corrupted zip : didn't get enough informations from the central directory \" + \"(compressedSize === -1 || uncompressedSize === -1)\");\n }\n\n compression = findCompression(this.compressionMethod);\n if (compression === null) { // no compression found\n throw new Error(\"Corrupted zip : compression \" + utils.pretty(this.compressionMethod) + \" unknown (inner file : \" + utils.transformTo(\"string\", this.fileName) + \")\");\n }\n this.decompressed = new CompressedObject(this.compressedSize, this.uncompressedSize, this.crc32, compression, reader.readData(this.compressedSize));\n },\n\n /**\n * Read the central part of a zip file and add the info in this object.\n * @param {DataReader} reader the reader to use.\n */\n readCentralPart: function(reader) {\n this.versionMadeBy = reader.readInt(2);\n reader.skip(2);\n // this.versionNeeded = reader.readInt(2);\n this.bitFlag = reader.readInt(2);\n this.compressionMethod = reader.readString(2);\n this.date = reader.readDate();\n this.crc32 = reader.readInt(4);\n this.compressedSize = reader.readInt(4);\n this.uncompressedSize = reader.readInt(4);\n var fileNameLength = reader.readInt(2);\n this.extraFieldsLength = reader.readInt(2);\n this.fileCommentLength = reader.readInt(2);\n this.diskNumberStart = reader.readInt(2);\n this.internalFileAttributes = reader.readInt(2);\n this.externalFileAttributes = reader.readInt(4);\n this.localHeaderOffset = reader.readInt(4);\n\n if (this.isEncrypted()) {\n throw new Error(\"Encrypted zip are not supported\");\n }\n\n // will be read in the local part, see the comments there\n reader.skip(fileNameLength);\n this.readExtraFields(reader);\n this.parseZIP64ExtraField(reader);\n this.fileComment = reader.readData(this.fileCommentLength);\n },\n\n /**\n * Parse the external file attributes and get the unix/dos permissions.\n */\n processAttributes: function () {\n this.unixPermissions = null;\n this.dosPermissions = null;\n var madeBy = this.versionMadeBy >> 8;\n\n // Check if we have the DOS directory flag set.\n // We look for it in the DOS and UNIX permissions\n // but some unknown platform could set it as a compatibility flag.\n this.dir = this.externalFileAttributes & 0x0010 ? true : false;\n\n if(madeBy === MADE_BY_DOS) {\n // first 6 bits (0 to 5)\n this.dosPermissions = this.externalFileAttributes & 0x3F;\n }\n\n if(madeBy === MADE_BY_UNIX) {\n this.unixPermissions = (this.externalFileAttributes >> 16) & 0xFFFF;\n // the octal permissions are in (this.unixPermissions & 0x01FF).toString(8);\n }\n\n // fail safe : if the name ends with a / it probably means a folder\n if (!this.dir && this.fileNameStr.slice(-1) === '/') {\n this.dir = true;\n }\n },\n\n /**\n * Parse the ZIP64 extra field and merge the info in the current ZipEntry.\n * @param {DataReader} reader the reader to use.\n */\n parseZIP64ExtraField: function(reader) {\n\n if (!this.extraFields[0x0001]) {\n return;\n }\n\n // should be something, preparing the extra reader\n var extraReader = readerFor(this.extraFields[0x0001].value);\n\n // I really hope that these 64bits integer can fit in 32 bits integer, because js\n // won't let us have more.\n if (this.uncompressedSize === utils.MAX_VALUE_32BITS) {\n this.uncompressedSize = extraReader.readInt(8);\n }\n if (this.compressedSize === utils.MAX_VALUE_32BITS) {\n this.compressedSize = extraReader.readInt(8);\n }\n if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) {\n this.localHeaderOffset = extraReader.readInt(8);\n }\n if (this.diskNumberStart === utils.MAX_VALUE_32BITS) {\n this.diskNumberStart = extraReader.readInt(4);\n }\n },\n /**\n * Read the central part of a zip file and add the info in this object.\n * @param {DataReader} reader the reader to use.\n */\n readExtraFields: function(reader) {\n var end = reader.index + this.extraFieldsLength,\n extraFieldId,\n extraFieldLength,\n extraFieldValue;\n\n if (!this.extraFields) {\n this.extraFields = {};\n }\n\n while (reader.index < end) {\n extraFieldId = reader.readInt(2);\n extraFieldLength = reader.readInt(2);\n extraFieldValue = reader.readData(extraFieldLength);\n\n this.extraFields[extraFieldId] = {\n id: extraFieldId,\n length: extraFieldLength,\n value: extraFieldValue\n };\n }\n },\n /**\n * Apply an UTF8 transformation if needed.\n */\n handleUTF8: function() {\n var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n if (this.useUTF8()) {\n this.fileNameStr = utf8.utf8decode(this.fileName);\n this.fileCommentStr = utf8.utf8decode(this.fileComment);\n } else {\n var upath = this.findExtraFieldUnicodePath();\n if (upath !== null) {\n this.fileNameStr = upath;\n } else {\n // ASCII text or unsupported code page\n var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName);\n this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);\n }\n\n var ucomment = this.findExtraFieldUnicodeComment();\n if (ucomment !== null) {\n this.fileCommentStr = ucomment;\n } else {\n // ASCII text or unsupported code page\n var commentByteArray = utils.transformTo(decodeParamType, this.fileComment);\n this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray);\n }\n }\n },\n\n /**\n * Find the unicode path declared in the extra field, if any.\n * @return {String} the unicode path, null otherwise.\n */\n findExtraFieldUnicodePath: function() {\n var upathField = this.extraFields[0x7075];\n if (upathField) {\n var extraReader = readerFor(upathField.value);\n\n // wrong version\n if (extraReader.readInt(1) !== 1) {\n return null;\n }\n\n // the crc of the filename changed, this field is out of date.\n if (crc32fn(this.fileName) !== extraReader.readInt(4)) {\n return null;\n }\n\n return utf8.utf8decode(extraReader.readData(upathField.length - 5));\n }\n return null;\n },\n\n /**\n * Find the unicode comment declared in the extra field, if any.\n * @return {String} the unicode comment, null otherwise.\n */\n findExtraFieldUnicodeComment: function() {\n var ucommentField = this.extraFields[0x6375];\n if (ucommentField) {\n var extraReader = readerFor(ucommentField.value);\n\n // wrong version\n if (extraReader.readInt(1) !== 1) {\n return null;\n }\n\n // the crc of the comment changed, this field is out of date.\n if (crc32fn(this.fileComment) !== extraReader.readInt(4)) {\n return null;\n }\n\n return utf8.utf8decode(extraReader.readData(ucommentField.length - 5));\n }\n return null;\n }\n};\nmodule.exports = ZipEntry;\n","'use strict';\n\nvar StreamHelper = require('./stream/StreamHelper');\nvar DataWorker = require('./stream/DataWorker');\nvar utf8 = require('./utf8');\nvar CompressedObject = require('./compressedObject');\nvar GenericWorker = require('./stream/GenericWorker');\n\n/**\n * A simple object representing a file in the zip file.\n * @constructor\n * @param {string} name the name of the file\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data\n * @param {Object} options the options of the file\n */\nvar ZipObject = function(name, data, options) {\n this.name = name;\n this.dir = options.dir;\n this.date = options.date;\n this.comment = options.comment;\n this.unixPermissions = options.unixPermissions;\n this.dosPermissions = options.dosPermissions;\n\n this._data = data;\n this._dataBinary = options.binary;\n // keep only the compression\n this.options = {\n compression : options.compression,\n compressionOptions : options.compressionOptions\n };\n};\n\nZipObject.prototype = {\n /**\n * Create an internal stream for the content of this object.\n * @param {String} type the type of each chunk.\n * @return StreamHelper the stream.\n */\n internalStream: function (type) {\n var result = null, outputType = \"string\";\n try {\n if (!type) {\n throw new Error(\"No output type specified.\");\n }\n outputType = type.toLowerCase();\n var askUnicodeString = outputType === \"string\" || outputType === \"text\";\n if (outputType === \"binarystring\" || outputType === \"text\") {\n outputType = \"string\";\n }\n result = this._decompressWorker();\n\n var isUnicodeString = !this._dataBinary;\n\n if (isUnicodeString && !askUnicodeString) {\n result = result.pipe(new utf8.Utf8EncodeWorker());\n }\n if (!isUnicodeString && askUnicodeString) {\n result = result.pipe(new utf8.Utf8DecodeWorker());\n }\n } catch (e) {\n result = new GenericWorker(\"error\");\n result.error(e);\n }\n\n return new StreamHelper(result, outputType, \"\");\n },\n\n /**\n * Prepare the content in the asked type.\n * @param {String} type the type of the result.\n * @param {Function} onUpdate a function to call on each internal update.\n * @return Promise the promise of the result.\n */\n async: function (type, onUpdate) {\n return this.internalStream(type).accumulate(onUpdate);\n },\n\n /**\n * Prepare the content as a nodejs stream.\n * @param {String} type the type of each chunk.\n * @param {Function} onUpdate a function to call on each internal update.\n * @return Stream the stream.\n */\n nodeStream: function (type, onUpdate) {\n return this.internalStream(type || \"nodebuffer\").toNodejsStream(onUpdate);\n },\n\n /**\n * Return a worker for the compressed content.\n * @private\n * @param {Object} compression the compression object to use.\n * @param {Object} compressionOptions the options to use when compressing.\n * @return Worker the worker.\n */\n _compressWorker: function (compression, compressionOptions) {\n if (\n this._data instanceof CompressedObject &&\n this._data.compression.magic === compression.magic\n ) {\n return this._data.getCompressedWorker();\n } else {\n var result = this._decompressWorker();\n if(!this._dataBinary) {\n result = result.pipe(new utf8.Utf8EncodeWorker());\n }\n return CompressedObject.createWorkerFrom(result, compression, compressionOptions);\n }\n },\n /**\n * Return a worker for the decompressed content.\n * @private\n * @return Worker the worker.\n */\n _decompressWorker : function () {\n if (this._data instanceof CompressedObject) {\n return this._data.getContentWorker();\n } else if (this._data instanceof GenericWorker) {\n return this._data;\n } else {\n return new DataWorker(this._data);\n }\n }\n};\n\nvar removedMethods = [\"asText\", \"asBinary\", \"asNodeBuffer\", \"asUint8Array\", \"asArrayBuffer\"];\nvar removedFn = function () {\n throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\");\n};\n\nfor(var i = 0; i < removedMethods.length; i++) {\n ZipObject.prototype[removedMethods[i]] = removedFn;\n}\nmodule.exports = ZipObject;\n","require('../modules/web.immediate');\nmodule.exports = require('../modules/_core').setImmediate;","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","var core = module.exports = {version: '2.3.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","var global = require('./_global')\n , core = require('./_core')\n , ctx = require('./_ctx')\n , hide = require('./_hide')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , IS_WRAP = type & $export.W\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE]\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]\n , key, own, out;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if(own && key in exports)continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function(C){\n var F = function(a, b, c){\n if(this instanceof C){\n switch(arguments.length){\n case 0: return new C;\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if(IS_PROTO){\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","module.exports = require('./_global').document && document.documentElement;","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\r\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\r\n});","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function(fn, args, that){\n var un = that === undefined;\n switch(args.length){\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var ctx = require('./_ctx')\n , invoke = require('./_invoke')\n , html = require('./_html')\n , cel = require('./_dom-create')\n , global = require('./_global')\n , process = global.process\n , setTask = global.setImmediate\n , clearTask = global.clearImmediate\n , MessageChannel = global.MessageChannel\n , counter = 0\n , queue = {}\n , ONREADYSTATECHANGE = 'onreadystatechange'\n , defer, channel, port;\nvar run = function(){\n var id = +this;\n if(queue.hasOwnProperty(id)){\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function(event){\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif(!setTask || !clearTask){\n setTask = function setImmediate(fn){\n var args = [], i = 1;\n while(arguments.length > i)args.push(arguments[i++]);\n queue[++counter] = function(){\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id){\n delete queue[id];\n };\n // Node.js 0.8-\n if(require('./_cof')(process) == 'process'){\n defer = function(id){\n process.nextTick(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if(MessageChannel){\n channel = new MessageChannel;\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){\n defer = function(id){\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if(ONREADYSTATECHANGE in cel('script')){\n defer = function(id){\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function(id){\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var $export = require('./_export')\n , $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});","'use strict';\nvar immediate = require('immediate');\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){\"use strict\";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||\"[object Array]\"===Object.prototype.toString.call(e)}function u(e){return null!=e&&\"[object Object]\"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return\"number\"==typeof e||\"[object Number]\"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||\"[object Date]\"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,\"toString\")&&(e.toString=t.toString),m(t,\"valueOf\")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Ot(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={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}),e._pf}function p(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function v(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function S(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function D(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=D(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&k(e[s])!==k(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&\"undefined\"!=typeof console&&console.warn&&console.warn(\"Deprecation warning: \"+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e=\"\",\"object\"==typeof arguments[n]){for(var s in e+=\"\\n[\"+n+\"] \",arguments[0])e+=s+\": \"+arguments[0][s]+\", \";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+\"\\nArguments: \"+Array.prototype.slice.call(t).join(\"\")+\"\\n\"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function x(e){return e instanceof Function||\"[object Function]\"===Object.prototype.toString.call(e)}function b(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function H(e,t){var n=e.toLowerCase();W[n]=W[n+\"s\"]=W[t]=e}function R(e){return\"string\"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function C(e){var t,n,s={};for(n in e)m(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var F={};function L(e,t){F[e]=t}function U(e,t,n){var s=\"\"+Math.abs(e),i=t-s.length;return(0<=e?n?\"+\":\"\":\"-\")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\\[[^\\[]*\\])|(\\\\)?([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,G=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;\"string\"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return U(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\\[[\\s\\S]/)?t.replace(/^\\[|\\]$/g,\"\"):t.replace(/\\\\/g,\"\");return function(e){var t,n=\"\";for(t=0;t<i;t++)n+=x(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\\d/,z=/\\d\\d/,$=/\\d{3}/,q=/\\d{4}/,J=/[+-]?\\d{6}/,B=/\\d\\d?/,Q=/\\d\\d\\d\\d?/,X=/\\d\\d\\d\\d\\d\\d?/,K=/\\d{1,3}/,ee=/\\d{1,4}/,te=/[+-]?\\d{1,6}/,ne=/\\d+/,se=/[+-]?\\d+/,ie=/Z|[+-]\\d\\d:?\\d\\d/gi,re=/Z|[+-]\\d\\d(?::?\\d\\d)?/gi,ae=/[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=x(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(de(e.replace(\"\\\\\",\"\").replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function de(e){return e.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")}var he={};function ce(e,n){var t,s=n;for(\"string\"==typeof e&&(e=[e]),d(n)&&(s=function(e,t){t[n]=k(e)}),t=0;t<e.length;t++)he[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,pe=4,ve=5,we=6,Me=7,Se=8;function De(e){return ke(e)?366:365}function ke(e){return e%4==0&&e%100!=0||e%400==0}I(\"Y\",0,0,function(){var e=this.year();return e<=9999?\"\"+e:\"+\"+e}),I(0,[\"YY\",2],0,function(){return this.year()%100}),I(0,[\"YYYY\",4],0,\"year\"),I(0,[\"YYYYY\",5],0,\"year\"),I(0,[\"YYYYYY\",6,!0],0,\"year\"),H(\"year\",\"y\"),L(\"year\",1),ue(\"Y\",se),ue(\"YY\",B,z),ue(\"YYYY\",ee,q),ue(\"YYYYY\",te,J),ue(\"YYYYYY\",te,J),ce([\"YYYYY\",\"YYYYYY\"],me),ce(\"YYYY\",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):k(e)}),ce(\"YY\",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce(\"Y\",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ye,Oe=Te(\"FullYear\",!0);function Te(t,n){return function(e){return null!=e?(be(this,t,e),c.updateOffset(this,n),this):xe(this,t)}}function xe(e,t){return e.isValid()?e._d[\"get\"+(e._isUTC?\"UTC\":\"\")+t]():NaN}function be(e,t,n){e.isValid()&&!isNaN(n)&&(\"FullYear\"===t&&ke(e.year())&&1===e.month()&&29===e.date()?e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n,e.month(),Pe(n,e.month())):e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ke(e)?29:28:31-s%7%2}Ye=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},I(\"M\",[\"MM\",2],\"Mo\",function(){return this.month()+1}),I(\"MMM\",0,0,function(e){return this.localeData().monthsShort(this,e)}),I(\"MMMM\",0,0,function(e){return this.localeData().months(this,e)}),H(\"month\",\"M\"),L(\"month\",8),ue(\"M\",B),ue(\"MM\",B,z),ue(\"MMM\",function(e,t){return t.monthsShortRegex(e)}),ue(\"MMMM\",function(e,t){return t.monthsRegex(e)}),ce([\"M\",\"MM\"],function(e,t){t[_e]=k(e)-1}),ce([\"MMM\",\"MMMM\"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,He=\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\");var Re=\"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec\".split(\"_\");function Ce(e,t){var n;if(!e.isValid())return e;if(\"string\"==typeof t)if(/^\\d+$/.test(t))t=k(t);else if(!d(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+\"Month\"](t,n),e}function Fe(e){return null!=e?(Ce(this,e),c.updateOffset(this,!0),this):xe(this,\"Month\")}var Le=ae;var Ue=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,\"\")),i.push(this.months(n,\"\")),r.push(this.months(n,\"\")),r.push(this.monthsShort(n,\"\"));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=de(s[t]),i[t]=de(i[t]);for(t=0;t<24;t++)r[t]=de(r[t]);this._monthsRegex=new RegExp(\"^(\"+r.join(\"|\")+\")\",\"i\"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp(\"^(\"+i.join(\"|\")+\")\",\"i\"),this._monthsShortStrictRegex=new RegExp(\"^(\"+s.join(\"|\")+\")\",\"i\")}function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I(\"w\",[\"ww\",2],\"wo\",\"week\"),I(\"W\",[\"WW\",2],\"Wo\",\"isoWeek\"),H(\"week\",\"w\"),H(\"isoWeek\",\"W\"),L(\"week\",5),L(\"isoWeek\",5),ue(\"w\",B),ue(\"ww\",B,z),ue(\"W\",B),ue(\"WW\",B,z),fe([\"w\",\"ww\",\"W\",\"WW\"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I(\"d\",0,\"do\",\"day\"),I(\"dd\",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I(\"ddd\",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I(\"dddd\",0,0,function(e){return this.localeData().weekdays(this,e)}),I(\"e\",0,0,\"weekday\"),I(\"E\",0,0,\"isoWeekday\"),H(\"day\",\"d\"),H(\"weekday\",\"e\"),H(\"isoWeekday\",\"E\"),L(\"day\",11),L(\"weekday\",11),L(\"isoWeekday\",11),ue(\"d\",B),ue(\"e\",B),ue(\"E\",B),ue(\"dd\",function(e,t){return t.weekdaysMinRegex(e)}),ue(\"ddd\",function(e,t){return t.weekdaysShortRegex(e)}),ue(\"dddd\",function(e,t){return t.weekdaysRegex(e)}),fe([\"dd\",\"ddd\",\"dddd\"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe([\"d\",\"e\",\"E\"],function(e,t,n,s){t[s]=k(e)});var je=\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\");var Ze=\"Sun_Mon_Tue_Wed_Thu_Fri_Sat\".split(\"_\");var ze=\"Su_Mo_Tu_We_Th_Fr_Sa\".split(\"_\");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,\"\"),i=this.weekdaysShort(n,\"\"),r=this.weekdays(n,\"\"),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp(\"^(\"+l.join(\"|\")+\")\",\"i\"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp(\"^(\"+u.join(\"|\")+\")\",\"i\"),this._weekdaysShortStrictRegex=new RegExp(\"^(\"+o.join(\"|\")+\")\",\"i\"),this._weekdaysMinStrictRegex=new RegExp(\"^(\"+a.join(\"|\")+\")\",\"i\")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I(\"H\",[\"HH\",2],0,\"hour\"),I(\"h\",[\"hh\",2],0,Qe),I(\"k\",[\"kk\",2],0,function(){return this.hours()||24}),I(\"hmm\",0,0,function(){return\"\"+Qe.apply(this)+U(this.minutes(),2)}),I(\"hmmss\",0,0,function(){return\"\"+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I(\"Hmm\",0,0,function(){return\"\"+this.hours()+U(this.minutes(),2)}),I(\"Hmmss\",0,0,function(){return\"\"+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe(\"a\",!0),Xe(\"A\",!1),H(\"hour\",\"h\"),L(\"hour\",13),ue(\"a\",Ke),ue(\"A\",Ke),ue(\"H\",B),ue(\"h\",B),ue(\"k\",B),ue(\"HH\",B,z),ue(\"hh\",B,z),ue(\"kk\",B,z),ue(\"hmm\",Q),ue(\"hmmss\",X),ue(\"Hmm\",Q),ue(\"Hmmss\",X),ce([\"H\",\"HH\"],ge),ce([\"k\",\"kk\"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce([\"a\",\"A\"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce([\"h\",\"hh\"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce(\"hmm\",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce(\"hmmss\",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce(\"Hmm\",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce(\"Hmmss\",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te(\"Hours\",!0),nt={calendar:{sameDay:\"[Today at] LT\",nextDay:\"[Tomorrow at] LT\",nextWeek:\"dddd [at] LT\",lastDay:\"[Yesterday at] LT\",lastWeek:\"[Last] dddd [at] LT\",sameElse:\"L\"},longDateFormat:{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\"},invalidDate:\"Invalid date\",ordinal:\"%d\",dayOfMonthOrdinalParse:/\\d{1,2}/,relativeTime:{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\"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\\.?m?\\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace(\"_\",\"-\"):e}function at(e){var t=null;if(!st[e]&&\"undefined\"!=typeof module&&module&&module.exports)try{t=et._abbr,require(\"./locale/\"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:\"undefined\"!=typeof console&&console.warn&&console.warn(\"Locale \"+e+\" not found. Did you forget to load it?\")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T(\"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.\"),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=rt(e[r]).split(\"-\")).length,n=(n=rt(e[r+1]))?n.split(\"-\"):null;0<t;){if(s=at(i.slice(0,t).join(\"-\")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?ge:n[pe]<0||59<n[pe]?pe:n[ve]<0||59<n[ve]?ve:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=Se),g(e).overflow=t),e}function ht(e,t,n){return null!=e?e:null!=t?t:n}function ct(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ht(t.GG,e._a[me],Ie(Tt(),1,4).year),s=ht(t.W,1),((i=ht(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(Tt(),r,a);n=ht(t.gg,e._a[me],l.year),s=ht(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\\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)?)?$/,mt=/^\\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)?)?$/,_t=/Z|[+-]\\d\\d(?::?\\d\\d)?/,yt=[[\"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}/]],gt=[[\"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/]],pt=/^\\/?Date\\((\\-?\\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||\" \")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a=\"Z\"}e._f=i+(r||\"\")+(a||\"\"),kt(e)}else e._isValid=!1}var wt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=wt.exec(e._i.replace(/\\([^)]*\\)|[\\n\\t]/g,\" \").replace(/(\\s\\s+)/g,\" \").trim());if(i){var r=Mt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&Ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function kt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=\"\"+e._i,d=l.length,h=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),h+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(he,a)&&he[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=d-h,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ct(e),dt(e)}else Dt(e);else vt(e)}function Yt(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||lt(e._l),null===r||void 0===a&&\"\"===r?v({nullInput:!0}):(\"string\"==typeof r&&(e._i=r=e._locale.preparse(r)),S(r)?new M(dt(r)):(h(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],kt(t),p(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?kt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):h(n)?t._d=new Date(n.valueOf()):\"string\"==typeof n?(s=t,null===(i=pt.exec(s._i))?(vt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ct(t)):u(n)?function(e){if(!e._d){var t=C(e._i);e._a=f([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)}}(t):d(n)?t._d=new Date(n):c.createFromInputFallback(t),p(e)||(e._d=null),e))}function Ot(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Yt(a))))._nextDay&&(r.add(1,\"d\"),r._nextDay=void 0),r}function Tt(e,t,n,s){return Ot(e,t,n,s,!1)}c.createFromInputFallback=n(\"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\":\"\"))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n(\"moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/\",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),bt=n(\"moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/\",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:v()});function Pt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=[\"year\",\"quarter\",\"month\",\"week\",\"day\",\"hour\",\"minute\",\"second\",\"millisecond\"];function Ht(e){var t=C(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Wt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Wt.length;++s)if(e[Wt[s]]){if(n)return!1;parseFloat(e[Wt[s]])!==k(e[Wt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Ht}function Ct(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t=\"+\";return e<0&&(e=-e,t=\"-\"),t+U(~~(e/60),2)+n+U(~~e%60,2)})}Ft(\"Z\",\":\"),Ft(\"ZZ\",\"\"),ue(\"Z\",re),ue(\"ZZ\",re),ce([\"Z\",\"ZZ\"],function(e,t,n){n._useUTC=!0,n._tzm=Ut(re,e)});var Lt=/([\\+\\-]|\\d\\d)/gi;function Ut(e,t){var n=(t||\"\").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+\"\").match(Lt)||[\"-\",0,0],i=60*s[1]+k(s[2]);return 0===i?0:\"+\"===s[0]?i:-i}function Nt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(S(e)||h(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):Tt(e).local()}function Gt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Et=/^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/,It=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function At(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=Et.exec(e))?(n=\"-\"===a[1]?-1:1,r={y:0,d:k(a[ye])*n,h:k(a[ge])*n,m:k(a[pe])*n,s:k(a[ve])*n,ms:k(Ct(1e3*a[we]))*n}):(a=It.exec(e))?(n=\"-\"===a[1]?-1:(a[1],1),r={y:jt(a[2],n),M:jt(a[3],n),w:jt(a[4],n),d:jt(a[5],n),h:jt(a[6],n),m:jt(a[7],n),s:jt(a[8],n)}):null==r?r={}:\"object\"==typeof r&&(\"from\"in r||\"to\"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Zt(e,t):((n=Zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,\"_locale\")&&(s._locale=e._locale),s}function jt(e,t){var n=e&&parseFloat(e.replace(\",\",\".\"));return(isNaN(n)?0:n)*t}function Zt(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 zt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,\"moment().\"+i+\"(period, number) is deprecated. Please use moment().\"+i+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),n=e,e=t,t=n),$t(this,At(e=\"string\"==typeof e?+e:e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ct(t._days),a=Ct(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,xe(e,\"Month\")+a*n),r&&be(e,\"Date\",xe(e,\"Date\")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}At.fn=Ht.prototype,At.invalid=function(){return At(NaN)};var qt=zt(1,\"add\"),Jt=zt(-1,\"subtract\");function Bt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,\"months\");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,\"months\")):(t-s)/(e.clone().add(n+1,\"months\")-s)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}c.defaultFormat=\"YYYY-MM-DDTHH:mm:ssZ\",c.defaultFormatUtc=\"YYYY-MM-DDTHH:mm:ss[Z]\";var Xt=n(\"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)});function Kt(){return this._locale}function en(e,t){I(0,[e,e.length],0,t)}function tn(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,[\"gg\",2],0,function(){return this.weekYear()%100}),I(0,[\"GG\",2],0,function(){return this.isoWeekYear()%100}),en(\"gggg\",\"weekYear\"),en(\"ggggg\",\"weekYear\"),en(\"GGGG\",\"isoWeekYear\"),en(\"GGGGG\",\"isoWeekYear\"),H(\"weekYear\",\"gg\"),H(\"isoWeekYear\",\"GG\"),L(\"weekYear\",1),L(\"isoWeekYear\",1),ue(\"G\",se),ue(\"g\",se),ue(\"GG\",B,z),ue(\"gg\",B,z),ue(\"GGGG\",ee,q),ue(\"gggg\",ee,q),ue(\"GGGGG\",te,J),ue(\"ggggg\",te,J),fe([\"gggg\",\"ggggg\",\"GGGG\",\"GGGGG\"],function(e,t,n,s){t[s.substr(0,2)]=k(e)}),fe([\"gg\",\"GG\"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I(\"Q\",0,\"Qo\",\"quarter\"),H(\"quarter\",\"Q\"),L(\"quarter\",7),ue(\"Q\",Z),ce(\"Q\",function(e,t){t[_e]=3*(k(e)-1)}),I(\"D\",[\"DD\",2],\"Do\",\"date\"),H(\"date\",\"D\"),L(\"date\",9),ue(\"D\",B),ue(\"DD\",B,z),ue(\"Do\",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce([\"D\",\"DD\"],ye),ce(\"Do\",function(e,t){t[ye]=k(e.match(B)[0])});var nn=Te(\"Date\",!0);I(\"DDD\",[\"DDDD\",3],\"DDDo\",\"dayOfYear\"),H(\"dayOfYear\",\"DDD\"),L(\"dayOfYear\",4),ue(\"DDD\",K),ue(\"DDDD\",$),ce([\"DDD\",\"DDDD\"],function(e,t,n){n._dayOfYear=k(e)}),I(\"m\",[\"mm\",2],0,\"minute\"),H(\"minute\",\"m\"),L(\"minute\",14),ue(\"m\",B),ue(\"mm\",B,z),ce([\"m\",\"mm\"],pe);var sn=Te(\"Minutes\",!1);I(\"s\",[\"ss\",2],0,\"second\"),H(\"second\",\"s\"),L(\"second\",15),ue(\"s\",B),ue(\"ss\",B,z),ce([\"s\",\"ss\"],ve);var rn,an=Te(\"Seconds\",!1);for(I(\"S\",0,0,function(){return~~(this.millisecond()/100)}),I(0,[\"SS\",2],0,function(){return~~(this.millisecond()/10)}),I(0,[\"SSS\",3],0,\"millisecond\"),I(0,[\"SSSS\",4],0,function(){return 10*this.millisecond()}),I(0,[\"SSSSS\",5],0,function(){return 100*this.millisecond()}),I(0,[\"SSSSSS\",6],0,function(){return 1e3*this.millisecond()}),I(0,[\"SSSSSSS\",7],0,function(){return 1e4*this.millisecond()}),I(0,[\"SSSSSSSS\",8],0,function(){return 1e5*this.millisecond()}),I(0,[\"SSSSSSSSS\",9],0,function(){return 1e6*this.millisecond()}),H(\"millisecond\",\"ms\"),L(\"millisecond\",16),ue(\"S\",K,Z),ue(\"SS\",K,z),ue(\"SSS\",K,$),rn=\"SSSS\";rn.length<=9;rn+=\"S\")ue(rn,ne);function on(e,t){t[we]=k(1e3*(\"0.\"+e))}for(rn=\"S\";rn.length<=9;rn+=\"S\")ce(rn,on);var un=Te(\"Milliseconds\",!1);I(\"z\",0,0,\"zoneAbbr\"),I(\"zz\",0,0,\"zoneName\");var ln=M.prototype;function dn(e){return e}ln.add=qt,ln.calendar=function(e,t){var n=e||Tt(),s=Nt(n,this).startOf(\"day\"),i=c.calendarFormat(this,s)||\"sameElse\",r=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},ln.clone=function(){return new M(this)},ln.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Nt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case\"year\":r=Bt(this,s)/12;break;case\"month\":r=Bt(this,s);break;case\"quarter\":r=Bt(this,s)/3;break;case\"second\":r=(this-s)/1e3;break;case\"minute\":r=(this-s)/6e4;break;case\"hour\":r=(this-s)/36e5;break;case\"day\":r=(this-s-i)/864e5;break;case\"week\":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:D(r)},ln.endOf=function(e){return void 0===(e=R(e))||\"millisecond\"===e?this:(\"date\"===e&&(e=\"day\"),this.startOf(e).add(1,\"isoWeek\"===e?\"week\":e).subtract(1,\"ms\"))},ln.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},ln.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.fromNow=function(e){return this.from(Tt(),e)},ln.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.toNow=function(e){return this.to(Tt(),e)},ln.get=function(e){return x(this[e=R(e)])?this[e]():this},ln.invalidAt=function(){return g(this).overflow},ln.isAfter=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=R(l(t)?\"millisecond\":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},ln.isBefore=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=R(l(t)?\"millisecond\":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return(\"(\"===(s=s||\"()\")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(\")\"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},ln.isSame=function(e,t){var n,s=S(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&(\"millisecond\"===(t=R(t||\"millisecond\"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},ln.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},ln.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},ln.isValid=function(){return p(this)},ln.lang=Xt,ln.locale=Qt,ln.localeData=Kt,ln.max=bt,ln.min=xt,ln.parsingFlags=function(){return _({},g(this))},ln.set=function(e,t){if(\"object\"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=C(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},ln.startOf=function(e){switch(e=R(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},ln.subtract=Jt,ln.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},ln.toObject=function(){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()}},ln.toDate=function(){return new Date(this.valueOf())},ln.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?\"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ\"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace(\"Z\",A(n,\"Z\")):A(n,t?\"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYY-MM-DD[T]HH:mm:ss.SSSZ\")},ln.inspect=function(){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+'(\"]',s=0<=this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",i=t+'[\")]';return this.format(n+s+\"-MM-DD[T]HH:mm:ss.SSS\"+i)},ln.toJSON=function(){return this.isValid()?this.toISOString():null},ln.toString=function(){return this.clone().locale(\"en\").format(\"ddd MMM DD YYYY HH:mm:ss [GMT]ZZ\")},ln.unix=function(){return Math.floor(this.valueOf()/1e3)},ln.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ln.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ln.year=Oe,ln.isLeapYear=function(){return ke(this.year())},ln.weekYear=function(e){return tn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ln.isoWeekYear=function(e){return tn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},ln.quarter=ln.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},ln.month=Fe,ln.daysInMonth=function(){return Pe(this.year(),this.month())},ln.week=ln.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),\"d\")},ln.isoWeek=ln.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),\"d\")},ln.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},ln.isoWeeksInYear=function(){return Ae(this.year(),1,4)},ln.date=nn,ln.day=ln.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e=\"string\"!=typeof t?t:isNaN(t)?\"number\"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,\"d\")):s},ln.weekday=function(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\")},ln.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=(n=e,s=this.localeData(),\"string\"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},ln.dayOfYear=function(e){var t=Math.round((this.clone().startOf(\"day\")-this.clone().startOf(\"year\"))/864e5)+1;return null==e?t:this.add(e-t,\"d\")},ln.hour=ln.hours=tt,ln.minute=ln.minutes=sn,ln.second=ln.seconds=an,ln.millisecond=ln.milliseconds=un,ln.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if(\"string\"==typeof e){if(null===(e=Ut(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Gt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,\"m\"),i!==e&&(!t||this._changeInProgress?$t(this,At(e-i,\"m\"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Gt(this)},ln.utc=function(e){return this.utcOffset(0,e)},ln.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),\"m\")),this},ln.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if(\"string\"==typeof this._i){var e=Ut(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},ln.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},ln.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?\"UTC\":\"\"},ln.zoneName=function(){return this._isUTC?\"Coordinated Universal Time\":\"\"},ln.dates=n(\"dates accessor is deprecated. Use date instead.\",nn),ln.months=n(\"months accessor is deprecated. Use month instead\",Fe),ln.years=n(\"years accessor is deprecated. Use year instead\",Oe),ln.zone=n(\"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/\",function(e,t){return null!=e?(\"string\"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n(\"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information\",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=P.prototype;function cn(e,t,n,s){var i=lt(),r=y().set(s,t);return i[n](r,e)}function fn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||\"\",null!=t)return cn(e,t,n,\"month\");var s,i=[];for(s=0;s<12;s++)i[s]=cn(e,s,n,\"month\");return i}function mn(e,t,n,s){\"boolean\"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=t||\"\";var i,r=lt(),a=e?r._week.dow:0;if(null!=n)return cn(t,(n+a)%7,s,\"day\");var o=[];for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,\"day\");return o}hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},hn.longDateFormat=function(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])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace(\"%d\",e)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var n=this._relativeTime[0<e?\"future\":\"past\"];return x(n)?n(t):n.replace(/%s/i,t)},hn.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this[\"_\"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+\"|\"+/\\d{1,2}/.source)},hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?\"format\":\"standalone\"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?\"format\":\"standalone\"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,\"\").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,\"\").toLocaleLowerCase();return n?\"MMM\"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:\"MMM\"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp(\"^\"+this.months(i,\"\").replace(\".\",\"\")+\"$\",\"i\"),this._shortMonthsParse[s]=new RegExp(\"^\"+this.monthsShort(i,\"\").replace(\".\",\"\")+\"$\",\"i\")),n||this._monthsParse[s]||(r=\"^\"+this.months(i,\"\")+\"|^\"+this.monthsShort(i,\"\"),this._monthsParse[s]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"MMMM\"===t&&this._longMonthsParse[s].test(e))return s;if(n&&\"MMM\"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},hn.monthsRegex=function(e){return this._monthsParseExact?(m(this,\"_monthsRegex\")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,\"_monthsRegex\")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,\"_monthsRegex\")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,\"_monthsShortRegex\")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?\"format\":\"standalone\"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,\"\").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,\"\").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,\"\").toLocaleLowerCase();return n?\"dddd\"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:\"ddd\"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:\"dddd\"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:\"ddd\"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp(\"^\"+this.weekdays(i,\"\").replace(\".\",\".?\")+\"$\",\"i\"),this._shortWeekdaysParse[s]=new RegExp(\"^\"+this.weekdaysShort(i,\"\").replace(\".\",\".?\")+\"$\",\"i\"),this._minWeekdaysParse[s]=new RegExp(\"^\"+this.weekdaysMin(i,\"\").replace(\".\",\".?\")+\"$\",\"i\")),this._weekdaysParse[s]||(r=\"^\"+this.weekdays(i,\"\")+\"|^\"+this.weekdaysShort(i,\"\")+\"|^\"+this.weekdaysMin(i,\"\"),this._weekdaysParse[s]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"dddd\"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&\"ddd\"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&\"dd\"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,\"_weekdaysRegex\")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,\"_weekdaysRegex\")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,\"_weekdaysRegex\")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,\"_weekdaysShortRegex\")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,\"_weekdaysRegex\")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,\"_weekdaysMinRegex\")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return\"p\"===(e+\"\").toLowerCase().charAt(0)},hn.meridiem=function(e,t,n){return 11<e?n?\"pm\":\"PM\":n?\"am\":\"AM\"},ot(\"en\",{dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?\"th\":1===t?\"st\":2===t?\"nd\":3===t?\"rd\":\"th\")}}),c.lang=n(\"moment.lang is deprecated. Use moment.locale instead.\",ot),c.langData=n(\"moment.langData is deprecated. Use moment.localeData instead.\",lt);var _n=Math.abs;function yn(e,t,n,s){var i=At(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function pn(e){return 4800*e/146097}function vn(e){return 146097*e/4800}function wn(e){return function(){return this.as(e)}}var Mn=wn(\"ms\"),Sn=wn(\"s\"),Dn=wn(\"m\"),kn=wn(\"h\"),Yn=wn(\"d\"),On=wn(\"w\"),Tn=wn(\"M\"),xn=wn(\"y\");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=bn(\"milliseconds\"),Wn=bn(\"seconds\"),Hn=bn(\"minutes\"),Rn=bn(\"hours\"),Cn=bn(\"days\"),Fn=bn(\"months\"),Ln=bn(\"years\");var Un=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Gn=Math.abs;function Vn(e){return(0<e)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,s=Gn(this._days),i=Gn(this._months);t=D((e=D(n/60))/60),n%=60,e%=60;var r=D(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\\.?0+$/,\"\"):\"\",h=this.asSeconds();if(!h)return\"P0D\";var c=h<0?\"-\":\"\",f=Vn(this._months)!==Vn(h)?\"-\":\"\",m=Vn(this._days)!==Vn(h)?\"-\":\"\",_=Vn(this._milliseconds)!==Vn(h)?\"-\":\"\";return c+\"P\"+(r?f+r+\"Y\":\"\")+(a?f+a+\"M\":\"\")+(o?m+o+\"D\":\"\")+(u||l||d?\"T\":\"\")+(u?_+u+\"H\":\"\")+(l?_+l+\"M\":\"\")+(d?_+d+\"S\":\"\")}var In=Ht.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},In.add=function(e,t){return yn(this,e,t,1)},In.subtract=function(e,t){return yn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(\"month\"===(e=R(e))||\"year\"===e)return t=this._days+s/864e5,n=this._months+pn(t),\"month\"===e?n:n/12;switch(t=this._days+Math.round(vn(this._months)),e){case\"week\":return t/7+s/6048e5;case\"day\":return t+s/864e5;case\"hour\":return 24*t+s/36e5;case\"minute\":return 1440*t+s/6e4;case\"second\":return 86400*t+s/1e3;case\"millisecond\":return Math.floor(864e5*t)+s;default:throw new Error(\"Unknown unit \"+e)}},In.asMilliseconds=Mn,In.asSeconds=Sn,In.asMinutes=Dn,In.asHours=kn,In.asDays=Yn,In.asWeeks=On,In.asMonths=Tn,In.asYears=xn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},In._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*gn(vn(o)+a),o=a=0),u.milliseconds=r%1e3,e=D(r/1e3),u.seconds=e%60,t=D(e/60),u.minutes=t%60,n=D(t/60),u.hours=n%24,o+=i=D(pn(a+=D(n/24))),a-=gn(vn(i)),s=D(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},In.clone=function(){return At(this)},In.get=function(e){return e=R(e),this.isValid()?this[e+\"s\"]():NaN},In.milliseconds=Pn,In.seconds=Wn,In.minutes=Hn,In.hours=Rn,In.days=Cn,In.weeks=function(){return D(this.days()/7)},In.months=Fn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,d,h,c=this.localeData(),f=(n=!e,s=c,i=At(t=this).abs(),r=Un(i.as(\"s\")),a=Un(i.as(\"m\")),o=Un(i.as(\"h\")),u=Un(i.as(\"d\")),l=Un(i.as(\"M\")),d=Un(i.as(\"y\")),(h=r<=Nn.ss&&[\"s\",r]||r<Nn.s&&[\"ss\",r]||a<=1&&[\"m\"]||a<Nn.m&&[\"mm\",a]||o<=1&&[\"h\"]||o<Nn.h&&[\"hh\",o]||u<=1&&[\"d\"]||u<Nn.d&&[\"dd\",u]||l<=1&&[\"M\"]||l<Nn.M&&[\"MM\",l]||d<=1&&[\"y\"]||[\"yy\",d])[2]=n,h[3]=0<+t,h[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,h));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},In.toISOString=En,In.toString=En,In.toJSON=En,In.locale=Qt,In.localeData=Kt,In.toIsoString=n(\"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)\",En),In.lang=Xt,I(\"X\",0,0,\"unix\"),I(\"x\",0,0,\"valueOf\"),ue(\"x\",se),ue(\"X\",/[+-]?\\d+(\\.\\d{1,3})?/),ce(\"X\",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce(\"x\",function(e,t,n){n._d=new Date(k(e))}),c.version=\"2.22.1\",e=Tt,c.fn=ln,c.min=function(){return Pt(\"isBefore\",[].slice.call(arguments,0))},c.max=function(){return Pt(\"isAfter\",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return Tt(1e3*e)},c.months=function(e,t){return fn(e,t,\"months\")},c.isDate=h,c.locale=ot,c.invalid=v,c.duration=At,c.isMoment=S,c.weekdays=function(e,t,n){return mn(e,t,n,\"weekdays\")},c.parseZone=function(){return Tt.apply(null,arguments).parseZone()},c.localeData=lt,c.isDuration=Rt,c.monthsShort=function(e,t){return fn(e,t,\"monthsShort\")},c.weekdaysMin=function(e,t,n){return mn(e,t,n,\"weekdaysMin\")},c.defineLocale=ut,c.updateLocale=function(e,t){if(null!=t){var n,s,i=nt;null!=(s=at(e))&&(i=s._config),(n=new P(t=b(i,t))).parentLocale=st[e],st[e]=n,ot(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},c.locales=function(){return s(st)},c.weekdaysShort=function(e,t,n){return mn(e,t,n,\"weekdaysShort\")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?Un:\"function\"==typeof e&&(Un=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,\"s\"===e&&(Nn.ss=t-1),!0))},c.calendarFormat=function(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\"},c.prototype=ln,c.HTML5_FMT={DATETIME_LOCAL:\"YYYY-MM-DDTHH:mm\",DATETIME_LOCAL_SECONDS:\"YYYY-MM-DDTHH:mm:ss\",DATETIME_LOCAL_MS:\"YYYY-MM-DDTHH:mm:ss.SSS\",DATE:\"YYYY-MM-DD\",TIME:\"HH:mm\",TIME_SECONDS:\"HH:mm:ss\",TIME_MS:\"HH:mm:ss.SSS\",WEEK:\"YYYY-[W]WW\",MONTH:\"YYYY-MM\"},c});","module.exports = exports = window.fetch;\n\n// Needed for TypeScript and Webpack.\nexports.default = window.fetch.bind(window);\n\nexports.Headers = window.Headers;\nexports.Request = window.Request;\nexports.Response = window.Response;\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n var dict;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n // Convert data if needed\n if (typeof dictionary === 'string') {\n dict = strings.string2buf(dictionary);\n } else if (toString.call(dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(dictionary);\n } else {\n dict = dictionary;\n }\n\n status = zlib_inflate.inflateSetDictionary(this.strm, dict);\n\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // use fallback for big arrays to avoid stack overflow\n if (len < 65537) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}\n\n\n/* ===========================================================================\n * Initialize the various 'constant' tables.\n */\nfunction tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","import PropTypes from 'prop-types';\nimport { Component, cloneElement, h, options, render } from 'preact';\n\nvar version = '15.1.0'; // trick libraries to think we are react\n\nvar ELEMENTS = 'a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan'.split(' ');\n\nvar REACT_ELEMENT_TYPE = (typeof Symbol!=='undefined' && Symbol.for && Symbol.for('react.element')) || 0xeac7;\n\nvar COMPONENT_WRAPPER_KEY = (typeof Symbol!=='undefined' && Symbol.for) ? Symbol.for('__preactCompatWrapper') : '__preactCompatWrapper';\n\n// don't autobind these methods since they already have guaranteed context.\nvar AUTOBIND_BLACKLIST = {\n\tconstructor: 1,\n\trender: 1,\n\tshouldComponentUpdate: 1,\n\tcomponentWillReceiveProps: 1,\n\tcomponentWillUpdate: 1,\n\tcomponentDidUpdate: 1,\n\tcomponentWillMount: 1,\n\tcomponentDidMount: 1,\n\tcomponentWillUnmount: 1,\n\tcomponentDidUnmount: 1\n};\n\n\nvar CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/;\n\n\nvar BYPASS_HOOK = {};\n\n/*global process*/\nvar DEV = typeof process==='undefined' || !process.env || process.env.NODE_ENV!=='production';\n\n// a component that renders nothing. Used to replace components for unmountComponentAtNode.\nfunction EmptyComponent() { return null; }\n\n\n\n// make react think we're react.\nvar VNode = h('a', null).constructor;\nVNode.prototype.$$typeof = REACT_ELEMENT_TYPE;\nVNode.prototype.preactCompatUpgraded = false;\nVNode.prototype.preactCompatNormalized = false;\n\nObject.defineProperty(VNode.prototype, 'type', {\n\tget: function() { return this.nodeName; },\n\tset: function(v) { this.nodeName = v; },\n\tconfigurable:true\n});\n\nObject.defineProperty(VNode.prototype, 'props', {\n\tget: function() { return this.attributes; },\n\tset: function(v) { this.attributes = v; },\n\tconfigurable:true\n});\n\n\n\nvar oldEventHook = options.event;\noptions.event = function (e) {\n\tif (oldEventHook) { e = oldEventHook(e); }\n\te.persist = Object;\n\te.nativeEvent = e;\n\treturn e;\n};\n\n\nvar oldVnodeHook = options.vnode;\noptions.vnode = function (vnode) {\n\tif (!vnode.preactCompatUpgraded) {\n\t\tvnode.preactCompatUpgraded = true;\n\n\t\tvar tag = vnode.nodeName,\n\t\t\tattrs = vnode.attributes = extend({}, vnode.attributes);\n\n\t\tif (typeof tag==='function') {\n\t\t\tif (tag[COMPONENT_WRAPPER_KEY]===true || (tag.prototype && 'isReactComponent' in tag.prototype)) {\n\t\t\t\tif (vnode.children && String(vnode.children)==='') { vnode.children = undefined; }\n\t\t\t\tif (vnode.children) { attrs.children = vnode.children; }\n\n\t\t\t\tif (!vnode.preactCompatNormalized) {\n\t\t\t\t\tnormalizeVNode(vnode);\n\t\t\t\t}\n\t\t\t\thandleComponentVNode(vnode);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (vnode.children && String(vnode.children)==='') { vnode.children = undefined; }\n\t\t\tif (vnode.children) { attrs.children = vnode.children; }\n\n\t\t\tif (attrs.defaultValue) {\n\t\t\t\tif (!attrs.value && attrs.value!==0) {\n\t\t\t\t\tattrs.value = attrs.defaultValue;\n\t\t\t\t}\n\t\t\t\tdelete attrs.defaultValue;\n\t\t\t}\n\n\t\t\thandleElementVNode(vnode, attrs);\n\t\t}\n\t}\n\n\tif (oldVnodeHook) { oldVnodeHook(vnode); }\n};\n\nfunction handleComponentVNode(vnode) {\n\tvar tag = vnode.nodeName,\n\t\ta = vnode.attributes;\n\n\tvnode.attributes = {};\n\tif (tag.defaultProps) { extend(vnode.attributes, tag.defaultProps); }\n\tif (a) { extend(vnode.attributes, a); }\n}\n\nfunction handleElementVNode(vnode, a) {\n\tvar shouldSanitize, attrs, i;\n\tif (a) {\n\t\tfor (i in a) { if ((shouldSanitize = CAMEL_PROPS.test(i))) { break; } }\n\t\tif (shouldSanitize) {\n\t\t\tattrs = vnode.attributes = {};\n\t\t\tfor (i in a) {\n\t\t\t\tif (a.hasOwnProperty(i)) {\n\t\t\t\t\tattrs[ CAMEL_PROPS.test(i) ? i.replace(/([A-Z0-9])/, '-$1').toLowerCase() : i ] = a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n\n// proxy render() since React returns a Component reference.\nfunction render$1(vnode, parent, callback) {\n\tvar prev = parent && parent._preactCompatRendered && parent._preactCompatRendered.base;\n\n\t// ignore impossible previous renders\n\tif (prev && prev.parentNode!==parent) { prev = null; }\n\n\t// default to first Element child\n\tif (!prev && parent) { prev = parent.firstElementChild; }\n\n\t// remove unaffected siblings\n\tfor (var i=parent.childNodes.length; i--; ) {\n\t\tif (parent.childNodes[i]!==prev) {\n\t\t\tparent.removeChild(parent.childNodes[i]);\n\t\t}\n\t}\n\n\tvar out = render(vnode, parent, prev);\n\tif (parent) { parent._preactCompatRendered = out && (out._component || { base: out }); }\n\tif (typeof callback==='function') { callback(); }\n\treturn out && out._component || out;\n}\n\n\nvar ContextProvider = function () {};\n\nContextProvider.prototype.getChildContext = function () {\n\treturn this.props.context;\n};\nContextProvider.prototype.render = function (props) {\n\treturn props.children[0];\n};\n\nfunction renderSubtreeIntoContainer(parentComponent, vnode, container, callback) {\n\tvar wrap = h(ContextProvider, { context: parentComponent.context }, vnode);\n\tvar renderContainer = render$1(wrap, container);\n\tvar component = renderContainer._component || renderContainer.base;\n\tif (callback) { callback.call(component, renderContainer); }\n\treturn component;\n}\n\n\nfunction unmountComponentAtNode(container) {\n\tvar existing = container._preactCompatRendered && container._preactCompatRendered.base;\n\tif (existing && existing.parentNode===container) {\n\t\trender(h(EmptyComponent), container, existing);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n\nvar ARR = [];\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nvar Children = {\n\tmap: function(children, fn, ctx) {\n\t\tif (children == null) { return null; }\n\t\tchildren = Children.toArray(children);\n\t\tif (ctx && ctx!==children) { fn = fn.bind(ctx); }\n\t\treturn children.map(fn);\n\t},\n\tforEach: function(children, fn, ctx) {\n\t\tif (children == null) { return null; }\n\t\tchildren = Children.toArray(children);\n\t\tif (ctx && ctx!==children) { fn = fn.bind(ctx); }\n\t\tchildren.forEach(fn);\n\t},\n\tcount: function(children) {\n\t\treturn children && children.length || 0;\n\t},\n\tonly: function(children) {\n\t\tchildren = Children.toArray(children);\n\t\tif (children.length!==1) { throw new Error('Children.only() expects only one child.'); }\n\t\treturn children[0];\n\t},\n\ttoArray: function(children) {\n\t\tif (children == null) { return []; }\n\t\treturn ARR.concat(children);\n\t}\n};\n\n\n/** Track current render() component for ref assignment */\nvar currentComponent;\n\n\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n\nvar DOM = {};\nfor (var i=ELEMENTS.length; i--; ) {\n\tDOM[ELEMENTS[i]] = createFactory(ELEMENTS[i]);\n}\n\nfunction upgradeToVNodes(arr, offset) {\n\tfor (var i=offset || 0; i<arr.length; i++) {\n\t\tvar obj = arr[i];\n\t\tif (Array.isArray(obj)) {\n\t\t\tupgradeToVNodes(obj);\n\t\t}\n\t\telse if (obj && typeof obj==='object' && !isValidElement(obj) && ((obj.props && obj.type) || (obj.attributes && obj.nodeName) || obj.children)) {\n\t\t\tarr[i] = createElement(obj.type || obj.nodeName, obj.props || obj.attributes, obj.children);\n\t\t}\n\t}\n}\n\nfunction isStatelessComponent(c) {\n\treturn typeof c==='function' && !(c.prototype && c.prototype.render);\n}\n\n\n// wraps stateless functional components in a PropTypes validator\nfunction wrapStatelessComponent(WrappedComponent) {\n\treturn createClass({\n\t\tdisplayName: WrappedComponent.displayName || WrappedComponent.name,\n\t\trender: function() {\n\t\t\treturn WrappedComponent(this.props, this.context);\n\t\t}\n\t});\n}\n\n\nfunction statelessComponentHook(Ctor) {\n\tvar Wrapped = Ctor[COMPONENT_WRAPPER_KEY];\n\tif (Wrapped) { return Wrapped===true ? Ctor : Wrapped; }\n\n\tWrapped = wrapStatelessComponent(Ctor);\n\n\tObject.defineProperty(Wrapped, COMPONENT_WRAPPER_KEY, { configurable:true, value:true });\n\tWrapped.displayName = Ctor.displayName;\n\tWrapped.propTypes = Ctor.propTypes;\n\tWrapped.defaultProps = Ctor.defaultProps;\n\n\tObject.defineProperty(Ctor, COMPONENT_WRAPPER_KEY, { configurable:true, value:Wrapped });\n\n\treturn Wrapped;\n}\n\n\nfunction createElement() {\n\tvar args = [], len = arguments.length;\n\twhile ( len-- ) args[ len ] = arguments[ len ];\n\n\tupgradeToVNodes(args, 2);\n\treturn normalizeVNode(h.apply(void 0, args));\n}\n\n\nfunction normalizeVNode(vnode) {\n\tvnode.preactCompatNormalized = true;\n\n\tapplyClassName(vnode);\n\n\tif (isStatelessComponent(vnode.nodeName)) {\n\t\tvnode.nodeName = statelessComponentHook(vnode.nodeName);\n\t}\n\n\tvar ref = vnode.attributes.ref,\n\t\ttype = ref && typeof ref;\n\tif (currentComponent && (type==='string' || type==='number')) {\n\t\tvnode.attributes.ref = createStringRefProxy(ref, currentComponent);\n\t}\n\n\tapplyEventNormalization(vnode);\n\n\treturn vnode;\n}\n\n\nfunction cloneElement$1(element, props) {\n\tvar children = [], len = arguments.length - 2;\n\twhile ( len-- > 0 ) children[ len ] = arguments[ len + 2 ];\n\n\tif (!isValidElement(element)) { return element; }\n\tvar elementProps = element.attributes || element.props;\n\tvar node = h(\n\t\telement.nodeName || element.type,\n\t\textend({}, elementProps),\n\t\telement.children || elementProps && elementProps.children\n\t);\n\t// Only provide the 3rd argument if needed.\n\t// Arguments 3+ overwrite element.children in preactCloneElement\n\tvar cloneArgs = [node, props];\n\tif (children && children.length) {\n\t\tcloneArgs.push(children);\n\t}\n\telse if (props && props.children) {\n\t\tcloneArgs.push(props.children);\n\t}\n\treturn normalizeVNode(cloneElement.apply(void 0, cloneArgs));\n}\n\n\nfunction isValidElement(element) {\n\treturn element && ((element instanceof VNode) || element.$$typeof===REACT_ELEMENT_TYPE);\n}\n\n\nfunction createStringRefProxy(name, component) {\n\treturn component._refProxies[name] || (component._refProxies[name] = function (resolved) {\n\t\tif (component && component.refs) {\n\t\t\tcomponent.refs[name] = resolved;\n\t\t\tif (resolved===null) {\n\t\t\t\tdelete component._refProxies[name];\n\t\t\t\tcomponent = null;\n\t\t\t}\n\t\t}\n\t});\n}\n\n\nfunction applyEventNormalization(ref) {\n\tvar nodeName = ref.nodeName;\n\tvar attributes = ref.attributes;\n\n\tif (!attributes || typeof nodeName!=='string') { return; }\n\tvar props = {};\n\tfor (var i in attributes) {\n\t\tprops[i.toLowerCase()] = i;\n\t}\n\tif (props.ondoubleclick) {\n\t\tattributes.ondblclick = attributes[props.ondoubleclick];\n\t\tdelete attributes[props.ondoubleclick];\n\t}\n\t// for *textual inputs* (incl textarea), normalize `onChange` -> `onInput`:\n\tif (props.onchange && (nodeName==='textarea' || (nodeName.toLowerCase()==='input' && !/^fil|che|rad/i.test(attributes.type)))) {\n\t\tvar normalized = props.oninput || 'oninput';\n\t\tif (!attributes[normalized]) {\n\t\t\tattributes[normalized] = multihook([attributes[normalized], attributes[props.onchange]]);\n\t\t\tdelete attributes[props.onchange];\n\t\t}\n\t}\n}\n\n\nfunction applyClassName(vnode) {\n\tvar a = vnode.attributes || (vnode.attributes = {});\n\tclassNameDescriptor.enumerable = 'className' in a;\n\tif (a.className) { a.class = a.className; }\n\tObject.defineProperty(a, 'className', classNameDescriptor);\n}\n\n\nvar classNameDescriptor = {\n\tconfigurable: true,\n\tget: function() { return this.class; },\n\tset: function(v) { this.class = v; }\n};\n\nfunction extend(base, props) {\n\tvar arguments$1 = arguments;\n\n\tfor (var i=1, obj = (void 0); i<arguments.length; i++) {\n\t\tif ((obj = arguments$1[i])) {\n\t\t\tfor (var key in obj) {\n\t\t\t\tif (obj.hasOwnProperty(key)) {\n\t\t\t\t\tbase[key] = obj[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn base;\n}\n\n\nfunction shallowDiffers(a, b) {\n\tfor (var i in a) { if (!(i in b)) { return true; } }\n\tfor (var i$1 in b) { if (a[i$1]!==b[i$1]) { return true; } }\n\treturn false;\n}\n\n\nfunction findDOMNode(component) {\n\treturn component && component.base || component;\n}\n\n\nfunction F(){}\n\nfunction createClass(obj) {\n\tfunction cl(props, context) {\n\t\tbindAll(this);\n\t\tComponent$1.call(this, props, context, BYPASS_HOOK);\n\t\tnewComponentHook.call(this, props, context);\n\t}\n\n\tobj = extend({ constructor: cl }, obj);\n\n\t// We need to apply mixins here so that getDefaultProps is correctly mixed\n\tif (obj.mixins) {\n\t\tapplyMixins(obj, collateMixins(obj.mixins));\n\t}\n\tif (obj.statics) {\n\t\textend(cl, obj.statics);\n\t}\n\tif (obj.propTypes) {\n\t\tcl.propTypes = obj.propTypes;\n\t}\n\tif (obj.defaultProps) {\n\t\tcl.defaultProps = obj.defaultProps;\n\t}\n\tif (obj.getDefaultProps) {\n\t\tcl.defaultProps = obj.getDefaultProps.call(cl);\n\t}\n\n\tF.prototype = Component$1.prototype;\n\tcl.prototype = extend(new F(), obj);\n\n\tcl.displayName = obj.displayName || 'Component';\n\n\treturn cl;\n}\n\n\n// Flatten an Array of mixins to a map of method name to mixin implementations\nfunction collateMixins(mixins) {\n\tvar keyed = {};\n\tfor (var i=0; i<mixins.length; i++) {\n\t\tvar mixin = mixins[i];\n\t\tfor (var key in mixin) {\n\t\t\tif (mixin.hasOwnProperty(key) && typeof mixin[key]==='function') {\n\t\t\t\t(keyed[key] || (keyed[key]=[])).push(mixin[key]);\n\t\t\t}\n\t\t}\n\t}\n\treturn keyed;\n}\n\n\n// apply a mapping of Arrays of mixin methods to a component prototype\nfunction applyMixins(proto, mixins) {\n\tfor (var key in mixins) { if (mixins.hasOwnProperty(key)) {\n\t\tproto[key] = multihook(\n\t\t\tmixins[key].concat(proto[key] || ARR),\n\t\t\tkey==='getDefaultProps' || key==='getInitialState' || key==='getChildContext'\n\t\t);\n\t} }\n}\n\n\nfunction bindAll(ctx) {\n\tfor (var i in ctx) {\n\t\tvar v = ctx[i];\n\t\tif (typeof v==='function' && !v.__bound && !AUTOBIND_BLACKLIST.hasOwnProperty(i)) {\n\t\t\t(ctx[i] = v.bind(ctx)).__bound = true;\n\t\t}\n\t}\n}\n\n\nfunction callMethod(ctx, m, args) {\n\tif (typeof m==='string') {\n\t\tm = ctx.constructor.prototype[m];\n\t}\n\tif (typeof m==='function') {\n\t\treturn m.apply(ctx, args);\n\t}\n}\n\nfunction multihook(hooks, skipDuplicates) {\n\treturn function() {\n\t\tvar arguments$1 = arguments;\n\t\tvar this$1 = this;\n\n\t\tvar ret;\n\t\tfor (var i=0; i<hooks.length; i++) {\n\t\t\tvar r = callMethod(this$1, hooks[i], arguments$1);\n\n\t\t\tif (skipDuplicates && r!=null) {\n\t\t\t\tif (!ret) { ret = {}; }\n\t\t\t\tfor (var key in r) { if (r.hasOwnProperty(key)) {\n\t\t\t\t\tret[key] = r[key];\n\t\t\t\t} }\n\t\t\t}\n\t\t\telse if (typeof r!=='undefined') { ret = r; }\n\t\t}\n\t\treturn ret;\n\t};\n}\n\n\nfunction newComponentHook(props, context) {\n\tpropsHook.call(this, props, context);\n\tthis.componentWillReceiveProps = multihook([propsHook, this.componentWillReceiveProps || 'componentWillReceiveProps']);\n\tthis.render = multihook([propsHook, beforeRender, this.render || 'render', afterRender]);\n}\n\n\nfunction propsHook(props, context) {\n\tif (!props) { return; }\n\n\t// React annoyingly special-cases single children, and some react components are ridiculously strict about this.\n\tvar c = props.children;\n\tif (c && Array.isArray(c) && c.length===1 && (typeof c[0]==='string' || typeof c[0]==='function' || c[0] instanceof VNode)) {\n\t\tprops.children = c[0];\n\n\t\t// but its totally still going to be an Array.\n\t\tif (props.children && typeof props.children==='object') {\n\t\t\tprops.children.length = 1;\n\t\t\tprops.children[0] = props.children;\n\t\t}\n\t}\n\n\t// add proptype checking\n\tif (DEV) {\n\t\tvar ctor = typeof this==='function' ? this : this.constructor,\n\t\t\tpropTypes = this.propTypes || ctor.propTypes;\n\t\tvar displayName = this.displayName || ctor.name;\n\n\t\tif (propTypes) {\n\t\t\tPropTypes.checkPropTypes(propTypes, props, 'prop', displayName);\n\t\t}\n\t}\n}\n\n\nfunction beforeRender(props) {\n\tcurrentComponent = this;\n}\n\nfunction afterRender() {\n\tif (currentComponent===this) {\n\t\tcurrentComponent = null;\n\t}\n}\n\n\n\nfunction Component$1(props, context, opts) {\n\tComponent.call(this, props, context);\n\tthis.state = this.getInitialState ? this.getInitialState() : {};\n\tthis.refs = {};\n\tthis._refProxies = {};\n\tif (opts!==BYPASS_HOOK) {\n\t\tnewComponentHook.call(this, props, context);\n\t}\n}\nextend(Component$1.prototype = new Component(), {\n\tconstructor: Component$1,\n\n\tisReactComponent: {},\n\n\treplaceState: function(state, callback) {\n\t\tvar this$1 = this;\n\n\t\tthis.setState(state, callback);\n\t\tfor (var i in this$1.state) {\n\t\t\tif (!(i in state)) {\n\t\t\t\tdelete this$1.state[i];\n\t\t\t}\n\t\t}\n\t},\n\n\tgetDOMNode: function() {\n\t\treturn this.base;\n\t},\n\n\tisMounted: function() {\n\t\treturn !!this.base;\n\t}\n});\n\n\n\nfunction PureComponent(props, context) {\n\tComponent$1.call(this, props, context);\n}\nF.prototype = Component$1.prototype;\nPureComponent.prototype = new F();\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function(props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n\nvar index = {\n\tversion: version,\n\tDOM: DOM,\n\tPropTypes: PropTypes,\n\tChildren: Children,\n\trender: render$1,\n\tcreateClass: createClass,\n\tcreateFactory: createFactory,\n\tcreateElement: createElement,\n\tcloneElement: cloneElement$1,\n\tisValidElement: isValidElement,\n\tfindDOMNode: findDOMNode,\n\tunmountComponentAtNode: unmountComponentAtNode,\n\tComponent: Component$1,\n\tPureComponent: PureComponent,\n\tunstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer,\n\t__spread: extend\n};\n\nexport { version, DOM, PropTypes, Children, render$1 as render, createClass, createFactory, createElement, cloneElement$1 as cloneElement, isValidElement, findDOMNode, unmountComponentAtNode, Component$1 as Component, PureComponent, renderSubtreeIntoContainer as unstable_renderSubtreeIntoContainer, extend as __spread };export default index;\n//# sourceMappingURL=preact-compat.es.js.map\n","/** Virtual DOM Node */\nfunction VNode() {}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nvar options = {\n\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n *\t@name syncComponentUpdates\n *\t@type Boolean\n *\t@default true\n */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t// afterMount(component) { }\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t// afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\n * the current _actual_ DOM structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `<div id=\"foo\" name=\"bar\">Hello!</div>`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\n * @param {Object} attributes\tAny attributes/props to set on the created element.\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\n *\n * @public\n */\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\n/**\n * Copy all properties from `props` onto `obj`.\n * @param {Object} obj\t\tObject onto which properties should be copied.\n * @param {Object} props\tObject from which to copy properties.\n * @returns obj\n * @private\n */\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n *\n * @param {Function} callback\n */\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\n// DOM properties that should NOT have \"px\" added when numeric\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n/** Managed queue of dirty components to be re-rendered */\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p,\n\t list = items;\n\titems = [];\n\twhile (p = list.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nfunction isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined;\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n }\n return hydrating || node._componentConstructor === vnode.nodeName;\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nfunction isNamedNode(node, nodeName) {\n return node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nfunction getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n\n var defaultProps = vnode.nodeName.defaultProps;\n if (defaultProps !== undefined) {\n for (var i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i];\n }\n }\n }\n\n return props;\n}\n\n/** Create an element with the given nodeName.\n *\t@param {String} nodeName\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\n *\t@returns {Element} node\n */\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\n/** Remove a child node from its parent if attached.\n *\t@param {Element} node\t\tThe node to remove\n */\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\n *\tIf `value` is `null`, the attribute/handler will be removed.\n *\t@param {Element} node\tAn element to mutate\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\n *\t@param {any} old\tThe last value that was set for this name/node pair\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\n *\t@private\n */\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {\n\t\t// ignore\n\t} else if (name === 'ref') {\n\t\tif (old) old(null);\n\t\tif (value) value(node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\tsetProperty(node, name, value == null ? '' : value);\n\t\tif (value == null || value === false) node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n/** Attempt to set a DOM property to the given value.\n *\tIE & FF throw for certain property-value combinations.\n */\nfunction setProperty(node, name, value) {\n\ttry {\n\t\tnode[name] = value;\n\t} catch (e) {}\n}\n\n/** Proxy an event to hooked event handlers\n *\t@private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nvar mounts = [];\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nvar diffLevel = 0;\n\n/** Global flag indicating if the diff is currently within an SVG */\nvar isSvgMode = false;\n\n/** Global flag indicating if the diff is performing hydration */\nvar hydrating = false;\n\n/** Invoke queued componentDidMount lifecycle methods */\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\t// If the VNode represents a Component, perform a component diff:\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t} // if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props);\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\t// attempt to find a node based on key matching\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// attempt to pluck a node of the same type from the existing children\n\t\t\telse if (!child && min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove unused keyed children:\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\t// remove orphaned unkeyed children:\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\n\t\tunmountComponent(component);\n\t} else {\n\t\t// If the node's VNode had a ref function, invoke it with null here.\n\t\t// (this is part of the React spec, and smart for unsetting references)\n\t\tif (node['__preactattr_'] != null && node['__preactattr_'].ref) node['__preactattr_'].ref(null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\t// remove attributes no longer present on the vnode by setting them to undefined\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\t// add new & update changed attributes\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\n/** Retains a pool of Components for re-use, keyed on component name.\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\n *\t@private\n */\nvar components = {};\n\n/** Reclaim a component for later re-use by the recycler. */\nfunction collectComponent(component) {\n\tvar name = component.constructor.name;\n\t(components[name] || (components[name] = [])).push(component);\n}\n\n/** Create a component. Normalizes differences between PFC's and classful Components. */\nfunction createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\n/** Set a component's `props` (generally derived from JSX attributes).\n *\t@param {Object} props\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\n */\nfunction setComponentProps(component, props, opts, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tif (component.__ref = props.ref) delete props.ref;\n\tif (component.__key = props.key) delete props.key;\n\n\tif (!component.base || mountAll) {\n\t\tif (component.componentWillMount) component.componentWillMount();\n\t} else if (component.componentWillReceiveProps) {\n\t\tcomponent.componentWillReceiveProps(props, context);\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (opts !== 0) {\n\t\tif (opts === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tif (component.__ref) component.__ref(component);\n}\n\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\n *\t@param {Component} component\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\n *\t@private\n */\nfunction renderComponent(component, opts, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t rendered,\n\t inst,\n\t cbase;\n\n\t// if updating\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (opts !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\t// context to pass to the child, can be updated via (grand-)parent component\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\t\t\t// set up high order component link\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\t// destroy high order component link\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || opts === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.unshift(component);\n\t} else if (!skip) {\n\t\t// Ensure that pending componentDidMount() hooks of child components\n\t\t// are called before the componentDidUpdate() hook in the parent.\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n\t\t// flushMounts();\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\tif (component._renderCallbacks != null) {\n\t\twhile (component._renderCallbacks.length) {\n\t\t\tcomponent._renderCallbacks.pop().call(component);\n\t\t}\n\t}\n\n\tif (!diffLevel && !isChild) flushMounts();\n}\n\n/** Apply the Component referenced by a VNode to the DOM.\n *\t@param {Element} dom\tThe DOM node to mutate\n *\t@param {VNode} vnode\tA Component-referencing VNode\n *\t@returns {Element} dom\tThe created/mutated element\n *\t@private\n */\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/** Remove a component from the DOM and recycle it.\n *\t@param {Component} component\tThe Component instance to unmount\n *\t@private\n */\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\t// recursively tear down & recollect high-order component children:\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] && base['__preactattr_'].ref) base['__preactattr_'].ref(null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\tcollectComponent(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tif (component.__ref) component.__ref(null);\n}\n\n/** Base Component class.\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\n *\t@public\n *\n *\t@example\n *\tclass MyFoo extends Component {\n *\t\trender(props, state) {\n *\t\t\treturn <div />;\n *\t\t}\n *\t}\n */\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.context = context;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.props = props;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.state = this.state || {};\n}\n\nextend(Component.prototype, {\n\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\n *\t@param {object} nextProps\n *\t@param {object} nextState\n *\t@param {object} nextContext\n *\t@returns {Boolean} should the component re-render\n *\t@name shouldComponentUpdate\n *\t@function\n */\n\n\t/** Update component state by copying properties from `state` to `this.state`.\n *\t@param {object} state\t\tA hash of state properties to update with new values\n *\t@param {function} callback\tA function to be called once component state is updated\n */\n\tsetState: function setState(state, callback) {\n\t\tvar s = this.state;\n\t\tif (!this.prevState) this.prevState = extend({}, s);\n\t\textend(s, typeof state === 'function' ? state(s, this.props) : state);\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\tenqueueRender(this);\n\t},\n\n\n\t/** Immediately perform a synchronous re-render of the component.\n *\t@param {function} callback\t\tA function to be called after component is re-rendered.\n *\t@private\n */\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\n\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\n *\t@param {object} state\t\tThe component's current state\n *\t@param {object} context\t\tContext object (if a parent component has provided context)\n *\t@returns VNode\n */\n\trender: function render() {}\n});\n\n/** Render JSX into a `parent` Element.\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\n *\t@param {Element} parent\t\tDOM element to render into\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\n *\t@public\n *\n *\t@example\n *\t// render a div into <body>:\n *\trender(<div id=\"hello\">hello!</div>, document.body);\n *\n *\t@example\n *\t// render a \"Thing\" component into #foo:\n *\tconst Thing = ({ name }) => <span>{ name }</span>;\n *\trender(<Thing name=\"one\" />, document.querySelector('#foo'));\n */\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, Component, render, rerender, options };\n//# sourceMappingURL=preact.esm.js.map\n","'use strict';\n\nif (!process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // 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\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // 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.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n 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', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<<anonymous>>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport { Component, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport { storeShape, subscriptionShape } from '../utils/PropTypes';\nimport warning from '../utils/warning';\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nexport function createProvider() {\n var _Provider$childContex;\n\n var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store';\n var subKey = arguments[1];\n\n var subscriptionKey = subKey || storeKey + 'Subscription';\n\n var Provider = function (_Component) {\n _inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref;\n };\n\n function Provider(props, context) {\n _classCallCheck(this, Provider);\n\n var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this[storeKey] = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n }(Component);\n\n if (process.env.NODE_ENV !== 'production') {\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n if (this[storeKey] !== nextProps.store) {\n warnAboutReceivingStore();\n }\n };\n }\n\n Provider.propTypes = {\n store: storeShape.isRequired,\n children: PropTypes.element.isRequired\n };\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = storeShape.isRequired, _Provider$childContex[subscriptionKey] = subscriptionShape, _Provider$childContex);\n\n return Provider;\n}\n\nexport default createProvider();","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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _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; }\n\nimport hoistStatics from 'hoist-non-react-statics';\nimport invariant from 'invariant';\nimport { Component, createElement } from 'react';\n\nimport Subscription from '../utils/Subscription';\nimport { storeShape, subscriptionShape } from '../utils/PropTypes';\n\nvar hotReloadingVersion = 0;\nvar dummyState = {};\nfunction noop() {}\nfunction makeSelectorStateful(sourceSelector, store) {\n // wrap the selector in an object that tracks its results between runs.\n var selector = {\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(store.getState(), props);\n if (nextProps !== selector.props || selector.error) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n\n return selector;\n}\n\nexport default function connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$getDisplayName = _ref.getDisplayName,\n getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName,\n _ref$methodName = _ref.methodName,\n methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName,\n _ref$renderCountProp = _ref.renderCountProp,\n renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp,\n _ref$shouldHandleStat = _ref.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat,\n _ref$storeKey = _ref.storeKey,\n storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey,\n _ref$withRef = _ref.withRef,\n withRef = _ref$withRef === undefined ? false : _ref$withRef,\n connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = subscriptionShape, _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = subscriptionShape, _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + (methodName + '. Instead received ' + JSON.stringify(WrappedComponent)));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n _inherits(Connect, _Component);\n\n function Connect(props, context) {\n _classCallCheck(this, Connect);\n\n var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = props[storeKey] || context[storeKey];\n _this.propsMode = Boolean(props[storeKey]);\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or props of ' + ('\"' + displayName + '\". Either wrap the root component in a <Provider>, ') + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n // If this component received store from props, its subscription should be transparent\n // to any descendants receiving store+subscription from context; it passes along\n // subscription passed to it. Otherwise, it shadows the parent subscription, which allows\n // Connect to control ordering of notifications to flow top-down.\n var subscription = this.propsMode ? null : this.subscription;\n return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.subscription = null;\n this.notifyNestedSubs = noop;\n this.store = null;\n this.selector.run = noop;\n this.selector.shouldComponentUpdate = false;\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);\n this.selector = makeSelectorStateful(sourceSelector, this.store);\n this.selector.run(this.props);\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n if (!shouldHandleStateChanges) return;\n\n // parentSub's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];\n this.subscription = new Subscription(this.store, parentSub, this.onStateChange.bind(this));\n\n // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `this.subscription` will then be null. An\n // extra null check every change can be avoided by copying the method onto `this` and then\n // replacing it with a no-op on unmount. This can probably be avoided if Subscription's\n // listeners logic is changed to not call listeners that have been unsubscribed in the\n // middle of the notification loop.\n this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);\n };\n\n Connect.prototype.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n this.notifyNestedSubs();\n } else {\n this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;\n this.setState(dummyState);\n }\n };\n\n Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {\n // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it\n // needs to notify nested subs. Once called, it unimplements itself until further state\n // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does\n // a boolean check every time avoids an extra method call most of the time, resulting\n // in some perf boost.\n this.componentDidUpdate = undefined;\n this.notifyNestedSubs();\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return createElement(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n Connect.propTypes = contextTypes;\n\n if (process.env.NODE_ENV !== 'production') {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n var _this2 = this;\n\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n // If any connected descendants don't hot reload (and resubscribe in the process), their\n // listeners will be lost when we unsubscribe. Unfortunately, by copying over all\n // listeners, this does mean that the old versions of connected descendants will still be\n // notified of state changes; however, their onStateChange function is a no-op so this\n // isn't a huge deal.\n var oldListeners = [];\n\n if (this.subscription) {\n oldListeners = this.subscription.listeners.get();\n this.subscription.tryUnsubscribe();\n }\n this.initSubscription();\n if (shouldHandleStateChanges) {\n this.subscription.trySubscribe();\n oldListeners.forEach(function (listener) {\n return _this2.subscription.listeners.subscribe(listener);\n });\n }\n }\n };\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","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; };\n\nfunction _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; }\n\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nexport function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nexport default createConnect();","import { bindActionCreators } from 'redux';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\n\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\n\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","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; };\n\nimport verifyPlainObject from '../utils/verifyPlainObject';\n\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","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; }\n\nimport verifySubselectors from './verifySubselectors';\n\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import warning from '../utils/warning';\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nexport default function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}","import verifyPlainObject from '../utils/verifyPlainObject';\n\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}","import Provider, { createProvider } from './components/Provider';\nimport connectAdvanced from './components/connectAdvanced';\nimport connect from './connect/connect';\n\nexport { Provider, createProvider, connectAdvanced, connect };","import PropTypes from 'prop-types';\n\nexport var subscriptionShape = PropTypes.shape({\n trySubscribe: PropTypes.func.isRequired,\n tryUnsubscribe: PropTypes.func.isRequired,\n notifyNestedSubs: PropTypes.func.isRequired,\n isSubscribed: PropTypes.func.isRequired\n});\n\nexport var storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n get: function get() {\n return next;\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub, onStateChange) {\n _classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.onStateChange = onStateChange;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nexport { Subscription as default };","var hasOwn = Object.prototype.hasOwnProperty;\n\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","import isPlainObject from 'lodash-es/isPlainObject';\nimport warning from './warning';\n\nexport default function verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}","/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport createHistory from 'history/createBrowserHistory';\nimport Router from './Router';\n\n/**\n * The public API for a <Router> that uses HTML5 history.\n */\n\nvar BrowserRouter = function (_React$Component) {\n _inherits(BrowserRouter, _React$Component);\n\n function BrowserRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, BrowserRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n BrowserRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<BrowserRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { BrowserRouter as Router }`.');\n };\n\n BrowserRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return BrowserRouter;\n}(React.Component);\n\nBrowserRouter.propTypes = {\n basename: PropTypes.string,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n};\n\n\nexport default BrowserRouter;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport createHistory from 'history/createHashHistory';\nimport Router from './Router';\n\n/**\n * The public API for a <Router> that uses window.location.hash.\n */\n\nvar HashRouter = function (_React$Component) {\n _inherits(HashRouter, _React$Component);\n\n function HashRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, HashRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n HashRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<HashRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { HashRouter as Router }`.');\n };\n\n HashRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return HashRouter;\n}(React.Component);\n\nHashRouter.propTypes = {\n basename: PropTypes.string,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf(['hashbang', 'noslash', 'slash']),\n children: PropTypes.node\n};\n\n\nexport default HashRouter;","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; };\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\n\nvar isModifiedEvent = function isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n};\n\n/**\n * The public API for rendering a history-aware <a>.\n */\n\nvar Link = function (_React$Component) {\n _inherits(Link, _React$Component);\n\n function Link() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Link);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {\n if (_this.props.onClick) _this.props.onClick(event);\n\n if (!event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore right clicks\n !_this.props.target && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n\n var history = _this.context.router.history;\n var _this$props = _this.props,\n replace = _this$props.replace,\n to = _this$props.to;\n\n\n if (replace) {\n history.replace(to);\n } else {\n history.push(to);\n }\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Link.prototype.render = function render() {\n var _props = this.props,\n replace = _props.replace,\n to = _props.to,\n innerRef = _props.innerRef,\n props = _objectWithoutProperties(_props, ['replace', 'to', 'innerRef']); // eslint-disable-line no-unused-vars\n\n invariant(this.context.router, 'You should not use <Link> outside a <Router>');\n\n var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);\n\n return React.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));\n };\n\n return Link;\n}(React.Component);\n\nLink.propTypes = {\n onClick: PropTypes.func,\n target: PropTypes.string,\n replace: PropTypes.bool,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func])\n};\nLink.defaultProps = {\n replace: false\n};\nLink.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n push: PropTypes.func.isRequired,\n replace: PropTypes.func.isRequired,\n createHref: PropTypes.func.isRequired\n }).isRequired\n }).isRequired\n};\n\n\nexport default Link;","// Written in this round about way for babel-transform-imports\nimport MemoryRouter from 'react-router/es/MemoryRouter';\n\nexport default MemoryRouter;","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; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Route from './Route';\nimport Link from './Link';\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nvar NavLink = function NavLink(_ref) {\n var to = _ref.to,\n exact = _ref.exact,\n strict = _ref.strict,\n location = _ref.location,\n activeClassName = _ref.activeClassName,\n className = _ref.className,\n activeStyle = _ref.activeStyle,\n style = _ref.style,\n getIsActive = _ref.isActive,\n ariaCurrent = _ref.ariaCurrent,\n rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive', 'ariaCurrent']);\n\n return React.createElement(Route, {\n path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to,\n exact: exact,\n strict: strict,\n location: location,\n children: function children(_ref2) {\n var location = _ref2.location,\n match = _ref2.match;\n\n var isActive = !!(getIsActive ? getIsActive(match, location) : match);\n\n return React.createElement(Link, _extends({\n to: to,\n className: isActive ? [className, activeClassName].filter(function (i) {\n return i;\n }).join(' ') : className,\n style: isActive ? _extends({}, style, activeStyle) : style,\n 'aria-current': isActive && ariaCurrent\n }, rest));\n }\n });\n};\n\nNavLink.propTypes = {\n to: Link.propTypes.to,\n exact: PropTypes.bool,\n strict: PropTypes.bool,\n location: PropTypes.object,\n activeClassName: PropTypes.string,\n className: PropTypes.string,\n activeStyle: PropTypes.object,\n style: PropTypes.object,\n isActive: PropTypes.func,\n ariaCurrent: PropTypes.oneOf(['page', 'step', 'location', 'true'])\n};\n\nNavLink.defaultProps = {\n activeClassName: 'active',\n ariaCurrent: 'true'\n};\n\nexport default NavLink;","// Written in this round about way for babel-transform-imports\nimport Prompt from 'react-router/es/Prompt';\n\nexport default Prompt;","// Written in this round about way for babel-transform-imports\nimport Redirect from 'react-router/es/Redirect';\n\nexport default Redirect;","// Written in this round about way for babel-transform-imports\nimport Route from 'react-router/es/Route';\n\nexport default Route;","// Written in this round about way for babel-transform-imports\nimport Router from 'react-router/es/Router';\n\nexport default Router;","// Written in this round about way for babel-transform-imports\nimport StaticRouter from 'react-router/es/StaticRouter';\n\nexport default StaticRouter;","// Written in this round about way for babel-transform-imports\nimport Switch from 'react-router/es/Switch';\n\nexport default Switch;","import _BrowserRouter from './BrowserRouter';\nexport { _BrowserRouter as BrowserRouter };\nimport _HashRouter from './HashRouter';\nexport { _HashRouter as HashRouter };\nimport _Link from './Link';\nexport { _Link as Link };\nimport _MemoryRouter from './MemoryRouter';\nexport { _MemoryRouter as MemoryRouter };\nimport _NavLink from './NavLink';\nexport { _NavLink as NavLink };\nimport _Prompt from './Prompt';\nexport { _Prompt as Prompt };\nimport _Redirect from './Redirect';\nexport { _Redirect as Redirect };\nimport _Route from './Route';\nexport { _Route as Route };\nimport _Router from './Router';\nexport { _Router as Router };\nimport _StaticRouter from './StaticRouter';\nexport { _StaticRouter as StaticRouter };\nimport _Switch from './Switch';\nexport { _Switch as Switch };\nimport _matchPath from './matchPath';\nexport { _matchPath as matchPath };\nimport _withRouter from './withRouter';\nexport { _withRouter as withRouter };","// Written in this round about way for babel-transform-imports\nimport matchPath from 'react-router/es/matchPath';\n\nexport default matchPath;","// Written in this round about way for babel-transform-imports\nimport withRouter from 'react-router/es/withRouter';\n\nexport default withRouter;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * This action type will be dispatched by the history actions below.\n * If you're writing a middleware to watch for navigation events, be sure to\n * look for actions of this type.\n */\nvar CALL_HISTORY_METHOD = exports.CALL_HISTORY_METHOD = '@@router/CALL_HISTORY_METHOD';\n\nfunction updateLocation(method) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return {\n type: CALL_HISTORY_METHOD,\n payload: { method: method, args: args }\n };\n };\n}\n\n/**\n * These actions correspond to the history API.\n * The associated routerMiddleware will capture these events before they get to\n * your reducer and reissue them as the matching function on your history.\n */\nvar push = exports.push = updateLocation('push');\nvar replace = exports.replace = updateLocation('replace');\nvar go = exports.go = updateLocation('go');\nvar goBack = exports.goBack = updateLocation('goBack');\nvar goForward = exports.goForward = updateLocation('goForward');\n\nvar routerActions = exports.routerActions = { push: push, replace: replace, go: go, goBack: goBack, goForward: goForward };","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.routerMiddleware = exports.routerActions = exports.goForward = exports.goBack = exports.go = exports.replace = exports.push = exports.CALL_HISTORY_METHOD = exports.routerReducer = exports.LOCATION_CHANGE = exports.syncHistoryWithStore = undefined;\n\nvar _reducer = require('./reducer');\n\nObject.defineProperty(exports, 'LOCATION_CHANGE', {\n enumerable: true,\n get: function get() {\n return _reducer.LOCATION_CHANGE;\n }\n});\nObject.defineProperty(exports, 'routerReducer', {\n enumerable: true,\n get: function get() {\n return _reducer.routerReducer;\n }\n});\n\nvar _actions = require('./actions');\n\nObject.defineProperty(exports, 'CALL_HISTORY_METHOD', {\n enumerable: true,\n get: function get() {\n return _actions.CALL_HISTORY_METHOD;\n }\n});\nObject.defineProperty(exports, 'push', {\n enumerable: true,\n get: function get() {\n return _actions.push;\n }\n});\nObject.defineProperty(exports, 'replace', {\n enumerable: true,\n get: function get() {\n return _actions.replace;\n }\n});\nObject.defineProperty(exports, 'go', {\n enumerable: true,\n get: function get() {\n return _actions.go;\n }\n});\nObject.defineProperty(exports, 'goBack', {\n enumerable: true,\n get: function get() {\n return _actions.goBack;\n }\n});\nObject.defineProperty(exports, 'goForward', {\n enumerable: true,\n get: function get() {\n return _actions.goForward;\n }\n});\nObject.defineProperty(exports, 'routerActions', {\n enumerable: true,\n get: function get() {\n return _actions.routerActions;\n }\n});\n\nvar _sync = require('./sync');\n\nvar _sync2 = _interopRequireDefault(_sync);\n\nvar _middleware = require('./middleware');\n\nvar _middleware2 = _interopRequireDefault(_middleware);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nexports.syncHistoryWithStore = _sync2['default'];\nexports.routerMiddleware = _middleware2['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = routerMiddleware;\n\nvar _actions = require('./actions');\n\nfunction _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); } }\n\n/**\n * This middleware captures CALL_HISTORY_METHOD actions to redirect to the\n * provided history object. This will prevent these actions from reaching your\n * reducer or any middleware that comes after this one.\n */\nfunction routerMiddleware(history) {\n return function () {\n return function (next) {\n return function (action) {\n if (action.type !== _actions.CALL_HISTORY_METHOD) {\n return next(action);\n }\n\n var _action$payload = action.payload,\n method = _action$payload.method,\n args = _action$payload.args;\n\n history[method].apply(history, _toConsumableArray(args));\n };\n };\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports.routerReducer = routerReducer;\n/**\n * This action type will be dispatched when your history\n * receives a location change.\n */\nvar LOCATION_CHANGE = exports.LOCATION_CHANGE = '@@router/LOCATION_CHANGE';\n\nvar initialState = {\n locationBeforeTransitions: null\n};\n\n/**\n * This reducer will update the state with the most recent location history\n * has transitioned to. This may not be in sync with the router, particularly\n * if you have asynchronously-loaded routes, so reading from and relying on\n * this state is discouraged.\n */\nfunction routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports['default'] = syncHistoryWithStore;\n\nvar _reducer = require('./reducer');\n\nvar defaultSelectLocationState = function defaultSelectLocationState(state) {\n return state.routing;\n};\n\n/**\n * This function synchronizes your history state with the Redux store.\n * Location changes flow from history to the store. An enhanced history is\n * returned with a listen method that responds to store updates for location.\n *\n * When this history is provided to the router, this means the location data\n * will flow like this:\n * history.push -> store.dispatch -> enhancedHistory.listen -> router\n * This ensures that when the store state changes due to a replay or other\n * event, the router will be updated appropriately and can transition to the\n * correct router state.\n */\nfunction syncHistoryWithStore(history, store) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n _ref$selectLocationSt = _ref.selectLocationState,\n selectLocationState = _ref$selectLocationSt === undefined ? defaultSelectLocationState : _ref$selectLocationSt,\n _ref$adjustUrlOnRepla = _ref.adjustUrlOnReplay,\n adjustUrlOnReplay = _ref$adjustUrlOnRepla === undefined ? true : _ref$adjustUrlOnRepla;\n\n // Ensure that the reducer is mounted on the store and functioning properly.\n if (typeof selectLocationState(store.getState()) === 'undefined') {\n throw new Error('Expected the routing state to be available either as `state.routing` ' + 'or as the custom expression you can specify as `selectLocationState` ' + 'in the `syncHistoryWithStore()` options. ' + 'Ensure you have added the `routerReducer` to your store\\'s ' + 'reducers via `combineReducers` or whatever method you use to isolate ' + 'your reducers.');\n }\n\n var initialLocation = void 0;\n var isTimeTraveling = void 0;\n var unsubscribeFromStore = void 0;\n var unsubscribeFromHistory = void 0;\n var currentLocation = void 0;\n\n // What does the store say about current location?\n var getLocationInStore = function getLocationInStore(useInitialIfEmpty) {\n var locationState = selectLocationState(store.getState());\n return locationState.locationBeforeTransitions || (useInitialIfEmpty ? initialLocation : undefined);\n };\n\n // Init initialLocation with potential location in store\n initialLocation = getLocationInStore();\n\n // If the store is replayed, update the URL in the browser to match.\n if (adjustUrlOnReplay) {\n var handleStoreChange = function handleStoreChange() {\n var locationInStore = getLocationInStore(true);\n if (currentLocation === locationInStore || initialLocation === locationInStore) {\n return;\n }\n\n // Update address bar to reflect store state\n isTimeTraveling = true;\n currentLocation = locationInStore;\n history.transitionTo(_extends({}, locationInStore, {\n action: 'PUSH'\n }));\n isTimeTraveling = false;\n };\n\n unsubscribeFromStore = store.subscribe(handleStoreChange);\n handleStoreChange();\n }\n\n // Whenever location changes, dispatch an action to get it in the store\n var handleLocationChange = function handleLocationChange(location) {\n // ... unless we just caused that location change\n if (isTimeTraveling) {\n return;\n }\n\n // Remember where we are\n currentLocation = location;\n\n // Are we being called for the first time?\n if (!initialLocation) {\n // Remember as a fallback in case state is reset\n initialLocation = location;\n\n // Respect persisted location, if any\n if (getLocationInStore()) {\n return;\n }\n }\n\n // Tell the store to update by dispatching an action\n store.dispatch({\n type: _reducer.LOCATION_CHANGE,\n payload: location\n });\n };\n unsubscribeFromHistory = history.listen(handleLocationChange);\n\n // History 3.x doesn't call listen synchronously, so fire the initial location change ourselves\n if (history.getCurrentLocation) {\n handleLocationChange(history.getCurrentLocation());\n }\n\n // The enhanced history uses store as source of truth\n return _extends({}, history, {\n // The listeners are subscribed to the store instead of history\n listen: function listen(listener) {\n // Copy of last location.\n var lastPublishedLocation = getLocationInStore(true);\n\n // Keep track of whether we unsubscribed, as Redux store\n // only applies changes in subscriptions on next dispatch\n var unsubscribed = false;\n var unsubscribeFromStore = store.subscribe(function () {\n var currentLocation = getLocationInStore(true);\n if (currentLocation === lastPublishedLocation) {\n return;\n }\n lastPublishedLocation = currentLocation;\n if (!unsubscribed) {\n listener(lastPublishedLocation);\n }\n });\n\n // History 2.x listeners expect a synchronous call. Make the first call to the\n // listener after subscribing to the store, in case the listener causes a\n // location change (e.g. when it redirects)\n if (!history.getCurrentLocation) {\n listener(lastPublishedLocation);\n }\n\n // Let user unsubscribe later\n return function () {\n unsubscribed = true;\n unsubscribeFromStore();\n };\n },\n\n\n // It also provides a way to destroy internal listeners\n unsubscribe: function unsubscribe() {\n if (adjustUrlOnReplay) {\n unsubscribeFromStore();\n }\n unsubscribeFromHistory();\n }\n });\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport createHistory from 'history/createMemoryHistory';\nimport Router from './Router';\n\n/**\n * The public API for a <Router> that stores location in memory.\n */\n\nvar MemoryRouter = function (_React$Component) {\n _inherits(MemoryRouter, _React$Component);\n\n function MemoryRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, MemoryRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n MemoryRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<MemoryRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { MemoryRouter as Router }`.');\n };\n\n MemoryRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return MemoryRouter;\n}(React.Component);\n\nMemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n};\n\n\nexport default MemoryRouter;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\n\n/**\n * The public API for prompting the user before navigating away\n * from a screen with a component.\n */\n\nvar Prompt = function (_React$Component) {\n _inherits(Prompt, _React$Component);\n\n function Prompt() {\n _classCallCheck(this, Prompt);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Prompt.prototype.enable = function enable(message) {\n if (this.unblock) this.unblock();\n\n this.unblock = this.context.router.history.block(message);\n };\n\n Prompt.prototype.disable = function disable() {\n if (this.unblock) {\n this.unblock();\n this.unblock = null;\n }\n };\n\n Prompt.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, 'You should not use <Prompt> outside a <Router>');\n\n if (this.props.when) this.enable(this.props.message);\n };\n\n Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (nextProps.when) {\n if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);\n } else {\n this.disable();\n }\n };\n\n Prompt.prototype.componentWillUnmount = function componentWillUnmount() {\n this.disable();\n };\n\n Prompt.prototype.render = function render() {\n return null;\n };\n\n return Prompt;\n}(React.Component);\n\nPrompt.propTypes = {\n when: PropTypes.bool,\n message: PropTypes.oneOfType([PropTypes.func, PropTypes.string]).isRequired\n};\nPrompt.defaultProps = {\n when: true\n};\nPrompt.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n block: PropTypes.func.isRequired\n }).isRequired\n }).isRequired\n};\n\n\nexport default Prompt;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport { createLocation, locationsAreEqual } from 'history';\n\n/**\n * The public API for updating the location programmatically\n * with a component.\n */\n\nvar Redirect = function (_React$Component) {\n _inherits(Redirect, _React$Component);\n\n function Redirect() {\n _classCallCheck(this, Redirect);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Redirect.prototype.isStatic = function isStatic() {\n return this.context.router && this.context.router.staticContext;\n };\n\n Redirect.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, 'You should not use <Redirect> outside a <Router>');\n\n if (this.isStatic()) this.perform();\n };\n\n Redirect.prototype.componentDidMount = function componentDidMount() {\n if (!this.isStatic()) this.perform();\n };\n\n Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {\n var prevTo = createLocation(prevProps.to);\n var nextTo = createLocation(this.props.to);\n\n if (locationsAreEqual(prevTo, nextTo)) {\n warning(false, 'You tried to redirect to the same route you\\'re currently on: ' + ('\"' + nextTo.pathname + nextTo.search + '\"'));\n return;\n }\n\n this.perform();\n };\n\n Redirect.prototype.perform = function perform() {\n var history = this.context.router.history;\n var _props = this.props,\n push = _props.push,\n to = _props.to;\n\n\n if (push) {\n history.push(to);\n } else {\n history.replace(to);\n }\n };\n\n Redirect.prototype.render = function render() {\n return null;\n };\n\n return Redirect;\n}(React.Component);\n\nRedirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n};\nRedirect.defaultProps = {\n push: false\n};\nRedirect.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n push: PropTypes.func.isRequired,\n replace: PropTypes.func.isRequired\n }).isRequired,\n staticContext: PropTypes.object\n }).isRequired\n};\n\n\nexport default Redirect;","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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport matchPath from './matchPath';\n\nvar isEmptyChildren = function isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n};\n\n/**\n * The public API for matching a single path and rendering.\n */\n\nvar Route = function (_React$Component) {\n _inherits(Route, _React$Component);\n\n function Route() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Route);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n match: _this.computeMatch(_this.props, _this.context.router)\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Route.prototype.getChildContext = function getChildContext() {\n return {\n router: _extends({}, this.context.router, {\n route: {\n location: this.props.location || this.context.router.route.location,\n match: this.state.match\n }\n })\n };\n };\n\n Route.prototype.computeMatch = function computeMatch(_ref, router) {\n var computedMatch = _ref.computedMatch,\n location = _ref.location,\n path = _ref.path,\n strict = _ref.strict,\n exact = _ref.exact,\n sensitive = _ref.sensitive;\n\n if (computedMatch) return computedMatch; // <Switch> already computed the match for us\n\n invariant(router, 'You should not use <Route> or withRouter() outside a <Router>');\n\n var route = router.route;\n\n var pathname = (location || route.location).pathname;\n\n return path ? matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }) : route.match;\n };\n\n Route.prototype.componentWillMount = function componentWillMount() {\n warning(!(this.props.component && this.props.render), 'You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored');\n\n warning(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored');\n\n warning(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored');\n };\n\n Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {\n warning(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.');\n\n warning(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.');\n\n this.setState({\n match: this.computeMatch(nextProps, nextContext.router)\n });\n };\n\n Route.prototype.render = function render() {\n var match = this.state.match;\n var _props = this.props,\n children = _props.children,\n component = _props.component,\n render = _props.render;\n var _context$router = this.context.router,\n history = _context$router.history,\n route = _context$router.route,\n staticContext = _context$router.staticContext;\n\n var location = this.props.location || route.location;\n var props = { match: match, location: location, history: history, staticContext: staticContext };\n\n return component ? // component prop gets first priority, only called if there's a match\n match ? React.createElement(component, props) : null : render ? // render prop is next, only called if there's a match\n match ? render(props) : null : children ? // children come last, always called\n typeof children === 'function' ? children(props) : !isEmptyChildren(children) ? React.Children.only(children) : null : null;\n };\n\n return Route;\n}(React.Component);\n\nRoute.propTypes = {\n computedMatch: PropTypes.object, // private, from <Switch>\n path: PropTypes.string,\n exact: PropTypes.bool,\n strict: PropTypes.bool,\n sensitive: PropTypes.bool,\n component: PropTypes.func,\n render: PropTypes.func,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n location: PropTypes.object\n};\nRoute.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n })\n};\nRoute.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default Route;","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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\n/**\n * The public API for putting history on context.\n */\n\nvar Router = function (_React$Component) {\n _inherits(Router, _React$Component);\n\n function Router() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Router);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n match: _this.computeMatch(_this.props.history.location.pathname)\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Router.prototype.getChildContext = function getChildContext() {\n return {\n router: _extends({}, this.context.router, {\n history: this.props.history,\n route: {\n location: this.props.history.location,\n match: this.state.match\n }\n })\n };\n };\n\n Router.prototype.computeMatch = function computeMatch(pathname) {\n return {\n path: '/',\n url: '/',\n params: {},\n isExact: pathname === '/'\n };\n };\n\n Router.prototype.componentWillMount = function componentWillMount() {\n var _this2 = this;\n\n var _props = this.props,\n children = _props.children,\n history = _props.history;\n\n\n invariant(children == null || React.Children.count(children) === 1, 'A <Router> may have only one child element');\n\n // Do this here so we can setState when a <Redirect> changes the\n // location in componentWillMount. This happens e.g. when doing\n // server rendering using a <StaticRouter>.\n this.unlisten = history.listen(function () {\n _this2.setState({\n match: _this2.computeMatch(history.location.pathname)\n });\n });\n };\n\n Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n warning(this.props.history === nextProps.history, 'You cannot change <Router history>');\n };\n\n Router.prototype.componentWillUnmount = function componentWillUnmount() {\n this.unlisten();\n };\n\n Router.prototype.render = function render() {\n var children = this.props.children;\n\n return children ? React.Children.only(children) : null;\n };\n\n return Router;\n}(React.Component);\n\nRouter.propTypes = {\n history: PropTypes.object.isRequired,\n children: PropTypes.node\n};\nRouter.contextTypes = {\n router: PropTypes.object\n};\nRouter.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default Router;","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; };\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { addLeadingSlash, createPath, parsePath } from 'history/PathUtils';\nimport Router from './Router';\n\nvar normalizeLocation = function normalizeLocation(object) {\n var _object$pathname = object.pathname,\n pathname = _object$pathname === undefined ? '/' : _object$pathname,\n _object$search = object.search,\n search = _object$search === undefined ? '' : _object$search,\n _object$hash = object.hash,\n hash = _object$hash === undefined ? '' : _object$hash;\n\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nvar addBasename = function addBasename(basename, location) {\n if (!basename) return location;\n\n return _extends({}, location, {\n pathname: addLeadingSlash(basename) + location.pathname\n });\n};\n\nvar stripBasename = function stripBasename(basename, location) {\n if (!basename) return location;\n\n var base = addLeadingSlash(basename);\n\n if (location.pathname.indexOf(base) !== 0) return location;\n\n return _extends({}, location, {\n pathname: location.pathname.substr(base.length)\n });\n};\n\nvar createLocation = function createLocation(location) {\n return typeof location === 'string' ? parsePath(location) : normalizeLocation(location);\n};\n\nvar createURL = function createURL(location) {\n return typeof location === 'string' ? location : createPath(location);\n};\n\nvar staticHandler = function staticHandler(methodName) {\n return function () {\n invariant(false, 'You cannot %s with <StaticRouter>', methodName);\n };\n};\n\nvar noop = function noop() {};\n\n/**\n * The public top-level API for a \"static\" <Router>, so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\n\nvar StaticRouter = function (_React$Component) {\n _inherits(StaticRouter, _React$Component);\n\n function StaticRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, StaticRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {\n return addLeadingSlash(_this.props.basename + createURL(path));\n }, _this.handlePush = function (location) {\n var _this$props = _this.props,\n basename = _this$props.basename,\n context = _this$props.context;\n\n context.action = 'PUSH';\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }, _this.handleReplace = function (location) {\n var _this$props2 = _this.props,\n basename = _this$props2.basename,\n context = _this$props2.context;\n\n context.action = 'REPLACE';\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }, _this.handleListen = function () {\n return noop;\n }, _this.handleBlock = function () {\n return noop;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n StaticRouter.prototype.getChildContext = function getChildContext() {\n return {\n router: {\n staticContext: this.props.context\n }\n };\n };\n\n StaticRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<StaticRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { StaticRouter as Router }`.');\n };\n\n StaticRouter.prototype.render = function render() {\n var _props = this.props,\n basename = _props.basename,\n context = _props.context,\n location = _props.location,\n props = _objectWithoutProperties(_props, ['basename', 'context', 'location']);\n\n var history = {\n createHref: this.createHref,\n action: 'POP',\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler('go'),\n goBack: staticHandler('goBack'),\n goForward: staticHandler('goForward'),\n listen: this.handleListen,\n block: this.handleBlock\n };\n\n return React.createElement(Router, _extends({}, props, { history: history }));\n };\n\n return StaticRouter;\n}(React.Component);\n\nStaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object.isRequired,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n};\nStaticRouter.defaultProps = {\n basename: '',\n location: '/'\n};\nStaticRouter.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default StaticRouter;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport matchPath from './matchPath';\n\n/**\n * The public API for rendering the first <Route> that matches.\n */\n\nvar Switch = function (_React$Component) {\n _inherits(Switch, _React$Component);\n\n function Switch() {\n _classCallCheck(this, Switch);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Switch.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, 'You should not use <Switch> outside a <Router>');\n };\n\n Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n warning(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.');\n\n warning(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.');\n };\n\n Switch.prototype.render = function render() {\n var route = this.context.router.route;\n var children = this.props.children;\n\n var location = this.props.location || route.location;\n\n var match = void 0,\n child = void 0;\n React.Children.forEach(children, function (element) {\n if (!React.isValidElement(element)) return;\n\n var _element$props = element.props,\n pathProp = _element$props.path,\n exact = _element$props.exact,\n strict = _element$props.strict,\n sensitive = _element$props.sensitive,\n from = _element$props.from;\n\n var path = pathProp || from;\n\n if (match == null) {\n child = element;\n match = path ? matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }) : route.match;\n }\n });\n\n return match ? React.cloneElement(child, { location: location, computedMatch: match }) : null;\n };\n\n return Switch;\n}(React.Component);\n\nSwitch.contextTypes = {\n router: PropTypes.shape({\n route: PropTypes.object.isRequired\n }).isRequired\n};\nSwitch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n};\n\n\nexport default Switch;","import pathToRegexp from 'path-to-regexp';\n\nvar patternCache = {};\nvar cacheLimit = 10000;\nvar cacheCount = 0;\n\nvar compilePath = function compilePath(pattern, options) {\n var cacheKey = '' + options.end + options.strict + options.sensitive;\n var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});\n\n if (cache[pattern]) return cache[pattern];\n\n var keys = [];\n var re = pathToRegexp(pattern, keys, options);\n var compiledPattern = { re: re, keys: keys };\n\n if (cacheCount < cacheLimit) {\n cache[pattern] = compiledPattern;\n cacheCount++;\n }\n\n return compiledPattern;\n};\n\n/**\n * Public API for matching a URL pathname to a path pattern.\n */\nvar matchPath = function matchPath(pathname) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (typeof options === 'string') options = { path: options };\n\n var _options = options,\n _options$path = _options.path,\n path = _options$path === undefined ? '/' : _options$path,\n _options$exact = _options.exact,\n exact = _options$exact === undefined ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === undefined ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === undefined ? false : _options$sensitive;\n\n var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),\n re = _compilePath.re,\n keys = _compilePath.keys;\n\n var match = re.exec(pathname);\n\n if (!match) return null;\n\n var url = match[0],\n values = match.slice(1);\n\n var isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path: path, // the path pattern used to match\n url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL\n isExact: isExact, // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n};\n\nexport default matchPath;","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; };\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport hoistStatics from 'hoist-non-react-statics';\nimport Route from './Route';\n\n/**\n * A public higher-order component to access the imperative API\n */\nvar withRouter = function withRouter(Component) {\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']);\n\n return React.createElement(Route, { render: function render(routeComponentProps) {\n return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef }));\n } });\n };\n\n C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';\n C.WrappedComponent = Component;\n C.propTypes = {\n wrappedComponentRef: PropTypes.func\n };\n\n return hoistStatics(C, Component);\n};\n\nexport default withRouter;","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n","var isarray = require('isarray')\n\n/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = options && options.delimiter || '/'\n var res\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n continue\n }\n\n var next = str[index]\n var prefix = res[2]\n var name = res[3]\n var capture = res[4]\n var group = res[5]\n var modifier = res[6]\n var asterisk = res[7]\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n }\n\n var partial = prefix != null && next != null && next !== prefix\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var delimiter = res[2] || defaultDelimiter\n var pattern = capture || group\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n })\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index)\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path)\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options))\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n })\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n var strict = options.strict\n var end = options.end !== false\n var route = ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var prefix = escapeString(token.prefix)\n var capture = '(?:' + token.pattern + ')'\n\n keys.push(token)\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*'\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?'\n } else {\n capture = prefix + '(' + capture + ')?'\n }\n } else {\n capture = prefix + '(' + capture + ')'\n }\n\n route += capture\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/')\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'\n }\n\n if (end) {\n route += '$'\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\n","module.exports = require('./lib/_stream_duplex.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = require('isarray');\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}","'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","module.exports = require('events').EventEmitter;\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","module.exports = require('./readable').PassThrough\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","module.exports = require('./readable').Transform\n","module.exports = require('./lib/_stream_writable.js');\n","'use strict';\n\nexports.__esModule = true;\nfunction createThunkMiddleware(extraArgument) {\n return function (_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n if (typeof action === 'function') {\n return action(dispatch, getState, extraArgument);\n }\n\n return next(action);\n };\n };\n };\n}\n\nvar thunk = createThunkMiddleware();\nthunk.withExtraArgument = createThunkMiddleware;\n\nexports['default'] = thunk;","import $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar ActionTypes = {\n INIT: '@@redux/INIT' + Math.random().toString(36).substring(7).split('').join('.'),\n REPLACE: '@@redux/REPLACE' + Math.random().toString(36).substring(7).split('').join('.')\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) return false;\n\n var proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.REPLACE });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if ((typeof observer === 'undefined' ? 'undefined' : _typeof(observer)) !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && 'action \"' + String(actionType) + '\"' || 'an action';\n\n return 'Given ' + actionDescription + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if ((typeof actionCreators === 'undefined' ? 'undefined' : _typeof(actionCreators)) !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators === 'undefined' ? 'undefined' : _typeof(actionCreators)) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nfunction compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var store = createStore.apply(undefined, args);\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(undefined, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning(\"You are currently using minified code outside of NODE_ENV === 'production'. \" + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { createStore, combineReducers, bindActionCreators, applyMiddleware, compose, ActionTypes as __DO_NOT_USE__ActionTypes };\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n","module.exports = {\n framer: require('./src/framer.js'),\n windows: require('./src/windows.js')\n};\n","/*===========================================================================*\\\n * Framer for breaking a U-Law ByteBuffer or Array into windows of a particular\n * size at an arbitrary step.\n *\n * (c) Vail Systems. Joshua Jung and Ben Bryan. 2015\n\\*===========================================================================*/\nvar Framer = function (options) {\n options = options || {};\n\n this.frameIx = 0;\n this.frameSize = options.frameSize || 64;\n this.frameStep = options.frameStep|| this.frameSize;\n this.map = options.map || undefined;\n this.scale = options.scale || undefined;\n this.offset = options.offset ? options.offset : 0;\n this.sampleType = options.sampleType || 'UInt8';\n this.wordSize = options.wordSize || 1;\n};\n\nFramer.prototype = {\n /**\n * Frames a buffer of single-byte char values or an array of Numbers into windows of the specified size.\n */\n frame: function(bufferOrArray, callback) {\n var self = this,\n ix = this.offset,\n frame = [],\n isArray = Object.prototype.toString.call( bufferOrArray) === '[object Array]';\n\n self.frameIx = 0;\n\n while (ix < bufferOrArray.length) {\n var value = isArray ? bufferOrArray[ix] : bufferOrArray['read' + self.sampleType](ix); \n\n frame.push(this.map ? this.map[value] : value);\n\n if (frame.length == this.frameSize || ix+self.wordSize == bufferOrArray.length) finishFrame(frame);\n\n ix += self.wordSize;\n }\n\n // Did we not process any frames at all for some reason?\n if (this.frameIx == 0) callback(undefined);\n\n function finishFrame(frame) {\n if (this.scale) frame = frame.map(function (s, ix) {return s * self.scale[ix];});\n\n callback(frame, self.frameIx);\n\n if (ix != bufferOrArray.length - self.wordSize)\n {\n ix -= (self.frameSize - self.frameStep) * self.wordSize;\n\n self.frameIx++;\n frame.length = 0;\n }\n }\n }\n};\n\nmodule.exports = Framer;\n","/*===========================================================================*\\\n * Method for producing the coefficients for windowing functions of an\n * arbitrary length.\n *\n * (c) Vail Systems. Joshua Jung and Ben Bryan. 2015\n\\*===========================================================================*/\nmodule.exports = {\n construct: function (type, sampleCount, alpha) {\n var coef = [];\n switch (type)\n {\n case 'ham': \n for (var i = 0; i < sampleCount; i++) {\n coef[i] = 0.54 - 0.46 * Math.cos((2 * Math.PI * i)/(sampleCount - 1));\n }\n break;\n case 'tukey':\n var sm1 = sampleCount - 1,\n asm1 = alpha * sm1;\n for (var i = 0; i < sampleCount; i++) {\n // Left tail\n if (i < asm1 / 2)\n coef[i] = 0.5 * (1 + Math.cos(Math.PI * ((2 * sampleCount)/(asm1) - 1))); \n // Right tail\n else if (i > (sm1 * (1 - alpha / 2)))\n coef[i] = 0.5 * (1 + Math.cos(Math.PI * ((2 * sampleCount)/(asm1) - (2 / alpha) + 1)));\n // Middle (rectangular)\n else coef[i] = 1;\n }\n break;\n case 'rectangular':\n for (var i = 0; i < sampleCount; i++)\n coef[i] = 1.0;\n break;\n }\n return coef;\n }\n};\n","/* global window, exports, define */\n\n!function() {\n 'use strict'\n\n var re = {\n not_string: /[^s]/,\n not_bool: /[^t]/,\n not_type: /[^T]/,\n not_primitive: /[^v]/,\n number: /[diefg]/,\n numeric_arg: /[bcdiefguxX]/,\n json: /[j]/,\n not_json: /[^j]/,\n text: /^[^\\x25]+/,\n modulo: /^\\x25{2}/,\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\n key: /^([a-z_][a-z_\\d]*)/i,\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\n index_access: /^\\[(\\d+)\\]/,\n sign: /^[\\+\\-]/\n }\n\n function sprintf(key) {\n // `arguments` is not an array, but should be fine for this call\n return sprintf_format(sprintf_parse(key), arguments)\n }\n\n function vsprintf(fmt, argv) {\n return sprintf.apply(null, [fmt].concat(argv || []))\n }\n\n function sprintf_format(parse_tree, argv) {\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, match, pad, pad_character, pad_length, is_positive, sign\n for (i = 0; i < tree_length; i++) {\n if (typeof parse_tree[i] === 'string') {\n output += parse_tree[i]\n }\n else if (Array.isArray(parse_tree[i])) {\n match = parse_tree[i] // convenience purposes only\n if (match[2]) { // keyword argument\n arg = argv[cursor]\n for (k = 0; k < match[2].length; k++) {\n if (!arg.hasOwnProperty(match[2][k])) {\n throw new Error(sprintf('[sprintf] property \"%s\" does not exist', match[2][k]))\n }\n arg = arg[match[2][k]]\n }\n }\n else if (match[1]) { // positional argument (explicit)\n arg = argv[match[1]]\n }\n else { // positional argument (implicit)\n arg = argv[cursor++]\n }\n\n if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && arg instanceof Function) {\n arg = arg()\n }\n\n if (re.numeric_arg.test(match[8]) && (typeof arg !== 'number' && isNaN(arg))) {\n throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))\n }\n\n if (re.number.test(match[8])) {\n is_positive = arg >= 0\n }\n\n switch (match[8]) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)\n break\n case 'e':\n arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)\n break\n case 'g':\n arg = match[7] ? String(Number(arg.toPrecision(match[7]))) : parseFloat(arg)\n break\n case 'o':\n arg = (parseInt(arg, 10) >>> 0).toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'T':\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'x':\n arg = (parseInt(arg, 10) >>> 0).toString(16)\n break\n case 'X':\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n break\n }\n if (re.json.test(match[8])) {\n output += arg\n }\n else {\n if (re.number.test(match[8]) && (!is_positive || match[3])) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '\n pad_length = match[6] - (sign + arg).length\n pad = match[6] ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n output += match[5] ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output\n }\n\n var sprintf_cache = Object.create(null)\n\n function sprintf_parse(fmt) {\n if (sprintf_cache[fmt]) {\n return sprintf_cache[fmt]\n }\n\n var _fmt = fmt, match, parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree.push(match[0])\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree.push('%')\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n }\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n }\n parse_tree.push(match)\n }\n else {\n throw new SyntaxError('[sprintf] unexpected placeholder')\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return sprintf_cache[fmt] = parse_tree\n }\n\n /**\n * export to either browser or node.js\n */\n /* eslint-disable quote-props */\n if (typeof exports !== 'undefined') {\n exports['sprintf'] = sprintf\n exports['vsprintf'] = vsprintf\n }\n if (typeof window !== 'undefined') {\n window['sprintf'] = sprintf\n window['vsprintf'] = vsprintf\n\n if (typeof define === 'function' && define['amd']) {\n define(function() {\n return {\n 'sprintf': sprintf,\n 'vsprintf': vsprintf\n }\n })\n }\n }\n /* eslint-enable quote-props */\n}()\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n 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':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","(function(root, factory){\n\n\t//UMD\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\tdefine(function() {\n\t\t\treturn factory();\n\t\t});\n\t} else if (typeof module === \"object\") {\n\t\tmodule.exports = factory();\n \t} else {\n\t\troot.Tone = factory();\n\t}\n\n}(this, function(){\n\n\t\"use strict\";\n\t\n\tvar Tone;\n\t//constructs the main Tone object\n\tfunction Main(func){\n\t\tTone = func();\n\t}\n\t//invokes each of the modules with the main Tone object as the argument\n\tfunction Module(func){\n\t\tfunc(Tone);\n\t}\t/**\n\t * Tone.js\n\t * @author Yotam Mann\n\t * @license http://opensource.org/licenses/MIT MIT License\n\t * @copyright 2014-2018 Yotam Mann\n\t */\n\tMain(function () {\n\t \n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTONE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * @class Tone is the base class of all other classes.\n\t\t * @constructor\n\t\t */\n\t var Tone = function () {\n\t if (!(this instanceof Tone)) {\n\t throw new Error('constructor needs to be called with the \\'new\\' keyword');\n\t }\n\t };\n\t /**\n\t\t * @memberOf Tone#\n\t\t * @returns {String} returns the name of the class as a string\n\t\t */\n\t Tone.prototype.toString = function () {\n\t for (var className in Tone) {\n\t var isLetter = className[0].match(/^[A-Z]$/);\n\t var sameConstructor = Tone[className] === this.constructor;\n\t if (Tone.isFunction(Tone[className]) && isLetter && sameConstructor) {\n\t return className;\n\t }\n\t }\n\t return 'Tone';\n\t };\n\t /**\n\t\t * @memberOf Tone#\n\t\t * disconnect and dispose\n\t\t * @returns {Tone} this\n\t\t */\n\t Tone.prototype.dispose = function () {\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tGET/SET\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Set the parameters at once. Either pass in an\n\t\t * object mapping parameters to values, or to set a\n\t\t * single parameter, by passing in a string and value.\n\t\t * The last argument is an optional ramp time which\n\t\t * will ramp any signal values to their destination value\n\t\t * over the duration of the rampTime.\n\t\t * @param {Object|String} params\n\t\t * @param {Number=} value\n\t\t * @param {Time=} rampTime\n\t\t * @returns {Tone} this\n\t\t * @memberOf Tone#\n\t\t * @example\n\t\t * //set values using an object\n\t\t * filter.set({\n\t\t * \t\"frequency\" : 300,\n\t\t * \t\"type\" : highpass\n\t\t * });\n\t\t * @example\n\t\t * filter.set(\"type\", \"highpass\");\n\t\t * @example\n\t\t * //ramp to the value 220 over 3 seconds.\n\t\t * oscillator.set({\n\t\t * \t\"frequency\" : 220\n\t\t * }, 3);\n\t\t */\n\t Tone.prototype.set = function (params, value, rampTime) {\n\t if (Tone.isObject(params)) {\n\t rampTime = value;\n\t } else if (Tone.isString(params)) {\n\t var tmpObj = {};\n\t tmpObj[params] = value;\n\t params = tmpObj;\n\t }\n\t paramLoop:\n\t for (var attr in params) {\n\t value = params[attr];\n\t var parent = this;\n\t if (attr.indexOf('.') !== -1) {\n\t var attrSplit = attr.split('.');\n\t for (var i = 0; i < attrSplit.length - 1; i++) {\n\t parent = parent[attrSplit[i]];\n\t if (parent instanceof Tone) {\n\t attrSplit.splice(0, i + 1);\n\t var innerParam = attrSplit.join('.');\n\t parent.set(innerParam, value);\n\t continue paramLoop;\n\t }\n\t }\n\t attr = attrSplit[attrSplit.length - 1];\n\t }\n\t var param = parent[attr];\n\t if (Tone.isUndef(param)) {\n\t continue;\n\t }\n\t if (Tone.Signal && param instanceof Tone.Signal || Tone.Param && param instanceof Tone.Param) {\n\t if (param.value !== value) {\n\t if (Tone.isUndef(rampTime)) {\n\t param.value = value;\n\t } else {\n\t param.rampTo(value, rampTime);\n\t }\n\t }\n\t } else if (param instanceof AudioParam) {\n\t if (param.value !== value) {\n\t param.value = value;\n\t }\n\t } else if (Tone.TimeBase && param instanceof Tone.TimeBase) {\n\t parent[attr] = value;\n\t } else if (param instanceof Tone) {\n\t param.set(value);\n\t } else if (param !== value) {\n\t parent[attr] = value;\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the object's attributes. Given no arguments get\n\t\t * will return all available object properties and their corresponding\n\t\t * values. Pass in a single attribute to retrieve or an array\n\t\t * of attributes. The attribute strings can also include a \".\"\n\t\t * to access deeper properties.\n\t\t * @memberOf Tone#\n\t\t * @example\n\t\t * osc.get();\n\t\t * //returns {\"type\" : \"sine\", \"frequency\" : 440, ...etc}\n\t\t * @example\n\t\t * osc.get(\"type\");\n\t\t * //returns { \"type\" : \"sine\"}\n\t\t * @example\n\t\t * //use dot notation to access deep properties\n\t\t * synth.get([\"envelope.attack\", \"envelope.release\"]);\n\t\t * //returns {\"envelope\" : {\"attack\" : 0.2, \"release\" : 0.4}}\n\t\t * @param {Array=|string|undefined} params the parameters to get, otherwise will return\n\t\t * \t\t\t\t\t all available.\n\t\t * @returns {Object}\n\t\t */\n\t Tone.prototype.get = function (params) {\n\t if (Tone.isUndef(params)) {\n\t params = this._collectDefaults(this.constructor);\n\t } else if (Tone.isString(params)) {\n\t params = [params];\n\t }\n\t var ret = {};\n\t for (var i = 0; i < params.length; i++) {\n\t var attr = params[i];\n\t var parent = this;\n\t var subRet = ret;\n\t if (attr.indexOf('.') !== -1) {\n\t var attrSplit = attr.split('.');\n\t for (var j = 0; j < attrSplit.length - 1; j++) {\n\t var subAttr = attrSplit[j];\n\t subRet[subAttr] = subRet[subAttr] || {};\n\t subRet = subRet[subAttr];\n\t parent = parent[subAttr];\n\t }\n\t attr = attrSplit[attrSplit.length - 1];\n\t }\n\t var param = parent[attr];\n\t if (Tone.isObject(params[attr])) {\n\t subRet[attr] = param.get();\n\t } else if (Tone.Signal && param instanceof Tone.Signal) {\n\t subRet[attr] = param.value;\n\t } else if (Tone.Param && param instanceof Tone.Param) {\n\t subRet[attr] = param.value;\n\t } else if (param instanceof AudioParam) {\n\t subRet[attr] = param.value;\n\t } else if (param instanceof Tone) {\n\t subRet[attr] = param.get();\n\t } else if (!Tone.isFunction(param) && Tone.isDefined(param)) {\n\t subRet[attr] = param;\n\t }\n\t }\n\t return ret;\n\t };\n\t /**\n\t\t * collect all of the default attributes in one\n\t\t * @private\n\t\t * @param {Function} constr the constructor to find the defaults from\n\t\t * @return {Array} all of the attributes which belong to the class\n\t\t */\n\t Tone.prototype._collectDefaults = function (constr) {\n\t var ret = [];\n\t if (Tone.isDefined(constr.defaults)) {\n\t ret = Object.keys(constr.defaults);\n\t }\n\t if (Tone.isDefined(constr._super)) {\n\t var superDefs = this._collectDefaults(constr._super);\n\t //filter out repeats\n\t for (var i = 0; i < superDefs.length; i++) {\n\t if (ret.indexOf(superDefs[i]) === -1) {\n\t ret.push(superDefs[i]);\n\t }\n\t }\n\t }\n\t return ret;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tDEFAULTS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * @memberOf Tone\n\t\t * @param {Array} values The arguments array\n\t\t * @param {Array} keys The names of the arguments\n\t\t * @param {Function|Object} constr The class constructor\n\t\t * @return {Object} An object composed of the defaults between the class' defaults\n\t\t * and the passed in arguments.\n\t\t */\n\t Tone.defaults = function (values, keys, constr) {\n\t var options = {};\n\t if (values.length === 1 && Tone.isObject(values[0])) {\n\t options = values[0];\n\t } else {\n\t for (var i = 0; i < keys.length; i++) {\n\t options[keys[i]] = values[i];\n\t }\n\t }\n\t if (Tone.isDefined(constr.defaults)) {\n\t return Tone.defaultArg(options, constr.defaults);\n\t } else if (Tone.isObject(constr)) {\n\t return Tone.defaultArg(options, constr);\n\t } else {\n\t return options;\n\t }\n\t };\n\t /**\n\t\t * If the `given` parameter is undefined, use the `fallback`.\n\t\t * If both `given` and `fallback` are object literals, it will\n\t\t * return a deep copy which includes all of the parameters from both\n\t\t * objects. If a parameter is undefined in given, it will return\n\t\t * the fallback property.\n\t\t * <br><br>\n\t\t * WARNING: if object is self referential, it will go into an an\n\t\t * infinite recursive loop.\n\t\t * @memberOf Tone\n\t\t * @param {*} given\n\t\t * @param {*} fallback\n\t\t * @return {*}\n\t\t */\n\t Tone.defaultArg = function (given, fallback) {\n\t if (Tone.isObject(given) && Tone.isObject(fallback)) {\n\t var ret = {};\n\t //make a deep copy of the given object\n\t for (var givenProp in given) {\n\t ret[givenProp] = Tone.defaultArg(fallback[givenProp], given[givenProp]);\n\t }\n\t for (var fallbackProp in fallback) {\n\t ret[fallbackProp] = Tone.defaultArg(given[fallbackProp], fallback[fallbackProp]);\n\t }\n\t return ret;\n\t } else {\n\t return Tone.isUndef(given) ? fallback : given;\n\t }\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tCONNECTIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * connect together all of the arguments in series\n\t\t * @param {...AudioParam|Tone|AudioNode} nodes\n\t\t * @returns {Tone}\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t */\n\t Tone.connectSeries = function () {\n\t var currentUnit = arguments[0];\n\t for (var i = 1; i < arguments.length; i++) {\n\t var toUnit = arguments[i];\n\t currentUnit.connect(toUnit);\n\t currentUnit = toUnit;\n\t }\n\t return Tone;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // TYPE CHECKING\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Test if the arg is undefined\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is undefined\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isUndef = function (val) {\n\t return typeof val === 'undefined';\n\t };\n\t /**\n\t\t * Test if the arg is not undefined\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is undefined\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isDefined = function (val) {\n\t return !Tone.isUndef(val);\n\t };\n\t /**\n\t\t * Test if the arg is a function\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a function\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isFunction = function (val) {\n\t return typeof val === 'function';\n\t };\n\t /**\n\t\t * Test if the argument is a number.\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a number\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isNumber = function (arg) {\n\t return typeof arg === 'number';\n\t };\n\t /**\n\t\t * Test if the given argument is an object literal (i.e. `{}`);\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is an object literal.\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isObject = function (arg) {\n\t return Object.prototype.toString.call(arg) === '[object Object]' && arg.constructor === Object;\n\t };\n\t /**\n\t\t * Test if the argument is a boolean.\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a boolean\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isBoolean = function (arg) {\n\t return typeof arg === 'boolean';\n\t };\n\t /**\n\t\t * Test if the argument is an Array\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is an array\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isArray = function (arg) {\n\t return Array.isArray(arg);\n\t };\n\t /**\n\t\t * Test if the argument is a string.\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a string\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isString = function (arg) {\n\t return typeof arg === 'string';\n\t };\n\t /**\n\t\t * Test if the argument is in the form of a note in scientific pitch notation.\n\t\t * e.g. \"C4\"\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a string\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isNote = function (arg) {\n\t return Tone.isString(arg) && /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(arg);\n\t };\n\t /**\n\t\t * An empty function.\n\t\t * @static\n\t\t */\n\t Tone.noOp = function () {\n\t };\n\t /**\n\t\t * Make the property not writable. Internal use only.\n\t\t * @private\n\t\t * @param {String} property the property to make not writable\n\t\t */\n\t Tone.prototype._readOnly = function (property) {\n\t if (Array.isArray(property)) {\n\t for (var i = 0; i < property.length; i++) {\n\t this._readOnly(property[i]);\n\t }\n\t } else {\n\t Object.defineProperty(this, property, {\n\t writable: false,\n\t enumerable: true\n\t });\n\t }\n\t };\n\t /**\n\t\t * Make an attribute writeable. Interal use only.\n\t\t * @private\n\t\t * @param {String} property the property to make writable\n\t\t */\n\t Tone.prototype._writable = function (property) {\n\t if (Array.isArray(property)) {\n\t for (var i = 0; i < property.length; i++) {\n\t this._writable(property[i]);\n\t }\n\t } else {\n\t Object.defineProperty(this, property, { writable: true });\n\t }\n\t };\n\t /**\n\t\t * Possible play states.\n\t\t * @enum {String}\n\t\t */\n\t Tone.State = {\n\t Started: 'started',\n\t Stopped: 'stopped',\n\t Paused: 'paused'\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Equal power gain scale. Good for cross-fading.\n\t\t * @param {NormalRange} percent (0-1)\n\t\t * @return {Number} output gain (0-1)\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.equalPowerScale = function (percent) {\n\t var piFactor = 0.5 * Math.PI;\n\t return Math.sin(percent * piFactor);\n\t };\n\t /**\n\t\t * Convert decibels into gain.\n\t\t * @param {Decibels} db\n\t\t * @return {Number}\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.dbToGain = function (db) {\n\t return Math.pow(10, db / 20);\n\t };\n\t /**\n\t\t * Convert gain to decibels.\n\t\t * @param {Number} gain (0-1)\n\t\t * @return {Decibels}\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.gainToDb = function (gain) {\n\t return 20 * (Math.log(gain) / Math.LN10);\n\t };\n\t /**\n\t\t * Convert an interval (in semitones) to a frequency ratio.\n\t\t * @param {Interval} interval the number of semitones above the base note\n\t\t * @return {Number} the frequency ratio\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t * @example\n\t\t * tone.intervalToFrequencyRatio(0); // 1\n\t\t * tone.intervalToFrequencyRatio(12); // 2\n\t\t * tone.intervalToFrequencyRatio(-12); // 0.5\n\t\t */\n\t Tone.intervalToFrequencyRatio = function (interval) {\n\t return Math.pow(2, interval / 12);\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTIMING\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Return the current time of the AudioContext clock.\n\t\t * @return {Number} the currentTime from the AudioContext\n\t\t * @memberOf Tone#\n\t\t */\n\t Tone.prototype.now = function () {\n\t return Tone.context.now();\n\t };\n\t /**\n\t\t * Return the current time of the AudioContext clock.\n\t\t * @return {Number} the currentTime from the AudioContext\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.now = function () {\n\t return Tone.context.now();\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tINHERITANCE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * have a child inherit all of Tone's (or a parent's) prototype\n\t\t * to inherit the parent's properties, make sure to call\n\t\t * Parent.call(this) in the child's constructor\n\t\t *\n\t\t * based on closure library's inherit function\n\t\t *\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @param {Function} \tchild\n\t\t * @param {Function=} parent (optional) parent to inherit from\n\t\t * if no parent is supplied, the child\n\t\t * will inherit from Tone\n\t\t */\n\t Tone.extend = function (child, parent) {\n\t if (Tone.isUndef(parent)) {\n\t parent = Tone;\n\t }\n\t function TempConstructor() {\n\t }\n\t TempConstructor.prototype = parent.prototype;\n\t child.prototype = new TempConstructor();\n\t /** @override */\n\t child.prototype.constructor = child;\n\t child._super = parent;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tCONTEXT\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Private reference to the global AudioContext\n\t\t * @type {AudioContext}\n\t\t * @private\n\t\t */\n\t var audioContext = null;\n\t /**\n\t\t * A static pointer to the audio context accessible as Tone.context.\n\t\t * @type {Tone.Context}\n\t\t * @name context\n\t\t * @memberOf Tone\n\t\t */\n\t Object.defineProperty(Tone, 'context', {\n\t get: function () {\n\t return audioContext;\n\t },\n\t set: function (context) {\n\t if (Tone.Context && context instanceof Tone.Context) {\n\t audioContext = context;\n\t } else {\n\t audioContext = new Tone.Context(context);\n\t }\n\t //initialize the new audio context\n\t Tone.Context.emit('init', audioContext);\n\t }\n\t });\n\t /**\n\t\t * The AudioContext\n\t\t * @type {Tone.Context}\n\t\t * @name context\n\t\t * @memberOf Tone#\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.prototype, 'context', {\n\t get: function () {\n\t return Tone.context;\n\t }\n\t });\n\t /**\n\t\t * Tone automatically creates a context on init, but if you are working\n\t\t * with other libraries which also create an AudioContext, it can be\n\t\t * useful to set your own. If you are going to set your own context,\n\t\t * be sure to do it at the start of your code, before creating any objects.\n\t\t * @static\n\t\t * @param {AudioContext} ctx The new audio context to set\n\t\t */\n\t Tone.setContext = function (ctx) {\n\t Tone.context = ctx;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tATTRIBUTES\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * The number of seconds of 1 processing block (128 samples)\n\t\t * @type {Number}\n\t\t * @name blockTime\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.prototype, 'blockTime', {\n\t get: function () {\n\t return 128 / this.context.sampleRate;\n\t }\n\t });\n\t /**\n\t\t * The duration in seconds of one sample.\n\t\t * @type {Number}\n\t\t * @name sampleTime\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.prototype, 'sampleTime', {\n\t get: function () {\n\t return 1 / this.context.sampleRate;\n\t }\n\t });\n\t /**\n\t\t * Whether or not all the technologies that Tone.js relies on are supported by the current browser.\n\t\t * @type {Boolean}\n\t\t * @name supported\n\t\t * @memberOf Tone\n\t\t * @readOnly\n\t\t * @static\n\t\t */\n\t Object.defineProperty(Tone, 'supported', {\n\t get: function () {\n\t var hasAudioContext = window.hasOwnProperty('AudioContext') || window.hasOwnProperty('webkitAudioContext');\n\t var hasPromises = window.hasOwnProperty('Promise');\n\t var hasWorkers = window.hasOwnProperty('Worker');\n\t return hasAudioContext && hasPromises && hasWorkers;\n\t }\n\t });\n\t /**\n\t\t * Boolean value if the audio context has been initialized.\n\t\t * @type {Boolean}\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @name initialized\n\t\t */\n\t Object.defineProperty(Tone, 'initialized', {\n\t get: function () {\n\t return audioContext !== null;\n\t }\n\t });\n\t /**\n\t\t * Get the context when it becomes available\n\t\t * @param {Function} resolve Callback when the context is initialized\n\t\t * @return {Tone}\n\t\t */\n\t Tone.getContext = function (resolve) {\n\t if (Tone.initialized) {\n\t resolve(Tone.context);\n\t } else {\n\t var resCallback = function () {\n\t resolve(Tone.context);\n\t Tone.Context.off('init', resCallback);\n\t };\n\t Tone.Context.on('init', resCallback);\n\t }\n\t return Tone;\n\t };\n\t /**\n\t\t * The version number\n\t\t * @type {String}\n\t\t * @static\n\t\t */\n\t Tone.version = 'r12';\n\t return Tone;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Emitter gives classes which extend it\n\t\t * the ability to listen for and emit events.\n\t\t * Inspiration and reference from Jerome Etienne's [MicroEvent](https://github.com/jeromeetienne/microevent.js).\n\t\t * MIT (c) 2011 Jerome Etienne.\n\t\t *\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.Emitter = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * Contains all of the events.\n\t\t\t * @private\n\t\t\t * @type {Object}\n\t\t\t */\n\t this._events = {};\n\t };\n\t Tone.extend(Tone.Emitter);\n\t /**\n\t\t * Bind a callback to a specific event.\n\t\t * @param {String} event The name of the event to listen for.\n\t\t * @param {Function} callback The callback to invoke when the\n\t\t * event is emitted\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.on = function (event, callback) {\n\t //split the event\n\t var events = event.split(/\\W+/);\n\t for (var i = 0; i < events.length; i++) {\n\t var eventName = events[i];\n\t if (!this._events.hasOwnProperty(eventName)) {\n\t this._events[eventName] = [];\n\t }\n\t this._events[eventName].push(callback);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Bind a callback which is only invoked once\n\t\t * @param {String} event The name of the event to listen for.\n\t\t * @param {Function} callback The callback to invoke when the\n\t\t * event is emitted\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.once = function (event, callback) {\n\t var boundCallback = function () {\n\t //invoke the callback\n\t callback.apply(this, arguments);\n\t this.off(event, boundCallback);\n\t }.bind(this);\n\t this.on(event, boundCallback);\n\t return this;\n\t };\n\t /**\n\t\t * Remove the event listener.\n\t\t * @param {String} event The event to stop listening to.\n\t\t * @param {Function=} callback The callback which was bound to\n\t\t * the event with Tone.Emitter.on.\n\t\t * If no callback is given, all callbacks\n\t\t * events are removed.\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.off = function (event, callback) {\n\t var events = event.split(/\\W+/);\n\t for (var ev = 0; ev < events.length; ev++) {\n\t event = events[ev];\n\t if (this._events.hasOwnProperty(event)) {\n\t if (Tone.isUndef(callback)) {\n\t this._events[event] = [];\n\t } else {\n\t var eventList = this._events[event];\n\t for (var i = 0; i < eventList.length; i++) {\n\t if (eventList[i] === callback) {\n\t eventList.splice(i, 1);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Invoke all of the callbacks bound to the event\n\t\t * with any arguments passed in.\n\t\t * @param {String} event The name of the event.\n\t\t * @param {*} args... The arguments to pass to the functions listening.\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.emit = function (event) {\n\t if (this._events) {\n\t var args = Array.apply(null, arguments).slice(1);\n\t if (this._events.hasOwnProperty(event)) {\n\t var eventList = this._events[event].slice(0);\n\t for (var i = 0, len = eventList.length; i < len; i++) {\n\t eventList[i].apply(this, args);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Add Emitter functions (on/off/emit) to the object\n\t\t * @param {Object|Function} object The object or class to extend.\n\t\t * @returns {Tone.Emitter}\n\t\t */\n\t Tone.Emitter.mixin = function (object) {\n\t var functions = [\n\t 'on',\n\t 'once',\n\t 'off',\n\t 'emit'\n\t ];\n\t object._events = {};\n\t for (var i = 0; i < functions.length; i++) {\n\t var func = functions[i];\n\t var emitterFunc = Tone.Emitter.prototype[func];\n\t object[func] = emitterFunc;\n\t }\n\t return Tone.Emitter;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this._events = null;\n\t return this;\n\t };\n\t return Tone.Emitter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A Timeline class for scheduling and maintaining state\n\t\t * along a timeline. All events must have a \"time\" property.\n\t\t * Internally, events are stored in time order for fast\n\t\t * retrieval.\n\t\t * @extends {Tone}\n\t\t * @param {Positive} [memory=Infinity] The number of previous events that are retained.\n\t\t */\n\t Tone.Timeline = function () {\n\t var options = Tone.defaults(arguments, ['memory'], Tone.Timeline);\n\t Tone.call(this);\n\t /**\n\t\t\t * The array of scheduled timeline events\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._timeline = [];\n\t /**\n\t\t\t * The memory of the timeline, i.e.\n\t\t\t * how many events in the past it will retain\n\t\t\t * @type {Positive}\n\t\t\t */\n\t this.memory = options.memory;\n\t };\n\t Tone.extend(Tone.Timeline);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Timeline.defaults = { 'memory': Infinity };\n\t /**\n\t\t * The number of items in the timeline.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Timeline#\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Timeline.prototype, 'length', {\n\t get: function () {\n\t return this._timeline.length;\n\t }\n\t });\n\t /**\n\t\t * Insert an event object onto the timeline. Events must have a \"time\" attribute.\n\t\t * @param {Object} event The event object to insert into the\n\t\t * timeline.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.add = function (event) {\n\t //the event needs to have a time attribute\n\t if (Tone.isUndef(event.time)) {\n\t throw new Error('Tone.Timeline: events must have a time attribute');\n\t }\n\t event.time = event.time.valueOf();\n\t var index = this._search(event.time);\n\t this._timeline.splice(index + 1, 0, event);\n\t //if the length is more than the memory, remove the previous ones\n\t if (this.length > this.memory) {\n\t var diff = this.length - this.memory;\n\t this._timeline.splice(0, diff);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Remove an event from the timeline.\n\t\t * @param {Object} event The event object to remove from the list.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.remove = function (event) {\n\t var index = this._timeline.indexOf(event);\n\t if (index !== -1) {\n\t this._timeline.splice(index, 1);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the nearest event whose time is less than or equal to the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @returns {Object} The event object set after that time.\n\t\t */\n\t Tone.Timeline.prototype.get = function (time, comparator) {\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var index = this._search(time, comparator);\n\t if (index !== -1) {\n\t return this._timeline[index];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Return the first event in the timeline without removing it\n\t\t * @returns {Object} The first event object\n\t\t */\n\t Tone.Timeline.prototype.peek = function () {\n\t return this._timeline[0];\n\t };\n\t /**\n\t\t * Return the first event in the timeline and remove it\n\t\t * @returns {Object} The first event object\n\t\t */\n\t Tone.Timeline.prototype.shift = function () {\n\t return this._timeline.shift();\n\t };\n\t /**\n\t\t * Get the event which is scheduled after the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @returns {Object} The event object after the given time\n\t\t */\n\t Tone.Timeline.prototype.getAfter = function (time, comparator) {\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var index = this._search(time, comparator);\n\t if (index + 1 < this._timeline.length) {\n\t return this._timeline[index + 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Get the event before the event at the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @returns {Object} The event object before the given time\n\t\t */\n\t Tone.Timeline.prototype.getBefore = function (time, comparator) {\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var len = this._timeline.length;\n\t //if it's after the last item, return the last item\n\t if (len > 0 && this._timeline[len - 1][comparator] < time) {\n\t return this._timeline[len - 1];\n\t }\n\t var index = this._search(time, comparator);\n\t if (index - 1 >= 0) {\n\t return this._timeline[index - 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Cancel events after the given time\n\t\t * @param {Number} time The time to query.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.cancel = function (after) {\n\t if (this._timeline.length > 1) {\n\t var index = this._search(after);\n\t if (index >= 0) {\n\t if (this._timeline[index].time === after) {\n\t //get the first item with that time\n\t for (var i = index; i >= 0; i--) {\n\t if (this._timeline[i].time === after) {\n\t index = i;\n\t } else {\n\t break;\n\t }\n\t }\n\t this._timeline = this._timeline.slice(0, index);\n\t } else {\n\t this._timeline = this._timeline.slice(0, index + 1);\n\t }\n\t } else {\n\t this._timeline = [];\n\t }\n\t } else if (this._timeline.length === 1) {\n\t //the first item's time\n\t if (this._timeline[0].time >= after) {\n\t this._timeline = [];\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel events before or equal to the given time.\n\t\t * @param {Number} time The time to cancel before.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.cancelBefore = function (time) {\n\t var index = this._search(time);\n\t if (index >= 0) {\n\t this._timeline = this._timeline.slice(index + 1);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Returns the previous event if there is one. null otherwise\n\t\t * @param {Object} event The event to find the previous one of\n\t\t * @return {Object} The event right before the given event\n\t\t */\n\t Tone.Timeline.prototype.previousEvent = function (event) {\n\t var index = this._timeline.indexOf(event);\n\t if (index > 0) {\n\t return this._timeline[index - 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Does a binary search on the timeline array and returns the\n\t\t * nearest event index whose time is after or equal to the given time.\n\t\t * If a time is searched before the first index in the timeline, -1 is returned.\n\t\t * If the time is after the end, the index of the last item is returned.\n\t\t * @param {Number} time\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @return {Number} the index in the timeline array\n\t\t * @private\n\t\t */\n\t Tone.Timeline.prototype._search = function (time, comparator) {\n\t if (this._timeline.length === 0) {\n\t return -1;\n\t }\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var beginning = 0;\n\t var len = this._timeline.length;\n\t var end = len;\n\t if (len > 0 && this._timeline[len - 1][comparator] <= time) {\n\t return len - 1;\n\t }\n\t while (beginning < end) {\n\t // calculate the midpoint for roughly equal partition\n\t var midPoint = Math.floor(beginning + (end - beginning) / 2);\n\t var event = this._timeline[midPoint];\n\t var nextEvent = this._timeline[midPoint + 1];\n\t if (event[comparator] === time) {\n\t //choose the last one that has the same time\n\t for (var i = midPoint; i < this._timeline.length; i++) {\n\t var testEvent = this._timeline[i];\n\t if (testEvent[comparator] === time) {\n\t midPoint = i;\n\t }\n\t }\n\t return midPoint;\n\t } else if (event[comparator] < time && nextEvent[comparator] > time) {\n\t return midPoint;\n\t } else if (event[comparator] > time) {\n\t //search lower\n\t end = midPoint;\n\t } else {\n\t //search upper\n\t beginning = midPoint + 1;\n\t }\n\t }\n\t return -1;\n\t };\n\t /**\n\t\t * Internal iterator. Applies extra safety checks for\n\t\t * removing items from the array.\n\t\t * @param {Function} callback\n\t\t * @param {Number=} lowerBound\n\t\t * @param {Number=} upperBound\n\t\t * @private\n\t\t */\n\t Tone.Timeline.prototype._iterate = function (callback, lowerBound, upperBound) {\n\t lowerBound = Tone.defaultArg(lowerBound, 0);\n\t upperBound = Tone.defaultArg(upperBound, this._timeline.length - 1);\n\t this._timeline.slice(lowerBound, upperBound + 1).forEach(function (event) {\n\t callback.call(this, event);\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Iterate over everything in the array\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEach = function (callback) {\n\t this._iterate(callback);\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array at or before the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachBefore = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var upperBound = this._search(time);\n\t if (upperBound !== -1) {\n\t this._iterate(callback, 0, upperBound);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array after the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachAfter = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var lowerBound = this._search(time);\n\t this._iterate(callback, lowerBound + 1);\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array between the startTime and endTime. \n\t\t * The timerange is inclusive of the startTime, but exclusive of the endTime. \n\t\t * range = [startTime, endTime). \n\t\t * @param {Number} startTime The time to check if items are before\n\t\t * @param {Number} endTime The end of the test interval. \n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachBetween = function (startTime, endTime, callback) {\n\t var lowerBound = this._search(startTime);\n\t var upperBound = this._search(endTime);\n\t if (lowerBound !== -1 && upperBound !== -1) {\n\t if (this._timeline[lowerBound].time !== startTime) {\n\t lowerBound += 1;\n\t }\n\t //exclusive of the end time\n\t if (this._timeline[upperBound].time === endTime) {\n\t upperBound -= 1;\n\t }\n\t this._iterate(callback, lowerBound, upperBound);\n\t } else if (lowerBound === -1) {\n\t this._iterate(callback, 0, upperBound);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array at or after the given time. Similar to\n\t\t * forEachAfter, but includes the item(s) at the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachFrom = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var lowerBound = this._search(time);\n\t //work backwards until the event time is less than time\n\t while (lowerBound >= 0 && this._timeline[lowerBound].time >= time) {\n\t lowerBound--;\n\t }\n\t this._iterate(callback, lowerBound + 1);\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array at the given time\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachAtTime = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var upperBound = this._search(time);\n\t if (upperBound !== -1) {\n\t this._iterate(function (event) {\n\t if (event.time === time) {\n\t callback.call(this, event);\n\t }\n\t }, 0, upperBound);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this._timeline = null;\n\t return this;\n\t };\n\t return Tone.Timeline;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t if (!window.hasOwnProperty('OfflineAudioContext') && window.hasOwnProperty('webkitOfflineAudioContext')) {\n\t window.OfflineAudioContext = window.webkitOfflineAudioContext;\n\t }\n\t //returns promise?\n\t var context = new OfflineAudioContext(1, 1, 44100);\n\t var ret = context.startRendering();\n\t if (!(ret instanceof Promise)) {\n\t OfflineAudioContext.prototype._native_startRendering = OfflineAudioContext.prototype.startRendering;\n\t OfflineAudioContext.prototype.startRendering = function () {\n\t return new Promise(function (done) {\n\t this.oncomplete = function (e) {\n\t done(e.renderedBuffer);\n\t };\n\t this._native_startRendering();\n\t }.bind(this));\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t if (!window.hasOwnProperty('AudioContext') && window.hasOwnProperty('webkitAudioContext')) {\n\t window.AudioContext = window.webkitAudioContext;\n\t }\n\t //not functionally equivalent, but only an API placeholder\n\t if (!AudioContext.prototype.close) {\n\t AudioContext.prototype.close = function () {\n\t if (Tone.isFunction(this.suspend)) {\n\t this.suspend();\n\t }\n\t return Promise.resolve();\n\t };\n\t }\n\t //not functionally equivalent\n\t if (!AudioContext.prototype.resume) {\n\t AudioContext.prototype.resume = function () {\n\t return Promise.resolve();\n\t };\n\t }\n\t //createGain\n\t if (!AudioContext.prototype.createGain && AudioContext.prototype.createGainNode) {\n\t AudioContext.prototype.createGain = AudioContext.prototype.createGainNode;\n\t }\n\t //createDelay\n\t if (!AudioContext.prototype.createDelay && AudioContext.prototype.createDelayNode) {\n\t AudioContext.prototype.createDelay = AudioContext.prototype.createDelayNode;\n\t }\n\t //test decodeAudioData returns a promise\n\t // https://github.com/mohayonao/web-audio-api-shim/blob/master/src/AudioContext.js\n\t // MIT License (c) 2015 @mohayonao\n\t var decodeAudioDataPromise = false;\n\t var offlineContext = new OfflineAudioContext(1, 1, 44100);\n\t var audioData = new Uint32Array([\n\t 1179011410,\n\t 48,\n\t 1163280727,\n\t 544501094,\n\t 16,\n\t 131073,\n\t 44100,\n\t 176400,\n\t 1048580,\n\t 1635017060,\n\t 8,\n\t 0,\n\t 0,\n\t 0,\n\t 0\n\t ]).buffer;\n\t try {\n\t var ret = offlineContext.decodeAudioData(audioData);\n\t if (ret instanceof Promise) {\n\t decodeAudioDataPromise = true;\n\t }\n\t } catch (e) {\n\t decodeAudioDataPromise = false;\n\t }\n\t if (!decodeAudioDataPromise) {\n\t AudioContext.prototype._native_decodeAudioData = AudioContext.prototype.decodeAudioData;\n\t AudioContext.prototype.decodeAudioData = function (audioData) {\n\t return new Promise(function (success, error) {\n\t this._native_decodeAudioData(audioData, success, error);\n\t }.bind(this));\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the native AudioContext.\n\t\t * @extends {Tone.Emitter}\n\t\t * @param {AudioContext=} context optionally pass in a context\n\t\t */\n\t Tone.Context = function () {\n\t Tone.Emitter.call(this);\n\t var options = Tone.defaults(arguments, ['context'], Tone.Context);\n\t if (!options.context) {\n\t options.context = new window.AudioContext();\n\t if (!options.context) {\n\t throw new Error('could not create AudioContext. Possibly too many AudioContexts running already.');\n\t }\n\t }\n\t this._context = options.context;\n\t // extend all of the methods\n\t for (var prop in this._context) {\n\t this._defineProperty(this._context, prop);\n\t }\n\t /**\n\t\t\t * The default latency hint\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._latencyHint = options.latencyHint;\n\t /**\n\t\t\t * An object containing all of the constants AudioBufferSourceNodes\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._constants = {};\n\t ///////////////////////////////////////////////////////////////////////\n\t // WORKER\n\t ///////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t * The amount of time events are scheduled\n\t\t\t * into the future\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.lookAhead = options.lookAhead;\n\t /**\n\t\t\t * A reference to the actual computed update interval\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._computedUpdateInterval = 0;\n\t /**\n\t\t\t * A reliable callback method\n\t\t\t * @private\n\t\t\t * @type {Ticker}\n\t\t\t */\n\t this._ticker = new Ticker(this.emit.bind(this, 'tick'), options.clockSource, options.updateInterval);\n\t ///////////////////////////////////////////////////////////////////////\n\t // TIMEOUTS\n\t ///////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t * All of the setTimeout events.\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._timeouts = new Tone.Timeline();\n\t /**\n\t\t\t * The timeout id counter\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._timeoutIds = 0;\n\t this.on('tick', this._timeoutLoop.bind(this));\n\t };\n\t Tone.extend(Tone.Context, Tone.Emitter);\n\t Tone.Emitter.mixin(Tone.Context);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Context.defaults = {\n\t 'clockSource': 'worker',\n\t 'latencyHint': 'interactive',\n\t 'lookAhead': 0.1,\n\t 'updateInterval': 0.03\n\t };\n\t /**\n\t\t * Define a property on this Tone.Context.\n\t\t * This is used to extend the native AudioContext\n\t\t * @param {AudioContext} context\n\t\t * @param {String} prop\n\t\t * @private\n\t\t */\n\t Tone.Context.prototype._defineProperty = function (context, prop) {\n\t if (Tone.isUndef(this[prop])) {\n\t Object.defineProperty(this, prop, {\n\t get: function () {\n\t if (typeof context[prop] === 'function') {\n\t return context[prop].bind(context);\n\t } else {\n\t return context[prop];\n\t }\n\t },\n\t set: function (val) {\n\t context[prop] = val;\n\t }\n\t });\n\t }\n\t };\n\t /**\n\t\t * The current audio context time\n\t\t * @return {Number}\n\t\t */\n\t Tone.Context.prototype.now = function () {\n\t return this._context.currentTime + this.lookAhead;\n\t };\n\t /**\n\t\t * Promise which is invoked when the context is running.\n\t\t * Tries to resume the context if it's not started.\n\t\t * @return {Promise}\n\t\t */\n\t Tone.Context.prototype.ready = function () {\n\t return new Promise(function (done) {\n\t if (this._context.state === 'running') {\n\t done();\n\t } else {\n\t this._context.resume().then(function () {\n\t done();\n\t });\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Promise which is invoked when the context is running.\n\t\t * Tries to resume the context if it's not started.\n\t\t * @return {Promise}\n\t\t */\n\t Tone.Context.prototype.close = function () {\n\t return this._context.close().then(function () {\n\t Tone.Context.emit('close', this);\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Generate a looped buffer at some constant value.\n\t\t * @param {Number} val\n\t\t * @return {BufferSourceNode}\n\t\t */\n\t Tone.Context.prototype.getConstant = function (val) {\n\t if (this._constants[val]) {\n\t return this._constants[val];\n\t } else {\n\t var buffer = this._context.createBuffer(1, 128, this._context.sampleRate);\n\t var arr = buffer.getChannelData(0);\n\t for (var i = 0; i < arr.length; i++) {\n\t arr[i] = val;\n\t }\n\t var constant = this._context.createBufferSource();\n\t constant.channelCount = 1;\n\t constant.channelCountMode = 'explicit';\n\t constant.buffer = buffer;\n\t constant.loop = true;\n\t constant.start(0);\n\t this._constants[val] = constant;\n\t return constant;\n\t }\n\t };\n\t /**\n\t\t * The private loop which keeps track of the context scheduled timeouts\n\t\t * Is invoked from the clock source\n\t\t * @private\n\t\t */\n\t Tone.Context.prototype._timeoutLoop = function () {\n\t var now = this.now();\n\t while (this._timeouts && this._timeouts.length && this._timeouts.peek().time <= now) {\n\t this._timeouts.shift().callback();\n\t }\n\t };\n\t /**\n\t\t * A setTimeout which is gaurenteed by the clock source.\n\t\t * Also runs in the offline context.\n\t\t * @param {Function} fn The callback to invoke\n\t\t * @param {Seconds} timeout The timeout in seconds\n\t\t * @returns {Number} ID to use when invoking Tone.Context.clearTimeout\n\t\t */\n\t Tone.Context.prototype.setTimeout = function (fn, timeout) {\n\t this._timeoutIds++;\n\t var now = this.now();\n\t this._timeouts.add({\n\t callback: fn,\n\t time: now + timeout,\n\t id: this._timeoutIds\n\t });\n\t return this._timeoutIds;\n\t };\n\t /**\n\t\t * Clears a previously scheduled timeout with Tone.context.setTimeout\n\t\t * @param {Number} id The ID returned from setTimeout\n\t\t * @return {Tone.Context} this\n\t\t */\n\t Tone.Context.prototype.clearTimeout = function (id) {\n\t this._timeouts.forEach(function (event) {\n\t if (event.id === id) {\n\t this.remove(event);\n\t }\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * How often the Web Worker callback is invoked.\n\t\t * This number corresponds to how responsive the scheduling\n\t\t * can be. Context.updateInterval + Context.lookAhead gives you the\n\t\t * total latency between scheduling an event and hearing it.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Context#\n\t\t * @name updateInterval\n\t\t */\n\t Object.defineProperty(Tone.Context.prototype, 'updateInterval', {\n\t get: function () {\n\t return this._ticker.updateInterval;\n\t },\n\t set: function (interval) {\n\t this._ticker.updateInterval = interval;\n\t }\n\t });\n\t /**\n\t\t * What the source of the clock is, either \"worker\" (Web Worker [default]),\n\t\t * \"timeout\" (setTimeout), or \"offline\" (none).\n\t\t * @type {String}\n\t\t * @memberOf Tone.Context#\n\t\t * @name clockSource\n\t\t */\n\t Object.defineProperty(Tone.Context.prototype, 'clockSource', {\n\t get: function () {\n\t return this._ticker.type;\n\t },\n\t set: function (type) {\n\t this._ticker.type = type;\n\t }\n\t });\n\t /**\n\t\t * The type of playback, which affects tradeoffs between audio\n\t\t * output latency and responsiveness.\n\t\t *\n\t\t * In addition to setting the value in seconds, the latencyHint also\n\t\t * accepts the strings \"interactive\" (prioritizes low latency),\n\t\t * \"playback\" (prioritizes sustained playback), \"balanced\" (balances\n\t\t * latency and performance), and \"fastest\" (lowest latency, might glitch more often).\n\t\t * @type {String|Seconds}\n\t\t * @memberOf Tone.Context#\n\t\t * @name latencyHint\n\t\t * @example\n\t\t * //set the lookAhead to 0.3 seconds\n\t\t * Tone.context.latencyHint = 0.3;\n\t\t */\n\t Object.defineProperty(Tone.Context.prototype, 'latencyHint', {\n\t get: function () {\n\t return this._latencyHint;\n\t },\n\t set: function (hint) {\n\t var lookAhead = hint;\n\t this._latencyHint = hint;\n\t if (Tone.isString(hint)) {\n\t switch (hint) {\n\t case 'interactive':\n\t lookAhead = 0.1;\n\t this._context.latencyHint = hint;\n\t break;\n\t case 'playback':\n\t lookAhead = 0.8;\n\t this._context.latencyHint = hint;\n\t break;\n\t case 'balanced':\n\t lookAhead = 0.25;\n\t this._context.latencyHint = hint;\n\t break;\n\t case 'fastest':\n\t this._context.latencyHint = 'interactive';\n\t lookAhead = 0.01;\n\t break;\n\t }\n\t }\n\t this.lookAhead = lookAhead;\n\t this.updateInterval = lookAhead / 3;\n\t }\n\t });\n\t /**\n\t\t * Unlike other dispose methods, this returns a Promise\n\t\t * which executes when the context is closed and disposed\n\t\t * @returns {Promise} this\n\t\t */\n\t Tone.Context.prototype.dispose = function () {\n\t return this.close().then(function () {\n\t Tone.Emitter.prototype.dispose.call(this);\n\t this._ticker.dispose();\n\t this._ticker = null;\n\t this._timeouts.dispose();\n\t this._timeouts = null;\n\t for (var con in this._constants) {\n\t this._constants[con].disconnect();\n\t }\n\t this._constants = null;\n\t }.bind(this));\n\t };\n\t /**\n\t\t * @class A class which provides a reliable callback using either\n\t\t * a Web Worker, or if that isn't supported, falls back to setTimeout.\n\t\t * @private\n\t\t */\n\t var Ticker = function (callback, type, updateInterval) {\n\t /**\n\t\t\t * Either \"worker\" or \"timeout\"\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._type = type;\n\t /**\n\t\t\t * The update interval of the worker\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._updateInterval = updateInterval;\n\t /**\n\t\t\t * The callback to invoke at regular intervals\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._callback = Tone.defaultArg(callback, Tone.noOp);\n\t //create the clock source for the first time\n\t this._createClock();\n\t };\n\t /**\n\t\t * The possible ticker types\n\t\t * @private\n\t\t * @type {Object}\n\t\t */\n\t Ticker.Type = {\n\t Worker: 'worker',\n\t Timeout: 'timeout',\n\t Offline: 'offline'\n\t };\n\t /**\n\t\t * Generate a web worker\n\t\t * @return {WebWorker}\n\t\t * @private\n\t\t */\n\t Ticker.prototype._createWorker = function () {\n\t //URL Shim\n\t window.URL = window.URL || window.webkitURL;\n\t var blob = new Blob([//the initial timeout time\n\t 'var timeoutTime = ' + (this._updateInterval * 1000).toFixed(1) + ';' + //onmessage callback\n\t 'self.onmessage = function(msg){' + '\\ttimeoutTime = parseInt(msg.data);' + '};' + //the tick function which posts a message\n\t //and schedules a new tick\n\t 'function tick(){' + '\\tsetTimeout(tick, timeoutTime);' + '\\tself.postMessage(\\'tick\\');' + '}' + //call tick initially\n\t 'tick();']);\n\t var blobUrl = URL.createObjectURL(blob);\n\t var worker = new Worker(blobUrl);\n\t worker.onmessage = this._callback.bind(this);\n\t this._worker = worker;\n\t };\n\t /**\n\t\t * Create a timeout loop\n\t\t * @private\n\t\t */\n\t Ticker.prototype._createTimeout = function () {\n\t this._timeout = setTimeout(function () {\n\t this._createTimeout();\n\t this._callback();\n\t }.bind(this), this._updateInterval * 1000);\n\t };\n\t /**\n\t\t * Create the clock source.\n\t\t * @private\n\t\t */\n\t Ticker.prototype._createClock = function () {\n\t if (this._type === Ticker.Type.Worker) {\n\t try {\n\t this._createWorker();\n\t } catch (e) {\n\t // workers not supported, fallback to timeout\n\t this._type = Ticker.Type.Timeout;\n\t this._createClock();\n\t }\n\t } else if (this._type === Ticker.Type.Timeout) {\n\t this._createTimeout();\n\t }\n\t };\n\t /**\n\t\t * @memberOf Ticker#\n\t\t * @type {Number}\n\t\t * @name updateInterval\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Ticker.prototype, 'updateInterval', {\n\t get: function () {\n\t return this._updateInterval;\n\t },\n\t set: function (interval) {\n\t this._updateInterval = Math.max(interval, 128 / 44100);\n\t if (this._type === Ticker.Type.Worker) {\n\t this._worker.postMessage(Math.max(interval * 1000, 1));\n\t }\n\t }\n\t });\n\t /**\n\t\t * The type of the ticker, either a worker or a timeout\n\t\t * @memberOf Ticker#\n\t\t * @type {Number}\n\t\t * @name type\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Ticker.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t this._disposeClock();\n\t this._type = type;\n\t this._createClock();\n\t }\n\t });\n\t /**\n\t\t * Clean up the current clock source\n\t\t * @private\n\t\t */\n\t Ticker.prototype._disposeClock = function () {\n\t if (this._timeout) {\n\t clearTimeout(this._timeout);\n\t this._timeout = null;\n\t }\n\t if (this._worker) {\n\t this._worker.terminate();\n\t this._worker.onmessage = null;\n\t this._worker = null;\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @private\n\t\t */\n\t Ticker.prototype.dispose = function () {\n\t this._disposeClock();\n\t this._callback = null;\n\t };\n\t /**\n\t\t * Shim all connect/disconnect and some deprecated methods which are still in\n\t\t * some older implementations.\n\t\t * @private\n\t\t */\n\t Tone.getContext(function () {\n\t var nativeConnect = AudioNode.prototype.connect;\n\t var nativeDisconnect = AudioNode.prototype.disconnect;\n\t //replace the old connect method\n\t function toneConnect(B, outNum, inNum) {\n\t if (B.input) {\n\t inNum = Tone.defaultArg(inNum, 0);\n\t if (Tone.isArray(B.input)) {\n\t return this.connect(B.input[inNum]);\n\t } else {\n\t return this.connect(B.input, outNum, inNum);\n\t }\n\t } else {\n\t try {\n\t if (B instanceof AudioNode) {\n\t nativeConnect.call(this, B, outNum, inNum);\n\t return B;\n\t } else {\n\t nativeConnect.call(this, B, outNum);\n\t return B;\n\t }\n\t } catch (e) {\n\t throw new Error('error connecting to node: ' + B + '\\n' + e);\n\t }\n\t }\n\t }\n\t //replace the old disconnect method\n\t function toneDisconnect(B, outNum, inNum) {\n\t if (B && B.input && Tone.isArray(B.input)) {\n\t inNum = Tone.defaultArg(inNum, 0);\n\t this.disconnect(B.input[inNum], outNum, 0);\n\t } else if (B && B.input) {\n\t this.disconnect(B.input, outNum, inNum);\n\t } else {\n\t try {\n\t nativeDisconnect.apply(this, arguments);\n\t } catch (e) {\n\t throw new Error('error disconnecting node: ' + B + '\\n' + e);\n\t }\n\t }\n\t }\n\t if (AudioNode.prototype.connect !== toneConnect) {\n\t AudioNode.prototype.connect = toneConnect;\n\t AudioNode.prototype.disconnect = toneDisconnect;\n\t }\n\t });\n\t // set the audio context initially, and if one is not already created\n\t if (Tone.supported && !Tone.initialized) {\n\t Tone.context = new Tone.Context();\n\t // log on first initialization\n\t // allow optional silencing of this log\n\t if (!window.TONE_SILENCE_VERSION_LOGGING) {\n\t // eslint-disable-next-line no-console\n\t console.log('%c * Tone.js ' + Tone.version + ' * ', 'background: #000; color: #fff');\n\t }\n\t } else if (!Tone.supported) {\n\t // eslint-disable-next-line no-console\n\t console.warn('This browser does not support Tone.js');\n\t }\n\t return Tone.Context;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.AudioNode is the base class for classes which process audio.\n\t\t * AudioNodes have inputs and outputs.\n\t\t * @param\t{AudioContext=} context\tThe audio context to use with the class\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.AudioNode = function () {\n\t Tone.call(this);\n\t //use the default context if one is not passed in\n\t var options = Tone.defaults(arguments, ['context'], { 'context': Tone.context });\n\t /**\n\t\t\t * The AudioContext of this instance\n\t\t\t * @private\n\t\t\t * @type {AudioContext}\n\t\t\t */\n\t this._context = options.context;\n\t };\n\t Tone.extend(Tone.AudioNode);\n\t /**\n\t\t * Get the audio context belonging to this instance.\n\t\t * @type {Tone.Context}\n\t\t * @memberOf Tone.AudioNode#\n\t\t * @name context\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'context', {\n\t get: function () {\n\t return this._context;\n\t }\n\t });\n\t /**\n\t\t * Create input and outputs for this object.\n\t\t * @param {Number} [input=0] The number of inputs\n\t\t * @param {Number} [outputs=0] The number of outputs\n\t\t * @return {Tone.AudioNode} this\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype.createInsOuts = function (inputs, outputs) {\n\t if (inputs === 1) {\n\t this.input = this.context.createGain();\n\t } else if (inputs > 1) {\n\t this.input = new Array(inputs);\n\t }\n\t if (outputs === 1) {\n\t this.output = this.context.createGain();\n\t } else if (outputs > 1) {\n\t this.output = new Array(outputs);\n\t }\n\t };\n\t /**\n\t\t * channelCount is the number of channels used when up-mixing and down-mixing\n\t\t * connections to any inputs to the node. The default value is 2 except for\n\t\t * specific nodes where its value is specially determined.\n\t\t *\n\t\t * @memberof Tone.AudioNode#\n\t\t * @type {Number}\n\t\t * @name channelCount\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'channelCount', {\n\t get: function () {\n\t return this.output.channelCount;\n\t },\n\t set: function (c) {\n\t return this.output.channelCount = c;\n\t }\n\t });\n\t /**\n\t\t * channelCountMode determines how channels will be counted when up-mixing and\n\t\t * down-mixing connections to any inputs to the node.\n\t\t * The default value is \"max\". This attribute has no effect for nodes with no inputs.\n\t\t * @memberof Tone.AudioNode#\n\t\t * @type {String}\n\t\t * @name channelCountMode\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'channelCountMode', {\n\t get: function () {\n\t return this.output.channelCountMode;\n\t },\n\t set: function (m) {\n\t return this.output.channelCountMode = m;\n\t }\n\t });\n\t /**\n\t\t * channelInterpretation determines how individual channels will be treated\n\t\t * when up-mixing and down-mixing connections to any inputs to the node.\n\t\t * The default value is \"speakers\".\n\t\t * @memberof Tone.AudioNode#\n\t\t * @type {String}\n\t\t * @name channelInterpretation\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'channelInterpretation', {\n\t get: function () {\n\t return this.output.channelInterpretation;\n\t },\n\t set: function (i) {\n\t return this.output.channelInterpretation = i;\n\t }\n\t });\n\t /**\n\t\t * The number of inputs feeding into the AudioNode.\n\t\t * For source nodes, this will be 0.\n\t\t * @type {Number}\n\t\t * @name numberOfInputs\n\t\t * @memberof Tone.AudioNode#\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'numberOfInputs', {\n\t get: function () {\n\t if (this.input) {\n\t if (Tone.isArray(this.input)) {\n\t return this.input.length;\n\t } else {\n\t return 1;\n\t }\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of outputs coming out of the AudioNode.\n\t\t * @type {Number}\n\t\t * @name numberOfOutputs\n\t\t * @memberof Tone.AudioNode#\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'numberOfOutputs', {\n\t get: function () {\n\t if (this.output) {\n\t if (Tone.isArray(this.output)) {\n\t return this.output.length;\n\t } else {\n\t return 1;\n\t }\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Called when an audio param connects to this node\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype._onConnect = function () {\n\t };\n\t /**\n\t\t * connect the output of a ToneNode to an AudioParam, AudioNode, or ToneNode\n\t\t * @param {Tone | AudioParam | AudioNode} unit\n\t\t * @param {number} [outputNum=0] optionally which output to connect from\n\t\t * @param {number} [inputNum=0] optionally which input to connect to\n\t\t * @returns {Tone.AudioNode} this\n\t\t */\n\t Tone.AudioNode.prototype.connect = function (unit, outputNum, inputNum) {\n\t if (unit._onConnect) {\n\t unit._onConnect(this);\n\t }\n\t if (Tone.isArray(this.output)) {\n\t outputNum = Tone.defaultArg(outputNum, 0);\n\t this.output[outputNum].connect(unit, 0, inputNum);\n\t } else {\n\t this.output.connect(unit, outputNum, inputNum);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * disconnect the output\n\t\t * @param {Number|AudioNode} output Either the output index to disconnect\n\t\t * if the output is an array, or the\n\t\t * node to disconnect from.\n\t\t * @returns {Tone.AudioNode} this\n\t\t */\n\t Tone.AudioNode.prototype.disconnect = function (destination, outputNum, inputNum) {\n\t if (Tone.isArray(this.output)) {\n\t if (Tone.isNumber(destination)) {\n\t this.output[destination].disconnect();\n\t } else {\n\t outputNum = Tone.defaultArg(outputNum, 0);\n\t this.output[outputNum].disconnect(destination, 0, inputNum);\n\t }\n\t } else {\n\t this.output.disconnect.apply(this.output, arguments);\n\t }\n\t };\n\t /**\n\t\t * Connect the output of this node to the rest of the nodes in series.\n\t\t * @example\n\t\t * //connect a node to an effect, panVol and then to the master output\n\t\t * node.chain(effect, panVol, Tone.Master);\n\t\t * @param {...AudioParam|Tone|AudioNode} nodes\n\t\t * @returns {Tone.AudioNode} this\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype.chain = function () {\n\t var currentUnit = this;\n\t for (var i = 0; i < arguments.length; i++) {\n\t var toUnit = arguments[i];\n\t currentUnit.connect(toUnit);\n\t currentUnit = toUnit;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * connect the output of this node to the rest of the nodes in parallel.\n\t\t * @param {...AudioParam|Tone|AudioNode} nodes\n\t\t * @returns {Tone.AudioNode} this\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype.fan = function () {\n\t for (var i = 0; i < arguments.length; i++) {\n\t this.connect(arguments[i]);\n\t }\n\t return this;\n\t };\n\t if (window.AudioNode) {\n\t //give native nodes chain and fan methods\n\t AudioNode.prototype.chain = Tone.AudioNode.prototype.chain;\n\t AudioNode.prototype.fan = Tone.AudioNode.prototype.fan;\n\t }\n\t /**\n\t\t * Dispose and disconnect\n\t\t * @return {Tone.AudioNode} this\n\t\t */\n\t Tone.AudioNode.prototype.dispose = function () {\n\t if (Tone.isDefined(this.input)) {\n\t if (this.input instanceof AudioNode) {\n\t this.input.disconnect();\n\t }\n\t this.input = null;\n\t }\n\t if (Tone.isDefined(this.output)) {\n\t if (this.output instanceof AudioNode) {\n\t this.output.disconnect();\n\t }\n\t this.output = null;\n\t }\n\t this._context = null;\n\t return this;\n\t };\n\t return Tone.AudioNode;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for all Signals. Used Internally.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.SignalBase = function () {\n\t Tone.AudioNode.call(this);\n\t };\n\t Tone.extend(Tone.SignalBase, Tone.AudioNode);\n\t /**\n\t\t * When signals connect to other signals or AudioParams,\n\t\t * they take over the output value of that signal or AudioParam.\n\t\t * For all other nodes, the behavior is the same as a default <code>connect</code>.\n\t\t *\n\t\t * @override\n\t\t * @param {AudioParam|AudioNode|Tone.Signal|Tone} node\n\t\t * @param {number} [outputNumber=0] The output number to connect from.\n\t\t * @param {number} [inputNumber=0] The input number to connect to.\n\t\t * @returns {Tone.SignalBase} this\n\t\t */\n\t Tone.SignalBase.prototype.connect = function (node, outputNumber, inputNumber) {\n\t //zero it out so that the signal can have full control\n\t if (Tone.Signal && Tone.Signal === node.constructor || Tone.Param && Tone.Param === node.constructor) {\n\t //cancel changes\n\t node._param.cancelScheduledValues(0);\n\t //reset the value\n\t node._param.value = 0;\n\t //mark the value as overridden\n\t node.overridden = true;\n\t } else if (node instanceof AudioParam) {\n\t node.cancelScheduledValues(0);\n\t node.value = 0;\n\t }\n\t Tone.AudioNode.prototype.connect.call(this, node, outputNumber, inputNumber);\n\t return this;\n\t };\n\t return Tone.SignalBase;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t //fixes safari only bug which is still present in 11\n\t var ua = navigator.userAgent.toLowerCase();\n\t var isSafari = ua.includes('safari') && !ua.includes('chrome');\n\t if (isSafari) {\n\t var WaveShaperNode = function (context) {\n\t this._internalNode = this.input = this.output = context._native_createWaveShaper();\n\t this._curve = null;\n\t for (var prop in this._internalNode) {\n\t this._defineProperty(this._internalNode, prop);\n\t }\n\t };\n\t Object.defineProperty(WaveShaperNode.prototype, 'curve', {\n\t get: function () {\n\t return this._curve;\n\t },\n\t set: function (curve) {\n\t this._curve = curve;\n\t var array = new Float32Array(curve.length + 1);\n\t array.set(curve, 1);\n\t array[0] = curve[0];\n\t this._internalNode.curve = array;\n\t }\n\t });\n\t WaveShaperNode.prototype._defineProperty = function (context, prop) {\n\t if (Tone.isUndef(this[prop])) {\n\t Object.defineProperty(this, prop, {\n\t get: function () {\n\t if (typeof context[prop] === 'function') {\n\t return context[prop].bind(context);\n\t } else {\n\t return context[prop];\n\t }\n\t },\n\t set: function (val) {\n\t context[prop] = val;\n\t }\n\t });\n\t }\n\t };\n\t AudioContext.prototype._native_createWaveShaper = AudioContext.prototype.createWaveShaper;\n\t AudioContext.prototype.createWaveShaper = function () {\n\t return new WaveShaperNode(this);\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Wraps the native Web Audio API\n\t\t * [WaveShaperNode](http://webaudio.github.io/web-audio-api/#the-waveshapernode-interface).\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @param {function|Array|Number} mapping The function used to define the values.\n\t\t * The mapping function should take two arguments:\n\t\t * the first is the value at the current position\n\t\t * and the second is the array position.\n\t\t * If the argument is an array, that array will be\n\t\t * set as the wave shaping function. The input\n\t\t * signal is an AudioRange [-1, 1] value and the output\n\t\t * signal can take on any numerical values.\n\t\t *\n\t\t * @param {Number} [bufferLen=1024] The length of the WaveShaperNode buffer.\n\t\t * @example\n\t\t * var timesTwo = new Tone.WaveShaper(function(val){\n\t\t * \treturn val * 2;\n\t\t * }, 2048);\n\t\t * @example\n\t\t * //a waveshaper can also be constructed with an array of values\n\t\t * var invert = new Tone.WaveShaper([1, -1]);\n\t\t */\n\t Tone.WaveShaper = function (mapping, bufferLen) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * the waveshaper\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._shaper = this.input = this.output = this.context.createWaveShaper();\n\t /**\n\t\t\t * the waveshapers curve\n\t\t\t * @type {Float32Array}\n\t\t\t * @private\n\t\t\t */\n\t this._curve = null;\n\t if (Array.isArray(mapping)) {\n\t this.curve = mapping;\n\t } else if (isFinite(mapping) || Tone.isUndef(mapping)) {\n\t this._curve = new Float32Array(Tone.defaultArg(mapping, 1024));\n\t } else if (Tone.isFunction(mapping)) {\n\t this._curve = new Float32Array(Tone.defaultArg(bufferLen, 1024));\n\t this.setMap(mapping);\n\t }\n\t };\n\t Tone.extend(Tone.WaveShaper, Tone.SignalBase);\n\t /**\n\t\t * Uses a mapping function to set the value of the curve.\n\t\t * @param {function} mapping The function used to define the values.\n\t\t * The mapping function take two arguments:\n\t\t * the first is the value at the current position\n\t\t * which goes from -1 to 1 over the number of elements\n\t\t * in the curve array. The second argument is the array position.\n\t\t * @returns {Tone.WaveShaper} this\n\t\t * @example\n\t\t * //map the input signal from [-1, 1] to [0, 10]\n\t\t * shaper.setMap(function(val, index){\n\t\t * \treturn (val + 1) * 5;\n\t\t * })\n\t\t */\n\t Tone.WaveShaper.prototype.setMap = function (mapping) {\n\t var array = new Array(this._curve.length);\n\t for (var i = 0, len = this._curve.length; i < len; i++) {\n\t var normalized = i / (len - 1) * 2 - 1;\n\t array[i] = mapping(normalized, i);\n\t }\n\t this.curve = array;\n\t return this;\n\t };\n\t /**\n\t\t * The array to set as the waveshaper curve. For linear curves\n\t\t * array length does not make much difference, but for complex curves\n\t\t * longer arrays will provide smoother interpolation.\n\t\t * @memberOf Tone.WaveShaper#\n\t\t * @type {Array}\n\t\t * @name curve\n\t\t */\n\t Object.defineProperty(Tone.WaveShaper.prototype, 'curve', {\n\t get: function () {\n\t return this._shaper.curve;\n\t },\n\t set: function (mapping) {\n\t this._curve = new Float32Array(mapping);\n\t this._shaper.curve = this._curve;\n\t }\n\t });\n\t /**\n\t\t * Specifies what type of oversampling (if any) should be used when\n\t\t * applying the shaping curve. Can either be \"none\", \"2x\" or \"4x\".\n\t\t * @memberOf Tone.WaveShaper#\n\t\t * @type {string}\n\t\t * @name oversample\n\t\t */\n\t Object.defineProperty(Tone.WaveShaper.prototype, 'oversample', {\n\t get: function () {\n\t return this._shaper.oversample;\n\t },\n\t set: function (oversampling) {\n\t if ([\n\t 'none',\n\t '2x',\n\t '4x'\n\t ].includes(oversampling)) {\n\t this._shaper.oversample = oversampling;\n\t } else {\n\t throw new RangeError('Tone.WaveShaper: oversampling must be either \\'none\\', \\'2x\\', or \\'4x\\'');\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.WaveShaper} this\n\t\t */\n\t Tone.WaveShaper.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._shaper.disconnect();\n\t this._shaper = null;\n\t this._curve = null;\n\t return this;\n\t };\n\t return Tone.WaveShaper;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TimeBase is a flexible encoding of time\n\t\t * which can be evaluated to and from a string.\n\t\t * @extends {Tone}\n\t\t * @param {Time} val The time value as a number or string\n\t\t * @param {String=} units Unit values\n\t\t * @example\n\t\t * Tone.TimeBase(4, \"n\")\n\t\t * Tone.TimeBase(2, \"t\")\n\t\t * Tone.TimeBase(\"2t\")\n\t\t * Tone.TimeBase(\"2t\") + Tone.TimeBase(\"4n\");\n\t\t */\n\t Tone.TimeBase = function (val, units) {\n\t //allows it to be constructed with or without 'new'\n\t if (this instanceof Tone.TimeBase) {\n\t /**\n\t\t\t\t * The value\n\t\t\t\t * @type {Number|String|Tone.TimeBase}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._val = val;\n\t /**\n\t\t\t\t * The units\n\t\t\t\t * @type {String?}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._units = units;\n\t //test if the value is a string representation of a number\n\t if (Tone.isUndef(this._units) && Tone.isString(this._val) && // eslint-disable-next-line eqeqeq\n\t parseFloat(this._val) == this._val && this._val.charAt(0) !== '+') {\n\t this._val = parseFloat(this._val);\n\t this._units = this._defaultUnits;\n\t } else if (val && val.constructor === this.constructor) {\n\t //if they're the same type, just copy values over\n\t this._val = val._val;\n\t this._units = val._units;\n\t } else if (val instanceof Tone.TimeBase) {\n\t switch (this._defaultUnits) {\n\t case 's':\n\t this._val = val.toSeconds();\n\t break;\n\t case 'i':\n\t this._val = val.toTicks();\n\t break;\n\t case 'hz':\n\t this._val = val.toFrequency();\n\t break;\n\t case 'midi':\n\t this._val = val.toMidi();\n\t break;\n\t default:\n\t throw new Error('Unrecognized default units ' + this._defaultUnits);\n\t }\n\t }\n\t } else {\n\t return new Tone.TimeBase(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.TimeBase);\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tABSTRACT SYNTAX TREE PARSER\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * All the primary expressions.\n\t\t * @private\n\t\t * @type {Object}\n\t\t */\n\t Tone.TimeBase.prototype._expressions = {\n\t 'n': {\n\t regexp: /^(\\d+)n(\\.?)$/i,\n\t method: function (value, dot) {\n\t value = parseInt(value);\n\t var scalar = dot === '.' ? 1.5 : 1;\n\t if (value === 1) {\n\t return this._beatsToUnits(this._getTimeSignature()) * scalar;\n\t } else {\n\t return this._beatsToUnits(4 / value) * scalar;\n\t }\n\t }\n\t },\n\t 't': {\n\t regexp: /^(\\d+)t$/i,\n\t method: function (value) {\n\t value = parseInt(value);\n\t return this._beatsToUnits(8 / (parseInt(value) * 3));\n\t }\n\t },\n\t 'm': {\n\t regexp: /^(\\d+)m$/i,\n\t method: function (value) {\n\t return this._beatsToUnits(parseInt(value) * this._getTimeSignature());\n\t }\n\t },\n\t 'i': {\n\t regexp: /^(\\d+)i$/i,\n\t method: function (value) {\n\t return this._ticksToUnits(parseInt(value));\n\t }\n\t },\n\t 'hz': {\n\t regexp: /^(\\d+(?:\\.\\d+)?)hz$/i,\n\t method: function (value) {\n\t return this._frequencyToUnits(parseFloat(value));\n\t }\n\t },\n\t 'tr': {\n\t regexp: /^(\\d+(?:\\.\\d+)?):(\\d+(?:\\.\\d+)?):?(\\d+(?:\\.\\d+)?)?$/,\n\t method: function (m, q, s) {\n\t var total = 0;\n\t if (m && m !== '0') {\n\t total += this._beatsToUnits(this._getTimeSignature() * parseFloat(m));\n\t }\n\t if (q && q !== '0') {\n\t total += this._beatsToUnits(parseFloat(q));\n\t }\n\t if (s && s !== '0') {\n\t total += this._beatsToUnits(parseFloat(s) / 4);\n\t }\n\t return total;\n\t }\n\t },\n\t 's': {\n\t regexp: /^(\\d+(?:\\.\\d+)?)s$/,\n\t method: function (value) {\n\t return this._secondsToUnits(parseFloat(value));\n\t }\n\t },\n\t 'samples': {\n\t regexp: /^(\\d+)samples$/,\n\t method: function (value) {\n\t return parseInt(value) / this.context.sampleRate;\n\t }\n\t },\n\t 'default': {\n\t regexp: /^(\\d+(?:\\.\\d+)?)$/,\n\t method: function (value) {\n\t return this._expressions[this._defaultUnits].method.call(this, value);\n\t }\n\t }\n\t };\n\t /**\n\t\t * The default units if none are given.\n\t\t * @type {String}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._defaultUnits = 's';\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTRANSPORT FALLBACKS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Return the bpm, or 120 if Transport is not available\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._getBpm = function () {\n\t if (Tone.Transport) {\n\t return Tone.Transport.bpm.value;\n\t } else {\n\t return 120;\n\t }\n\t };\n\t /**\n\t\t * Return the timeSignature or 4 if Transport is not available\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._getTimeSignature = function () {\n\t if (Tone.Transport) {\n\t return Tone.Transport.timeSignature;\n\t } else {\n\t return 4;\n\t }\n\t };\n\t /**\n\t\t * Return the PPQ or 192 if Transport is not available\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._getPPQ = function () {\n\t if (Tone.Transport) {\n\t return Tone.Transport.PPQ;\n\t } else {\n\t return 192;\n\t }\n\t };\n\t /**\n\t\t * Return the current time in whichever context is relevant\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._now = function () {\n\t return this.now();\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tUNIT CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Returns the value of a frequency in the current units\n\t\t * @param {Frequency} freq\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._frequencyToUnits = function (freq) {\n\t return 1 / freq;\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._beatsToUnits = function (beats) {\n\t return 60 / this._getBpm() * beats;\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._secondsToUnits = function (seconds) {\n\t return seconds;\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._ticksToUnits = function (ticks) {\n\t return ticks * (this._beatsToUnits(1) / this._getPPQ());\n\t };\n\t /**\n\t\t * With no arguments, return 'now'\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._noArg = function () {\n\t return this._now();\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tEXPRESSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Evaluate the time value. Returns the time\n\t\t * in seconds.\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.TimeBase.prototype.valueOf = function () {\n\t if (Tone.isUndef(this._val)) {\n\t return this._noArg();\n\t } else if (Tone.isString(this._val) && Tone.isUndef(this._units)) {\n\t for (var units in this._expressions) {\n\t if (this._expressions[units].regexp.test(this._val.trim())) {\n\t this._units = units;\n\t break;\n\t }\n\t }\n\t }\n\t if (Tone.isDefined(this._units)) {\n\t var expr = this._expressions[this._units];\n\t var matching = this._val.toString().trim().match(expr.regexp);\n\t if (matching) {\n\t return expr.method.apply(this, matching.slice(1));\n\t } else {\n\t return expr.method.call(this, parseFloat(this._val));\n\t }\n\t } else {\n\t return this._val;\n\t }\n\t };\n\t /**\n\t\t * Return the value in seconds\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.TimeBase.prototype.toSeconds = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the value in hertz\n\t\t * @return {Frequency}\n\t\t */\n\t Tone.TimeBase.prototype.toFrequency = function () {\n\t return 1 / this.toSeconds();\n\t };\n\t /**\n\t\t * Return the time in samples\n\t\t * @return {Samples}\n\t\t */\n\t Tone.TimeBase.prototype.toSamples = function () {\n\t return this.toSeconds() * this.context.sampleRate;\n\t };\n\t /**\n\t\t * Return the time in milliseconds.\n\t\t * @return {Milliseconds}\n\t\t */\n\t Tone.TimeBase.prototype.toMilliseconds = function () {\n\t return this.toSeconds() * 1000;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.TimeBase} this\n\t\t */\n\t Tone.TimeBase.prototype.dispose = function () {\n\t this._val = null;\n\t this._units = null;\n\t };\n\t return Tone.TimeBase;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Frequency is a primitive type for encoding Frequency values.\n\t\t * Eventually all time values are evaluated to hertz\n\t\t * using the `eval` method.\n\t\t * @constructor\n\t\t * @extends {Tone.TimeBase}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * Tone.Frequency(\"C3\") // 261\n\t\t * Tone.Frequency(38, \"midi\") //\n\t\t * Tone.Frequency(\"C3\").transpose(4);\n\t\t */\n\t Tone.Frequency = function (val, units) {\n\t if (this instanceof Tone.Frequency) {\n\t Tone.TimeBase.call(this, val, units);\n\t } else {\n\t return new Tone.Frequency(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Frequency, Tone.TimeBase);\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tAUGMENT BASE EXPRESSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t Tone.Frequency.prototype._expressions = Object.assign({}, Tone.TimeBase.prototype._expressions, {\n\t 'midi': {\n\t regexp: /^(\\d+(?:\\.\\d+)?midi)/,\n\t method: function (value) {\n\t if (this._defaultUnits === 'midi') {\n\t return value;\n\t } else {\n\t return Tone.Frequency.mtof(value);\n\t }\n\t }\n\t },\n\t 'note': {\n\t regexp: /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,\n\t method: function (pitch, octave) {\n\t var index = noteToScaleIndex[pitch.toLowerCase()];\n\t var noteNumber = index + (parseInt(octave) + 1) * 12;\n\t if (this._defaultUnits === 'midi') {\n\t return noteNumber;\n\t } else {\n\t return Tone.Frequency.mtof(noteNumber);\n\t }\n\t }\n\t },\n\t 'tr': {\n\t regexp: /^(\\d+(?:\\.\\d+)?):(\\d+(?:\\.\\d+)?):?(\\d+(?:\\.\\d+)?)?/,\n\t method: function (m, q, s) {\n\t var total = 1;\n\t if (m && m !== '0') {\n\t total *= this._beatsToUnits(this._getTimeSignature() * parseFloat(m));\n\t }\n\t if (q && q !== '0') {\n\t total *= this._beatsToUnits(parseFloat(q));\n\t }\n\t if (s && s !== '0') {\n\t total *= this._beatsToUnits(parseFloat(s) / 4);\n\t }\n\t return total;\n\t }\n\t }\n\t });\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tEXPRESSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Transposes the frequency by the given number of semitones.\n\t\t * @param {Interval} interval\n\t\t * @return {Tone.Frequency} A new transposed frequency\n\t\t * @example\n\t\t * Tone.Frequency(\"A4\").transpose(3); //\"C5\"\n\t\t */\n\t Tone.Frequency.prototype.transpose = function (interval) {\n\t return new this.constructor(this.valueOf() * Tone.intervalToFrequencyRatio(interval));\n\t };\n\t /**\n\t\t * Takes an array of semitone intervals and returns\n\t\t * an array of frequencies transposed by those intervals.\n\t\t * @param {Array} intervals\n\t\t * @return {Array<Tone.Frequency>} Returns an array of Frequencies\n\t\t * @example\n\t\t * Tone.Frequency(\"A4\").harmonize([0, 3, 7]); //[\"A4\", \"C5\", \"E5\"]\n\t\t */\n\t Tone.Frequency.prototype.harmonize = function (intervals) {\n\t return intervals.map(function (interval) {\n\t return this.transpose(interval);\n\t }.bind(this));\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tUNIT CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Return the value of the frequency as a MIDI note\n\t\t * @return {MIDI}\n\t\t * @example\n\t\t * Tone.Frequency(\"C4\").toMidi(); //60\n\t\t */\n\t Tone.Frequency.prototype.toMidi = function () {\n\t return Tone.Frequency.ftom(this.valueOf());\n\t };\n\t /**\n\t\t * Return the value of the frequency in Scientific Pitch Notation\n\t\t * @return {Note}\n\t\t * @example\n\t\t * Tone.Frequency(69, \"midi\").toNote(); //\"A4\"\n\t\t */\n\t Tone.Frequency.prototype.toNote = function () {\n\t var freq = this.toFrequency();\n\t var log = Math.log2(freq / Tone.Frequency.A4);\n\t var noteNumber = Math.round(12 * log) + 57;\n\t var octave = Math.floor(noteNumber / 12);\n\t if (octave < 0) {\n\t noteNumber += -12 * octave;\n\t }\n\t var noteName = scaleIndexToNote[noteNumber % 12];\n\t return noteName + octave.toString();\n\t };\n\t /**\n\t\t * Return the duration of one cycle in seconds.\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.Frequency.prototype.toSeconds = function () {\n\t return 1 / Tone.TimeBase.prototype.toSeconds.call(this);\n\t };\n\t /**\n\t\t * Return the value in Hertz\n\t\t * @return {Frequency}\n\t\t */\n\t Tone.Frequency.prototype.toFrequency = function () {\n\t return Tone.TimeBase.prototype.toFrequency.call(this);\n\t };\n\t /**\n\t\t * Return the duration of one cycle in ticks\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Frequency.prototype.toTicks = function () {\n\t var quarterTime = this._beatsToUnits(1);\n\t var quarters = this.valueOf() / quarterTime;\n\t return Math.floor(quarters * Tone.Transport.PPQ);\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tUNIT CONVERSIONS HELPERS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * With no arguments, return 0\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._noArg = function () {\n\t return 0;\n\t };\n\t /**\n\t\t * Returns the value of a frequency in the current units\n\t\t * @param {Frequency} freq\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._frequencyToUnits = function (freq) {\n\t return freq;\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._ticksToUnits = function (ticks) {\n\t return 1 / (ticks * 60 / (Tone.Transport.bpm.value * Tone.Transport.PPQ));\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._beatsToUnits = function (beats) {\n\t return 1 / Tone.TimeBase.prototype._beatsToUnits.call(this, beats);\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._secondsToUnits = function (seconds) {\n\t return 1 / seconds;\n\t };\n\t /**\n\t\t * The default units if none are given.\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._defaultUnits = 'hz';\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tFREQUENCY CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Note to scale index\n\t\t * @type {Object}\n\t\t */\n\t var noteToScaleIndex = {\n\t 'cbb': -2,\n\t 'cb': -1,\n\t 'c': 0,\n\t 'c#': 1,\n\t 'cx': 2,\n\t 'dbb': 0,\n\t 'db': 1,\n\t 'd': 2,\n\t 'd#': 3,\n\t 'dx': 4,\n\t 'ebb': 2,\n\t 'eb': 3,\n\t 'e': 4,\n\t 'e#': 5,\n\t 'ex': 6,\n\t 'fbb': 3,\n\t 'fb': 4,\n\t 'f': 5,\n\t 'f#': 6,\n\t 'fx': 7,\n\t 'gbb': 5,\n\t 'gb': 6,\n\t 'g': 7,\n\t 'g#': 8,\n\t 'gx': 9,\n\t 'abb': 7,\n\t 'ab': 8,\n\t 'a': 9,\n\t 'a#': 10,\n\t 'ax': 11,\n\t 'bbb': 9,\n\t 'bb': 10,\n\t 'b': 11,\n\t 'b#': 12,\n\t 'bx': 13\n\t };\n\t /**\n\t\t * scale index to note (sharps)\n\t\t * @type {Array}\n\t\t */\n\t var scaleIndexToNote = [\n\t 'C',\n\t 'C#',\n\t 'D',\n\t 'D#',\n\t 'E',\n\t 'F',\n\t 'F#',\n\t 'G',\n\t 'G#',\n\t 'A',\n\t 'A#',\n\t 'B'\n\t ];\n\t /**\n\t\t * The [concert pitch](https://en.wikipedia.org/wiki/Concert_pitch)\n\t\t * A4's values in Hertz.\n\t\t * @type {Frequency}\n\t\t * @static\n\t\t */\n\t Tone.Frequency.A4 = 440;\n\t /**\n\t\t * Convert a MIDI note to frequency value.\n\t\t * @param {MIDI} midi The midi number to convert.\n\t\t * @return {Frequency} the corresponding frequency value\n\t\t * @static\n\t\t * @example\n\t\t * Tone.Frequency.mtof(69); // returns 440\n\t\t */\n\t Tone.Frequency.mtof = function (midi) {\n\t return Tone.Frequency.A4 * Math.pow(2, (midi - 69) / 12);\n\t };\n\t /**\n\t\t * Convert a frequency value to a MIDI note.\n\t\t * @param {Frequency} frequency The value to frequency value to convert.\n\t\t * @returns {MIDI}\n\t\t * @static\n\t\t * @example\n\t\t * Tone.Frequency.ftom(440); // returns 69\n\t\t */\n\t Tone.Frequency.ftom = function (frequency) {\n\t return 69 + Math.round(12 * Math.log2(frequency / Tone.Frequency.A4));\n\t };\n\t return Tone.Frequency;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Time is a primitive type for encoding Time values.\n\t\t * Tone.Time can be constructed with or without the `new` keyword. Tone.Time can be passed\n\t\t * into the parameter of any method which takes time as an argument.\n\t\t * @constructor\n\t\t * @extends {Tone.TimeBase}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * var t = Tone.Time(\"4n\");//a quarter note\n\t\t */\n\t Tone.Time = function (val, units) {\n\t if (this instanceof Tone.Time) {\n\t Tone.TimeBase.call(this, val, units);\n\t } else {\n\t return new Tone.Time(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Time, Tone.TimeBase);\n\t /**\n\t\t * Extend the base expressions\n\t\t */\n\t Tone.Time.prototype._expressions = Object.assign({}, Tone.TimeBase.prototype._expressions, {\n\t 'quantize': {\n\t regexp: /^@(.+)/,\n\t method: function (capture) {\n\t if (Tone.Transport) {\n\t var quantTo = new this.constructor(capture);\n\t return Tone.Transport.nextSubdivision(quantTo);\n\t } else {\n\t return 0;\n\t }\n\t }\n\t },\n\t 'now': {\n\t regexp: /^\\+(.+)/,\n\t method: function (capture) {\n\t return this._now() + new this.constructor(capture);\n\t }\n\t }\n\t });\n\t /**\n\t\t * Quantize the time by the given subdivision. Optionally add a\n\t\t * percentage which will move the time value towards the ideal\n\t\t * quantized value by that percentage.\n\t\t * @param {Number|Time} val The subdivision to quantize to\n\t\t * @param {NormalRange} [percent=1] Move the time value\n\t\t * towards the quantized value by\n\t\t * a percentage.\n\t\t * @return {Number} this\n\t\t * @example\n\t\t * Tone.Time(21).quantize(2) //returns 22\n\t\t * Tone.Time(0.6).quantize(\"4n\", 0.5) //returns 0.55\n\t\t */\n\t Tone.Time.prototype.quantize = function (subdiv, percent) {\n\t percent = Tone.defaultArg(percent, 1);\n\t var subdivision = new this.constructor(subdiv);\n\t var value = this.valueOf();\n\t var multiple = Math.round(value / subdivision);\n\t var ideal = multiple * subdivision;\n\t var diff = ideal - value;\n\t return value + diff * percent;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Convert a Time to Notation. The notation values are will be the\n\t\t * closest representation between 1m to 128th note.\n\t\t * @return {Notation}\n\t\t * @example\n\t\t * //if the Transport is at 120bpm:\n\t\t * Tone.Time(2).toNotation();//returns \"1m\"\n\t\t */\n\t Tone.Time.prototype.toNotation = function () {\n\t var time = this.toSeconds();\n\t var testNotations = ['1m'];\n\t for (var power = 1; power < 8; power++) {\n\t var subdiv = Math.pow(2, power);\n\t testNotations.push(subdiv + 'n.');\n\t testNotations.push(subdiv + 'n');\n\t testNotations.push(subdiv + 't');\n\t }\n\t testNotations.push('0');\n\t //find the closets notation representation\n\t var closest = testNotations[0];\n\t var closestSeconds = Tone.Time(testNotations[0]).toSeconds();\n\t testNotations.forEach(function (notation) {\n\t var notationSeconds = Tone.Time(notation).toSeconds();\n\t if (Math.abs(notationSeconds - time) < Math.abs(closestSeconds - time)) {\n\t closest = notation;\n\t closestSeconds = notationSeconds;\n\t }\n\t });\n\t return closest;\n\t };\n\t /**\n\t\t * Return the time encoded as Bars:Beats:Sixteenths.\n\t\t * @return {BarsBeatsSixteenths}\n\t\t */\n\t Tone.Time.prototype.toBarsBeatsSixteenths = function () {\n\t var quarterTime = this._beatsToUnits(1);\n\t var quarters = this.valueOf() / quarterTime;\n\t var measures = Math.floor(quarters / this._getTimeSignature());\n\t var sixteenths = quarters % 1 * 4;\n\t quarters = Math.floor(quarters) % this._getTimeSignature();\n\t sixteenths = sixteenths.toString();\n\t if (sixteenths.length > 3) {\n\t // the additional parseFloat removes insignificant trailing zeroes\n\t sixteenths = parseFloat(parseFloat(sixteenths).toFixed(3));\n\t }\n\t var progress = [\n\t measures,\n\t quarters,\n\t sixteenths\n\t ];\n\t return progress.join(':');\n\t };\n\t /**\n\t\t * Return the time in ticks.\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Time.prototype.toTicks = function () {\n\t var quarterTime = this._beatsToUnits(1);\n\t var quarters = this.valueOf() / quarterTime;\n\t return Math.round(quarters * this._getPPQ());\n\t };\n\t /**\n\t\t * Return the time in seconds.\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.Time.prototype.toSeconds = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the value as a midi note.\n\t\t * @return {Midi}\n\t\t */\n\t Tone.Time.prototype.toMidi = function () {\n\t return Tone.Frequency.ftom(this.toFrequency());\n\t };\n\t return Tone.Time;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportTime is a the time along the Transport's\n\t\t * timeline. It is similar to Tone.Time, but instead of evaluating\n\t\t * against the AudioContext's clock, it is evaluated against\n\t\t * the Transport's position. See [TransportTime wiki](https://github.com/Tonejs/Tone.js/wiki/TransportTime).\n\t\t * @constructor\n\t\t * @param {Time} val The time value as a number or string\n\t\t * @param {String=} units Unit values\n\t\t * @extends {Tone.Time}\n\t\t */\n\t Tone.TransportTime = function (val, units) {\n\t if (this instanceof Tone.TransportTime) {\n\t Tone.Time.call(this, val, units);\n\t } else {\n\t return new Tone.TransportTime(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.TransportTime, Tone.Time);\n\t /**\n\t\t * Return the current time in whichever context is relevant\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TransportTime.prototype._now = function () {\n\t return Tone.Transport.seconds;\n\t };\n\t return Tone.TransportTime;\n\t});\n\tModule(function (Tone) {\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTYPES\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Units which a value can take on.\n\t\t * @enum {String}\n\t\t */\n\t Tone.Type = {\n\t /**\n\t\t\t * Default units\n\t\t\t * @typedef {Default}\n\t\t\t */\n\t Default: 'number',\n\t /**\n\t\t\t * Time can be described in a number of ways. Read more [Time](https://github.com/Tonejs/Tone.js/wiki/Time).\n\t\t\t *\n\t\t\t * * Numbers, which will be taken literally as the time (in seconds).\n\t\t\t * * Notation, (\"4n\", \"8t\") describes time in BPM and time signature relative values.\n\t\t\t * * TransportTime, (\"4:3:2\") will also provide tempo and time signature relative times\n\t\t\t * in the form BARS:QUARTERS:SIXTEENTHS.\n\t\t\t * * Frequency, (\"8hz\") is converted to the length of the cycle in seconds.\n\t\t\t * * Now-Relative, (\"+1\") prefix any of the above with \"+\" and it will be interpreted as\n\t\t\t * \"the current time plus whatever expression follows\".\n\t\t\t * * Expressions, (\"3:0 + 2 - (1m / 7)\") any of the above can also be combined\n\t\t\t * into a mathematical expression which will be evaluated to compute the desired time.\n\t\t\t * * No Argument, for methods which accept time, no argument will be interpreted as\n\t\t\t * \"now\" (i.e. the currentTime).\n\t\t\t *\n\t\t\t * @typedef {Time}\n\t\t\t */\n\t Time: 'time',\n\t /**\n\t\t\t * Frequency can be described similar to time, except ultimately the\n\t\t\t * values are converted to frequency instead of seconds. A number\n\t\t\t * is taken literally as the value in hertz. Additionally any of the\n\t\t\t * Time encodings can be used. Note names in the form\n\t\t\t * of NOTE OCTAVE (i.e. C4) are also accepted and converted to their\n\t\t\t * frequency value.\n\t\t\t * @typedef {Frequency}\n\t\t\t */\n\t Frequency: 'frequency',\n\t /**\n\t\t\t * TransportTime describes a position along the Transport's timeline. It is\n\t\t\t * similar to Time in that it uses all the same encodings, but TransportTime specifically\n\t\t\t * pertains to the Transport's timeline, which is startable, stoppable, loopable, and seekable.\n\t\t\t * [Read more](https://github.com/Tonejs/Tone.js/wiki/TransportTime)\n\t\t\t * @typedef {TransportTime}\n\t\t\t */\n\t TransportTime: 'transportTime',\n\t /**\n\t\t\t * Ticks are the basic subunit of the Transport. They are\n\t\t\t * the smallest unit of time that the Transport supports.\n\t\t\t * @typedef {Ticks}\n\t\t\t */\n\t Ticks: 'ticks',\n\t /**\n\t\t\t * Normal values are within the range [0, 1].\n\t\t\t * @typedef {NormalRange}\n\t\t\t */\n\t NormalRange: 'normalRange',\n\t /**\n\t\t\t * AudioRange values are between [-1, 1].\n\t\t\t * @typedef {AudioRange}\n\t\t\t */\n\t AudioRange: 'audioRange',\n\t /**\n\t\t\t * Decibels are a logarithmic unit of measurement which is useful for volume\n\t\t\t * because of the logarithmic way that we perceive loudness. 0 decibels\n\t\t\t * means no change in volume. -10db is approximately half as loud and 10db\n\t\t\t * is twice is loud.\n\t\t\t * @typedef {Decibels}\n\t\t\t */\n\t Decibels: 'db',\n\t /**\n\t\t\t * Half-step note increments, i.e. 12 is an octave above the root. and 1 is a half-step up.\n\t\t\t * @typedef {Interval}\n\t\t\t */\n\t Interval: 'interval',\n\t /**\n\t\t\t * Beats per minute.\n\t\t\t * @typedef {BPM}\n\t\t\t */\n\t BPM: 'bpm',\n\t /**\n\t\t\t * The value must be greater than or equal to 0.\n\t\t\t * @typedef {Positive}\n\t\t\t */\n\t Positive: 'positive',\n\t /**\n\t\t\t * Gain is the ratio between input and output of a signal.\n\t\t\t * A gain of 0 is the same as silencing the signal. A gain of\n\t\t\t * 1, causes no change to the incoming signal.\n\t\t\t * @typedef {Gain}\n\t\t\t */\n\t Gain: 'gain',\n\t /**\n\t\t\t * A cent is a hundredth of a semitone.\n\t\t\t * @typedef {Cents}\n\t\t\t */\n\t Cents: 'cents',\n\t /**\n\t\t\t * Angle between 0 and 360.\n\t\t\t * @typedef {Degrees}\n\t\t\t */\n\t Degrees: 'degrees',\n\t /**\n\t\t\t * A number representing a midi note.\n\t\t\t * @typedef {MIDI}\n\t\t\t */\n\t MIDI: 'midi',\n\t /**\n\t\t\t * A colon-separated representation of time in the form of\n\t\t\t * Bars:Beats:Sixteenths.\n\t\t\t * @typedef {BarsBeatsSixteenths}\n\t\t\t */\n\t BarsBeatsSixteenths: 'barsBeatsSixteenths',\n\t /**\n\t\t\t * Sampling is the reduction of a continuous signal to a discrete signal.\n\t\t\t * Audio is typically sampled 44100 times per second.\n\t\t\t * @typedef {Samples}\n\t\t\t */\n\t Samples: 'samples',\n\t /**\n\t\t\t * Hertz are a frequency representation defined as one cycle per second.\n\t\t\t * @typedef {Hertz}\n\t\t\t */\n\t Hertz: 'hertz',\n\t /**\n\t\t\t * A frequency represented by a letter name,\n\t\t\t * accidental and octave. This system is known as\n\t\t\t * [Scientific Pitch Notation](https://en.wikipedia.org/wiki/Scientific_pitch_notation).\n\t\t\t * @typedef {Note}\n\t\t\t */\n\t Note: 'note',\n\t /**\n\t\t\t * One millisecond is a thousandth of a second.\n\t\t\t * @typedef {Milliseconds}\n\t\t\t */\n\t Milliseconds: 'milliseconds',\n\t /**\n\t\t\t * Seconds are the time unit of the AudioContext. In the end,\n\t\t\t * all values need to be evaluated to seconds.\n\t\t\t * @typedef {Seconds}\n\t\t\t */\n\t Seconds: 'seconds',\n\t /**\n\t\t\t * A string representing a duration relative to a measure.\n\t\t\t * * \"4n\" = quarter note\n\t\t\t * * \"2m\" = two measures\n\t\t\t * * \"8t\" = eighth-note triplet\n\t\t\t * @typedef {Notation}\n\t\t\t */\n\t Notation: 'notation'\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // AUGMENT TONE's PROTOTYPE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Convert Time into seconds.\n\t\t *\n\t\t * Unlike the method which it overrides, this takes into account\n\t\t * transporttime and musical notation.\n\t\t *\n\t\t * Time : 1.40\n\t\t * Notation: 4n or 1m or 2t\n\t\t * Now Relative: +3n\n\t\t * Math: 3n+16n or even complicated expressions ((3n*2)/6 + 1)\n\t\t *\n\t\t * @param {Time} time\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.prototype.toSeconds = function (time) {\n\t if (Tone.isNumber(time)) {\n\t return time;\n\t } else if (Tone.isUndef(time)) {\n\t return this.now();\n\t } else if (Tone.isString(time)) {\n\t return new Tone.Time(time).toSeconds();\n\t } else if (time instanceof Tone.TimeBase) {\n\t return time.toSeconds();\n\t }\n\t };\n\t /**\n\t\t * Convert a frequency representation into a number.\n\t\t * @param {Frequency} freq\n\t\t * @return {Hertz} the frequency in hertz\n\t\t */\n\t Tone.prototype.toFrequency = function (freq) {\n\t if (Tone.isNumber(freq)) {\n\t return freq;\n\t } else if (Tone.isString(freq) || Tone.isUndef(freq)) {\n\t return new Tone.Frequency(freq).valueOf();\n\t } else if (freq instanceof Tone.TimeBase) {\n\t return freq.toFrequency();\n\t }\n\t };\n\t /**\n\t\t * Convert a time representation into ticks.\n\t\t * @param {Time} time\n\t\t * @return {Ticks} the time in ticks\n\t\t */\n\t Tone.prototype.toTicks = function (time) {\n\t if (Tone.isNumber(time) || Tone.isString(time)) {\n\t return new Tone.TransportTime(time).toTicks();\n\t } else if (Tone.isUndef(time)) {\n\t return Tone.Transport.ticks;\n\t } else if (time instanceof Tone.TimeBase) {\n\t return time.toTicks();\n\t }\n\t };\n\t return Tone;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Param wraps the native Web Audio's AudioParam to provide\n\t\t * additional unit conversion functionality. It also\n\t\t * serves as a base-class for classes which have a single,\n\t\t * automatable parameter.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {AudioParam} param The parameter to wrap.\n\t\t * @param {Tone.Type} units The units of the audio param.\n\t\t * @param {Boolean} convert If the param should be converted.\n\t\t */\n\t Tone.Param = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'param',\n\t 'units',\n\t 'convert'\n\t ], Tone.Param);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The native parameter to control\n\t\t\t * @type {AudioParam}\n\t\t\t * @private\n\t\t\t */\n\t this._param = this.input = options.param;\n\t /**\n\t\t\t * The units of the parameter\n\t\t\t * @type {Tone.Type}\n\t\t\t */\n\t this.units = options.units;\n\t /**\n\t\t\t * If the value should be converted or not\n\t\t\t * @type {Boolean}\n\t\t\t */\n\t this.convert = options.convert;\n\t /**\n\t\t\t * True if the signal value is being overridden by\n\t\t\t * a connected signal.\n\t\t\t * @readOnly\n\t\t\t * @type {boolean}\n\t\t\t * @private\n\t\t\t */\n\t this.overridden = false;\n\t /**\n\t\t\t * The timeline which tracks all of the automations.\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._events = new Tone.Timeline(1000);\n\t if (Tone.isDefined(options.value) && this._param) {\n\t this.value = options.value;\n\t }\n\t };\n\t Tone.extend(Tone.Param, Tone.AudioNode);\n\t /**\n\t\t * Defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Param.defaults = {\n\t 'units': Tone.Type.Default,\n\t 'convert': true,\n\t 'param': undefined\n\t };\n\t /**\n\t\t * The current value of the parameter.\n\t\t * @memberOf Tone.Param#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Param.prototype, 'value', {\n\t get: function () {\n\t var now = this.now();\n\t return this._toUnits(this.getValueAtTime(now));\n\t },\n\t set: function (value) {\n\t this._initialValue = this._fromUnits(value);\n\t this.cancelScheduledValues(this.context.currentTime);\n\t this.setValueAtTime(value, this.context.currentTime);\n\t }\n\t });\n\t /**\n\t\t * The minimum output value of the parameter\n\t\t * @memberOf Tone.Param#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Param.prototype, 'minValue', {\n\t get: function () {\n\t if (this.units === Tone.Type.Time || this.units === Tone.Type.Frequency || this.units === Tone.Type.NormalRange || this.units === Tone.Type.Positive || this.units === Tone.Type.BPM) {\n\t return 0;\n\t } else if (this.units === Tone.Type.AudioRange) {\n\t return -1;\n\t } else if (this.units === Tone.Type.Decibels) {\n\t return -Infinity;\n\t } else {\n\t return this._param.minValue;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The maximum output value of the parameter\n\t\t * @memberOf Tone.Param#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Param.prototype, 'maxValue', {\n\t get: function () {\n\t if (this.units === Tone.Type.NormalRange || this.units === Tone.Type.AudioRange) {\n\t return 1;\n\t } else {\n\t return this._param.maxValue;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Convert the given value from the type specified by Tone.Param.units\n\t\t * into the destination value (such as Gain or Frequency).\n\t\t * @private\n\t\t * @param {*} val the value to convert\n\t\t * @return {number} the number which the value should be set to\n\t\t */\n\t Tone.Param.prototype._fromUnits = function (val) {\n\t if ((this.convert || Tone.isUndef(this.convert)) && !this.overridden) {\n\t switch (this.units) {\n\t case Tone.Type.Time:\n\t return this.toSeconds(val);\n\t case Tone.Type.Frequency:\n\t return this.toFrequency(val);\n\t case Tone.Type.Decibels:\n\t return Tone.dbToGain(val);\n\t case Tone.Type.NormalRange:\n\t return Math.min(Math.max(val, 0), 1);\n\t case Tone.Type.AudioRange:\n\t return Math.min(Math.max(val, -1), 1);\n\t case Tone.Type.Positive:\n\t return Math.max(val, 0);\n\t default:\n\t return val;\n\t }\n\t } else {\n\t return val;\n\t }\n\t };\n\t /**\n\t\t * Convert the parameters value into the units specified by Tone.Param.units.\n\t\t * @private\n\t\t * @param {number} val the value to convert\n\t\t * @return {number}\n\t\t */\n\t Tone.Param.prototype._toUnits = function (val) {\n\t if (this.convert || Tone.isUndef(this.convert)) {\n\t switch (this.units) {\n\t case Tone.Type.Decibels:\n\t return Tone.gainToDb(val);\n\t default:\n\t return val;\n\t }\n\t } else {\n\t return val;\n\t }\n\t };\n\t /**\n\t\t * the minimum output value\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.Param.prototype._minOutput = 0.00001;\n\t /**\n\t\t * The event types\n\t\t * @enum {String}\n\t\t * @private\n\t\t */\n\t Tone.Param.AutomationType = {\n\t Linear: 'linearRampToValueAtTime',\n\t Exponential: 'exponentialRampToValueAtTime',\n\t Target: 'setTargetAtTime',\n\t SetValue: 'setValueAtTime'\n\t };\n\t /**\n\t\t * Schedules a parameter value change at the given time.\n\t\t * @param {*}\tvalue The value to set the signal.\n\t\t * @param {Time} time The time when the change should occur.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //set the frequency to \"G4\" in exactly 1 second from now.\n\t\t * freq.setValueAtTime(\"G4\", \"+1\");\n\t\t */\n\t Tone.Param.prototype.setValueAtTime = function (value, time) {\n\t time = this.toSeconds(time);\n\t value = this._fromUnits(value);\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.SetValue,\n\t 'value': value,\n\t 'time': time\n\t });\n\t this._param.setValueAtTime(value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the signals value at the given time. Subsequent scheduling\n\t\t * may invalidate the returned value.\n\t\t * @param {Time} time When to get the value\n\t\t * @returns {Number} The value at the given time\n\t\t */\n\t Tone.Param.prototype.getValueAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var after = this._events.getAfter(time);\n\t var before = this._events.get(time);\n\t var initialValue = Tone.defaultArg(this._initialValue, this._param.defaultValue);\n\t var value = initialValue;\n\t //if it was set by\n\t if (before === null) {\n\t value = initialValue;\n\t } else if (before.type === Tone.Param.AutomationType.Target) {\n\t var previous = this._events.getBefore(before.time);\n\t var previousVal;\n\t if (previous === null) {\n\t previousVal = initialValue;\n\t } else {\n\t previousVal = previous.value;\n\t }\n\t value = this._exponentialApproach(before.time, previousVal, before.value, before.constant, time);\n\t } else if (after === null) {\n\t value = before.value;\n\t } else if (after.type === Tone.Param.AutomationType.Linear) {\n\t value = this._linearInterpolate(before.time, before.value, after.time, after.value, time);\n\t } else if (after.type === Tone.Param.AutomationType.Exponential) {\n\t value = this._exponentialInterpolate(before.time, before.value, after.time, after.value, time);\n\t } else {\n\t value = before.value;\n\t }\n\t return value;\n\t };\n\t /**\n\t\t * Creates a schedule point with the current value at the current time.\n\t\t * This is useful for creating an automation anchor point in order to\n\t\t * schedule changes from the current value.\n\t\t *\n\t\t * @param {number=} now (Optionally) pass the now value in.\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.setRampPoint = function (time) {\n\t time = this.toSeconds(time);\n\t var currentVal = this.getValueAtTime(time);\n\t this.cancelAndHoldAtTime(time);\n\t if (currentVal === 0) {\n\t currentVal = this._minOutput;\n\t }\n\t this.setValueAtTime(this._toUnits(currentVal), time);\n\t return this;\n\t };\n\t /**\n\t\t * Schedules a linear continuous change in parameter value from the\n\t\t * previous scheduled parameter value to the given value.\n\t\t *\n\t\t * @param {number} value\n\t\t * @param {Time} endTime\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.linearRampToValueAtTime = function (value, endTime) {\n\t value = this._fromUnits(value);\n\t endTime = this.toSeconds(endTime);\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Linear,\n\t 'value': value,\n\t 'time': endTime\n\t });\n\t this._param.linearRampToValueAtTime(value, endTime);\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an exponential continuous change in parameter value from\n\t\t * the previous scheduled parameter value to the given value.\n\t\t *\n\t\t * @param {number} value\n\t\t * @param {Time} endTime\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.exponentialRampToValueAtTime = function (value, endTime) {\n\t value = this._fromUnits(value);\n\t value = Math.max(this._minOutput, value);\n\t endTime = this.toSeconds(endTime);\n\t //store the event\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Exponential,\n\t 'time': endTime,\n\t 'value': value\n\t });\n\t this._param.exponentialRampToValueAtTime(value, endTime);\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an exponential continuous change in parameter value from\n\t\t * the current time and current value to the given value over the\n\t\t * duration of the rampTime.\n\t\t *\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //exponentially ramp to the value 2 over 4 seconds.\n\t\t * signal.exponentialRampTo(2, 4);\n\t\t */\n\t Tone.Param.prototype.exponentialRampTo = function (value, rampTime, startTime) {\n\t startTime = this.toSeconds(startTime);\n\t this.setRampPoint(startTime);\n\t this.exponentialRampToValueAtTime(value, startTime + this.toSeconds(rampTime));\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an linear continuous change in parameter value from\n\t\t * the current time and current value to the given value over the\n\t\t * duration of the rampTime.\n\t\t *\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //linearly ramp to the value 4 over 3 seconds.\n\t\t * signal.linearRampTo(4, 3);\n\t\t */\n\t Tone.Param.prototype.linearRampTo = function (value, rampTime, startTime) {\n\t startTime = this.toSeconds(startTime);\n\t this.setRampPoint(startTime);\n\t this.linearRampToValueAtTime(value, startTime + this.toSeconds(rampTime));\n\t return this;\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time. Since it\n\t\t * is an exponential approach it will continue approaching after the ramp duration. The\n\t\t * rampTime is the time that it takes to reach over 99% of the way towards the value.\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //exponentially ramp to the value 2 over 4 seconds.\n\t\t * signal.exponentialRampTo(2, 4);\n\t\t */\n\t Tone.Param.prototype.targetRampTo = function (value, rampTime, startTime) {\n\t startTime = this.toSeconds(startTime);\n\t this.setRampPoint(startTime);\n\t this.exponentialApproachValueAtTime(value, startTime, rampTime);\n\t return this;\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time. Since it\n\t\t * is an exponential approach it will continue approaching after the ramp duration. The\n\t\t * rampTime is the time that it takes to reach over 99% of the way towards the value. This methods\n\t\t * is similar to setTargetAtTime except the third argument is a time instead of a 'timeConstant'\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time}\ttime \tWhen the ramp should start.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //exponentially ramp to the value 2 over 4 seconds.\n\t\t * signal.exponentialRampTo(2, 4);\n\t\t */\n\t Tone.Param.prototype.exponentialApproachValueAtTime = function (value, time, rampTime) {\n\t var timeConstant = Math.log(this.toSeconds(rampTime) + 1) / Math.log(200);\n\t time = this.toSeconds(time);\n\t return this.setTargetAtTime(value, time, timeConstant);\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time with\n\t\t * a rate having the given time constant.\n\t\t * @param {number} value\n\t\t * @param {Time} startTime\n\t\t * @param {number} timeConstant\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.setTargetAtTime = function (value, startTime, timeConstant) {\n\t value = this._fromUnits(value);\n\t // The value will never be able to approach without timeConstant > 0.\n\t if (timeConstant <= 0) {\n\t throw new Error('timeConstant must be greater than 0');\n\t }\n\t startTime = this.toSeconds(startTime);\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Target,\n\t 'value': value,\n\t 'time': startTime,\n\t 'constant': timeConstant\n\t });\n\t this._param.setTargetAtTime(value, startTime, timeConstant);\n\t return this;\n\t };\n\t /**\n\t\t * Sets an array of arbitrary parameter values starting at the given time\n\t\t * for the given duration.\n\t\t *\n\t\t * @param {Array} values\n\t\t * @param {Time} startTime\n\t\t * @param {Time} duration\n\t\t * @param {NormalRange} [scaling=1] If the values in the curve should be scaled by some value\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.setValueCurveAtTime = function (values, startTime, duration, scaling) {\n\t scaling = Tone.defaultArg(scaling, 1);\n\t duration = this.toSeconds(duration);\n\t startTime = this.toSeconds(startTime);\n\t this.setValueAtTime(values[0] * scaling, startTime);\n\t var segTime = duration / (values.length - 1);\n\t for (var i = 1; i < values.length; i++) {\n\t this.linearRampToValueAtTime(values[i] * scaling, startTime + i * segTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancels all scheduled parameter changes with times greater than or\n\t\t * equal to startTime.\n\t\t *\n\t\t * @param {Time} time\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.cancelScheduledValues = function (time) {\n\t time = this.toSeconds(time);\n\t this._events.cancel(time);\n\t this._param.cancelScheduledValues(time);\n\t return this;\n\t };\n\t /**\n\t\t * This is similar to [cancelScheduledValues](#cancelScheduledValues) except\n\t\t * it holds the automated value at time until the next automated event.\n\t\t * @param {Time} time\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.cancelAndHoldAtTime = function (time) {\n\t var valueAtTime = this.getValueAtTime(time);\n\t //if there is an event at the given time\n\t //and that even is not a \"set\"\n\t var before = this._events.get(time);\n\t var after = this._events.getAfter(time);\n\t if (before && before.time === time) {\n\t //remove everything after\n\t if (after) {\n\t this._events.cancel(after.time);\n\t } else {\n\t this._events.cancel(time + 0.000001);\n\t }\n\t } else if (after) {\n\t //cancel the next event(s)\n\t this._events.cancel(after.time);\n\t if (!this._param.cancelAndHoldAtTime) {\n\t this._param.cancelScheduledValues(time);\n\t }\n\t if (after.type === Tone.Param.AutomationType.Linear) {\n\t if (!this._param.cancelAndHoldAtTime) {\n\t this.linearRampToValueAtTime(valueAtTime, time);\n\t } else {\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Linear,\n\t 'value': valueAtTime,\n\t 'time': time\n\t });\n\t }\n\t } else if (after.type === Tone.Param.AutomationType.Exponential) {\n\t if (!this._param.cancelAndHoldAtTime) {\n\t this.exponentialRampToValueAtTime(valueAtTime, time);\n\t } else {\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Exponential,\n\t 'value': valueAtTime,\n\t 'time': time\n\t });\n\t }\n\t }\n\t }\n\t //set the value at the given time\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.SetValue,\n\t 'value': valueAtTime,\n\t 'time': time\n\t });\n\t if (this._param.cancelAndHoldAtTime) {\n\t this._param.cancelAndHoldAtTime(time);\n\t } else {\n\t this._param.setValueAtTime(valueAtTime, time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Ramps to the given value over the duration of the rampTime.\n\t\t * Automatically selects the best ramp type (exponential or linear)\n\t\t * depending on the `units` of the signal\n\t\t *\n\t\t * @param {number} value\n\t\t * @param {Time} rampTime \tThe time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //ramp to the value either linearly or exponentially\n\t\t * //depending on the \"units\" value of the signal\n\t\t * signal.rampTo(0, 10);\n\t\t * @example\n\t\t * //schedule it to ramp starting at a specific time\n\t\t * signal.rampTo(0, 10, 5)\n\t\t */\n\t Tone.Param.prototype.rampTo = function (value, rampTime, startTime) {\n\t rampTime = Tone.defaultArg(rampTime, 0.1);\n\t if (this.units === Tone.Type.Frequency || this.units === Tone.Type.BPM || this.units === Tone.Type.Decibels) {\n\t this.exponentialRampTo(value, rampTime, startTime);\n\t } else {\n\t this.linearRampTo(value, rampTime, startTime);\n\t }\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tAUTOMATION CURVE CALCULATIONS\n\t //\tMIT License, copyright (c) 2014 Jordan Santell\n\t ///////////////////////////////////////////////////////////////////////////\n\t // Calculates the the value along the curve produced by setTargetAtTime\n\t Tone.Param.prototype._exponentialApproach = function (t0, v0, v1, timeConstant, t) {\n\t return v1 + (v0 - v1) * Math.exp(-(t - t0) / timeConstant);\n\t };\n\t // Calculates the the value along the curve produced by linearRampToValueAtTime\n\t Tone.Param.prototype._linearInterpolate = function (t0, v0, t1, v1, t) {\n\t return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));\n\t };\n\t // Calculates the the value along the curve produced by exponentialRampToValueAtTime\n\t Tone.Param.prototype._exponentialInterpolate = function (t0, v0, t1, v1, t) {\n\t return v0 * Math.pow(v1 / v0, (t - t0) / (t1 - t0));\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._param = null;\n\t this._events = null;\n\t return this;\n\t };\n\t return Tone.Param;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the OfflineAudioContext\n\t\t * @extends {Tone.Context}\n\t\t * @param {Number} channels The number of channels to render\n\t\t * @param {Number} duration The duration to render in samples\n\t\t * @param {Number} sampleRate the sample rate to render at\n\t\t */\n\t Tone.OfflineContext = function (channels, duration, sampleRate) {\n\t /**\n\t\t\t * The offline context\n\t\t\t * @private\n\t\t\t * @type {OfflineAudioContext}\n\t\t\t */\n\t var offlineContext = new OfflineAudioContext(channels, duration * sampleRate, sampleRate);\n\t //wrap the methods/members\n\t Tone.Context.call(this, {\n\t 'context': offlineContext,\n\t 'clockSource': 'offline',\n\t 'lookAhead': 0,\n\t 'updateInterval': 128 / sampleRate\n\t });\n\t /**\n\t\t\t * A private reference to the duration\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._duration = duration;\n\t /**\n\t\t\t * An artificial clock source\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._currentTime = 0;\n\t };\n\t Tone.extend(Tone.OfflineContext, Tone.Context);\n\t /**\n\t\t * Override the now method to point to the internal clock time\n\t\t * @return {Number}\n\t\t */\n\t Tone.OfflineContext.prototype.now = function () {\n\t return this._currentTime;\n\t };\n\t /**\n\t\t * Render the output of the OfflineContext\n\t\t * @return {Promise}\n\t\t */\n\t Tone.OfflineContext.prototype.render = function () {\n\t while (this._duration - this._currentTime >= 0) {\n\t //invoke all the callbacks on that time\n\t this.emit('tick');\n\t //increment the clock\n\t this._currentTime += this.blockTime;\n\t }\n\t return this._context.startRendering();\n\t };\n\t /**\n\t\t * Close the context\n\t\t * @return {Promise}\n\t\t */\n\t Tone.OfflineContext.prototype.close = function () {\n\t this._context = null;\n\t return Promise.resolve();\n\t };\n\t return Tone.OfflineContext;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t var ua = navigator.userAgent.toLowerCase();\n\t var isMobileSafari = ua.includes('safari') && !ua.includes('chrome') && ua.includes('mobile');\n\t if (isMobileSafari) {\n\t //mobile safari has a bizarre bug with the offline context\n\t //when a BufferSourceNode is started, it starts the offline context\n\t //\n\t //deferring all BufferSource starts till the last possible moment\n\t //reduces the likelihood of this happening\n\t Tone.OfflineContext.prototype.createBufferSource = function () {\n\t var bufferSource = this._context.createBufferSource();\n\t var _native_start = bufferSource.start;\n\t bufferSource.start = function (time) {\n\t this.setTimeout(function () {\n\t _native_start.call(bufferSource, time);\n\t }.bind(this), 0);\n\t }.bind(this);\n\t return bufferSource;\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A thin wrapper around the Native Web Audio GainNode.\n\t\t * The GainNode is a basic building block of the Web Audio\n\t\t * API and is useful for routing audio and adjusting gains.\n\t\t * @extends {Tone}\n\t\t * @param {Number=} gain The initial gain of the GainNode\n\t\t * @param {Tone.Type=} units The units of the gain parameter.\n\t\t */\n\t Tone.Gain = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'gain',\n\t 'units'\n\t ], Tone.Gain);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The GainNode\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.input = this.output = this._gainNode = this.context.createGain();\n\t /**\n\t\t\t * The gain parameter of the gain node.\n\t\t\t * @type {Gain}\n\t\t\t * @signal\n\t\t\t */\n\t this.gain = new Tone.Param({\n\t 'param': this._gainNode.gain,\n\t 'units': options.units,\n\t 'value': options.gain,\n\t 'convert': options.convert\n\t });\n\t this._readOnly('gain');\n\t };\n\t Tone.extend(Tone.Gain, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Gain.defaults = {\n\t 'gain': 1,\n\t 'convert': true\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Gain} this\n\t\t */\n\t Tone.Gain.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._gainNode.disconnect();\n\t this._gainNode = null;\n\t this._writable('gain');\n\t this.gain.dispose();\n\t this.gain = null;\n\t };\n\t return Tone.Gain;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported && !AudioContext.prototype.createConstantSource) {\n\t var ConstantSourceNode = function (context) {\n\t this.context = context;\n\t var buffer = context.createBuffer(1, 128, context.sampleRate);\n\t var arr = buffer.getChannelData(0);\n\t for (var i = 0; i < arr.length; i++) {\n\t arr[i] = 1;\n\t }\n\t this._bufferSource = context.createBufferSource();\n\t this._bufferSource.channelCount = 1;\n\t this._bufferSource.channelCountMode = 'explicit';\n\t this._bufferSource.buffer = buffer;\n\t this._bufferSource.loop = true;\n\t var gainNode = this._output = context.createGain();\n\t this.offset = gainNode.gain;\n\t this._bufferSource.connect(gainNode);\n\t };\n\t ConstantSourceNode.prototype.start = function (time) {\n\t this._bufferSource.start(time);\n\t return this;\n\t };\n\t ConstantSourceNode.prototype.stop = function (time) {\n\t this._bufferSource.stop(time);\n\t return this;\n\t };\n\t ConstantSourceNode.prototype.connect = function () {\n\t this._output.connect.apply(this._output, arguments);\n\t return this;\n\t };\n\t ConstantSourceNode.prototype.disconnect = function () {\n\t this._output.disconnect.apply(this._output, arguments);\n\t return this;\n\t };\n\t AudioContext.prototype.createConstantSource = function () {\n\t return new ConstantSourceNode(this);\n\t };\n\t Tone.Context.prototype.createConstantSource = function () {\n\t return new ConstantSourceNode(this);\n\t };\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A signal is an audio-rate value. Tone.Signal is a core component of the library.\n\t\t * Unlike a number, Signals can be scheduled with sample-level accuracy. Tone.Signal\n\t\t * has all of the methods available to native Web Audio\n\t\t * [AudioParam](http://webaudio.github.io/web-audio-api/#the-audioparam-interface)\n\t\t * as well as additional conveniences. Read more about working with signals\n\t\t * [here](https://github.com/Tonejs/Tone.js/wiki/Signals).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Param}\n\t\t * @param {Number|AudioParam} [value] Initial value of the signal. If an AudioParam\n\t\t * is passed in, that parameter will be wrapped\n\t\t * and controlled by the Signal.\n\t\t * @param {string} [units=Number] unit The units the signal is in.\n\t\t * @example\n\t\t * var signal = new Tone.Signal(10);\n\t\t */\n\t Tone.Signal = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'value',\n\t 'units'\n\t ], Tone.Signal);\n\t Tone.Param.call(this, options);\n\t /**\n\t\t\t* When a signal is connected to another signal or audio param,\n\t\t\t* this signal becomes a proxy for it\n\t\t\t* @type {Array}\n\t\t\t* @private\n\t\t\t*/\n\t this._proxies = [];\n\t /**\n\t\t\t* Indicates if the constant source was started or not\n\t\t\t* @private\n\t\t\t* @type {Boolean}\n\t\t\t*/\n\t this._sourceStarted = false;\n\t /**\n\t\t\t * The constant source node which generates the signal\n\t\t\t * @type {ConstantSourceNode}\n\t\t\t * @private\n\t\t\t */\n\t this._constantSource = this.context.createConstantSource();\n\t this._param = this._constantSource.offset;\n\t this.value = options.value;\n\t /**\n\t\t\t * The node where the constant signal value is scaled.\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.output = this._constantSource;\n\t /**\n\t\t\t * The node where the value is set.\n\t\t\t * @type {Tone.Param}\n\t\t\t * @private\n\t\t\t */\n\t this.input = this._param = this.output.offset;\n\t };\n\t Tone.extend(Tone.Signal, Tone.Param);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Signal.defaults = {\n\t 'value': 0,\n\t 'units': Tone.Type.Default,\n\t 'convert': true\n\t };\n\t /**\n\t\t * When signals connect to other signals or AudioParams,\n\t\t * they take over the output value of that signal or AudioParam.\n\t\t * For all other nodes, the behavior is the same as a default <code>connect</code>.\n\t\t *\n\t\t * @override\n\t\t * @param {AudioParam|AudioNode|Tone.Signal|Tone} node\n\t\t * @param {number} [outputNumber=0] The output number to connect from.\n\t\t * @param {number} [inputNumber=0] The input number to connect to.\n\t\t * @returns {Tone.Signal} this\n\t\t * @method\n\t\t */\n\t Tone.Signal.prototype.connect = function (node) {\n\t //this is an optimization where this node will forward automations\n\t //to connected nodes without any signal if possible.\n\t if (this._isParam(node) && !this._sourceStarted) {\n\t this._proxies.push(node);\n\t node.overridden = true;\n\t this._applyAutomations(node);\n\t } else {\n\t Tone.SignalBase.prototype.connect.apply(this, arguments);\n\t if (!this._sourceStarted) {\n\t this._sourceStarted = true;\n\t this._constantSource.start(0);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Takes a node as an argument and returns if it is a Param or AudioParam\n\t\t * @param {*} node The node to test\n\t\t * @return {Boolean}\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._isParam = function (node) {\n\t return Tone.Param && Tone.Param === node.constructor || node instanceof AudioParam;\n\t };\n\t /**\n\t\t * Discard the optimization and connect all of the proxies\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._connectProxies = function () {\n\t if (!this._sourceStarted) {\n\t this._sourceStarted = true;\n\t this._constantSource.start(0);\n\t }\n\t this._proxies.forEach(function (proxy) {\n\t Tone.SignalBase.prototype.connect.call(this, proxy);\n\t if (proxy._proxies) {\n\t proxy._connectProxies();\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Invoked when a node is connected to this\n\t\t * @param {AudioNode} from\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._onConnect = function (from) {\n\t if (!this._isParam(from)) {\n\t //connect all the proxies\n\t this._connectProxies();\n\t }\n\t };\n\t /**\n\t\t * Apply all the current automations to the given parameter\n\t\t * @param {AudioParam} param\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._applyAutomations = function (param) {\n\t var now = this.context.currentTime;\n\t param.cancelScheduledValues(now);\n\t var currentVal = this.getValueAtTime(now);\n\t param.setValueAtTime(currentVal, now);\n\t this._events.forEachFrom(now, function (event) {\n\t param[event.type](event.value, event.time, event.constant);\n\t });\n\t };\n\t /**\n\t\t * Disconnect from the given node or all nodes if no param is given.\n\t\t * @param {AudioNode|AudioParam} node\n\t\t * @return {Tone.Signal} this\n\t\t */\n\t Tone.Signal.prototype.disconnect = function (node) {\n\t if (this._proxies.includes(node)) {\n\t var index = this._proxies.indexOf(node);\n\t this._proxies.splice(index, 1);\n\t } else if (!node) {\n\t //no argument, disconnect everything\n\t this._proxies = [];\n\t }\n\t return Tone.SignalBase.prototype.disconnect.apply(this, arguments);\n\t };\n\t /**\n\t\t * Return the current signal value at the given time.\n\t\t * @param {Time} time When to get the signal value\n\t\t * @return {Number}\n\t\t */\n\t Tone.Signal.prototype.getValueAtTime = function (time) {\n\t if (this._param.getValueAtTime) {\n\t return this._param.getValueAtTime(time);\n\t } else {\n\t return Tone.Param.prototype.getValueAtTime.call(this, time);\n\t }\n\t };\n\t //wrap all of the automation methods\n\t [\n\t 'setValueAtTime',\n\t 'linearRampToValueAtTime',\n\t 'exponentialRampToValueAtTime',\n\t 'setTargetAtTime'\n\t ].forEach(function (method) {\n\t var previousMethod = Tone.Signal.prototype[method];\n\t Tone.Signal.prototype[method] = function () {\n\t var args = arguments;\n\t previousMethod.apply(this, arguments);\n\t args[0] = this._fromUnits(args[0]);\n\t args[1] = this.toSeconds(args[1]);\n\t //apply it to the proxies\n\t this._proxies.forEach(function (signal) {\n\t signal[method].apply(signal, args);\n\t });\n\t };\n\t });\n\t [\n\t 'cancelScheduledValues',\n\t 'cancelAndHoldAtTime'\n\t ].forEach(function (method) {\n\t var previousMethod = Tone.Signal.prototype[method];\n\t Tone.Signal.prototype[method] = function () {\n\t var args = arguments;\n\t previousMethod.apply(this, arguments);\n\t args[0] = this.toSeconds(args[0]);\n\t //apply it to the proxies\n\t this._proxies.forEach(function (signal) {\n\t signal[method].apply(signal, args);\n\t });\n\t };\n\t });\n\t /**\n\t\t * dispose and disconnect\n\t\t * @returns {Tone.Signal} this\n\t\t */\n\t Tone.Signal.prototype.dispose = function () {\n\t Tone.Param.prototype.dispose.call(this);\n\t this._constantSource.disconnect();\n\t this._constantSource = null;\n\t this._proxies = null;\n\t return this;\n\t };\n\t return Tone.Signal;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Pow applies an exponent to the incoming signal. The incoming signal\n\t\t * must be AudioRange.\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @param {Positive} exp The exponent to apply to the incoming signal, must be at least 2. \n\t\t * @example\n\t\t * var pow = new Tone.Pow(2);\n\t\t * var sig = new Tone.Signal(0.5).connect(pow);\n\t\t * //output of pow is 0.25. \n\t\t */\n\t Tone.Pow = function (exp) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * the exponent\n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._exp = Tone.defaultArg(exp, 1);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._expScaler = this.input = this.output = new Tone.WaveShaper(this._expFunc(this._exp), 8192);\n\t };\n\t Tone.extend(Tone.Pow, Tone.SignalBase);\n\t /**\n\t\t * The value of the exponent.\n\t\t * @memberOf Tone.Pow#\n\t\t * @type {number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Pow.prototype, 'value', {\n\t get: function () {\n\t return this._exp;\n\t },\n\t set: function (exp) {\n\t this._exp = exp;\n\t this._expScaler.setMap(this._expFunc(this._exp));\n\t }\n\t });\n\t /**\n\t\t * the function which maps the waveshaper\n\t\t * @param {number} exp\n\t\t * @return {function}\n\t\t * @private\n\t\t */\n\t Tone.Pow.prototype._expFunc = function (exp) {\n\t return function (val) {\n\t return Math.pow(Math.abs(val), exp);\n\t };\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Pow} this\n\t\t */\n\t Tone.Pow.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._expScaler.dispose();\n\t this._expScaler = null;\n\t return this;\n\t };\n\t return Tone.Pow;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Envelope is an [ADSR](https://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope)\n\t\t * envelope generator. Tone.Envelope outputs a signal which\n\t\t * can be connected to an AudioParam or Tone.Signal.\n\t\t * <img src=\"https://upload.wikimedia.org/wikipedia/commons/e/ea/ADSR_parameter.svg\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Time} [attack] The amount of time it takes for the envelope to go from\n\t\t * 0 to it's maximum value.\n\t\t * @param {Time} [decay]\tThe period of time after the attack that it takes for the envelope\n\t\t * \tto fall to the sustain value.\n\t\t * @param {NormalRange} [sustain]\tThe percent of the maximum value that the envelope rests at until\n\t\t * \tthe release is triggered.\n\t\t * @param {Time} [release]\tThe amount of time after the release is triggered it takes to reach 0.\n\t\t * @example\n\t\t * //an amplitude envelope\n\t\t * var gainNode = Tone.context.createGain();\n\t\t * var env = new Tone.Envelope({\n\t\t * \t\"attack\" : 0.1,\n\t\t * \t\"decay\" : 0.2,\n\t\t * \t\"sustain\" : 1,\n\t\t * \t\"release\" : 0.8,\n\t\t * });\n\t\t * env.connect(gainNode.gain);\n\t\t */\n\t Tone.Envelope = function () {\n\t //get all of the defaults\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'decay',\n\t 'sustain',\n\t 'release'\n\t ], Tone.Envelope);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * When triggerAttack is called, the attack time is the amount of\n\t\t\t * time it takes for the envelope to reach it's maximum value.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.attack = options.attack;\n\t /**\n\t\t\t * After the attack portion of the envelope, the value will fall\n\t\t\t * over the duration of the decay time to it's sustain value.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.decay = options.decay;\n\t /**\n\t\t\t * \tThe sustain value is the value\n\t\t\t * \twhich the envelope rests at after triggerAttack is\n\t\t\t * \tcalled, but before triggerRelease is invoked.\n\t\t\t * @type {NormalRange}\n\t\t\t */\n\t this.sustain = options.sustain;\n\t /**\n\t\t\t * After triggerRelease is called, the envelope's\n\t\t\t * value will fall to it's miminum value over the\n\t\t\t * duration of the release time.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.release = options.release;\n\t /**\n\t\t\t * the next time the envelope is at standby\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._attackCurve = 'linear';\n\t /**\n\t\t\t * the next time the envelope is at standby\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._releaseCurve = 'exponential';\n\t /**\n\t\t\t * the signal\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._sig = this.output = new Tone.Signal(0);\n\t //set the attackCurve initially\n\t this.attackCurve = options.attackCurve;\n\t this.releaseCurve = options.releaseCurve;\n\t };\n\t Tone.extend(Tone.Envelope, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Envelope.defaults = {\n\t 'attack': 0.01,\n\t 'decay': 0.1,\n\t 'sustain': 0.5,\n\t 'release': 1,\n\t 'attackCurve': 'linear',\n\t 'releaseCurve': 'exponential'\n\t };\n\t /**\n\t\t * Read the current value of the envelope. Useful for\n\t\t * syncronizing visual output to the envelope.\n\t\t * @memberOf Tone.Envelope#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Envelope.prototype, 'value', {\n\t get: function () {\n\t return this.getValueAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * The shape of the attack.\n\t\t * Can be any of these strings:\n\t\t * <ul>\n\t\t * <li>linear</li>\n\t\t * <li>exponential</li>\n\t\t * <li>sine</li>\n\t\t * <li>cosine</li>\n\t\t * <li>bounce</li>\n\t\t * <li>ripple</li>\n\t\t * <li>step</li>\n\t\t * </ul>\n\t\t * Can also be an array which describes the curve. Values\n\t\t * in the array are evenly subdivided and linearly\n\t\t * interpolated over the duration of the attack.\n\t\t * @memberOf Tone.Envelope#\n\t\t * @type {String|Array}\n\t\t * @name attackCurve\n\t\t * @example\n\t\t * env.attackCurve = \"linear\";\n\t\t * @example\n\t\t * //can also be an array\n\t\t * env.attackCurve = [0, 0.2, 0.3, 0.4, 1]\n\t\t */\n\t Object.defineProperty(Tone.Envelope.prototype, 'attackCurve', {\n\t get: function () {\n\t if (Tone.isString(this._attackCurve)) {\n\t return this._attackCurve;\n\t } else if (Tone.isArray(this._attackCurve)) {\n\t //look up the name in the curves array\n\t for (var type in Tone.Envelope.Type) {\n\t if (Tone.Envelope.Type[type].In === this._attackCurve) {\n\t return type;\n\t }\n\t }\n\t //otherwise just return the array\n\t return this._attackCurve;\n\t }\n\t },\n\t set: function (curve) {\n\t //check if it's a valid type\n\t if (Tone.Envelope.Type.hasOwnProperty(curve)) {\n\t var curveDef = Tone.Envelope.Type[curve];\n\t if (Tone.isObject(curveDef)) {\n\t this._attackCurve = curveDef.In;\n\t } else {\n\t this._attackCurve = curveDef;\n\t }\n\t } else if (Tone.isArray(curve)) {\n\t this._attackCurve = curve;\n\t } else {\n\t throw new Error('Tone.Envelope: invalid curve: ' + curve);\n\t }\n\t }\n\t });\n\t /**\n\t\t * The shape of the release. See the attack curve types.\n\t\t * @memberOf Tone.Envelope#\n\t\t * @type {String|Array}\n\t\t * @name releaseCurve\n\t\t * @example\n\t\t * env.releaseCurve = \"linear\";\n\t\t */\n\t Object.defineProperty(Tone.Envelope.prototype, 'releaseCurve', {\n\t get: function () {\n\t if (Tone.isString(this._releaseCurve)) {\n\t return this._releaseCurve;\n\t } else if (Tone.isArray(this._releaseCurve)) {\n\t //look up the name in the curves array\n\t for (var type in Tone.Envelope.Type) {\n\t if (Tone.Envelope.Type[type].Out === this._releaseCurve) {\n\t return type;\n\t }\n\t }\n\t //otherwise just return the array\n\t return this._releaseCurve;\n\t }\n\t },\n\t set: function (curve) {\n\t //check if it's a valid type\n\t if (Tone.Envelope.Type.hasOwnProperty(curve)) {\n\t var curveDef = Tone.Envelope.Type[curve];\n\t if (Tone.isObject(curveDef)) {\n\t this._releaseCurve = curveDef.Out;\n\t } else {\n\t this._releaseCurve = curveDef;\n\t }\n\t } else if (Tone.isArray(curve)) {\n\t this._releaseCurve = curve;\n\t } else {\n\t throw new Error('Tone.Envelope: invalid curve: ' + curve);\n\t }\n\t }\n\t });\n\t /**\n\t\t * Trigger the attack/decay portion of the ADSR envelope.\n\t\t * @param {Time} [time=now] When the attack should start.\n\t\t * @param {NormalRange} [velocity=1] The velocity of the envelope scales the vales.\n\t\t * number between 0-1\n\t\t * @returns {Tone.Envelope} this\n\t\t * @example\n\t\t * //trigger the attack 0.5 seconds from now with a velocity of 0.2\n\t\t * env.triggerAttack(\"+0.5\", 0.2);\n\t\t */\n\t Tone.Envelope.prototype.triggerAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t var originalAttack = this.toSeconds(this.attack);\n\t var attack = originalAttack;\n\t var decay = this.toSeconds(this.decay);\n\t velocity = Tone.defaultArg(velocity, 1);\n\t //check if it's not a complete attack\n\t var currentValue = this.getValueAtTime(time);\n\t if (currentValue > 0) {\n\t //subtract the current value from the attack time\n\t var attackRate = 1 / attack;\n\t var remainingDistance = 1 - currentValue;\n\t //the attack is now the remaining time\n\t attack = remainingDistance / attackRate;\n\t }\n\t //attack\n\t if (this._attackCurve === 'linear') {\n\t this._sig.linearRampTo(velocity, attack, time);\n\t } else if (this._attackCurve === 'exponential') {\n\t this._sig.targetRampTo(velocity, attack, time);\n\t } else if (attack > 0) {\n\t this._sig.cancelAndHoldAtTime(time);\n\t var curve = this._attackCurve;\n\t //take only a portion of the curve\n\t if (attack < originalAttack) {\n\t var percentComplete = 1 - attack / originalAttack;\n\t var sliceIndex = Math.floor(percentComplete * this._attackCurve.length);\n\t curve = this._attackCurve.slice(sliceIndex);\n\t //the first index is the current value\n\t curve[0] = currentValue;\n\t }\n\t this._sig.setValueCurveAtTime(curve, time, attack, velocity);\n\t }\n\t //decay\n\t if (decay) {\n\t this._sig.targetRampTo(velocity * this.sustain, decay, attack + time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Triggers the release of the envelope.\n\t\t * @param {Time} [time=now] When the release portion of the envelope should start.\n\t\t * @returns {Tone.Envelope} this\n\t\t * @example\n\t\t * //trigger release immediately\n\t\t * env.triggerRelease();\n\t\t */\n\t Tone.Envelope.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t var currentValue = this.getValueAtTime(time);\n\t if (currentValue > 0) {\n\t var release = this.toSeconds(this.release);\n\t if (this._releaseCurve === 'linear') {\n\t this._sig.linearRampTo(0, release, time);\n\t } else if (this._releaseCurve === 'exponential') {\n\t this._sig.targetRampTo(0, release, time);\n\t } else {\n\t var curve = this._releaseCurve;\n\t if (Tone.isArray(curve)) {\n\t this._sig.cancelAndHoldAtTime(time);\n\t this._sig.setValueCurveAtTime(curve, time, release, currentValue);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the scheduled value at the given time. This will\n\t\t * return the unconverted (raw) value.\n\t\t * @param {Number} time The time in seconds.\n\t\t * @return {Number} The scheduled value at the given time.\n\t\t */\n\t Tone.Envelope.prototype.getValueAtTime = function (time) {\n\t return this._sig.getValueAtTime(time);\n\t };\n\t /**\n\t\t * triggerAttackRelease is shorthand for triggerAttack, then waiting\n\t\t * some duration, then triggerRelease.\n\t\t * @param {Time} duration The duration of the sustain.\n\t\t * @param {Time} [time=now] When the attack should be triggered.\n\t\t * @param {number} [velocity=1] The velocity of the envelope.\n\t\t * @returns {Tone.Envelope} this\n\t\t * @example\n\t\t * //trigger the attack and then the release after 0.6 seconds.\n\t\t * env.triggerAttackRelease(0.6);\n\t\t */\n\t Tone.Envelope.prototype.triggerAttackRelease = function (duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t this.triggerAttack(time, velocity);\n\t this.triggerRelease(time + this.toSeconds(duration));\n\t return this;\n\t };\n\t /**\n\t\t * Cancels all scheduled envelope changes after the given time.\n\t\t * @param {Time} after\n\t\t * @returns {Tone.Envelope} this\n\t\t */\n\t Tone.Envelope.prototype.cancel = function (after) {\n\t this._sig.cancelScheduledValues(after);\n\t return this;\n\t };\n\t /**\n\t\t * Borrows the connect method from Tone.Signal.\n\t\t * @function\n\t\t * @private\n\t\t */\n\t Tone.Envelope.prototype.connect = Tone.SignalBase.prototype.connect;\n\t /**\n\t \t * Generate some complex envelope curves.\n\t \t */\n\t (function _createCurves() {\n\t var curveLen = 128;\n\t var i, k;\n\t //cosine curve\n\t var cosineCurve = [];\n\t for (i = 0; i < curveLen; i++) {\n\t cosineCurve[i] = Math.sin(i / (curveLen - 1) * (Math.PI / 2));\n\t }\n\t //ripple curve\n\t var rippleCurve = [];\n\t var rippleCurveFreq = 6.4;\n\t for (i = 0; i < curveLen - 1; i++) {\n\t k = i / (curveLen - 1);\n\t var sineWave = Math.sin(k * (Math.PI * 2) * rippleCurveFreq - Math.PI / 2) + 1;\n\t rippleCurve[i] = sineWave / 10 + k * 0.83;\n\t }\n\t rippleCurve[curveLen - 1] = 1;\n\t //stairs curve\n\t var stairsCurve = [];\n\t var steps = 5;\n\t for (i = 0; i < curveLen; i++) {\n\t stairsCurve[i] = Math.ceil(i / (curveLen - 1) * steps) / steps;\n\t }\n\t //in-out easing curve\n\t var sineCurve = [];\n\t for (i = 0; i < curveLen; i++) {\n\t k = i / (curveLen - 1);\n\t sineCurve[i] = 0.5 * (1 - Math.cos(Math.PI * k));\n\t }\n\t //a bounce curve\n\t var bounceCurve = [];\n\t for (i = 0; i < curveLen; i++) {\n\t k = i / (curveLen - 1);\n\t var freq = Math.pow(k, 3) * 4 + 0.2;\n\t var val = Math.cos(freq * Math.PI * 2 * k);\n\t bounceCurve[i] = Math.abs(val * (1 - k));\n\t }\n\t /**\n\t\t\t * Invert a value curve to make it work for the release\n\t\t\t * @private\n\t\t\t */\n\t function invertCurve(curve) {\n\t var out = new Array(curve.length);\n\t for (var j = 0; j < curve.length; j++) {\n\t out[j] = 1 - curve[j];\n\t }\n\t return out;\n\t }\n\t /**\n\t\t\t * reverse the curve\n\t\t\t * @private\n\t\t\t */\n\t function reverseCurve(curve) {\n\t return curve.slice(0).reverse();\n\t }\n\t /**\n\t\t\t * attack and release curve arrays\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t Tone.Envelope.Type = {\n\t 'linear': 'linear',\n\t 'exponential': 'exponential',\n\t 'bounce': {\n\t In: invertCurve(bounceCurve),\n\t Out: bounceCurve\n\t },\n\t 'cosine': {\n\t In: cosineCurve,\n\t Out: reverseCurve(cosineCurve)\n\t },\n\t 'step': {\n\t In: stairsCurve,\n\t Out: invertCurve(stairsCurve)\n\t },\n\t 'ripple': {\n\t In: rippleCurve,\n\t Out: invertCurve(rippleCurve)\n\t },\n\t 'sine': {\n\t In: sineCurve,\n\t Out: invertCurve(sineCurve)\n\t }\n\t };\n\t }());\n\t /**\n\t\t * Disconnect and dispose.\n\t\t * @returns {Tone.Envelope} this\n\t\t */\n\t Tone.Envelope.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._sig.dispose();\n\t this._sig = null;\n\t this._attackCurve = null;\n\t this._releaseCurve = null;\n\t return this;\n\t };\n\t return Tone.Envelope;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AmplitudeEnvelope is a Tone.Envelope connected to a gain node.\n\t\t * Unlike Tone.Envelope, which outputs the envelope's value, Tone.AmplitudeEnvelope accepts\n\t\t * an audio signal as the input and will apply the envelope to the amplitude\n\t\t * of the signal. Read more about ADSR Envelopes on [Wikipedia](https://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Envelope}\n\t\t * @param {Time|Object} [attack] The amount of time it takes for the envelope to go from\n\t\t * 0 to it's maximum value.\n\t\t * @param {Time} [decay]\tThe period of time after the attack that it takes for the envelope\n\t\t * \tto fall to the sustain value.\n\t\t * @param {NormalRange} [sustain]\tThe percent of the maximum value that the envelope rests at until\n\t\t * \tthe release is triggered.\n\t\t * @param {Time} [release]\tThe amount of time after the release is triggered it takes to reach 0.\n\t\t * @example\n\t\t * var ampEnv = new Tone.AmplitudeEnvelope({\n\t\t * \t\"attack\": 0.1,\n\t\t * \t\"decay\": 0.2,\n\t\t * \t\"sustain\": 1.0,\n\t\t * \t\"release\": 0.8\n\t\t * }).toMaster();\n\t\t * //create an oscillator and connect it\n\t\t * var osc = new Tone.Oscillator().connect(ampEnv).start();\n\t\t * //trigger the envelopes attack and release \"8t\" apart\n\t\t * ampEnv.triggerAttackRelease(\"8t\");\n\t\t */\n\t Tone.AmplitudeEnvelope = function () {\n\t Tone.Envelope.apply(this, arguments);\n\t /**\n\t\t\t * the input node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.input = this.output = new Tone.Gain();\n\t this._sig.connect(this.output.gain);\n\t };\n\t Tone.extend(Tone.AmplitudeEnvelope, Tone.Envelope);\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.AmplitudeEnvelope} this\n\t\t */\n\t Tone.AmplitudeEnvelope.prototype.dispose = function () {\n\t Tone.Envelope.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.AmplitudeEnvelope;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * AnalyserNode.getFloatTimeDomainData polyfill\n\t\t * @private\n\t\t */\n\t if (Tone.supported) {\n\t if (!AnalyserNode.prototype.getFloatTimeDomainData) {\n\t //referenced https://github.com/mohayonao/get-float-time-domain-data\n\t AnalyserNode.prototype.getFloatTimeDomainData = function (array) {\n\t var uint8 = new Uint8Array(array.length);\n\t this.getByteTimeDomainData(uint8);\n\t for (var i = 0; i < uint8.length; i++) {\n\t array[i] = (uint8[i] - 128) / 128;\n\t }\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Wrapper around the native Web Audio's\n\t\t * [AnalyserNode](http://webaudio.github.io/web-audio-api/#idl-def-AnalyserNode).\n\t\t * Extracts FFT or Waveform data from the incoming signal.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {String=} type The return type of the analysis, either \"fft\", or \"waveform\".\n\t\t * @param {Number=} size The size of the FFT. Value must be a power of\n\t\t * two in the range 32 to 32768.\n\t\t */\n\t Tone.Analyser = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'type',\n\t 'size'\n\t ], Tone.Analyser);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node.\n\t\t\t * @private\n\t\t\t * @type {AnalyserNode}\n\t\t\t */\n\t this._analyser = this.input = this.output = this.context.createAnalyser();\n\t /**\n\t\t\t * The analysis type\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * The buffer that the FFT data is written to\n\t\t\t * @type {TypedArray}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = null;\n\t //set the values initially\n\t this.size = options.size;\n\t this.type = options.type;\n\t };\n\t Tone.extend(Tone.Analyser, Tone.AudioNode);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Analyser.defaults = {\n\t 'size': 1024,\n\t 'type': 'fft',\n\t 'smoothing': 0.8\n\t };\n\t /**\n\t\t * Possible return types of analyser.getValue()\n\t\t * @enum {String}\n\t\t */\n\t Tone.Analyser.Type = {\n\t Waveform: 'waveform',\n\t FFT: 'fft'\n\t };\n\t /**\n\t\t * Run the analysis given the current settings and return the\n\t\t * result as a TypedArray.\n\t\t * @returns {TypedArray}\n\t\t */\n\t Tone.Analyser.prototype.getValue = function () {\n\t if (this._type === Tone.Analyser.Type.FFT) {\n\t this._analyser.getFloatFrequencyData(this._buffer);\n\t } else if (this._type === Tone.Analyser.Type.Waveform) {\n\t this._analyser.getFloatTimeDomainData(this._buffer);\n\t }\n\t return this._buffer;\n\t };\n\t /**\n\t\t * The size of analysis. This must be a power of two in the range 32 to 32768.\n\t\t * @memberOf Tone.Analyser#\n\t\t * @type {Number}\n\t\t * @name size\n\t\t */\n\t Object.defineProperty(Tone.Analyser.prototype, 'size', {\n\t get: function () {\n\t return this._analyser.frequencyBinCount;\n\t },\n\t set: function (size) {\n\t this._analyser.fftSize = size * 2;\n\t this._buffer = new Float32Array(size);\n\t }\n\t });\n\t /**\n\t\t * The analysis function returned by analyser.getValue(), either \"fft\" or \"waveform\".\n\t\t * @memberOf Tone.Analyser#\n\t\t * @type {String}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Analyser.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t if (type !== Tone.Analyser.Type.Waveform && type !== Tone.Analyser.Type.FFT) {\n\t throw new TypeError('Tone.Analyser: invalid type: ' + type);\n\t }\n\t this._type = type;\n\t }\n\t });\n\t /**\n\t\t * 0 represents no time averaging with the last analysis frame.\n\t\t * @memberOf Tone.Analyser#\n\t\t * @type {NormalRange}\n\t\t * @name smoothing\n\t\t */\n\t Object.defineProperty(Tone.Analyser.prototype, 'smoothing', {\n\t get: function () {\n\t return this._analyser.smoothingTimeConstant;\n\t },\n\t set: function (val) {\n\t this._analyser.smoothingTimeConstant = val;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Analyser} this\n\t\t */\n\t Tone.Analyser.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.disconnect();\n\t this._analyser = null;\n\t this._buffer = null;\n\t };\n\t return Tone.Analyser;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Compressor is a thin wrapper around the Web Audio\n\t\t * [DynamicsCompressorNode](http://webaudio.github.io/web-audio-api/#the-dynamicscompressornode-interface).\n\t\t * Compression reduces the volume of loud sounds or amplifies quiet sounds\n\t\t * by narrowing or \"compressing\" an audio signal's dynamic range.\n\t\t * Read more on [Wikipedia](https://en.wikipedia.org/wiki/Dynamic_range_compression).\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Decibels|Object} [threshold] The value above which the compression starts to be applied.\n\t\t * @param {Positive} [ratio] The gain reduction ratio.\n\t\t * @example\n\t\t * var comp = new Tone.Compressor(-30, 3);\n\t\t */\n\t Tone.Compressor = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'threshold',\n\t 'ratio'\n\t ], Tone.Compressor);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the compressor node\n\t\t\t * @type {DynamicsCompressorNode}\n\t\t\t * @private\n\t\t\t */\n\t this._compressor = this.input = this.output = this.context.createDynamicsCompressor();\n\t /**\n\t\t\t * the threshold vaue\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.threshold = new Tone.Param({\n\t 'param': this._compressor.threshold,\n\t 'units': Tone.Type.Decibels,\n\t 'convert': false\n\t });\n\t /**\n\t\t\t * The attack parameter\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.attack = new Tone.Param(this._compressor.attack, Tone.Type.Time);\n\t /**\n\t\t\t * The release parameter\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.release = new Tone.Param(this._compressor.release, Tone.Type.Time);\n\t /**\n\t\t\t * The knee parameter\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.knee = new Tone.Param({\n\t 'param': this._compressor.knee,\n\t 'units': Tone.Type.Decibels,\n\t 'convert': false\n\t });\n\t /**\n\t\t\t * The ratio value\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.ratio = new Tone.Param({\n\t 'param': this._compressor.ratio,\n\t 'convert': false\n\t });\n\t //set the defaults\n\t this._readOnly([\n\t 'knee',\n\t 'release',\n\t 'attack',\n\t 'ratio',\n\t 'threshold'\n\t ]);\n\t this.set(options);\n\t };\n\t Tone.extend(Tone.Compressor, Tone.AudioNode);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Compressor.defaults = {\n\t 'ratio': 12,\n\t 'threshold': -24,\n\t 'release': 0.25,\n\t 'attack': 0.003,\n\t 'knee': 30\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Compressor} this\n\t\t */\n\t Tone.Compressor.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'knee',\n\t 'release',\n\t 'attack',\n\t 'ratio',\n\t 'threshold'\n\t ]);\n\t this._compressor.disconnect();\n\t this._compressor = null;\n\t this.attack.dispose();\n\t this.attack = null;\n\t this.release.dispose();\n\t this.release = null;\n\t this.threshold.dispose();\n\t this.threshold = null;\n\t this.ratio.dispose();\n\t this.ratio = null;\n\t this.knee.dispose();\n\t this.knee = null;\n\t return this;\n\t };\n\t return Tone.Compressor;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Add a signal and a number or two signals. When no value is\n\t\t * passed into the constructor, Tone.Add will sum <code>input[0]</code>\n\t\t * and <code>input[1]</code>. If a value is passed into the constructor, \n\t\t * the it will be added to the input.\n\t\t * \n\t\t * @constructor\n\t\t * @extends {Tone.Signal}\n\t\t * @param {number=} value If no value is provided, Tone.Add will sum the first\n\t\t * and second inputs. \n\t\t * @example\n\t\t * var signal = new Tone.Signal(2);\n\t\t * var add = new Tone.Add(2);\n\t\t * signal.connect(add);\n\t\t * //the output of add equals 4\n\t\t * @example\n\t\t * //if constructed with no arguments\n\t\t * //it will add the first and second inputs\n\t\t * var add = new Tone.Add();\n\t\t * var sig0 = new Tone.Signal(3).connect(add, 0, 0);\n\t\t * var sig1 = new Tone.Signal(4).connect(add, 0, 1);\n\t\t * //the output of add equals 7. \n\t\t */\n\t Tone.Add = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * the summing node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._sum = this.input[0] = this.input[1] = this.output = new Tone.Gain();\n\t /**\n\t\t\t * @private\n\t\t\t * @type {Tone.Signal}\n\t\t\t */\n\t this._param = this.input[1] = new Tone.Signal(value);\n\t this._param.connect(this._sum);\n\t };\n\t Tone.extend(Tone.Add, Tone.Signal);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Add} this\n\t\t */\n\t Tone.Add.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._sum.dispose();\n\t this._sum = null;\n\t return this;\n\t };\n\t return Tone.Add;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Multiply two incoming signals. Or, if a number is given in the constructor,\n\t\t * multiplies the incoming signal by that value.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Signal}\n\t\t * @param {number=} value Constant value to multiple. If no value is provided,\n\t\t * it will return the product of the first and second inputs\n\t\t * @example\n\t\t * var mult = new Tone.Multiply();\n\t\t * var sigA = new Tone.Signal(3);\n\t\t * var sigB = new Tone.Signal(4);\n\t\t * sigA.connect(mult, 0, 0);\n\t\t * sigB.connect(mult, 0, 1);\n\t\t * //output of mult is 12.\n\t\t * @example\n\t\t * var mult = new Tone.Multiply(10);\n\t\t * var sig = new Tone.Signal(2).connect(mult);\n\t\t * //the output of mult is 20.\n\t\t */\n\t Tone.Multiply = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * the input node is the same as the output node\n\t\t\t * it is also the GainNode which handles the scaling of incoming signal\n\t\t\t *\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._mult = this.input[0] = this.output = new Tone.Gain();\n\t /**\n\t\t\t * the scaling parameter\n\t\t\t * @type {AudioParam}\n\t\t\t * @private\n\t\t\t */\n\t this._param = this.input[1] = this.output.gain;\n\t this.value = Tone.defaultArg(value, 0);\n\t };\n\t Tone.extend(Tone.Multiply, Tone.Signal);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Multiply} this\n\t\t */\n\t Tone.Multiply.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._mult.dispose();\n\t this._mult = null;\n\t this._param = null;\n\t return this;\n\t };\n\t return Tone.Multiply;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Negate the incoming signal. i.e. an input signal of 10 will output -10\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @example\n\t\t * var neg = new Tone.Negate();\n\t\t * var sig = new Tone.Signal(-2).connect(neg);\n\t\t * //output of neg is positive 2. \n\t\t */\n\t Tone.Negate = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * negation is done by multiplying by -1\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._multiply = this.input = this.output = new Tone.Multiply(-1);\n\t };\n\t Tone.extend(Tone.Negate, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Negate} this\n\t\t */\n\t Tone.Negate.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._multiply.dispose();\n\t this._multiply = null;\n\t return this;\n\t };\n\t return Tone.Negate;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Subtract the signal connected to <code>input[1]</code> from the signal connected \n\t\t * to <code>input[0]</code>. If an argument is provided in the constructor, the \n\t\t * signals <code>.value</code> will be subtracted from the incoming signal.\n\t\t *\n\t\t * @extends {Tone.Signal}\n\t\t * @constructor\n\t\t * @param {number=} value The value to subtract from the incoming signal. If the value\n\t\t * is omitted, it will subtract the second signal from the first.\n\t\t * @example\n\t\t * var sub = new Tone.Subtract(1);\n\t\t * var sig = new Tone.Signal(4).connect(sub);\n\t\t * //the output of sub is 3. \n\t\t * @example\n\t\t * var sub = new Tone.Subtract();\n\t\t * var sigA = new Tone.Signal(10);\n\t\t * var sigB = new Tone.Signal(2.5);\n\t\t * sigA.connect(sub, 0, 0);\n\t\t * sigB.connect(sub, 0, 1);\n\t\t * //output of sub is 7.5\n\t\t */\n\t Tone.Subtract = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * the summing node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._sum = this.input[0] = this.output = new Tone.Gain();\n\t /**\n\t\t\t * negate the input of the second input before connecting it\n\t\t\t * to the summing node.\n\t\t\t * @type {Tone.Negate}\n\t\t\t * @private\n\t\t\t */\n\t this._neg = new Tone.Negate();\n\t /**\n\t\t\t * the node where the value is set\n\t\t\t * @private\n\t\t\t * @type {Tone.Signal}\n\t\t\t */\n\t this._param = this.input[1] = new Tone.Signal(value);\n\t this._param.chain(this._neg, this._sum);\n\t };\n\t Tone.extend(Tone.Subtract, Tone.Signal);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.SignalBase} this\n\t\t */\n\t Tone.Subtract.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._neg.dispose();\n\t this._neg = null;\n\t this._sum.disconnect();\n\t this._sum = null;\n\t return this;\n\t };\n\t return Tone.Subtract;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Convert an incoming signal between 0, 1 to an equal power gain scale.\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @example\n\t\t * var eqPowGain = new Tone.EqualPowerGain();\n\t\t */\n\t Tone.EqualPowerGain = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._eqPower = this.input = this.output = new Tone.WaveShaper(function (val) {\n\t if (Math.abs(val) < 0.001) {\n\t //should output 0 when input is 0\n\t return 0;\n\t } else {\n\t return Tone.equalPowerScale(val);\n\t }\n\t }.bind(this), 4096);\n\t };\n\t Tone.extend(Tone.EqualPowerGain, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.EqualPowerGain} this\n\t\t */\n\t Tone.EqualPowerGain.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._eqPower.dispose();\n\t this._eqPower = null;\n\t return this;\n\t };\n\t return Tone.EqualPowerGain;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Crossfade provides equal power fading between two inputs.\n\t\t * More on crossfading technique [here](https://en.wikipedia.org/wiki/Fade_(audio_engineering)#Crossfading).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {NormalRange} [initialFade=0.5]\n\t\t * @example\n\t\t * var crossFade = new Tone.CrossFade(0.5);\n\t\t * //connect effect A to crossfade from\n\t\t * //effect output 0 to crossfade input 0\n\t\t * effectA.connect(crossFade, 0, 0);\n\t\t * //connect effect B to crossfade from\n\t\t * //effect output 0 to crossfade input 1\n\t\t * effectB.connect(crossFade, 0, 1);\n\t\t * crossFade.fade.value = 0;\n\t\t * // ^ only effectA is output\n\t\t * crossFade.fade.value = 1;\n\t\t * // ^ only effectB is output\n\t\t * crossFade.fade.value = 0.5;\n\t\t * // ^ the two signals are mixed equally.\n\t\t */\n\t Tone.CrossFade = function (initialFade) {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(2, 1);\n\t /**\n\t\t\t * Alias for <code>input[0]</code>.\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.a = this.input[0] = new Tone.Gain();\n\t /**\n\t\t\t * Alias for <code>input[1]</code>.\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.b = this.input[1] = new Tone.Gain();\n\t /**\n\t\t\t * \tThe mix between the two inputs. A fade value of 0\n\t\t\t * \twill output 100% <code>input[0]</code> and\n\t\t\t * \ta value of 1 will output 100% <code>input[1]</code>.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.fade = new Tone.Signal(Tone.defaultArg(initialFade, 0.5), Tone.Type.NormalRange);\n\t /**\n\t\t\t * equal power gain cross fade\n\t\t\t * @private\n\t\t\t * @type {Tone.EqualPowerGain}\n\t\t\t */\n\t this._equalPowerA = new Tone.EqualPowerGain();\n\t /**\n\t\t\t * equal power gain cross fade\n\t\t\t * @private\n\t\t\t * @type {Tone.EqualPowerGain}\n\t\t\t */\n\t this._equalPowerB = new Tone.EqualPowerGain();\n\t /**\n\t\t\t * invert the incoming signal\n\t\t\t * @private\n\t\t\t * @type {Tone}\n\t\t\t */\n\t this._one = this.context.getConstant(1);\n\t /**\n\t\t\t * invert the incoming signal\n\t\t\t * @private\n\t\t\t * @type {Tone.Subtract}\n\t\t\t */\n\t this._invert = new Tone.Subtract();\n\t //connections\n\t this.a.connect(this.output);\n\t this.b.connect(this.output);\n\t this.fade.chain(this._equalPowerB, this.b.gain);\n\t this._one.connect(this._invert, 0, 0);\n\t this.fade.connect(this._invert, 0, 1);\n\t this._invert.chain(this._equalPowerA, this.a.gain);\n\t this._readOnly('fade');\n\t };\n\t Tone.extend(Tone.CrossFade, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.CrossFade} this\n\t\t */\n\t Tone.CrossFade.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('fade');\n\t this._equalPowerA.dispose();\n\t this._equalPowerA = null;\n\t this._equalPowerB.dispose();\n\t this._equalPowerB = null;\n\t this.fade.dispose();\n\t this.fade = null;\n\t this._invert.dispose();\n\t this._invert = null;\n\t this._one = null;\n\t this.a.dispose();\n\t this.a = null;\n\t this.b.dispose();\n\t this.b = null;\n\t return this;\n\t };\n\t return Tone.CrossFade;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Filter is a filter which allows for all of the same native methods\n\t\t * as the [BiquadFilterNode](http://webaudio.github.io/web-audio-api/#the-biquadfilternode-interface).\n\t\t * Tone.Filter has the added ability to set the filter rolloff at -12\n\t\t * (default), -24 and -48.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Frequency|Object} [frequency] The cutoff frequency of the filter.\n\t\t * @param {string=} type The type of filter.\n\t\t * @param {number=} rolloff The drop in decibels per octave after the cutoff frequency.\n\t\t * 3 choices: -12, -24, and -48\n\t\t * @example\n\t\t * var filter = new Tone.Filter(200, \"highpass\");\n\t\t */\n\t Tone.Filter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'rolloff'\n\t ], Tone.Filter);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the filter(s)\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._filters = [];\n\t /**\n\t\t\t * The cutoff frequency of the filter.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune parameter\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(0, Tone.Type.Cents);\n\t /**\n\t\t\t * The gain of the filter, only used in certain filter types\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.gain = new Tone.Signal({\n\t 'value': options.gain,\n\t 'convert': false\n\t });\n\t /**\n\t\t\t * The Q or Quality of the filter\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = new Tone.Signal(options.Q);\n\t /**\n\t\t\t * the type of the filter\n\t\t\t * @type {string}\n\t\t\t * @private\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * the rolloff value of the filter\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._rolloff = options.rolloff;\n\t //set the rolloff;\n\t this.rolloff = options.rolloff;\n\t this._readOnly([\n\t 'detune',\n\t 'frequency',\n\t 'gain',\n\t 'Q'\n\t ]);\n\t };\n\t Tone.extend(Tone.Filter, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t *\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Filter.defaults = {\n\t 'type': 'lowpass',\n\t 'frequency': 350,\n\t 'rolloff': -12,\n\t 'Q': 1,\n\t 'gain': 0\n\t };\n\t /**\n\t\t * The type of the filter. Types: \"lowpass\", \"highpass\",\n\t\t * \"bandpass\", \"lowshelf\", \"highshelf\", \"notch\", \"allpass\", or \"peaking\".\n\t\t * @memberOf Tone.Filter#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Filter.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t var types = [\n\t 'lowpass',\n\t 'highpass',\n\t 'bandpass',\n\t 'lowshelf',\n\t 'highshelf',\n\t 'notch',\n\t 'allpass',\n\t 'peaking'\n\t ];\n\t if (types.indexOf(type) === -1) {\n\t throw new TypeError('Tone.Filter: invalid type ' + type);\n\t }\n\t this._type = type;\n\t for (var i = 0; i < this._filters.length; i++) {\n\t this._filters[i].type = type;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The rolloff of the filter which is the drop in db\n\t\t * per octave. Implemented internally by cascading filters.\n\t\t * Only accepts the values -12, -24, -48 and -96.\n\t\t * @memberOf Tone.Filter#\n\t\t * @type {number}\n\t\t * @name rolloff\n\t\t */\n\t Object.defineProperty(Tone.Filter.prototype, 'rolloff', {\n\t get: function () {\n\t return this._rolloff;\n\t },\n\t set: function (rolloff) {\n\t rolloff = parseInt(rolloff, 10);\n\t var possibilities = [\n\t -12,\n\t -24,\n\t -48,\n\t -96\n\t ];\n\t var cascadingCount = possibilities.indexOf(rolloff);\n\t //check the rolloff is valid\n\t if (cascadingCount === -1) {\n\t throw new RangeError('Tone.Filter: rolloff can only be -12, -24, -48 or -96');\n\t }\n\t cascadingCount += 1;\n\t this._rolloff = rolloff;\n\t //first disconnect the filters and throw them away\n\t this.input.disconnect();\n\t for (var i = 0; i < this._filters.length; i++) {\n\t this._filters[i].disconnect();\n\t this._filters[i] = null;\n\t }\n\t this._filters = new Array(cascadingCount);\n\t for (var count = 0; count < cascadingCount; count++) {\n\t var filter = this.context.createBiquadFilter();\n\t filter.type = this._type;\n\t this.frequency.connect(filter.frequency);\n\t this.detune.connect(filter.detune);\n\t this.Q.connect(filter.Q);\n\t this.gain.connect(filter.gain);\n\t this._filters[count] = filter;\n\t }\n\t //connect them up\n\t var connectionChain = [this.input].concat(this._filters).concat([this.output]);\n\t Tone.connectSeries.apply(Tone, connectionChain);\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Filter} this\n\t\t */\n\t Tone.Filter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t for (var i = 0; i < this._filters.length; i++) {\n\t this._filters[i].disconnect();\n\t this._filters[i] = null;\n\t }\n\t this._filters = null;\n\t this._writable([\n\t 'detune',\n\t 'frequency',\n\t 'gain',\n\t 'Q'\n\t ]);\n\t this.frequency.dispose();\n\t this.Q.dispose();\n\t this.frequency = null;\n\t this.Q = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.gain.dispose();\n\t this.gain = null;\n\t return this;\n\t };\n\t return Tone.Filter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Split the incoming signal into three bands (low, mid, high)\n\t\t * with two crossover frequency controls.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Frequency|Object} [lowFrequency] the low/mid crossover frequency\n\t\t * @param {Frequency} [highFrequency] the mid/high crossover frequency\n\t\t */\n\t Tone.MultibandSplit = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'lowFrequency',\n\t 'highFrequency'\n\t ], Tone.MultibandSplit);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the input\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.input = new Tone.Gain();\n\t /**\n\t\t\t * the outputs\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this.output = new Array(3);\n\t /**\n\t\t\t * The low band. Alias for <code>output[0]</code>\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.low = this.output[0] = new Tone.Filter(0, 'lowpass');\n\t /**\n\t\t\t * the lower filter of the mid band\n\t\t\t * @type {Tone.Filter}\n\t\t\t * @private\n\t\t\t */\n\t this._lowMidFilter = new Tone.Filter(0, 'highpass');\n\t /**\n\t\t\t * The mid band output. Alias for <code>output[1]</code>\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.mid = this.output[1] = new Tone.Filter(0, 'lowpass');\n\t /**\n\t\t\t * The high band output. Alias for <code>output[2]</code>\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.high = this.output[2] = new Tone.Filter(0, 'highpass');\n\t /**\n\t\t\t * The low/mid crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.lowFrequency = new Tone.Signal(options.lowFrequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The mid/high crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.highFrequency = new Tone.Signal(options.highFrequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The quality of all the filters\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = new Tone.Signal(options.Q);\n\t this.input.fan(this.low, this.high);\n\t this.input.chain(this._lowMidFilter, this.mid);\n\t //the frequency control signal\n\t this.lowFrequency.connect(this.low.frequency);\n\t this.lowFrequency.connect(this._lowMidFilter.frequency);\n\t this.highFrequency.connect(this.mid.frequency);\n\t this.highFrequency.connect(this.high.frequency);\n\t //the Q value\n\t this.Q.connect(this.low.Q);\n\t this.Q.connect(this._lowMidFilter.Q);\n\t this.Q.connect(this.mid.Q);\n\t this.Q.connect(this.high.Q);\n\t this._readOnly([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t };\n\t Tone.extend(Tone.MultibandSplit, Tone.AudioNode);\n\t /**\n\t\t * @private\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MultibandSplit.defaults = {\n\t 'lowFrequency': 400,\n\t 'highFrequency': 2500,\n\t 'Q': 1\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MultibandSplit} this\n\t\t */\n\t Tone.MultibandSplit.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t this.low.dispose();\n\t this.low = null;\n\t this._lowMidFilter.dispose();\n\t this._lowMidFilter = null;\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.high.dispose();\n\t this.high = null;\n\t this.lowFrequency.dispose();\n\t this.lowFrequency = null;\n\t this.highFrequency.dispose();\n\t this.highFrequency = null;\n\t this.Q.dispose();\n\t this.Q = null;\n\t return this;\n\t };\n\t return Tone.MultibandSplit;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.EQ3 is a three band EQ with control over low, mid, and high gain as\n\t\t * well as the low and high crossover frequencies.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t *\n\t\t * @param {Decibels|Object} [lowLevel] The gain applied to the lows.\n\t\t * @param {Decibels} [midLevel] The gain applied to the mid.\n\t\t * @param {Decibels} [highLevel] The gain applied to the high.\n\t\t * @example\n\t\t * var eq = new Tone.EQ3(-10, 3, -20);\n\t\t */\n\t Tone.EQ3 = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'low',\n\t 'mid',\n\t 'high'\n\t ], Tone.EQ3);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the output node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.output = new Tone.Gain();\n\t /**\n\t\t\t * the multiband split\n\t\t\t * @type {Tone.MultibandSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._multibandSplit = this.input = new Tone.MultibandSplit({\n\t 'lowFrequency': options.lowFrequency,\n\t 'highFrequency': options.highFrequency\n\t });\n\t /**\n\t\t\t * The gain for the lower signals\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._lowGain = new Tone.Gain(options.low, Tone.Type.Decibels);\n\t /**\n\t\t\t * The gain for the mid signals\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._midGain = new Tone.Gain(options.mid, Tone.Type.Decibels);\n\t /**\n\t\t\t * The gain in decibels of the high part\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._highGain = new Tone.Gain(options.high, Tone.Type.Decibels);\n\t /**\n\t\t\t * The gain in decibels of the low part\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.low = this._lowGain.gain;\n\t /**\n\t\t\t * The gain in decibels of the mid part\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.mid = this._midGain.gain;\n\t /**\n\t\t\t * The gain in decibels of the high part\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.high = this._highGain.gain;\n\t /**\n\t\t\t * The Q value for all of the filters.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = this._multibandSplit.Q;\n\t /**\n\t\t\t * The low/mid crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.lowFrequency = this._multibandSplit.lowFrequency;\n\t /**\n\t\t\t * The mid/high crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.highFrequency = this._multibandSplit.highFrequency;\n\t //the frequency bands\n\t this._multibandSplit.low.chain(this._lowGain, this.output);\n\t this._multibandSplit.mid.chain(this._midGain, this.output);\n\t this._multibandSplit.high.chain(this._highGain, this.output);\n\t this._readOnly([\n\t 'low',\n\t 'mid',\n\t 'high',\n\t 'lowFrequency',\n\t 'highFrequency'\n\t ]);\n\t };\n\t Tone.extend(Tone.EQ3, Tone.AudioNode);\n\t /**\n\t\t * the default values\n\t\t */\n\t Tone.EQ3.defaults = {\n\t 'low': 0,\n\t 'mid': 0,\n\t 'high': 0,\n\t 'lowFrequency': 400,\n\t 'highFrequency': 2500\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.EQ3} this\n\t\t */\n\t Tone.EQ3.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'low',\n\t 'mid',\n\t 'high',\n\t 'lowFrequency',\n\t 'highFrequency'\n\t ]);\n\t this._multibandSplit.dispose();\n\t this._multibandSplit = null;\n\t this.lowFrequency = null;\n\t this.highFrequency = null;\n\t this._lowGain.dispose();\n\t this._lowGain = null;\n\t this._midGain.dispose();\n\t this._midGain = null;\n\t this._highGain.dispose();\n\t this._highGain = null;\n\t this.low = null;\n\t this.mid = null;\n\t this.high = null;\n\t this.Q = null;\n\t return this;\n\t };\n\t return Tone.EQ3;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Performs a linear scaling on an input signal.\n\t\t * Scales a NormalRange input to between\n\t\t * outputMin and outputMax.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @param {number} [outputMin=0] The output value when the input is 0. \n\t\t * @param {number} [outputMax=1]\tThe output value when the input is 1. \n\t\t * @example\n\t\t * var scale = new Tone.Scale(50, 100);\n\t\t * var signal = new Tone.Signal(0.5).connect(scale);\n\t\t * //the output of scale equals 75\n\t\t */\n\t Tone.Scale = function (outputMin, outputMax) {\n\t Tone.SignalBase.call(this);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._outputMin = Tone.defaultArg(outputMin, 0);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._outputMax = Tone.defaultArg(outputMax, 1);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.input = new Tone.Multiply(1);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {Tone.Add}\n\t\t\t * @private\n\t\t\t */\n\t this._add = this.output = new Tone.Add(0);\n\t this._scale.connect(this._add);\n\t this._setRange();\n\t };\n\t Tone.extend(Tone.Scale, Tone.SignalBase);\n\t /**\n\t\t * The minimum output value. This number is output when \n\t\t * the value input value is 0. \n\t\t * @memberOf Tone.Scale#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.Scale.prototype, 'min', {\n\t get: function () {\n\t return this._outputMin;\n\t },\n\t set: function (min) {\n\t this._outputMin = min;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * The maximum output value. This number is output when \n\t\t * the value input value is 1. \n\t\t * @memberOf Tone.Scale#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.Scale.prototype, 'max', {\n\t get: function () {\n\t return this._outputMax;\n\t },\n\t set: function (max) {\n\t this._outputMax = max;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * set the values\n\t\t * @private\n\t\t */\n\t Tone.Scale.prototype._setRange = function () {\n\t this._add.value = this._outputMin;\n\t this._scale.value = this._outputMax - this._outputMin;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Scale} this\n\t\t */\n\t Tone.Scale.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._add.dispose();\n\t this._add = null;\n\t this._scale.dispose();\n\t this._scale = null;\n\t return this;\n\t };\n\t return Tone.Scale;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Performs an exponential scaling on an input signal.\n\t\t * Scales a NormalRange value [0,1] exponentially\n\t\t * to the output range of outputMin to outputMax.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @param {number} [outputMin=0] The output value when the input is 0.\n\t\t * @param {number} [outputMax=1]\tThe output value when the input is 1.\n\t\t * @param {number} [exponent=2] The exponent which scales the incoming signal.\n\t\t * @example\n\t\t * var scaleExp = new Tone.ScaleExp(0, 100, 2);\n\t\t * var signal = new Tone.Signal(0.5).connect(scaleExp);\n\t\t */\n\t Tone.ScaleExp = function (outputMin, outputMax, exponent) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * scale the input to the output range\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.output = new Tone.Scale(outputMin, outputMax);\n\t /**\n\t\t\t * @private\n\t\t\t * @type {Tone.Pow}\n\t\t\t * @private\n\t\t\t */\n\t this._exp = this.input = new Tone.Pow(Tone.defaultArg(exponent, 2));\n\t this._exp.connect(this._scale);\n\t };\n\t Tone.extend(Tone.ScaleExp, Tone.SignalBase);\n\t /**\n\t\t * Instead of interpolating linearly between the <code>min</code> and\n\t\t * <code>max</code> values, setting the exponent will interpolate between\n\t\t * the two values with an exponential curve.\n\t\t * @memberOf Tone.ScaleExp#\n\t\t * @type {number}\n\t\t * @name exponent\n\t\t */\n\t Object.defineProperty(Tone.ScaleExp.prototype, 'exponent', {\n\t get: function () {\n\t return this._exp.value;\n\t },\n\t set: function (exp) {\n\t this._exp.value = exp;\n\t }\n\t });\n\t /**\n\t\t * The minimum output value. This number is output when\n\t\t * the value input value is 0.\n\t\t * @memberOf Tone.ScaleExp#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.ScaleExp.prototype, 'min', {\n\t get: function () {\n\t return this._scale.min;\n\t },\n\t set: function (min) {\n\t this._scale.min = min;\n\t }\n\t });\n\t /**\n\t\t * The maximum output value. This number is output when\n\t\t * the value input value is 1.\n\t\t * @memberOf Tone.ScaleExp#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.ScaleExp.prototype, 'max', {\n\t get: function () {\n\t return this._scale.max;\n\t },\n\t set: function (max) {\n\t this._scale.max = max;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.ScaleExp} this\n\t\t */\n\t Tone.ScaleExp.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._exp.dispose();\n\t this._exp = null;\n\t return this;\n\t };\n\t return Tone.ScaleExp;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Wrapper around Web Audio's native [DelayNode](http://webaudio.github.io/web-audio-api/#the-delaynode-interface).\n\t\t * @extends {Tone}\n\t\t * @param {Time=} delayTime The delay applied to the incoming signal.\n\t\t * @param {Time=} maxDelay The maximum delay time.\n\t\t */\n\t Tone.Delay = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'maxDelay'\n\t ], Tone.Delay);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The maximum delay time initialized with the node\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._maxDelay = Math.max(this.toSeconds(options.maxDelay), this.toSeconds(options.delayTime));\n\t /**\n\t\t\t * The native delay node\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNode = this.input = this.output = this.context.createDelay(this._maxDelay);\n\t /**\n\t\t\t * The amount of time the incoming signal is\n\t\t\t * delayed.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = new Tone.Param({\n\t 'param': this._delayNode.delayTime,\n\t 'units': Tone.Type.Time,\n\t 'value': options.delayTime\n\t });\n\t this._readOnly('delayTime');\n\t };\n\t Tone.extend(Tone.Delay, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Delay.defaults = {\n\t 'maxDelay': 1,\n\t 'delayTime': 0\n\t };\n\t /**\n\t\t * The maximum delay time. This cannot be changed. The value is passed into the constructor.\n\t\t * @memberof Tone.Delay#\n\t\t * @type {Time}\n\t\t * @name maxDelay\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Delay.prototype, 'maxDelay', {\n\t get: function () {\n\t return this._maxDelay;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Delay} this\n\t\t */\n\t Tone.Delay.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._delayNode.disconnect();\n\t this._delayNode = null;\n\t this._writable('delayTime');\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.Delay;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Comb filters are basic building blocks for physical modeling. Read more\n\t\t * about comb filters on [CCRMA's website](https://ccrma.stanford.edu/~jos/pasp/Feedback_Comb_Filters.html).\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Time|Object} [delayTime] The delay time of the filter.\n\t\t * @param {NormalRange=} resonance The amount of feedback the filter has.\n\t\t */\n\t Tone.FeedbackCombFilter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'resonance'\n\t ], Tone.FeedbackCombFilter);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the delay node\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delay = this.input = this.output = new Tone.Delay(options.delayTime);\n\t /**\n\t\t\t * The amount of delay of the comb filter.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._delay.delayTime;\n\t /**\n\t\t\t * the feedback node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._feedback = new Tone.Gain(options.resonance, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of feedback of the delayed signal.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.resonance = this._feedback.gain;\n\t this._delay.chain(this._feedback, this._delay);\n\t this._readOnly([\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t };\n\t Tone.extend(Tone.FeedbackCombFilter, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.FeedbackCombFilter.defaults = {\n\t 'delayTime': 0.1,\n\t 'resonance': 0.5\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FeedbackCombFilter} this\n\t\t */\n\t Tone.FeedbackCombFilter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t this._delay.dispose();\n\t this._delay = null;\n\t this.delayTime = null;\n\t this._feedback.dispose();\n\t this._feedback = null;\n\t this.resonance = null;\n\t return this;\n\t };\n\t return Tone.FeedbackCombFilter;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Get the current waveform data of the connected audio source.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number=} size The size of the FFT. Value must be a power of\n\t\t * two in the range 32 to 32768.\n\t\t */\n\t Tone.FFT = function () {\n\t var options = Tone.defaults(arguments, ['size'], Tone.FFT);\n\t options.type = Tone.Analyser.Type.FFT;\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node.\n\t\t\t * @private\n\t\t\t * @type {Tone.Analyser}\n\t\t\t */\n\t this._analyser = this.input = this.output = new Tone.Analyser(options);\n\t };\n\t Tone.extend(Tone.FFT, Tone.AudioNode);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.FFT.defaults = { 'size': 1024 };\n\t /**\n\t\t * Gets the waveform of the audio source. Returns the waveform data\n\t\t * of length [size](#size) as a Float32Array with values between -1 and 1.\n\t\t * @returns {TypedArray}\n\t\t */\n\t Tone.FFT.prototype.getValue = function () {\n\t return this._analyser.getValue();\n\t };\n\t /**\n\t\t * The size of analysis. This must be a power of two in the range 32 to 32768.\n\t\t * @memberOf Tone.FFT#\n\t\t * @type {Number}\n\t\t * @name size\n\t\t */\n\t Object.defineProperty(Tone.FFT.prototype, 'size', {\n\t get: function () {\n\t return this._analyser.size;\n\t },\n\t set: function (size) {\n\t this._analyser.size = size;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.FFT} this\n\t\t */\n\t Tone.FFT.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.dispose();\n\t this._analyser = null;\n\t };\n\t return Tone.FFT;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Return the absolute value of an incoming signal.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @example\n\t\t * var signal = new Tone.Signal(-1);\n\t\t * var abs = new Tone.Abs();\n\t\t * signal.connect(abs);\n\t\t * //the output of abs is 1.\n\t\t */\n\t Tone.Abs = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {Tone.LessThan}\n\t\t\t * @private\n\t\t\t */\n\t this._abs = this.input = this.output = new Tone.WaveShaper(function (val) {\n\t if (Math.abs(val) < 0.001) {\n\t return 0;\n\t } else {\n\t return Math.abs(val);\n\t }\n\t }, 1024);\n\t };\n\t Tone.extend(Tone.Abs, Tone.SignalBase);\n\t /**\n\t\t * dispose method\n\t\t * @returns {Tone.Abs} this\n\t\t */\n\t Tone.Abs.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._abs.dispose();\n\t this._abs = null;\n\t return this;\n\t };\n\t return Tone.Abs;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Follower is a crude envelope follower which will follow\n\t\t * the amplitude of an incoming signal.\n\t\t * Take care with small (< 0.02) attack or decay values\n\t\t * as follower has some ripple which is exaggerated\n\t\t * at these values. Read more about envelope followers (also known\n\t\t * as envelope detectors) on [Wikipedia](https://en.wikipedia.org/wiki/Envelope_detector).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Time|Object} [attack] The rate at which the follower rises.\n\t\t * @param {Time=} release The rate at which the folower falls.\n\t\t * @example\n\t\t * var follower = new Tone.Follower(0.2, 0.4);\n\t\t */\n\t Tone.Follower = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'release'\n\t ], Tone.Follower);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * @type {Tone.Abs}\n\t\t\t * @private\n\t\t\t */\n\t this._abs = new Tone.Abs();\n\t /**\n\t\t\t * the lowpass filter which smooths the input\n\t\t\t * @type {BiquadFilterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._filter = this.context.createBiquadFilter();\n\t this._filter.type = 'lowpass';\n\t this._filter.frequency.value = 0;\n\t this._filter.Q.value = -100;\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._frequencyValues = new Tone.WaveShaper();\n\t /**\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._sub = new Tone.Subtract();\n\t /**\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delay = new Tone.Delay(this.blockTime);\n\t /**\n\t\t\t * this keeps it far from 0, even for very small differences\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._mult = new Tone.Multiply(10000);\n\t /**\n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._attack = options.attack;\n\t /**\n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._release = options.release;\n\t //the smoothed signal to get the values\n\t this.input.chain(this._abs, this._filter, this.output);\n\t //the difference path\n\t this._abs.connect(this._sub, 0, 1);\n\t this._filter.chain(this._delay, this._sub);\n\t //threshold the difference and use the thresh to set the frequency\n\t this._sub.chain(this._mult, this._frequencyValues, this._filter.frequency);\n\t //set the attack and release values in the table\n\t this._setAttackRelease(this._attack, this._release);\n\t };\n\t Tone.extend(Tone.Follower, Tone.AudioNode);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Follower.defaults = {\n\t 'attack': 0.05,\n\t 'release': 0.5\n\t };\n\t /**\n\t\t * sets the attack and release times in the wave shaper\n\t\t * @param {Time} attack\n\t\t * @param {Time} release\n\t\t * @private\n\t\t */\n\t Tone.Follower.prototype._setAttackRelease = function (attack, release) {\n\t var minTime = this.blockTime;\n\t attack = Tone.Time(attack).toFrequency();\n\t release = Tone.Time(release).toFrequency();\n\t attack = Math.max(attack, minTime);\n\t release = Math.max(release, minTime);\n\t this._frequencyValues.setMap(function (val) {\n\t if (val <= 0) {\n\t return attack;\n\t } else {\n\t return release;\n\t }\n\t });\n\t };\n\t /**\n\t\t * The attack time.\n\t\t * @memberOf Tone.Follower#\n\t\t * @type {Time}\n\t\t * @name attack\n\t\t */\n\t Object.defineProperty(Tone.Follower.prototype, 'attack', {\n\t get: function () {\n\t return this._attack;\n\t },\n\t set: function (attack) {\n\t this._attack = attack;\n\t this._setAttackRelease(this._attack, this._release);\n\t }\n\t });\n\t /**\n\t\t * The release time.\n\t\t * @memberOf Tone.Follower#\n\t\t * @type {Time}\n\t\t * @name release\n\t\t */\n\t Object.defineProperty(Tone.Follower.prototype, 'release', {\n\t get: function () {\n\t return this._release;\n\t },\n\t set: function (release) {\n\t this._release = release;\n\t this._setAttackRelease(this._attack, this._release);\n\t }\n\t });\n\t /**\n\t\t * Borrows the connect method from Signal so that the output can be used\n\t\t * as a Tone.Signal control signal.\n\t\t * @function\n\t\t */\n\t Tone.Follower.prototype.connect = Tone.SignalBase.prototype.connect;\n\t /**\n\t\t * dispose\n\t\t * @returns {Tone.Follower} this\n\t\t */\n\t Tone.Follower.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._filter.disconnect();\n\t this._filter = null;\n\t this._frequencyValues.disconnect();\n\t this._frequencyValues = null;\n\t this._delay.dispose();\n\t this._delay = null;\n\t this._sub.disconnect();\n\t this._sub = null;\n\t this._abs.dispose();\n\t this._abs = null;\n\t this._mult.dispose();\n\t this._mult = null;\n\t this._curve = null;\n\t return this;\n\t };\n\t return Tone.Follower;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.ScaledEnvelop is an envelope which can be scaled\n\t\t * to any range. It's useful for applying an envelope\n\t\t * to a frequency or any other non-NormalRange signal\n\t\t * parameter.\n\t\t *\n\t\t * @extends {Tone.Envelope}\n\t\t * @constructor\n\t\t * @param {Time|Object} [attack]\tthe attack time in seconds\n\t\t * @param {Time} [decay]\tthe decay time in seconds\n\t\t * @param {number} [sustain] \ta percentage (0-1) of the full amplitude\n\t\t * @param {Time} [release]\tthe release time in seconds\n\t\t * @example\n\t\t * var scaledEnv = new Tone.ScaledEnvelope({\n\t\t * \t\"attack\" : 0.2,\n\t\t * \t\"min\" : 200,\n\t\t * \t\"max\" : 2000\n\t\t * });\n\t\t * scaledEnv.connect(oscillator.frequency);\n\t\t */\n\t Tone.ScaledEnvelope = function () {\n\t //get all of the defaults\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'decay',\n\t 'sustain',\n\t 'release'\n\t ], Tone.Envelope);\n\t Tone.Envelope.call(this, options);\n\t options = Tone.defaultArg(options, Tone.ScaledEnvelope.defaults);\n\t /**\n\t\t\t * scale the incoming signal by an exponent\n\t\t\t * @type {Tone.Pow}\n\t\t\t * @private\n\t\t\t */\n\t this._exp = this.output = new Tone.Pow(options.exponent);\n\t /**\n\t\t\t * scale the signal to the desired range\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.output = new Tone.Scale(options.min, options.max);\n\t this._sig.chain(this._exp, this._scale);\n\t };\n\t Tone.extend(Tone.ScaledEnvelope, Tone.Envelope);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t */\n\t Tone.ScaledEnvelope.defaults = {\n\t 'min': 0,\n\t 'max': 1,\n\t 'exponent': 1\n\t };\n\t /**\n\t\t * The envelope's min output value. This is the value which it\n\t\t * starts at.\n\t\t * @memberOf Tone.ScaledEnvelope#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.ScaledEnvelope.prototype, 'min', {\n\t get: function () {\n\t return this._scale.min;\n\t },\n\t set: function (min) {\n\t this._scale.min = min;\n\t }\n\t });\n\t /**\n\t\t * The envelope's max output value. In other words, the value\n\t\t * at the peak of the attack portion of the envelope.\n\t\t * @memberOf Tone.ScaledEnvelope#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.ScaledEnvelope.prototype, 'max', {\n\t get: function () {\n\t return this._scale.max;\n\t },\n\t set: function (max) {\n\t this._scale.max = max;\n\t }\n\t });\n\t /**\n\t\t * The envelope's exponent value.\n\t\t * @memberOf Tone.ScaledEnvelope#\n\t\t * @type {number}\n\t\t * @name exponent\n\t\t */\n\t Object.defineProperty(Tone.ScaledEnvelope.prototype, 'exponent', {\n\t get: function () {\n\t return this._exp.value;\n\t },\n\t set: function (exp) {\n\t this._exp.value = exp;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.ScaledEnvelope} this\n\t\t */\n\t Tone.ScaledEnvelope.prototype.dispose = function () {\n\t Tone.Envelope.prototype.dispose.call(this);\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._exp.dispose();\n\t this._exp = null;\n\t return this;\n\t };\n\t return Tone.ScaledEnvelope;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FrequencyEnvelope is a Tone.ScaledEnvelope, but instead of `min` and `max`\n\t\t * it's got a `baseFrequency` and `octaves` parameter.\n\t\t *\n\t\t * @extends {Tone.Envelope}\n\t\t * @constructor\n\t\t * @param {Time|Object} [attack]\tthe attack time in seconds\n\t\t * @param {Time} [decay]\tthe decay time in seconds\n\t\t * @param {number} [sustain] \ta percentage (0-1) of the full amplitude\n\t\t * @param {Time} [release]\tthe release time in seconds\n\t\t * @example\n\t\t * var freqEnv = new Tone.FrequencyEnvelope({\n\t\t * \t\"attack\" : 0.2,\n\t\t * \t\"baseFrequency\" : \"C2\",\n\t\t * \t\"octaves\" : 4\n\t\t * });\n\t\t * freqEnv.connect(oscillator.frequency);\n\t\t */\n\t Tone.FrequencyEnvelope = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'decay',\n\t 'sustain',\n\t 'release'\n\t ], Tone.Envelope);\n\t Tone.ScaledEnvelope.call(this, options);\n\t //merge it with the frequency envelope defaults\n\t options = Tone.defaultArg(options, Tone.FrequencyEnvelope.defaults);\n\t /**\n\t\t\t * Stores the octave value\n\t\t\t * @type {Positive}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t //setup\n\t this.baseFrequency = options.baseFrequency;\n\t this.octaves = options.octaves;\n\t };\n\t Tone.extend(Tone.FrequencyEnvelope, Tone.Envelope);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t */\n\t Tone.FrequencyEnvelope.defaults = {\n\t 'baseFrequency': 200,\n\t 'octaves': 4,\n\t 'exponent': 2\n\t };\n\t /**\n\t\t * The envelope's mininum output value. This is the value which it\n\t\t * starts at.\n\t\t * @memberOf Tone.FrequencyEnvelope#\n\t\t * @type {Frequency}\n\t\t * @name baseFrequency\n\t\t */\n\t Object.defineProperty(Tone.FrequencyEnvelope.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._scale.min;\n\t },\n\t set: function (min) {\n\t this._scale.min = this.toFrequency(min);\n\t //also update the octaves\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * The number of octaves above the baseFrequency that the\n\t\t * envelope will scale to.\n\t\t * @memberOf Tone.FrequencyEnvelope#\n\t\t * @type {Positive}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.FrequencyEnvelope.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octaves) {\n\t this._octaves = octaves;\n\t this._scale.max = this.baseFrequency * Math.pow(2, octaves);\n\t }\n\t });\n\t /**\n\t\t * The envelope's exponent value.\n\t\t * @memberOf Tone.FrequencyEnvelope#\n\t\t * @type {number}\n\t\t * @name exponent\n\t\t */\n\t Object.defineProperty(Tone.FrequencyEnvelope.prototype, 'exponent', {\n\t get: function () {\n\t return this._exp.value;\n\t },\n\t set: function (exp) {\n\t this._exp.value = exp;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FrequencyEnvelope} this\n\t\t */\n\t Tone.FrequencyEnvelope.prototype.dispose = function () {\n\t Tone.ScaledEnvelope.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.FrequencyEnvelope;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class GreaterThanZero outputs 1 when the input is strictly greater than zero\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @example\n\t\t * var gt0 = new Tone.GreaterThanZero();\n\t\t * var sig = new Tone.Signal(0.01).connect(gt0);\n\t\t * //the output of gt0 is 1.\n\t\t * sig.value = 0;\n\t\t * //the output of gt0 is 0.\n\t\t */\n\t Tone.GreaterThanZero = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._thresh = this.output = new Tone.WaveShaper(function (val) {\n\t if (val <= 0) {\n\t return 0;\n\t } else {\n\t return 1;\n\t }\n\t }, 127);\n\t /**\n\t\t\t * scale the first thresholded signal by a large value.\n\t\t\t * this will help with values which are very close to 0\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.input = new Tone.Multiply(10000);\n\t //connections\n\t this._scale.connect(this._thresh);\n\t };\n\t Tone.extend(Tone.GreaterThanZero, Tone.SignalBase);\n\t /**\n\t\t * dispose method\n\t\t * @returns {Tone.GreaterThanZero} this\n\t\t */\n\t Tone.GreaterThanZero.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._thresh.dispose();\n\t this._thresh = null;\n\t return this;\n\t };\n\t return Tone.GreaterThanZero;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Output 1 if the signal is greater than the value, otherwise outputs 0.\n\t\t * can compare two signals or a signal and a number.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Signal}\n\t\t * @param {number} [value=0] the value to compare to the incoming signal\n\t\t * @example\n\t\t * var gt = new Tone.GreaterThan(2);\n\t\t * var sig = new Tone.Signal(4).connect(gt);\n\t\t * //output of gt is equal 1.\n\t\t */\n\t Tone.GreaterThan = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * subtract the amount from the incoming signal\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._param = this.input[0] = new Tone.Subtract(value);\n\t this.input[1] = this._param.input[1];\n\t /**\n\t\t\t * compare that amount to zero\n\t\t\t * @type {Tone.GreaterThanZero}\n\t\t\t * @private\n\t\t\t */\n\t this._gtz = this.output = new Tone.GreaterThanZero();\n\t //connect\n\t this._param.connect(this._gtz);\n\t };\n\t Tone.extend(Tone.GreaterThan, Tone.Signal);\n\t /**\n\t\t * dispose method\n\t\t * @returns {Tone.GreaterThan} this\n\t\t */\n\t Tone.GreaterThan.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._gtz.dispose();\n\t this._gtz = null;\n\t return this;\n\t };\n\t return Tone.GreaterThan;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Gate only passes a signal through when the incoming\n\t\t * signal exceeds a specified threshold. To do this, Gate uses\n\t\t * a Tone.Follower to follow the amplitude of the incoming signal.\n\t\t * A common implementation of this class is a [Noise Gate](https://en.wikipedia.org/wiki/Noise_gate).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Decibels|Object} [threshold] The threshold above which the gate will open.\n\t\t * @param {Time=} attack The follower's attack time\n\t\t * @param {Time=} release The follower's release time\n\t\t * @example\n\t\t * var gate = new Tone.Gate(-30, 0.2, 0.3).toMaster();\n\t\t * var mic = new Tone.UserMedia().connect(gate);\n\t\t * //the gate will only pass through the incoming\n\t\t * //signal when it's louder than -30db\n\t\t */\n\t Tone.Gate = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'threshold',\n\t 'attack',\n\t 'release'\n\t ], Tone.Gate);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * @type {Tone.Follower}\n\t\t\t * @private\n\t\t\t */\n\t this._follower = new Tone.Follower(options.attack, options.release);\n\t /**\n\t\t\t * @type {Tone.GreaterThan}\n\t\t\t * @private\n\t\t\t */\n\t this._gt = new Tone.GreaterThan(Tone.dbToGain(options.threshold));\n\t //the connections\n\t this.input.connect(this.output);\n\t //the control signal\n\t this.input.chain(this._gt, this._follower, this.output.gain);\n\t };\n\t Tone.extend(Tone.Gate, Tone.AudioNode);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Gate.defaults = {\n\t 'attack': 0.1,\n\t 'release': 0.1,\n\t 'threshold': -40\n\t };\n\t /**\n\t\t * The threshold of the gate in decibels\n\t\t * @memberOf Tone.Gate#\n\t\t * @type {Decibels}\n\t\t * @name threshold\n\t\t */\n\t Object.defineProperty(Tone.Gate.prototype, 'threshold', {\n\t get: function () {\n\t return Tone.gainToDb(this._gt.value);\n\t },\n\t set: function (thresh) {\n\t this._gt.value = Tone.dbToGain(thresh);\n\t }\n\t });\n\t /**\n\t\t * The attack speed of the gate\n\t\t * @memberOf Tone.Gate#\n\t\t * @type {Time}\n\t\t * @name attack\n\t\t */\n\t Object.defineProperty(Tone.Gate.prototype, 'attack', {\n\t get: function () {\n\t return this._follower.attack;\n\t },\n\t set: function (attackTime) {\n\t this._follower.attack = attackTime;\n\t }\n\t });\n\t /**\n\t\t * The release speed of the gate\n\t\t * @memberOf Tone.Gate#\n\t\t * @type {Time}\n\t\t * @name release\n\t\t */\n\t Object.defineProperty(Tone.Gate.prototype, 'release', {\n\t get: function () {\n\t return this._follower.release;\n\t },\n\t set: function (releaseTime) {\n\t this._follower.release = releaseTime;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Gate} this\n\t\t */\n\t Tone.Gate.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._follower.dispose();\n\t this._gt.dispose();\n\t this._follower = null;\n\t this._gt = null;\n\t return this;\n\t };\n\t return Tone.Gate;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TickSignal extends Tone.Signal, but adds the capability\n\t\t * to calculate the number of elapsed ticks. exponential and target curves\n\t\t * are approximated with multiple linear ramps.\n\t\t *\n\t\t * Thank you Bruno Dias, H. Sofia Pinto, and David M. Matos, for your [WAC paper](https://smartech.gatech.edu/bitstream/handle/1853/54588/WAC2016-49.pdf)\n\t\t * describing integrating timing functions for tempo calculations.\n\t\t *\n\t\t * @param {Number} value The initial value of the signal\n\t\t * @extends {Tone.Signal}\n\t\t */\n\t Tone.TickSignal = function (value) {\n\t value = Tone.defaultArg(value, 1);\n\t Tone.Signal.call(this, {\n\t 'units': Tone.Type.Ticks,\n\t 'value': value\n\t });\n\t //extend the memory\n\t this._events.memory = Infinity;\n\t //clear the clock from the beginning\n\t this.cancelScheduledValues(0);\n\t //set an initial event\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.SetValue,\n\t 'time': 0,\n\t 'value': value\n\t });\n\t };\n\t Tone.extend(Tone.TickSignal, Tone.Signal);\n\t /**\n\t\t * Wraps Tone.Signal methods so that they also\n\t\t * record the ticks.\n\t\t * @param {Function} method\n\t\t * @return {Function}\n\t\t * @private\n\t\t */\n\t function _wrapScheduleMethods(method) {\n\t return function (value, time) {\n\t time = this.toSeconds(time);\n\t method.apply(this, arguments);\n\t var event = this._events.get(time);\n\t var previousEvent = this._events.previousEvent(event);\n\t var ticksUntilTime = this._getTicksUntilEvent(previousEvent, time);\n\t event.ticks = Math.max(ticksUntilTime, 0);\n\t return this;\n\t };\n\t }\n\t Tone.TickSignal.prototype.setValueAtTime = _wrapScheduleMethods(Tone.Signal.prototype.setValueAtTime);\n\t Tone.TickSignal.prototype.linearRampToValueAtTime = _wrapScheduleMethods(Tone.Signal.prototype.linearRampToValueAtTime);\n\t /**\n\t\t * Start exponentially approaching the target value at the given time with\n\t\t * a rate having the given time constant.\n\t\t * @param {number} value\n\t\t * @param {Time} startTime\n\t\t * @param {number} timeConstant\n\t\t * @returns {Tone.TickSignal} this\n\t\t */\n\t Tone.TickSignal.prototype.setTargetAtTime = function (value, time, constant) {\n\t //aproximate it with multiple linear ramps\n\t time = this.toSeconds(time);\n\t this.setRampPoint(time);\n\t value = this._fromUnits(value);\n\t //start from previously scheduled value\n\t var prevEvent = this._events.get(time);\n\t var segments = Math.round(Math.max(1 / constant, 1));\n\t for (var i = 0; i <= segments; i++) {\n\t var segTime = constant * i + time;\n\t var rampVal = this._exponentialApproach(prevEvent.time, prevEvent.value, value, constant, segTime);\n\t this.linearRampToValueAtTime(this._toUnits(rampVal), segTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an exponential continuous change in parameter value from\n\t\t * the previous scheduled parameter value to the given value.\n\t\t * @param {number} value\n\t\t * @param {Time} endTime\n\t\t * @returns {Tone.TickSignal} this\n\t\t */\n\t Tone.TickSignal.prototype.exponentialRampToValueAtTime = function (value, time) {\n\t //aproximate it with multiple linear ramps\n\t time = this.toSeconds(time);\n\t value = this._fromUnits(value);\n\t //start from previously scheduled value\n\t var prevEvent = this._events.get(time);\n\t if (prevEvent === null) {\n\t prevEvent = {\n\t 'value': this._initialValue,\n\t 'time': 0\n\t };\n\t }\n\t //approx 10 segments per second\n\t var segments = Math.round(Math.max((time - prevEvent.time) * 10, 1));\n\t var segmentDur = (time - prevEvent.time) / segments;\n\t for (var i = 0; i <= segments; i++) {\n\t var segTime = segmentDur * i + prevEvent.time;\n\t var rampVal = this._exponentialInterpolate(prevEvent.time, prevEvent.value, time, value, segTime);\n\t this.linearRampToValueAtTime(this._toUnits(rampVal), segTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Returns the tick value at the time. Takes into account\n\t\t * any automation curves scheduled on the signal.\n\t\t * @private\n\t\t * @param {Time} time The time to get the tick count at\n\t\t * @return {Ticks} The number of ticks which have elapsed at the time\n\t\t * given any automations.\n\t\t */\n\t Tone.TickSignal.prototype._getTicksUntilEvent = function (event, time) {\n\t if (event === null) {\n\t event = {\n\t 'ticks': 0,\n\t 'time': 0\n\t };\n\t } else if (Tone.isUndef(event.ticks)) {\n\t var previousEvent = this._events.previousEvent(event);\n\t event.ticks = this._getTicksUntilEvent(previousEvent, event.time);\n\t }\n\t var val0 = this.getValueAtTime(event.time);\n\t var val1 = this.getValueAtTime(time);\n\t //if it's right on the line, take the previous value\n\t if (this._events.get(time).time === time && this._events.get(time).type === Tone.Param.AutomationType.SetValue) {\n\t val1 = this.getValueAtTime(time - this.sampleTime);\n\t }\n\t return 0.5 * (time - event.time) * (val0 + val1) + event.ticks;\n\t };\n\t /**\n\t\t * Returns the tick value at the time. Takes into account\n\t\t * any automation curves scheduled on the signal.\n\t\t * @param {Time} time The time to get the tick count at\n\t\t * @return {Ticks} The number of ticks which have elapsed at the time\n\t\t * given any automations.\n\t\t */\n\t Tone.TickSignal.prototype.getTicksAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var event = this._events.get(time);\n\t return Math.max(this._getTicksUntilEvent(event, time), 0);\n\t };\n\t /**\n\t\t * Return the elapsed time of the number of ticks from the given time\n\t\t * @param {Ticks} ticks The number of ticks to calculate\n\t\t * @param {Time} time The time to get the next tick from\n\t\t * @return {Seconds} The duration of the number of ticks from the given time in seconds\n\t\t */\n\t Tone.TickSignal.prototype.getDurationOfTicks = function (ticks, time) {\n\t time = this.toSeconds(time);\n\t var currentTick = this.getTicksAtTime(time);\n\t return this.getTimeOfTick(currentTick + ticks) - time;\n\t };\n\t /**\n\t\t * Given a tick, returns the time that tick occurs at.\n\t\t * @param {Ticks} tick\n\t\t * @return {Time} The time that the tick occurs.\n\t\t */\n\t Tone.TickSignal.prototype.getTimeOfTick = function (tick) {\n\t var before = this._events.get(tick, 'ticks');\n\t var after = this._events.getAfter(tick, 'ticks');\n\t if (before && before.ticks === tick) {\n\t return before.time;\n\t } else if (before && after && after.type === Tone.Param.AutomationType.Linear && before.value !== after.value) {\n\t var val0 = this.getValueAtTime(before.time);\n\t var val1 = this.getValueAtTime(after.time);\n\t var delta = (val1 - val0) / (after.time - before.time);\n\t var k = Math.sqrt(Math.pow(val0, 2) - 2 * delta * (before.ticks - tick));\n\t var sol1 = (-val0 + k) / delta;\n\t var sol2 = (-val0 - k) / delta;\n\t return (sol1 > 0 ? sol1 : sol2) + before.time;\n\t } else if (before) {\n\t if (before.value === 0) {\n\t return Infinity;\n\t } else {\n\t return before.time + (tick - before.ticks) / before.value;\n\t }\n\t } else {\n\t return tick / this._initialValue;\n\t }\n\t };\n\t /**\n\t\t * Convert some number of ticks their the duration in seconds accounting\n\t\t * for any automation curves starting at the given time.\n\t\t * @param {Ticks} ticks The number of ticks to convert to seconds.\n\t\t * @param {Time} [when=now] When along the automation timeline to convert the ticks.\n\t\t * @return {Tone.Time} The duration in seconds of the ticks.\n\t\t */\n\t Tone.TickSignal.prototype.ticksToTime = function (ticks, when) {\n\t when = this.toSeconds(when);\n\t return new Tone.Time(this.getDurationOfTicks(ticks, when));\n\t };\n\t /**\n\t\t * The inverse of [ticksToTime](#tickstotime). Convert a duration in\n\t\t * seconds to the corresponding number of ticks accounting for any\n\t\t * automation curves starting at the given time.\n\t\t * @param {Time} duration The time interval to convert to ticks.\n\t\t * @param {Time} [when=now] When along the automation timeline to convert the ticks.\n\t\t * @return {Tone.Ticks} The duration in ticks.\n\t\t */\n\t Tone.TickSignal.prototype.timeToTicks = function (duration, when) {\n\t when = this.toSeconds(when);\n\t duration = this.toSeconds(duration);\n\t var startTicks = this.getTicksAtTime(when);\n\t var endTicks = this.getTicksAtTime(when + duration);\n\t return new Tone.Ticks(endTicks - startTicks);\n\t };\n\t return Tone.TickSignal;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A Timeline State. Provides the methods: <code>setStateAtTime(\"state\", time)</code>\n\t\t * and <code>getValueAtTime(time)</code>.\n\t\t *\n\t\t * @extends {Tone.Timeline}\n\t\t * @param {String} initial The initial state of the TimelineState. \n\t\t * Defaults to <code>undefined</code>\n\t\t */\n\t Tone.TimelineState = function (initial) {\n\t Tone.Timeline.call(this);\n\t /**\n\t\t\t * The initial state\n\t\t\t * @private\n\t\t\t * @type {String}\n\t\t\t */\n\t this._initial = initial;\n\t };\n\t Tone.extend(Tone.TimelineState, Tone.Timeline);\n\t /**\n\t\t * Returns the scheduled state scheduled before or at\n\t\t * the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @return {String} The name of the state input in setStateAtTime.\n\t\t */\n\t Tone.TimelineState.prototype.getValueAtTime = function (time) {\n\t var event = this.get(time);\n\t if (event !== null) {\n\t return event.state;\n\t } else {\n\t return this._initial;\n\t }\n\t };\n\t /**\n\t\t * Add a state to the timeline.\n\t\t * @param {String} state The name of the state to set.\n\t\t * @param {Number} time The time to query.\n\t\t * @returns {Tone.TimelineState} this\n\t\t */\n\t Tone.TimelineState.prototype.setStateAtTime = function (state, time) {\n\t //all state changes need to be >= the previous state time\n\t //TODO throw error if time < the previous event time\n\t this.add({\n\t 'state': state,\n\t 'time': time\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Return the event before the time with the given state\n\t\t * @param {Tone.State} state The state to look for\n\t\t * @param {Time} time When to check before\t\t\t\n\t\t * @return {Object} The event with the given state before the time\n\t\t */\n\t Tone.TimelineState.prototype.getLastState = function (state, time) {\n\t time = this.toSeconds(time);\n\t var index = this._search(time);\n\t for (var i = index; i >= 0; i--) {\n\t var event = this._timeline[i];\n\t if (event.state === state) {\n\t return event;\n\t }\n\t }\n\t };\n\t /**\n\t\t * Return the event after the time with the given state\n\t\t * @param {Tone.State} state The state to look for\n\t\t * @param {Time} time When to check from\n\t\t * @return {Object} The event with the given state after the time\n\t\t */\n\t Tone.TimelineState.prototype.getNextState = function (state, time) {\n\t time = this.toSeconds(time);\n\t var index = this._search(time);\n\t if (index !== -1) {\n\t for (var i = index; i < this._timeline.length; i++) {\n\t var event = this._timeline[i];\n\t if (event.state === state) {\n\t return event;\n\t }\n\t }\n\t }\n\t };\n\t return Tone.TimelineState;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Uses [Tone.TickSignal](TickSignal) to track elapsed ticks with\n\t\t * \t\tcomplex automation curves.\n\t\t *\n\t\t * \t@constructor\n\t * @param {Frequency} frequency The initial frequency that the signal ticks at\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.TickSource = function () {\n\t var options = Tone.defaults(arguments, ['frequency'], Tone.TickSource);\n\t /**\n\t\t\t * The frequency the callback function should be invoked.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.TickSignal(options.frequency, Tone.Type.Frequency);\n\t this._readOnly('frequency');\n\t /**\n\t\t\t * The state timeline\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t this._state.setStateAtTime(Tone.State.Stopped, 0);\n\t /**\n\t\t\t * The offset values of the ticks\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._tickOffset = new Tone.Timeline();\n\t //add the first event\n\t this.setTicksAtTime(0, 0);\n\t };\n\t Tone.extend(Tone.TickSource);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.TickSource.defaults = { 'frequency': 1 };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\", \"stopped\" or \"paused\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.TickSource#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.TickSource.prototype, 'state', {\n\t get: function () {\n\t return this._state.getValueAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Start the clock at the given time. Optionally pass in an offset\n\t\t * of where to start the tick counter from.\n\t\t * @param {Time=} time The time the clock should start\n\t\t * @param {Ticks=0} offset The number of ticks to start the source at\n\t\t * @return {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.start = function (time, offset) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) !== Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t if (Tone.isDefined(offset)) {\n\t this.setTicksAtTime(offset, time);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the clock. Stopping the clock resets the tick counter to 0.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.TickSource} this\n\t\t * @example\n\t\t * clock.stop();\n\t\t */\n\t Tone.TickSource.prototype.stop = function (time) {\n\t time = this.toSeconds(time);\n\t //cancel the previous stop\n\t if (this._state.getValueAtTime(time) === Tone.State.Stopped) {\n\t var event = this._state.get(time);\n\t if (event.time > 0) {\n\t this._tickOffset.cancel(event.time);\n\t this._state.cancel(event.time);\n\t }\n\t }\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t this.setTicksAtTime(0, time);\n\t return this;\n\t };\n\t /**\n\t\t * Pause the clock. Pausing does not reset the tick counter.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.pause = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Paused, time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel start/stop/pause and setTickAtTime events scheduled after the given time.\n\t\t * @param {Time} [time=now] When to clear the events after\n\t\t * @returns {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.cancel = function (time) {\n\t time = this.toSeconds(time);\n\t this._state.cancel(time);\n\t this._tickOffset.cancel(time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the elapsed ticks at the given time\n\t\t * @param {Time} time When to get the tick value\n\t\t * @return {Ticks} The number of ticks\n\t\t */\n\t Tone.TickSource.prototype.getTicksAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var stopEvent = this._state.getLastState(Tone.State.Stopped, time);\n\t //this event allows forEachBetween to iterate until the current time\n\t var tmpEvent = {\n\t state: Tone.State.Paused,\n\t time: time\n\t };\n\t this._state.add(tmpEvent);\n\t //keep track of the previous offset event\n\t var lastState = stopEvent;\n\t var elapsedTicks = 0;\n\t //iterate through all the events since the last stop\n\t this._state.forEachBetween(stopEvent.time, time + this.sampleTime, function (e) {\n\t var periodStartTime = lastState.time;\n\t //if there is an offset event in this period use that\n\t var offsetEvent = this._tickOffset.get(e.time);\n\t if (offsetEvent.time >= lastState.time) {\n\t elapsedTicks = offsetEvent.ticks;\n\t periodStartTime = offsetEvent.time;\n\t }\n\t if (lastState.state === Tone.State.Started && e.state !== Tone.State.Started) {\n\t elapsedTicks += this.frequency.getTicksAtTime(e.time) - this.frequency.getTicksAtTime(periodStartTime);\n\t }\n\t lastState = e;\n\t }.bind(this));\n\t //remove the temporary event\n\t this._state.remove(tmpEvent);\n\t //return the ticks\n\t return elapsedTicks;\n\t };\n\t /**\n\t\t * The number of times the callback was invoked. Starts counting at 0\n\t\t * and increments after the callback was invoked. Returns -1 when stopped.\n\t\t * @memberOf Tone.TickSource#\n\t\t * @name ticks\n\t\t * @type {Ticks}\n\t\t */\n\t Object.defineProperty(Tone.TickSource.prototype, 'ticks', {\n\t get: function () {\n\t return this.getTicksAtTime(this.now());\n\t },\n\t set: function (t) {\n\t this.setTicksAtTime(t, this.now());\n\t }\n\t });\n\t /**\n\t\t * The time since ticks=0 that the TickSource has been running. Accounts\n\t\t * for tempo curves\n\t\t * @memberOf Tone.TickSource#\n\t\t * @name seconds\n\t\t * @type {Seconds}\n\t\t */\n\t Object.defineProperty(Tone.TickSource.prototype, 'seconds', {\n\t get: function () {\n\t return this.getSecondsAtTime(this.now());\n\t },\n\t set: function (s) {\n\t var now = this.now();\n\t var ticks = this.frequency.timeToTicks(s, now);\n\t this.setTicksAtTime(ticks, now);\n\t }\n\t });\n\t /**\n\t\t * Return the elapsed seconds at the given time.\n\t\t * @param {Time} time When to get the elapsed seconds\n\t\t * @return {Seconds} The number of elapsed seconds\n\t\t */\n\t Tone.TickSource.prototype.getSecondsAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var stopEvent = this._state.getLastState(Tone.State.Stopped, time);\n\t //this event allows forEachBetween to iterate until the current time\n\t var tmpEvent = {\n\t state: Tone.State.Paused,\n\t time: time\n\t };\n\t this._state.add(tmpEvent);\n\t //keep track of the previous offset event\n\t var lastState = stopEvent;\n\t var elapsedSeconds = 0;\n\t //iterate through all the events since the last stop\n\t this._state.forEachBetween(stopEvent.time, time + this.sampleTime, function (e) {\n\t var periodStartTime = lastState.time;\n\t //if there is an offset event in this period use that\n\t var offsetEvent = this._tickOffset.get(e.time);\n\t if (offsetEvent.time >= lastState.time) {\n\t elapsedSeconds = offsetEvent.seconds;\n\t periodStartTime = offsetEvent.time;\n\t }\n\t if (lastState.state === Tone.State.Started && e.state !== Tone.State.Started) {\n\t elapsedSeconds += e.time - periodStartTime;\n\t }\n\t lastState = e;\n\t }.bind(this));\n\t //remove the temporary event\n\t this._state.remove(tmpEvent);\n\t //return the ticks\n\t return elapsedSeconds;\n\t };\n\t /**\n\t\t * Set the clock's ticks at the given time.\n\t\t * @param {Ticks} ticks The tick value to set\n\t\t * @param {Time} time When to set the tick value\n\t\t * @return {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.setTicksAtTime = function (ticks, time) {\n\t time = this.toSeconds(time);\n\t this._tickOffset.cancel(time);\n\t this._tickOffset.add({\n\t 'time': time,\n\t 'ticks': ticks,\n\t 'seconds': this.frequency.getDurationOfTicks(ticks, time)\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Returns the scheduled state at the given time.\n\t\t * @param {Time} time The time to query.\n\t\t * @return {String} The name of the state input in setStateAtTime.\n\t\t * @example\n\t\t * source.start(\"+0.1\");\n\t\t * source.getStateAtTime(\"+0.1\"); //returns \"started\"\n\t\t */\n\t Tone.TickSource.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t return this._state.getValueAtTime(time);\n\t };\n\t /**\n\t\t * Get the time of the given tick. The second argument\n\t\t * is when to test before. Since ticks can be set (with setTicksAtTime)\n\t\t * there may be multiple times for a given tick value. \n\t\t * @param {Ticks} ticks The tick number.\n\t\t * @param {Time=} before When to measure the tick value from. \n\t\t * @return {Time} The time of the tick\n\t\t */\n\t Tone.TickSource.prototype.getTimeOfTick = function (tick, before) {\n\t before = Tone.defaultArg(before, this.now());\n\t var offset = this._tickOffset.get(before);\n\t var event = this._state.get(before);\n\t var startTime = Math.max(offset.time, event.time);\n\t var absoluteTicks = this.frequency.getTicksAtTime(startTime) + tick - offset.ticks;\n\t return this.frequency.getTimeOfTick(absoluteTicks);\n\t };\n\t /**\n\t\t * Invoke the callback event at all scheduled ticks between the \n\t\t * start time and the end time\n\t\t * @param {Time} startTime The beginning of the search range\n\t\t * @param {Time} endTime The end of the search range\n\t\t * @param {Function<Time,Ticks>} callback The callback to invoke with each tick\n\t\t * @return {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.forEachTickBetween = function (startTime, endTime, callback) {\n\t //only iterate through the sections where it is \"started\"\n\t var lastStateEvent = this._state.get(startTime);\n\t this._state.forEachBetween(startTime, endTime, function (event) {\n\t if (lastStateEvent.state === Tone.State.Started && event.state !== Tone.State.Started) {\n\t this.forEachTickBetween(Math.max(lastStateEvent.time, startTime), event.time - this.sampleTime, callback);\n\t }\n\t lastStateEvent = event;\n\t }.bind(this));\n\t startTime = Math.max(lastStateEvent.time, startTime);\n\t if (lastStateEvent.state === Tone.State.Started && this._state) {\n\t //figure out the difference between the frequency ticks and the \n\t var startTicks = this.frequency.getTicksAtTime(startTime);\n\t var ticksAtStart = this.frequency.getTicksAtTime(lastStateEvent.time);\n\t var diff = startTicks - ticksAtStart;\n\t var offset = diff % 1;\n\t if (offset !== 0) {\n\t offset = 1 - offset;\n\t }\n\t var nextTickTime = this.frequency.getTimeOfTick(startTicks + offset);\n\t var error = null;\n\t while (nextTickTime < endTime && this._state) {\n\t try {\n\t callback(nextTickTime, Math.round(this.getTicksAtTime(nextTickTime)));\n\t } catch (e) {\n\t error = e;\n\t break;\n\t }\n\t if (this._state) {\n\t nextTickTime += this.frequency.getDurationOfTicks(1, nextTickTime);\n\t }\n\t }\n\t }\n\t if (error) {\n\t throw error;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.dispose = function () {\n\t Tone.Param.prototype.dispose.call(this);\n\t this._state.dispose();\n\t this._state = null;\n\t this._tickOffset.dispose();\n\t this._tickOffset = null;\n\t this._writable('frequency');\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t return this;\n\t };\n\t return Tone.TickSource;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A sample accurate clock which provides a callback at the given rate.\n\t\t * While the callback is not sample-accurate (it is still susceptible to\n\t\t * loose JS timing), the time passed in as the argument to the callback\n\t\t * is precise. For most applications, it is better to use Tone.Transport\n\t\t * instead of the Clock by itself since you can synchronize multiple callbacks.\n\t\t *\n\t\t * \t@constructor\n\t\t * @extends {Tone.Emitter}\n\t\t * \t@param {function} callback The callback to be invoked with the time of the audio event\n\t\t * \t@param {Frequency} frequency The rate of the callback\n\t\t * \t@example\n\t\t * //the callback will be invoked approximately once a second\n\t\t * //and will print the time exactly once a second apart.\n\t\t * var clock = new Tone.Clock(function(time){\n\t\t * \tconsole.log(time);\n\t\t * }, 1);\n\t\t */\n\t Tone.Clock = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'frequency'\n\t ], Tone.Clock);\n\t Tone.Emitter.call(this);\n\t /**\n\t\t\t * The callback function to invoke at the scheduled tick.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t /**\n\t\t\t * The next time the callback is scheduled.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._nextTick = 0;\n\t /**\n\t\t\t * The tick counter\n\t\t\t * @type {Tone.TickSource}\n\t\t\t * @private\n\t\t\t */\n\t this._tickSource = new Tone.TickSource(options.frequency);\n\t /**\n\t\t\t * The last time the loop callback was invoked\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._lastUpdate = 0;\n\t /**\n\t\t\t * The rate the callback function should be invoked.\n\t\t\t * @type {BPM}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._tickSource.frequency;\n\t this._readOnly('frequency');\n\t /**\n\t\t\t * The state timeline\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t //add an initial state\n\t this._state.setStateAtTime(Tone.State.Stopped, 0);\n\t /**\n\t\t\t * The loop function bound to its context.\n\t\t\t * This is necessary to remove the event in the end.\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._boundLoop = this._loop.bind(this);\n\t //bind a callback to the worker thread\n\t this.context.on('tick', this._boundLoop);\n\t };\n\t Tone.extend(Tone.Clock, Tone.Emitter);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Clock.defaults = {\n\t 'callback': Tone.noOp,\n\t 'frequency': 1\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\", \"stopped\" or \"paused\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Clock#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Clock.prototype, 'state', {\n\t get: function () {\n\t return this._state.getValueAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Start the clock at the given time. Optionally pass in an offset\n\t\t * of where to start the tick counter from.\n\t\t * @param {Time=} time The time the clock should start\n\t\t * @param {Ticks=} offset Where the tick counter starts counting from.\n\t\t * @return {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.start = function (time, offset) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) !== Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t this._tickSource.start(time, offset);\n\t if (time < this._lastUpdate) {\n\t this.emit('start', time, offset);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the clock. Stopping the clock resets the tick counter to 0.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.Clock} this\n\t\t * @example\n\t\t * clock.stop();\n\t\t */\n\t Tone.Clock.prototype.stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t this._tickSource.stop(time);\n\t if (time < this._lastUpdate) {\n\t this.emit('stop', time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Pause the clock. Pausing does not reset the tick counter.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.pause = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Paused, time);\n\t this._tickSource.pause(time);\n\t if (time < this._lastUpdate) {\n\t this.emit('pause', time);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * The number of times the callback was invoked. Starts counting at 0\n\t\t * and increments after the callback was invoked.\n\t\t * @type {Ticks}\n\t\t */\n\t Object.defineProperty(Tone.Clock.prototype, 'ticks', {\n\t get: function () {\n\t return Math.ceil(this.getTicksAtTime(this.now()));\n\t },\n\t set: function (t) {\n\t this._tickSource.ticks = t;\n\t }\n\t });\n\t /**\n\t\t * The time since ticks=0 that the Clock has been running. Accounts\n\t\t * for tempo curves\n\t\t * @type {Seconds}\n\t\t */\n\t Object.defineProperty(Tone.Clock.prototype, 'seconds', {\n\t get: function () {\n\t return this._tickSource.seconds;\n\t },\n\t set: function (s) {\n\t this._tickSource.seconds = s;\n\t }\n\t });\n\t /**\n\t\t * Return the elapsed seconds at the given time.\n\t\t * @param {Time} time When to get the elapsed seconds\n\t\t * @return {Seconds} The number of elapsed seconds\n\t\t */\n\t Tone.Clock.prototype.getSecondsAtTime = function (time) {\n\t return this._tickSource.getSecondsAtTime(time);\n\t };\n\t /**\n\t\t * Set the clock's ticks at the given time.\n\t\t * @param {Ticks} ticks The tick value to set\n\t\t * @param {Time} time When to set the tick value\n\t\t * @return {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.setTicksAtTime = function (ticks, time) {\n\t this._tickSource.setTicksAtTime(ticks, time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the clock's ticks at the given time.\n\t\t * @param {Time} time When to get the tick value\n\t\t * @return {Ticks} The tick value at the given time.\n\t\t */\n\t Tone.Clock.prototype.getTicksAtTime = function (time) {\n\t return this._tickSource.getTicksAtTime(time);\n\t };\n\t /**\n\t\t * Get the time of the next tick\n\t\t * @param {Ticks} ticks The tick number.\n\t\t * @param {Time} before \n\t\t * @return {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.nextTickTime = function (offset, when) {\n\t when = this.toSeconds(when);\n\t var currentTick = this.getTicksAtTime(when);\n\t return this._tickSource.getTimeOfTick(currentTick + offset, when);\n\t };\n\t /**\n\t\t * The scheduling loop.\n\t\t * @private\n\t\t */\n\t Tone.Clock.prototype._loop = function () {\n\t var startTime = this._lastUpdate;\n\t var endTime = this.now();\n\t this._lastUpdate = endTime;\n\t if (startTime !== endTime) {\n\t //the state change events\n\t this._state.forEachBetween(startTime, endTime, function (e) {\n\t switch (e.state) {\n\t case Tone.State.Started:\n\t var offset = this._tickSource.getTicksAtTime(e.time);\n\t this.emit('start', e.time, offset);\n\t break;\n\t case Tone.State.Stopped:\n\t if (e.time !== 0) {\n\t this.emit('stop', e.time);\n\t }\n\t break;\n\t case Tone.State.Paused:\n\t this.emit('pause', e.time);\n\t break;\n\t }\n\t }.bind(this));\n\t //the tick callbacks\n\t this._tickSource.forEachTickBetween(startTime, endTime, function (time, ticks) {\n\t this.callback(time, ticks);\n\t }.bind(this));\n\t }\n\t };\n\t /**\n\t\t * Returns the scheduled state at the given time.\n\t\t * @param {Time} time The time to query.\n\t\t * @return {String} The name of the state input in setStateAtTime.\n\t\t * @example\n\t\t * clock.start(\"+0.1\");\n\t\t * clock.getStateAtTime(\"+0.1\"); //returns \"started\"\n\t\t */\n\t Tone.Clock.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t return this._state.getValueAtTime(time);\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.dispose = function () {\n\t Tone.Emitter.prototype.dispose.call(this);\n\t this.context.off('tick', this._boundLoop);\n\t this._writable('frequency');\n\t this._tickSource.dispose();\n\t this._tickSource = null;\n\t this.frequency = null;\n\t this._boundLoop = null;\n\t this._nextTick = Infinity;\n\t this.callback = null;\n\t this._state.dispose();\n\t this._state = null;\n\t };\n\t return Tone.Clock;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Similar to Tone.Timeline, but all events represent\n\t\t * intervals with both \"time\" and \"duration\" times. The\n\t\t * events are placed in a tree structure optimized\n\t\t * for querying an intersection point with the timeline\n\t\t * events. Internally uses an [Interval Tree](https://en.wikipedia.org/wiki/Interval_tree)\n\t\t * to represent the data.\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.IntervalTimeline = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * The root node of the inteval tree\n\t\t\t * @type {IntervalNode}\n\t\t\t * @private\n\t\t\t */\n\t this._root = null;\n\t /**\n\t\t\t * Keep track of the length of the timeline.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._length = 0;\n\t };\n\t Tone.extend(Tone.IntervalTimeline);\n\t /**\n\t\t * The event to add to the timeline. All events must\n\t\t * have a time and duration value\n\t\t * @param {Object} event The event to add to the timeline\n\t\t * @return {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.add = function (event) {\n\t if (Tone.isUndef(event.time) || Tone.isUndef(event.duration)) {\n\t throw new Error('Tone.IntervalTimeline: events must have time and duration parameters');\n\t }\n\t event.time = event.time.valueOf();\n\t var node = new IntervalNode(event.time, event.time + event.duration, event);\n\t if (this._root === null) {\n\t this._root = node;\n\t } else {\n\t this._root.insert(node);\n\t }\n\t this._length++;\n\t // Restructure tree to be balanced\n\t while (node !== null) {\n\t node.updateHeight();\n\t node.updateMax();\n\t this._rebalance(node);\n\t node = node.parent;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Remove an event from the timeline.\n\t\t * @param {Object} event The event to remove from the timeline\n\t\t * @return {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.remove = function (event) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.search(event.time, results);\n\t for (var i = 0; i < results.length; i++) {\n\t var node = results[i];\n\t if (node.event === event) {\n\t this._removeNode(node);\n\t this._length--;\n\t break;\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * The number of items in the timeline.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.IntervalTimeline#\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.IntervalTimeline.prototype, 'length', {\n\t get: function () {\n\t return this._length;\n\t }\n\t });\n\t /**\n\t\t * Remove events whose time time is after the given time\n\t\t * @param {Number} time The time to query.\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.cancel = function (after) {\n\t this.forEachFrom(after, function (event) {\n\t this.remove(event);\n\t }.bind(this));\n\t return this;\n\t };\n\t /**\n\t\t * Set the root node as the given node\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._setRoot = function (node) {\n\t this._root = node;\n\t if (this._root !== null) {\n\t this._root.parent = null;\n\t }\n\t };\n\t /**\n\t\t * Replace the references to the node in the node's parent\n\t\t * with the replacement node.\n\t\t * @param {IntervalNode} node\n\t\t * @param {IntervalNode} replacement\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._replaceNodeInParent = function (node, replacement) {\n\t if (node.parent !== null) {\n\t if (node.isLeftChild()) {\n\t node.parent.left = replacement;\n\t } else {\n\t node.parent.right = replacement;\n\t }\n\t this._rebalance(node.parent);\n\t } else {\n\t this._setRoot(replacement);\n\t }\n\t };\n\t /**\n\t\t * Remove the node from the tree and replace it with\n\t\t * a successor which follows the schema.\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._removeNode = function (node) {\n\t if (node.left === null && node.right === null) {\n\t this._replaceNodeInParent(node, null);\n\t } else if (node.right === null) {\n\t this._replaceNodeInParent(node, node.left);\n\t } else if (node.left === null) {\n\t this._replaceNodeInParent(node, node.right);\n\t } else {\n\t var balance = node.getBalance();\n\t var replacement, temp;\n\t if (balance > 0) {\n\t if (node.left.right === null) {\n\t replacement = node.left;\n\t replacement.right = node.right;\n\t temp = replacement;\n\t } else {\n\t replacement = node.left.right;\n\t while (replacement.right !== null) {\n\t replacement = replacement.right;\n\t }\n\t replacement.parent.right = replacement.left;\n\t temp = replacement.parent;\n\t replacement.left = node.left;\n\t replacement.right = node.right;\n\t }\n\t } else if (node.right.left === null) {\n\t replacement = node.right;\n\t replacement.left = node.left;\n\t temp = replacement;\n\t } else {\n\t replacement = node.right.left;\n\t while (replacement.left !== null) {\n\t replacement = replacement.left;\n\t }\n\t replacement.parent = replacement.parent;\n\t replacement.parent.left = replacement.right;\n\t temp = replacement.parent;\n\t replacement.left = node.left;\n\t replacement.right = node.right;\n\t }\n\t if (node.parent !== null) {\n\t if (node.isLeftChild()) {\n\t node.parent.left = replacement;\n\t } else {\n\t node.parent.right = replacement;\n\t }\n\t } else {\n\t this._setRoot(replacement);\n\t }\n\t // this._replaceNodeInParent(node, replacement);\n\t this._rebalance(temp);\n\t }\n\t node.dispose();\n\t };\n\t /**\n\t\t * Rotate the tree to the left\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._rotateLeft = function (node) {\n\t var parent = node.parent;\n\t var isLeftChild = node.isLeftChild();\n\t // Make node.right the new root of this sub tree (instead of node)\n\t var pivotNode = node.right;\n\t node.right = pivotNode.left;\n\t pivotNode.left = node;\n\t if (parent !== null) {\n\t if (isLeftChild) {\n\t parent.left = pivotNode;\n\t } else {\n\t parent.right = pivotNode;\n\t }\n\t } else {\n\t this._setRoot(pivotNode);\n\t }\n\t };\n\t /**\n\t\t * Rotate the tree to the right\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._rotateRight = function (node) {\n\t var parent = node.parent;\n\t var isLeftChild = node.isLeftChild();\n\t // Make node.left the new root of this sub tree (instead of node)\n\t var pivotNode = node.left;\n\t node.left = pivotNode.right;\n\t pivotNode.right = node;\n\t if (parent !== null) {\n\t if (isLeftChild) {\n\t parent.left = pivotNode;\n\t } else {\n\t parent.right = pivotNode;\n\t }\n\t } else {\n\t this._setRoot(pivotNode);\n\t }\n\t };\n\t /**\n\t\t * Balance the BST\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._rebalance = function (node) {\n\t var balance = node.getBalance();\n\t if (balance > 1) {\n\t if (node.left.getBalance() < 0) {\n\t this._rotateLeft(node.left);\n\t } else {\n\t this._rotateRight(node);\n\t }\n\t } else if (balance < -1) {\n\t if (node.right.getBalance() > 0) {\n\t this._rotateRight(node.right);\n\t } else {\n\t this._rotateLeft(node);\n\t }\n\t }\n\t };\n\t /**\n\t\t * Get an event whose time and duration span the give time. Will\n\t\t * return the match whose \"time\" value is closest to the given time.\n\t\t * @param {Object} event The event to add to the timeline\n\t\t * @return {Object} The event which spans the desired time\n\t\t */\n\t Tone.IntervalTimeline.prototype.get = function (time) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.search(time, results);\n\t if (results.length > 0) {\n\t var max = results[0];\n\t for (var i = 1; i < results.length; i++) {\n\t if (results[i].low > max.low) {\n\t max = results[i];\n\t }\n\t }\n\t return max.event;\n\t }\n\t }\n\t return null;\n\t };\n\t /**\n\t\t * Iterate over everything in the timeline.\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.forEach = function (callback) {\n\t if (this._root !== null) {\n\t var allNodes = [];\n\t this._root.traverse(function (node) {\n\t allNodes.push(node);\n\t });\n\t for (var i = 0; i < allNodes.length; i++) {\n\t var ev = allNodes[i].event;\n\t if (ev) {\n\t callback(ev);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array in which the given time\n\t\t * overlaps with the time and duration time of the event.\n\t\t * @param {Number} time The time to check if items are overlapping\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.forEachAtTime = function (time, callback) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.search(time, results);\n\t for (var i = results.length - 1; i >= 0; i--) {\n\t var ev = results[i].event;\n\t if (ev) {\n\t callback(ev);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array in which the time is greater\n\t\t * than or equal to the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.forEachFrom = function (time, callback) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.searchAfter(time, results);\n\t for (var i = results.length - 1; i >= 0; i--) {\n\t var ev = results[i].event;\n\t callback(ev);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.dispose = function () {\n\t var allNodes = [];\n\t if (this._root !== null) {\n\t this._root.traverse(function (node) {\n\t allNodes.push(node);\n\t });\n\t }\n\t for (var i = 0; i < allNodes.length; i++) {\n\t allNodes[i].dispose();\n\t }\n\t allNodes = null;\n\t this._root = null;\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tINTERVAL NODE HELPER\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Represents a node in the binary search tree, with the addition\n\t\t * of a \"high\" value which keeps track of the highest value of\n\t\t * its children.\n\t\t * References:\n\t\t * https://brooknovak.wordpress.com/2013/12/07/augmented-interval-tree-in-c/\n\t\t * http://www.mif.vu.lt/~valdas/ALGORITMAI/LITERATURA/Cormen/Cormen.pdf\n\t\t * @param {Number} low\n\t\t * @param {Number} high\n\t\t * @private\n\t\t */\n\t var IntervalNode = function (low, high, event) {\n\t //the event container\n\t this.event = event;\n\t //the low value\n\t this.low = low;\n\t //the high value\n\t this.high = high;\n\t //the high value for this and all child nodes\n\t this.max = this.high;\n\t //the nodes to the left\n\t this._left = null;\n\t //the nodes to the right\n\t this._right = null;\n\t //the parent node\n\t this.parent = null;\n\t //the number of child nodes\n\t this.height = 0;\n\t };\n\t /**\n\t\t * Insert a node into the correct spot in the tree\n\t\t * @param {IntervalNode} node\n\t\t */\n\t IntervalNode.prototype.insert = function (node) {\n\t if (node.low <= this.low) {\n\t if (this.left === null) {\n\t this.left = node;\n\t } else {\n\t this.left.insert(node);\n\t }\n\t } else if (this.right === null) {\n\t this.right = node;\n\t } else {\n\t this.right.insert(node);\n\t }\n\t };\n\t /**\n\t\t * Search the tree for nodes which overlap\n\t\t * with the given point\n\t\t * @param {Number} point The point to query\n\t\t * @param {Array} results The array to put the results\n\t\t */\n\t IntervalNode.prototype.search = function (point, results) {\n\t // If p is to the right of the rightmost point of any interval\n\t // in this node and all children, there won't be any matches.\n\t if (point > this.max) {\n\t return;\n\t }\n\t // Search left children\n\t if (this.left !== null) {\n\t this.left.search(point, results);\n\t }\n\t // Check this node\n\t if (this.low <= point && this.high > point) {\n\t results.push(this);\n\t }\n\t // If p is to the left of the time of this interval,\n\t // then it can't be in any child to the right.\n\t if (this.low > point) {\n\t return;\n\t }\n\t // Search right children\n\t if (this.right !== null) {\n\t this.right.search(point, results);\n\t }\n\t };\n\t /**\n\t\t * Search the tree for nodes which are less\n\t\t * than the given point\n\t\t * @param {Number} point The point to query\n\t\t * @param {Array} results The array to put the results\n\t\t */\n\t IntervalNode.prototype.searchAfter = function (point, results) {\n\t // Check this node\n\t if (this.low >= point) {\n\t results.push(this);\n\t if (this.left !== null) {\n\t this.left.searchAfter(point, results);\n\t }\n\t }\n\t // search the right side\n\t if (this.right !== null) {\n\t this.right.searchAfter(point, results);\n\t }\n\t };\n\t /**\n\t\t * Invoke the callback on this element and both it's branches\n\t\t * @param {Function} callback\n\t\t */\n\t IntervalNode.prototype.traverse = function (callback) {\n\t callback(this);\n\t if (this.left !== null) {\n\t this.left.traverse(callback);\n\t }\n\t if (this.right !== null) {\n\t this.right.traverse(callback);\n\t }\n\t };\n\t /**\n\t\t * Update the height of the node\n\t\t */\n\t IntervalNode.prototype.updateHeight = function () {\n\t if (this.left !== null && this.right !== null) {\n\t this.height = Math.max(this.left.height, this.right.height) + 1;\n\t } else if (this.right !== null) {\n\t this.height = this.right.height + 1;\n\t } else if (this.left !== null) {\n\t this.height = this.left.height + 1;\n\t } else {\n\t this.height = 0;\n\t }\n\t };\n\t /**\n\t\t * Update the height of the node\n\t\t */\n\t IntervalNode.prototype.updateMax = function () {\n\t this.max = this.high;\n\t if (this.left !== null) {\n\t this.max = Math.max(this.max, this.left.max);\n\t }\n\t if (this.right !== null) {\n\t this.max = Math.max(this.max, this.right.max);\n\t }\n\t };\n\t /**\n\t\t * The balance is how the leafs are distributed on the node\n\t\t * @return {Number} Negative numbers are balanced to the right\n\t\t */\n\t IntervalNode.prototype.getBalance = function () {\n\t var balance = 0;\n\t if (this.left !== null && this.right !== null) {\n\t balance = this.left.height - this.right.height;\n\t } else if (this.left !== null) {\n\t balance = this.left.height + 1;\n\t } else if (this.right !== null) {\n\t balance = -(this.right.height + 1);\n\t }\n\t return balance;\n\t };\n\t /**\n\t\t * @returns {Boolean} true if this node is the left child\n\t\t * of its parent\n\t\t */\n\t IntervalNode.prototype.isLeftChild = function () {\n\t return this.parent !== null && this.parent.left === this;\n\t };\n\t /**\n\t\t * get/set the left node\n\t\t * @type {IntervalNode}\n\t\t */\n\t Object.defineProperty(IntervalNode.prototype, 'left', {\n\t get: function () {\n\t return this._left;\n\t },\n\t set: function (node) {\n\t this._left = node;\n\t if (node !== null) {\n\t node.parent = this;\n\t }\n\t this.updateHeight();\n\t this.updateMax();\n\t }\n\t });\n\t /**\n\t\t * get/set the right node\n\t\t * @type {IntervalNode}\n\t\t */\n\t Object.defineProperty(IntervalNode.prototype, 'right', {\n\t get: function () {\n\t return this._right;\n\t },\n\t set: function (node) {\n\t this._right = node;\n\t if (node !== null) {\n\t node.parent = this;\n\t }\n\t this.updateHeight();\n\t this.updateMax();\n\t }\n\t });\n\t /**\n\t\t * null out references.\n\t\t */\n\t IntervalNode.prototype.dispose = function () {\n\t this.parent = null;\n\t this._left = null;\n\t this._right = null;\n\t this.event = null;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tEND INTERVAL NODE HELPER\n\t ///////////////////////////////////////////////////////////////////////////\n\t return Tone.IntervalTimeline;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Ticks is a primitive type for encoding Time values.\n\t\t * Tone.Ticks can be constructed with or without the `new` keyword. Tone.Ticks can be passed\n\t\t * into the parameter of any method which takes time as an argument.\n\t\t * @constructor\n\t\t * @extends {Tone.TransportTime}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * var t = Tone.Ticks(\"4n\");//a quarter note\n\t\t */\n\t Tone.Ticks = function (val, units) {\n\t if (this instanceof Tone.Ticks) {\n\t Tone.TransportTime.call(this, val, units);\n\t } else {\n\t return new Tone.Ticks(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Ticks, Tone.TransportTime);\n\t /**\n\t\t * The default units if none are given.\n\t\t * @type {String}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._defaultUnits = 'i';\n\t /**\n\t\t * Get the current time in the given units\n\t\t * @return {Ticks}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._now = function () {\n\t return Tone.Transport.ticks;\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._beatsToUnits = function (beats) {\n\t return this._getPPQ() * beats;\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._secondsToUnits = function (seconds) {\n\t return seconds / (60 / this._getBpm()) * this._getPPQ();\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._ticksToUnits = function (ticks) {\n\t return ticks;\n\t };\n\t /**\n\t\t * Return the time in ticks\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Ticks.prototype.toTicks = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the time in ticks\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Ticks.prototype.toSeconds = function () {\n\t return this.valueOf() / this._getPPQ() * (60 / this._getBpm());\n\t };\n\t return Tone.Ticks;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportEvent is an internal class used by (Tone.Transport)[Transport]\n\t\t * to schedule events. Do no invoke this class directly, it is\n\t\t * handled from within Tone.Transport.\n\t\t * @extends {Tone}\n\t\t * @param {Object} options\n\t\t */\n\t Tone.TransportEvent = function (Transport, options) {\n\t options = Tone.defaultArg(options, Tone.TransportEvent.defaults);\n\t Tone.call(this);\n\t /**\n\t\t\t * Reference to the Transport that created it\n\t\t\t * @type {Tone.Transport}\n\t\t\t */\n\t this.Transport = Transport;\n\t /**\n\t\t\t * The unique id of the event\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.id = Tone.TransportEvent._eventId++;\n\t /**\n\t\t\t * The time the event starts\n\t\t\t * @type {Ticks}\n\t\t\t */\n\t this.time = Tone.Ticks(options.time);\n\t /**\n\t\t\t * The callback to invoke\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t /**\n\t\t\t * If the event should be removed after being created.\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._once = options.once;\n\t };\n\t Tone.extend(Tone.TransportEvent);\n\t /**\n\t\t * The defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.TransportEvent.defaults = {\n\t 'once': false,\n\t 'callback': Tone.noOp\n\t };\n\t /**\n\t\t * Current ID counter\n\t\t * @private\n\t\t * @static\n\t\t * @type {Number}\n\t\t */\n\t Tone.TransportEvent._eventId = 0;\n\t /**\n\t\t * Invoke the event callback.\n\t\t * @param {Time} time The AudioContext time in seconds of the event\n\t\t */\n\t Tone.TransportEvent.prototype.invoke = function (time) {\n\t if (this.callback) {\n\t this.callback(time);\n\t if (this._once && this.Transport) {\n\t this.Transport.clear(this.id);\n\t }\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.TransportEvent} this\n\t\t */\n\t Tone.TransportEvent.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this.Transport = null;\n\t this.callback = null;\n\t this.time = null;\n\t return this;\n\t };\n\t return Tone.TransportEvent;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportRepeatEvent is an internal class used by Tone.Transport\n\t\t * to schedule repeat events. This class should not be instantiated directly.\n\t\t * @extends {Tone.TransportEvent}\n\t\t * @param {Object} options\n\t\t */\n\t Tone.TransportRepeatEvent = function (Transport, options) {\n\t Tone.TransportEvent.call(this, Transport, options);\n\t options = Tone.defaultArg(options, Tone.TransportRepeatEvent.defaults);\n\t /**\n\t\t\t * When the event should stop repeating\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this.duration = Tone.Ticks(options.duration);\n\t /**\n\t\t\t * The interval of the repeated event\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._interval = Tone.Ticks(options.interval);\n\t /**\n\t\t\t * The ID of the current timeline event\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._currentId = -1;\n\t /**\n\t\t\t * The ID of the next timeline event\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._nextId = -1;\n\t /**\n\t\t\t * The time of the next event\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._nextTick = this.time;\n\t /**\n\t\t\t * a reference to the bound start method\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._boundRestart = this._restart.bind(this);\n\t this.Transport.on('start loopStart', this._boundRestart);\n\t this._restart();\n\t };\n\t Tone.extend(Tone.TransportRepeatEvent, Tone.TransportEvent);\n\t /**\n\t\t * The defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.TransportRepeatEvent.defaults = {\n\t 'duration': Infinity,\n\t 'interval': 1\n\t };\n\t /**\n\t\t * Invoke the callback. Returns the tick time which\n\t\t * the next event should be scheduled at.\n\t\t * @param {Number} time The AudioContext time in seconds of the event\n\t\t */\n\t Tone.TransportRepeatEvent.prototype.invoke = function (time) {\n\t //create more events if necessary\n\t this._createEvents(time);\n\t //call the super class\n\t Tone.TransportEvent.prototype.invoke.call(this, time);\n\t };\n\t /**\n\t\t * Push more events onto the timeline to keep up with the position of the timeline\n\t\t * @private\n\t\t */\n\t Tone.TransportRepeatEvent.prototype._createEvents = function (time) {\n\t // schedule the next event\n\t var ticks = this.Transport.getTicksAtTime(time);\n\t if (ticks >= this.time && ticks >= this._nextTick && this._nextTick + this._interval < this.time + this.duration) {\n\t this._nextTick += this._interval;\n\t this._currentId = this._nextId;\n\t this._nextId = this.Transport.scheduleOnce(this.invoke.bind(this), Tone.Ticks(this._nextTick));\n\t }\n\t };\n\t /**\n\t\t * Push more events onto the timeline to keep up with the position of the timeline\n\t\t * @private\n\t\t */\n\t Tone.TransportRepeatEvent.prototype._restart = function (time) {\n\t this.Transport.clear(this._currentId);\n\t this.Transport.clear(this._nextId);\n\t this._nextTick = this.time;\n\t var ticks = this.Transport.getTicksAtTime(time);\n\t if (ticks > this.time) {\n\t this._nextTick = this.time + Math.ceil((ticks - this.time) / this._interval) * this._interval;\n\t }\n\t this._currentId = this.Transport.scheduleOnce(this.invoke.bind(this), Tone.Ticks(this._nextTick));\n\t this._nextTick += this._interval;\n\t this._nextId = this.Transport.scheduleOnce(this.invoke.bind(this), Tone.Ticks(this._nextTick));\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.TransportRepeatEvent} this\n\t\t */\n\t Tone.TransportRepeatEvent.prototype.dispose = function () {\n\t this.Transport.clear(this._currentId);\n\t this.Transport.clear(this._nextId);\n\t this.Transport.off('start loopStart', this._boundRestart);\n\t this._boundCreateEvents = null;\n\t Tone.TransportEvent.prototype.dispose.call(this);\n\t this.duration = null;\n\t this._interval = null;\n\t return this;\n\t };\n\t return Tone.TransportRepeatEvent;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Transport for timing musical events.\n\t\t * Supports tempo curves and time changes. Unlike browser-based timing (setInterval, requestAnimationFrame)\n\t\t * Tone.Transport timing events pass in the exact time of the scheduled event\n\t\t * in the argument of the callback function. Pass that time value to the object\n\t\t * you're scheduling. <br><br>\n\t\t * A single transport is created for you when the library is initialized.\n\t\t * <br><br>\n\t\t * The transport emits the events: \"start\", \"stop\", \"pause\", and \"loop\" which are\n\t\t * called with the time of that event as the argument.\n\t\t *\n\t\t * @extends {Tone.Emitter}\n\t\t * @singleton\n\t\t * @example\n\t\t * //repeated event every 8th note\n\t\t * Tone.Transport.scheduleRepeat(function(time){\n\t\t * \t//do something with the time\n\t\t * }, \"8n\");\n\t\t * @example\n\t\t * //schedule an event on the 16th measure\n\t\t * Tone.Transport.schedule(function(time){\n\t\t * \t//do something with the time\n\t\t * }, \"16:0:0\");\n\t\t */\n\t Tone.Transport = function () {\n\t Tone.Emitter.call(this);\n\t Tone.getContext(function () {\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tLOOPING\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * \tIf the transport loops or not.\n\t\t\t\t * @type {boolean}\n\t\t\t\t */\n\t this.loop = false;\n\t /**\n\t\t\t\t * \tThe loop start position in ticks\n\t\t\t\t * @type {Ticks}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._loopStart = 0;\n\t /**\n\t\t\t\t * \tThe loop end position in ticks\n\t\t\t\t * @type {Ticks}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._loopEnd = 0;\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tCLOCK/TEMPO\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * Pulses per quarter is the number of ticks per quarter note.\n\t\t\t\t * @private\n\t\t\t\t * @type {Number}\n\t\t\t\t */\n\t this._ppq = TransportConstructor.defaults.PPQ;\n\t /**\n\t\t\t\t * watches the main oscillator for timing ticks\n\t\t\t\t * initially starts at 120bpm\n\t\t\t\t * @private\n\t\t\t\t * @type {Tone.Clock}\n\t\t\t\t */\n\t this._clock = new Tone.Clock({\n\t 'callback': this._processTick.bind(this),\n\t 'frequency': 0\n\t });\n\t this._bindClockEvents();\n\t /**\n\t\t\t\t * The Beats Per Minute of the Transport.\n\t\t\t\t * @type {BPM}\n\t\t\t\t * @signal\n\t\t\t\t * @example\n\t\t\t\t * Tone.Transport.bpm.value = 80;\n\t\t\t\t * //ramp the bpm to 120 over 10 seconds\n\t\t\t\t * Tone.Transport.bpm.rampTo(120, 10);\n\t\t\t\t */\n\t this.bpm = this._clock.frequency;\n\t this.bpm._toUnits = this._toUnits.bind(this);\n\t this.bpm._fromUnits = this._fromUnits.bind(this);\n\t this.bpm.units = Tone.Type.BPM;\n\t this.bpm.value = TransportConstructor.defaults.bpm;\n\t this._readOnly('bpm');\n\t /**\n\t\t\t\t * The time signature, or more accurately the numerator\n\t\t\t\t * of the time signature over a denominator of 4.\n\t\t\t\t * @type {Number}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._timeSignature = TransportConstructor.defaults.timeSignature;\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tTIMELINE EVENTS\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * All the events in an object to keep track by ID\n\t\t\t\t * @type {Object}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._scheduledEvents = {};\n\t /**\n\t\t\t\t * \tThe scheduled events.\n\t\t\t\t * @type {Tone.Timeline}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._timeline = new Tone.Timeline();\n\t /**\n\t\t\t\t * Repeated events\n\t\t\t\t * @type {Array}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._repeatedEvents = new Tone.IntervalTimeline();\n\t /**\n\t\t\t\t * All of the synced Signals\n\t\t\t\t * @private\n\t\t\t\t * @type {Array}\n\t\t\t\t */\n\t this._syncedSignals = [];\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tSWING\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * The subdivision of the swing\n\t\t\t\t * @type {Ticks}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._swingTicks = TransportConstructor.defaults.PPQ / 2;\n\t //8n\n\t /**\n\t\t\t\t * The swing amount\n\t\t\t\t * @type {NormalRange}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._swingAmount = 0;\n\t }.bind(this));\n\t };\n\t Tone.extend(Tone.Transport, Tone.Emitter);\n\t /**\n\t\t * the defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.Transport.defaults = {\n\t 'bpm': 120,\n\t 'swing': 0,\n\t 'swingSubdivision': '8n',\n\t 'timeSignature': 4,\n\t 'loopStart': 0,\n\t 'loopEnd': '4m',\n\t 'PPQ': 192\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tTICKS\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * called on every tick\n\t\t * @param {number} tickTime clock relative tick time\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._processTick = function (tickTime, ticks) {\n\t //handle swing\n\t if (this._swingAmount > 0 && ticks % this._ppq !== 0 && //not on a downbeat\n\t ticks % (this._swingTicks * 2) !== 0) {\n\t //add some swing\n\t var progress = ticks % (this._swingTicks * 2) / (this._swingTicks * 2);\n\t var amount = Math.sin(progress * Math.PI) * this._swingAmount;\n\t tickTime += Tone.Ticks(this._swingTicks * 2 / 3).toSeconds() * amount;\n\t }\n\t //do the loop test\n\t if (this.loop) {\n\t if (ticks >= this._loopEnd) {\n\t this.emit('loopEnd', tickTime);\n\t this._clock.setTicksAtTime(this._loopStart, tickTime);\n\t ticks = this._loopStart;\n\t this.emit('loopStart', tickTime, this._clock.getSecondsAtTime(tickTime));\n\t this.emit('loop', tickTime);\n\t }\n\t }\n\t //invoke the timeline events scheduled on this tick\n\t this._timeline.forEachAtTime(ticks, function (event) {\n\t event.invoke(tickTime);\n\t });\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSCHEDULABLE EVENTS\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Schedule an event along the timeline.\n\t\t * @param {Function} callback The callback to be invoked at the time.\n\t\t * @param {TransportTime} time The time to invoke the callback at.\n\t\t * @return {Number} The id of the event which can be used for canceling the event.\n\t\t * @example\n\t\t * //trigger the callback when the Transport reaches the desired time\n\t\t * Tone.Transport.schedule(function(time){\n\t\t * \tenvelope.triggerAttack(time);\n\t\t * }, \"128i\");\n\t\t */\n\t Tone.Transport.prototype.schedule = function (callback, time) {\n\t var event = new Tone.TransportEvent(this, {\n\t 'time': Tone.TransportTime(time),\n\t 'callback': callback\n\t });\n\t return this._addEvent(event, this._timeline);\n\t };\n\t /**\n\t\t * Schedule a repeated event along the timeline. The event will fire\n\t\t * at the `interval` starting at the `startTime` and for the specified\n\t\t * `duration`.\n\t\t * @param {Function} callback The callback to invoke.\n\t\t * @param {Time} interval The duration between successive\n\t\t * callbacks. Must be a positive number.\n\t\t * @param {TransportTime=} startTime When along the timeline the events should\n\t\t * start being invoked.\n\t\t * @param {Time} [duration=Infinity] How long the event should repeat.\n\t\t * @return {Number} The ID of the scheduled event. Use this to cancel\n\t\t * the event.\n\t\t * @example\n\t\t * //a callback invoked every eighth note after the first measure\n\t\t * Tone.Transport.scheduleRepeat(callback, \"8n\", \"1m\");\n\t\t */\n\t Tone.Transport.prototype.scheduleRepeat = function (callback, interval, startTime, duration) {\n\t var event = new Tone.TransportRepeatEvent(this, {\n\t 'callback': callback,\n\t 'interval': Tone.Time(interval),\n\t 'time': Tone.TransportTime(startTime),\n\t 'duration': Tone.Time(Tone.defaultArg(duration, Infinity))\n\t });\n\t //kick it off if the Transport is started\n\t return this._addEvent(event, this._repeatedEvents);\n\t };\n\t /**\n\t\t * Schedule an event that will be removed after it is invoked.\n\t\t * Note that if the given time is less than the current transport time,\n\t\t * the event will be invoked immediately.\n\t\t * @param {Function} callback The callback to invoke once.\n\t\t * @param {TransportTime} time The time the callback should be invoked.\n\t\t * @returns {Number} The ID of the scheduled event.\n\t\t */\n\t Tone.Transport.prototype.scheduleOnce = function (callback, time) {\n\t var event = new Tone.TransportEvent(this, {\n\t 'time': Tone.TransportTime(time),\n\t 'callback': callback,\n\t 'once': true\n\t });\n\t return this._addEvent(event, this._timeline);\n\t };\n\t /**\n\t\t * Clear the passed in event id from the timeline\n\t\t * @param {Number} eventId The id of the event.\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.clear = function (eventId) {\n\t if (this._scheduledEvents.hasOwnProperty(eventId)) {\n\t var item = this._scheduledEvents[eventId.toString()];\n\t item.timeline.remove(item.event);\n\t item.event.dispose();\n\t delete this._scheduledEvents[eventId.toString()];\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Add an event to the correct timeline. Keep track of the\n\t\t * timeline it was added to.\n\t\t * @param {Tone.TransportEvent}\tevent\n\t\t * @param {Tone.Timeline} timeline\n\t\t * @returns {Number} the event id which was just added\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._addEvent = function (event, timeline) {\n\t this._scheduledEvents[event.id.toString()] = {\n\t 'event': event,\n\t 'timeline': timeline\n\t };\n\t timeline.add(event);\n\t return event.id;\n\t };\n\t /**\n\t\t * Remove scheduled events from the timeline after\n\t\t * the given time. Repeated events will be removed\n\t\t * if their startTime is after the given time\n\t\t * @param {TransportTime} [after=0] Clear all events after\n\t\t * this time.\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.cancel = function (after) {\n\t after = Tone.defaultArg(after, 0);\n\t after = this.toTicks(after);\n\t this._timeline.forEachFrom(after, function (event) {\n\t this.clear(event.id);\n\t }.bind(this));\n\t this._repeatedEvents.forEachFrom(after, function (event) {\n\t this.clear(event.id);\n\t }.bind(this));\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSTART/STOP/PAUSE\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Bind start/stop/pause events from the clock and emit them.\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._bindClockEvents = function () {\n\t this._clock.on('start', function (time, offset) {\n\t offset = Tone.Ticks(offset).toSeconds();\n\t this.emit('start', time, offset);\n\t }.bind(this));\n\t this._clock.on('stop', function (time) {\n\t this.emit('stop', time);\n\t }.bind(this));\n\t this._clock.on('pause', function (time) {\n\t this.emit('pause', time);\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\", \"stopped\", or \"paused\"\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Transport#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'state', {\n\t get: function () {\n\t return this._clock.getStateAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Start the transport and all sources synced to the transport.\n\t\t * @param {Time} [time=now] The time when the transport should start.\n\t\t * @param {TransportTime=} offset The timeline offset to start the transport.\n\t\t * @returns {Tone.Transport} this\n\t\t * @example\n\t\t * //start the transport in one second starting at beginning of the 5th measure.\n\t\t * Tone.Transport.start(\"+1\", \"4:0:0\");\n\t\t */\n\t Tone.Transport.prototype.start = function (time, offset) {\n\t //start the clock\n\t if (Tone.isDefined(offset)) {\n\t offset = this.toTicks(offset);\n\t }\n\t this._clock.start(time, offset);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the transport and all sources synced to the transport.\n\t\t * @param {Time} [time=now] The time when the transport should stop.\n\t\t * @returns {Tone.Transport} this\n\t\t * @example\n\t\t * Tone.Transport.stop();\n\t\t */\n\t Tone.Transport.prototype.stop = function (time) {\n\t this._clock.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Pause the transport and all sources synced to the transport.\n\t\t * @param {Time} [time=now]\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.pause = function (time) {\n\t this._clock.pause(time);\n\t return this;\n\t };\n\t /**\n\t\t * Toggle the current state of the transport. If it is\n\t\t * started, it will stop it, otherwise it will start the Transport.\n\t\t * @param {Time=} time The time of the event\n\t\t * @return {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.toggle = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._clock.getStateAtTime(time) !== Tone.State.Started) {\n\t this.start(time);\n\t } else {\n\t this.stop(time);\n\t }\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSETTERS/GETTERS\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * The time signature as just the numerator over 4.\n\t\t * For example 4/4 would be just 4 and 6/8 would be 3.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Number|Array}\n\t\t * @name timeSignature\n\t\t * @example\n\t\t * //common time\n\t\t * Tone.Transport.timeSignature = 4;\n\t\t * // 7/8\n\t\t * Tone.Transport.timeSignature = [7, 8];\n\t\t * //this will be reduced to a single number\n\t\t * Tone.Transport.timeSignature; //returns 3.5\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'timeSignature', {\n\t get: function () {\n\t return this._timeSignature;\n\t },\n\t set: function (timeSig) {\n\t if (Tone.isArray(timeSig)) {\n\t timeSig = timeSig[0] / timeSig[1] * 4;\n\t }\n\t this._timeSignature = timeSig;\n\t }\n\t });\n\t /**\n\t\t * When the Tone.Transport.loop = true, this is the starting position of the loop.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'loopStart', {\n\t get: function () {\n\t return Tone.Ticks(this._loopStart).toSeconds();\n\t },\n\t set: function (startPosition) {\n\t this._loopStart = this.toTicks(startPosition);\n\t }\n\t });\n\t /**\n\t\t * When the Tone.Transport.loop = true, this is the ending position of the loop.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'loopEnd', {\n\t get: function () {\n\t return Tone.Ticks(this._loopEnd).toSeconds();\n\t },\n\t set: function (endPosition) {\n\t this._loopEnd = this.toTicks(endPosition);\n\t }\n\t });\n\t /**\n\t\t * Set the loop start and stop at the same time.\n\t\t * @param {TransportTime} startPosition\n\t\t * @param {TransportTime} endPosition\n\t\t * @returns {Tone.Transport} this\n\t\t * @example\n\t\t * //loop over the first measure\n\t\t * Tone.Transport.setLoopPoints(0, \"1m\");\n\t\t * Tone.Transport.loop = true;\n\t\t */\n\t Tone.Transport.prototype.setLoopPoints = function (startPosition, endPosition) {\n\t this.loopStart = startPosition;\n\t this.loopEnd = endPosition;\n\t return this;\n\t };\n\t /**\n\t\t * The swing value. Between 0-1 where 1 equal to\n\t\t * the note + half the subdivision.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {NormalRange}\n\t\t * @name swing\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'swing', {\n\t get: function () {\n\t return this._swingAmount;\n\t },\n\t set: function (amount) {\n\t //scale the values to a normal range\n\t this._swingAmount = amount;\n\t }\n\t });\n\t /**\n\t\t * Set the subdivision which the swing will be applied to.\n\t\t * The default value is an 8th note. Value must be less\n\t\t * than a quarter note.\n\t\t *\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Time}\n\t\t * @name swingSubdivision\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'swingSubdivision', {\n\t get: function () {\n\t return Tone.Ticks(this._swingTicks).toNotation();\n\t },\n\t set: function (subdivision) {\n\t this._swingTicks = this.toTicks(subdivision);\n\t }\n\t });\n\t /**\n\t\t * The Transport's position in Bars:Beats:Sixteenths.\n\t\t * Setting the value will jump to that position right away.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {BarsBeatsSixteenths}\n\t\t * @name position\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'position', {\n\t get: function () {\n\t var now = this.now();\n\t var ticks = this._clock.getTicksAtTime(now);\n\t return Tone.Ticks(ticks).toBarsBeatsSixteenths();\n\t },\n\t set: function (progress) {\n\t var ticks = this.toTicks(progress);\n\t this.ticks = ticks;\n\t }\n\t });\n\t /**\n\t\t * The Transport's position in seconds\n\t\t * Setting the value will jump to that position right away.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Seconds}\n\t\t * @name seconds\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'seconds', {\n\t get: function () {\n\t return this._clock.seconds;\n\t },\n\t set: function (s) {\n\t var now = this.now();\n\t var ticks = this.bpm.timeToTicks(s, now);\n\t this.ticks = ticks;\n\t }\n\t });\n\t /**\n\t\t * The Transport's loop position as a normalized value. Always\n\t\t * returns 0 if the transport if loop is not true.\n\t\t * @memberOf Tone.Transport#\n\t\t * @name progress\n\t\t * @type {NormalRange}\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'progress', {\n\t get: function () {\n\t if (this.loop) {\n\t var now = this.now();\n\t var ticks = this._clock.getTicksAtTime(now);\n\t return (ticks - this._loopStart) / (this._loopEnd - this._loopStart);\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The transports current tick position.\n\t\t *\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Ticks}\n\t\t * @name ticks\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'ticks', {\n\t get: function () {\n\t return this._clock.ticks;\n\t },\n\t set: function (t) {\n\t if (this._clock.ticks !== t) {\n\t var now = this.now();\n\t //stop everything synced to the transport\n\t if (this.state === Tone.State.Started) {\n\t this.emit('stop', now);\n\t this._clock.setTicksAtTime(t, now);\n\t //restart it with the new time\n\t this.emit('start', now, this.seconds);\n\t } else {\n\t this._clock.setTicksAtTime(t, now);\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * Get the clock's ticks at the given time.\n\t\t * @param {Time} time When to get the tick value\n\t\t * @return {Ticks} The tick value at the given time.\n\t\t */\n\t Tone.Transport.prototype.getTicksAtTime = function (time) {\n\t return Math.round(this._clock.getTicksAtTime(time));\n\t };\n\t /**\n\t\t * Return the elapsed seconds at the given time.\n\t\t * @param {Time} time When to get the elapsed seconds\n\t\t * @return {Seconds} The number of elapsed seconds\n\t\t */\n\t Tone.Transport.prototype.getSecondsAtTime = function (time) {\n\t return this._clock.getSecondsAtTime(time);\n\t };\n\t /**\n\t\t * Pulses Per Quarter note. This is the smallest resolution\n\t\t * the Transport timing supports. This should be set once\n\t\t * on initialization and not set again. Changing this value\n\t\t * after other objects have been created can cause problems.\n\t\t *\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Number}\n\t\t * @name PPQ\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'PPQ', {\n\t get: function () {\n\t return this._ppq;\n\t },\n\t set: function (ppq) {\n\t var bpm = this.bpm.value;\n\t this._ppq = ppq;\n\t this.bpm.value = bpm;\n\t }\n\t });\n\t /**\n\t\t * Convert from BPM to frequency (factoring in PPQ)\n\t\t * @param {BPM} bpm The BPM value to convert to frequency\n\t\t * @return {Frequency} The BPM as a frequency with PPQ factored in.\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._fromUnits = function (bpm) {\n\t return 1 / (60 / bpm / this.PPQ);\n\t };\n\t /**\n\t\t * Convert from frequency (with PPQ) into BPM\n\t\t * @param {Frequency} freq The clocks frequency to convert to BPM\n\t\t * @return {BPM} The frequency value as BPM.\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._toUnits = function (freq) {\n\t return freq / this.PPQ * 60;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSYNCING\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Returns the time aligned to the next subdivision\n\t\t * of the Transport. If the Transport is not started,\n\t\t * it will return 0.\n\t\t * Note: this will not work precisely during tempo ramps.\n\t\t * @param {Time} subdivision The subdivision to quantize to\n\t\t * @return {Number} The context time of the next subdivision.\n\t\t * @example\n\t\t * Tone.Transport.start(); //the transport must be started\n\t\t * Tone.Transport.nextSubdivision(\"4n\");\n\t\t */\n\t Tone.Transport.prototype.nextSubdivision = function (subdivision) {\n\t subdivision = this.toTicks(subdivision);\n\t if (this.state !== Tone.State.Started) {\n\t //if the transport's not started, return 0\n\t return 0;\n\t } else {\n\t var now = this.now();\n\t //the remainder of the current ticks and the subdivision\n\t var transportPos = this.getTicksAtTime(now);\n\t var remainingTicks = subdivision - transportPos % subdivision;\n\t return this._clock.nextTickTime(remainingTicks, now);\n\t }\n\t };\n\t /**\n\t\t * Attaches the signal to the tempo control signal so that\n\t\t * any changes in the tempo will change the signal in the same\n\t\t * ratio.\n\t\t *\n\t\t * @param {Tone.Signal} signal\n\t\t * @param {number=} ratio Optionally pass in the ratio between\n\t\t * the two signals. Otherwise it will be computed\n\t\t * based on their current values.\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.syncSignal = function (signal, ratio) {\n\t if (!ratio) {\n\t //get the sync ratio\n\t var now = this.now();\n\t if (signal.getValueAtTime(now) !== 0) {\n\t ratio = signal.getValueAtTime(now) / this.bpm.getValueAtTime(now);\n\t } else {\n\t ratio = 0;\n\t }\n\t }\n\t var ratioSignal = new Tone.Gain(ratio);\n\t this.bpm.chain(ratioSignal, signal._param);\n\t this._syncedSignals.push({\n\t 'ratio': ratioSignal,\n\t 'signal': signal,\n\t 'initial': signal.value\n\t });\n\t signal.value = 0;\n\t return this;\n\t };\n\t /**\n\t\t * Unsyncs a previously synced signal from the transport's control.\n\t\t * See Tone.Transport.syncSignal.\n\t\t * @param {Tone.Signal} signal\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.unsyncSignal = function (signal) {\n\t for (var i = this._syncedSignals.length - 1; i >= 0; i--) {\n\t var syncedSignal = this._syncedSignals[i];\n\t if (syncedSignal.signal === signal) {\n\t syncedSignal.ratio.dispose();\n\t syncedSignal.signal.value = syncedSignal.initial;\n\t this._syncedSignals.splice(i, 1);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Transport} this\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype.dispose = function () {\n\t Tone.Emitter.prototype.dispose.call(this);\n\t this._clock.dispose();\n\t this._clock = null;\n\t this._writable('bpm');\n\t this.bpm = null;\n\t this._timeline.dispose();\n\t this._timeline = null;\n\t this._repeatedEvents.dispose();\n\t this._repeatedEvents = null;\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tINITIALIZATION\n\t ///////////////////////////////////////////////////////////////////////////////\n\t var TransportConstructor = Tone.Transport;\n\t Tone.Transport = new TransportConstructor();\n\t Tone.Context.on('init', function (context) {\n\t if (context.Transport instanceof TransportConstructor) {\n\t Tone.Transport = context.Transport;\n\t } else {\n\t Tone.Transport = new TransportConstructor();\n\t }\n\t //store the Transport on the context so it can be retrieved later\n\t context.Transport = Tone.Transport;\n\t });\n\t Tone.Context.on('close', function (context) {\n\t if (context.Transport instanceof TransportConstructor) {\n\t context.Transport.dispose();\n\t }\n\t });\n\t return Tone.Transport;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Volume is a simple volume node, useful for creating a volume fader.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Decibels} [volume=0] the initial volume\n\t\t * @example\n\t\t * var vol = new Tone.Volume(-12);\n\t\t * instrument.chain(vol, Tone.Master);\n\t\t */\n\t Tone.Volume = function () {\n\t var options = Tone.defaults(arguments, ['volume'], Tone.Volume);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the output node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.output = this.input = new Tone.Gain(options.volume, Tone.Type.Decibels);\n\t /**\n\t\t\t * The unmuted volume\n\t\t\t * @type {Decibels}\n\t\t\t * @private\n\t\t\t */\n\t this._unmutedVolume = options.volume;\n\t /**\n\t\t\t * The volume control in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.volume = this.output.gain;\n\t this._readOnly('volume');\n\t //set the mute initially\n\t this.mute = options.mute;\n\t };\n\t Tone.extend(Tone.Volume, Tone.AudioNode);\n\t /**\n\t\t * Defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.Volume.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Volume#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * volume.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Volume.prototype, 'mute', {\n\t get: function () {\n\t return this.volume.value === -Infinity;\n\t },\n\t set: function (mute) {\n\t if (!this.mute && mute) {\n\t this._unmutedVolume = this.volume.value;\n\t //maybe it should ramp here?\n\t this.volume.value = -Infinity;\n\t } else if (this.mute && !mute) {\n\t this.volume.value = this._unmutedVolume;\n\t }\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Volume} this\n\t\t */\n\t Tone.Volume.prototype.dispose = function () {\n\t this.input.dispose();\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('volume');\n\t this.volume.dispose();\n\t this.volume = null;\n\t return this;\n\t };\n\t return Tone.Volume;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A single master output which is connected to the\n\t\t * AudioDestinationNode (aka your speakers).\n\t\t * It provides useful conveniences such as the ability\n\t\t * to set the volume and mute the entire application.\n\t\t * It also gives you the ability to apply master effects to your application.\n\t\t * <br><br>\n\t\t * Like Tone.Transport, A single Tone.Master is created\n\t\t * on initialization and you do not need to explicitly construct one.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t * @singleton\n\t\t * @example\n\t\t * //the audio will go from the oscillator to the speakers\n\t\t * oscillator.connect(Tone.Master);\n\t\t * //a convenience for connecting to the master output is also provided:\n\t\t * oscillator.toMaster();\n\t\t * //the above two examples are equivalent.\n\t\t */\n\t Tone.Master = function () {\n\t Tone.AudioNode.call(this);\n\t Tone.getContext(function () {\n\t this.createInsOuts(1, 0);\n\t /**\n\t\t\t\t * The private volume node\n\t\t\t\t * @type {Tone.Volume}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._volume = this.output = new Tone.Volume();\n\t /**\n\t\t\t\t * The volume of the master output.\n\t\t\t\t * @type {Decibels}\n\t\t\t\t * @signal\n\t\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t //connections\n\t this.input.chain(this.output, this.context.destination);\n\t }.bind(this));\n\t };\n\t Tone.extend(Tone.Master, Tone.AudioNode);\n\t /**\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Master.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Master#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * Tone.Master.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Master.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * Add a master effects chain. NOTE: this will disconnect any nodes which were previously\n\t\t * chained in the master effects chain.\n\t\t * @param {AudioNode|Tone} args... All arguments will be connected in a row\n\t\t * and the Master will be routed through it.\n\t\t * @return {Tone.Master} this\n\t\t * @example\n\t\t * //some overall compression to keep the levels in check\n\t\t * var masterCompressor = new Tone.Compressor({\n\t\t * \t\"threshold\" : -6,\n\t\t * \t\"ratio\" : 3,\n\t\t * \t\"attack\" : 0.5,\n\t\t * \t\"release\" : 0.1\n\t\t * });\n\t\t * //give a little boost to the lows\n\t\t * var lowBump = new Tone.Filter(200, \"lowshelf\");\n\t\t * //route everything through the filter\n\t\t * //and compressor before going to the speakers\n\t\t * Tone.Master.chain(lowBump, masterCompressor);\n\t\t */\n\t Tone.Master.prototype.chain = function () {\n\t this.input.disconnect();\n\t this.input.chain.apply(this.input, arguments);\n\t arguments[arguments.length - 1].connect(this.output);\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Master} this\n\t\t */\n\t Tone.Master.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('volume');\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tAUGMENT TONE's PROTOTYPE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Connect 'this' to the master output. Shorthand for this.connect(Tone.Master)\n\t\t * @returns {Tone.AudioNode} this\n\t\t * @example\n\t\t * //connect an oscillator to the master output\n\t\t * var osc = new Tone.Oscillator().toMaster();\n\t\t */\n\t Tone.AudioNode.prototype.toMaster = function () {\n\t this.connect(Tone.Master);\n\t return this;\n\t };\n\t if (window.AudioNode) {\n\t // Also augment AudioNode's prototype to include toMaster as a convenience\n\t AudioNode.prototype.toMaster = function () {\n\t this.connect(Tone.Master);\n\t return this;\n\t };\n\t }\n\t /**\n\t\t * initialize the module and listen for new audio contexts\n\t\t */\n\t var MasterConstructor = Tone.Master;\n\t Tone.Master = new MasterConstructor();\n\t Tone.Context.on('init', function (context) {\n\t // if it already exists, just restore it\n\t if (context.Master instanceof MasterConstructor) {\n\t Tone.Master = context.Master;\n\t } else {\n\t Tone.Master = new MasterConstructor();\n\t }\n\t context.Master = Tone.Master;\n\t });\n\t Tone.Context.on('close', function (context) {\n\t if (context.Master instanceof MasterConstructor) {\n\t context.Master.dispose();\n\t }\n\t });\n\t return Tone.Master;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for sources. Sources have start/stop methods\n\t\t * and the ability to be synced to the\n\t\t * start/stop of Tone.Transport.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * //Multiple state change events can be chained together,\n\t\t * //but must be set in the correct order and with ascending times\n\t\t *\n\t\t * // OK\n\t\t * state.start().stop(\"+0.2\");\n\t\t * // AND\n\t\t * state.start().stop(\"+0.2\").start(\"+0.4\").stop(\"+0.7\")\n\t\t *\n\t\t * // BAD\n\t\t * state.stop(\"+0.2\").start();\n\t\t * // OR\n\t\t * state.start(\"+0.3\").stop(\"+0.2\");\n\t\t *\n\t\t */\n\t Tone.Source = function (options) {\n\t options = Tone.defaultArg(options, Tone.Source.defaults);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The output volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * source.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t /**\n\t\t\t * \tKeep track of the scheduled state.\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t this._state.memory = 100;\n\t /**\n\t\t\t * The synced `start` callback function from the transport\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._synced = false;\n\t /**\n\t\t\t * Keep track of all of the scheduled event ids\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._scheduled = [];\n\t //make the output explicitly stereo\n\t this._volume.output.output.channelCount = 2;\n\t this._volume.output.output.channelCountMode = 'explicit';\n\t //mute initially\n\t this.mute = options.mute;\n\t };\n\t Tone.extend(Tone.Source, Tone.AudioNode);\n\t /**\n\t\t * The default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Source.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Source#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Source.prototype, 'state', {\n\t get: function () {\n\t if (this._synced) {\n\t if (Tone.Transport.state === Tone.State.Started) {\n\t return this._state.getValueAtTime(Tone.Transport.seconds);\n\t } else {\n\t return Tone.State.Stopped;\n\t }\n\t } else {\n\t return this._state.getValueAtTime(this.now());\n\t }\n\t }\n\t });\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * source.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Source.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t //overwrite these functions\n\t Tone.Source.prototype._start = Tone.noOp;\n\t Tone.Source.prototype.restart = Tone.noOp;\n\t Tone.Source.prototype._stop = Tone.noOp;\n\t /**\n\t\t * Start the source at the specified time. If no time is given,\n\t\t * start the source now.\n\t\t * @param {Time} [time=now] When the source should be started.\n\t\t * @returns {Tone.Source} this\n\t\t * @example\n\t\t * source.start(\"+0.5\"); //starts the source 0.5 seconds from now\n\t\t */\n\t Tone.Source.prototype.start = function (time, offset, duration) {\n\t if (Tone.isUndef(time) && this._synced) {\n\t time = Tone.Transport.seconds;\n\t } else {\n\t time = this.toSeconds(time);\n\t }\n\t //if it's started, stop it and restart it\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t this.restart(time, offset, duration);\n\t } else {\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t if (this._synced) {\n\t // add the offset time to the event\n\t var event = this._state.get(time);\n\t event.offset = Tone.defaultArg(offset, 0);\n\t event.duration = duration;\n\t var sched = Tone.Transport.schedule(function (t) {\n\t this._start(t, offset, duration);\n\t }.bind(this), time);\n\t this._scheduled.push(sched);\n\t //if it's already started\n\t if (Tone.Transport.state === Tone.State.Started) {\n\t this._syncedStart(this.now(), Tone.Transport.seconds);\n\t }\n\t } else {\n\t this._start.apply(this, arguments);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the source at the specified time. If no time is given,\n\t\t * stop the source now.\n\t\t * @param {Time} [time=now] When the source should be stopped.\n\t\t * @returns {Tone.Source} this\n\t\t * @example\n\t\t * source.stop(); // stops the source immediately\n\t\t */\n\t Tone.Source.prototype.stop = function (time) {\n\t if (Tone.isUndef(time) && this._synced) {\n\t time = Tone.Transport.seconds;\n\t } else {\n\t time = this.toSeconds(time);\n\t }\n\t if (!this._synced) {\n\t this._stop.apply(this, arguments);\n\t } else {\n\t var sched = Tone.Transport.schedule(this._stop.bind(this), time);\n\t this._scheduled.push(sched);\n\t }\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the source to the Transport so that all subsequent\n\t\t * calls to `start` and `stop` are synced to the TransportTime\n\t\t * instead of the AudioContext time.\n\t\t *\n\t\t * @returns {Tone.Source} this\n\t\t * @example\n\t\t * //sync the source so that it plays between 0 and 0.3 on the Transport's timeline\n\t\t * source.sync().start(0).stop(0.3);\n\t\t * //start the transport.\n\t\t * Tone.Transport.start();\n\t\t *\n\t\t * @example\n\t\t * //start the transport with an offset and the sync'ed sources\n\t\t * //will start in the correct position\n\t\t * source.sync().start(0.1);\n\t\t * //the source will be invoked with an offset of 0.4\n\t\t * Tone.Transport.start(\"+0.5\", 0.5);\n\t\t */\n\t Tone.Source.prototype.sync = function () {\n\t this._synced = true;\n\t this._syncedStart = function (time, offset) {\n\t if (offset > 0) {\n\t // get the playback state at that time\n\t var stateEvent = this._state.get(offset);\n\t // listen for start events which may occur in the middle of the sync'ed time\n\t if (stateEvent && stateEvent.state === Tone.State.Started && stateEvent.time !== offset) {\n\t // get the offset\n\t var startOffset = offset - this.toSeconds(stateEvent.time);\n\t var duration;\n\t if (stateEvent.duration) {\n\t duration = this.toSeconds(stateEvent.duration) - startOffset;\n\t }\n\t this._start(time, this.toSeconds(stateEvent.offset) + startOffset, duration);\n\t }\n\t }\n\t }.bind(this);\n\t this._syncedStop = function (time) {\n\t var seconds = Tone.Transport.getSecondsAtTime(Math.max(time - this.sampleTime, 0));\n\t if (this._state.getValueAtTime(seconds) === Tone.State.Started) {\n\t this._stop(time);\n\t }\n\t }.bind(this);\n\t Tone.Transport.on('start loopStart', this._syncedStart);\n\t Tone.Transport.on('stop pause loopEnd', this._syncedStop);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the source to the Transport. See Tone.Source.sync\n\t\t * @returns {Tone.Source} this\n\t\t */\n\t Tone.Source.prototype.unsync = function () {\n\t if (this._synced) {\n\t Tone.Transport.off('stop pause loopEnd', this._syncedStop);\n\t Tone.Transport.off('start loopStart', this._syncedStart);\n\t }\n\t this._synced = false;\n\t // clear all of the scheduled ids\n\t for (var i = 0; i < this._scheduled.length; i++) {\n\t var id = this._scheduled[i];\n\t Tone.Transport.clear(id);\n\t }\n\t this._scheduled = [];\n\t this._state.cancel(0);\n\t return this;\n\t };\n\t /**\n\t\t *\tClean up.\n\t\t * @return {Tone.Source} this\n\t\t */\n\t Tone.Source.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.unsync();\n\t this._scheduled = null;\n\t this._writable('volume');\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t this._state.dispose();\n\t this._state = null;\n\t };\n\t return Tone.Source;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * AudioBuffer.copyTo/FromChannel polyfill\n\t\t * @private\n\t\t */\n\t if (Tone.supported) {\n\t if (!AudioBuffer.prototype.copyToChannel) {\n\t AudioBuffer.prototype.copyToChannel = function (src, chanNum, start) {\n\t var channel = this.getChannelData(chanNum);\n\t start = start || 0;\n\t for (var i = 0; i < channel.length; i++) {\n\t channel[i + start] = src[i];\n\t }\n\t };\n\t AudioBuffer.prototype.copyFromChannel = function (dest, chanNum, start) {\n\t var channel = this.getChannelData(chanNum);\n\t start = start || 0;\n\t for (var i = 0; i < dest.length; i++) {\n\t dest[i] = channel[i + start];\n\t }\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Buffer loading and storage. Tone.Buffer is used internally by all\n\t\t * classes that make requests for audio files such as Tone.Player,\n\t\t * Tone.Sampler and Tone.Convolver.\n\t\t *\n\t\t * Aside from load callbacks from individual buffers, Tone.Buffer\n\t\t * \t\tprovides events which keep track of the loading progress\n\t\t * \t\tof _all_ of the buffers. These are Tone.Buffer.on(\"load\" / \"progress\" / \"error\")\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t * @param {AudioBuffer|String} url The url to load, or the audio buffer to set.\n\t\t * @param {Function=} onload A callback which is invoked after the buffer is loaded.\n\t\t * It's recommended to use `Tone.Buffer.on('load', callback)` instead\n\t\t * since it will give you a callback when _all_ buffers are loaded.\n\t\t * @param {Function=} onerror The callback to invoke if there is an error\n\t\t * @example\n\t\t * var buffer = new Tone.Buffer(\"path/to/sound.mp3\", function(){\n\t\t * \t//the buffer is now available.\n\t\t * \tvar buff = buffer.get();\n\t\t * });\n\t\t * @example\n\t\t * //can load provide fallback extension types if the first type is not supported.\n\t\t * var buffer = new Tone.Buffer(\"path/to/sound.[mp3|ogg|wav]\");\n\t\t */\n\t Tone.Buffer = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload',\n\t 'onerror'\n\t ], Tone.Buffer);\n\t Tone.call(this);\n\t /**\n\t\t\t * stores the loaded AudioBuffer\n\t\t\t * @type {AudioBuffer}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = null;\n\t /**\n\t\t\t * indicates if the buffer should be reversed or not\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._reversed = options.reverse;\n\t /**\n\t\t\t * The XHR\n\t\t\t * @type {XMLHttpRequest}\n\t\t\t * @private\n\t\t\t */\n\t this._xhr = null;\n\t /**\n\t\t\t * Private callback when the buffer is loaded.\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._onload = Tone.noOp;\n\t if (options.url instanceof AudioBuffer || options.url instanceof Tone.Buffer) {\n\t this.set(options.url);\n\t // invoke the onload callback\n\t if (options.onload) {\n\t if (this.loaded) {\n\t options.onload(this);\n\t } else {\n\t this._onload = options.onload;\n\t }\n\t }\n\t } else if (Tone.isString(options.url)) {\n\t this.load(options.url).then(options.onload).catch(options.onerror);\n\t }\n\t };\n\t Tone.extend(Tone.Buffer);\n\t /**\n\t\t * the default parameters\n\t\t * @type {Object}\n\t\t */\n\t Tone.Buffer.defaults = {\n\t 'url': undefined,\n\t 'reverse': false,\n\t 'onload': Tone.noOp,\n\t 'onerror': Tone.noOp\n\t };\n\t /**\n\t\t * Pass in an AudioBuffer or Tone.Buffer to set the value\n\t\t * of this buffer.\n\t\t * @param {AudioBuffer|Tone.Buffer} buffer the buffer\n\t\t * @returns {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.set = function (buffer) {\n\t if (buffer instanceof Tone.Buffer) {\n\t if (buffer.loaded) {\n\t this._buffer = buffer.get();\n\t } else {\n\t buffer._onload = function () {\n\t this.set(buffer);\n\t this._onload(this);\n\t }.bind(this);\n\t }\n\t } else {\n\t this._buffer = buffer;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * @return {AudioBuffer} The audio buffer stored in the object.\n\t\t */\n\t Tone.Buffer.prototype.get = function () {\n\t return this._buffer;\n\t };\n\t /**\n\t\t * Makes an xhr reqest for the selected url then decodes\n\t\t * the file as an audio buffer. Invokes\n\t\t * the callback once the audio buffer loads.\n\t\t * @param {String} url The url of the buffer to load.\n\t\t * filetype support depends on the\n\t\t * browser.\n\t\t * @returns {Promise} returns a Promise which resolves with the Tone.Buffer\n\t\t */\n\t Tone.Buffer.prototype.load = function (url, onload, onerror) {\n\t var promise = new Promise(function (load, error) {\n\t this._xhr = Tone.Buffer.load(url, //success\n\t function (buff) {\n\t this._xhr = null;\n\t this.set(buff);\n\t load(this);\n\t this._onload(this);\n\t if (onload) {\n\t onload(this);\n\t }\n\t }.bind(this), //error\n\t function (err) {\n\t this._xhr = null;\n\t error(err);\n\t if (onerror) {\n\t onerror(err);\n\t }\n\t }.bind(this));\n\t }.bind(this));\n\t return promise;\n\t };\n\t /**\n\t\t * dispose and disconnect\n\t\t * @returns {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this._buffer = null;\n\t if (this._xhr) {\n\t Tone.Buffer._removeFromDownloadQueue(this._xhr);\n\t this._xhr.abort();\n\t this._xhr = null;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * If the buffer is loaded or not\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'loaded', {\n\t get: function () {\n\t return this.length > 0;\n\t }\n\t });\n\t /**\n\t\t * The duration of the buffer.\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Number}\n\t\t * @name duration\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'duration', {\n\t get: function () {\n\t if (this._buffer) {\n\t return this._buffer.duration;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The length of the buffer in samples\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Number}\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'length', {\n\t get: function () {\n\t if (this._buffer) {\n\t return this._buffer.length;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of discrete audio channels. Returns 0 if no buffer\n\t\t * is loaded.\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Number}\n\t\t * @name numberOfChannels\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'numberOfChannels', {\n\t get: function () {\n\t if (this._buffer) {\n\t return this._buffer.numberOfChannels;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Set the audio buffer from the array. To create a multichannel AudioBuffer,\n\t\t * pass in a multidimensional array.\n\t\t * @param {Float32Array} array The array to fill the audio buffer\n\t\t * @return {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.fromArray = function (array) {\n\t var isMultidimensional = array[0].length > 0;\n\t var channels = isMultidimensional ? array.length : 1;\n\t var len = isMultidimensional ? array[0].length : array.length;\n\t var buffer = this.context.createBuffer(channels, len, this.context.sampleRate);\n\t if (!isMultidimensional && channels === 1) {\n\t array = [array];\n\t }\n\t for (var c = 0; c < channels; c++) {\n\t buffer.copyToChannel(array[c], c);\n\t }\n\t this._buffer = buffer;\n\t return this;\n\t };\n\t /**\n\t\t * \tSums muliple channels into 1 channel\n\t\t * @param {Number=} channel Optionally only copy a single channel from the array.\n\t\t * @return {Array}\n\t\t */\n\t Tone.Buffer.prototype.toMono = function (chanNum) {\n\t if (Tone.isNumber(chanNum)) {\n\t this.fromArray(this.toArray(chanNum));\n\t } else {\n\t var outputArray = new Float32Array(this.length);\n\t var numChannels = this.numberOfChannels;\n\t for (var channel = 0; channel < numChannels; channel++) {\n\t var channelArray = this.toArray(channel);\n\t for (var i = 0; i < channelArray.length; i++) {\n\t outputArray[i] += channelArray[i];\n\t }\n\t }\n\t //divide by the number of channels\n\t outputArray = outputArray.map(function (sample) {\n\t return sample / numChannels;\n\t });\n\t this.fromArray(outputArray);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * \tGet the buffer as an array. Single channel buffers will return a 1-dimensional\n\t\t * \tFloat32Array, and multichannel buffers will return multidimensional arrays.\n\t\t * @param {Number=} channel Optionally only copy a single channel from the array.\n\t\t * @return {Array}\n\t\t */\n\t Tone.Buffer.prototype.toArray = function (channel) {\n\t if (Tone.isNumber(channel)) {\n\t return this.getChannelData(channel);\n\t } else if (this.numberOfChannels === 1) {\n\t return this.toArray(0);\n\t } else {\n\t var ret = [];\n\t for (var c = 0; c < this.numberOfChannels; c++) {\n\t ret[c] = this.getChannelData(c);\n\t }\n\t return ret;\n\t }\n\t };\n\t /**\n\t\t * Returns the Float32Array representing the PCM audio data for the specific channel.\n\t\t * @param {Number} channel The channel number to return\n\t\t * @return {Float32Array} The audio as a TypedArray\n\t\t */\n\t Tone.Buffer.prototype.getChannelData = function (channel) {\n\t return this._buffer.getChannelData(channel);\n\t };\n\t /**\n\t\t * Cut a subsection of the array and return a buffer of the\n\t\t * subsection. Does not modify the original buffer\n\t\t * @param {Time} start The time to start the slice\n\t\t * @param {Time=} end The end time to slice. If none is given\n\t\t * will default to the end of the buffer\n\t\t * @return {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.slice = function (start, end) {\n\t end = Tone.defaultArg(end, this.duration);\n\t var startSamples = Math.floor(this.context.sampleRate * this.toSeconds(start));\n\t var endSamples = Math.floor(this.context.sampleRate * this.toSeconds(end));\n\t var replacement = [];\n\t for (var i = 0; i < this.numberOfChannels; i++) {\n\t replacement[i] = this.toArray(i).slice(startSamples, endSamples);\n\t }\n\t var retBuffer = new Tone.Buffer().fromArray(replacement);\n\t return retBuffer;\n\t };\n\t /**\n\t\t * Reverse the buffer.\n\t\t * @private\n\t\t * @return {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype._reverse = function () {\n\t if (this.loaded) {\n\t for (var i = 0; i < this.numberOfChannels; i++) {\n\t Array.prototype.reverse.call(this.getChannelData(i));\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Reverse the buffer.\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Boolean}\n\t\t * @name reverse\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'reverse', {\n\t get: function () {\n\t return this._reversed;\n\t },\n\t set: function (rev) {\n\t if (this._reversed !== rev) {\n\t this._reversed = rev;\n\t this._reverse();\n\t }\n\t }\n\t });\n\t ///////////////////////////////////////////////////////////////////////////\n\t // STATIC METHODS\n\t ///////////////////////////////////////////////////////////////////////////\n\t //statically inherits Emitter methods\n\t Tone.Emitter.mixin(Tone.Buffer);\n\t /**\n\t\t * the static queue for all of the xhr requests\n\t\t * @type {Array}\n\t\t * @private\n\t\t */\n\t Tone.Buffer._downloadQueue = [];\n\t /**\n\t\t * A path which is prefixed before every url.\n\t\t * @type {String}\n\t\t * @static\n\t\t */\n\t Tone.Buffer.baseUrl = '';\n\t /**\n\t\t * Create a Tone.Buffer from the array. To create a multichannel AudioBuffer,\n\t\t * pass in a multidimensional array.\n\t\t * @param {Float32Array} array The array to fill the audio buffer\n\t\t * @return {Tone.Buffer} A Tone.Buffer created from the array\n\t\t */\n\t Tone.Buffer.fromArray = function (array) {\n\t return new Tone.Buffer().fromArray(array);\n\t };\n\t /**\n\t\t * Creates a Tone.Buffer from a URL, returns a promise\n\t\t * which resolves to a Tone.Buffer\n\t\t * @param {String} url The url to load.\n\t\t * @return {Promise<Tone.Buffer>} A promise which resolves to a Tone.Buffer\n\t\t */\n\t Tone.Buffer.fromUrl = function (url) {\n\t var buffer = new Tone.Buffer();\n\t return buffer.load(url).then(function () {\n\t return buffer;\n\t });\n\t };\n\t /**\n\t\t * Remove an xhr request from the download queue\n\t\t * @private\n\t\t */\n\t Tone.Buffer._removeFromDownloadQueue = function (request) {\n\t var index = Tone.Buffer._downloadQueue.indexOf(request);\n\t if (index !== -1) {\n\t Tone.Buffer._downloadQueue.splice(index, 1);\n\t }\n\t };\n\t /**\n\t\t * Loads a url using XMLHttpRequest.\n\t\t * @param {String} url\n\t\t * @param {Function} onload\n\t\t * @param {Function} onerror\n\t\t * @param {Function} onprogress\n\t\t * @return {XMLHttpRequest}\n\t\t */\n\t Tone.Buffer.load = function (url, onload, onerror) {\n\t //default\n\t onload = Tone.defaultArg(onload, Tone.noOp);\n\t // test if the url contains multiple extensions\n\t var matches = url.match(/\\[(.+\\|?)+\\]$/);\n\t if (matches) {\n\t var extensions = matches[1].split('|');\n\t var extension = extensions[0];\n\t for (var i = 0; i < extensions.length; i++) {\n\t if (Tone.Buffer.supportsType(extensions[i])) {\n\t extension = extensions[i];\n\t break;\n\t }\n\t }\n\t url = url.replace(matches[0], extension);\n\t }\n\t function onError(e) {\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t Tone.Buffer.emit('error', e);\n\t if (onerror) {\n\t onerror(e);\n\t } else {\n\t throw e;\n\t }\n\t }\n\t function onProgress() {\n\t //calculate the progress\n\t var totalProgress = 0;\n\t for (var i = 0; i < Tone.Buffer._downloadQueue.length; i++) {\n\t totalProgress += Tone.Buffer._downloadQueue[i].progress;\n\t }\n\t Tone.Buffer.emit('progress', totalProgress / Tone.Buffer._downloadQueue.length);\n\t }\n\t var request = new XMLHttpRequest();\n\t request.open('GET', Tone.Buffer.baseUrl + url, true);\n\t request.responseType = 'arraybuffer';\n\t //start out as 0\n\t request.progress = 0;\n\t Tone.Buffer._downloadQueue.push(request);\n\t request.addEventListener('load', function () {\n\t if (request.status === 200) {\n\t Tone.context.decodeAudioData(request.response).then(function (buff) {\n\t request.progress = 1;\n\t onProgress();\n\t onload(buff);\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t if (Tone.Buffer._downloadQueue.length === 0) {\n\t //emit the event at the end\n\t Tone.Buffer.emit('load');\n\t }\n\t }).catch(function () {\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t onError('Tone.Buffer: could not decode audio data: ' + url);\n\t });\n\t } else {\n\t onError('Tone.Buffer: could not locate file: ' + url);\n\t }\n\t });\n\t request.addEventListener('error', onError);\n\t request.addEventListener('progress', function (event) {\n\t if (event.lengthComputable) {\n\t //only go to 95%, the last 5% is when the audio is decoded\n\t request.progress = event.loaded / event.total * 0.95;\n\t onProgress();\n\t }\n\t });\n\t request.send();\n\t return request;\n\t };\n\t /**\n\t\t * Stop all of the downloads in progress\n\t\t * @return {Tone.Buffer}\n\t\t * @static\n\t\t */\n\t Tone.Buffer.cancelDownloads = function () {\n\t Tone.Buffer._downloadQueue.slice().forEach(function (request) {\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t request.abort();\n\t });\n\t return Tone.Buffer;\n\t };\n\t /**\n\t\t * Checks a url's extension to see if the current browser can play that file type.\n\t\t * @param {String} url The url/extension to test\n\t\t * @return {Boolean} If the file extension can be played\n\t\t * @static\n\t\t * @example\n\t\t * Tone.Buffer.supportsType(\"wav\"); //returns true\n\t\t * Tone.Buffer.supportsType(\"path/to/file.wav\"); //returns true\n\t\t */\n\t Tone.Buffer.supportsType = function (url) {\n\t var extension = url.split('.');\n\t extension = extension[extension.length - 1];\n\t var response = document.createElement('audio').canPlayType('audio/' + extension);\n\t return response !== '';\n\t };\n\t /**\n\t\t * Returns a Promise which resolves when all of the buffers have loaded\n\t\t * @return {Promise}\n\t\t */\n\t Tone.loaded = function () {\n\t var onload, onerror;\n\t function removeEvents() {\n\t //remove the events when it's resolved\n\t Tone.Buffer.off('load', onload);\n\t Tone.Buffer.off('error', onerror);\n\t }\n\t return new Promise(function (success, fail) {\n\t onload = function () {\n\t success();\n\t };\n\t onerror = function () {\n\t fail();\n\t };\n\t //add the event listeners\n\t Tone.Buffer.on('load', onload);\n\t Tone.Buffer.on('error', onerror);\n\t }).then(removeEvents).catch(function (e) {\n\t removeEvents();\n\t throw new Error(e);\n\t });\n\t };\n\t return Tone.Buffer;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the native fire-and-forget OscillatorNode. Adds the\n\t\t * ability to reschedule the stop method.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {AudioBuffer|Tone.Buffer} buffer The buffer to play\n\t\t * @param {Function} onload The callback to invoke when the\n\t\t * buffer is done playing.\n\t\t */\n\t Tone.OscillatorNode = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type'\n\t ], Tone.OscillatorNode);\n\t Tone.AudioNode.call(this, options);\n\t /**\n\t\t\t * The callback to invoke after the\n\t\t\t * buffer source is done playing.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.onended = options.onended;\n\t /**\n\t\t\t * The oscillator start time\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._startTime = -1;\n\t /**\n\t\t\t * The oscillator stop time\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._stopTime = -1;\n\t /**\n\t\t\t * The gain node which envelopes the OscillatorNode\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gainNode = this.output = new Tone.Gain();\n\t this._gainNode.gain.setValueAtTime(0, this.context.currentTime);\n\t /**\n\t\t\t * The oscillator\n\t\t\t * @type {OscillatorNode}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = this.context.createOscillator();\n\t this._oscillator.connect(this._gainNode);\n\t this.type = options.type;\n\t /**\n\t\t\t * The frequency of the oscillator\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Param(this._oscillator.frequency, Tone.Type.Frequency);\n\t this.frequency.value = options.frequency;\n\t /**\n\t\t\t * The detune of the oscillator\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Param(this._oscillator.detune, Tone.Type.Cents);\n\t this.detune.value = options.detune;\n\t /**\n\t\t\t * The value that the buffer ramps to\n\t\t\t * @type {Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gain = 1;\n\t };\n\t Tone.extend(Tone.OscillatorNode, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.OscillatorNode.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'type': 'sine',\n\t 'onended': Tone.noOp\n\t };\n\t /**\n\t\t * Returns the playback state of the oscillator, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.OscillatorNode#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.OscillatorNode.prototype, 'state', {\n\t get: function () {\n\t return this.getStateAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Get the playback state at the given time\n\t\t * @param {Time} time The time to test the state at\n\t\t * @return {Tone.State} The playback state. \n\t\t */\n\t Tone.OscillatorNode.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._startTime !== -1 && time >= this._startTime && (this._stopTime === -1 || time <= this._stopTime)) {\n\t return Tone.State.Started;\n\t } else {\n\t return Tone.State.Stopped;\n\t }\n\t };\n\t /**\n\t * Start the oscillator node at the given time\n\t * @param {Time=} time When to start the oscillator\n\t * @return {OscillatorNode} this\n\t */\n\t Tone.OscillatorNode.prototype.start = function (time) {\n\t if (this._startTime === -1) {\n\t this._startTime = this.toSeconds(time);\n\t this._oscillator.start(this._startTime);\n\t var now = this.context.currentTime;\n\t this._gainNode.gain.cancelScheduledValues(now);\n\t this._gainNode.gain.setValueAtTime(0, now);\n\t this._gainNode.gain.setValueAtTime(1, this._startTime);\n\t } else {\n\t throw new Error('cannot call OscillatorNode.start more than once');\n\t }\n\t return this;\n\t };\n\t /**\n\t * Sets an arbitrary custom periodic waveform given a PeriodicWave.\n\t * @param {PeriodicWave} periodicWave PeriodicWave should be created with context.createPeriodicWave\n\t * @return {OscillatorNode} this\n\t */\n\t Tone.OscillatorNode.prototype.setPeriodicWave = function (periodicWave) {\n\t this._oscillator.setPeriodicWave(periodicWave);\n\t return this;\n\t };\n\t /**\n\t * Stop the oscillator node at the given time\n\t * @param {Time=} time When to stop the oscillator\n\t * @return {OscillatorNode} this\n\t */\n\t Tone.OscillatorNode.prototype.stop = function (time) {\n\t //cancel the previous stop\n\t this.cancelStop();\n\t //reschedule it\n\t this._stopTime = this.toSeconds(time);\n\t this._gainNode.gain.setValueAtTime(0, this._stopTime);\n\t this.context.clearTimeout(this._timeout);\n\t this._timeout = this.context.setTimeout(function () {\n\t this._oscillator.stop(this.now());\n\t this.onended();\n\t }.bind(this), this._stopTime - this.now());\n\t return this;\n\t };\n\t /**\n\t\t * Cancel a scheduled stop event\n\t\t * @return {Tone.OscillatorNode} this\n\t\t */\n\t Tone.OscillatorNode.prototype.cancelStop = function () {\n\t if (this._startTime !== -1) {\n\t //cancel the stop envelope\n\t this._gainNode.gain.cancelScheduledValues(this._startTime + this.sampleTime);\n\t this._gainNode.gain.setValueAtTime(1, Math.max(this.now(), this._startTime));\n\t this.context.clearTimeout(this._timeout);\n\t this._stopTime = -1;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * The oscillator type. Either 'sine', 'sawtooth', 'square', or 'triangle'\n\t\t * @memberOf Tone.OscillatorNode#\n\t\t * @type {Time}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.OscillatorNode.prototype, 'type', {\n\t get: function () {\n\t return this._oscillator.type;\n\t },\n\t set: function (type) {\n\t this._oscillator.type = type;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.OscillatorNode} this\n\t\t */\n\t Tone.OscillatorNode.prototype.dispose = function () {\n\t this.context.clearTimeout(this._timeout);\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.onended = null;\n\t this._oscillator.disconnect();\n\t this._oscillator = null;\n\t this._gainNode.dispose();\n\t this._gainNode = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.OscillatorNode;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Oscillator supports a number of features including\n\t\t * phase rotation, multiple oscillator types (see Tone.Oscillator.type),\n\t\t * and Transport syncing (see Tone.Oscillator.syncFrequency).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {Frequency} [frequency] Starting frequency\n\t\t * @param {string} [type] The oscillator type. Read more about type below.\n\t\t * @example\n\t\t * //make and start a 440hz sine tone\n\t\t * var osc = new Tone.Oscillator(440, \"sine\").toMaster().start();\n\t\t */\n\t Tone.Oscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type'\n\t ], Tone.Oscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * the main oscillator\n\t\t\t * @type {OscillatorNode}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = null;\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * the periodic wave\n\t\t\t * @type {PeriodicWave}\n\t\t\t * @private\n\t\t\t */\n\t this._wave = null;\n\t /**\n\t\t\t * The partials of the oscillator\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._partials = Tone.defaultArg(options.partials, [1]);\n\t /**\n\t\t\t * the phase of the oscillator\n\t\t\t * between 0 - 360\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._phase = options.phase;\n\t /**\n\t\t\t * the type of the oscillator\n\t\t\t * @type {string}\n\t\t\t * @private\n\t\t\t */\n\t this._type = null;\n\t //setup\n\t this.type = options.type;\n\t this.phase = this._phase;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.Oscillator, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t * @type {Object}\n\t\t */\n\t Tone.Oscillator.defaults = {\n\t 'type': 'sine',\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'partials': []\n\t };\n\t /**\n\t\t * The Oscillator types\n\t\t * @enum {String}\n\t\t */\n\t Tone.Oscillator.Type = {\n\t Sine: 'sine',\n\t Triangle: 'triangle',\n\t Sawtooth: 'sawtooth',\n\t Square: 'square',\n\t Custom: 'custom'\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._start = function (time) {\n\t //new oscillator with previous values\n\t this._oscillator = new Tone.OscillatorNode();\n\t if (this._wave) {\n\t this._oscillator.setPeriodicWave(this._wave);\n\t } else {\n\t this._oscillator.type = this._type;\n\t }\n\t //connect the control signal to the oscillator frequency & detune\n\t this._oscillator.connect(this.output);\n\t this.frequency.connect(this._oscillator.frequency);\n\t this.detune.connect(this._oscillator.detune);\n\t //start the oscillator\n\t time = this.toSeconds(time);\n\t this._oscillator.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @private\n\t\t * @param {Time} [time=now] (optional) timing parameter\n\t\t * @returns {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype._stop = function (time) {\n\t if (this._oscillator) {\n\t time = this.toSeconds(time);\n\t this._oscillator.stop(time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Restart the oscillator. Does not stop the oscillator, but instead\n\t\t * just cancels any scheduled 'stop' from being invoked.\n\t\t * @param {Time=} time\n\t\t * @return {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype.restart = function (time) {\n\t this._oscillator.cancelStop();\n\t this._state.cancel(this.toSeconds(time));\n\t return this;\n\t };\n\t /**\n\t\t * Sync the signal to the Transport's bpm. Any changes to the transports bpm,\n\t\t * will also affect the oscillators frequency.\n\t\t * @returns {Tone.Oscillator} this\n\t\t * @example\n\t\t * Tone.Transport.bpm.value = 120;\n\t\t * osc.frequency.value = 440;\n\t\t * //the ration between the bpm and the frequency will be maintained\n\t\t * osc.syncFrequency();\n\t\t * Tone.Transport.bpm.value = 240;\n\t\t * // the frequency of the oscillator is doubled to 880\n\t\t */\n\t Tone.Oscillator.prototype.syncFrequency = function () {\n\t Tone.Transport.syncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the oscillator's frequency from the Transport.\n\t\t * See Tone.Oscillator.syncFrequency\n\t\t * @returns {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype.unsyncFrequency = function () {\n\t Tone.Transport.unsyncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * The type of the oscillator: either sine, square, triangle, or sawtooth. Also capable of\n\t\t * setting the first x number of partials of the oscillator. For example: \"sine4\" would\n\t\t * set be the first 4 partials of the sine wave and \"triangle8\" would set the first\n\t\t * 8 partials of the triangle wave.\n\t\t * <br><br>\n\t\t * Uses PeriodicWave internally even for native types so that it can set the phase.\n\t\t * PeriodicWave equations are from the\n\t\t * [Webkit Web Audio implementation](https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp&sq=package:chromium).\n\t\t *\n\t\t * @memberOf Tone.Oscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t * @example\n\t\t * //set it to a square wave\n\t\t * osc.type = \"square\";\n\t\t * @example\n\t\t * //set the first 6 partials of a sawtooth wave\n\t\t * osc.type = \"sawtooth6\";\n\t\t */\n\t Object.defineProperty(Tone.Oscillator.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t var isBasicType = [\n\t Tone.Oscillator.Type.Sine,\n\t Tone.Oscillator.Type.Square,\n\t Tone.Oscillator.Type.Triangle,\n\t Tone.Oscillator.Type.Sawtooth\n\t ].includes(type);\n\t if (this._phase === 0 && isBasicType) {\n\t this._wave = null;\n\t //just go with the basic approach\n\t if (this._oscillator !== null) {\n\t this._oscillator.type === type;\n\t }\n\t } else {\n\t var coefs = this._getRealImaginary(type, this._phase);\n\t var periodicWave = this.context.createPeriodicWave(coefs[0], coefs[1]);\n\t this._wave = periodicWave;\n\t if (this._oscillator !== null) {\n\t this._oscillator.setPeriodicWave(this._wave);\n\t }\n\t }\n\t this._type = type;\n\t }\n\t });\n\t /**\n\t\t * Returns the real and imaginary components based\n\t\t * on the oscillator type.\n\t\t * @returns {Array} [real, imaginary]\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._getRealImaginary = function (type, phase) {\n\t var fftSize = 4096;\n\t var periodicWaveSize = fftSize / 2;\n\t var real = new Float32Array(periodicWaveSize);\n\t var imag = new Float32Array(periodicWaveSize);\n\t var partialCount = 1;\n\t if (type === Tone.Oscillator.Type.Custom) {\n\t partialCount = this._partials.length + 1;\n\t periodicWaveSize = partialCount;\n\t } else {\n\t var partial = /^(sine|triangle|square|sawtooth)(\\d+)$/.exec(type);\n\t if (partial) {\n\t partialCount = parseInt(partial[2]) + 1;\n\t type = partial[1];\n\t partialCount = Math.max(partialCount, 2);\n\t periodicWaveSize = partialCount;\n\t }\n\t }\n\t for (var n = 1; n < periodicWaveSize; ++n) {\n\t var piFactor = 2 / (n * Math.PI);\n\t var b;\n\t switch (type) {\n\t case Tone.Oscillator.Type.Sine:\n\t b = n <= partialCount ? 1 : 0;\n\t break;\n\t case Tone.Oscillator.Type.Square:\n\t b = n & 1 ? 2 * piFactor : 0;\n\t break;\n\t case Tone.Oscillator.Type.Sawtooth:\n\t b = piFactor * (n & 1 ? 1 : -1);\n\t break;\n\t case Tone.Oscillator.Type.Triangle:\n\t if (n & 1) {\n\t b = 2 * (piFactor * piFactor) * (n - 1 >> 1 & 1 ? -1 : 1);\n\t } else {\n\t b = 0;\n\t }\n\t break;\n\t case Tone.Oscillator.Type.Custom:\n\t b = this._partials[n - 1];\n\t break;\n\t default:\n\t throw new TypeError('Tone.Oscillator: invalid type: ' + type);\n\t }\n\t if (b !== 0) {\n\t real[n] = -b * Math.sin(phase * n);\n\t imag[n] = b * Math.cos(phase * n);\n\t } else {\n\t real[n] = 0;\n\t imag[n] = 0;\n\t }\n\t }\n\t return [\n\t real,\n\t imag\n\t ];\n\t };\n\t /**\n\t\t * Compute the inverse FFT for a given phase.\n\t\t * @param {Float32Array} real\n\t\t * @param {Float32Array} imag\n\t\t * @param {NormalRange} phase\n\t\t * @return {AudioRange}\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._inverseFFT = function (real, imag, phase) {\n\t var sum = 0;\n\t var len = real.length;\n\t for (var i = 0; i < len; i++) {\n\t sum += real[i] * Math.cos(i * phase) + imag[i] * Math.sin(i * phase);\n\t }\n\t return sum;\n\t };\n\t /**\n\t\t * Returns the initial value of the oscillator.\n\t\t * @return {AudioRange}\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._getInitialValue = function () {\n\t var coefs = this._getRealImaginary(this._type, 0);\n\t var real = coefs[0];\n\t var imag = coefs[1];\n\t var maxValue = 0;\n\t var twoPi = Math.PI * 2;\n\t //check for peaks in 8 places\n\t for (var i = 0; i < 8; i++) {\n\t maxValue = Math.max(this._inverseFFT(real, imag, i / 8 * twoPi), maxValue);\n\t }\n\t return -this._inverseFFT(real, imag, this._phase) / maxValue;\n\t };\n\t /**\n\t\t * The partials of the waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.Oscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.Oscillator.prototype, 'partials', {\n\t get: function () {\n\t if (this._type !== Tone.Oscillator.Type.Custom) {\n\t return [];\n\t } else {\n\t return this._partials;\n\t }\n\t },\n\t set: function (partials) {\n\t this._partials = partials;\n\t this.type = Tone.Oscillator.Type.Custom;\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.Oscillator#\n\t\t * @type {Degrees}\n\t\t * @name phase\n\t\t * @example\n\t\t * osc.phase = 180; //flips the phase of the oscillator\n\t\t */\n\t Object.defineProperty(Tone.Oscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._phase * (180 / Math.PI);\n\t },\n\t set: function (phase) {\n\t this._phase = phase * Math.PI / 180;\n\t //reset the type\n\t this.type = this._type;\n\t }\n\t });\n\t /**\n\t\t * Dispose and disconnect.\n\t\t * @return {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t if (this._oscillator !== null) {\n\t this._oscillator.dispose();\n\t this._oscillator = null;\n\t }\n\t this._wave = null;\n\t this._writable([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this._partials = null;\n\t return this;\n\t };\n\t return Tone.Oscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class AudioToGain converts an input in AudioRange [-1,1] to NormalRange [0,1]. \n\t\t * See Tone.GainToAudio.\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @example\n\t\t * var a2g = new Tone.AudioToGain();\n\t\t */\n\t Tone.AudioToGain = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._norm = this.input = this.output = new Tone.WaveShaper(function (x) {\n\t return (x + 1) / 2;\n\t });\n\t };\n\t Tone.extend(Tone.AudioToGain, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.AudioToGain} this\n\t\t */\n\t Tone.AudioToGain.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._norm.dispose();\n\t this._norm = null;\n\t return this;\n\t };\n\t return Tone.AudioToGain;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Zero outputs 0's at audio-rate. The reason this has to be\n\t\t * it's own class is that many browsers optimize out Tone.Signal\n\t\t * with a value of 0 and will not process nodes further down the graph.\n\t\t * @extends {Tone.SignalBase}\n\t\t */\n\t Tone.Zero = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * The gain node\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gain = this.input = this.output = new Tone.Gain();\n\t this.context.getConstant(0).connect(this._gain);\n\t };\n\t Tone.extend(Tone.Zero, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @return {Tone.Zero} this\n\t\t */\n\t Tone.Zero.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._gain.dispose();\n\t this._gain = null;\n\t return this;\n\t };\n\t return Tone.Zero;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class LFO stands for low frequency oscillator. Tone.LFO produces an output signal\n\t\t * which can be attached to an AudioParam or Tone.Signal\n\t\t * in order to modulate that parameter with an oscillator. The LFO can\n\t\t * also be synced to the transport to start/stop and change when the tempo changes.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Frequency|Object} [frequency] The frequency of the oscillation. Typically, LFOs will be\n\t\t * in the frequency range of 0.1 to 10 hertz.\n\t\t * @param {number=} min The minimum output value of the LFO.\n\t\t * @param {number=} max The maximum value of the LFO.\n\t\t * @example\n\t\t * var lfo = new Tone.LFO(\"4n\", 400, 4000);\n\t\t * lfo.connect(filter.frequency);\n\t\t */\n\t Tone.LFO = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'min',\n\t 'max'\n\t ], Tone.LFO);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = new Tone.Oscillator({\n\t 'frequency': options.frequency,\n\t 'type': options.type\n\t });\n\t /**\n\t\t\t * the lfo's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._oscillator.frequency;\n\t /**\n\t\t\t * The amplitude of the LFO, which controls the output range between\n\t\t\t * the min and max output. For example if the min is -10 and the max\n\t\t\t * is 10, setting the amplitude to 0.5 would make the LFO modulate\n\t\t\t * between -5 and 5.\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.amplitude = this._oscillator.volume;\n\t this.amplitude.units = Tone.Type.NormalRange;\n\t this.amplitude.value = options.amplitude;\n\t /**\n\t\t\t * The signal which is output when the LFO is stopped\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._stoppedSignal = new Tone.Signal(0, Tone.Type.AudioRange);\n\t /**\n\t\t\t * Just outputs zeros.\n\t\t\t * @type {Tone.Zero}\n\t\t\t * @private\n\t\t\t */\n\t this._zeros = new Tone.Zero();\n\t /**\n\t\t\t * The value that the LFO outputs when it's stopped\n\t\t\t * @type {AudioRange}\n\t\t\t * @private\n\t\t\t */\n\t this._stoppedValue = 0;\n\t /**\n\t\t\t * @type {Tone.AudioToGain}\n\t\t\t * @private\n\t\t\t */\n\t this._a2g = new Tone.AudioToGain();\n\t /**\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._scaler = this.output = new Tone.Scale(options.min, options.max);\n\t /**\n\t\t\t * the units of the LFO (used for converting)\n\t\t\t * @type {Tone.Type}\n\t\t\t * @private\n\t\t\t */\n\t this._units = Tone.Type.Default;\n\t this.units = options.units;\n\t //connect it up\n\t this._oscillator.chain(this._a2g, this._scaler);\n\t this._zeros.connect(this._a2g);\n\t this._stoppedSignal.connect(this._a2g);\n\t this._readOnly([\n\t 'amplitude',\n\t 'frequency'\n\t ]);\n\t this.phase = options.phase;\n\t };\n\t Tone.extend(Tone.LFO, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t *\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.LFO.defaults = {\n\t 'type': 'sine',\n\t 'min': 0,\n\t 'max': 1,\n\t 'phase': 0,\n\t 'frequency': '4n',\n\t 'amplitude': 1,\n\t 'units': Tone.Type.Default\n\t };\n\t /**\n\t\t * Start the LFO.\n\t\t * @param {Time} [time=now] the time the LFO will start\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.start = function (time) {\n\t time = this.toSeconds(time);\n\t this._stoppedSignal.setValueAtTime(0, time);\n\t this._oscillator.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the LFO.\n\t\t * @param {Time} [time=now] the time the LFO will stop\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._stoppedSignal.setValueAtTime(this._stoppedValue, time);\n\t this._oscillator.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the start/stop/pause to the transport\n\t\t * and the frequency to the bpm of the transport\n\t\t * @returns {Tone.LFO} this\n\t\t * @example\n\t\t * lfo.frequency.value = \"8n\";\n\t\t * lfo.sync().start(0)\n\t\t * //the rate of the LFO will always be an eighth note,\n\t\t * //even as the tempo changes\n\t\t */\n\t Tone.LFO.prototype.sync = function () {\n\t this._oscillator.sync();\n\t this._oscillator.syncFrequency();\n\t return this;\n\t };\n\t /**\n\t\t * unsync the LFO from transport control\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.unsync = function () {\n\t this._oscillator.unsync();\n\t this._oscillator.unsyncFrequency();\n\t return this;\n\t };\n\t /**\n\t\t * The miniumum output of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'min', {\n\t get: function () {\n\t return this._toUnits(this._scaler.min);\n\t },\n\t set: function (min) {\n\t min = this._fromUnits(min);\n\t this._scaler.min = min;\n\t }\n\t });\n\t /**\n\t\t * The maximum output of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'max', {\n\t get: function () {\n\t return this._toUnits(this._scaler.max);\n\t },\n\t set: function (max) {\n\t max = this._fromUnits(max);\n\t this._scaler.max = max;\n\t }\n\t });\n\t /**\n\t\t * The type of the oscillator: sine, square, sawtooth, triangle.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'type', {\n\t get: function () {\n\t return this._oscillator.type;\n\t },\n\t set: function (type) {\n\t this._oscillator.type = type;\n\t this._stoppedValue = this._oscillator._getInitialValue();\n\t this._stoppedSignal.value = this._stoppedValue;\n\t }\n\t });\n\t /**\n\t\t * The phase of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'phase', {\n\t get: function () {\n\t return this._oscillator.phase;\n\t },\n\t set: function (phase) {\n\t this._oscillator.phase = phase;\n\t this._stoppedValue = this._oscillator._getInitialValue();\n\t this._stoppedSignal.value = this._stoppedValue;\n\t }\n\t });\n\t /**\n\t\t * The output units of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {Tone.Type}\n\t\t * @name units\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'units', {\n\t get: function () {\n\t return this._units;\n\t },\n\t set: function (val) {\n\t var currentMin = this.min;\n\t var currentMax = this.max;\n\t //convert the min and the max\n\t this._units = val;\n\t this.min = currentMin;\n\t this.max = currentMax;\n\t }\n\t });\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {Boolean}\n\t\t * @name mute\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'mute', {\n\t get: function () {\n\t return this._oscillator.mute;\n\t },\n\t set: function (mute) {\n\t this._oscillator.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * Returns the playback state of the source, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.LFO#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'state', {\n\t get: function () {\n\t return this._oscillator.state;\n\t }\n\t });\n\t /**\n\t\t * Connect the output of the LFO to an AudioParam, AudioNode, or Tone Node.\n\t\t * Tone.LFO will automatically convert to the destination units of the\n\t\t * will get the units from the connected node.\n\t\t * @param {Tone | AudioParam | AudioNode} node\n\t\t * @param {number} [outputNum=0] optionally which output to connect from\n\t\t * @param {number} [inputNum=0] optionally which input to connect to\n\t\t * @returns {Tone.LFO} this\n\t\t * @private\n\t\t */\n\t Tone.LFO.prototype.connect = function (node) {\n\t if (node.constructor === Tone.Signal || node.constructor === Tone.Param) {\n\t this.convert = node.convert;\n\t this.units = node.units;\n\t }\n\t Tone.SignalBase.prototype.connect.apply(this, arguments);\n\t return this;\n\t };\n\t /**\n\t\t * private method borrowed from Param converts\n\t\t * units from their destination value\n\t\t * @function\n\t\t * @private\n\t\t */\n\t Tone.LFO.prototype._fromUnits = Tone.Param.prototype._fromUnits;\n\t /**\n\t\t * private method borrowed from Param converts\n\t\t * units to their destination value\n\t\t * @function\n\t\t * @private\n\t\t */\n\t Tone.LFO.prototype._toUnits = Tone.Param.prototype._toUnits;\n\t /**\n\t\t * disconnect and dispose\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'amplitude',\n\t 'frequency'\n\t ]);\n\t this._oscillator.dispose();\n\t this._oscillator = null;\n\t this._stoppedSignal.dispose();\n\t this._stoppedSignal = null;\n\t this._zeros.dispose();\n\t this._zeros = null;\n\t this._scaler.dispose();\n\t this._scaler = null;\n\t this._a2g.dispose();\n\t this._a2g = null;\n\t this.frequency = null;\n\t this.amplitude = null;\n\t return this;\n\t };\n\t return Tone.LFO;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Limiter will limit the loudness of an incoming signal.\n\t\t * It is composed of a Tone.Compressor with a fast attack\n\t\t * and release. Limiters are commonly used to safeguard against\n\t\t * signal clipping. Unlike a compressor, limiters do not provide\n\t\t * smooth gain reduction and almost completely prevent\n\t\t * additional gain above the threshold.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {number} threshold The theshold above which the limiting is applied.\n\t\t * @example\n\t\t * var limiter = new Tone.Limiter(-6);\n\t\t */\n\t Tone.Limiter = function () {\n\t var options = Tone.defaults(arguments, ['threshold'], Tone.Limiter);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the compressor\n\t\t\t * @private\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this._compressor = this.input = this.output = new Tone.Compressor({\n\t 'attack': 0.001,\n\t 'decay': 0.001,\n\t 'threshold': options.threshold\n\t });\n\t /**\n\t\t\t * The threshold of of the limiter\n\t\t\t * @type {Decibel}\n\t\t\t * @signal\n\t\t\t */\n\t this.threshold = this._compressor.threshold;\n\t this._readOnly('threshold');\n\t };\n\t Tone.extend(Tone.Limiter, Tone.AudioNode);\n\t /**\n\t\t * The default value\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.Limiter.defaults = { 'threshold': -12 };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Limiter} this\n\t\t */\n\t Tone.Limiter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._compressor.dispose();\n\t this._compressor = null;\n\t this._writable('threshold');\n\t this.threshold = null;\n\t return this;\n\t };\n\t return Tone.Limiter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Lowpass is a lowpass feedback comb filter. It is similar to\n\t\t * Tone.FeedbackCombFilter, but includes a lowpass filter.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Time|Object} [delayTime] The delay time of the comb filter\n\t\t * @param {NormalRange=} resonance The resonance (feedback) of the comb filter\n\t\t * @param {Frequency=} dampening The cutoff of the lowpass filter dampens the\n\t\t * signal as it is fedback.\n\t\t */\n\t Tone.LowpassCombFilter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'resonance',\n\t 'dampening'\n\t ], Tone.LowpassCombFilter);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the delay node\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delay = this.input = new Tone.Delay(options.delayTime);\n\t /**\n\t\t\t * The delayTime of the comb filter.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._delay.delayTime;\n\t /**\n\t\t\t * the lowpass filter\n\t\t\t * @type {BiquadFilterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._lowpass = this.output = this.context.createBiquadFilter();\n\t this._lowpass.Q.value = -3.0102999566398125;\n\t this._lowpass.type = 'lowpass';\n\t /**\n\t\t\t * The dampening control of the feedback\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.dampening = new Tone.Param({\n\t 'param': this._lowpass.frequency,\n\t 'units': Tone.Type.Frequency,\n\t 'value': options.dampening\n\t });\n\t /**\n\t\t\t * the feedback gain\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedback = new Tone.Gain(options.resonance, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of feedback of the delayed signal.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.resonance = this._feedback.gain;\n\t //connections\n\t this._delay.chain(this._lowpass, this._feedback, this._delay);\n\t this._readOnly([\n\t 'dampening',\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t };\n\t Tone.extend(Tone.LowpassCombFilter, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.LowpassCombFilter.defaults = {\n\t 'delayTime': 0.1,\n\t 'resonance': 0.5,\n\t 'dampening': 3000\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.LowpassCombFilter} this\n\t\t */\n\t Tone.LowpassCombFilter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'dampening',\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t this.dampening.dispose();\n\t this.dampening = null;\n\t this.resonance.dispose();\n\t this.resonance = null;\n\t this._delay.dispose();\n\t this._delay = null;\n\t this.delayTime = null;\n\t this._lowpass.disconnect();\n\t this._lowpass = null;\n\t this._feedback.disconnect();\n\t this._feedback = null;\n\t return this;\n\t };\n\t return Tone.LowpassCombFilter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Merge brings two signals into the left and right\n\t\t * channels of a single stereo channel.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * var merge = new Tone.Merge().toMaster();\n\t\t * //routing a sine tone in the left channel\n\t\t * //and noise in the right channel\n\t\t * var osc = new Tone.Oscillator().connect(merge.left);\n\t\t * var noise = new Tone.Noise().connect(merge.right);\n\t\t * //starting our oscillators\n\t\t * noise.start();\n\t\t * osc.start();\n\t\t */\n\t Tone.Merge = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * The left input channel.\n\t\t\t * Alias for <code>input[0]</code>\n\t\t\t * @type {GainNode}\n\t\t\t */\n\t this.left = this.input[0] = new Tone.Gain();\n\t /**\n\t\t\t * The right input channel.\n\t\t\t * Alias for <code>input[1]</code>.\n\t\t\t * @type {GainNode}\n\t\t\t */\n\t this.right = this.input[1] = new Tone.Gain();\n\t /**\n\t\t\t * the merger node for the two channels\n\t\t\t * @type {ChannelMergerNode}\n\t\t\t * @private\n\t\t\t */\n\t this._merger = this.output = this.context.createChannelMerger(2);\n\t //connections\n\t this.left.connect(this._merger, 0, 0);\n\t this.right.connect(this._merger, 0, 1);\n\t this.left.channelCount = 1;\n\t this.right.channelCount = 1;\n\t this.left.channelCountMode = 'explicit';\n\t this.right.channelCountMode = 'explicit';\n\t };\n\t Tone.extend(Tone.Merge, Tone.AudioNode);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Merge} this\n\t\t */\n\t Tone.Merge.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.left.dispose();\n\t this.left = null;\n\t this.right.dispose();\n\t this.right = null;\n\t this._merger.disconnect();\n\t this._merger = null;\n\t return this;\n\t };\n\t return Tone.Merge;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Meter gets the [RMS](https://en.wikipedia.org/wiki/Root_mean_square)\n\t\t * of an input signal with some averaging applied. It can also get the raw\n\t\t * value of the input signal.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number} smoothing The amount of smoothing applied between frames.\n\t\t * @example\n\t\t * var meter = new Tone.Meter();\n\t\t * var mic = new Tone.UserMedia().open();\n\t\t * //connect mic to the meter\n\t\t * mic.connect(meter);\n\t\t * //the current level of the mic input in decibels\n\t\t * var level = meter.getValue();\n\t\t */\n\t Tone.Meter = function () {\n\t var options = Tone.defaults(arguments, ['smoothing'], Tone.Meter);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node which computes the levels.\n\t\t\t * @private\n\t\t\t * @type {Tone.Analyser}\n\t\t\t */\n\t this.input = this.output = this._analyser = new Tone.Analyser('waveform', 1024);\n\t /**\n\t\t\t * The amount of carryover between the current and last frame.\n\t\t\t * Only applied meter for \"level\" type.\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.smoothing = options.smoothing;\n\t };\n\t Tone.extend(Tone.Meter, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Meter.defaults = { 'smoothing': 0.8 };\n\t /**\n\t\t * Get the current decibel value of the incoming signal\n\t\t * @returns {Decibels}\n\t\t */\n\t Tone.Meter.prototype.getLevel = function () {\n\t this._analyser.type = 'fft';\n\t var values = this._analyser.getValue();\n\t var offset = 28;\n\t // normalizes most signal levels\n\t // TODO: compute loudness from FFT\n\t return Math.max.apply(this, values) + offset;\n\t };\n\t /**\n\t\t * Get the signal value of the incoming signal\n\t\t * @returns {Number}\n\t\t */\n\t Tone.Meter.prototype.getValue = function () {\n\t this._analyser.type = 'waveform';\n\t var value = this._analyser.getValue();\n\t return value[0];\n\t };\n\t /**\n\t\t * A value from 0 -> 1 where 0 represents no time averaging with the last analysis frame.\n\t\t * @memberOf Tone.Meter#\n\t\t * @type {Number}\n\t\t * @name smoothing\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Meter.prototype, 'smoothing', {\n\t get: function () {\n\t return this._analyser.smoothing;\n\t },\n\t set: function (val) {\n\t this._analyser.smoothing = val;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Meter} this\n\t\t */\n\t Tone.Meter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.dispose();\n\t this._analyser = null;\n\t return this;\n\t };\n\t return Tone.Meter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t *\t@class Tone.Split splits an incoming signal into left and right channels.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * var split = new Tone.Split();\n\t\t * stereoSignal.connect(split);\n\t\t */\n\t Tone.Split = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(0, 2);\n\t /**\n\t\t\t * @type {ChannelSplitterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._splitter = this.input = this.context.createChannelSplitter(2);\n\t this._splitter.channelCount = 2;\n\t this._splitter.channelCountMode = 'explicit';\n\t /**\n\t\t\t * Left channel output.\n\t\t\t * Alias for <code>output[0]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.left = this.output[0] = new Tone.Gain();\n\t /**\n\t\t\t * Right channel output.\n\t\t\t * Alias for <code>output[1]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.right = this.output[1] = new Tone.Gain();\n\t //connections\n\t this._splitter.connect(this.left, 0, 0);\n\t this._splitter.connect(this.right, 1, 0);\n\t };\n\t Tone.extend(Tone.Split, Tone.AudioNode);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Split} this\n\t\t */\n\t Tone.Split.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._splitter.disconnect();\n\t this.left.dispose();\n\t this.left = null;\n\t this.right.dispose();\n\t this.right = null;\n\t this._splitter = null;\n\t return this;\n\t };\n\t return Tone.Split;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Mid/Side processing separates the the 'mid' signal\n\t\t * (which comes out of both the left and the right channel)\n\t\t * and the 'side' (which only comes out of the the side channels). <br><br>\n\t\t * <code>\n\t\t * Mid = (Left+Right)/sqrt(2); // obtain mid-signal from left and right<br>\n\t\t * Side = (Left-Right)/sqrt(2); // obtain side-signal from left and righ<br>\n\t\t * </code>\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideSplit = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(0, 2);\n\t /**\n\t\t\t * split the incoming signal into left and right channels\n\t\t\t * @type {Tone.Split}\n\t\t\t * @private\n\t\t\t */\n\t this._split = this.input = new Tone.Split();\n\t /**\n\t\t\t * The mid send. Connect to mid processing. Alias for\n\t\t\t * <code>output[0]</code>\n\t\t\t * @type {Tone.Add}\n\t\t\t */\n\t this._midAdd = new Tone.Add();\n\t /**\n\t\t\t * Multiply the _midAdd by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this.mid = this.output[0] = new Tone.Multiply(Math.SQRT1_2);\n\t /**\n\t\t\t * The side output. Connect to side processing. Also Output 1\n\t\t\t * @type {Tone.Subtract}\n\t\t\t */\n\t this._sideSubtract = new Tone.Subtract();\n\t /**\n\t\t\t * Multiply the _midAdd by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this.side = this.output[1] = new Tone.Multiply(Math.SQRT1_2);\n\t this._split.connect(this._midAdd, 0, 0);\n\t this._split.connect(this._midAdd, 1, 1);\n\t this._split.connect(this._sideSubtract, 0, 0);\n\t this._split.connect(this._sideSubtract, 1, 1);\n\t this._midAdd.connect(this.mid);\n\t this._sideSubtract.connect(this.side);\n\t };\n\t Tone.extend(Tone.MidSideSplit, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MidSideSplit} this\n\t\t */\n\t Tone.MidSideSplit.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.side.dispose();\n\t this.side = null;\n\t this._midAdd.dispose();\n\t this._midAdd = null;\n\t this._sideSubtract.dispose();\n\t this._sideSubtract = null;\n\t this._split.dispose();\n\t this._split = null;\n\t return this;\n\t };\n\t return Tone.MidSideSplit;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Mid/Side processing separates the the 'mid' signal\n\t\t * (which comes out of both the left and the right channel)\n\t\t * and the 'side' (which only comes out of the the side channels).\n\t\t * MidSideMerge merges the mid and side signal after they've been seperated\n\t\t * by Tone.MidSideSplit.<br><br>\n\t\t * <code>\n\t\t * Left = (Mid+Side)/sqrt(2); // obtain left signal from mid and side<br>\n\t\t * Right = (Mid-Side)/sqrt(2); // obtain right signal from mid and side<br>\n\t\t * </code>\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideMerge = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * The mid signal input. Alias for\n\t\t\t * <code>input[0]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.mid = this.input[0] = new Tone.Gain();\n\t /**\n\t\t\t * recombine the mid/side into Left\n\t\t\t * @type {Tone.Add}\n\t\t\t * @private\n\t\t\t */\n\t this._left = new Tone.Add();\n\t /**\n\t\t\t * Multiply the left by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this._timesTwoLeft = new Tone.Multiply(Math.SQRT1_2);\n\t /**\n\t\t\t * The side signal input. Alias for\n\t\t\t * <code>input[1]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.side = this.input[1] = new Tone.Gain();\n\t /**\n\t\t\t * recombine the mid/side into Right\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._right = new Tone.Subtract();\n\t /**\n\t\t\t * Multiply the right by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this._timesTwoRight = new Tone.Multiply(Math.SQRT1_2);\n\t /**\n\t\t\t * Merge the left/right signal back into a stereo signal.\n\t\t\t * @type {Tone.Merge}\n\t\t\t * @private\n\t\t\t */\n\t this._merge = this.output = new Tone.Merge();\n\t this.mid.connect(this._left, 0, 0);\n\t this.side.connect(this._left, 0, 1);\n\t this.mid.connect(this._right, 0, 0);\n\t this.side.connect(this._right, 0, 1);\n\t this._left.connect(this._timesTwoLeft);\n\t this._right.connect(this._timesTwoRight);\n\t this._timesTwoLeft.connect(this._merge, 0, 0);\n\t this._timesTwoRight.connect(this._merge, 0, 1);\n\t };\n\t Tone.extend(Tone.MidSideMerge, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MidSideMerge} this\n\t\t */\n\t Tone.MidSideMerge.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.side.dispose();\n\t this.side = null;\n\t this._left.dispose();\n\t this._left = null;\n\t this._timesTwoLeft.dispose();\n\t this._timesTwoLeft = null;\n\t this._right.dispose();\n\t this._right = null;\n\t this._timesTwoRight.dispose();\n\t this._timesTwoRight = null;\n\t this._merge.dispose();\n\t this._merge = null;\n\t return this;\n\t };\n\t return Tone.MidSideMerge;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.MidSideCompressor applies two different compressors to the mid\n\t\t * and side signal components. See Tone.MidSideSplit.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Object} options The options that are passed to the mid and side\n\t\t * compressors.\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideCompressor = function (options) {\n\t Tone.AudioNode.call(this);\n\t options = Tone.defaultArg(options, Tone.MidSideCompressor.defaults);\n\t /**\n\t\t\t * the mid/side split\n\t\t\t * @type {Tone.MidSideSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideSplit = this.input = new Tone.MidSideSplit();\n\t /**\n\t\t\t * the mid/side recombination\n\t\t\t * @type {Tone.MidSideMerge}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideMerge = this.output = new Tone.MidSideMerge();\n\t /**\n\t\t\t * The compressor applied to the mid signal\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.mid = new Tone.Compressor(options.mid);\n\t /**\n\t\t\t * The compressor applied to the side signal\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.side = new Tone.Compressor(options.side);\n\t this._midSideSplit.mid.chain(this.mid, this._midSideMerge.mid);\n\t this._midSideSplit.side.chain(this.side, this._midSideMerge.side);\n\t this._readOnly([\n\t 'mid',\n\t 'side'\n\t ]);\n\t };\n\t Tone.extend(Tone.MidSideCompressor, Tone.AudioNode);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MidSideCompressor.defaults = {\n\t 'mid': {\n\t 'ratio': 3,\n\t 'threshold': -24,\n\t 'release': 0.03,\n\t 'attack': 0.02,\n\t 'knee': 16\n\t },\n\t 'side': {\n\t 'ratio': 6,\n\t 'threshold': -30,\n\t 'release': 0.25,\n\t 'attack': 0.03,\n\t 'knee': 10\n\t }\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MidSideCompressor} this\n\t\t */\n\t Tone.MidSideCompressor.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'mid',\n\t 'side'\n\t ]);\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.side.dispose();\n\t this.side = null;\n\t this._midSideSplit.dispose();\n\t this._midSideSplit = null;\n\t this._midSideMerge.dispose();\n\t this._midSideMerge = null;\n\t return this;\n\t };\n\t return Tone.MidSideCompressor;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Mono coerces the incoming mono or stereo signal into a mono signal\n\t\t * where both left and right channels have the same value. This can be useful\n\t\t * for [stereo imaging](https://en.wikipedia.org/wiki/Stereo_imaging).\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t */\n\t Tone.Mono = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 0);\n\t /**\n\t\t\t * merge the signal\n\t\t\t * @type {Tone.Merge}\n\t\t\t * @private\n\t\t\t */\n\t this._merge = this.output = new Tone.Merge();\n\t this.input.connect(this._merge, 0, 0);\n\t this.input.connect(this._merge, 0, 1);\n\t };\n\t Tone.extend(Tone.Mono, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Mono} this\n\t\t */\n\t Tone.Mono.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._merge.dispose();\n\t this._merge = null;\n\t return this;\n\t };\n\t return Tone.Mono;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A compressor with seperate controls over low/mid/high dynamics\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Object} options The low/mid/high compressor settings.\n\t\t * @example\n\t\t * var multiband = new Tone.MultibandCompressor({\n\t\t * \t\"lowFrequency\" : 200,\n\t\t * \t\"highFrequency\" : 1300\n\t\t * \t\"low\" : {\n\t\t * \t\t\"threshold\" : -12\n\t\t * \t}\n\t\t * })\n\t\t */\n\t Tone.MultibandCompressor = function (options) {\n\t Tone.AudioNode.call(this);\n\t options = Tone.defaultArg(arguments, Tone.MultibandCompressor.defaults);\n\t /**\n\t\t\t * split the incoming signal into high/mid/low\n\t\t\t * @type {Tone.MultibandSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._splitter = this.input = new Tone.MultibandSplit({\n\t 'lowFrequency': options.lowFrequency,\n\t 'highFrequency': options.highFrequency\n\t });\n\t /**\n\t\t\t * low/mid crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.lowFrequency = this._splitter.lowFrequency;\n\t /**\n\t\t\t * mid/high crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.highFrequency = this._splitter.highFrequency;\n\t /**\n\t\t\t * the output\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.output = new Tone.Gain();\n\t /**\n\t\t\t * The compressor applied to the low frequencies.\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.low = new Tone.Compressor(options.low);\n\t /**\n\t\t\t * The compressor applied to the mid frequencies.\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.mid = new Tone.Compressor(options.mid);\n\t /**\n\t\t\t * The compressor applied to the high frequencies.\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.high = new Tone.Compressor(options.high);\n\t //connect the compressor\n\t this._splitter.low.chain(this.low, this.output);\n\t this._splitter.mid.chain(this.mid, this.output);\n\t this._splitter.high.chain(this.high, this.output);\n\t this._readOnly([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t };\n\t Tone.extend(Tone.MultibandCompressor, Tone.AudioNode);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MultibandCompressor.defaults = {\n\t 'low': Tone.Compressor.defaults,\n\t 'mid': Tone.Compressor.defaults,\n\t 'high': Tone.Compressor.defaults,\n\t 'lowFrequency': 250,\n\t 'highFrequency': 2000\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MultibandCompressor} this\n\t\t */\n\t Tone.MultibandCompressor.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._splitter.dispose();\n\t this._writable([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t this.low.dispose();\n\t this.mid.dispose();\n\t this.high.dispose();\n\t this._splitter = null;\n\t this.low = null;\n\t this.mid = null;\n\t this.high = null;\n\t this.lowFrequency = null;\n\t this.highFrequency = null;\n\t return this;\n\t };\n\t return Tone.MultibandCompressor;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported && !window.StereoPannerNode) {\n\t /**\n\t\t\t * @class Shimmed StereoPannerNode\n\t\t\t * @param {AudioContext} context\n\t\t\t * @private\n\t\t\t */\n\t var StereoPannerNode = function (context) {\n\t /**\n\t\t\t\t * The audio context\n\t\t\t\t * @type {AudioContext}\n\t\t\t\t */\n\t this.context = context;\n\t /**\n\t\t\t\t * The left/right panning. [-1, 1]\n\t\t\t\t * @type {AudioRange}\n\t\t\t\t * @signal\n\t\t\t\t */\n\t this.pan = new Tone.Signal(0, Tone.Type.AudioRange);\n\t /**\n\t\t\t\t * Equal power scaling of the right gain\n\t\t\t\t * @type {Tone.WaveShaper}\n\t\t\t\t */\n\t var rightWaveShaper = new Tone.WaveShaper(function (val) {\n\t return Tone.equalPowerScale((val + 1) / 2);\n\t }, 4096);\n\t /**\n\t\t\t\t * Equal power scaling of the left gain\n\t\t\t\t * @type {Tone.WaveShaper}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var leftWaveShaper = new Tone.WaveShaper(function (val) {\n\t return Tone.equalPowerScale(1 - (val + 1) / 2);\n\t }, 4096);\n\t /**\n\t\t\t\t * The left gain value\n\t\t\t\t * @type {Tone.Gain}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var leftGain = new Tone.Gain();\n\t /**\n\t\t\t\t * The right gain value\n\t\t\t\t * @type {Tone.Gain}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var rightGain = new Tone.Gain();\n\t /**\n\t\t\t\t * Split the incoming signal\n\t\t\t\t * @type {Tone.Split}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var split = this.input = new Tone.Split();\n\t /**\n\t\t\t\t * Keeps the waveshapers from optimizing 0s\n\t\t\t\t * @type {Tone.Zero}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var zero = new Tone.Zero();\n\t zero.fan(rightWaveShaper, leftWaveShaper);\n\t /**\n\t\t\t\t * Merge the outgoing signal\n\t\t\t\t * @type {Tone.Merge}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var merge = this.output = new Tone.Merge();\n\t //connections\n\t split.left.chain(leftGain, merge.left);\n\t split.right.chain(rightGain, merge.right);\n\t this.pan.chain(leftWaveShaper, leftGain.gain);\n\t this.pan.chain(rightWaveShaper, rightGain.gain);\n\t };\n\t StereoPannerNode.prototype.disconnect = function () {\n\t this.output.disconnect.apply(this.output, arguments);\n\t };\n\t StereoPannerNode.prototype.connect = function () {\n\t this.output.connect.apply(this.output, arguments);\n\t };\n\t //add it to the AudioContext\n\t AudioContext.prototype.createStereoPanner = function () {\n\t return new StereoPannerNode(this);\n\t };\n\t Tone.Context.prototype.createStereoPanner = function () {\n\t return new StereoPannerNode(this);\n\t };\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Panner is an equal power Left/Right Panner and does not\n\t\t * support 3D. Panner uses the StereoPannerNode when available.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {NormalRange} [initialPan=0] The initail panner value (center).\n\t\t * @example\n\t\t * //pan the input signal hard right.\n\t\t * var panner = new Tone.Panner(1);\n\t\t */\n\t Tone.Panner = function (initialPan) {\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t* the panner node\n\t\t\t* @type {StereoPannerNode}\n\t\t\t* @private\n\t\t\t*/\n\t this._panner = this.input = this.output = this.context.createStereoPanner();\n\t /**\n\t\t\t* The pan control. -1 = hard left, 1 = hard right.\n\t\t\t* @type {AudioRange}\n\t\t\t* @signal\n\t\t\t*/\n\t this.pan = this._panner.pan;\n\t //initial value\n\t this.pan.value = Tone.defaultArg(initialPan, 0);\n\t this._readOnly('pan');\n\t };\n\t Tone.extend(Tone.Panner, Tone.AudioNode);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Panner} this\n\t\t */\n\t Tone.Panner.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('pan');\n\t this._panner.disconnect();\n\t this._panner = null;\n\t this.pan = null;\n\t return this;\n\t };\n\t return Tone.Panner;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A spatialized panner node which supports equalpower or HRTF panning.\n\t\t * Tries to normalize the API across various browsers. See Tone.Listener\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number} positionX The initial x position.\n\t\t * @param {Number} positionY The initial y position.\n\t\t * @param {Number} positionZ The initial z position.\n\t\t */\n\t Tone.Panner3D = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'positionX',\n\t 'positionY',\n\t 'positionZ'\n\t ], Tone.Panner3D);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The panner node\n\t\t\t * @type {PannerNode}\n\t\t\t * @private\n\t\t\t */\n\t this._panner = this.input = this.output = this.context.createPanner();\n\t //set some values\n\t this._panner.panningModel = options.panningModel;\n\t this._panner.maxDistance = options.maxDistance;\n\t this._panner.distanceModel = options.distanceModel;\n\t this._panner.coneOuterGain = options.coneOuterGain;\n\t this._panner.coneOuterAngle = options.coneOuterAngle;\n\t this._panner.coneInnerAngle = options.coneInnerAngle;\n\t this._panner.refDistance = options.refDistance;\n\t this._panner.rolloffFactor = options.rolloffFactor;\n\t /**\n\t\t\t * Holds the current orientation\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._orientation = [\n\t options.orientationX,\n\t options.orientationY,\n\t options.orientationZ\n\t ];\n\t /**\n\t\t\t * Holds the current position\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._position = [\n\t options.positionX,\n\t options.positionY,\n\t options.positionZ\n\t ];\n\t // set the default position/orientation\n\t this.orientationX = options.orientationX;\n\t this.orientationY = options.orientationY;\n\t this.orientationZ = options.orientationZ;\n\t this.positionX = options.positionX;\n\t this.positionY = options.positionY;\n\t this.positionZ = options.positionZ;\n\t };\n\t Tone.extend(Tone.Panner3D, Tone.AudioNode);\n\t /**\n\t\t * Defaults according to the specification\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Panner3D.defaults = {\n\t 'positionX': 0,\n\t 'positionY': 0,\n\t 'positionZ': 0,\n\t 'orientationX': 0,\n\t 'orientationY': 0,\n\t 'orientationZ': 0,\n\t 'panningModel': 'equalpower',\n\t 'maxDistance': 10000,\n\t 'distanceModel': 'inverse',\n\t 'coneOuterGain': 0,\n\t 'coneOuterAngle': 360,\n\t 'coneInnerAngle': 360,\n\t 'refDistance': 1,\n\t 'rolloffFactor': 1\n\t };\n\t /**\n\t\t * The ramp time which is applied to the setTargetAtTime\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.Panner3D.prototype._rampTimeConstant = 0.01;\n\t /**\n\t\t * Sets the position of the source in 3d space.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @return {Tone.Panner3D} this\n\t\t */\n\t Tone.Panner3D.prototype.setPosition = function (x, y, z) {\n\t if (this._panner.positionX) {\n\t var now = this.now();\n\t this._panner.positionX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this._panner.positionY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this._panner.positionZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t } else {\n\t this._panner.setPosition(x, y, z);\n\t }\n\t this._position = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * Sets the orientation of the source in 3d space.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @return {Tone.Panner3D} this\n\t\t */\n\t Tone.Panner3D.prototype.setOrientation = function (x, y, z) {\n\t if (this._panner.orientationX) {\n\t var now = this.now();\n\t this._panner.orientationX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this._panner.orientationY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this._panner.orientationZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t } else {\n\t this._panner.setOrientation(x, y, z);\n\t }\n\t this._orientation = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * The x position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name positionX\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'positionX', {\n\t set: function (pos) {\n\t this._position[0] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[0];\n\t }\n\t });\n\t /**\n\t\t * The y position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name positionY\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'positionY', {\n\t set: function (pos) {\n\t this._position[1] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[1];\n\t }\n\t });\n\t /**\n\t\t * The z position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name positionZ\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'positionZ', {\n\t set: function (pos) {\n\t this._position[2] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[2];\n\t }\n\t });\n\t /**\n\t\t * The x orientation of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name orientationX\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'orientationX', {\n\t set: function (pos) {\n\t this._orientation[0] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[0];\n\t }\n\t });\n\t /**\n\t\t * The y orientation of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name orientationY\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'orientationY', {\n\t set: function (pos) {\n\t this._orientation[1] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[1];\n\t }\n\t });\n\t /**\n\t\t * The z orientation of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name orientationZ\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'orientationZ', {\n\t set: function (pos) {\n\t this._orientation[2] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[2];\n\t }\n\t });\n\t /**\n\t\t * Proxy a property on the panner to an exposed public propery\n\t\t * @param {String} prop\n\t\t * @private\n\t\t */\n\t Tone.Panner3D._aliasProperty = function (prop) {\n\t Object.defineProperty(Tone.Panner3D.prototype, prop, {\n\t set: function (val) {\n\t this._panner[prop] = val;\n\t },\n\t get: function () {\n\t return this._panner[prop];\n\t }\n\t });\n\t };\n\t /**\n\t\t * The panning model. Either \"equalpower\" or \"HRTF\".\n\t\t * @type {String}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name panningModel\n\t\t */\n\t Tone.Panner3D._aliasProperty('panningModel');\n\t /**\n\t\t * A reference distance for reducing volume as source move further from the listener\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name refDistance\n\t\t */\n\t Tone.Panner3D._aliasProperty('refDistance');\n\t /**\n\t\t * Describes how quickly the volume is reduced as source moves away from listener.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name rolloffFactor\n\t\t */\n\t Tone.Panner3D._aliasProperty('rolloffFactor');\n\t /**\n\t\t * The distance model used by, \"linear\", \"inverse\", or \"exponential\".\n\t\t * @type {String}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name distanceModel\n\t\t */\n\t Tone.Panner3D._aliasProperty('distanceModel');\n\t /**\n\t\t * The angle, in degrees, inside of which there will be no volume reduction\n\t\t * @type {Degrees}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name coneInnerAngle\n\t\t */\n\t Tone.Panner3D._aliasProperty('coneInnerAngle');\n\t /**\n\t\t * The angle, in degrees, outside of which the volume will be reduced\n\t\t * to a constant value of coneOuterGain\n\t\t * @type {Degrees}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name coneOuterAngle\n\t\t */\n\t Tone.Panner3D._aliasProperty('coneOuterAngle');\n\t /**\n\t\t * The gain outside of the coneOuterAngle\n\t\t * @type {Gain}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name coneOuterGain\n\t\t */\n\t Tone.Panner3D._aliasProperty('coneOuterGain');\n\t /**\n\t\t * The maximum distance between source and listener,\n\t\t * after which the volume will not be reduced any further.\n\t\t * @type {Positive}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name maxDistance\n\t\t */\n\t Tone.Panner3D._aliasProperty('maxDistance');\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Panner3D} this\n\t\t */\n\t Tone.Panner3D.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._panner.disconnect();\n\t this._panner = null;\n\t this._orientation = null;\n\t this._position = null;\n\t return this;\n\t };\n\t return Tone.Panner3D;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PanVol is a Tone.Panner and Tone.Volume in one.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {AudioRange} pan the initial pan\n\t\t * @param {number} volume The output volume.\n\t\t * @example\n\t\t * //pan the incoming signal left and drop the volume\n\t\t * var panVol = new Tone.PanVol(-0.25, -12);\n\t\t */\n\t Tone.PanVol = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'pan',\n\t 'volume'\n\t ], Tone.PanVol);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The panning node\n\t\t\t * @type {Tone.Panner}\n\t\t\t * @private\n\t\t\t */\n\t this._panner = this.input = new Tone.Panner(options.pan);\n\t /**\n\t\t\t * The L/R panning control.\n\t\t\t * @type {AudioRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.pan = this._panner.pan;\n\t /**\n\t\t\t * The volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume control in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t //connections\n\t this._panner.connect(this._volume);\n\t this.mute = options.mute;\n\t this._readOnly([\n\t 'pan',\n\t 'volume'\n\t ]);\n\t };\n\t Tone.extend(Tone.PanVol, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.PanVol.defaults = {\n\t 'pan': 0,\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Mute/unmute the volume\n\t\t * @memberOf Tone.PanVol#\n\t\t * @name mute\n\t\t * @type {Boolean}\n\t\t */\n\t Object.defineProperty(Tone.PanVol.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.PanVol} this\n\t\t */\n\t Tone.PanVol.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'pan',\n\t 'volume'\n\t ]);\n\t this._panner.dispose();\n\t this._panner = null;\n\t this.pan = null;\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t return this;\n\t };\n\t return Tone.PanVol;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Solo lets you isolate a specific audio stream. When\n\t\t * an instance is set to `solo=true`, it will mute all other instances.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * var soloA = new Tone.Solo()\n\t\t * var soloB = new Tone.Solo()\n\t\t * soloA.solo = true\n\t\t * //no audio will pass through soloB\n\t\t */\n\t Tone.Solo = function () {\n\t var options = Tone.defaults(arguments, ['solo'], Tone.Solo);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The input and output node\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.input = this.output = new Tone.Gain();\n\t /**\n\t\t\t * A bound _soloed method\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._soloBind = this._soloed.bind(this);\n\t //listen for solo events class-wide.\n\t this.context.on('solo', this._soloBind);\n\t //set initially\n\t this.solo = options.solo;\n\t };\n\t Tone.extend(Tone.Solo, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @static\n\t\t */\n\t Tone.Solo.defaults = { solo: false };\n\t /**\n\t\t * Isolates this instance and mutes all other instances of Tone.Solo.\n\t\t * Only one instance can be soloed at a time. A soloed\n\t\t * instance will report `solo=false` when another instance is soloed.\n\t\t * @memberOf Tone.Solo#\n\t\t * @type {Boolean}\n\t\t * @name solo\n\t\t */\n\t Object.defineProperty(Tone.Solo.prototype, 'solo', {\n\t get: function () {\n\t return this._isSoloed();\n\t },\n\t set: function (solo) {\n\t if (solo) {\n\t this._addSolo();\n\t } else {\n\t this._removeSolo();\n\t }\n\t this.context.emit('solo', this);\n\t }\n\t });\n\t /**\n\t\t * If the current instance is muted, i.e. another instance is soloed\n\t\t * @memberOf Tone.Solo#\n\t\t * @type {Boolean}\n\t\t * @name muted\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Solo.prototype, 'muted', {\n\t get: function () {\n\t return this.input.gain.value === 0;\n\t }\n\t });\n\t /**\n\t\t * Add this to the soloed array\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._addSolo = function () {\n\t if (!Tone.isArray(this.context._currentSolo)) {\n\t this.context._currentSolo = [];\n\t }\n\t if (!this._isSoloed()) {\n\t this.context._currentSolo.push(this);\n\t }\n\t };\n\t /**\n\t\t * Remove this from the soloed array\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._removeSolo = function () {\n\t if (this._isSoloed()) {\n\t var index = this.context._currentSolo.indexOf(this);\n\t this.context._currentSolo.splice(index, 1);\n\t }\n\t };\n\t /**\n\t\t * @return {Boolean} Is this on the soloed array\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._isSoloed = function () {\n\t if (Tone.isArray(this.context._currentSolo)) {\n\t return this.context._currentSolo.length !== 0 && this.context._currentSolo.indexOf(this) !== -1;\n\t } else {\n\t return false;\n\t }\n\t };\n\t /**\n\t\t * @return {Boolean} Returns true if no one is soloed\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._noSolos = function () {\n\t return !Tone.isArray(this.context._currentSolo) || this.context._currentSolo.length === 0;\n\t };\n\t /**\n\t\t * Solo the current instance and unsolo all other instances.\n\t\t * @param {Tone.Solo} instance The instance which is being soloed/unsoloed.\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._soloed = function () {\n\t if (this._isSoloed()) {\n\t this.input.gain.value = 1;\n\t } else if (this._noSolos()) {\n\t //no one is soloed\n\t this.input.gain.value = 1;\n\t } else {\n\t this.input.gain.value = 0;\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Solo} this\n\t\t */\n\t Tone.Solo.prototype.dispose = function () {\n\t this.context.off('solo', this._soloBind);\n\t this._removeSolo();\n\t this._soloBind = null;\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.Solo;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Get the current waveform data of the connected audio source.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number=} size The size of the FFT. Value must be a power of\n\t\t * two in the range 32 to 32768.\n\t\t */\n\t Tone.Waveform = function () {\n\t var options = Tone.defaults(arguments, ['size'], Tone.Waveform);\n\t options.type = Tone.Analyser.Type.Waveform;\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node.\n\t\t\t * @private\n\t\t\t * @type {Tone.Analyser}\n\t\t\t */\n\t this._analyser = this.input = this.output = new Tone.Analyser(options);\n\t };\n\t Tone.extend(Tone.Waveform, Tone.AudioNode);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Waveform.defaults = { 'size': 1024 };\n\t /**\n\t\t * Gets the waveform of the audio source. Returns the waveform data\n\t\t * of length [size](#size) as a Float32Array with values between -1 and 1.\n\t\t * @returns {TypedArray}\n\t\t */\n\t Tone.Waveform.prototype.getValue = function () {\n\t return this._analyser.getValue();\n\t };\n\t /**\n\t\t * The size of analysis. This must be a power of two in the range 32 to 32768.\n\t\t * @memberOf Tone.Waveform#\n\t\t * @type {Number}\n\t\t * @name size\n\t\t */\n\t Object.defineProperty(Tone.Waveform.prototype, 'size', {\n\t get: function () {\n\t return this._analyser.size;\n\t },\n\t set: function (size) {\n\t this._analyser.size = size;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Waveform} this\n\t\t */\n\t Tone.Waveform.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.dispose();\n\t this._analyser = null;\n\t };\n\t return Tone.Waveform;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.CtrlInterpolate will interpolate between given values based\n\t\t * on the \"index\" property. Passing in an array or object literal\n\t\t * will interpolate each of the parameters. Note (i.e. \"C3\")\n\t\t * and Time (i.e. \"4n + 2\") can be interpolated. All other values are\n\t\t * assumed to be numbers. \n\t\t * @example\n\t\t * var interp = new Tone.CtrlInterpolate([0, 2, 9, 4]);\n\t\t * interp.index = 0.75;\n\t\t * interp.value; //returns 1.5\n\t\t *\n\t\t * @example\n\t\t * var interp = new Tone.CtrlInterpolate([\n\t\t * \t[2, 4, 5],\n\t\t * \t[9, 3, 2],\n\t\t * ]);\n\t\t * @param {Array} values The array of values to interpolate over\n\t\t * @param {Positive} index The initial interpolation index.\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.CtrlInterpolate = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'values',\n\t 'index'\n\t ], Tone.CtrlInterpolate);\n\t Tone.call(this);\n\t /**\n\t\t\t * The values to interpolate between\n\t\t\t * @type {Array}\n\t\t\t */\n\t this.values = options.values;\n\t /**\n\t\t\t * The interpolated index between values. For example: a value of 1.5\n\t\t\t * would interpolate equally between the value at index 1\n\t\t\t * and the value at index 2. \n\t\t\t * @example\n\t\t\t * interp.index = 0; \n\t\t\t * interp.value; //returns the value at 0\n\t\t\t * interp.index = 0.5;\n\t\t\t * interp.value; //returns the value between indices 0 and 1. \n\t\t\t * @type {Positive}\n\t\t\t */\n\t this.index = options.index;\n\t };\n\t Tone.extend(Tone.CtrlInterpolate);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.CtrlInterpolate.defaults = {\n\t 'index': 0,\n\t 'values': []\n\t };\n\t /**\n\t\t * The current interpolated value based on the index\n\t\t * @readOnly\n\t\t * @memberOf Tone.CtrlInterpolate#\n\t\t * @type {*}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.CtrlInterpolate.prototype, 'value', {\n\t get: function () {\n\t var index = this.index;\n\t index = Math.min(index, this.values.length - 1);\n\t var lowerPosition = Math.floor(index);\n\t var lower = this.values[lowerPosition];\n\t var upper = this.values[Math.ceil(index)];\n\t return this._interpolate(index - lowerPosition, lower, upper);\n\t }\n\t });\n\t /**\n\t\t * Internal interpolation routine\n\t\t * @param {NormalRange} index The index between the lower and upper\n\t\t * @param {*} lower \n\t\t * @param {*} upper \n\t\t * @return {*} The interpolated value\n\t\t * @private\n\t\t */\n\t Tone.CtrlInterpolate.prototype._interpolate = function (index, lower, upper) {\n\t if (Tone.isArray(lower)) {\n\t var retArray = [];\n\t for (var i = 0; i < lower.length; i++) {\n\t retArray[i] = this._interpolate(index, lower[i], upper[i]);\n\t }\n\t return retArray;\n\t } else if (Tone.isObject(lower)) {\n\t var retObj = {};\n\t for (var attr in lower) {\n\t retObj[attr] = this._interpolate(index, lower[attr], upper[attr]);\n\t }\n\t return retObj;\n\t } else {\n\t lower = this._toNumber(lower);\n\t upper = this._toNumber(upper);\n\t return (1 - index) * lower + index * upper;\n\t }\n\t };\n\t /**\n\t\t * Convert from the given type into a number\n\t\t * @param {Number|String} value\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.CtrlInterpolate.prototype._toNumber = function (val) {\n\t if (Tone.isNumber(val)) {\n\t return val;\n\t } else {\n\t //otherwise assume that it's Time...\n\t return this.toSeconds(val);\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.CtrlInterpolate} this\n\t\t */\n\t Tone.CtrlInterpolate.prototype.dispose = function () {\n\t this.values = null;\n\t };\n\t return Tone.CtrlInterpolate;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.CtrlMarkov represents a Markov Chain where each call\n\t\t * to Tone.CtrlMarkov.next will move to the next state. If the next\n\t\t * state choice is an array, the next state is chosen randomly with\n\t\t * even probability for all of the choices. For a weighted probability\n\t\t * of the next choices, pass in an object with \"state\" and \"probability\" attributes. \n\t\t * The probabilities will be normalized and then chosen. If no next options\n\t\t * are given for the current state, the state will stay there. \n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * var chain = new Tone.CtrlMarkov({\n\t\t * \t\"beginning\" : [\"end\", \"middle\"],\n\t\t * \t\"middle\" : \"end\"\n\t\t * });\n\t\t * chain.value = \"beginning\";\n\t\t * chain.next(); //returns \"end\" or \"middle\" with 50% probability\n\t\t *\n\t\t * @example\n\t\t * var chain = new Tone.CtrlMarkov({\n\t\t * \t\"beginning\" : [{\"value\" : \"end\", \"probability\" : 0.8}, \n\t\t * \t\t\t\t\t{\"value\" : \"middle\", \"probability\" : 0.2}],\n\t\t * \t\"middle\" : \"end\"\n\t\t * });\n\t\t * chain.value = \"beginning\";\n\t\t * chain.next(); //returns \"end\" with 80% probability or \"middle\" with 20%.\n\t\t * @param {Object} values An object with the state names as the keys\n\t\t * and the next state(s) as the values. \n\t\t */\n\t Tone.CtrlMarkov = function (values, initial) {\n\t Tone.call(this);\n\t /**\n\t\t\t * The Markov values with states as the keys\n\t\t\t * and next state(s) as the values. \n\t\t\t * @type {Object}\n\t\t\t */\n\t this.values = Tone.defaultArg(values, {});\n\t /**\n\t\t\t * The current state of the Markov values. The next\n\t\t\t * state will be evaluated and returned when Tone.CtrlMarkov.next\n\t\t\t * is invoked.\n\t\t\t * @type {String}\n\t\t\t */\n\t this.value = Tone.defaultArg(initial, Object.keys(this.values)[0]);\n\t };\n\t Tone.extend(Tone.CtrlMarkov);\n\t /**\n\t\t * Returns the next state of the Markov values. \n\t\t * @return {String}\n\t\t */\n\t Tone.CtrlMarkov.prototype.next = function () {\n\t if (this.values.hasOwnProperty(this.value)) {\n\t var next = this.values[this.value];\n\t if (Tone.isArray(next)) {\n\t var distribution = this._getProbDistribution(next);\n\t var rand = Math.random();\n\t var total = 0;\n\t for (var i = 0; i < distribution.length; i++) {\n\t var dist = distribution[i];\n\t if (rand > total && rand < total + dist) {\n\t var chosen = next[i];\n\t if (Tone.isObject(chosen)) {\n\t this.value = chosen.value;\n\t } else {\n\t this.value = chosen;\n\t }\n\t }\n\t total += dist;\n\t }\n\t } else {\n\t this.value = next;\n\t }\n\t }\n\t return this.value;\n\t };\n\t /**\n\t\t * Choose randomly from an array weighted options in the form \n\t\t * {\"state\" : string, \"probability\" : number} or an array of values\n\t\t * @param {Array} options \n\t\t * @return {Array} The randomly selected choice\n\t\t * @private\n\t\t */\n\t Tone.CtrlMarkov.prototype._getProbDistribution = function (options) {\n\t var distribution = [];\n\t var total = 0;\n\t var needsNormalizing = false;\n\t for (var i = 0; i < options.length; i++) {\n\t var option = options[i];\n\t if (Tone.isObject(option)) {\n\t needsNormalizing = true;\n\t distribution[i] = option.probability;\n\t } else {\n\t distribution[i] = 1 / options.length;\n\t }\n\t total += distribution[i];\n\t }\n\t if (needsNormalizing) {\n\t //normalize the values\n\t for (var j = 0; j < distribution.length; j++) {\n\t distribution[j] = distribution[j] / total;\n\t }\n\t }\n\t return distribution;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.CtrlMarkov} this\n\t\t */\n\t Tone.CtrlMarkov.prototype.dispose = function () {\n\t this.values = null;\n\t };\n\t return Tone.CtrlMarkov;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Generate patterns from an array of values.\n\t\t * Has a number of arpeggiation and randomized\n\t\t * selection patterns. \n\t\t * <ul>\n\t\t * \t <li>\"up\" - cycles upward</li>\n\t\t * \t\t\t<li>\"down\" - cycles downward</li>\n\t\t * \t\t\t<li>\"upDown\" - up then and down</li>\n\t\t * \t\t\t<li>\"downUp\" - cycles down then and up</li>\n\t\t * \t\t\t<li>\"alternateUp\" - jump up two and down one</li>\n\t\t * \t\t\t<li>\"alternateDown\" - jump down two and up one</li>\n\t\t * \t\t\t<li>\"random\" - randomly select an index</li>\n\t\t * \t\t\t<li>\"randomWalk\" - randomly moves one index away from the current position</li>\n\t\t * \t\t\t<li>\"randomOnce\" - randomly select an index without repeating until all values have been chosen.</li>\n\t\t * \t\t</ul>\n\t\t * @param {Array} values An array of options to choose from.\n\t\t * @param {Tone.CtrlPattern.Type=} type The name of the pattern.\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.CtrlPattern = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'values',\n\t 'type'\n\t ], Tone.CtrlPattern);\n\t Tone.call(this);\n\t /**\n\t\t\t * The array of values to arpeggiate over\n\t\t\t * @type {Array}\n\t\t\t */\n\t this.values = options.values;\n\t /**\n\t\t\t * The current position in the values array\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.index = 0;\n\t /**\n\t\t\t * The type placeholder\n\t\t\t * @type {Tone.CtrlPattern.Type}\n\t\t\t * @private\n\t\t\t */\n\t this._type = null;\n\t /**\n\t\t\t * Shuffled values for the RandomOnce type\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._shuffled = null;\n\t /**\n\t\t\t * The direction of the movement\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._direction = null;\n\t this.type = options.type;\n\t };\n\t Tone.extend(Tone.CtrlPattern);\n\t /**\n\t\t * The Control Patterns\n\t\t * @type {Object}\n\t\t * @static\n\t\t */\n\t Tone.CtrlPattern.Type = {\n\t Up: 'up',\n\t Down: 'down',\n\t UpDown: 'upDown',\n\t DownUp: 'downUp',\n\t AlternateUp: 'alternateUp',\n\t AlternateDown: 'alternateDown',\n\t Random: 'random',\n\t RandomWalk: 'randomWalk',\n\t RandomOnce: 'randomOnce'\n\t };\n\t /**\n\t\t * The default values. \n\t\t * @type {Object}\n\t\t */\n\t Tone.CtrlPattern.defaults = {\n\t 'type': Tone.CtrlPattern.Type.Up,\n\t 'values': []\n\t };\n\t /**\n\t\t * The value at the current index of the pattern.\n\t\t * @readOnly\n\t\t * @memberOf Tone.CtrlPattern#\n\t\t * @type {*}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.CtrlPattern.prototype, 'value', {\n\t get: function () {\n\t //some safeguards\n\t if (this.values.length === 0) {\n\t return;\n\t } else if (this.values.length === 1) {\n\t return this.values[0];\n\t }\n\t this.index = Math.min(this.index, this.values.length - 1);\n\t var val = this.values[this.index];\n\t if (this.type === Tone.CtrlPattern.Type.RandomOnce) {\n\t if (this.values.length !== this._shuffled.length) {\n\t this._shuffleValues();\n\t }\n\t val = this.values[this._shuffled[this.index]];\n\t }\n\t return val;\n\t }\n\t });\n\t /**\n\t\t * The pattern used to select the next\n\t\t * item from the values array\n\t\t * @memberOf Tone.CtrlPattern#\n\t\t * @type {Tone.CtrlPattern.Type}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.CtrlPattern.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t this._type = type;\n\t this._shuffled = null;\n\t //the first index\n\t if (this._type === Tone.CtrlPattern.Type.Up || this._type === Tone.CtrlPattern.Type.UpDown || this._type === Tone.CtrlPattern.Type.RandomOnce || this._type === Tone.CtrlPattern.Type.AlternateUp) {\n\t this.index = 0;\n\t } else if (this._type === Tone.CtrlPattern.Type.Down || this._type === Tone.CtrlPattern.Type.DownUp || this._type === Tone.CtrlPattern.Type.AlternateDown) {\n\t this.index = this.values.length - 1;\n\t }\n\t //the direction\n\t if (this._type === Tone.CtrlPattern.Type.UpDown || this._type === Tone.CtrlPattern.Type.AlternateUp) {\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t } else if (this._type === Tone.CtrlPattern.Type.DownUp || this._type === Tone.CtrlPattern.Type.AlternateDown) {\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t }\n\t //randoms\n\t if (this._type === Tone.CtrlPattern.Type.RandomOnce) {\n\t this._shuffleValues();\n\t } else if (this._type === Tone.CtrlPattern.Random) {\n\t this.index = Math.floor(Math.random() * this.values.length);\n\t }\n\t }\n\t });\n\t /**\n\t\t * Return the next value given the current position\n\t\t * and pattern.\n\t\t * @return {*} The next value\n\t\t */\n\t Tone.CtrlPattern.prototype.next = function () {\n\t var type = this.type;\n\t //choose the next index\n\t if (type === Tone.CtrlPattern.Type.Up) {\n\t this.index++;\n\t if (this.index >= this.values.length) {\n\t this.index = 0;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.Down) {\n\t this.index--;\n\t if (this.index < 0) {\n\t this.index = this.values.length - 1;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.UpDown || type === Tone.CtrlPattern.Type.DownUp) {\n\t if (this._direction === Tone.CtrlPattern.Type.Up) {\n\t this.index++;\n\t } else {\n\t this.index--;\n\t }\n\t if (this.index < 0) {\n\t this.index = 1;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t } else if (this.index >= this.values.length) {\n\t this.index = this.values.length - 2;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.Random) {\n\t this.index = Math.floor(Math.random() * this.values.length);\n\t } else if (type === Tone.CtrlPattern.Type.RandomWalk) {\n\t if (Math.random() < 0.5) {\n\t this.index--;\n\t this.index = Math.max(this.index, 0);\n\t } else {\n\t this.index++;\n\t this.index = Math.min(this.index, this.values.length - 1);\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.RandomOnce) {\n\t this.index++;\n\t if (this.index >= this.values.length) {\n\t this.index = 0;\n\t //reshuffle the values for next time\n\t this._shuffleValues();\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.AlternateUp) {\n\t if (this._direction === Tone.CtrlPattern.Type.Up) {\n\t this.index += 2;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t } else {\n\t this.index -= 1;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t }\n\t if (this.index >= this.values.length) {\n\t this.index = 0;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.AlternateDown) {\n\t if (this._direction === Tone.CtrlPattern.Type.Up) {\n\t this.index += 1;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t } else {\n\t this.index -= 2;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t }\n\t if (this.index < 0) {\n\t this.index = this.values.length - 1;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t }\n\t }\n\t return this.value;\n\t };\n\t /**\n\t\t * Shuffles the values and places the results into the _shuffled\n\t\t * @private\n\t\t */\n\t Tone.CtrlPattern.prototype._shuffleValues = function () {\n\t var copy = [];\n\t this._shuffled = [];\n\t for (var i = 0; i < this.values.length; i++) {\n\t copy[i] = i;\n\t }\n\t while (copy.length > 0) {\n\t var randVal = copy.splice(Math.floor(copy.length * Math.random()), 1);\n\t this._shuffled.push(randVal[0]);\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.CtrlPattern} this\n\t\t */\n\t Tone.CtrlPattern.prototype.dispose = function () {\n\t this._shuffled = null;\n\t this.values = null;\n\t };\n\t return Tone.CtrlPattern;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Choose a random value.\n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * var randomWalk = new Tone.CtrlRandom({\n\t\t * \t\"min\" : 0,\n\t\t * \t\"max\" : 10,\n\t\t * \t\"integer\" : true\n\t\t * });\n\t\t * randomWalk.eval();\n\t\t *\n\t\t * @param {Number|Time=} min The minimum return value.\n\t\t * @param {Number|Time=} max The maximum return value.\n\t\t */\n\t Tone.CtrlRandom = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'min',\n\t 'max'\n\t ], Tone.CtrlRandom);\n\t Tone.call(this);\n\t /**\n\t\t\t * The minimum return value\n\t\t\t * @type {Number|Time}\n\t\t\t */\n\t this.min = options.min;\n\t /**\n\t\t\t * The maximum return value\n\t\t\t * @type {Number|Time}\n\t\t\t */\n\t this.max = options.max;\n\t /**\n\t\t\t * If the return value should be an integer\n\t\t\t * @type {Boolean}\n\t\t\t */\n\t this.integer = options.integer;\n\t };\n\t Tone.extend(Tone.CtrlRandom);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.CtrlRandom.defaults = {\n\t 'min': 0,\n\t 'max': 1,\n\t 'integer': false\n\t };\n\t /**\n\t\t * Return a random value between min and max. \n\t\t * @readOnly\n\t\t * @memberOf Tone.CtrlRandom#\n\t\t * @type {*}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.CtrlRandom.prototype, 'value', {\n\t get: function () {\n\t var min = this.toSeconds(this.min);\n\t var max = this.toSeconds(this.max);\n\t var rand = Math.random();\n\t var val = rand * min + (1 - rand) * max;\n\t if (this.integer) {\n\t val = Math.floor(val);\n\t }\n\t return val;\n\t }\n\t });\n\t return Tone.CtrlRandom;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class A data structure for holding multiple buffers.\n\t\t * \n\t\t * @param {Object|Array} urls An object literal or array\n\t\t * of urls to load.\n\t\t * @param {Function=} callback The callback to invoke when\n\t\t * the buffers are loaded. \n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * //load a whole bank of piano samples\n\t\t * var pianoSamples = new Tone.Buffers({\n\t\t * \t\"C4\" : \"path/to/C4.mp3\"\n\t\t * \t\"C#4\" : \"path/to/C#4.mp3\"\n\t\t * \t\"D4\" : \"path/to/D4.mp3\"\n\t\t * \t\"D#4\" : \"path/to/D#4.mp3\"\n\t\t * \t...\n\t\t * }, function(){\n\t\t * \t//play one of the samples when they all load\n\t\t * \tplayer.buffer = pianoSamples.get(\"C4\");\n\t\t * \tplayer.start();\n\t\t * });\n\t\t * \t@example\n\t\t * //To pass in additional parameters in the second parameter\n\t\t * var buffers = new Tone.Buffers(urls, {\n\t\t * \t\"onload\" : callback,\n\t\t * \t\"baseUrl\" : \"../path/to/audio/\"\n\t\t * })\n\t\t */\n\t Tone.Buffers = function (urls) {\n\t //remove the urls from the options\n\t var args = Array.prototype.slice.call(arguments);\n\t args.shift();\n\t var options = Tone.defaults(args, [\n\t 'onload',\n\t 'baseUrl'\n\t ], Tone.Buffers);\n\t Tone.call(this);\n\t /**\n\t\t\t * All of the buffers\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._buffers = {};\n\t /**\n\t\t\t * A path which is prefixed before every url.\n\t\t\t * @type {String}\n\t\t\t */\n\t this.baseUrl = options.baseUrl;\n\t this._loadingCount = 0;\n\t //add each one\n\t for (var key in urls) {\n\t this._loadingCount++;\n\t this.add(key, urls[key], this._bufferLoaded.bind(this, options.onload));\n\t }\n\t };\n\t Tone.extend(Tone.Buffers);\n\t /**\n\t\t * Defaults\n\t\t * @type {Object}\n\t\t */\n\t Tone.Buffers.defaults = {\n\t 'onload': Tone.noOp,\n\t 'baseUrl': ''\n\t };\n\t /**\n\t\t * True if the buffers object has a buffer by that name.\n\t\t * @param {String|Number} name The key or index of the \n\t\t * buffer.\n\t\t * @return {Boolean}\n\t\t */\n\t Tone.Buffers.prototype.has = function (name) {\n\t return this._buffers.hasOwnProperty(name);\n\t };\n\t /**\n\t\t * Get a buffer by name. If an array was loaded, \n\t\t * then use the array index.\n\t\t * @param {String|Number} name The key or index of the \n\t\t * buffer.\n\t\t * @return {Tone.Buffer}\n\t\t */\n\t Tone.Buffers.prototype.get = function (name) {\n\t if (this.has(name)) {\n\t return this._buffers[name];\n\t } else {\n\t throw new Error('Tone.Buffers: no buffer named ' + name);\n\t }\n\t };\n\t /**\n\t\t * A buffer was loaded. decrement the counter.\n\t\t * @param {Function} callback \n\t\t * @private\n\t\t */\n\t Tone.Buffers.prototype._bufferLoaded = function (callback) {\n\t this._loadingCount--;\n\t if (this._loadingCount === 0 && callback) {\n\t callback(this);\n\t }\n\t };\n\t /**\n\t\t * If the buffers are loaded or not\n\t\t * @memberOf Tone.Buffers#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffers.prototype, 'loaded', {\n\t get: function () {\n\t var isLoaded = true;\n\t for (var buffName in this._buffers) {\n\t var buff = this.get(buffName);\n\t isLoaded = isLoaded && buff.loaded;\n\t }\n\t return isLoaded;\n\t }\n\t });\n\t /**\n\t\t * Add a buffer by name and url to the Buffers\n\t\t * @param {String} name A unique name to give\n\t\t * the buffer\n\t\t * @param {String|Tone.Buffer|Audiobuffer} url Either the url of the bufer, \n\t\t * or a buffer which will be added\n\t\t * with the given name.\n\t\t * @param {Function=} callback The callback to invoke \n\t\t * when the url is loaded.\n\t\t */\n\t Tone.Buffers.prototype.add = function (name, url, callback) {\n\t callback = Tone.defaultArg(callback, Tone.noOp);\n\t if (url instanceof Tone.Buffer) {\n\t this._buffers[name] = url;\n\t callback(this);\n\t } else if (url instanceof AudioBuffer) {\n\t this._buffers[name] = new Tone.Buffer(url);\n\t callback(this);\n\t } else if (Tone.isString(url)) {\n\t this._buffers[name] = new Tone.Buffer(this.baseUrl + url, callback);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Buffers} this\n\t\t */\n\t Tone.Buffers.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t for (var name in this._buffers) {\n\t this._buffers[name].dispose();\n\t }\n\t this._buffers = null;\n\t return this;\n\t };\n\t return Tone.Buffers;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * buses are another way of routing audio\n\t\t *\n\t\t * augments Tone.prototype to include send and recieve\n\t\t */\n\t /**\n\t\t * All of the routes\n\t\t *\n\t\t * @type {Object}\n\t\t * @static\n\t\t * @private\n\t\t */\n\t var Buses = {};\n\t /**\n\t\t * Send this signal to the channel name.\n\t\t * @param {String} channelName A named channel to send the signal to.\n\t\t * @param {Decibels} amount The amount of the source to send to the bus.\n\t\t * @return {GainNode} The gain node which connects this node to the desired channel.\n\t\t * Can be used to adjust the levels of the send.\n\t\t * @example\n\t\t * source.send(\"reverb\", -12);\n\t\t */\n\t Tone.prototype.send = function (channelName, amount) {\n\t if (!Buses.hasOwnProperty(channelName)) {\n\t Buses[channelName] = this.context.createGain();\n\t }\n\t amount = Tone.defaultArg(amount, 0);\n\t var sendKnob = new Tone.Gain(amount, Tone.Type.Decibels);\n\t this.connect(sendKnob);\n\t sendKnob.connect(Buses[channelName]);\n\t return sendKnob;\n\t };\n\t /**\n\t\t * Recieve the input from the desired channelName to the input\n\t\t *\n\t\t * @param {String} channelName A named channel to send the signal to.\n\t\t * @param {Number=} channelNumber The channel to connect to\n\t\t * @returns {Tone} this\n\t\t * @example\n\t\t * reverbEffect.receive(\"reverb\");\n\t\t */\n\t Tone.prototype.receive = function (channelName, inputNum) {\n\t if (!Buses.hasOwnProperty(channelName)) {\n\t Buses[channelName] = this.context.createGain();\n\t }\n\t Buses[channelName].connect(this, 0, inputNum);\n\t return this;\n\t };\n\t //remove all the send/receives when a new audio context is passed in\n\t Tone.Context.on('init', function (context) {\n\t if (context.Buses) {\n\t Buses = context.Buses;\n\t } else {\n\t Buses = {};\n\t context.Buses = Buses;\n\t }\n\t });\n\t return Tone;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Draw is useful for synchronizing visuals and audio events.\n\t\t * Callbacks from Tone.Transport or any of the Tone.Event classes\n\t\t * always happen _before_ the scheduled time and are not synchronized\n\t\t * to the animation frame so they are not good for triggering tightly\n\t\t * synchronized visuals and sound. Tone.Draw makes it easy to schedule\n\t\t * callbacks using the AudioContext time and uses requestAnimationFrame.\n\t\t * \n\t\t * @singleton\n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * Tone.Transport.schedule(function(time){\n\t\t * \t//use the time argument to schedule a callback with Tone.Draw\n\t\t * \tTone.Draw.schedule(function(){\n\t\t * \t\t//do drawing or DOM manipulation here\n\t\t * \t}, time)\n\t\t * }, \"+0.5\")\n\t\t */\n\t Tone.Draw = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * All of the events.\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._events = new Tone.Timeline();\n\t /**\n\t\t\t * The duration after which events are not invoked.\n\t\t\t * @type {Number}\n\t\t\t * @default 0.25\n\t\t\t */\n\t this.expiration = 0.25;\n\t /**\n\t\t\t * The amount of time before the scheduled time \n\t\t\t * that the callback can be invoked. Default is\n\t\t\t * half the time of an animation frame (0.008 seconds).\n\t\t\t * @type {Number}\n\t\t\t * @default 0.008\n\t\t\t */\n\t this.anticipation = 0.008;\n\t /**\n\t\t\t * The draw loop\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._boundDrawLoop = this._drawLoop.bind(this);\n\t };\n\t Tone.extend(Tone.Draw);\n\t /**\n\t\t * Schedule a function at the given time to be invoked\n\t\t * on the nearest animation frame.\n\t\t * @param {Function} callback Callback is invoked at the given time.\n\t\t * @param {Time} time The time relative to the AudioContext time\n\t\t * to invoke the callback.\n\t\t * @return {Tone.Draw} this\n\t\t */\n\t Tone.Draw.prototype.schedule = function (callback, time) {\n\t this._events.add({\n\t callback: callback,\n\t time: this.toSeconds(time)\n\t });\n\t //start the draw loop on the first event\n\t if (this._events.length === 1) {\n\t requestAnimationFrame(this._boundDrawLoop);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel events scheduled after the given time\n\t\t * @param {Time=} after Time after which scheduled events will \n\t\t * be removed from the scheduling timeline.\n\t\t * @return {Tone.Draw} this\n\t\t */\n\t Tone.Draw.prototype.cancel = function (after) {\n\t this._events.cancel(this.toSeconds(after));\n\t return this;\n\t };\n\t /**\n\t\t * The draw loop\n\t\t * @private\n\t\t */\n\t Tone.Draw.prototype._drawLoop = function () {\n\t var now = Tone.now();\n\t while (this._events.length && this._events.peek().time - this.anticipation <= now) {\n\t var event = this._events.shift();\n\t if (now - event.time <= this.expiration) {\n\t event.callback();\n\t }\n\t }\n\t if (this._events.length > 0) {\n\t requestAnimationFrame(this._boundDrawLoop);\n\t }\n\t };\n\t //make a singleton\n\t Tone.Draw = new Tone.Draw();\n\t return Tone.Draw;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Both Tone.Panner3D and Tone.Listener have a position in 3D space\n\t\t * using a right-handed cartesian coordinate system.\n\t\t * The units used in the coordinate system are not defined;\n\t\t * these coordinates are independent/invariant of any particular\n\t\t * units such as meters or feet. Tone.Panner3D objects have an forward\n\t\t * vector representing the direction the sound is projecting. Additionally,\n\t\t * they have a sound cone representing how directional the sound is.\n\t\t * For example, the sound could be omnidirectional, in which case it would\n\t\t * be heard anywhere regardless of its forward, or it can be more directional\n\t\t * and heard only if it is facing the listener. Tone.Listener objects\n\t\t * (representing a person's ears) have an forward and up vector\n\t\t * representing in which direction the person is facing. Because both the\n\t\t * source stream and the listener can be moving, they both have a velocity\n\t\t * vector representing both the speed and direction of movement. Taken together,\n\t\t * these two velocities can be used to generate a doppler shift effect which changes the pitch.\n\t\t * <br><br>\n\t\t * Note: the position of the Listener will have no effect on nodes not connected to a Tone.Panner3D\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t * @singleton\n\t\t */\n\t Tone.Listener = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * Holds the current forward orientation\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._orientation = [\n\t 0,\n\t 0,\n\t 0,\n\t 0,\n\t 0,\n\t 0\n\t ];\n\t /**\n\t\t\t * Holds the current position\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._position = [\n\t 0,\n\t 0,\n\t 0\n\t ];\n\t Tone.getContext(function () {\n\t // set the default position/forward\n\t this.set(ListenerConstructor.defaults);\n\t }.bind(this));\n\t };\n\t Tone.extend(Tone.Listener);\n\t /**\n\t\t * Defaults according to the specification\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Listener.defaults = {\n\t 'positionX': 0,\n\t 'positionY': 0,\n\t 'positionZ': 0,\n\t 'forwardX': 0,\n\t 'forwardY': 0,\n\t 'forwardZ': 1,\n\t 'upX': 0,\n\t 'upY': 1,\n\t 'upZ': 0\n\t };\n\t /**\n\t\t * The ramp time which is applied to the setTargetAtTime\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.Listener.prototype._rampTimeConstant = 0.01;\n\t /**\n\t\t * Sets the position of the listener in 3d space.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @return {Tone.Listener} this\n\t\t */\n\t Tone.Listener.prototype.setPosition = function (x, y, z) {\n\t if (this.context.listener.positionX) {\n\t var now = this.now();\n\t this.context.listener.positionX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this.context.listener.positionY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this.context.listener.positionZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t } else {\n\t this.context.listener.setPosition(x, y, z);\n\t }\n\t this._position = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * Sets the orientation of the listener using two vectors, the forward\n\t\t * vector (which direction the listener is facing) and the up vector\n\t\t * (which the up direction of the listener). An up vector\n\t\t * of 0, 0, 1 is equivalent to the listener standing up in the Z direction.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @param {Number} upX\n\t\t * @param {Number} upY\n\t\t * @param {Number} upZ\n\t\t * @return {Tone.Listener} this\n\t\t */\n\t Tone.Listener.prototype.setOrientation = function (x, y, z, upX, upY, upZ) {\n\t if (this.context.listener.forwardX) {\n\t var now = this.now();\n\t this.context.listener.forwardX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this.context.listener.forwardY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this.context.listener.forwardZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t this.context.listener.upX.setTargetAtTime(upX, now, this._rampTimeConstant);\n\t this.context.listener.upY.setTargetAtTime(upY, now, this._rampTimeConstant);\n\t this.context.listener.upZ.setTargetAtTime(upZ, now, this._rampTimeConstant);\n\t } else {\n\t this.context.listener.setOrientation(x, y, z, upX, upY, upZ);\n\t }\n\t this._orientation = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * The x position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name positionX\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'positionX', {\n\t set: function (pos) {\n\t this._position[0] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[0];\n\t }\n\t });\n\t /**\n\t\t * The y position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name positionY\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'positionY', {\n\t set: function (pos) {\n\t this._position[1] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[1];\n\t }\n\t });\n\t /**\n\t\t * The z position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name positionZ\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'positionZ', {\n\t set: function (pos) {\n\t this._position[2] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[2];\n\t }\n\t });\n\t /**\n\t\t * The x coordinate of the listeners front direction. i.e.\n\t\t * which way they are facing.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name forwardX\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'forwardX', {\n\t set: function (pos) {\n\t this._orientation[0] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[0];\n\t }\n\t });\n\t /**\n\t\t * The y coordinate of the listeners front direction. i.e.\n\t\t * which way they are facing.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name forwardY\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'forwardY', {\n\t set: function (pos) {\n\t this._orientation[1] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[1];\n\t }\n\t });\n\t /**\n\t\t * The z coordinate of the listeners front direction. i.e.\n\t\t * which way they are facing.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name forwardZ\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'forwardZ', {\n\t set: function (pos) {\n\t this._orientation[2] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[2];\n\t }\n\t });\n\t /**\n\t\t * The x coordinate of the listener's up direction. i.e.\n\t\t * the direction the listener is standing in.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name upX\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'upX', {\n\t set: function (pos) {\n\t this._orientation[3] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[3];\n\t }\n\t });\n\t /**\n\t\t * The y coordinate of the listener's up direction. i.e.\n\t\t * the direction the listener is standing in.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name upY\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'upY', {\n\t set: function (pos) {\n\t this._orientation[4] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[4];\n\t }\n\t });\n\t /**\n\t\t * The z coordinate of the listener's up direction. i.e.\n\t\t * the direction the listener is standing in.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name upZ\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'upZ', {\n\t set: function (pos) {\n\t this._orientation[5] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[5];\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Listener} this\n\t\t */\n\t Tone.Listener.prototype.dispose = function () {\n\t this._orientation = null;\n\t this._position = null;\n\t return this;\n\t };\n\t //SINGLETON SETUP\n\t var ListenerConstructor = Tone.Listener;\n\t Tone.Listener = new ListenerConstructor();\n\t Tone.Context.on('init', function (context) {\n\t if (context.Listener instanceof ListenerConstructor) {\n\t //a single listener object\n\t Tone.Listener = context.Listener;\n\t } else {\n\t //make new Listener insides\n\t Tone.Listener = new ListenerConstructor();\n\t }\n\t context.Listener = Tone.Listener;\n\t });\n\t //END SINGLETON SETUP\n\t return Tone.Listener;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * Because of a bug in iOS causing the currentTime to increment\n\t\t * before the rendering is started, sometimes it takes multiple\n\t\t * attempts to render the audio correctly.\n\t\t * @private\n\t\t */\n\t function attemptRender(callback, duration, sampleRate, tries) {\n\t tries = Tone.defaultArg(tries, 0);\n\t var context = new Tone.OfflineContext(2, duration, sampleRate);\n\t Tone.context = context;\n\t //invoke the callback/scheduling\n\t var response = callback(Tone.Transport);\n\t if (context.currentTime > 0 && tries < 1000) {\n\t return attemptRender(callback, duration, sampleRate, ++tries);\n\t } else {\n\t return {\n\t 'response': response,\n\t 'context': context\n\t };\n\t }\n\t }\n\t /**\n\t\t * Generate a buffer by rendering all of the Tone.js code within the callback using the OfflineAudioContext.\n\t\t * The OfflineAudioContext is capable of rendering much faster than real time in many cases.\n\t\t * The callback function also passes in an offline instance of Tone.Transport which can be used\n\t\t * to schedule events along the Transport. **NOTE** OfflineAudioContext has the same restrictions\n\t\t * as the AudioContext in that on certain platforms (like iOS) it must be invoked by an explicit\n\t\t * user action like a click or tap. \n\t\t * @param {Function} callback All Tone.js nodes which are created and scheduled within this callback are recorded into the output Buffer.\n\t\t * @param {Time} duration the amount of time to record for.\n\t\t * @return {Promise} The promise which is invoked with the Tone.Buffer of the recorded output.\n\t\t * @example\n\t\t * //render 2 seconds of the oscillator\n\t\t * Tone.Offline(function(){\n\t\t * \t//only nodes created in this callback will be recorded\n\t\t * \tvar oscillator = new Tone.Oscillator().toMaster().start(0)\n\t\t * \t//schedule their events\n\t\t * }, 2).then(function(buffer){\n\t\t * \t//do something with the output buffer\n\t\t * })\n\t\t * @example\n\t\t * //can also schedule events along the Transport\n\t\t * //using the passed in Offline Transport\n\t\t * Tone.Offline(function(Transport){\n\t\t * \tvar osc = new Tone.Oscillator().toMaster()\n\t\t * \tTransport.schedule(function(time){\n\t\t * \t\tosc.start(time).stop(time + 0.1)\n\t\t * \t}, 1)\n\t\t * \tTransport.start(0.2)\n\t\t * }, 4).then(function(buffer){\n\t\t * \t//do something with the output buffer\n\t\t * })\n\t\t */\n\t Tone.Offline = function (callback, duration) {\n\t //set the OfflineAudioContext\n\t var sampleRate = Tone.context.sampleRate;\n\t var originalContext = Tone.context;\n\t var renderRet = attemptRender(callback, duration, sampleRate);\n\t var response = renderRet.response;\n\t var context = renderRet.context;\n\t var ret;\n\t if (response instanceof Promise) {\n\t //wait for the promise to resolve\n\t ret = response.then(function () {\n\t //then render the audio\n\t return context.render();\n\t });\n\t } else {\n\t //process the audio\n\t ret = context.render();\n\t }\n\t //return the original AudioContext\n\t Tone.context = originalContext;\n\t //return the audio\n\t return ret.then(function (buffer) {\n\t //wrap it in a Tone.Buffer\n\t return new Tone.Buffer(buffer);\n\t });\n\t };\n\t return Tone.Offline;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * \t@class Tone.Effect is the base class for effects. Connect the effect between\n\t\t * \t the effectSend and effectReturn GainNodes, then control the amount of\n\t\t * \t effect which goes to the output using the wet control.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {NormalRange|Object} [wet] The starting wet value.\n\t\t */\n\t Tone.Effect = function () {\n\t var options = Tone.defaults(arguments, ['wet'], Tone.Effect);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the drywet knob to control the amount of effect\n\t\t\t * @type {Tone.CrossFade}\n\t\t\t * @private\n\t\t\t */\n\t this._dryWet = new Tone.CrossFade(options.wet);\n\t /**\n\t\t\t * The wet control is how much of the effected\n\t\t\t * will pass through to the output. 1 = 100% effected\n\t\t\t * signal, 0 = 100% dry signal.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.wet = this._dryWet.fade;\n\t /**\n\t\t\t * connect the effectSend to the input of hte effect\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.effectSend = new Tone.Gain();\n\t /**\n\t\t\t * connect the output of the effect to the effectReturn\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.effectReturn = new Tone.Gain();\n\t //connections\n\t this.input.connect(this._dryWet.a);\n\t this.input.connect(this.effectSend);\n\t this.effectReturn.connect(this._dryWet.b);\n\t this._dryWet.connect(this.output);\n\t this._readOnly(['wet']);\n\t };\n\t Tone.extend(Tone.Effect, Tone.AudioNode);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Effect.defaults = { 'wet': 1 };\n\t /**\n\t\t * chains the effect in between the effectSend and effectReturn\n\t\t * @param {Tone} effect\n\t\t * @private\n\t\t * @returns {Tone.Effect} this\n\t\t */\n\t Tone.Effect.prototype.connectEffect = function (effect) {\n\t this.effectSend.chain(effect, this.effectReturn);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Effect} this\n\t\t */\n\t Tone.Effect.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._dryWet.dispose();\n\t this._dryWet = null;\n\t this.effectSend.dispose();\n\t this.effectSend = null;\n\t this.effectReturn.dispose();\n\t this.effectReturn = null;\n\t this._writable(['wet']);\n\t this.wet = null;\n\t return this;\n\t };\n\t return Tone.Effect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AutoFilter is a Tone.Filter with a Tone.LFO connected to the filter cutoff frequency.\n\t\t * Setting the LFO rate and depth allows for control over the filter modulation rate \n\t\t * and depth.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Time|Object} [frequency] The rate of the LFO.\n\t\t * @param {Frequency=} baseFrequency The lower value of the LFOs oscillation\n\t \t * @param {Frequency=} octaves The number of octaves above the baseFrequency\n\t\t * @example\n\t\t * //create an autofilter and start it's LFO\n\t\t * var autoFilter = new Tone.AutoFilter(\"4n\").toMaster().start();\n\t\t * //route an oscillator through the filter and start it\n\t\t * var oscillator = new Tone.Oscillator().connect(autoFilter).start();\n\t\t */\n\t Tone.AutoFilter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'baseFrequency',\n\t 'octaves'\n\t ], Tone.AutoFilter);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * the lfo which drives the filter cutoff\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfo = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'amplitude': options.depth\n\t });\n\t /**\n\t\t\t * The range of the filter modulating between the min and max frequency. \n\t\t\t * 0 = no modulation. 1 = full modulation.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = this._lfo.amplitude;\n\t /**\n\t\t\t * How fast the filter modulates between min and max. \n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfo.frequency;\n\t /**\n\t\t\t * The filter node\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.filter = new Tone.Filter(options.filter);\n\t /**\n\t\t\t * The octaves placeholder\n\t\t\t * @type {Positive}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = 0;\n\t //connections\n\t this.connectEffect(this.filter);\n\t this._lfo.connect(this.filter.frequency);\n\t this.type = options.type;\n\t this._readOnly([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.octaves = options.octaves;\n\t this.baseFrequency = options.baseFrequency;\n\t };\n\t //extend Effect\n\t Tone.extend(Tone.AutoFilter, Tone.Effect);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AutoFilter.defaults = {\n\t 'frequency': 1,\n\t 'type': 'sine',\n\t 'depth': 1,\n\t 'baseFrequency': 200,\n\t 'octaves': 2.6,\n\t 'filter': {\n\t 'type': 'lowpass',\n\t 'rolloff': -12,\n\t 'Q': 1\n\t }\n\t };\n\t /**\n\t\t * Start the effect.\n\t\t * @param {Time} [time=now] When the LFO will start. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.start = function (time) {\n\t this._lfo.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the effect.\n\t\t * @param {Time} [time=now] When the LFO will stop. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.stop = function (time) {\n\t this._lfo.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the filter to the transport.\n\t\t * @param {Time} [delay=0] Delay time before starting the effect after the\n\t\t * Transport has started. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.sync = function (delay) {\n\t this._lfo.sync(delay);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the filter from the transport.\n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.unsync = function () {\n\t this._lfo.unsync();\n\t return this;\n\t };\n\t /**\n\t\t * Type of oscillator attached to the AutoFilter. \n\t\t * Possible values: \"sine\", \"square\", \"triangle\", \"sawtooth\".\n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.AutoFilter.prototype, 'type', {\n\t get: function () {\n\t return this._lfo.type;\n\t },\n\t set: function (type) {\n\t this._lfo.type = type;\n\t }\n\t });\n\t /**\n\t\t * The minimum value of the filter's cutoff frequency.\n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {Frequency}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.AutoFilter.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._lfo.min;\n\t },\n\t set: function (freq) {\n\t this._lfo.min = this.toFrequency(freq);\n\t //and set the max\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * The maximum value of the filter's cutoff frequency. \n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {Positive}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.AutoFilter.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (oct) {\n\t this._octaves = oct;\n\t this._lfo.max = this.baseFrequency * Math.pow(2, oct);\n\t }\n\t });\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._lfo.dispose();\n\t this._lfo = null;\n\t this.filter.dispose();\n\t this.filter = null;\n\t this._writable([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.frequency = null;\n\t this.depth = null;\n\t return this;\n\t };\n\t return Tone.AutoFilter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AutoPanner is a Tone.Panner with an LFO connected to the pan amount. \n\t\t * More on using autopanners [here](https://www.ableton.com/en/blog/autopan-chopper-effect-and-more-liveschool/).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Frequency|Object} [frequency] Rate of left-right oscillation. \n\t\t * @example\n\t\t * //create an autopanner and start it's LFO\n\t\t * var autoPanner = new Tone.AutoPanner(\"4n\").toMaster().start();\n\t\t * //route an oscillator through the panner and start it\n\t\t * var oscillator = new Tone.Oscillator().connect(autoPanner).start();\n\t\t */\n\t Tone.AutoPanner = function () {\n\t var options = Tone.defaults(arguments, ['frequency'], Tone.AutoPanner);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * the lfo which drives the panning\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfo = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'amplitude': options.depth,\n\t 'min': -1,\n\t 'max': 1\n\t });\n\t /**\n\t\t\t * The amount of panning between left and right. \n\t\t\t * 0 = always center. 1 = full range between left and right. \n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = this._lfo.amplitude;\n\t /**\n\t\t\t * the panner node which does the panning\n\t\t\t * @type {Tone.Panner}\n\t\t\t * @private\n\t\t\t */\n\t this._panner = new Tone.Panner();\n\t /**\n\t\t\t * How fast the panner modulates between left and right. \n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfo.frequency;\n\t //connections\n\t this.connectEffect(this._panner);\n\t this._lfo.connect(this._panner.pan);\n\t this.type = options.type;\n\t this._readOnly([\n\t 'depth',\n\t 'frequency'\n\t ]);\n\t };\n\t //extend Effect\n\t Tone.extend(Tone.AutoPanner, Tone.Effect);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AutoPanner.defaults = {\n\t 'frequency': 1,\n\t 'type': 'sine',\n\t 'depth': 1\n\t };\n\t /**\n\t\t * Start the effect.\n\t\t * @param {Time} [time=now] When the LFO will start. \n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.start = function (time) {\n\t this._lfo.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the effect.\n\t\t * @param {Time} [time=now] When the LFO will stop. \n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.stop = function (time) {\n\t this._lfo.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the panner to the transport.\n\t\t * @param {Time} [delay=0] Delay time before starting the effect after the\n\t\t * Transport has started. \n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.sync = function (delay) {\n\t this._lfo.sync(delay);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the panner from the transport\n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.unsync = function () {\n\t this._lfo.unsync();\n\t return this;\n\t };\n\t /**\n\t\t * Type of oscillator attached to the AutoFilter. \n\t\t * Possible values: \"sine\", \"square\", \"triangle\", \"sawtooth\".\n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.AutoPanner.prototype, 'type', {\n\t get: function () {\n\t return this._lfo.type;\n\t },\n\t set: function (type) {\n\t this._lfo.type = type;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._lfo.dispose();\n\t this._lfo = null;\n\t this._panner.dispose();\n\t this._panner = null;\n\t this._writable([\n\t 'depth',\n\t 'frequency'\n\t ]);\n\t this.frequency = null;\n\t this.depth = null;\n\t return this;\n\t };\n\t return Tone.AutoPanner;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AutoWah connects a Tone.Follower to a bandpass filter (Tone.Filter).\n\t\t * The frequency of the filter is adjusted proportionally to the\n\t\t * incoming signal's amplitude. Inspiration from [Tuna.js](https://github.com/Dinahmoe/tuna).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Frequency|Object} [baseFrequency] The frequency the filter is set\n\t\t * to at the low point of the wah\n\t\t * @param {Positive} [octaves] The number of octaves above the baseFrequency\n\t\t * the filter will sweep to when fully open\n\t\t * @param {Decibels} [sensitivity] The decibel threshold sensitivity for\n\t\t * the incoming signal. Normal range of -40 to 0.\n\t\t * @example\n\t\t * var autoWah = new Tone.AutoWah(50, 6, -30).toMaster();\n\t\t * //initialize the synth and connect to autowah\n\t\t * var synth = new Synth.connect(autoWah);\n\t\t * //Q value influences the effect of the wah - default is 2\n\t\t * autoWah.Q.value = 6;\n\t\t * //more audible on higher notes\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\")\n\t\t */\n\t Tone.AutoWah = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'baseFrequency',\n\t 'octaves',\n\t 'sensitivity'\n\t ], Tone.AutoWah);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * The envelope follower. Set the attack/release\n\t\t\t * timing to adjust how the envelope is followed.\n\t\t\t * @type {Tone.Follower}\n\t\t\t * @private\n\t\t\t */\n\t this.follower = new Tone.Follower(options.follower);\n\t /**\n\t\t\t * scales the follower value to the frequency domain\n\t\t\t * @type {Tone}\n\t\t\t * @private\n\t\t\t */\n\t this._sweepRange = new Tone.ScaleExp(0, 1, 0.5);\n\t /**\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._baseFrequency = options.baseFrequency;\n\t /**\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t /**\n\t\t\t * the input gain to adjust the sensitivity\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._inputBoost = new Tone.Gain();\n\t /**\n\t\t\t * @type {BiquadFilterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._bandpass = new Tone.Filter({\n\t 'rolloff': -48,\n\t 'frequency': 0,\n\t 'Q': options.Q\n\t });\n\t /**\n\t\t\t * @type {Tone.Filter}\n\t\t\t * @private\n\t\t\t */\n\t this._peaking = new Tone.Filter(0, 'peaking');\n\t this._peaking.gain.value = options.gain;\n\t /**\n\t\t\t * The gain of the filter.\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.gain = this._peaking.gain;\n\t /**\n\t\t\t * The quality of the filter.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = this._bandpass.Q;\n\t //the control signal path\n\t this.effectSend.chain(this._inputBoost, this.follower, this._sweepRange);\n\t this._sweepRange.connect(this._bandpass.frequency);\n\t this._sweepRange.connect(this._peaking.frequency);\n\t //the filtered path\n\t this.effectSend.chain(this._bandpass, this._peaking, this.effectReturn);\n\t //set the initial value\n\t this._setSweepRange();\n\t this.sensitivity = options.sensitivity;\n\t this._readOnly([\n\t 'gain',\n\t 'Q'\n\t ]);\n\t };\n\t Tone.extend(Tone.AutoWah, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AutoWah.defaults = {\n\t 'baseFrequency': 100,\n\t 'octaves': 6,\n\t 'sensitivity': 0,\n\t 'Q': 2,\n\t 'gain': 2,\n\t 'follower': {\n\t 'attack': 0.3,\n\t 'release': 0.5\n\t }\n\t };\n\t /**\n\t\t * The number of octaves that the filter will sweep above the\n\t\t * baseFrequency.\n\t\t * @memberOf Tone.AutoWah#\n\t\t * @type {Number}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.AutoWah.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octaves) {\n\t this._octaves = octaves;\n\t this._setSweepRange();\n\t }\n\t });\n\t /**\n\t\t * The base frequency from which the sweep will start from.\n\t\t * @memberOf Tone.AutoWah#\n\t\t * @type {Frequency}\n\t\t * @name baseFrequency\n\t\t */\n\t Object.defineProperty(Tone.AutoWah.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._baseFrequency;\n\t },\n\t set: function (baseFreq) {\n\t this._baseFrequency = baseFreq;\n\t this._setSweepRange();\n\t }\n\t });\n\t /**\n\t\t * The sensitivity to control how responsive to the input signal the filter is.\n\t\t * @memberOf Tone.AutoWah#\n\t\t * @type {Decibels}\n\t\t * @name sensitivity\n\t\t */\n\t Object.defineProperty(Tone.AutoWah.prototype, 'sensitivity', {\n\t get: function () {\n\t return Tone.gainToDb(1 / this._inputBoost.gain.value);\n\t },\n\t set: function (sensitivy) {\n\t this._inputBoost.gain.value = 1 / Tone.dbToGain(sensitivy);\n\t }\n\t });\n\t /**\n\t\t * sets the sweep range of the scaler\n\t\t * @private\n\t\t */\n\t Tone.AutoWah.prototype._setSweepRange = function () {\n\t this._sweepRange.min = this._baseFrequency;\n\t this._sweepRange.max = Math.min(this._baseFrequency * Math.pow(2, this._octaves), this.context.sampleRate / 2);\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.AutoWah} this\n\t\t */\n\t Tone.AutoWah.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this.follower.dispose();\n\t this.follower = null;\n\t this._sweepRange.dispose();\n\t this._sweepRange = null;\n\t this._bandpass.dispose();\n\t this._bandpass = null;\n\t this._peaking.dispose();\n\t this._peaking = null;\n\t this._inputBoost.dispose();\n\t this._inputBoost = null;\n\t this._writable([\n\t 'gain',\n\t 'Q'\n\t ]);\n\t this.gain = null;\n\t this.Q = null;\n\t return this;\n\t };\n\t return Tone.AutoWah;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Signal-rate modulo operator. Only works in AudioRange [-1, 1] and for modulus\n\t\t * values in the NormalRange.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @param {NormalRange} modulus The modulus to apply.\n\t\t * @example\n\t\t * var mod = new Tone.Modulo(0.2)\n\t\t * var sig = new Tone.Signal(0.5).connect(mod);\n\t\t * //mod outputs 0.1\n\t\t */\n\t Tone.Modulo = function (modulus) {\n\t Tone.SignalBase.call(this);\n\t this.createInsOuts(1, 0);\n\t /**\n\t\t\t * A waveshaper gets the integer multiple of\n\t\t\t * the input signal and the modulus.\n\t\t\t * @private\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t */\n\t this._shaper = new Tone.WaveShaper(Math.pow(2, 16));\n\t /**\n\t\t\t * the integer multiple is multiplied by the modulus\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._multiply = new Tone.Multiply();\n\t /**\n\t\t\t * and subtracted from the input signal\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._subtract = this.output = new Tone.Subtract();\n\t /**\n\t\t\t * the modulus signal\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._modSignal = new Tone.Signal(modulus);\n\t //connections\n\t this.input.fan(this._shaper, this._subtract);\n\t this._modSignal.connect(this._multiply, 0, 0);\n\t this._shaper.connect(this._multiply, 0, 1);\n\t this._multiply.connect(this._subtract, 0, 1);\n\t this._setWaveShaper(modulus);\n\t };\n\t Tone.extend(Tone.Modulo, Tone.SignalBase);\n\t /**\n\t\t * @param {number} mod the modulus to apply\n\t\t * @private\n\t\t */\n\t Tone.Modulo.prototype._setWaveShaper = function (mod) {\n\t this._shaper.setMap(function (val) {\n\t var multiple = Math.floor((val + 0.0001) / mod);\n\t return multiple;\n\t });\n\t };\n\t /**\n\t\t * The modulus value.\n\t\t * @memberOf Tone.Modulo#\n\t\t * @type {NormalRange}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Modulo.prototype, 'value', {\n\t get: function () {\n\t return this._modSignal.value;\n\t },\n\t set: function (mod) {\n\t this._modSignal.value = mod;\n\t this._setWaveShaper(mod);\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Modulo} this\n\t\t */\n\t Tone.Modulo.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._shaper.dispose();\n\t this._shaper = null;\n\t this._multiply.dispose();\n\t this._multiply = null;\n\t this._subtract.dispose();\n\t this._subtract = null;\n\t this._modSignal.dispose();\n\t this._modSignal = null;\n\t return this;\n\t };\n\t return Tone.Modulo;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Bitcrusher downsamples the incoming signal to a different bitdepth.\n\t\t * Lowering the bitdepth of the signal creates distortion. Read more about Bitcrushing\n\t\t * on [Wikipedia](https://en.wikipedia.org/wiki/Bitcrusher).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Number} bits The number of bits to downsample the signal. Nominal range\n\t\t * of 1 to 8.\n\t\t * @example\n\t\t * //initialize crusher and route a synth through it\n\t\t * var crusher = new Tone.BitCrusher(4).toMaster();\n\t\t * var synth = new Tone.MonoSynth().connect(crusher);\n\t\t */\n\t Tone.BitCrusher = function () {\n\t var options = Tone.defaults(arguments, ['bits'], Tone.BitCrusher);\n\t Tone.Effect.call(this, options);\n\t var invStepSize = 1 / Math.pow(2, options.bits - 1);\n\t /**\n\t\t\t * Subtract the input signal and the modulus of the input signal\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._subtract = new Tone.Subtract();\n\t /**\n\t\t\t * The mod function\n\t\t\t * @type {Tone.Modulo}\n\t\t\t * @private\n\t\t\t */\n\t this._modulo = new Tone.Modulo(invStepSize);\n\t /**\n\t\t\t * keeps track of the bits\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._bits = options.bits;\n\t //connect it up\n\t this.effectSend.fan(this._subtract, this._modulo);\n\t this._modulo.connect(this._subtract, 0, 1);\n\t this._subtract.connect(this.effectReturn);\n\t };\n\t Tone.extend(Tone.BitCrusher, Tone.Effect);\n\t /**\n\t\t * the default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.BitCrusher.defaults = { 'bits': 4 };\n\t /**\n\t\t * The bit depth of the effect. Nominal range of 1-8.\n\t\t * @memberOf Tone.BitCrusher#\n\t\t * @type {number}\n\t\t * @name bits\n\t\t */\n\t Object.defineProperty(Tone.BitCrusher.prototype, 'bits', {\n\t get: function () {\n\t return this._bits;\n\t },\n\t set: function (bits) {\n\t this._bits = bits;\n\t var invStepSize = 1 / Math.pow(2, bits - 1);\n\t this._modulo.value = invStepSize;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.BitCrusher} this\n\t\t */\n\t Tone.BitCrusher.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._subtract.dispose();\n\t this._subtract = null;\n\t this._modulo.dispose();\n\t this._modulo = null;\n\t return this;\n\t };\n\t return Tone.BitCrusher;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.ChebyShev is a Chebyshev waveshaper, an effect which is good \n\t\t * for making different types of distortion sounds.\n\t\t * Note that odd orders sound very different from even ones, \n\t\t * and order = 1 is no change. \n\t\t * Read more at [music.columbia.edu](http://music.columbia.edu/cmc/musicandcomputers/chapter4/04_06.php).\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {Positive|Object} [order] The order of the chebyshev polynomial. Normal range between 1-100. \n\t\t * @example\n\t\t * //create a new cheby\n\t\t * var cheby = new Tone.Chebyshev(50);\n\t\t * //create a monosynth connected to our cheby\n\t\t * synth = new Tone.MonoSynth().connect(cheby);\n\t\t */\n\t Tone.Chebyshev = function () {\n\t var options = Tone.defaults(arguments, ['order'], Tone.Chebyshev);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._shaper = new Tone.WaveShaper(4096);\n\t /**\n\t\t\t * holds onto the order of the filter\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._order = options.order;\n\t this.connectEffect(this._shaper);\n\t this.order = options.order;\n\t this.oversample = options.oversample;\n\t };\n\t Tone.extend(Tone.Chebyshev, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Chebyshev.defaults = {\n\t 'order': 1,\n\t 'oversample': 'none'\n\t };\n\t /**\n\t\t * get the coefficient for that degree\n\t\t * @param {number} x the x value\n\t\t * @param {number} degree \n\t\t * @param {Object} memo memoize the computed value. \n\t\t * this speeds up computation greatly. \n\t\t * @return {number} the coefficient \n\t\t * @private\n\t\t */\n\t Tone.Chebyshev.prototype._getCoefficient = function (x, degree, memo) {\n\t if (memo.hasOwnProperty(degree)) {\n\t return memo[degree];\n\t } else if (degree === 0) {\n\t memo[degree] = 0;\n\t } else if (degree === 1) {\n\t memo[degree] = x;\n\t } else {\n\t memo[degree] = 2 * x * this._getCoefficient(x, degree - 1, memo) - this._getCoefficient(x, degree - 2, memo);\n\t }\n\t return memo[degree];\n\t };\n\t /**\n\t\t * The order of the Chebyshev polynomial which creates\n\t\t * the equation which is applied to the incoming \n\t\t * signal through a Tone.WaveShaper. The equations\n\t\t * are in the form:<br>\n\t\t * order 2: 2x^2 + 1<br>\n\t\t * order 3: 4x^3 + 3x <br>\n\t\t * @memberOf Tone.Chebyshev#\n\t\t * @type {Positive}\n\t\t * @name order\n\t\t */\n\t Object.defineProperty(Tone.Chebyshev.prototype, 'order', {\n\t get: function () {\n\t return this._order;\n\t },\n\t set: function (order) {\n\t this._order = order;\n\t var curve = new Array(4096);\n\t var len = curve.length;\n\t for (var i = 0; i < len; ++i) {\n\t var x = i * 2 / len - 1;\n\t if (x === 0) {\n\t //should output 0 when input is 0\n\t curve[i] = 0;\n\t } else {\n\t curve[i] = this._getCoefficient(x, order, {});\n\t }\n\t }\n\t this._shaper.curve = curve;\n\t }\n\t });\n\t /**\n\t\t * The oversampling of the effect. Can either be \"none\", \"2x\" or \"4x\".\n\t\t * @memberOf Tone.Chebyshev#\n\t\t * @type {string}\n\t\t * @name oversample\n\t\t */\n\t Object.defineProperty(Tone.Chebyshev.prototype, 'oversample', {\n\t get: function () {\n\t return this._shaper.oversample;\n\t },\n\t set: function (oversampling) {\n\t this._shaper.oversample = oversampling;\n\t }\n\t });\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.Chebyshev} this\n\t\t */\n\t Tone.Chebyshev.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._shaper.dispose();\n\t this._shaper = null;\n\t return this;\n\t };\n\t return Tone.Chebyshev;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for Stereo effects. Provides effectSendL/R and effectReturnL/R.\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.Effect}\n\t\t */\n\t Tone.StereoEffect = function () {\n\t //get the defaults\n\t Tone.AudioNode.call(this);\n\t var options = Tone.defaults(arguments, ['wet'], Tone.Effect);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the drywet knob to control the amount of effect\n\t\t\t * @type {Tone.CrossFade}\n\t\t\t * @private\n\t\t\t */\n\t this._dryWet = new Tone.CrossFade(options.wet);\n\t /**\n\t\t\t * The wet control, i.e. how much of the effected\n\t\t\t * will pass through to the output.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.wet = this._dryWet.fade;\n\t /**\n\t\t\t * then split it\n\t\t\t * @type {Tone.Split}\n\t\t\t * @private\n\t\t\t */\n\t this._split = new Tone.Split();\n\t /**\n\t\t\t * the effects send LEFT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectSendL = this._split.left;\n\t /**\n\t\t\t * the effects send RIGHT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectSendR = this._split.right;\n\t /**\n\t\t\t * the stereo effect merger\n\t\t\t * @type {Tone.Merge}\n\t\t\t * @private\n\t\t\t */\n\t this._merge = new Tone.Merge();\n\t /**\n\t\t\t * the effect return LEFT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectReturnL = this._merge.left;\n\t /**\n\t\t\t * the effect return RIGHT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectReturnR = this._merge.right;\n\t //connections\n\t this.input.connect(this._split);\n\t //dry wet connections\n\t this.input.connect(this._dryWet, 0, 0);\n\t this._merge.connect(this._dryWet, 0, 1);\n\t this._dryWet.connect(this.output);\n\t this._readOnly(['wet']);\n\t };\n\t Tone.extend(Tone.StereoEffect, Tone.Effect);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.StereoEffect} this\n\t\t */\n\t Tone.StereoEffect.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._dryWet.dispose();\n\t this._dryWet = null;\n\t this._split.dispose();\n\t this._split = null;\n\t this._merge.dispose();\n\t this._merge = null;\n\t this.effectSendL = null;\n\t this.effectSendR = null;\n\t this.effectReturnL = null;\n\t this.effectReturnR = null;\n\t this._writable(['wet']);\n\t this.wet = null;\n\t return this;\n\t };\n\t return Tone.StereoEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Chorus is a stereo chorus effect composed of\n\t\t * a left and right delay with a Tone.LFO applied to the delayTime of each channel.\n\t\t * Inspiration from [Tuna.js](https://github.com/Dinahmoe/tuna/blob/master/tuna.js).\n\t\t * Read more on the chorus effect on [SoundOnSound](http://www.soundonsound.com/sos/jun04/articles/synthsecrets.htm).\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t *\t@param {Frequency|Object} [frequency] The frequency of the LFO.\n\t\t *\t@param {Milliseconds} [delayTime] The delay of the chorus effect in ms.\n\t\t *\t@param {NormalRange} [depth] The depth of the chorus.\n\t\t *\t@example\n\t\t * var chorus = new Tone.Chorus(4, 2.5, 0.5);\n\t\t * var synth = new Tone.PolySynth(4, Tone.MonoSynth).connect(chorus);\n\t\t * synth.triggerAttackRelease([\"C3\",\"E3\",\"G3\"], \"8n\");\n\t\t */\n\t Tone.Chorus = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'delayTime',\n\t 'depth'\n\t ], Tone.Chorus);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * the depth of the chorus\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._depth = options.depth;\n\t /**\n\t\t\t * the delayTime\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._delayTime = options.delayTime / 1000;\n\t /**\n\t\t\t * the lfo which controls the delayTime\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoL = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'min': 0,\n\t 'max': 1\n\t });\n\t /**\n\t\t\t * another LFO for the right side with a 180 degree phase diff\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoR = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'min': 0,\n\t 'max': 1,\n\t 'phase': 180\n\t });\n\t /**\n\t\t\t * delay for left\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNodeL = new Tone.Delay();\n\t /**\n\t\t\t * delay for right\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNodeR = new Tone.Delay();\n\t /**\n\t\t\t * The frequency of the LFO which modulates the delayTime.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfoL.frequency;\n\t //connections\n\t this.effectSendL.chain(this._delayNodeL, this.effectReturnL);\n\t this.effectSendR.chain(this._delayNodeR, this.effectReturnR);\n\t //and pass through to make the detune apparent\n\t this.effectSendL.connect(this.effectReturnL);\n\t this.effectSendR.connect(this.effectReturnR);\n\t //lfo setup\n\t this._lfoL.connect(this._delayNodeL.delayTime);\n\t this._lfoR.connect(this._delayNodeR.delayTime);\n\t //start the lfo\n\t this._lfoL.start();\n\t this._lfoR.start();\n\t //have one LFO frequency control the other\n\t this._lfoL.frequency.connect(this._lfoR.frequency);\n\t //set the initial values\n\t this.depth = this._depth;\n\t this.frequency.value = options.frequency;\n\t this.type = options.type;\n\t this._readOnly(['frequency']);\n\t this.spread = options.spread;\n\t };\n\t Tone.extend(Tone.Chorus, Tone.StereoEffect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Chorus.defaults = {\n\t 'frequency': 1.5,\n\t 'delayTime': 3.5,\n\t 'depth': 0.7,\n\t 'type': 'sine',\n\t 'spread': 180\n\t };\n\t /**\n\t\t * The depth of the effect. A depth of 1 makes the delayTime\n\t\t * modulate between 0 and 2*delayTime (centered around the delayTime).\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {NormalRange}\n\t\t * @name depth\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'depth', {\n\t get: function () {\n\t return this._depth;\n\t },\n\t set: function (depth) {\n\t this._depth = depth;\n\t var deviation = this._delayTime * depth;\n\t this._lfoL.min = Math.max(this._delayTime - deviation, 0);\n\t this._lfoL.max = this._delayTime + deviation;\n\t this._lfoR.min = Math.max(this._delayTime - deviation, 0);\n\t this._lfoR.max = this._delayTime + deviation;\n\t }\n\t });\n\t /**\n\t\t * The delayTime in milliseconds of the chorus. A larger delayTime\n\t\t * will give a more pronounced effect. Nominal range a delayTime\n\t\t * is between 2 and 20ms.\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {Milliseconds}\n\t\t * @name delayTime\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'delayTime', {\n\t get: function () {\n\t return this._delayTime * 1000;\n\t },\n\t set: function (delayTime) {\n\t this._delayTime = delayTime / 1000;\n\t this.depth = this._depth;\n\t }\n\t });\n\t /**\n\t\t * The oscillator type of the LFO.\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'type', {\n\t get: function () {\n\t return this._lfoL.type;\n\t },\n\t set: function (type) {\n\t this._lfoL.type = type;\n\t this._lfoR.type = type;\n\t }\n\t });\n\t /**\n\t\t * Amount of stereo spread. When set to 0, both LFO's will be panned centrally.\n\t\t * When set to 180, LFO's will be panned hard left and right respectively.\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {Degrees}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'spread', {\n\t get: function () {\n\t return this._lfoR.phase - this._lfoL.phase;\n\t },\n\t set: function (spread) {\n\t this._lfoL.phase = 90 - spread / 2;\n\t this._lfoR.phase = spread / 2 + 90;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Chorus} this\n\t\t */\n\t Tone.Chorus.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._lfoL.dispose();\n\t this._lfoL = null;\n\t this._lfoR.dispose();\n\t this._lfoR = null;\n\t this._delayNodeL.dispose();\n\t this._delayNodeL = null;\n\t this._delayNodeR.dispose();\n\t this._delayNodeR = null;\n\t this._writable('frequency');\n\t this.frequency = null;\n\t return this;\n\t };\n\t return Tone.Chorus;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Convolver is a wrapper around the Native Web Audio\n\t\t * [ConvolverNode](http://webaudio.github.io/web-audio-api/#the-convolvernode-interface).\n\t\t * Convolution is useful for reverb and filter emulation. Read more about convolution reverb on\n\t\t * [Wikipedia](https://en.wikipedia.org/wiki/Convolution_reverb).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {string|Tone.Buffer|Object} [url] The URL of the impulse response or the Tone.Buffer\n\t\t * contianing the impulse response.\n\t\t * @param {Function=} onload The callback to invoke when the url is loaded.\n\t\t * @example\n\t\t * //initializing the convolver with an impulse response\n\t\t * var convolver = new Tone.Convolver(\"./path/to/ir.wav\").toMaster();\n\t\t */\n\t Tone.Convolver = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload'\n\t ], Tone.Convolver);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * convolver node\n\t\t\t * @type {ConvolverNode}\n\t\t\t * @private\n\t\t\t */\n\t this._convolver = this.context.createConvolver();\n\t /**\n\t\t\t * the convolution buffer\n\t\t\t * @type {Tone.Buffer}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = new Tone.Buffer(options.url, function (buffer) {\n\t this._convolver.buffer = buffer.get();\n\t options.onload();\n\t }.bind(this));\n\t this.connectEffect(this._convolver);\n\t };\n\t Tone.extend(Tone.Convolver, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Convolver.defaults = { 'onload': Tone.noOp };\n\t /**\n\t\t * The convolver's buffer\n\t\t * @memberOf Tone.Convolver#\n\t\t * @type {AudioBuffer}\n\t\t * @name buffer\n\t\t */\n\t Object.defineProperty(Tone.Convolver.prototype, 'buffer', {\n\t get: function () {\n\t return this._buffer.get();\n\t },\n\t set: function (buffer) {\n\t this._buffer.set(buffer);\n\t this._convolver.buffer = this._buffer.get();\n\t }\n\t });\n\t /**\n\t\t * Load an impulse response url as an audio buffer.\n\t\t * Decodes the audio asynchronously and invokes\n\t\t * the callback once the audio buffer loads.\n\t\t * @param {string} url The url of the buffer to load.\n\t\t * filetype support depends on the\n\t\t * browser.\n\t\t * @param {function=} callback\n\t\t * @returns {Promise}\n\t\t */\n\t Tone.Convolver.prototype.load = function (url, callback) {\n\t return this._buffer.load(url, function (buff) {\n\t this.buffer = buff;\n\t if (callback) {\n\t callback();\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Convolver} this\n\t\t */\n\t Tone.Convolver.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._convolver.disconnect();\n\t this._convolver = null;\n\t this._buffer.dispose();\n\t this._buffer = null;\n\t return this;\n\t };\n\t return Tone.Convolver;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Distortion is a simple distortion effect using Tone.WaveShaper.\n\t\t * Algorithm from [a stackoverflow answer](http://stackoverflow.com/a/22313408).\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {Number|Object} [distortion] The amount of distortion (nominal range of 0-1)\n\t\t * @example\n\t\t * var dist = new Tone.Distortion(0.8).toMaster();\n\t\t * var fm = new Tone.SimpleFM().connect(dist);\n\t\t * //this sounds good on bass notes\n\t\t * fm.triggerAttackRelease(\"A1\", \"8n\");\n\t\t */\n\t Tone.Distortion = function () {\n\t var options = Tone.defaults(arguments, ['distortion'], Tone.Distortion);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._shaper = new Tone.WaveShaper(4096);\n\t /**\n\t\t\t * holds the distortion amount\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._distortion = options.distortion;\n\t this.connectEffect(this._shaper);\n\t this.distortion = options.distortion;\n\t this.oversample = options.oversample;\n\t };\n\t Tone.extend(Tone.Distortion, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Distortion.defaults = {\n\t 'distortion': 0.4,\n\t 'oversample': 'none'\n\t };\n\t /**\n\t\t * The amount of distortion.\n\t\t * @memberOf Tone.Distortion#\n\t\t * @type {NormalRange}\n\t\t * @name distortion\n\t\t */\n\t Object.defineProperty(Tone.Distortion.prototype, 'distortion', {\n\t get: function () {\n\t return this._distortion;\n\t },\n\t set: function (amount) {\n\t this._distortion = amount;\n\t var k = amount * 100;\n\t var deg = Math.PI / 180;\n\t this._shaper.setMap(function (x) {\n\t if (Math.abs(x) < 0.001) {\n\t //should output 0 when input is 0\n\t return 0;\n\t } else {\n\t return (3 + k) * x * 20 * deg / (Math.PI + k * Math.abs(x));\n\t }\n\t });\n\t }\n\t });\n\t /**\n\t\t * The oversampling of the effect. Can either be \"none\", \"2x\" or \"4x\".\n\t\t * @memberOf Tone.Distortion#\n\t\t * @type {string}\n\t\t * @name oversample\n\t\t */\n\t Object.defineProperty(Tone.Distortion.prototype, 'oversample', {\n\t get: function () {\n\t return this._shaper.oversample;\n\t },\n\t set: function (oversampling) {\n\t this._shaper.oversample = oversampling;\n\t }\n\t });\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.Distortion} this\n\t\t */\n\t Tone.Distortion.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._shaper.dispose();\n\t this._shaper = null;\n\t return this;\n\t };\n\t return Tone.Distortion;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * \t@class Tone.FeedbackEffect provides a loop between an \n\t\t * \t audio source and its own output. This is a base-class\n\t\t * \t for feedback effects. \n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {NormalRange|Object} [feedback] The initial feedback value.\n\t\t */\n\t Tone.FeedbackEffect = function () {\n\t var options = Tone.defaults(arguments, ['feedback'], Tone.FeedbackEffect);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * the gain which controls the feedback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackGain = new Tone.Gain(options.feedback, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of signal which is fed back into the effect input. \n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.feedback = this._feedbackGain.gain;\n\t //the feedback loop\n\t this.effectReturn.chain(this._feedbackGain, this.effectSend);\n\t this._readOnly(['feedback']);\n\t };\n\t Tone.extend(Tone.FeedbackEffect, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.FeedbackEffect.defaults = { 'feedback': 0.125 };\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.FeedbackEffect} this\n\t\t */\n\t Tone.FeedbackEffect.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._writable(['feedback']);\n\t this._feedbackGain.dispose();\n\t this._feedbackGain = null;\n\t this.feedback = null;\n\t return this;\n\t };\n\t return Tone.FeedbackEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FeedbackDelay is a DelayNode in which part of output\n\t\t * signal is fed back into the delay.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.FeedbackEffect}\n\t\t * @param {Time|Object} [delayTime] The delay applied to the incoming signal.\n\t\t * @param {NormalRange=} feedback The amount of the effected signal which\n\t\t * is fed back through the delay.\n\t\t * @example\n\t\t * var feedbackDelay = new Tone.FeedbackDelay(\"8n\", 0.5).toMaster();\n\t\t * var tom = new Tone.DrumSynth({\n\t\t * \t\"octaves\" : 4,\n\t\t * \t\"pitchDecay\" : 0.1\n\t\t * }).connect(feedbackDelay);\n\t\t * tom.triggerAttackRelease(\"A2\",\"32n\");\n\t\t */\n\t Tone.FeedbackDelay = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'feedback'\n\t ], Tone.FeedbackDelay);\n\t Tone.FeedbackEffect.call(this, options);\n\t /**\n\t\t\t * the delay node\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNode = new Tone.Delay(options.delayTime, options.maxDelay);\n\t /**\n\t\t\t * The delayTime of the DelayNode.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._delayNode.delayTime;\n\t // connect it up\n\t this.connectEffect(this._delayNode);\n\t this._readOnly(['delayTime']);\n\t };\n\t Tone.extend(Tone.FeedbackDelay, Tone.FeedbackEffect);\n\t /**\n\t\t * The default values.\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.FeedbackDelay.defaults = {\n\t 'delayTime': 0.25,\n\t 'maxDelay': 1\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FeedbackDelay} this\n\t\t */\n\t Tone.FeedbackDelay.prototype.dispose = function () {\n\t Tone.FeedbackEffect.prototype.dispose.call(this);\n\t this._delayNode.dispose();\n\t this._delayNode = null;\n\t this._writable(['delayTime']);\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.FeedbackDelay;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * an array of comb filter delay values from Freeverb implementation\n\t\t * @static\n\t\t * @private\n\t\t * @type {Array}\n\t\t */\n\t var combFilterTunings = [\n\t 1557 / 44100,\n\t 1617 / 44100,\n\t 1491 / 44100,\n\t 1422 / 44100,\n\t 1277 / 44100,\n\t 1356 / 44100,\n\t 1188 / 44100,\n\t 1116 / 44100\n\t ];\n\t /**\n\t\t * an array of allpass filter frequency values from Freeverb implementation\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var allpassFilterFrequencies = [\n\t 225,\n\t 556,\n\t 441,\n\t 341\n\t ];\n\t /**\n\t\t * @class Tone.Freeverb is a reverb based on [Freeverb](https://ccrma.stanford.edu/~jos/pasp/Freeverb.html).\n\t\t * Read more on reverb on [Sound On Sound](https://web.archive.org/web/20160404083902/http://www.soundonsound.com:80/sos/feb01/articles/synthsecrets.asp).\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {NormalRange|Object} [roomSize] Correlated to the decay time.\n\t\t * @param {Frequency} [dampening] The cutoff frequency of a lowpass filter as part\n\t\t * of the reverb.\n\t\t * @example\n\t\t * var freeverb = new Tone.Freeverb().toMaster();\n\t\t * freeverb.dampening.value = 1000;\n\t\t * //routing synth through the reverb\n\t\t * var synth = new Tone.AMSynth().connect(freeverb);\n\t\t */\n\t Tone.Freeverb = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'roomSize',\n\t 'dampening'\n\t ], Tone.Freeverb);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * The roomSize value between. A larger roomSize\n\t\t\t * will result in a longer decay.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.roomSize = new Tone.Signal(options.roomSize, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of dampening of the reverberant signal.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.dampening = new Tone.Signal(options.dampening, Tone.Type.Frequency);\n\t /**\n\t\t\t * the comb filters\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._combFilters = [];\n\t /**\n\t\t\t * the allpass filters on the left\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._allpassFiltersL = [];\n\t /**\n\t\t\t * the allpass filters on the right\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._allpassFiltersR = [];\n\t //make the allpass filters on the right\n\t for (var l = 0; l < allpassFilterFrequencies.length; l++) {\n\t var allpassL = this.context.createBiquadFilter();\n\t allpassL.type = 'allpass';\n\t allpassL.frequency.value = allpassFilterFrequencies[l];\n\t this._allpassFiltersL.push(allpassL);\n\t }\n\t //make the allpass filters on the left\n\t for (var r = 0; r < allpassFilterFrequencies.length; r++) {\n\t var allpassR = this.context.createBiquadFilter();\n\t allpassR.type = 'allpass';\n\t allpassR.frequency.value = allpassFilterFrequencies[r];\n\t this._allpassFiltersR.push(allpassR);\n\t }\n\t //make the comb filters\n\t for (var c = 0; c < combFilterTunings.length; c++) {\n\t var lfpf = new Tone.LowpassCombFilter(combFilterTunings[c]);\n\t if (c < combFilterTunings.length / 2) {\n\t this.effectSendL.chain(lfpf, this._allpassFiltersL[0]);\n\t } else {\n\t this.effectSendR.chain(lfpf, this._allpassFiltersR[0]);\n\t }\n\t this.roomSize.connect(lfpf.resonance);\n\t this.dampening.connect(lfpf.dampening);\n\t this._combFilters.push(lfpf);\n\t }\n\t //chain the allpass filters togetehr\n\t Tone.connectSeries.apply(Tone, this._allpassFiltersL);\n\t Tone.connectSeries.apply(Tone, this._allpassFiltersR);\n\t this._allpassFiltersL[this._allpassFiltersL.length - 1].connect(this.effectReturnL);\n\t this._allpassFiltersR[this._allpassFiltersR.length - 1].connect(this.effectReturnR);\n\t this._readOnly([\n\t 'roomSize',\n\t 'dampening'\n\t ]);\n\t };\n\t Tone.extend(Tone.Freeverb, Tone.StereoEffect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Freeverb.defaults = {\n\t 'roomSize': 0.7,\n\t 'dampening': 3000\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Freeverb} this\n\t\t */\n\t Tone.Freeverb.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t for (var al = 0; al < this._allpassFiltersL.length; al++) {\n\t this._allpassFiltersL[al].disconnect();\n\t this._allpassFiltersL[al] = null;\n\t }\n\t this._allpassFiltersL = null;\n\t for (var ar = 0; ar < this._allpassFiltersR.length; ar++) {\n\t this._allpassFiltersR[ar].disconnect();\n\t this._allpassFiltersR[ar] = null;\n\t }\n\t this._allpassFiltersR = null;\n\t for (var cf = 0; cf < this._combFilters.length; cf++) {\n\t this._combFilters[cf].dispose();\n\t this._combFilters[cf] = null;\n\t }\n\t this._combFilters = null;\n\t this._writable([\n\t 'roomSize',\n\t 'dampening'\n\t ]);\n\t this.roomSize.dispose();\n\t this.roomSize = null;\n\t this.dampening.dispose();\n\t this.dampening = null;\n\t return this;\n\t };\n\t return Tone.Freeverb;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * an array of the comb filter delay time values\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var combFilterDelayTimes = [\n\t 1687 / 25000,\n\t 1601 / 25000,\n\t 2053 / 25000,\n\t 2251 / 25000\n\t ];\n\t /**\n\t\t * the resonances of each of the comb filters\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var combFilterResonances = [\n\t 0.773,\n\t 0.802,\n\t 0.753,\n\t 0.733\n\t ];\n\t /**\n\t\t * the allpass filter frequencies\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var allpassFilterFreqs = [\n\t 347,\n\t 113,\n\t 37\n\t ];\n\t /**\n\t\t * @class Tone.JCReverb is a simple [Schroeder Reverberator](https://ccrma.stanford.edu/~jos/pasp/Schroeder_Reverberators.html)\n\t\t * tuned by John Chowning in 1970.\n\t\t * It is made up of three allpass filters and four Tone.FeedbackCombFilter.\n\t\t *\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {NormalRange|Object} [roomSize] Coorelates to the decay time.\n\t\t * @example\n\t\t * var reverb = new Tone.JCReverb(0.4).connect(Tone.Master);\n\t\t * var delay = new Tone.FeedbackDelay(0.5);\n\t\t * //connecting the synth to reverb through delay\n\t\t * var synth = new Tone.DuoSynth().chain(delay, reverb);\n\t\t * synth.triggerAttackRelease(\"A4\",\"8n\");\n\t\t */\n\t Tone.JCReverb = function () {\n\t var options = Tone.defaults(arguments, ['roomSize'], Tone.JCReverb);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * room size control values between [0,1]\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.roomSize = new Tone.Signal(options.roomSize, Tone.Type.NormalRange);\n\t /**\n\t\t\t * scale the room size\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._scaleRoomSize = new Tone.Scale(-0.733, 0.197);\n\t /**\n\t\t\t * a series of allpass filters\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._allpassFilters = [];\n\t /**\n\t\t\t * parallel feedback comb filters\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackCombFilters = [];\n\t //make the allpass filters\n\t for (var af = 0; af < allpassFilterFreqs.length; af++) {\n\t var allpass = this.context.createBiquadFilter();\n\t allpass.type = 'allpass';\n\t allpass.frequency.value = allpassFilterFreqs[af];\n\t this._allpassFilters.push(allpass);\n\t }\n\t //and the comb filters\n\t for (var cf = 0; cf < combFilterDelayTimes.length; cf++) {\n\t var fbcf = new Tone.FeedbackCombFilter(combFilterDelayTimes[cf], 0.1);\n\t this._scaleRoomSize.connect(fbcf.resonance);\n\t fbcf.resonance.value = combFilterResonances[cf];\n\t this._allpassFilters[this._allpassFilters.length - 1].connect(fbcf);\n\t if (cf < combFilterDelayTimes.length / 2) {\n\t fbcf.connect(this.effectReturnL);\n\t } else {\n\t fbcf.connect(this.effectReturnR);\n\t }\n\t this._feedbackCombFilters.push(fbcf);\n\t }\n\t //chain the allpass filters together\n\t this.roomSize.connect(this._scaleRoomSize);\n\t Tone.connectSeries.apply(Tone, this._allpassFilters);\n\t this.effectSendL.connect(this._allpassFilters[0]);\n\t this.effectSendR.connect(this._allpassFilters[0]);\n\t this._readOnly(['roomSize']);\n\t };\n\t Tone.extend(Tone.JCReverb, Tone.StereoEffect);\n\t /**\n\t\t * the default values\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.JCReverb.defaults = { 'roomSize': 0.5 };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.JCReverb} this\n\t\t */\n\t Tone.JCReverb.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t for (var apf = 0; apf < this._allpassFilters.length; apf++) {\n\t this._allpassFilters[apf].disconnect();\n\t this._allpassFilters[apf] = null;\n\t }\n\t this._allpassFilters = null;\n\t for (var fbcf = 0; fbcf < this._feedbackCombFilters.length; fbcf++) {\n\t this._feedbackCombFilters[fbcf].dispose();\n\t this._feedbackCombFilters[fbcf] = null;\n\t }\n\t this._feedbackCombFilters = null;\n\t this._writable(['roomSize']);\n\t this.roomSize.dispose();\n\t this.roomSize = null;\n\t this._scaleRoomSize.dispose();\n\t this._scaleRoomSize = null;\n\t return this;\n\t };\n\t return Tone.JCReverb;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Mid/Side processing separates the the 'mid' signal\n\t\t * (which comes out of both the left and the right channel)\n\t\t * and the 'side' (which only comes out of the the side channels)\n\t\t * and effects them separately before being recombined.\n\t\t * Applies a Mid/Side seperation and recombination.\n\t\t * Algorithm found in [kvraudio forums](http://www.kvraudio.com/forum/viewtopic.php?t=212587).\n\t\t * <br><br>\n\t\t * This is a base-class for Mid/Side Effects.\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideEffect = function () {\n\t Tone.Effect.apply(this, arguments);\n\t /**\n\t\t\t * The mid/side split\n\t\t\t * @type {Tone.MidSideSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideSplit = new Tone.MidSideSplit();\n\t /**\n\t\t\t * The mid/side merge\n\t\t\t * @type {Tone.MidSideMerge}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideMerge = new Tone.MidSideMerge();\n\t /**\n\t\t\t * The mid send. Connect to mid processing\n\t\t\t * @type {Tone}\n\t\t\t * @private\n\t\t\t */\n\t this.midSend = this._midSideSplit.mid;\n\t /**\n\t\t\t * The side send. Connect to side processing\n\t\t\t * @type {Tone}\n\t\t\t * @private\n\t\t\t */\n\t this.sideSend = this._midSideSplit.side;\n\t /**\n\t\t\t * The mid return connection\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.midReturn = this._midSideMerge.mid;\n\t /**\n\t\t\t * The side return connection\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.sideReturn = this._midSideMerge.side;\n\t //the connections\n\t this.effectSend.connect(this._midSideSplit);\n\t this._midSideMerge.connect(this.effectReturn);\n\t };\n\t Tone.extend(Tone.MidSideEffect, Tone.Effect);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MidSideEffect} this\n\t\t */\n\t Tone.MidSideEffect.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._midSideSplit.dispose();\n\t this._midSideSplit = null;\n\t this._midSideMerge.dispose();\n\t this._midSideMerge = null;\n\t this.midSend = null;\n\t this.sideSend = null;\n\t this.midReturn = null;\n\t this.sideReturn = null;\n\t return this;\n\t };\n\t return Tone.MidSideEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Phaser is a phaser effect. Phasers work by changing the phase\n\t\t * of different frequency components of an incoming signal. Read more on\n\t\t * [Wikipedia](https://en.wikipedia.org/wiki/Phaser_(effect)).\n\t\t * Inspiration for this phaser comes from [Tuna.js](https://github.com/Dinahmoe/tuna/).\n\t\t *\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t *\t@constructor\n\t\t *\t@param {Frequency|Object} [frequency] The speed of the phasing.\n\t\t *\t@param {number} [octaves] The octaves of the effect.\n\t\t *\t@param {Frequency} [baseFrequency] The base frequency of the filters.\n\t\t *\t@example\n\t\t * var phaser = new Tone.Phaser({\n\t\t * \t\"frequency\" : 15,\n\t\t * \t\"octaves\" : 5,\n\t\t * \t\"baseFrequency\" : 1000\n\t\t * }).toMaster();\n\t\t * var synth = new Tone.FMSynth().connect(phaser);\n\t\t * synth.triggerAttackRelease(\"E3\", \"2n\");\n\t\t */\n\t Tone.Phaser = function () {\n\t //set the defaults\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'octaves',\n\t 'baseFrequency'\n\t ], Tone.Phaser);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * the lfo which controls the frequency on the left side\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoL = new Tone.LFO(options.frequency, 0, 1);\n\t /**\n\t\t\t * the lfo which controls the frequency on the right side\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoR = new Tone.LFO(options.frequency, 0, 1);\n\t this._lfoR.phase = 180;\n\t /**\n\t\t\t * the base modulation frequency\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._baseFrequency = options.baseFrequency;\n\t /**\n\t\t\t * the octaves of the phasing\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t /**\n\t\t\t * The quality factor of the filters\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = new Tone.Signal(options.Q, Tone.Type.Positive);\n\t /**\n\t\t\t * the array of filters for the left side\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._filtersL = this._makeFilters(options.stages, this._lfoL, this.Q);\n\t /**\n\t\t\t * the array of filters for the left side\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._filtersR = this._makeFilters(options.stages, this._lfoR, this.Q);\n\t /**\n\t\t\t * the frequency of the effect\n\t\t\t * @type {Tone.Signal}\n\t\t\t */\n\t this.frequency = this._lfoL.frequency;\n\t this.frequency.value = options.frequency;\n\t //connect them up\n\t this.effectSendL.connect(this._filtersL[0]);\n\t this.effectSendR.connect(this._filtersR[0]);\n\t this._filtersL[options.stages - 1].connect(this.effectReturnL);\n\t this._filtersR[options.stages - 1].connect(this.effectReturnR);\n\t //control the frequency with one LFO\n\t this._lfoL.frequency.connect(this._lfoR.frequency);\n\t //set the options\n\t this.baseFrequency = options.baseFrequency;\n\t this.octaves = options.octaves;\n\t //start the lfo\n\t this._lfoL.start();\n\t this._lfoR.start();\n\t this._readOnly([\n\t 'frequency',\n\t 'Q'\n\t ]);\n\t };\n\t Tone.extend(Tone.Phaser, Tone.StereoEffect);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {object}\n\t\t */\n\t Tone.Phaser.defaults = {\n\t 'frequency': 0.5,\n\t 'octaves': 3,\n\t 'stages': 10,\n\t 'Q': 10,\n\t 'baseFrequency': 350\n\t };\n\t /**\n\t\t * @param {number} stages\n\t\t * @returns {Array} the number of filters all connected together\n\t\t * @private\n\t\t */\n\t Tone.Phaser.prototype._makeFilters = function (stages, connectToFreq, Q) {\n\t var filters = new Array(stages);\n\t //make all the filters\n\t for (var i = 0; i < stages; i++) {\n\t var filter = this.context.createBiquadFilter();\n\t filter.type = 'allpass';\n\t Q.connect(filter.Q);\n\t connectToFreq.connect(filter.frequency);\n\t filters[i] = filter;\n\t }\n\t Tone.connectSeries.apply(Tone, filters);\n\t return filters;\n\t };\n\t /**\n\t\t * The number of octaves the phase goes above\n\t\t * the baseFrequency\n\t\t * @memberOf Tone.Phaser#\n\t\t * @type {Positive}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.Phaser.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octaves) {\n\t this._octaves = octaves;\n\t var max = this._baseFrequency * Math.pow(2, octaves);\n\t this._lfoL.max = max;\n\t this._lfoR.max = max;\n\t }\n\t });\n\t /**\n\t\t * The the base frequency of the filters.\n\t\t * @memberOf Tone.Phaser#\n\t\t * @type {number}\n\t\t * @name baseFrequency\n\t\t */\n\t Object.defineProperty(Tone.Phaser.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._baseFrequency;\n\t },\n\t set: function (freq) {\n\t this._baseFrequency = freq;\n\t this._lfoL.min = freq;\n\t this._lfoR.min = freq;\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Phaser} this\n\t\t */\n\t Tone.Phaser.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'Q'\n\t ]);\n\t this.Q.dispose();\n\t this.Q = null;\n\t this._lfoL.dispose();\n\t this._lfoL = null;\n\t this._lfoR.dispose();\n\t this._lfoR = null;\n\t for (var i = 0; i < this._filtersL.length; i++) {\n\t this._filtersL[i].disconnect();\n\t this._filtersL[i] = null;\n\t }\n\t this._filtersL = null;\n\t for (var j = 0; j < this._filtersR.length; j++) {\n\t this._filtersR[j].disconnect();\n\t this._filtersR[j] = null;\n\t }\n\t this._filtersR = null;\n\t this.frequency = null;\n\t return this;\n\t };\n\t return Tone.Phaser;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Just like a stereo feedback effect, but the feedback is routed from left to right\n\t\t * and right to left instead of on the same channel.\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t */\n\t Tone.StereoXFeedbackEffect = function () {\n\t var options = Tone.defaults(arguments, ['feedback'], Tone.FeedbackEffect);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * The amount of feedback from the output\n\t\t\t * back into the input of the effect (routed\n\t\t\t * across left and right channels).\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.feedback = new Tone.Signal(options.feedback, Tone.Type.NormalRange);\n\t /**\n\t\t\t * the left side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackLR = new Tone.Gain();\n\t /**\n\t\t\t * the right side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackRL = new Tone.Gain();\n\t //connect it up\n\t this.effectReturnL.chain(this._feedbackLR, this.effectSendR);\n\t this.effectReturnR.chain(this._feedbackRL, this.effectSendL);\n\t this.feedback.fan(this._feedbackLR.gain, this._feedbackRL.gain);\n\t this._readOnly(['feedback']);\n\t };\n\t Tone.extend(Tone.StereoXFeedbackEffect, Tone.StereoEffect);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.StereoXFeedbackEffect} this\n\t\t */\n\t Tone.StereoXFeedbackEffect.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable(['feedback']);\n\t this.feedback.dispose();\n\t this.feedback = null;\n\t this._feedbackLR.dispose();\n\t this._feedbackLR = null;\n\t this._feedbackRL.dispose();\n\t this._feedbackRL = null;\n\t return this;\n\t };\n\t return Tone.StereoXFeedbackEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PingPongDelay is a feedback delay effect where the echo is heard\n\t\t * first in one channel and next in the opposite channel. In a stereo\n\t\t * system these are the right and left channels.\n\t\t * PingPongDelay in more simplified terms is two Tone.FeedbackDelays\n\t\t * with independent delay values. Each delay is routed to one channel\n\t\t * (left or right), and the channel triggered second will always\n\t\t * trigger at the same interval after the first.\n\t\t *\n\t\t * \t@constructor\n\t\t * \t@extends {Tone.StereoXFeedbackEffect}\n\t\t * @param {Time|Object} [delayTime] The delayTime between consecutive echos.\n\t\t * @param {NormalRange=} feedback The amount of the effected signal which\n\t\t * is fed back through the delay.\n\t\t * @example\n\t\t * var pingPong = new Tone.PingPongDelay(\"4n\", 0.2).toMaster();\n\t\t * var drum = new Tone.DrumSynth().connect(pingPong);\n\t\t * drum.triggerAttackRelease(\"C4\", \"32n\");\n\t\t */\n\t Tone.PingPongDelay = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'feedback'\n\t ], Tone.PingPongDelay);\n\t Tone.StereoXFeedbackEffect.call(this, options);\n\t /**\n\t\t\t * the delay node on the left side\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._leftDelay = new Tone.Delay(0, options.maxDelayTime);\n\t /**\n\t\t\t * the delay node on the right side\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._rightDelay = new Tone.Delay(0, options.maxDelayTime);\n\t /**\n\t\t\t * the predelay on the right side\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._rightPreDelay = new Tone.Delay(0, options.maxDelayTime);\n\t /**\n\t\t\t * the delay time signal\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = new Tone.Signal(options.delayTime, Tone.Type.Time);\n\t //connect it up\n\t this.effectSendL.chain(this._leftDelay, this.effectReturnL);\n\t this.effectSendR.chain(this._rightPreDelay, this._rightDelay, this.effectReturnR);\n\t this.delayTime.fan(this._leftDelay.delayTime, this._rightDelay.delayTime, this._rightPreDelay.delayTime);\n\t //rearranged the feedback to be after the rightPreDelay\n\t this._feedbackLR.disconnect();\n\t this._feedbackLR.connect(this._rightDelay);\n\t this._readOnly(['delayTime']);\n\t };\n\t Tone.extend(Tone.PingPongDelay, Tone.StereoXFeedbackEffect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.PingPongDelay.defaults = {\n\t 'delayTime': 0.25,\n\t 'maxDelayTime': 1\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.PingPongDelay} this\n\t\t */\n\t Tone.PingPongDelay.prototype.dispose = function () {\n\t Tone.StereoXFeedbackEffect.prototype.dispose.call(this);\n\t this._leftDelay.dispose();\n\t this._leftDelay = null;\n\t this._rightDelay.dispose();\n\t this._rightDelay = null;\n\t this._rightPreDelay.dispose();\n\t this._rightPreDelay = null;\n\t this._writable(['delayTime']);\n\t this.delayTime.dispose();\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.PingPongDelay;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PitchShift does near-realtime pitch shifting to the incoming signal.\n\t\t * The effect is achieved by speeding up or slowing down the delayTime\n\t\t * of a DelayNode using a sawtooth wave.\n\t\t * Algorithm found in [this pdf](http://dsp-book.narod.ru/soundproc.pdf).\n\t\t * Additional reference by [Miller Pucket](http://msp.ucsd.edu/techniques/v0.11/book-html/node115.html).\n\t\t *\n\t\t * @extends {Tone.FeedbackEffect}\n\t\t * @param {Interval=} pitch The interval to transpose the incoming signal by.\n\t\t */\n\t Tone.PitchShift = function () {\n\t var options = Tone.defaults(arguments, ['pitch'], Tone.PitchShift);\n\t Tone.FeedbackEffect.call(this, options);\n\t /**\n\t\t\t * The pitch signal\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._frequency = new Tone.Signal(0);\n\t /**\n\t\t\t * Uses two DelayNodes to cover up the jump in\n\t\t\t * the sawtooth wave.\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delayA = new Tone.Delay(0, 1);\n\t /**\n\t\t\t * The first LFO.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoA = new Tone.LFO({\n\t 'min': 0,\n\t 'max': 0.1,\n\t 'type': 'sawtooth'\n\t }).connect(this._delayA.delayTime);\n\t /**\n\t\t\t * The second DelayNode\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delayB = new Tone.Delay(0, 1);\n\t /**\n\t\t\t * The first LFO.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoB = new Tone.LFO({\n\t 'min': 0,\n\t 'max': 0.1,\n\t 'type': 'sawtooth',\n\t 'phase': 180\n\t }).connect(this._delayB.delayTime);\n\t /**\n\t\t\t * Crossfade quickly between the two delay lines\n\t\t\t * to cover up the jump in the sawtooth wave\n\t\t\t * @type {Tone.CrossFade}\n\t\t\t * @private\n\t\t\t */\n\t this._crossFade = new Tone.CrossFade();\n\t /**\n\t\t\t * LFO which alternates between the two\n\t\t\t * delay lines to cover up the disparity in the\n\t\t\t * sawtooth wave.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._crossFadeLFO = new Tone.LFO({\n\t 'min': 0,\n\t 'max': 1,\n\t 'type': 'triangle',\n\t 'phase': 90\n\t }).connect(this._crossFade.fade);\n\t /**\n\t\t\t * The delay node\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackDelay = new Tone.Delay(options.delayTime);\n\t /**\n\t\t\t * The amount of delay on the input signal\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._feedbackDelay.delayTime;\n\t this._readOnly('delayTime');\n\t /**\n\t\t\t * Hold the current pitch\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._pitch = options.pitch;\n\t /**\n\t\t\t * Hold the current windowSize\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._windowSize = options.windowSize;\n\t //connect the two delay lines up\n\t this._delayA.connect(this._crossFade.a);\n\t this._delayB.connect(this._crossFade.b);\n\t //connect the frequency\n\t this._frequency.fan(this._lfoA.frequency, this._lfoB.frequency, this._crossFadeLFO.frequency);\n\t //route the input\n\t this.effectSend.fan(this._delayA, this._delayB);\n\t this._crossFade.chain(this._feedbackDelay, this.effectReturn);\n\t //start the LFOs at the same time\n\t var now = this.now();\n\t this._lfoA.start(now);\n\t this._lfoB.start(now);\n\t this._crossFadeLFO.start(now);\n\t //set the initial value\n\t this.windowSize = this._windowSize;\n\t };\n\t Tone.extend(Tone.PitchShift, Tone.FeedbackEffect);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.PitchShift.defaults = {\n\t 'pitch': 0,\n\t 'windowSize': 0.1,\n\t 'delayTime': 0,\n\t 'feedback': 0\n\t };\n\t /**\n\t\t * Repitch the incoming signal by some interval (measured\n\t\t * in semi-tones).\n\t\t * @memberOf Tone.PitchShift#\n\t\t * @type {Interval}\n\t\t * @name pitch\n\t\t * @example\n\t\t * pitchShift.pitch = -12; //down one octave\n\t\t * pitchShift.pitch = 7; //up a fifth\n\t\t */\n\t Object.defineProperty(Tone.PitchShift.prototype, 'pitch', {\n\t get: function () {\n\t return this._pitch;\n\t },\n\t set: function (interval) {\n\t this._pitch = interval;\n\t var factor = 0;\n\t if (interval < 0) {\n\t this._lfoA.min = 0;\n\t this._lfoA.max = this._windowSize;\n\t this._lfoB.min = 0;\n\t this._lfoB.max = this._windowSize;\n\t factor = Tone.intervalToFrequencyRatio(interval - 1) + 1;\n\t } else {\n\t this._lfoA.min = this._windowSize;\n\t this._lfoA.max = 0;\n\t this._lfoB.min = this._windowSize;\n\t this._lfoB.max = 0;\n\t factor = Tone.intervalToFrequencyRatio(interval) - 1;\n\t }\n\t this._frequency.value = factor * (1.2 / this._windowSize);\n\t }\n\t });\n\t /**\n\t\t * The window size corresponds roughly to the sample length in a looping sampler.\n\t\t * Smaller values are desirable for a less noticeable delay time of the pitch shifted\n\t\t * signal, but larger values will result in smoother pitch shifting for larger intervals.\n\t\t * A nominal range of 0.03 to 0.1 is recommended.\n\t\t * @memberOf Tone.PitchShift#\n\t\t * @type {Time}\n\t\t * @name windowSize\n\t\t * @example\n\t\t * pitchShift.windowSize = 0.1;\n\t\t */\n\t Object.defineProperty(Tone.PitchShift.prototype, 'windowSize', {\n\t get: function () {\n\t return this._windowSize;\n\t },\n\t set: function (size) {\n\t this._windowSize = this.toSeconds(size);\n\t this.pitch = this._pitch;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.PitchShift} this\n\t\t */\n\t Tone.PitchShift.prototype.dispose = function () {\n\t Tone.FeedbackEffect.prototype.dispose.call(this);\n\t this._frequency.dispose();\n\t this._frequency = null;\n\t this._delayA.disconnect();\n\t this._delayA = null;\n\t this._delayB.disconnect();\n\t this._delayB = null;\n\t this._lfoA.dispose();\n\t this._lfoA = null;\n\t this._lfoB.dispose();\n\t this._lfoB = null;\n\t this._crossFade.dispose();\n\t this._crossFade = null;\n\t this._crossFadeLFO.dispose();\n\t this._crossFadeLFO = null;\n\t this._writable('delayTime');\n\t this._feedbackDelay.dispose();\n\t this._feedbackDelay = null;\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.PitchShift;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the native BufferSourceNode.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {AudioBuffer|Tone.Buffer} buffer The buffer to play\n\t\t * @param {Function} onload The callback to invoke when the\n\t\t * buffer is done playing.\n\t\t */\n\t Tone.BufferSource = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'buffer',\n\t 'onload'\n\t ], Tone.BufferSource);\n\t Tone.AudioNode.call(this, options);\n\t /**\n\t\t\t * The callback to invoke after the\n\t\t\t * buffer source is done playing.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.onended = options.onended;\n\t /**\n\t\t\t * The time that the buffer was started.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._startTime = -1;\n\t /**\n\t\t\t * An additional flag if the actual BufferSourceNode\n\t\t\t * has been started. b/c stopping an unstarted buffer\n\t\t\t * will throw it into an invalid state\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._sourceStarted = false;\n\t /**\n\t\t\t * Flag if the source has already been stopped\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._sourceStopped = false;\n\t /**\n\t\t\t * The time that the buffer is scheduled to stop.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._stopTime = -1;\n\t /**\n\t\t\t * The gain node which envelopes the BufferSource\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gainNode = this.output = new Tone.Gain();\n\t /**\n\t\t\t * The buffer source\n\t\t\t * @type {AudioBufferSourceNode}\n\t\t\t * @private\n\t\t\t */\n\t this._source = this.context.createBufferSource();\n\t this._source.connect(this._gainNode);\n\t this._source.onended = this._onended.bind(this);\n\t /**\n\t\t\t * The private buffer instance\n\t\t\t * @type {Tone.Buffer}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = new Tone.Buffer(options.buffer, options.onload);\n\t /**\n\t\t\t * The playbackRate of the buffer\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.playbackRate = new Tone.Param(this._source.playbackRate, Tone.Type.Positive);\n\t /**\n\t\t\t * The fadeIn time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeIn = options.fadeIn;\n\t /**\n\t\t\t * The fadeOut time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeOut = options.fadeOut;\n\t /**\n\t\t\t * The curve applied to the fades, either \"linear\" or \"exponential\"\n\t\t\t * @type {String}\n\t\t\t */\n\t this.curve = options.curve;\n\t /**\n\t\t\t * The value that the buffer ramps to\n\t\t\t * @type {Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gain = 1;\n\t /**\n\t\t\t * The onended timeout\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._onendedTimeout = -1;\n\t //set some values initially\n\t this.loop = options.loop;\n\t this.loopStart = options.loopStart;\n\t this.loopEnd = options.loopEnd;\n\t this.playbackRate.value = options.playbackRate;\n\t };\n\t Tone.extend(Tone.BufferSource, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.BufferSource.defaults = {\n\t 'onended': Tone.noOp,\n\t 'onload': Tone.noOp,\n\t 'loop': false,\n\t 'loopStart': 0,\n\t 'loopEnd': 0,\n\t 'fadeIn': 0,\n\t 'fadeOut': 0,\n\t 'curve': 'linear',\n\t 'playbackRate': 1\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'state', {\n\t get: function () {\n\t return this.getStateAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Get the playback state at the given time\n\t\t * @param {Time} time The time to test the state at\n\t\t * @return {Tone.State} The playback state. \n\t\t */\n\t Tone.BufferSource.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._startTime !== -1 && time >= this._startTime && !this._sourceStopped) {\n\t return Tone.State.Started;\n\t } else {\n\t return Tone.State.Stopped;\n\t }\n\t };\n\t /**\n\t\t * Start the buffer\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @param {Gain} [gain=1] The gain to play the buffer back at.\n\t\t * @param {Time=} fadeInTime The optional fadeIn ramp time.\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.start = function (time, offset, duration, gain, fadeInTime) {\n\t if (this._startTime !== -1) {\n\t throw new Error('Tone.BufferSource can only be started once.');\n\t }\n\t if (!this.buffer.loaded) {\n\t throw new Error('Tone.BufferSource: buffer is either not set or not loaded.');\n\t }\n\t time = this.toSeconds(time);\n\t //if it's a loop the default offset is the loopstart point\n\t if (this.loop) {\n\t offset = Tone.defaultArg(offset, this.loopStart);\n\t } else {\n\t //otherwise the default offset is 0\n\t offset = Tone.defaultArg(offset, 0);\n\t }\n\t offset = this.toSeconds(offset);\n\t gain = Tone.defaultArg(gain, 1);\n\t this._gain = gain;\n\t fadeInTime = this.toSeconds(Tone.defaultArg(fadeInTime, this.fadeIn));\n\t this.fadeIn = fadeInTime;\n\t if (fadeInTime > 0) {\n\t this._gainNode.gain.setValueAtTime(0, time);\n\t if (this.curve === 'linear') {\n\t this._gainNode.gain.linearRampToValueAtTime(this._gain, time + fadeInTime);\n\t } else {\n\t this._gainNode.gain.exponentialApproachValueAtTime(this._gain, time, fadeInTime);\n\t }\n\t } else {\n\t this._gainNode.gain.setValueAtTime(gain, time);\n\t }\n\t this._startTime = time;\n\t var computedDur = this.toSeconds(Tone.defaultArg(duration, this.buffer.duration - offset % this.buffer.duration));\n\t computedDur = Math.max(computedDur, 0);\n\t if (Tone.isDefined(duration)) {\n\t //clip the duration when not looping\n\t if (!this.loop) {\n\t computedDur = Math.min(computedDur, this.buffer.duration - offset % this.buffer.duration);\n\t }\n\t this.stop(time + computedDur, this.fadeOut);\n\t }\n\t //start the buffer source\n\t if (this.loop) {\n\t //modify the offset if it's greater than the loop time\n\t var loopEnd = this.loopEnd || this.buffer.duration;\n\t var loopStart = this.loopStart;\n\t var loopDuration = loopEnd - loopStart;\n\t //move the offset back\n\t if (offset >= loopEnd) {\n\t offset = (offset - loopStart) % loopDuration + loopStart;\n\t }\n\t }\n\t this._source.buffer = this.buffer.get();\n\t this._source.loopEnd = this.loopEnd || this.buffer.duration;\n\t if (offset < this.buffer.duration) {\n\t this._sourceStarted = true;\n\t this._source.start(time, offset);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the buffer. Optionally add a ramp time to fade the\n\t\t * buffer out.\n\t\t * @param {Time=} time The time the buffer should stop.\n\t\t * @param {Time=} fadeOutTime How long the gain should fade out for\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.stop = function (time, fadeOutTime) {\n\t if (!this.buffer.loaded) {\n\t throw new Error('Tone.BufferSource: buffer is either not set or not loaded.');\n\t }\n\t if (this._sourceStopped) {\n\t return;\n\t }\n\t time = this.toSeconds(time);\n\t //if the event has already been scheduled, clear it\n\t if (this._stopTime !== -1) {\n\t this.cancelStop();\n\t }\n\t //stop if it's schedule before the start time\n\t if (time <= this._startTime) {\n\t this._gainNode.gain.cancelScheduledValues(time);\n\t this._gainNode.gain.value = 0;\n\t return this;\n\t }\n\t time = Math.max(this._startTime + this.fadeIn + this.sampleTime, time);\n\t //cancel the previous curve\n\t this._gainNode.gain.cancelScheduledValues(time);\n\t this._stopTime = time;\n\t //the fadeOut time\n\t fadeOutTime = this.toSeconds(Tone.defaultArg(fadeOutTime, this.fadeOut));\n\t var heldDuration = time - this._startTime - this.fadeIn - this.sampleTime;\n\t if (!this.loop) {\n\t //make sure the fade does not go beyond the length of the buffer\n\t heldDuration = Math.min(heldDuration, this.buffer.duration);\n\t }\n\t fadeOutTime = Math.min(heldDuration, fadeOutTime);\n\t var startFade = time - fadeOutTime;\n\t if (fadeOutTime > this.sampleTime) {\n\t this._gainNode.gain.setValueAtTime(this._gain, startFade);\n\t if (this.curve === 'linear') {\n\t this._gainNode.gain.linearRampToValueAtTime(0, time);\n\t } else {\n\t this._gainNode.gain.exponentialApproachValueAtTime(0, startFade, fadeOutTime);\n\t }\n\t } else {\n\t this._gainNode.gain.setValueAtTime(0, time);\n\t }\n\t Tone.context.clearTimeout(this._onendedTimeout);\n\t this._onendedTimeout = Tone.context.setTimeout(this._onended.bind(this), this._stopTime - this.now());\n\t return this;\n\t };\n\t /**\n\t\t * Cancel a scheduled stop event\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.cancelStop = function () {\n\t if (this._startTime !== -1 && !this._sourceStopped) {\n\t //cancel the stop envelope\n\t var fadeInTime = this.toSeconds(this.fadeIn);\n\t this._gainNode.gain.cancelScheduledValues(this._startTime + fadeInTime + this.sampleTime);\n\t this._gainNode.gain.setValueAtTime(1, Math.max(this.now(), this._startTime + fadeInTime + this.sampleTime));\n\t this.context.clearTimeout(this._onendedTimeout);\n\t this._stopTime = -1;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Internal callback when the buffer is ended.\n\t\t * Invokes `onended` and disposes the node.\n\t\t * @private\n\t\t */\n\t Tone.BufferSource.prototype._onended = function () {\n\t if (!this._sourceStopped) {\n\t this._sourceStopped = true;\n\t //allow additional time for the exponential curve to fully decay\n\t var additionalTail = this.curve === 'exponential' ? this.fadeOut * 2 : 0;\n\t if (this._sourceStarted && this._stopTime !== -1) {\n\t this._source.stop(this._stopTime + additionalTail);\n\t }\n\t this.onended(this);\n\t }\n\t };\n\t /**\n\t\t * If loop is true, the loop will start at this position.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'loopStart', {\n\t get: function () {\n\t return this._source.loopStart;\n\t },\n\t set: function (loopStart) {\n\t this._source.loopStart = this.toSeconds(loopStart);\n\t }\n\t });\n\t /**\n\t\t * If loop is true, the loop will end at this position.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'loopEnd', {\n\t get: function () {\n\t return this._source.loopEnd;\n\t },\n\t set: function (loopEnd) {\n\t this._source.loopEnd = this.toSeconds(loopEnd);\n\t }\n\t });\n\t /**\n\t\t * The audio buffer belonging to the player.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Tone.Buffer}\n\t\t * @name buffer\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'buffer', {\n\t get: function () {\n\t return this._buffer;\n\t },\n\t set: function (buffer) {\n\t this._buffer.set(buffer);\n\t }\n\t });\n\t /**\n\t\t * If the buffer should loop once it's over.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Boolean}\n\t\t * @name loop\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'loop', {\n\t get: function () {\n\t return this._source.loop;\n\t },\n\t set: function (loop) {\n\t this._source.loop = loop;\n\t this.cancelStop();\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.onended = null;\n\t this._source.onended = null;\n\t this._source.disconnect();\n\t this._source = null;\n\t this._gainNode.dispose();\n\t this._gainNode = null;\n\t this._buffer.dispose();\n\t this._buffer = null;\n\t this._startTime = -1;\n\t this.playbackRate = null;\n\t Tone.context.clearTimeout(this._onendedTimeout);\n\t return this;\n\t };\n\t return Tone.BufferSource;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Noise is a noise generator. It uses looped noise buffers to save on performance.\n\t\t * Tone.Noise supports the noise types: \"pink\", \"white\", and \"brown\". Read more about\n\t\t * colors of noise on [Wikipedia](https://en.wikipedia.org/wiki/Colors_of_noise).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {string} type the noise type (white|pink|brown)\n\t\t * @example\n\t\t * //initialize the noise and start\n\t\t * var noise = new Tone.Noise(\"pink\").start();\n\t\t *\n\t\t * //make an autofilter to shape the noise\n\t\t * var autoFilter = new Tone.AutoFilter({\n\t\t * \t\"frequency\" : \"8m\",\n\t\t * \t\"min\" : 800,\n\t\t * \t\"max\" : 15000\n\t\t * }).connect(Tone.Master);\n\t\t *\n\t\t * //connect the noise\n\t\t * noise.connect(autoFilter);\n\t\t * //start the autofilter LFO\n\t\t * autoFilter.start()\n\t\t */\n\t Tone.Noise = function () {\n\t var options = Tone.defaults(arguments, ['type'], Tone.Noise);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * @private\n\t\t\t * @type {AudioBufferSourceNode}\n\t\t\t */\n\t this._source = null;\n\t /**\n\t\t\t * the buffer\n\t\t\t * @private\n\t\t\t * @type {AudioBuffer}\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * The playback rate of the noise. Affects\n\t\t\t * the \"frequency\" of the noise.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this._playbackRate = options.playbackRate;\n\t };\n\t Tone.extend(Tone.Noise, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t *\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Noise.defaults = {\n\t 'type': 'white',\n\t 'playbackRate': 1\n\t };\n\t /**\n\t\t * The type of the noise. Can be \"white\", \"brown\", or \"pink\".\n\t\t * @memberOf Tone.Noise#\n\t\t * @type {string}\n\t\t * @name type\n\t\t * @example\n\t\t * noise.type = \"white\";\n\t\t */\n\t Object.defineProperty(Tone.Noise.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t if (this._type !== type) {\n\t if (type in _noiseBuffers) {\n\t this._type = type;\n\t //if it's playing, stop and restart it\n\t if (this.state === Tone.State.Started) {\n\t var now = this.now();\n\t this._stop(now);\n\t this._start(now);\n\t }\n\t } else {\n\t throw new TypeError('Tone.Noise: invalid type: ' + type);\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * The playback rate of the noise. Affects\n\t\t * the \"frequency\" of the noise.\n\t\t * @type {Positive}\n\t\t * @signal\n\t\t */\n\t Object.defineProperty(Tone.Noise.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t if (this._source) {\n\t this._source.playbackRate.value = rate;\n\t }\n\t }\n\t });\n\t /**\n\t\t * internal start method\n\t\t *\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.Noise.prototype._start = function (time) {\n\t var buffer = _noiseBuffers[this._type];\n\t this._source = new Tone.BufferSource(buffer).connect(this.output);\n\t this._source.loop = true;\n\t this._source.playbackRate.value = this._playbackRate;\n\t this._source.start(this.toSeconds(time), Math.random() * (buffer.duration - 0.001));\n\t };\n\t /**\n\t\t * internal stop method\n\t\t *\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.Noise.prototype._stop = function (time) {\n\t if (this._source) {\n\t this._source.stop(this.toSeconds(time));\n\t this._source = null;\n\t }\n\t };\n\t /**\n\t\t * Restarts the noise.\n\t\t * @param {[type]} time [description]\n\t\t * @return {[type]} [description]\n\t\t */\n\t Tone.Noise.prototype.restart = function (time) {\n\t //TODO could be optimized by cancelling the buffer source 'stop'\n\t //stop and restart\n\t this._stop(time);\n\t this._start(time);\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Noise} this\n\t\t */\n\t Tone.Noise.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t if (this._source !== null) {\n\t this._source.disconnect();\n\t this._source = null;\n\t }\n\t this._buffer = null;\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // THE BUFFERS\n\t ///////////////////////////////////////////////////////////////////////////\n\t //Noise buffer stats\n\t var bufferLength = 44100 * 5;\n\t var channels = 2;\n\t /**\n\t\t *\tThe noise arrays. Generated on initialization.\n\t\t * borrowed heavily from https://github.com/zacharydenton/noise.js\n\t\t * (c) 2013 Zach Denton (MIT)\n\t\t * @static\n\t\t * @private\n\t\t * @type {Array}\n\t\t */\n\t var _noiseArrays = {\n\t 'pink': function () {\n\t var buffer = [];\n\t for (var channelNum = 0; channelNum < channels; channelNum++) {\n\t var channel = new Float32Array(bufferLength);\n\t buffer[channelNum] = channel;\n\t var b0, b1, b2, b3, b4, b5, b6;\n\t b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0;\n\t for (var i = 0; i < bufferLength; i++) {\n\t var white = Math.random() * 2 - 1;\n\t b0 = 0.99886 * b0 + white * 0.0555179;\n\t b1 = 0.99332 * b1 + white * 0.0750759;\n\t b2 = 0.969 * b2 + white * 0.153852;\n\t b3 = 0.8665 * b3 + white * 0.3104856;\n\t b4 = 0.55 * b4 + white * 0.5329522;\n\t b5 = -0.7616 * b5 - white * 0.016898;\n\t channel[i] = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362;\n\t channel[i] *= 0.11;\n\t // (roughly) compensate for gain\n\t b6 = white * 0.115926;\n\t }\n\t }\n\t return buffer;\n\t }(),\n\t 'brown': function () {\n\t var buffer = [];\n\t for (var channelNum = 0; channelNum < channels; channelNum++) {\n\t var channel = new Float32Array(bufferLength);\n\t buffer[channelNum] = channel;\n\t var lastOut = 0;\n\t for (var i = 0; i < bufferLength; i++) {\n\t var white = Math.random() * 2 - 1;\n\t channel[i] = (lastOut + 0.02 * white) / 1.02;\n\t lastOut = channel[i];\n\t channel[i] *= 3.5; // (roughly) compensate for gain\n\t }\n\t }\n\t return buffer;\n\t }(),\n\t 'white': function () {\n\t var buffer = [];\n\t for (var channelNum = 0; channelNum < channels; channelNum++) {\n\t var channel = new Float32Array(bufferLength);\n\t buffer[channelNum] = channel;\n\t for (var i = 0; i < bufferLength; i++) {\n\t channel[i] = Math.random() * 2 - 1;\n\t }\n\t }\n\t return buffer;\n\t }()\n\t };\n\t /**\n\t\t *\tstatic noise buffers\n\t\t * @static\n\t\t * @private\n\t\t * @type {Tone.Buffer}\n\t\t */\n\t var _noiseBuffers = {};\n\t //create the Tone.Buffers\n\t function createBuffers() {\n\t for (var type in _noiseArrays) {\n\t _noiseBuffers[type] = new Tone.Buffer().fromArray(_noiseArrays[type]);\n\t }\n\t }\n\t //create the noise buffers\n\t Tone.getContext(createBuffers);\n\t Tone.Context.on('init', createBuffers);\n\t return Tone.Noise;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Simple convolution created with decaying noise.\n\t\t * \t\tGenerates an Impulse Response Buffer\n\t\t * \t\t\twith Tone.Offline then feeds the IR into ConvolverNode.\n\t\t * \t\t\tNote: the Reverb will not make any sound until [generate](#generate)\n\t\t * \t\t\thas been invoked and resolved.\n\t\t *\n\t\t * \t\t\tInspiration from [ReverbGen](https://github.com/adelespinasse/reverbGen).\n\t\t * \t\t\tCopyright (c) 2014 Alan deLespinasse Apache 2.0 License.\n\t\t *\n\t\t * @extends {Tone.Convolver}\n\t\t * @param {Time=} decay The amount of time it will reverberate for.\n\t\t */\n\t Tone.Reverb = function () {\n\t var options = Tone.defaults(arguments, ['decay'], Tone.Reverb);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * Convolver node\n\t\t\t * @type {ConvolverNode}\n\t\t\t * @private\n\t\t\t */\n\t this._convolver = this.context.createConvolver();\n\t /**\n\t\t\t * The duration of the reverb\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.decay = options.decay;\n\t /**\n\t\t\t * The amount of time before the reverb is fully\n\t\t\t * ramped in.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.preDelay = options.preDelay;\n\t this.connectEffect(this._convolver);\n\t };\n\t Tone.extend(Tone.Reverb, Tone.Effect);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @static\n\t\t */\n\t Tone.Reverb.defaults = {\n\t 'decay': 1.5,\n\t 'preDelay': 0.01\n\t };\n\t /**\n\t\t * Generate the Impulse Response. Returns a promise while the IR is being\n\t\t * generated.\n\t\t * @return {Promise<Tone.Reverb>} Promise which returns this object.\n\t\t */\n\t Tone.Reverb.prototype.generate = function () {\n\t return Tone.Offline(function () {\n\t //create a noise burst which decays over the duration\n\t var noiseL = new Tone.Noise();\n\t var noiseR = new Tone.Noise();\n\t var merge = new Tone.Merge();\n\t noiseL.connect(merge.left);\n\t noiseR.connect(merge.right);\n\t var gainNode = new Tone.Gain().toMaster();\n\t merge.connect(gainNode);\n\t noiseL.start(0);\n\t noiseR.start(0);\n\t //short fade in\n\t gainNode.gain.setValueAtTime(0, 0);\n\t gainNode.gain.linearRampToValueAtTime(1, this.preDelay);\n\t //decay\n\t gainNode.gain.exponentialApproachValueAtTime(0, this.preDelay, this.decay - this.preDelay);\n\t }.bind(this), this.decay).then(function (buffer) {\n\t this._convolver.buffer = buffer.get();\n\t return this;\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Reverb} this\n\t\t */\n\t Tone.Reverb.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._convolver.disconnect();\n\t this._convolver = null;\n\t return this;\n\t };\n\t return Tone.Reverb;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for stereo feedback effects where the effectReturn\n\t\t * is fed back into the same channel.\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t */\n\t Tone.StereoFeedbackEffect = function () {\n\t var options = Tone.defaults(arguments, ['feedback'], Tone.FeedbackEffect);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * controls the amount of feedback\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.feedback = new Tone.Signal(options.feedback, Tone.Type.NormalRange);\n\t /**\n\t\t\t * the left side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackL = new Tone.Gain();\n\t /**\n\t\t\t * the right side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackR = new Tone.Gain();\n\t //connect it up\n\t this.effectReturnL.chain(this._feedbackL, this.effectSendL);\n\t this.effectReturnR.chain(this._feedbackR, this.effectSendR);\n\t this.feedback.fan(this._feedbackL.gain, this._feedbackR.gain);\n\t this._readOnly(['feedback']);\n\t };\n\t Tone.extend(Tone.StereoFeedbackEffect, Tone.StereoEffect);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.StereoFeedbackEffect} this\n\t\t */\n\t Tone.StereoFeedbackEffect.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable(['feedback']);\n\t this.feedback.dispose();\n\t this.feedback = null;\n\t this._feedbackL.dispose();\n\t this._feedbackL = null;\n\t this._feedbackR.dispose();\n\t this._feedbackR = null;\n\t return this;\n\t };\n\t return Tone.StereoFeedbackEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Applies a width factor to the mid/side seperation.\n\t\t * 0 is all mid and 1 is all side.\n\t\t * Algorithm found in [kvraudio forums](http://www.kvraudio.com/forum/viewtopic.php?t=212587).\n\t\t * <br><br>\n\t\t * <code>\n\t\t * Mid *= 2*(1-width)<br>\n\t\t * Side *= 2*width\n\t\t * </code>\n\t\t *\n\t\t * @extends {Tone.MidSideEffect}\n\t\t * @constructor\n\t\t * @param {NormalRange|Object} [width] The stereo width. A width of 0 is mono and 1 is stereo. 0.5 is no change.\n\t\t */\n\t Tone.StereoWidener = function () {\n\t var options = Tone.defaults(arguments, ['width'], Tone.StereoWidener);\n\t Tone.MidSideEffect.call(this, options);\n\t /**\n\t\t\t * The width control. 0 = 100% mid. 1 = 100% side. 0.5 = no change.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.width = new Tone.Signal(options.width, Tone.Type.NormalRange);\n\t this._readOnly(['width']);\n\t /**\n\t\t\t * Two times the (1-width) for the mid channel\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._twoTimesWidthMid = new Tone.Multiply(2);\n\t /**\n\t\t\t * Two times the width for the side channel\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._twoTimesWidthSide = new Tone.Multiply(2);\n\t /**\n\t\t\t * Mid multiplier\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._midMult = new Tone.Multiply();\n\t this._twoTimesWidthMid.connect(this._midMult, 0, 1);\n\t this.midSend.chain(this._midMult, this.midReturn);\n\t /**\n\t\t\t * 1 - width\n\t\t\t * @type {Tone}\n\t\t\t */\n\t this._oneMinusWidth = new Tone.Subtract();\n\t this._oneMinusWidth.connect(this._twoTimesWidthMid);\n\t this.context.getConstant(1).connect(this._oneMinusWidth, 0, 0);\n\t this.width.connect(this._oneMinusWidth, 0, 1);\n\t /**\n\t\t\t * Side multiplier\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._sideMult = new Tone.Multiply();\n\t this.width.connect(this._twoTimesWidthSide);\n\t this._twoTimesWidthSide.connect(this._sideMult, 0, 1);\n\t this.sideSend.chain(this._sideMult, this.sideReturn);\n\t };\n\t Tone.extend(Tone.StereoWidener, Tone.MidSideEffect);\n\t /**\n\t\t * the default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.StereoWidener.defaults = { 'width': 0.5 };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.StereoWidener} this\n\t\t */\n\t Tone.StereoWidener.prototype.dispose = function () {\n\t Tone.MidSideEffect.prototype.dispose.call(this);\n\t this._writable(['width']);\n\t this.width.dispose();\n\t this.width = null;\n\t this._midMult.dispose();\n\t this._midMult = null;\n\t this._sideMult.dispose();\n\t this._sideMult = null;\n\t this._twoTimesWidthMid.dispose();\n\t this._twoTimesWidthMid = null;\n\t this._twoTimesWidthSide.dispose();\n\t this._twoTimesWidthSide = null;\n\t this._oneMinusWidth.dispose();\n\t this._oneMinusWidth = null;\n\t return this;\n\t };\n\t return Tone.StereoWidener;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Tremolo modulates the amplitude of an incoming signal using a Tone.LFO.\n\t\t * The type, frequency, and depth of the LFO is controllable.\n\t\t *\n\t\t * @extends {Tone.StereoEffect}\n\t\t * @constructor\n\t\t * @param {Frequency} [frequency] The rate of the effect.\n\t\t * @param {NormalRange} [depth] The depth of the effect.\n\t\t * @example\n\t\t * //create a tremolo and start it's LFO\n\t\t * var tremolo = new Tone.Tremolo(9, 0.75).toMaster().start();\n\t\t * //route an oscillator through the tremolo and start it\n\t\t * var oscillator = new Tone.Oscillator().connect(tremolo).start();\n\t\t */\n\t Tone.Tremolo = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'depth'\n\t ], Tone.Tremolo);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * The tremelo LFO in the left channel\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoL = new Tone.LFO({\n\t 'phase': options.spread,\n\t 'min': 1,\n\t 'max': 0\n\t });\n\t /**\n\t\t\t * The tremelo LFO in the left channel\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoR = new Tone.LFO({\n\t 'phase': options.spread,\n\t 'min': 1,\n\t 'max': 0\n\t });\n\t /**\n\t\t\t * Where the gain is multiplied\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._amplitudeL = new Tone.Gain();\n\t /**\n\t\t\t * Where the gain is multiplied\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._amplitudeR = new Tone.Gain();\n\t /**\n\t\t\t * The frequency of the tremolo.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The depth of the effect. A depth of 0, has no effect\n\t\t\t * on the amplitude, and a depth of 1 makes the amplitude\n\t\t\t * modulate fully between 0 and 1.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = new Tone.Signal(options.depth, Tone.Type.NormalRange);\n\t this._readOnly([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.effectSendL.chain(this._amplitudeL, this.effectReturnL);\n\t this.effectSendR.chain(this._amplitudeR, this.effectReturnR);\n\t this._lfoL.connect(this._amplitudeL.gain);\n\t this._lfoR.connect(this._amplitudeR.gain);\n\t this.frequency.fan(this._lfoL.frequency, this._lfoR.frequency);\n\t this.depth.fan(this._lfoR.amplitude, this._lfoL.amplitude);\n\t this.type = options.type;\n\t this.spread = options.spread;\n\t };\n\t Tone.extend(Tone.Tremolo, Tone.StereoEffect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Tremolo.defaults = {\n\t 'frequency': 10,\n\t 'type': 'sine',\n\t 'depth': 0.5,\n\t 'spread': 180\n\t };\n\t /**\n\t\t * Start the tremolo.\n\t\t * @param {Time} [time=now] When the tremolo begins.\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.start = function (time) {\n\t this._lfoL.start(time);\n\t this._lfoR.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the tremolo.\n\t\t * @param {Time} [time=now] When the tremolo stops.\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.stop = function (time) {\n\t this._lfoL.stop(time);\n\t this._lfoR.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the effect to the transport.\n\t\t * @param {Time} [delay=0] Delay time before starting the effect after the\n\t\t * Transport has started.\n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.Tremolo.prototype.sync = function (delay) {\n\t this._lfoL.sync(delay);\n\t this._lfoR.sync(delay);\n\t Tone.Transport.syncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the filter from the transport\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.unsync = function () {\n\t this._lfoL.unsync();\n\t this._lfoR.unsync();\n\t Tone.Transport.unsyncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * The Tremolo's oscillator type.\n\t\t * @memberOf Tone.Tremolo#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Tremolo.prototype, 'type', {\n\t get: function () {\n\t return this._lfoL.type;\n\t },\n\t set: function (type) {\n\t this._lfoL.type = type;\n\t this._lfoR.type = type;\n\t }\n\t });\n\t /**\n\t\t * Amount of stereo spread. When set to 0, both LFO's will be panned centrally.\n\t\t * When set to 180, LFO's will be panned hard left and right respectively.\n\t\t * @memberOf Tone.Tremolo#\n\t\t * @type {Degrees}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.Tremolo.prototype, 'spread', {\n\t get: function () {\n\t return this._lfoR.phase - this._lfoL.phase; //180\n\t },\n\t set: function (spread) {\n\t this._lfoL.phase = 90 - spread / 2;\n\t this._lfoR.phase = spread / 2 + 90;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this._lfoL.dispose();\n\t this._lfoL = null;\n\t this._lfoR.dispose();\n\t this._lfoR = null;\n\t this._amplitudeL.dispose();\n\t this._amplitudeL = null;\n\t this._amplitudeR.dispose();\n\t this._amplitudeR = null;\n\t this.frequency = null;\n\t this.depth = null;\n\t return this;\n\t };\n\t return Tone.Tremolo;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A Vibrato effect composed of a Tone.Delay and a Tone.LFO. The LFO\n\t\t * modulates the delayTime of the delay, causing the pitch to rise\n\t\t * and fall. \n\t\t * @extends {Tone.Effect}\n\t\t * @param {Frequency} frequency The frequency of the vibrato.\n\t\t * @param {NormalRange} depth The amount the pitch is modulated.\n\t\t */\n\t Tone.Vibrato = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'depth'\n\t ], Tone.Vibrato);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * The delay node used for the vibrato effect\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNode = new Tone.Delay(0, options.maxDelay);\n\t /**\n\t\t\t * The LFO used to control the vibrato\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfo = new Tone.LFO({\n\t 'type': options.type,\n\t 'min': 0,\n\t 'max': options.maxDelay,\n\t 'frequency': options.frequency,\n\t 'phase': -90 //offse the phase so the resting position is in the center\n\t }).start().connect(this._delayNode.delayTime);\n\t /**\n\t\t\t * The frequency of the vibrato\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfo.frequency;\n\t /**\n\t\t\t * The depth of the vibrato. \n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = this._lfo.amplitude;\n\t this.depth.value = options.depth;\n\t this._readOnly([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.effectSend.chain(this._delayNode, this.effectReturn);\n\t };\n\t Tone.extend(Tone.Vibrato, Tone.Effect);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Vibrato.defaults = {\n\t 'maxDelay': 0.005,\n\t 'frequency': 5,\n\t 'depth': 0.1,\n\t 'type': 'sine'\n\t };\n\t /**\n\t\t * Type of oscillator attached to the Vibrato.\n\t\t * @memberOf Tone.Vibrato#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Vibrato.prototype, 'type', {\n\t get: function () {\n\t return this._lfo.type;\n\t },\n\t set: function (type) {\n\t this._lfo.type = type;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Vibrato} this\n\t\t */\n\t Tone.Vibrato.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._delayNode.dispose();\n\t this._delayNode = null;\n\t this._lfo.dispose();\n\t this._lfo = null;\n\t this._writable([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.frequency = null;\n\t this.depth = null;\n\t };\n\t return Tone.Vibrato;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Event abstracts away Tone.Transport.schedule and provides a schedulable\n\t\t * callback for a single or repeatable events along the timeline.\n\t\t *\n\t\t * @extends {Tone}\n\t\t * @param {function} callback The callback to invoke at the time.\n\t\t * @param {*} value The value or values which should be passed to\n\t\t * the callback function on invocation.\n\t\t * @example\n\t\t * var chord = new Tone.Event(function(time, chord){\n\t\t * \t//the chord as well as the exact time of the event\n\t\t * \t//are passed in as arguments to the callback function\n\t\t * }, [\"D4\", \"E4\", \"F4\"]);\n\t\t * //start the chord at the beginning of the transport timeline\n\t\t * chord.start();\n\t\t * //loop it every measure for 8 measures\n\t\t * chord.loop = 8;\n\t\t * chord.loopEnd = \"1m\";\n\t\t */\n\t Tone.Event = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'value'\n\t ], Tone.Event);\n\t Tone.call(this);\n\t /**\n\t\t\t * Loop value\n\t\t\t * @type {Boolean|Positive}\n\t\t\t * @private\n\t\t\t */\n\t this._loop = options.loop;\n\t /**\n\t\t\t * The callback to invoke.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t /**\n\t\t\t * The value which is passed to the\n\t\t\t * callback function.\n\t\t\t * @type {*}\n\t\t\t * @private\n\t\t\t */\n\t this.value = options.value;\n\t /**\n\t\t\t * When the note is scheduled to start.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopStart = this.toTicks(options.loopStart);\n\t /**\n\t\t\t * When the note is scheduled to start.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopEnd = this.toTicks(options.loopEnd);\n\t /**\n\t\t\t * Tracks the scheduled events\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t /**\n\t\t\t * The playback speed of the note. A speed of 1\n\t\t\t * is no change.\n\t\t\t * @private\n\t\t\t * @type {Positive}\n\t\t\t */\n\t this._playbackRate = 1;\n\t /**\n\t\t\t * A delay time from when the event is scheduled to start\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._startOffset = 0;\n\t /**\n\t\t\t * private holder of probability value\n\t\t\t * @type {NormalRange}\n\t\t\t * @private\n\t\t\t */\n\t this._probability = options.probability;\n\t /**\n\t\t\t * the amount of variation from the\n\t\t\t * given time.\n\t\t\t * @type {Boolean|Time}\n\t\t\t * @private\n\t\t\t */\n\t this._humanize = options.humanize;\n\t /**\n\t\t\t * If mute is true, the callback won't be\n\t\t\t * invoked.\n\t\t\t * @type {Boolean}\n\t\t\t */\n\t this.mute = options.mute;\n\t //set the initial values\n\t this.playbackRate = options.playbackRate;\n\t };\n\t Tone.extend(Tone.Event);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Event.defaults = {\n\t 'callback': Tone.noOp,\n\t 'loop': false,\n\t 'loopEnd': '1m',\n\t 'loopStart': 0,\n\t 'playbackRate': 1,\n\t 'value': null,\n\t 'probability': 1,\n\t 'mute': false,\n\t 'humanize': false\n\t };\n\t /**\n\t\t * Reschedule all of the events along the timeline\n\t\t * with the updated values.\n\t\t * @param {Time} after Only reschedules events after the given time.\n\t\t * @return {Tone.Event} this\n\t\t * @private\n\t\t */\n\t Tone.Event.prototype._rescheduleEvents = function (after) {\n\t //if no argument is given, schedules all of the events\n\t after = Tone.defaultArg(after, -1);\n\t this._state.forEachFrom(after, function (event) {\n\t var duration;\n\t if (event.state === Tone.State.Started) {\n\t if (Tone.isDefined(event.id)) {\n\t Tone.Transport.clear(event.id);\n\t }\n\t var startTick = event.time + Math.round(this.startOffset / this._playbackRate);\n\t if (this._loop) {\n\t duration = Infinity;\n\t if (Tone.isNumber(this._loop)) {\n\t duration = this._loop * this._getLoopDuration();\n\t }\n\t var nextEvent = this._state.getAfter(startTick);\n\t if (nextEvent !== null) {\n\t duration = Math.min(duration, nextEvent.time - startTick);\n\t }\n\t if (duration !== Infinity) {\n\t //schedule a stop since it's finite duration\n\t this._state.setStateAtTime(Tone.State.Stopped, startTick + duration + 1);\n\t duration = Tone.Ticks(duration);\n\t }\n\t var interval = Tone.Ticks(this._getLoopDuration());\n\t event.id = Tone.Transport.scheduleRepeat(this._tick.bind(this), interval, Tone.Ticks(startTick), duration);\n\t } else {\n\t event.id = Tone.Transport.schedule(this._tick.bind(this), Tone.Ticks(startTick));\n\t }\n\t }\n\t }.bind(this));\n\t return this;\n\t };\n\t /**\n\t\t * Returns the playback state of the note, either \"started\" or \"stopped\".\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Event#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'state', {\n\t get: function () {\n\t return this._state.getValueAtTime(Tone.Transport.ticks);\n\t }\n\t });\n\t /**\n\t\t * The start from the scheduled start time\n\t\t * @type {Ticks}\n\t\t * @memberOf Tone.Event#\n\t\t * @name startOffset\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'startOffset', {\n\t get: function () {\n\t return this._startOffset;\n\t },\n\t set: function (offset) {\n\t this._startOffset = offset;\n\t }\n\t });\n\t /**\n\t\t * The probability of the notes being triggered.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {NormalRange}\n\t\t * @name probability\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'probability', {\n\t get: function () {\n\t return this._probability;\n\t },\n\t set: function (prob) {\n\t this._probability = prob;\n\t }\n\t });\n\t /**\n\t\t * If set to true, will apply small random variation\n\t\t * to the callback time. If the value is given as a time, it will randomize\n\t\t * by that amount.\n\t\t * @example\n\t\t * event.humanize = true;\n\t\t * @type {Boolean|Time}\n\t\t * @name humanize\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'humanize', {\n\t get: function () {\n\t return this._humanize;\n\t },\n\t set: function (variation) {\n\t this._humanize = variation;\n\t }\n\t });\n\t /**\n\t\t * Start the note at the given time.\n\t\t * @param {TimelinePosition} time When the note should start.\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.start = function (time) {\n\t time = this.toTicks(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Stopped) {\n\t this._state.add({\n\t 'state': Tone.State.Started,\n\t 'time': time,\n\t 'id': undefined\n\t });\n\t this._rescheduleEvents(time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the Event at the given time.\n\t\t * @param {TimelinePosition} time When the note should stop.\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.stop = function (time) {\n\t this.cancel(time);\n\t time = this.toTicks(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t var previousEvent = this._state.getBefore(time);\n\t var reschedulTime = time;\n\t if (previousEvent !== null) {\n\t reschedulTime = previousEvent.time;\n\t }\n\t this._rescheduleEvents(reschedulTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel all scheduled events greater than or equal to the given time\n\t\t * @param {TimelinePosition} [time=0] The time after which events will be cancel.\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.cancel = function (time) {\n\t time = Tone.defaultArg(time, -Infinity);\n\t time = this.toTicks(time);\n\t this._state.forEachFrom(time, function (event) {\n\t Tone.Transport.clear(event.id);\n\t });\n\t this._state.cancel(time);\n\t return this;\n\t };\n\t /**\n\t\t * The callback function invoker. Also\n\t\t * checks if the Event is done playing\n\t\t * @param {Number} time The time of the event in seconds\n\t\t * @private\n\t\t */\n\t Tone.Event.prototype._tick = function (time) {\n\t var ticks = Tone.Transport.getTicksAtTime(time);\n\t if (!this.mute && this._state.getValueAtTime(ticks) === Tone.State.Started) {\n\t if (this.probability < 1 && Math.random() > this.probability) {\n\t return;\n\t }\n\t if (this.humanize) {\n\t var variation = 0.02;\n\t if (!Tone.isBoolean(this.humanize)) {\n\t variation = this.toSeconds(this.humanize);\n\t }\n\t time += (Math.random() * 2 - 1) * variation;\n\t }\n\t this.callback(time, this.value);\n\t }\n\t };\n\t /**\n\t\t * Get the duration of the loop.\n\t\t * @return {Ticks}\n\t\t * @private\n\t\t */\n\t Tone.Event.prototype._getLoopDuration = function () {\n\t return Math.round((this._loopEnd - this._loopStart) / this._playbackRate);\n\t };\n\t /**\n\t\t * If the note should loop or not\n\t\t * between Tone.Event.loopStart and\n\t\t * Tone.Event.loopEnd. An integer\n\t\t * value corresponds to the number of\n\t\t * loops the Event does after it starts.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Boolean|Positive}\n\t\t * @name loop\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'loop', {\n\t get: function () {\n\t return this._loop;\n\t },\n\t set: function (loop) {\n\t this._loop = loop;\n\t this._rescheduleEvents();\n\t }\n\t });\n\t /**\n\t\t * \tThe playback rate of the note. Defaults to 1.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Positive}\n\t\t * @name playbackRate\n\t\t * @example\n\t\t * note.loop = true;\n\t\t * //repeat the note twice as fast\n\t\t * note.playbackRate = 2;\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t this._rescheduleEvents();\n\t }\n\t });\n\t /**\n\t\t * The loopEnd point is the time the event will loop\n\t\t * if Tone.Event.loop is true.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'loopEnd', {\n\t get: function () {\n\t return Tone.Ticks(this._loopEnd).toSeconds();\n\t },\n\t set: function (loopEnd) {\n\t this._loopEnd = this.toTicks(loopEnd);\n\t if (this._loop) {\n\t this._rescheduleEvents();\n\t }\n\t }\n\t });\n\t /**\n\t\t * The time when the loop should start.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'loopStart', {\n\t get: function () {\n\t return Tone.Ticks(this._loopStart).toSeconds();\n\t },\n\t set: function (loopStart) {\n\t this._loopStart = this.toTicks(loopStart);\n\t if (this._loop) {\n\t this._rescheduleEvents();\n\t }\n\t }\n\t });\n\t /**\n\t\t * The current progress of the loop interval.\n\t\t * Returns 0 if the event is not started yet or\n\t\t * it is not set to loop.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {NormalRange}\n\t\t * @name progress\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'progress', {\n\t get: function () {\n\t if (this._loop) {\n\t var ticks = Tone.Transport.ticks;\n\t var lastEvent = this._state.get(ticks);\n\t if (lastEvent !== null && lastEvent.state === Tone.State.Started) {\n\t var loopDuration = this._getLoopDuration();\n\t var progress = (ticks - lastEvent.time) % loopDuration;\n\t return progress / loopDuration;\n\t } else {\n\t return 0;\n\t }\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.dispose = function () {\n\t this.cancel();\n\t this._state.dispose();\n\t this._state = null;\n\t this.callback = null;\n\t this.value = null;\n\t };\n\t return Tone.Event;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Loop creates a looped callback at the \n\t\t * specified interval. The callback can be \n\t\t * started, stopped and scheduled along\n\t\t * the Transport's timeline. \n\t\t * @example\n\t\t * var loop = new Tone.Loop(function(time){\n\t\t * \t//triggered every eighth note. \n\t\t * \tconsole.log(time);\n\t\t * }, \"8n\").start(0);\n\t\t * Tone.Transport.start();\n\t\t * @extends {Tone}\n\t\t * @param {Function} callback The callback to invoke with the event.\n\t\t * @param {Time} interval The time between successive callback calls. \n\t\t */\n\t Tone.Loop = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'interval'\n\t ], Tone.Loop);\n\t Tone.call(this);\n\t /**\n\t\t\t * The event which produces the callbacks\n\t\t\t */\n\t this._event = new Tone.Event({\n\t 'callback': this._tick.bind(this),\n\t 'loop': true,\n\t 'loopEnd': options.interval,\n\t 'playbackRate': options.playbackRate,\n\t 'probability': options.probability\n\t });\n\t /**\n\t\t\t * The callback to invoke with the next event in the pattern\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t //set the iterations\n\t this.iterations = options.iterations;\n\t };\n\t Tone.extend(Tone.Loop);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Loop.defaults = {\n\t 'interval': '4n',\n\t 'callback': Tone.noOp,\n\t 'playbackRate': 1,\n\t 'iterations': Infinity,\n\t 'probability': true,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Start the loop at the specified time along the Transport's\n\t\t * timeline.\n\t\t * @param {TimelinePosition=} time When to start the Loop.\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.start = function (time) {\n\t this._event.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the loop at the given time.\n\t\t * @param {TimelinePosition=} time When to stop the Arpeggio\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.stop = function (time) {\n\t this._event.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Cancel all scheduled events greater than or equal to the given time\n\t\t * @param {TimelinePosition} [time=0] The time after which events will be cancel.\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.cancel = function (time) {\n\t this._event.cancel(time);\n\t return this;\n\t };\n\t /**\n\t\t * Internal function called when the notes should be called\n\t\t * @param {Number} time The time the event occurs\n\t\t * @private\n\t\t */\n\t Tone.Loop.prototype._tick = function (time) {\n\t this.callback(time);\n\t };\n\t /**\n\t\t * The state of the Loop, either started or stopped.\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {String}\n\t\t * @name state\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'state', {\n\t get: function () {\n\t return this._event.state;\n\t }\n\t });\n\t /**\n\t\t * The progress of the loop as a value between 0-1. 0, when\n\t\t * the loop is stopped or done iterating. \n\t\t * @memberOf Tone.Loop#\n\t\t * @type {NormalRange}\n\t\t * @name progress\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'progress', {\n\t get: function () {\n\t return this._event.progress;\n\t }\n\t });\n\t /**\n\t\t * The time between successive callbacks. \n\t\t * @example\n\t\t * loop.interval = \"8n\"; //loop every 8n\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Time}\n\t\t * @name interval\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'interval', {\n\t get: function () {\n\t return this._event.loopEnd;\n\t },\n\t set: function (interval) {\n\t this._event.loopEnd = interval;\n\t }\n\t });\n\t /**\n\t\t * The playback rate of the loop. The normal playback rate is 1 (no change). \n\t\t * A `playbackRate` of 2 would be twice as fast. \n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Time}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._event.playbackRate;\n\t },\n\t set: function (rate) {\n\t this._event.playbackRate = rate;\n\t }\n\t });\n\t /**\n\t\t * Random variation +/-0.01s to the scheduled time. \n\t\t * Or give it a time value which it will randomize by.\n\t\t * @type {Boolean|Time}\n\t\t * @memberOf Tone.Loop#\n\t\t * @name humanize\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'humanize', {\n\t get: function () {\n\t return this._event.humanize;\n\t },\n\t set: function (variation) {\n\t this._event.humanize = variation;\n\t }\n\t });\n\t /**\n\t\t * The probably of the callback being invoked.\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {NormalRange}\n\t\t * @name probability\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'probability', {\n\t get: function () {\n\t return this._event.probability;\n\t },\n\t set: function (prob) {\n\t this._event.probability = prob;\n\t }\n\t });\n\t /**\n\t\t * Muting the Loop means that no callbacks are invoked.\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Boolean}\n\t\t * @name mute\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'mute', {\n\t get: function () {\n\t return this._event.mute;\n\t },\n\t set: function (mute) {\n\t this._event.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * The number of iterations of the loop. The default\n\t\t * value is Infinity (loop forever).\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Positive}\n\t\t * @name iterations\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'iterations', {\n\t get: function () {\n\t if (this._event.loop === true) {\n\t return Infinity;\n\t } else {\n\t return this._event.loop;\n\t }\n\t },\n\t set: function (iters) {\n\t if (iters === Infinity) {\n\t this._event.loop = true;\n\t } else {\n\t this._event.loop = iters;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.dispose = function () {\n\t this._event.dispose();\n\t this._event = null;\n\t this.callback = null;\n\t };\n\t return Tone.Loop;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Part is a collection Tone.Events which can be\n\t\t * started/stopped and looped as a single unit.\n\t\t *\n\t\t * @extends {Tone.Event}\n\t\t * @param {Function} callback The callback to invoke on each event\n\t\t * @param {Array} events the array of events\n\t\t * @example\n\t\t * var part = new Tone.Part(function(time, note){\n\t\t * \t//the notes given as the second element in the array\n\t\t * \t//will be passed in as the second argument\n\t\t * \tsynth.triggerAttackRelease(note, \"8n\", time);\n\t\t * }, [[0, \"C2\"], [\"0:2\", \"C3\"], [\"0:3:2\", \"G2\"]]);\n\t\t * @example\n\t\t * //use an array of objects as long as the object has a \"time\" attribute\n\t\t * var part = new Tone.Part(function(time, value){\n\t\t * \t//the value is an object which contains both the note and the velocity\n\t\t * \tsynth.triggerAttackRelease(value.note, \"8n\", time, value.velocity);\n\t\t * }, [{\"time\" : 0, \"note\" : \"C3\", \"velocity\": 0.9},\n\t\t * \t {\"time\" : \"0:2\", \"note\" : \"C4\", \"velocity\": 0.5}\n\t\t * ]).start(0);\n\t\t */\n\t Tone.Part = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'events'\n\t ], Tone.Part);\n\t Tone.Event.call(this, options);\n\t /**\n\t\t\t * An array of Objects.\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._events = [];\n\t //add the events\n\t for (var i = 0; i < options.events.length; i++) {\n\t if (Array.isArray(options.events[i])) {\n\t this.add(options.events[i][0], options.events[i][1]);\n\t } else {\n\t this.add(options.events[i]);\n\t }\n\t }\n\t };\n\t Tone.extend(Tone.Part, Tone.Event);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Part.defaults = {\n\t 'callback': Tone.noOp,\n\t 'loop': false,\n\t 'loopEnd': '1m',\n\t 'loopStart': 0,\n\t 'playbackRate': 1,\n\t 'probability': 1,\n\t 'humanize': false,\n\t 'mute': false,\n\t 'events': []\n\t };\n\t /**\n\t\t * Start the part at the given time.\n\t\t * @param {TransportTime} time When to start the part.\n\t\t * @param {Time=} offset The offset from the start of the part\n\t\t * to begin playing at.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.start = function (time, offset) {\n\t var ticks = this.toTicks(time);\n\t if (this._state.getValueAtTime(ticks) !== Tone.State.Started) {\n\t if (this._loop) {\n\t offset = Tone.defaultArg(offset, this._loopStart);\n\t } else {\n\t offset = Tone.defaultArg(offset, 0);\n\t }\n\t offset = this.toTicks(offset);\n\t this._state.add({\n\t 'state': Tone.State.Started,\n\t 'time': ticks,\n\t 'offset': offset\n\t });\n\t this._forEach(function (event) {\n\t this._startNote(event, ticks, offset);\n\t });\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Start the event in the given event at the correct time given\n\t\t * the ticks and offset and looping.\n\t\t * @param {Tone.Event} event\n\t\t * @param {Ticks} ticks\n\t\t * @param {Ticks} offset\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._startNote = function (event, ticks, offset) {\n\t ticks -= offset;\n\t if (this._loop) {\n\t if (event.startOffset >= this._loopStart && event.startOffset < this._loopEnd) {\n\t if (event.startOffset < offset) {\n\t //start it on the next loop\n\t ticks += this._getLoopDuration();\n\t }\n\t event.start(Tone.Ticks(ticks));\n\t } else if (event.startOffset < this._loopStart && event.startOffset >= offset) {\n\t event.loop = false;\n\t event.start(Tone.Ticks(ticks));\n\t }\n\t } else if (event.startOffset >= offset) {\n\t event.start(Tone.Ticks(ticks));\n\t }\n\t };\n\t /**\n\t\t * The start from the scheduled start time\n\t\t * @type {Ticks}\n\t\t * @memberOf Tone.Part#\n\t\t * @name startOffset\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'startOffset', {\n\t get: function () {\n\t return this._startOffset;\n\t },\n\t set: function (offset) {\n\t this._startOffset = offset;\n\t this._forEach(function (event) {\n\t event.startOffset += this._startOffset;\n\t });\n\t }\n\t });\n\t /**\n\t\t * Stop the part at the given time.\n\t\t * @param {TimelinePosition} time When to stop the part.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.stop = function (time) {\n\t var ticks = this.toTicks(time);\n\t this._state.cancel(ticks);\n\t this._state.setStateAtTime(Tone.State.Stopped, ticks);\n\t this._forEach(function (event) {\n\t event.stop(time);\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Get/Set an Event's value at the given time.\n\t\t * If a value is passed in and no event exists at\n\t\t * the given time, one will be created with that value.\n\t\t * If two events are at the same time, the first one will\n\t\t * be returned.\n\t\t * @example\n\t\t * part.at(\"1m\"); //returns the part at the first measure\n\t\t *\n\t\t * part.at(\"2m\", \"C2\"); //set the value at \"2m\" to C2.\n\t\t * //if an event didn't exist at that time, it will be created.\n\t\t * @param {TransportTime} time The time of the event to get or set.\n\t\t * @param {*=} value If a value is passed in, the value of the\n\t\t * event at the given time will be set to it.\n\t\t * @return {Tone.Event} the event at the time\n\t\t */\n\t Tone.Part.prototype.at = function (time, value) {\n\t time = Tone.TransportTime(time);\n\t var tickTime = Tone.Ticks(1).toSeconds();\n\t for (var i = 0; i < this._events.length; i++) {\n\t var event = this._events[i];\n\t if (Math.abs(time.toTicks() - event.startOffset) < tickTime) {\n\t if (Tone.isDefined(value)) {\n\t event.value = value;\n\t }\n\t return event;\n\t }\n\t }\n\t //if there was no event at that time, create one\n\t if (Tone.isDefined(value)) {\n\t this.add(time, value);\n\t //return the new event\n\t return this._events[this._events.length - 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Add a an event to the part.\n\t\t * @param {Time} time The time the note should start.\n\t\t * If an object is passed in, it should\n\t\t * have a 'time' attribute and the rest\n\t\t * of the object will be used as the 'value'.\n\t\t * @param {Tone.Event|*} value\n\t\t * @returns {Tone.Part} this\n\t\t * @example\n\t\t * part.add(\"1m\", \"C#+11\");\n\t\t */\n\t Tone.Part.prototype.add = function (time, value) {\n\t //extract the parameters\n\t if (time.hasOwnProperty('time')) {\n\t value = time;\n\t time = value.time;\n\t }\n\t time = this.toTicks(time);\n\t var event;\n\t if (value instanceof Tone.Event) {\n\t event = value;\n\t event.callback = this._tick.bind(this);\n\t } else {\n\t event = new Tone.Event({\n\t 'callback': this._tick.bind(this),\n\t 'value': value\n\t });\n\t }\n\t //the start offset\n\t event.startOffset = time;\n\t //initialize the values\n\t event.set({\n\t 'loopEnd': this.loopEnd,\n\t 'loopStart': this.loopStart,\n\t 'loop': this.loop,\n\t 'humanize': this.humanize,\n\t 'playbackRate': this.playbackRate,\n\t 'probability': this.probability\n\t });\n\t this._events.push(event);\n\t //start the note if it should be played right now\n\t this._restartEvent(event);\n\t return this;\n\t };\n\t /**\n\t\t * Restart the given event\n\t\t * @param {Tone.Event} event\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._restartEvent = function (event) {\n\t this._state.forEach(function (stateEvent) {\n\t if (stateEvent.state === Tone.State.Started) {\n\t this._startNote(event, stateEvent.time, stateEvent.offset);\n\t } else {\n\t //stop the note\n\t event.stop(Tone.Ticks(stateEvent.time));\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Remove an event from the part. Will recursively iterate\n\t\t * into nested parts to find the event.\n\t\t * @param {Time} time The time of the event\n\t\t * @param {*} value Optionally select only a specific event value\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.remove = function (time, value) {\n\t //extract the parameters\n\t if (time.hasOwnProperty('time')) {\n\t value = time;\n\t time = value.time;\n\t }\n\t time = this.toTicks(time);\n\t for (var i = this._events.length - 1; i >= 0; i--) {\n\t var event = this._events[i];\n\t if (event instanceof Tone.Part) {\n\t event.remove(time, value);\n\t } else if (event.startOffset === time) {\n\t if (Tone.isUndef(value) || Tone.isDefined(value) && event.value === value) {\n\t this._events.splice(i, 1);\n\t event.dispose();\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Remove all of the notes from the group.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.removeAll = function () {\n\t this._forEach(function (event) {\n\t event.dispose();\n\t });\n\t this._events = [];\n\t return this;\n\t };\n\t /**\n\t\t * Cancel scheduled state change events: i.e. \"start\" and \"stop\".\n\t\t * @param {TimelinePosition} after The time after which to cancel the scheduled events.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.cancel = function (after) {\n\t this._forEach(function (event) {\n\t event.cancel(after);\n\t });\n\t this._state.cancel(this.toTicks(after));\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over all of the events\n\t\t * @param {Function} callback\n\t\t * @param {Object} ctx The context\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._forEach = function (callback, ctx) {\n\t if (this._events) {\n\t ctx = Tone.defaultArg(ctx, this);\n\t for (var i = this._events.length - 1; i >= 0; i--) {\n\t var e = this._events[i];\n\t if (e instanceof Tone.Part) {\n\t e._forEach(callback, ctx);\n\t } else {\n\t callback.call(ctx, e);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Set the attribute of all of the events\n\t\t * @param {String} attr the attribute to set\n\t\t * @param {*} value The value to set it to\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._setAll = function (attr, value) {\n\t this._forEach(function (event) {\n\t event[attr] = value;\n\t });\n\t };\n\t /**\n\t\t * Internal tick method\n\t\t * @param {Number} time The time of the event in seconds\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._tick = function (time, value) {\n\t if (!this.mute) {\n\t this.callback(time, value);\n\t }\n\t };\n\t /**\n\t\t * Determine if the event should be currently looping\n\t\t * given the loop boundries of this Part.\n\t\t * @param {Tone.Event} event The event to test\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._testLoopBoundries = function (event) {\n\t if (event.startOffset < this._loopStart || event.startOffset >= this._loopEnd) {\n\t event.cancel(0);\n\t } else if (event.state === Tone.State.Stopped) {\n\t //reschedule it if it's stopped\n\t this._restartEvent(event);\n\t }\n\t };\n\t /**\n\t\t * The probability of the notes being triggered.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {NormalRange}\n\t\t * @name probability\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'probability', {\n\t get: function () {\n\t return this._probability;\n\t },\n\t set: function (prob) {\n\t this._probability = prob;\n\t this._setAll('probability', prob);\n\t }\n\t });\n\t /**\n\t\t * If set to true, will apply small random variation\n\t\t * to the callback time. If the value is given as a time, it will randomize\n\t\t * by that amount.\n\t\t * @example\n\t\t * event.humanize = true;\n\t\t * @type {Boolean|Time}\n\t\t * @name humanize\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'humanize', {\n\t get: function () {\n\t return this._humanize;\n\t },\n\t set: function (variation) {\n\t this._humanize = variation;\n\t this._setAll('humanize', variation);\n\t }\n\t });\n\t /**\n\t\t * If the part should loop or not\n\t\t * between Tone.Part.loopStart and\n\t\t * Tone.Part.loopEnd. An integer\n\t\t * value corresponds to the number of\n\t\t * loops the Part does after it starts.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Boolean|Positive}\n\t\t * @name loop\n\t\t * @example\n\t\t * //loop the part 8 times\n\t\t * part.loop = 8;\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'loop', {\n\t get: function () {\n\t return this._loop;\n\t },\n\t set: function (loop) {\n\t this._loop = loop;\n\t this._forEach(function (event) {\n\t event._loopStart = this._loopStart;\n\t event._loopEnd = this._loopEnd;\n\t event.loop = loop;\n\t this._testLoopBoundries(event);\n\t });\n\t }\n\t });\n\t /**\n\t\t * The loopEnd point determines when it will\n\t\t * loop if Tone.Part.loop is true.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'loopEnd', {\n\t get: function () {\n\t return Tone.Ticks(this._loopEnd).toSeconds();\n\t },\n\t set: function (loopEnd) {\n\t this._loopEnd = this.toTicks(loopEnd);\n\t if (this._loop) {\n\t this._forEach(function (event) {\n\t event.loopEnd = loopEnd;\n\t this._testLoopBoundries(event);\n\t });\n\t }\n\t }\n\t });\n\t /**\n\t\t * The loopStart point determines when it will\n\t\t * loop if Tone.Part.loop is true.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'loopStart', {\n\t get: function () {\n\t return Tone.Ticks(this._loopStart).toSeconds();\n\t },\n\t set: function (loopStart) {\n\t this._loopStart = this.toTicks(loopStart);\n\t if (this._loop) {\n\t this._forEach(function (event) {\n\t event.loopStart = this.loopStart;\n\t this._testLoopBoundries(event);\n\t });\n\t }\n\t }\n\t });\n\t /**\n\t\t * \tThe playback rate of the part\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Positive}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t this._setAll('playbackRate', rate);\n\t }\n\t });\n\t /**\n\t\t * \tThe number of scheduled notes in the part.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Positive}\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'length', {\n\t get: function () {\n\t return this._events.length;\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.dispose = function () {\n\t this.removeAll();\n\t this._state.dispose();\n\t this._state = null;\n\t this.callback = null;\n\t this._events = null;\n\t return this;\n\t };\n\t return Tone.Part;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Pattern arpeggiates between the given notes\n\t\t * in a number of patterns. See Tone.CtrlPattern for\n\t\t * a full list of patterns.\n\t\t * @example\n\t\t * var pattern = new Tone.Pattern(function(time, note){\n\t\t * //the order of the notes passed in depends on the pattern\n\t\t * }, [\"C2\", \"D4\", \"E5\", \"A6\"], \"upDown\");\n\t\t * @extends {Tone.Loop}\n\t\t * @param {Function} callback The callback to invoke with the\n\t\t * event.\n\t\t * @param {Array} values The values to arpeggiate over.\n\t\t */\n\t Tone.Pattern = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'values',\n\t 'pattern'\n\t ], Tone.Pattern);\n\t Tone.Loop.call(this, options);\n\t /**\n\t\t\t * The pattern manager\n\t\t\t * @type {Tone.CtrlPattern}\n\t\t\t * @private\n\t\t\t */\n\t this._pattern = new Tone.CtrlPattern({\n\t 'values': options.values,\n\t 'type': options.pattern,\n\t 'index': options.index\n\t });\n\t };\n\t Tone.extend(Tone.Pattern, Tone.Loop);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Pattern.defaults = {\n\t 'pattern': Tone.CtrlPattern.Type.Up,\n\t 'callback': Tone.noOp,\n\t 'values': []\n\t };\n\t /**\n\t\t * Internal function called when the notes should be called\n\t\t * @param {Number} time The time the event occurs\n\t\t * @private\n\t\t */\n\t Tone.Pattern.prototype._tick = function (time) {\n\t this.callback(time, this._pattern.value);\n\t this._pattern.next();\n\t };\n\t /**\n\t\t * The current index in the values array.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {Positive}\n\t\t * @name index\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'index', {\n\t get: function () {\n\t return this._pattern.index;\n\t },\n\t set: function (i) {\n\t this._pattern.index = i;\n\t }\n\t });\n\t /**\n\t\t * The array of events.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {Array}\n\t\t * @name values\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'values', {\n\t get: function () {\n\t return this._pattern.values;\n\t },\n\t set: function (vals) {\n\t this._pattern.values = vals;\n\t }\n\t });\n\t /**\n\t\t * The current value of the pattern.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {*}\n\t\t * @name value\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'value', {\n\t get: function () {\n\t return this._pattern.value;\n\t }\n\t });\n\t /**\n\t\t * The pattern type. See Tone.CtrlPattern for the full list of patterns.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {String}\n\t\t * @name pattern\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'pattern', {\n\t get: function () {\n\t return this._pattern.type;\n\t },\n\t set: function (pattern) {\n\t this._pattern.type = pattern;\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Pattern} this\n\t\t */\n\t Tone.Pattern.prototype.dispose = function () {\n\t Tone.Loop.prototype.dispose.call(this);\n\t this._pattern.dispose();\n\t this._pattern = null;\n\t };\n\t return Tone.Pattern;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A sequence is an alternate notation of a part. Instead\n\t\t * of passing in an array of [time, event] pairs, pass\n\t\t * in an array of events which will be spaced at the\n\t\t * given subdivision. Sub-arrays will subdivide that beat\n\t\t * by the number of items are in the array.\n\t\t * Sequence notation inspiration from [Tidal](http://yaxu.org/tidal/)\n\t\t * @param {Function} callback The callback to invoke with every note\n\t\t * @param {Array} events The sequence\n\t\t * @param {Time} subdivision The subdivision between which events are placed.\n\t\t * @extends {Tone.Part}\n\t\t * @example\n\t\t * var seq = new Tone.Sequence(function(time, note){\n\t\t * \tconsole.log(note);\n\t\t * //straight quater notes\n\t\t * }, [\"C4\", \"E4\", \"G4\", \"A4\"], \"4n\");\n\t\t * @example\n\t\t * var seq = new Tone.Sequence(function(time, note){\n\t\t * \tconsole.log(note);\n\t\t * //subdivisions are given as subarrays\n\t\t * }, [\"C4\", [\"E4\", \"D4\", \"E4\"], \"G4\", [\"A4\", \"G4\"]]);\n\t\t */\n\t Tone.Sequence = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'events',\n\t 'subdivision'\n\t ], Tone.Sequence);\n\t //remove the events\n\t var events = options.events;\n\t delete options.events;\n\t Tone.Part.call(this, options);\n\t /**\n\t\t\t * The subdivison of each note\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._subdivision = this.toTicks(options.subdivision);\n\t //if no time was passed in, the loop end is the end of the cycle\n\t if (Tone.isUndef(options.loopEnd) && Tone.isDefined(events)) {\n\t this._loopEnd = events.length * this._subdivision;\n\t }\n\t //defaults to looping\n\t this._loop = true;\n\t //add all of the events\n\t if (Tone.isDefined(events)) {\n\t for (var i = 0; i < events.length; i++) {\n\t this.add(i, events[i]);\n\t }\n\t }\n\t };\n\t Tone.extend(Tone.Sequence, Tone.Part);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t */\n\t Tone.Sequence.defaults = { 'subdivision': '4n' };\n\t /**\n\t\t * The subdivision of the sequence. This can only be\n\t\t * set in the constructor. The subdivision is the\n\t\t * interval between successive steps.\n\t\t * @type {Time}\n\t\t * @memberOf Tone.Sequence#\n\t\t * @name subdivision\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Sequence.prototype, 'subdivision', {\n\t get: function () {\n\t return Tone.Ticks(this._subdivision).toSeconds();\n\t }\n\t });\n\t /**\n\t\t * Get/Set an index of the sequence. If the index contains a subarray,\n\t\t * a Tone.Sequence representing that sub-array will be returned.\n\t\t * @example\n\t\t * var sequence = new Tone.Sequence(playNote, [\"E4\", \"C4\", \"F#4\", [\"A4\", \"Bb3\"]])\n\t\t * sequence.at(0)// => returns \"E4\"\n\t\t * //set a value\n\t\t * sequence.at(0, \"G3\");\n\t\t * //get a nested sequence\n\t\t * sequence.at(3).at(1)// => returns \"Bb3\"\n\t\t * @param {Positive} index The index to get or set\n\t\t * @param {*} value Optionally pass in the value to set at the given index.\n\t\t */\n\t Tone.Sequence.prototype.at = function (index, value) {\n\t //if the value is an array,\n\t if (Tone.isArray(value)) {\n\t //remove the current event at that index\n\t this.remove(index);\n\t }\n\t //call the parent's method\n\t return Tone.Part.prototype.at.call(this, this._indexTime(index), value);\n\t };\n\t /**\n\t\t * Add an event at an index, if there's already something\n\t\t * at that index, overwrite it. If `value` is an array,\n\t\t * it will be parsed as a subsequence.\n\t\t * @param {Number} index The index to add the event to\n\t\t * @param {*} value The value to add at that index\n\t\t * @returns {Tone.Sequence} this\n\t\t */\n\t Tone.Sequence.prototype.add = function (index, value) {\n\t if (value === null) {\n\t return this;\n\t }\n\t if (Tone.isArray(value)) {\n\t //make a subsequence and add that to the sequence\n\t var subSubdivision = Math.round(this._subdivision / value.length);\n\t value = new Tone.Sequence(this._tick.bind(this), value, Tone.Ticks(subSubdivision));\n\t }\n\t Tone.Part.prototype.add.call(this, this._indexTime(index), value);\n\t return this;\n\t };\n\t /**\n\t\t * Remove a value from the sequence by index\n\t\t * @param {Number} index The index of the event to remove\n\t\t * @returns {Tone.Sequence} this\n\t\t */\n\t Tone.Sequence.prototype.remove = function (index, value) {\n\t Tone.Part.prototype.remove.call(this, this._indexTime(index), value);\n\t return this;\n\t };\n\t /**\n\t\t * Get the time of the index given the Sequence's subdivision\n\t\t * @param {Number} index\n\t\t * @return {Time} The time of that index\n\t\t * @private\n\t\t */\n\t Tone.Sequence.prototype._indexTime = function (index) {\n\t if (index instanceof Tone.TransportTime) {\n\t return index;\n\t } else {\n\t return Tone.Ticks(index * this._subdivision + this.startOffset).toSeconds();\n\t }\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Sequence} this\n\t\t */\n\t Tone.Sequence.prototype.dispose = function () {\n\t Tone.Part.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.Sequence;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PulseOscillator is a pulse oscillator with control over pulse width,\n\t\t * also known as the duty cycle. At 50% duty cycle (width = 0.5) the wave is\n\t\t * a square and only odd-numbered harmonics are present. At all other widths\n\t\t * even-numbered harmonics are present. Read more\n\t\t * [here](https://wigglewave.wordpress.com/2014/08/16/pulse-waveforms-and-harmonics/).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {Frequency} [frequency] The frequency of the oscillator\n\t\t * @param {NormalRange} [width] The width of the pulse\n\t\t * @example\n\t\t * var pulse = new Tone.PulseOscillator(\"E5\", 0.4).toMaster().start();\n\t\t */\n\t Tone.PulseOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'width'\n\t ], Tone.Oscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The width of the pulse.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.width = new Tone.Signal(options.width, Tone.Type.NormalRange);\n\t /**\n\t\t\t * gate the width amount\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._widthGate = new Tone.Gain();\n\t /**\n\t\t\t * the sawtooth oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._sawtooth = new Tone.Oscillator({\n\t frequency: options.frequency,\n\t detune: options.detune,\n\t type: 'sawtooth',\n\t phase: options.phase\n\t });\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._sawtooth.frequency;\n\t /**\n\t\t\t * The detune in cents.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._sawtooth.detune;\n\t /**\n\t\t\t * Threshold the signal to turn it into a square\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._thresh = new Tone.WaveShaper(function (val) {\n\t if (val < 0) {\n\t return -1;\n\t } else {\n\t return 1;\n\t }\n\t });\n\t //connections\n\t this._sawtooth.chain(this._thresh, this.output);\n\t this.width.chain(this._widthGate, this._thresh);\n\t this._readOnly([\n\t 'width',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.PulseOscillator, Tone.Source);\n\t /**\n\t\t * The default parameters.\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.PulseOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'width': 0.2\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.PulseOscillator.prototype._start = function (time) {\n\t time = this.toSeconds(time);\n\t this._sawtooth.start(time);\n\t this._widthGate.gain.setValueAtTime(1, time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.PulseOscillator.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._sawtooth.stop(time);\n\t //the width is still connected to the output.\n\t //that needs to be stopped also\n\t this._widthGate.gain.setValueAtTime(0, time);\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.PulseOscillator.prototype.restart = function (time) {\n\t this._sawtooth.restart(time);\n\t };\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.PulseOscillator#\n\t\t * @type {Degrees}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.PulseOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._sawtooth.phase;\n\t },\n\t set: function (phase) {\n\t this._sawtooth.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The type of the oscillator. Always returns \"pulse\".\n\t\t * @readOnly\n\t\t * @memberOf Tone.PulseOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.PulseOscillator.prototype, 'type', {\n\t get: function () {\n\t return 'pulse';\n\t }\n\t });\n\t /**\n\t\t * The partials of the waveform. Cannot set partials for this waveform type\n\t\t * @memberOf Tone.PulseOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.PulseOscillator.prototype, 'partials', {\n\t get: function () {\n\t return [];\n\t }\n\t });\n\t /**\n\t\t * Clean up method.\n\t\t * @return {Tone.PulseOscillator} this\n\t\t */\n\t Tone.PulseOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._sawtooth.dispose();\n\t this._sawtooth = null;\n\t this._writable([\n\t 'width',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.width.dispose();\n\t this.width = null;\n\t this._widthGate.dispose();\n\t this._widthGate = null;\n\t this._thresh.dispose();\n\t this._thresh = null;\n\t this.frequency = null;\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.PulseOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PWMOscillator modulates the width of a Tone.PulseOscillator\n\t\t * at the modulationFrequency. This has the effect of continuously\n\t\t * changing the timbre of the oscillator by altering the harmonics\n\t\t * generated.\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {Frequency} modulationFrequency The modulation frequency of the width of the pulse.\n\t\t * @example\n\t\t * var pwm = new Tone.PWMOscillator(\"Ab3\", 0.3).toMaster().start();\n\t\t */\n\t Tone.PWMOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'modulationFrequency'\n\t ], Tone.PWMOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * the pulse oscillator\n\t\t\t * @type {Tone.PulseOscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._pulse = new Tone.PulseOscillator(options.modulationFrequency);\n\t //change the pulse oscillator type\n\t this._pulse._sawtooth.type = 'sine';\n\t /**\n\t\t\t * the modulator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Oscillator({\n\t 'frequency': options.frequency,\n\t 'detune': options.detune,\n\t 'phase': options.phase\n\t });\n\t /**\n\t\t\t * Scale the oscillator so it doesn't go silent\n\t\t\t * at the extreme values.\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = new Tone.Multiply(2);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._modulator.frequency;\n\t /**\n\t\t\t * The detune of the oscillator.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._modulator.detune;\n\t /**\n\t\t\t * The modulation rate of the oscillator.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.modulationFrequency = this._pulse.frequency;\n\t //connections\n\t this._modulator.chain(this._scale, this._pulse.width);\n\t this._pulse.connect(this.output);\n\t this._readOnly([\n\t 'modulationFrequency',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.PWMOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.PWMOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'modulationFrequency': 0.4\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.PWMOscillator.prototype._start = function (time) {\n\t time = this.toSeconds(time);\n\t this._modulator.start(time);\n\t this._pulse.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.PWMOscillator.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._modulator.stop(time);\n\t this._pulse.stop(time);\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.PWMOscillator.prototype.restart = function (time) {\n\t this._modulator.restart(time);\n\t this._pulse.restart(time);\n\t };\n\t /**\n\t\t * The type of the oscillator. Always returns \"pwm\".\n\t\t * @readOnly\n\t\t * @memberOf Tone.PWMOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.PWMOscillator.prototype, 'type', {\n\t get: function () {\n\t return 'pwm';\n\t }\n\t });\n\t /**\n\t\t * The partials of the waveform. Cannot set partials for this waveform type\n\t\t * @memberOf Tone.PWMOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.PWMOscillator.prototype, 'partials', {\n\t get: function () {\n\t return [];\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.PWMOscillator#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.PWMOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._modulator.phase;\n\t },\n\t set: function (phase) {\n\t this._modulator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.PWMOscillator} this\n\t\t */\n\t Tone.PWMOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._pulse.dispose();\n\t this._pulse = null;\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this._writable([\n\t 'modulationFrequency',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.frequency = null;\n\t this.detune = null;\n\t this.modulationFrequency = null;\n\t return this;\n\t };\n\t return Tone.PWMOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FMOscillator\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {String} type The type of the carrier oscillator.\n\t\t * @param {String} modulationType The type of the modulator oscillator.\n\t\t * @example\n\t\t * //a sine oscillator frequency-modulated by a square wave\n\t\t * var fmOsc = new Tone.FMOscillator(\"Ab3\", \"sine\", \"square\").toMaster().start();\n\t\t */\n\t Tone.FMOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'modulationType'\n\t ], Tone.FMOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The carrier oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Oscillator(options.frequency, options.type);\n\t /**\n\t\t\t * The oscillator's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._carrier.detune;\n\t this.detune.value = options.detune;\n\t /**\n\t\t\t * The modulation index which is in essence the depth or amount of the modulation. In other terms it is the\n\t\t\t * ratio of the frequency of the modulating signal (mf) to the amplitude of the\n\t\t\t * modulating signal (ma) -- as in ma/mf.\n\t\t\t *\t@type {Positive}\n\t\t\t *\t@signal\n\t\t\t */\n\t this.modulationIndex = new Tone.Multiply(options.modulationIndex);\n\t this.modulationIndex.units = Tone.Type.Positive;\n\t /**\n\t\t\t * The modulating oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Oscillator(options.frequency, options.modulationType);\n\t /**\n\t\t\t * Harmonicity is the frequency ratio between the carrier and the modulator oscillators.\n\t\t\t * A harmonicity of 1 gives both oscillators the same frequency.\n\t\t\t * Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch the modulator an octave below carrier\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain(0);\n\t //connections\n\t this.frequency.connect(this._carrier.frequency);\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.frequency.chain(this.modulationIndex, this._modulationNode);\n\t this._modulator.connect(this._modulationNode.gain);\n\t this._modulationNode.connect(this._carrier.frequency);\n\t this._carrier.connect(this.output);\n\t this.detune.connect(this._modulator.detune);\n\t this.phase = options.phase;\n\t this._readOnly([\n\t 'modulationIndex',\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t };\n\t Tone.extend(Tone.FMOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.FMOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'modulationIndex': 2,\n\t 'modulationType': 'square',\n\t 'harmonicity': 1\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.FMOscillator.prototype._start = function (time) {\n\t this._modulator.start(time);\n\t this._carrier.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.FMOscillator.prototype._stop = function (time) {\n\t this._modulator.stop(time);\n\t this._carrier.stop(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.FMOscillator.prototype.restart = function (time) {\n\t this._modulator.restart(time);\n\t this._carrier.restart(time);\n\t };\n\t /**\n\t\t * The type of the carrier oscillator\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'type', {\n\t get: function () {\n\t return this._carrier.type;\n\t },\n\t set: function (type) {\n\t this._carrier.type = type;\n\t }\n\t });\n\t /**\n\t\t * The type of the modulator oscillator\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {String}\n\t\t * @name modulationType\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'modulationType', {\n\t get: function () {\n\t return this._modulator.type;\n\t },\n\t set: function (type) {\n\t this._modulator.type = type;\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._carrier.phase;\n\t },\n\t set: function (phase) {\n\t this._carrier.phase = phase;\n\t this._modulator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The partials of the carrier waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._carrier.partials;\n\t },\n\t set: function (partials) {\n\t this._carrier.partials = partials;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.FMOscillator} this\n\t\t */\n\t Tone.FMOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'modulationIndex',\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this.modulationIndex.dispose();\n\t this.modulationIndex = null;\n\t return this;\n\t };\n\t return Tone.FMOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AMOscillator\n\t\t *\n\t\t * @extends {Tone.Oscillator}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {String} type The type of the carrier oscillator.\n\t\t * @param {String} modulationType The type of the modulator oscillator.\n\t\t * @example\n\t\t * //a sine oscillator frequency-modulated by a square wave\n\t\t * var fmOsc = new Tone.AMOscillator(\"Ab3\", \"sine\", \"square\").toMaster().start();\n\t\t */\n\t Tone.AMOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'modulationType'\n\t ], Tone.AMOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The carrier oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Oscillator(options.frequency, options.type);\n\t /**\n\t\t\t * The oscillator's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._carrier.frequency;\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._carrier.detune;\n\t this.detune.value = options.detune;\n\t /**\n\t\t\t * The modulating oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Oscillator(options.frequency, options.modulationType);\n\t /**\n\t\t\t * convert the -1,1 output to 0,1\n\t\t\t * @type {Tone.AudioToGain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationScale = new Tone.AudioToGain();\n\t /**\n\t\t\t * Harmonicity is the frequency ratio between the carrier and the modulator oscillators.\n\t\t\t * A harmonicity of 1 gives both oscillators the same frequency.\n\t\t\t * Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch the modulator an octave below carrier\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain(0);\n\t //connections\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.detune.connect(this._modulator.detune);\n\t this._modulator.chain(this._modulationScale, this._modulationNode.gain);\n\t this._carrier.chain(this._modulationNode, this.output);\n\t this.phase = options.phase;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t };\n\t Tone.extend(Tone.AMOscillator, Tone.Oscillator);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.AMOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'modulationType': 'square',\n\t 'harmonicity': 1\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.AMOscillator.prototype._start = function (time) {\n\t this._modulator.start(time);\n\t this._carrier.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.AMOscillator.prototype._stop = function (time) {\n\t this._modulator.stop(time);\n\t this._carrier.stop(time);\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.AMOscillator.prototype.restart = function (time) {\n\t this._modulator.restart(time);\n\t this._carrier.restart(time);\n\t };\n\t /**\n\t\t * The type of the carrier oscillator\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'type', {\n\t get: function () {\n\t return this._carrier.type;\n\t },\n\t set: function (type) {\n\t this._carrier.type = type;\n\t }\n\t });\n\t /**\n\t\t * The type of the modulator oscillator\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {string}\n\t\t * @name modulationType\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'modulationType', {\n\t get: function () {\n\t return this._modulator.type;\n\t },\n\t set: function (type) {\n\t this._modulator.type = type;\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._carrier.phase;\n\t },\n\t set: function (phase) {\n\t this._carrier.phase = phase;\n\t this._modulator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The partials of the carrier waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._carrier.partials;\n\t },\n\t set: function (partials) {\n\t this._carrier.partials = partials;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.AMOscillator} this\n\t\t */\n\t Tone.AMOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t this.frequency = null;\n\t this.detune = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this._modulationScale.dispose();\n\t this._modulationScale = null;\n\t return this;\n\t };\n\t return Tone.AMOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FatOscillator\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {String} type The type of the carrier oscillator.\n\t\t * @param {String} modulationType The type of the modulator oscillator.\n\t\t * @example\n\t\t * //a sine oscillator frequency-modulated by a square wave\n\t\t * var fmOsc = new Tone.FatOscillator(\"Ab3\", \"sine\", \"square\").toMaster().start();\n\t\t */\n\t Tone.FatOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'spread'\n\t ], Tone.FatOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The oscillator's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * The array of oscillators\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillators = [];\n\t /**\n\t\t\t * The total spread of the oscillators\n\t\t\t * @type {Cents}\n\t\t\t * @private\n\t\t\t */\n\t this._spread = options.spread;\n\t /**\n\t\t\t * The type of the oscillator\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * The phase of the oscillators\n\t\t\t * @type {Degrees}\n\t\t\t * @private\n\t\t\t */\n\t this._phase = options.phase;\n\t /**\n\t\t\t * The partials array\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._partials = Tone.defaultArg(options.partials, []);\n\t //set the count initially\n\t this.count = options.count;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.FatOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.FatOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'spread': 20,\n\t 'count': 3,\n\t 'type': 'sawtooth'\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype._start = function (time) {\n\t time = this.toSeconds(time);\n\t this._forEach(function (osc) {\n\t osc.start(time);\n\t });\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._forEach(function (osc) {\n\t osc.stop(time);\n\t });\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype.restart = function (time) {\n\t time = this.toSeconds(time);\n\t this._forEach(function (osc) {\n\t osc.restart(time);\n\t });\n\t };\n\t /**\n\t\t * Iterate over all of the oscillators\n\t\t * @param {Function} iterator The iterator function\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype._forEach = function (iterator) {\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t iterator.call(this, this._oscillators[i], i);\n\t }\n\t };\n\t /**\n\t\t * The type of the carrier oscillator\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t this._type = type;\n\t this._forEach(function (osc) {\n\t osc.type = type;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The detune spread between the oscillators. If \"count\" is\n\t\t * set to 3 oscillators and the \"spread\" is set to 40,\n\t\t * the three oscillators would be detuned like this: [-20, 0, 20]\n\t\t * for a total detune spread of 40 cents.\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Cents}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'spread', {\n\t get: function () {\n\t return this._spread;\n\t },\n\t set: function (spread) {\n\t this._spread = spread;\n\t if (this._oscillators.length > 1) {\n\t var start = -spread / 2;\n\t var step = spread / (this._oscillators.length - 1);\n\t this._forEach(function (osc, i) {\n\t osc.detune.value = start + step * i;\n\t });\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of detuned oscillators\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Number}\n\t\t * @name count\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'count', {\n\t get: function () {\n\t return this._oscillators.length;\n\t },\n\t set: function (count) {\n\t count = Math.max(count, 1);\n\t if (this._oscillators.length !== count) {\n\t // var partials = this.partials;\n\t // var type = this.type;\n\t //dispose the previous oscillators\n\t this._forEach(function (osc) {\n\t osc.dispose();\n\t });\n\t this._oscillators = [];\n\t for (var i = 0; i < count; i++) {\n\t var osc = new Tone.Oscillator();\n\t if (this.type === Tone.Oscillator.Type.Custom) {\n\t osc.partials = this._partials;\n\t } else {\n\t osc.type = this._type;\n\t }\n\t osc.phase = this._phase;\n\t osc.volume.value = -6 - count * 1.1;\n\t this.frequency.connect(osc.frequency);\n\t this.detune.connect(osc.detune);\n\t osc.connect(this.output);\n\t this._oscillators[i] = osc;\n\t }\n\t //set the spread\n\t this.spread = this._spread;\n\t if (this.state === Tone.State.Started) {\n\t this._forEach(function (osc) {\n\t osc.start();\n\t });\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._phase;\n\t },\n\t set: function (phase) {\n\t this._phase = phase;\n\t this._forEach(function (osc) {\n\t osc.phase = phase;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The partials of the carrier waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._partials;\n\t },\n\t set: function (partials) {\n\t this._partials = partials;\n\t this._type = Tone.Oscillator.Type.Custom;\n\t this._forEach(function (osc) {\n\t osc.partials = partials;\n\t });\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.FatOscillator} this\n\t\t */\n\t Tone.FatOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this._forEach(function (osc) {\n\t osc.dispose();\n\t });\n\t this._oscillators = null;\n\t this._partials = null;\n\t return this;\n\t };\n\t return Tone.FatOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.OmniOscillator aggregates Tone.Oscillator, Tone.PulseOscillator,\n\t\t * Tone.PWMOscillator, Tone.FMOscillator, Tone.AMOscillator, and Tone.FatOscillator\n\t\t * into one class. The oscillator class can be changed by setting the `type`.\n\t\t * `omniOsc.type = \"pwm\"` will set it to the Tone.PWMOscillator. Prefixing\n\t\t * any of the basic types (\"sine\", \"square4\", etc.) with \"fm\", \"am\", or \"fat\"\n\t\t * will use the FMOscillator, AMOscillator or FatOscillator respectively.\n\t\t * For example: `omniOsc.type = \"fatsawtooth\"` will create set the oscillator\n\t\t * to a FatOscillator of type \"sawtooth\".\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The initial frequency of the oscillator.\n\t\t * @param {String} type The type of the oscillator.\n\t\t * @example\n\t\t * var omniOsc = new Tone.OmniOscillator(\"C#4\", \"pwm\");\n\t\t */\n\t Tone.OmniOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type'\n\t ], Tone.OmniOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * the type of the oscillator source\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._sourceType = undefined;\n\t /**\n\t\t\t * the oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = null;\n\t //set the oscillator\n\t this.type = options.type;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t //set the options\n\t this.set(options);\n\t };\n\t Tone.extend(Tone.OmniOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.OmniOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'type': 'sine',\n\t 'phase': 0\n\t };\n\t /**\n\t\t * @enum {String}\n\t\t * @private\n\t\t */\n\t var OmniOscType = {\n\t Pulse: 'PulseOscillator',\n\t PWM: 'PWMOscillator',\n\t Osc: 'Oscillator',\n\t FM: 'FMOscillator',\n\t AM: 'AMOscillator',\n\t Fat: 'FatOscillator'\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now] the time to start the oscillator\n\t\t * @private\n\t\t */\n\t Tone.OmniOscillator.prototype._start = function (time) {\n\t this._oscillator.start(time);\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now] the time to start the oscillator\n\t\t * @private\n\t\t */\n\t Tone.OmniOscillator.prototype._stop = function (time) {\n\t this._oscillator.stop(time);\n\t };\n\t Tone.OmniOscillator.prototype.restart = function (time) {\n\t this._oscillator.restart(time);\n\t };\n\t /**\n\t\t * The type of the oscillator. Can be any of the basic types: sine, square, triangle, sawtooth. Or\n\t\t * prefix the basic types with \"fm\", \"am\", or \"fat\" to use the FMOscillator, AMOscillator or FatOscillator\n\t\t * types. The oscillator could also be set to \"pwm\" or \"pulse\". All of the parameters of the\n\t\t * oscillator's class are accessible when the oscillator is set to that type, but throws an error\n\t\t * when it's not.\n\t\t *\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {String}\n\t\t * @name type\n\t\t * @example\n\t\t * omniOsc.type = \"pwm\";\n\t\t * //modulationFrequency is parameter which is available\n\t\t * //only when the type is \"pwm\".\n\t\t * omniOsc.modulationFrequency.value = 0.5;\n\t\t * @example\n\t\t * //an square wave frequency modulated by a sawtooth\n\t\t * omniOsc.type = \"fmsquare\";\n\t\t * omniOsc.modulationType = \"sawtooth\";\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'type', {\n\t get: function () {\n\t var prefix = '';\n\t if (this._sourceType === OmniOscType.FM) {\n\t prefix = 'fm';\n\t } else if (this._sourceType === OmniOscType.AM) {\n\t prefix = 'am';\n\t } else if (this._sourceType === OmniOscType.Fat) {\n\t prefix = 'fat';\n\t }\n\t return prefix + this._oscillator.type;\n\t },\n\t set: function (type) {\n\t if (type.substr(0, 2) === 'fm') {\n\t this._createNewOscillator(OmniOscType.FM);\n\t this._oscillator.type = type.substr(2);\n\t } else if (type.substr(0, 2) === 'am') {\n\t this._createNewOscillator(OmniOscType.AM);\n\t this._oscillator.type = type.substr(2);\n\t } else if (type.substr(0, 3) === 'fat') {\n\t this._createNewOscillator(OmniOscType.Fat);\n\t this._oscillator.type = type.substr(3);\n\t } else if (type === 'pwm') {\n\t this._createNewOscillator(OmniOscType.PWM);\n\t } else if (type === 'pulse') {\n\t this._createNewOscillator(OmniOscType.Pulse);\n\t } else {\n\t this._createNewOscillator(OmniOscType.Osc);\n\t this._oscillator.type = type;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The partials of the waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * This is not available on \"pwm\" and \"pulse\" oscillator types.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._oscillator.partials;\n\t },\n\t set: function (partials) {\n\t this._oscillator.partials = partials;\n\t }\n\t });\n\t /**\n\t\t * Set a member/attribute of the oscillator.\n\t\t * @param {Object|String} params\n\t\t * @param {number=} value\n\t\t * @param {Time=} rampTime\n\t\t * @returns {Tone.OmniOscillator} this\n\t\t */\n\t Tone.OmniOscillator.prototype.set = function (params, value) {\n\t //make sure the type is set first\n\t if (params === 'type') {\n\t this.type = value;\n\t } else if (Tone.isObject(params) && params.hasOwnProperty('type')) {\n\t this.type = params.type;\n\t }\n\t //then set the rest\n\t Tone.prototype.set.apply(this, arguments);\n\t return this;\n\t };\n\t /**\n\t\t * connect the oscillator to the frequency and detune signals\n\t\t * @private\n\t\t */\n\t Tone.OmniOscillator.prototype._createNewOscillator = function (oscType) {\n\t if (oscType !== this._sourceType) {\n\t this._sourceType = oscType;\n\t var OscillatorConstructor = Tone[oscType];\n\t //short delay to avoid clicks on the change\n\t var now = this.now();\n\t if (this._oscillator !== null) {\n\t var oldOsc = this._oscillator;\n\t oldOsc.stop(now);\n\t //dispose the old one\n\t this.context.setTimeout(function () {\n\t oldOsc.dispose();\n\t oldOsc = null;\n\t }, this.blockTime);\n\t }\n\t this._oscillator = new OscillatorConstructor();\n\t this.frequency.connect(this._oscillator.frequency);\n\t this.detune.connect(this._oscillator.detune);\n\t this._oscillator.connect(this.output);\n\t if (this.state === Tone.State.Started) {\n\t this._oscillator.start(now);\n\t }\n\t }\n\t };\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Degrees}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._oscillator.phase;\n\t },\n\t set: function (phase) {\n\t this._oscillator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The width of the oscillator (only if the oscillator is set to \"pulse\")\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {NormalRange}\n\t\t * @signal\n\t\t * @name width\n\t\t * @example\n\t\t * var omniOsc = new Tone.OmniOscillator(440, \"pulse\");\n\t\t * //can access the width attribute only if type === \"pulse\"\n\t\t * omniOsc.width.value = 0.2;\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'width', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.Pulse) {\n\t return this._oscillator.width;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of detuned oscillators\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Number}\n\t\t * @name count\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'count', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t return this._oscillator.count;\n\t }\n\t },\n\t set: function (count) {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t this._oscillator.count = count;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The detune spread between the oscillators. If \"count\" is\n\t\t * set to 3 oscillators and the \"spread\" is set to 40,\n\t\t * the three oscillators would be detuned like this: [-20, 0, 20]\n\t\t * for a total detune spread of 40 cents. See Tone.FatOscillator\n\t\t * for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Cents}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'spread', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t return this._oscillator.spread;\n\t }\n\t },\n\t set: function (spread) {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t this._oscillator.spread = spread;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The type of the modulator oscillator. Only if the oscillator\n\t\t * is set to \"am\" or \"fm\" types. see. Tone.AMOscillator or Tone.FMOscillator\n\t\t * for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {String}\n\t\t * @name modulationType\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'modulationType', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.FM || this._sourceType === OmniOscType.AM) {\n\t return this._oscillator.modulationType;\n\t }\n\t },\n\t set: function (mType) {\n\t if (this._sourceType === OmniOscType.FM || this._sourceType === OmniOscType.AM) {\n\t this._oscillator.modulationType = mType;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The modulation index which is in essence the depth or amount of the modulation. In other terms it is the\n\t\t * ratio of the frequency of the modulating signal (mf) to the amplitude of the\n\t\t * modulating signal (ma) -- as in ma/mf.\n\t\t * See Tone.FMOscillator for more info.\n\t\t * @type {Positive}\n\t\t * @signal\n\t\t * @name modulationIndex\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'modulationIndex', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.FM) {\n\t return this._oscillator.modulationIndex;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Harmonicity is the frequency ratio between the carrier and the modulator oscillators.\n\t\t * A harmonicity of 1 gives both oscillators the same frequency.\n\t\t * Harmonicity = 2 means a change of an octave. See Tone.AMOscillator or Tone.FMOscillator\n\t\t * for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @signal\n\t\t * @type {Positive}\n\t\t * @name harmonicity\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'harmonicity', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.FM || this._sourceType === OmniOscType.AM) {\n\t return this._oscillator.harmonicity;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The modulationFrequency Signal of the oscillator\n\t\t * (only if the oscillator type is set to pwm). See\n\t\t * Tone.PWMOscillator for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Frequency}\n\t\t * @signal\n\t\t * @name modulationFrequency\n\t\t * @example\n\t\t * var omniOsc = new Tone.OmniOscillator(440, \"pwm\");\n\t\t * //can access the modulationFrequency attribute only if type === \"pwm\"\n\t\t * omniOsc.modulationFrequency.value = 0.2;\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'modulationFrequency', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.PWM) {\n\t return this._oscillator.modulationFrequency;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.OmniOscillator} this\n\t\t */\n\t Tone.OmniOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this._oscillator.dispose();\n\t this._oscillator = null;\n\t this._sourceType = null;\n\t return this;\n\t };\n\t return Tone.OmniOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base-class for all instruments\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t */\n\t Tone.Instrument = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.Instrument.defaults);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The output and volume triming node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * source.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t /**\n\t\t\t * Keep track of all events scheduled to the transport\n\t\t\t * when the instrument is 'synced'\n\t\t\t * @type {Array<Number>}\n\t\t\t * @private\n\t\t\t */\n\t this._scheduledEvents = [];\n\t };\n\t Tone.extend(Tone.Instrument, Tone.AudioNode);\n\t /**\n\t\t * the default attributes\n\t\t * @type {object}\n\t\t */\n\t Tone.Instrument.defaults = {\n\t /** the volume of the output in decibels */\n\t 'volume': 0\n\t };\n\t /**\n\t\t * @abstract\n\t\t * @param {string|number} note the note to trigger\n\t\t * @param {Time} [time=now] the time to trigger the ntoe\n\t\t * @param {number} [velocity=1] the velocity to trigger the note\n\t\t */\n\t Tone.Instrument.prototype.triggerAttack = Tone.noOp;\n\t /**\n\t\t * @abstract\n\t\t * @param {Time} [time=now] when to trigger the release\n\t\t */\n\t Tone.Instrument.prototype.triggerRelease = Tone.noOp;\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * instrument.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * instrument.triggerAttackRelease('C4', '8n', 0)\n\t\t * instrument.triggerAttackRelease('E4', '8n', '8n')\n\t\t * instrument.triggerAttackRelease('G4', '8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Instrument.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 1);\n\t this._syncMethod('triggerRelease', 0);\n\t return this;\n\t };\n\t /**\n\t\t * Wrap the given method so that it can be synchronized\n\t\t * @param {String} method Which method to wrap and sync\n\t\t * @param {Number} timePosition What position the time argument appears in\n\t\t * @private\n\t\t */\n\t Tone.Instrument.prototype._syncMethod = function (method, timePosition) {\n\t var originalMethod = this['_original_' + method] = this[method];\n\t this[method] = function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t var time = args[timePosition];\n\t var id = Tone.Transport.schedule(function (t) {\n\t args[timePosition] = t;\n\t originalMethod.apply(this, args);\n\t }.bind(this), time);\n\t this._scheduledEvents.push(id);\n\t }.bind(this);\n\t };\n\t /**\n\t\t * Unsync the instrument from the Transport\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Instrument.prototype.unsync = function () {\n\t this._scheduledEvents.forEach(function (id) {\n\t Tone.Transport.clear(id);\n\t });\n\t this._scheduledEvents = [];\n\t if (this._original_triggerAttack) {\n\t this.triggerAttack = this._original_triggerAttack;\n\t this.triggerRelease = this._original_triggerRelease;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and then the release after the duration.\n\t\t * @param {Frequency} note The note to trigger.\n\t\t * @param {Time} duration How long the note should be held for before\n\t\t * triggering the release. This value must be greater than 0.\n\t\t * @param {Time} [time=now] When the note should be triggered.\n\t\t * @param {NormalRange} [velocity=1] The velocity the note should be triggered at.\n\t\t * @returns {Tone.Instrument} this\n\t\t * @example\n\t\t * //trigger \"C4\" for the duration of an 8th note\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\");\n\t\t */\n\t Tone.Instrument.prototype.triggerAttackRelease = function (note, duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(note, time, velocity);\n\t this.triggerRelease(time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Instrument.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._volume.dispose();\n\t this._volume = null;\n\t this._writable(['volume']);\n\t this.volume = null;\n\t this.unsync();\n\t this._scheduledEvents = null;\n\t return this;\n\t };\n\t return Tone.Instrument;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class This is an abstract base class for other monophonic instruments to \n\t\t * extend. IMPORTANT: It does not make any sound on its own and\n\t\t * shouldn't be directly instantiated.\n\t\t *\n\t\t * @constructor\n\t\t * @abstract\n\t\t * @extends {Tone.Instrument}\n\t\t */\n\t Tone.Monophonic = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.Monophonic.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The glide time between notes. \n\t\t\t * @type {Time}\n\t\t\t */\n\t this.portamento = options.portamento;\n\t };\n\t Tone.extend(Tone.Monophonic, Tone.Instrument);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Monophonic.defaults = { 'portamento': 0 };\n\t /**\n\t\t * Trigger the attack of the note optionally with a given velocity. \n\t\t * \n\t\t * \n\t\t * @param {Frequency} note The note to trigger.\n\t\t * @param {Time} [time=now] When the note should start.\n\t\t * @param {number} [velocity=1] velocity The velocity scaler \n\t\t * determines how \"loud\" the note \n\t\t * will be triggered.\n\t\t * @returns {Tone.Monophonic} this\n\t\t * @example\n\t\t * synth.triggerAttack(\"C4\");\n\t\t * @example\n\t\t * //trigger the note a half second from now at half velocity\n\t\t * synth.triggerAttack(\"C4\", \"+0.5\", 0.5);\n\t\t */\n\t Tone.Monophonic.prototype.triggerAttack = function (note, time, velocity) {\n\t time = this.toSeconds(time);\n\t this._triggerEnvelopeAttack(time, velocity);\n\t this.setNote(note, time);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release portion of the envelope\n\t\t * @param {Time} [time=now] If no time is given, the release happens immediatly\n\t\t * @returns {Tone.Monophonic} this\n\t\t * @example\n\t\t * synth.triggerRelease();\n\t\t */\n\t Tone.Monophonic.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * override this method with the actual method\n\t\t * @abstract\n\t\t * @private\n\t\t */\n\t Tone.Monophonic.prototype._triggerEnvelopeAttack = function () {\n\t };\n\t /**\n\t\t * override this method with the actual method\n\t\t * @abstract\n\t\t * @private\n\t\t */\n\t Tone.Monophonic.prototype._triggerEnvelopeRelease = function () {\n\t };\n\t /**\n\t\t * Get the level of the output at the given time. Measures\n\t\t * the envelope(s) value at the time. \n\t\t * @param {Time} time The time to query the envelope value\n\t\t * @return {NormalRange} The output level between 0-1\n\t\t */\n\t Tone.Monophonic.prototype.getLevelAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t return this.envelope.getValueAtTime(time);\n\t };\n\t /**\n\t\t * Set the note at the given time. If no time is given, the note\n\t\t * will set immediately. \n\t\t * @param {Frequency} note The note to change to.\n\t\t * @param {Time} [time=now] The time when the note should be set. \n\t\t * @returns {Tone.Monophonic} this\n\t\t * @example\n\t\t * //change to F#6 in one quarter note from now.\n\t\t * synth.setNote(\"F#6\", \"+4n\");\n\t\t * @example\n\t\t * //change to Bb4 right now\n\t\t * synth.setNote(\"Bb4\");\n\t\t */\n\t Tone.Monophonic.prototype.setNote = function (note, time) {\n\t time = this.toSeconds(time);\n\t if (this.portamento > 0 && this.getLevelAtTime(time) > 0.05) {\n\t var portTime = this.toSeconds(this.portamento);\n\t this.frequency.exponentialRampTo(note, portTime, time);\n\t } else {\n\t this.frequency.setValueAtTime(note, time);\n\t }\n\t return this;\n\t };\n\t return Tone.Monophonic;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Synth is composed simply of a Tone.OmniOscillator\n\t\t * routed through a Tone.AmplitudeEnvelope.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1-1_0YW2Z1J2EPI36P8fNCMcZG7N1w1GZluPs4og4evo/pub?w=1163&h=231\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.Synth().toMaster();\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\");\n\t\t */\n\t Tone.Synth = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.Synth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.OmniOscillator}\n\t\t\t */\n\t this.oscillator = new Tone.OmniOscillator(options.oscillator);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this.oscillator.frequency;\n\t /**\n\t\t\t * The detune control.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this.oscillator.detune;\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t //connect the oscillators to the output\n\t this.oscillator.chain(this.envelope, this.output);\n\t this._readOnly([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.Synth, Tone.Monophonic);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Synth.defaults = {\n\t 'oscillator': { 'type': 'triangle' },\n\t 'envelope': {\n\t 'attack': 0.005,\n\t 'decay': 0.1,\n\t 'sustain': 0.3,\n\t 'release': 1\n\t }\n\t };\n\t /**\n\t\t * start the attack portion of the envelope\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {number} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.Synth} this\n\t\t * @private\n\t\t */\n\t Tone.Synth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t //the envelopes\n\t this.envelope.triggerAttack(time, velocity);\n\t this.oscillator.start(time);\n\t //if there is no release portion, stop the oscillator\n\t if (this.envelope.sustain === 0) {\n\t this.oscillator.stop(time + this.envelope.attack + this.envelope.decay);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * start the release portion of the envelope\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.Synth} this\n\t\t * @private\n\t\t */\n\t Tone.Synth.prototype._triggerEnvelopeRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this.envelope.triggerRelease(time);\n\t this.oscillator.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Synth} this\n\t\t */\n\t Tone.Synth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'envelope'\n\t ]);\n\t this.oscillator.dispose();\n\t this.oscillator = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t this.frequency = null;\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.Synth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class AMSynth uses the output of one Tone.Synth to modulate the\n\t\t * amplitude of another Tone.Synth. The harmonicity (the ratio between\n\t\t * the two signals) affects the timbre of the output signal greatly.\n\t\t * Read more about Amplitude Modulation Synthesis on\n\t\t * [SoundOnSound](https://web.archive.org/web/20160404103653/http://www.soundonsound.com:80/sos/mar00/articles/synthsecrets.htm).\n\t\t * <img src=\"https://docs.google.com/drawings/d/1TQu8Ed4iFr1YTLKpB3U1_hur-UwBrh5gdBXc8BxfGKw/pub?w=1009&h=457\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.AMSynth().toMaster();\n\t\t * synth.triggerAttackRelease(\"C4\", \"4n\");\n\t\t */\n\t Tone.AMSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.AMSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The carrier voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Synth();\n\t this._carrier.volume.value = -10;\n\t /**\n\t\t\t * The carrier's oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.oscillator = this._carrier.oscillator;\n\t /**\n\t\t\t * The carrier's envelope\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = this._carrier.envelope.set(options.envelope);\n\t /**\n\t\t\t * The modulator voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Synth();\n\t this._modulator.volume.value = -10;\n\t /**\n\t\t\t * The modulator's oscillator which is applied\n\t\t\t * to the amplitude of the oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.modulation = this._modulator.oscillator.set(options.modulation);\n\t /**\n\t\t\t * The modulator's envelope\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.modulationEnvelope = this._modulator.envelope.set(options.modulationEnvelope);\n\t /**\n\t\t\t * The frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(440, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune in cents\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * Harmonicity is the ratio between the two voices. A harmonicity of\n\t\t\t * 1 is no change. Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch voice1 an octave below voice0\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * convert the -1,1 output to 0,1\n\t\t\t * @type {Tone.AudioToGain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationScale = new Tone.AudioToGain();\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain();\n\t //control the two voices frequency\n\t this.frequency.connect(this._carrier.frequency);\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.detune.fan(this._carrier.detune, this._modulator.detune);\n\t this._modulator.chain(this._modulationScale, this._modulationNode.gain);\n\t this._carrier.chain(this._modulationNode, this.output);\n\t this._readOnly([\n\t 'frequency',\n\t 'harmonicity',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.AMSynth, Tone.Monophonic);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AMSynth.defaults = {\n\t 'harmonicity': 3,\n\t 'detune': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0.01,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'modulation': { 'type': 'square' },\n\t 'modulationEnvelope': {\n\t 'attack': 0.5,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t };\n\t /**\n\t\t * trigger the attack portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will occur\n\t\t * @param {NormalRange} [velocity=1] the velocity of the note\n\t\t * @private\n\t\t * @returns {Tone.AMSynth} this\n\t\t */\n\t Tone.AMSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t //the port glide\n\t time = this.toSeconds(time);\n\t //the envelopes\n\t this._carrier._triggerEnvelopeAttack(time, velocity);\n\t this._modulator._triggerEnvelopeAttack(time);\n\t return this;\n\t };\n\t /**\n\t\t * trigger the release portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will release\n\t\t * @private\n\t\t * @returns {Tone.AMSynth} this\n\t\t */\n\t Tone.AMSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t this._carrier._triggerEnvelopeRelease(time);\n\t this._modulator._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.AMSynth} this\n\t\t */\n\t Tone.AMSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'harmonicity',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._modulationScale.dispose();\n\t this._modulationScale = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this.oscillator = null;\n\t this.envelope = null;\n\t this.modulationEnvelope = null;\n\t this.modulation = null;\n\t return this;\n\t };\n\t return Tone.AMSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.MonoSynth is composed of one oscillator, one filter, and two envelopes.\n\t\t * The amplitude of the Tone.Oscillator and the cutoff frequency of the\n\t\t * Tone.Filter are controlled by Tone.Envelopes.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1gaY1DF9_Hzkodqf8JI1Cg2VZfwSElpFQfI94IQwad38/pub?w=924&h=240\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.MonoSynth({\n\t\t * \t\"oscillator\" : {\n\t\t * \t\t\"type\" : \"square\"\n\t\t * },\n\t\t * \"envelope\" : {\n\t\t * \t\"attack\" : 0.1\n\t\t * }\n\t\t * }).toMaster();\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\");\n\t\t */\n\t Tone.MonoSynth = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.MonoSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.OmniOscillator}\n\t\t\t */\n\t this.oscillator = new Tone.OmniOscillator(options.oscillator);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this.oscillator.frequency;\n\t /**\n\t\t\t * The detune control.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this.oscillator.detune;\n\t /**\n\t\t\t * The filter.\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.filter = new Tone.Filter(options.filter);\n\t /**\n\t\t\t * The filter envelope.\n\t\t\t * @type {Tone.FrequencyEnvelope}\n\t\t\t */\n\t this.filterEnvelope = new Tone.FrequencyEnvelope(options.filterEnvelope);\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t //connect the oscillators to the output\n\t this.oscillator.chain(this.filter, this.envelope, this.output);\n\t //connect the filter envelope\n\t this.filterEnvelope.connect(this.filter.frequency);\n\t this._readOnly([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'filter',\n\t 'filterEnvelope',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.MonoSynth, Tone.Monophonic);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MonoSynth.defaults = {\n\t 'frequency': 'C4',\n\t 'detune': 0,\n\t 'oscillator': { 'type': 'square' },\n\t 'filter': {\n\t 'Q': 6,\n\t 'type': 'lowpass',\n\t 'rolloff': -24\n\t },\n\t 'envelope': {\n\t 'attack': 0.005,\n\t 'decay': 0.1,\n\t 'sustain': 0.9,\n\t 'release': 1\n\t },\n\t 'filterEnvelope': {\n\t 'attack': 0.06,\n\t 'decay': 0.2,\n\t 'sustain': 0.5,\n\t 'release': 2,\n\t 'baseFrequency': 200,\n\t 'octaves': 7,\n\t 'exponent': 2\n\t }\n\t };\n\t /**\n\t\t * start the attack portion of the envelope\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {NormalRange} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.MonoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.MonoSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t //the envelopes\n\t this.envelope.triggerAttack(time, velocity);\n\t this.filterEnvelope.triggerAttack(time);\n\t this.oscillator.start(time);\n\t if (this.envelope.sustain === 0) {\n\t this.oscillator.stop(time + this.envelope.attack + this.envelope.decay);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * start the release portion of the envelope\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.MonoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.MonoSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t this.envelope.triggerRelease(time);\n\t this.filterEnvelope.triggerRelease(time);\n\t this.oscillator.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MonoSynth} this\n\t\t */\n\t Tone.MonoSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'filter',\n\t 'filterEnvelope',\n\t 'envelope'\n\t ]);\n\t this.oscillator.dispose();\n\t this.oscillator = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t this.filterEnvelope.dispose();\n\t this.filterEnvelope = null;\n\t this.filter.dispose();\n\t this.filter = null;\n\t this.frequency = null;\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.MonoSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.DuoSynth is a monophonic synth composed of two\n\t\t * MonoSynths run in parallel with control over the\n\t\t * frequency ratio between the two voices and vibrato effect.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1bL4GXvfRMMlqS7XyBm9CjL9KJPSUKbcdBNpqOlkFLxk/pub?w=1012&h=448\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var duoSynth = new Tone.DuoSynth().toMaster();\n\t\t * duoSynth.triggerAttackRelease(\"C4\", \"2n\");\n\t\t */\n\t Tone.DuoSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.DuoSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * the first voice\n\t\t\t * @type {Tone.MonoSynth}\n\t\t\t */\n\t this.voice0 = new Tone.MonoSynth(options.voice0);\n\t this.voice0.volume.value = -10;\n\t /**\n\t\t\t * the second voice\n\t\t\t * @type {Tone.MonoSynth}\n\t\t\t */\n\t this.voice1 = new Tone.MonoSynth(options.voice1);\n\t this.voice1.volume.value = -10;\n\t /**\n\t\t\t * The vibrato LFO.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._vibrato = new Tone.LFO(options.vibratoRate, -50, 50);\n\t this._vibrato.start();\n\t /**\n\t\t\t * the vibrato frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.vibratoRate = this._vibrato.frequency;\n\t /**\n\t\t\t * the vibrato gain\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._vibratoGain = new Tone.Gain(options.vibratoAmount, Tone.Type.Positive);\n\t /**\n\t\t\t * The amount of vibrato\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.vibratoAmount = this._vibratoGain.gain;\n\t /**\n\t\t\t * the frequency control\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(440, Tone.Type.Frequency);\n\t /**\n\t\t\t * Harmonicity is the ratio between the two voices. A harmonicity of\n\t\t\t * 1 is no change. Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch voice1 an octave below voice0\n\t\t\t * duoSynth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t //control the two voices frequency\n\t this.frequency.connect(this.voice0.frequency);\n\t this.frequency.chain(this.harmonicity, this.voice1.frequency);\n\t this._vibrato.connect(this._vibratoGain);\n\t this._vibratoGain.fan(this.voice0.detune, this.voice1.detune);\n\t this.voice0.connect(this.output);\n\t this.voice1.connect(this.output);\n\t this._readOnly([\n\t 'voice0',\n\t 'voice1',\n\t 'frequency',\n\t 'vibratoAmount',\n\t 'vibratoRate'\n\t ]);\n\t };\n\t Tone.extend(Tone.DuoSynth, Tone.Monophonic);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.DuoSynth.defaults = {\n\t 'vibratoAmount': 0.5,\n\t 'vibratoRate': 5,\n\t 'harmonicity': 1.5,\n\t 'voice0': {\n\t 'volume': -10,\n\t 'portamento': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'filterEnvelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t },\n\t 'voice1': {\n\t 'volume': -10,\n\t 'portamento': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'filterEnvelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t }\n\t };\n\t /**\n\t\t * start the attack portion of the envelopes\n\t\t *\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {NormalRange} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.DuoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.DuoSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t this.voice0._triggerEnvelopeAttack(time, velocity);\n\t this.voice1._triggerEnvelopeAttack(time, velocity);\n\t return this;\n\t };\n\t /**\n\t\t * start the release portion of the envelopes\n\t\t *\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.DuoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.DuoSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t this.voice0._triggerEnvelopeRelease(time);\n\t this.voice1._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the level of the output at the given time. Measures\n\t\t * the envelope(s) value at the time. \n\t\t * @param {Time} time The time to query the envelope value\n\t\t * @return {NormalRange} The output level between 0-1\n\t\t */\n\t Tone.DuoSynth.prototype.getLevelAtTime = function (time) {\n\t return (this.voice0.getLevelAtTime(time) + this.voice1.getLevelAtTime(time)) / 2;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.DuoSynth} this\n\t\t */\n\t Tone.DuoSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'voice0',\n\t 'voice1',\n\t 'frequency',\n\t 'vibratoAmount',\n\t 'vibratoRate'\n\t ]);\n\t this.voice0.dispose();\n\t this.voice0 = null;\n\t this.voice1.dispose();\n\t this.voice1 = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this._vibratoGain.dispose();\n\t this._vibratoGain = null;\n\t this._vibrato = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this.vibratoAmount.dispose();\n\t this.vibratoAmount = null;\n\t this.vibratoRate = null;\n\t return this;\n\t };\n\t return Tone.DuoSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class FMSynth is composed of two Tone.Synths where one Tone.Synth modulates\n\t\t * the frequency of a second Tone.Synth. A lot of spectral content\n\t\t * can be explored using the modulationIndex parameter. Read more about\n\t\t * frequency modulation synthesis on Sound On Sound: [Part 1](https://web.archive.org/web/20160403123704/http://www.soundonsound.com/sos/apr00/articles/synthsecrets.htm), [Part 2](https://web.archive.org/web/20160403115835/http://www.soundonsound.com/sos/may00/articles/synth.htm).\n\t\t * <img src=\"https://docs.google.com/drawings/d/1h0PUDZXPgi4Ikx6bVT6oncrYPLluFKy7lj53puxj-DM/pub?w=902&h=462\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var fmSynth = new Tone.FMSynth().toMaster();\n\t\t * fmSynth.triggerAttackRelease(\"C5\", \"4n\");\n\t\t */\n\t Tone.FMSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.FMSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The carrier voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Synth(options.carrier);\n\t this._carrier.volume.value = -10;\n\t /**\n\t\t\t * The carrier's oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.oscillator = this._carrier.oscillator;\n\t /**\n\t\t\t * The carrier's envelope\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.envelope = this._carrier.envelope.set(options.envelope);\n\t /**\n\t\t\t * The modulator voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Synth(options.modulator);\n\t this._modulator.volume.value = -10;\n\t /**\n\t\t\t * The modulator's oscillator which is applied\n\t\t\t * to the amplitude of the oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.modulation = this._modulator.oscillator.set(options.modulation);\n\t /**\n\t\t\t * The modulator's envelope\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.modulationEnvelope = this._modulator.envelope.set(options.modulationEnvelope);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(440, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune in cents\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * Harmonicity is the ratio between the two voices. A harmonicity of\n\t\t\t * 1 is no change. Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch voice1 an octave below voice0\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * The modulation index which essentially the depth or amount of the modulation. It is the\n\t\t\t * ratio of the frequency of the modulating signal (mf) to the amplitude of the\n\t\t\t * modulating signal (ma) -- as in ma/mf.\n\t\t\t *\t@type {Positive}\n\t\t\t *\t@signal\n\t\t\t */\n\t this.modulationIndex = new Tone.Multiply(options.modulationIndex);\n\t this.modulationIndex.units = Tone.Type.Positive;\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain(0);\n\t //control the two voices frequency\n\t this.frequency.connect(this._carrier.frequency);\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.frequency.chain(this.modulationIndex, this._modulationNode);\n\t this.detune.fan(this._carrier.detune, this._modulator.detune);\n\t this._modulator.connect(this._modulationNode.gain);\n\t this._modulationNode.connect(this._carrier.frequency);\n\t this._carrier.connect(this.output);\n\t this._readOnly([\n\t 'frequency',\n\t 'harmonicity',\n\t 'modulationIndex',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.FMSynth, Tone.Monophonic);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.FMSynth.defaults = {\n\t 'harmonicity': 3,\n\t 'modulationIndex': 10,\n\t 'detune': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0.01,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'modulation': { 'type': 'square' },\n\t 'modulationEnvelope': {\n\t 'attack': 0.5,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t };\n\t /**\n\t\t * \ttrigger the attack portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will occur\n\t\t * @param {number} [velocity=1] the velocity of the note\n\t\t * @returns {Tone.FMSynth} this\n\t\t * @private\n\t\t */\n\t Tone.FMSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t //the envelopes\n\t this._carrier._triggerEnvelopeAttack(time, velocity);\n\t this._modulator._triggerEnvelopeAttack(time);\n\t return this;\n\t };\n\t /**\n\t\t * trigger the release portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will release\n\t\t * @returns {Tone.FMSynth} this\n\t\t * @private\n\t\t */\n\t Tone.FMSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this._carrier._triggerEnvelopeRelease(time);\n\t this._modulator._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FMSynth} this\n\t\t */\n\t Tone.FMSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'harmonicity',\n\t 'modulationIndex',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.modulationIndex.dispose();\n\t this.modulationIndex = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this.oscillator = null;\n\t this.envelope = null;\n\t this.modulationEnvelope = null;\n\t this.modulation = null;\n\t return this;\n\t };\n\t return Tone.FMSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.MembraneSynth makes kick and tom sounds using a single oscillator\n\t\t * with an amplitude envelope and frequency ramp. A Tone.OmniOscillator\n\t\t * is routed through a Tone.AmplitudeEnvelope to the output. The drum\n\t\t * quality of the sound comes from the frequency envelope applied\n\t\t * during Tone.MembraneSynth.triggerAttack(note). The frequency envelope\n\t\t * starts at <code>note * .octaves</code> and ramps to <code>note</code>\n\t\t * over the duration of <code>.pitchDecay</code>.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.MembraneSynth().toMaster();\n\t\t * synth.triggerAttackRelease(\"C2\", \"8n\");\n\t\t */\n\t Tone.MembraneSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.MembraneSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.OmniOscillator}\n\t\t\t */\n\t this.oscillator = new Tone.OmniOscillator(options.oscillator);\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t /**\n\t\t\t * The number of octaves the pitch envelope ramps.\n\t\t\t * @type {Positive}\n\t\t\t */\n\t this.octaves = options.octaves;\n\t /**\n\t\t\t * The amount of time the frequency envelope takes.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.pitchDecay = options.pitchDecay;\n\t this.oscillator.chain(this.envelope, this.output);\n\t this._readOnly([\n\t 'oscillator',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.MembraneSynth, Tone.Instrument);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MembraneSynth.defaults = {\n\t 'pitchDecay': 0.05,\n\t 'octaves': 10,\n\t 'oscillator': { 'type': 'sine' },\n\t 'envelope': {\n\t 'attack': 0.001,\n\t 'decay': 0.4,\n\t 'sustain': 0.01,\n\t 'release': 1.4,\n\t 'attackCurve': 'exponential'\n\t }\n\t };\n\t /**\n\t\t * Trigger the note at the given time with the given velocity.\n\t\t *\n\t\t * @param {Frequency} note the note\n\t\t * @param {Time} [time=now] the time, if not given is now\n\t\t * @param {number} [velocity=1] velocity defaults to 1\n\t\t * @returns {Tone.MembraneSynth} this\n\t\t * @example\n\t\t * kick.triggerAttack(60);\n\t\t */\n\t Tone.MembraneSynth.prototype.triggerAttack = function (note, time, velocity) {\n\t time = this.toSeconds(time);\n\t note = this.toFrequency(note);\n\t var maxNote = note * this.octaves;\n\t this.oscillator.frequency.setValueAtTime(maxNote, time);\n\t this.oscillator.frequency.exponentialRampToValueAtTime(note, time + this.toSeconds(this.pitchDecay));\n\t this.envelope.triggerAttack(time, velocity);\n\t this.oscillator.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release portion of the note.\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will release\n\t\t * @returns {Tone.MembraneSynth} this\n\t\t */\n\t Tone.MembraneSynth.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this.envelope.triggerRelease(time);\n\t this.oscillator.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MembraneSynth} this\n\t\t */\n\t Tone.MembraneSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._writable([\n\t 'oscillator',\n\t 'envelope'\n\t ]);\n\t this.oscillator.dispose();\n\t this.oscillator = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t return this;\n\t };\n\t return Tone.MembraneSynth;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * Inharmonic ratio of frequencies based on the Roland TR-808\n\t\t * Taken from https://ccrma.stanford.edu/papers/tr-808-cymbal-physically-informed-circuit-bendable-digital-model\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var inharmRatios = [\n\t 1,\n\t 1.483,\n\t 1.932,\n\t 2.546,\n\t 2.63,\n\t 3.897\n\t ];\n\t /**\n\t\t * @class A highly inharmonic and spectrally complex source with a highpass filter\n\t\t * and amplitude envelope which is good for making metalophone sounds. Based\n\t\t * on CymbalSynth by [@polyrhythmatic](https://github.com/polyrhythmatic).\n\t\t * Inspiration from [Sound on Sound](https://web.archive.org/web/20160610143924/https://www.soundonsound.com/sos/jul02/articles/synthsecrets0702.asp).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] The options availble for the synth\n\t\t * see defaults below\n\t\t */\n\t Tone.MetalSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.MetalSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The frequency of the cymbal\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The array of FMOscillators\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillators = [];\n\t /**\n\t\t\t * The frequency multipliers\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._freqMultipliers = [];\n\t /**\n\t\t\t * The amplitude for the body\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._amplitue = new Tone.Gain(0).connect(this.output);\n\t /**\n\t\t\t * highpass the output\n\t\t\t * @type {Tone.Filter}\n\t\t\t * @private\n\t\t\t */\n\t this._highpass = new Tone.Filter({\n\t 'type': 'highpass',\n\t 'Q': -3.0102999566398125\n\t }).connect(this._amplitue);\n\t /**\n\t\t\t * The number of octaves the highpass\n\t\t\t * filter frequency ramps\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t /**\n\t\t\t * Scale the body envelope\n\t\t\t * for the bandpass\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._filterFreqScaler = new Tone.Scale(options.resonance, 7000);\n\t /**\n\t\t\t * The envelope which is connected both to the\n\t\t\t * amplitude and highpass filter's cutoff frequency\n\t\t\t * @type {Tone.Envelope}\n\t\t\t */\n\t this.envelope = new Tone.Envelope({\n\t 'attack': options.envelope.attack,\n\t 'attackCurve': 'linear',\n\t 'decay': options.envelope.decay,\n\t 'sustain': 0,\n\t 'release': options.envelope.release\n\t }).chain(this._filterFreqScaler, this._highpass.frequency);\n\t this.envelope.connect(this._amplitue.gain);\n\t for (var i = 0; i < inharmRatios.length; i++) {\n\t var osc = new Tone.FMOscillator({\n\t 'type': 'square',\n\t 'modulationType': 'square',\n\t 'harmonicity': options.harmonicity,\n\t 'modulationIndex': options.modulationIndex\n\t });\n\t osc.connect(this._highpass);\n\t this._oscillators[i] = osc;\n\t var mult = new Tone.Multiply(inharmRatios[i]);\n\t this._freqMultipliers[i] = mult;\n\t this.frequency.chain(mult, osc.frequency);\n\t }\n\t //set the octaves\n\t this.octaves = options.octaves;\n\t };\n\t Tone.extend(Tone.MetalSynth, Tone.Instrument);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.MetalSynth.defaults = {\n\t 'frequency': 200,\n\t 'envelope': {\n\t 'attack': 0.001,\n\t 'decay': 1.4,\n\t 'release': 0.2\n\t },\n\t 'harmonicity': 5.1,\n\t 'modulationIndex': 32,\n\t 'resonance': 4000,\n\t 'octaves': 1.5\n\t };\n\t /**\n\t\t * Trigger the attack.\n\t\t * @param {Time} time When the attack should be triggered.\n\t\t * @param {NormalRange} [velocity=1] The velocity that the envelope should be triggered at.\n\t\t * @return {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.triggerAttack = function (time, vel) {\n\t time = this.toSeconds(time);\n\t vel = Tone.defaultArg(vel, 1);\n\t this.envelope.triggerAttack(time, vel);\n\t this._oscillators.forEach(function (osc) {\n\t osc.start(time);\n\t });\n\t //if the sustain is 0, stop the oscillator as well\n\t if (this.envelope.sustain === 0) {\n\t this._oscillators.forEach(function (osc) {\n\t osc.stop(time + this.envelope.attack + this.envelope.decay);\n\t }.bind(this));\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release of the envelope.\n\t\t * @param {Time} time When the release should be triggered.\n\t\t * @return {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this.envelope.triggerRelease(time);\n\t this._oscillators.forEach(function (osc) {\n\t osc.stop(time + this.envelope.release);\n\t }.bind(this));\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.MetalSynth.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 0);\n\t this._syncMethod('triggerRelease', 0);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and release of the envelope after the given\n\t\t * duration.\n\t\t * @param {Time} duration The duration before triggering the release\n\t\t * @param {Time} time When the attack should be triggered.\n\t\t * @param {NormalRange} [velocity=1] The velocity that the envelope should be triggered at.\n\t\t * @return {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.triggerAttackRelease = function (duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(time, velocity);\n\t this.triggerRelease(time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * The modulationIndex of the oscillators which make up the source.\n\t\t * see Tone.FMOscillator.modulationIndex\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Positive}\n\t\t * @name modulationIndex\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'modulationIndex', {\n\t get: function () {\n\t return this._oscillators[0].modulationIndex.value;\n\t },\n\t set: function (val) {\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t this._oscillators[i].modulationIndex.value = val;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The harmonicity of the oscillators which make up the source.\n\t\t * see Tone.FMOscillator.harmonicity\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Positive}\n\t\t * @name harmonicity\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'harmonicity', {\n\t get: function () {\n\t return this._oscillators[0].harmonicity.value;\n\t },\n\t set: function (val) {\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t this._oscillators[i].harmonicity.value = val;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The frequency of the highpass filter attached to the envelope\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Frequency}\n\t\t * @name resonance\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'resonance', {\n\t get: function () {\n\t return this._filterFreqScaler.min;\n\t },\n\t set: function (val) {\n\t this._filterFreqScaler.min = val;\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * The number of octaves above the \"resonance\" frequency\n\t\t * that the filter ramps during the attack/decay envelope\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Number}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octs) {\n\t this._octaves = octs;\n\t this._filterFreqScaler.max = this._filterFreqScaler.min * Math.pow(2, octs);\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t this._oscillators[i].dispose();\n\t this._freqMultipliers[i].dispose();\n\t }\n\t this._oscillators = null;\n\t this._freqMultipliers = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this._filterFreqScaler.dispose();\n\t this._filterFreqScaler = null;\n\t this._amplitue.dispose();\n\t this._amplitue = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t this._highpass.dispose();\n\t this._highpass = null;\n\t };\n\t return Tone.MetalSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.NoiseSynth is composed of a noise generator (Tone.Noise), one filter (Tone.Filter),\n\t\t * and two envelopes (Tone.Envelop). One envelope controls the amplitude\n\t\t * of the noise and the other is controls the cutoff frequency of the filter.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1rqzuX9rBlhT50MRvD2TKml9bnZhcZmzXF1rf_o7vdnE/pub?w=918&h=242\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var noiseSynth = new Tone.NoiseSynth().toMaster();\n\t\t * noiseSynth.triggerAttackRelease(\"8n\");\n\t\t */\n\t Tone.NoiseSynth = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.NoiseSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The noise source.\n\t\t\t * @type {Tone.Noise}\n\t\t\t * @example\n\t\t\t * noiseSynth.set(\"noise.type\", \"brown\");\n\t\t\t */\n\t this.noise = new Tone.Noise();\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t //connect the noise to the output\n\t this.noise.chain(this.envelope, this.output);\n\t this._readOnly([\n\t 'noise',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.NoiseSynth, Tone.Instrument);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.NoiseSynth.defaults = {\n\t 'noise': { 'type': 'white' },\n\t 'envelope': {\n\t 'attack': 0.005,\n\t 'decay': 0.1,\n\t 'sustain': 0\n\t }\n\t };\n\t /**\n\t\t * Start the attack portion of the envelopes. Unlike other\n\t\t * instruments, Tone.NoiseSynth doesn't have a note.\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {number} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t * @example\n\t\t * noiseSynth.triggerAttack();\n\t\t */\n\t Tone.NoiseSynth.prototype.triggerAttack = function (time, velocity) {\n\t //the envelopes\n\t this.envelope.triggerAttack(time, velocity);\n\t //start the noise\n\t this.noise.start(time);\n\t if (this.envelope.sustain === 0) {\n\t this.noise.stop(time = this.envelope.attack + this.envelope.decay);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Start the release portion of the envelopes.\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t */\n\t Tone.NoiseSynth.prototype.triggerRelease = function (time) {\n\t this.envelope.triggerRelease(time);\n\t this.noise.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.NoiseSynth.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 0);\n\t this._syncMethod('triggerRelease', 0);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and then the release.\n\t\t * @param {Time} duration the duration of the note\n\t\t * @param {Time} [time=now] the time of the attack\n\t\t * @param {number} [velocity=1] the velocity\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t */\n\t Tone.NoiseSynth.prototype.triggerAttackRelease = function (duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(time, velocity);\n\t this.triggerRelease(time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t */\n\t Tone.NoiseSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._writable([\n\t 'noise',\n\t 'envelope'\n\t ]);\n\t this.noise.dispose();\n\t this.noise = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t return this;\n\t };\n\t return Tone.NoiseSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Karplus-String string synthesis. Often out of tune.\n\t\t * Will change when the AudioWorkerNode is available across\n\t\t * browsers.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] see the defaults\n\t\t * @example\n\t\t * var plucky = new Tone.PluckSynth().toMaster();\n\t\t * plucky.triggerAttack(\"C4\");\n\t\t */\n\t Tone.PluckSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.PluckSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * @type {Tone.Noise}\n\t\t\t * @private\n\t\t\t */\n\t this._noise = new Tone.Noise('pink');\n\t /**\n\t\t\t * The amount of noise at the attack.\n\t\t\t * Nominal range of [0.1, 20]\n\t\t\t * @type {number}\n\t\t\t */\n\t this.attackNoise = options.attackNoise;\n\t /**\n\t\t\t * the LFCF\n\t\t\t * @type {Tone.LowpassCombFilter}\n\t\t\t * @private\n\t\t\t */\n\t this._lfcf = new Tone.LowpassCombFilter({\n\t 'resonance': options.resonance,\n\t 'dampening': options.dampening\n\t });\n\t /**\n\t\t\t * The resonance control.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.resonance = this._lfcf.resonance;\n\t /**\n\t\t\t * The dampening control. i.e. the lowpass filter frequency of the comb filter\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.dampening = this._lfcf.dampening;\n\t //connections\n\t this._noise.connect(this._lfcf);\n\t this._lfcf.connect(this.output);\n\t this._readOnly([\n\t 'resonance',\n\t 'dampening'\n\t ]);\n\t };\n\t Tone.extend(Tone.PluckSynth, Tone.Instrument);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.PluckSynth.defaults = {\n\t 'attackNoise': 1,\n\t 'dampening': 4000,\n\t 'resonance': 0.7\n\t };\n\t /**\n\t\t * Trigger the note.\n\t\t * @param {Frequency} note The note to trigger.\n\t\t * @param {Time} [time=now] When the note should be triggered.\n\t\t * @returns {Tone.PluckSynth} this\n\t\t */\n\t Tone.PluckSynth.prototype.triggerAttack = function (note, time) {\n\t note = this.toFrequency(note);\n\t time = this.toSeconds(time);\n\t var delayAmount = 1 / note;\n\t this._lfcf.delayTime.setValueAtTime(delayAmount, time);\n\t this._noise.start(time);\n\t this._noise.stop(time + delayAmount * this.attackNoise);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.PluckSynth} this\n\t\t */\n\t Tone.PluckSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._noise.dispose();\n\t this._lfcf.dispose();\n\t this._noise = null;\n\t this._lfcf = null;\n\t this._writable([\n\t 'resonance',\n\t 'dampening'\n\t ]);\n\t this.dampening = null;\n\t this.resonance = null;\n\t return this;\n\t };\n\t return Tone.PluckSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PolySynth handles voice creation and allocation for any\n\t\t * instruments passed in as the second paramter. PolySynth is\n\t\t * not a synthesizer by itself, it merely manages voices of\n\t\t * one of the other types of synths, allowing any of the\n\t\t * monophonic synthesizers to be polyphonic.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {number|Object} [polyphony=4] The number of voices to create\n\t\t * @param {function} [voice=Tone.Synth] The constructor of the voices\n\t\t * uses Tone.Synth by default.\n\t\t * @example\n\t\t * //a polysynth composed of 6 Voices of Synth\n\t\t * var synth = new Tone.PolySynth(6, Tone.Synth).toMaster();\n\t\t * //set the attributes using the set interface\n\t\t * synth.set(\"detune\", -1200);\n\t\t * //play a chord\n\t\t * synth.triggerAttackRelease([\"C4\", \"E4\", \"A4\"], \"4n\");\n\t\t */\n\t Tone.PolySynth = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'polyphony',\n\t 'voice'\n\t ], Tone.PolySynth);\n\t Tone.Instrument.call(this, options);\n\t options = Tone.defaultArg(options, Tone.Instrument.defaults);\n\t //max polyphony\n\t options.polyphony = Math.min(Tone.PolySynth.MAX_POLYPHONY, options.polyphony);\n\t /**\n\t\t\t * the array of voices\n\t\t\t * @type {Array}\n\t\t\t */\n\t this.voices = new Array(options.polyphony);\n\t /**\n\t\t\t * The queue of voices with data about last trigger\n\t\t\t * and the triggered note\n\t\t\t * @private\n\t\t\t * @type {Array}\n\t\t\t */\n\t this._triggers = new Array(options.polyphony);\n\t /**\n\t\t\t * The detune in cents\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t this._readOnly('detune');\n\t //create the voices\n\t for (var i = 0; i < options.polyphony; i++) {\n\t var v = new options.voice(arguments[2], arguments[3]);\n\t if (!(v instanceof Tone.Monophonic)) {\n\t throw new Error('Synth constructor must be instance of Tone.Monophonic');\n\t }\n\t this.voices[i] = v;\n\t v.connect(this.output);\n\t if (v.hasOwnProperty('detune')) {\n\t this.detune.connect(v.detune);\n\t }\n\t this._triggers[i] = {\n\t release: -1,\n\t note: null,\n\t voice: v\n\t };\n\t }\n\t };\n\t Tone.extend(Tone.PolySynth, Tone.Instrument);\n\t /**\n\t\t * the defaults\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.PolySynth.defaults = {\n\t 'polyphony': 4,\n\t 'volume': 0,\n\t 'detune': 0,\n\t 'voice': Tone.Synth\n\t };\n\t /**\n\t\t * Trigger the attack portion of the note\n\t\t * @param {Frequency|Array} notes The notes to play. Accepts a single\n\t\t * Frequency or an array of frequencies.\n\t\t * @param {Time} [time=now] The start time of the note.\n\t\t * @param {number} [velocity=1] The velocity of the note.\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * //trigger a chord immediately with a velocity of 0.2\n\t\t * poly.triggerAttack([\"Ab3\", \"C4\", \"F5\"], undefined, 0.2);\n\t\t */\n\t Tone.PolySynth.prototype.triggerAttack = function (notes, time, velocity) {\n\t if (!Array.isArray(notes)) {\n\t notes = [notes];\n\t }\n\t time = this.toSeconds(time);\n\t for (var i = 0; i < notes.length; i++) {\n\t var val = notes[i];\n\t //trigger the oldest voice\n\t var oldest = this._triggers[0];\n\t for (var j = 1; j < this._triggers.length; j++) {\n\t if (this._triggers[j].release < oldest.release) {\n\t oldest = this._triggers[j];\n\t }\n\t }\n\t oldest.release = Infinity;\n\t oldest.note = JSON.stringify(val);\n\t oldest.voice.triggerAttack(val, time, velocity);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and release after the specified duration\n\t\t *\n\t\t * @param {Frequency|Array} notes The notes to play. Accepts a single\n\t\t * Frequency or an array of frequencies.\n\t\t * @param {Time} duration the duration of the note\n\t\t * @param {Time} [time=now] if no time is given, defaults to now\n\t\t * @param {number} [velocity=1] the velocity of the attack (0-1)\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * //trigger a chord for a duration of a half note\n\t\t * poly.triggerAttackRelease([\"Eb3\", \"G4\", \"C5\"], \"2n\");\n\t\t * @example\n\t\t * //can pass in an array of durations as well\n\t\t * poly.triggerAttackRelease([\"Eb3\", \"G4\", \"C5\"], [\"2n\", \"4n\", \"4n\"]);\n\t\t */\n\t Tone.PolySynth.prototype.triggerAttackRelease = function (notes, duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t this.triggerAttack(notes, time, velocity);\n\t if (Tone.isArray(duration) && Tone.isArray(notes)) {\n\t for (var i = 0; i < notes.length; i++) {\n\t var d = duration[Math.min(i, duration.length - 1)];\n\t this.triggerRelease(notes[i], time + this.toSeconds(d));\n\t }\n\t } else {\n\t this.triggerRelease(notes, time + this.toSeconds(duration));\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release of the note. Unlike monophonic instruments,\n\t\t * a note (or array of notes) needs to be passed in as the first argument.\n\t\t * @param {Frequency|Array} notes The notes to play. Accepts a single\n\t\t * Frequency or an array of frequencies.\n\t\t * @param {Time} [time=now] When the release will be triggered.\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * poly.triggerRelease([\"Ab3\", \"C4\", \"F5\"], \"+2n\");\n\t\t */\n\t Tone.PolySynth.prototype.triggerRelease = function (notes, time) {\n\t if (!Array.isArray(notes)) {\n\t notes = [notes];\n\t }\n\t time = this.toSeconds(time);\n\t for (var i = 0; i < notes.length; i++) {\n\t //get the voice\n\t var stringified = JSON.stringify(notes[i]);\n\t for (var v = 0; v < this._triggers.length; v++) {\n\t var desc = this._triggers[v];\n\t if (desc.note === stringified && desc.release > time) {\n\t desc.voice.triggerRelease(time);\n\t desc.release = time;\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.PolySynth.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 1);\n\t this._syncMethod('triggerRelease', 1);\n\t return this;\n\t };\n\t /**\n\t\t * Set a member/attribute of the voices.\n\t\t * @param {Object|string} params\n\t\t * @param {number=} value\n\t\t * @param {Time=} rampTime\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * poly.set({\n\t\t * \t\"filter\" : {\n\t\t * \t\t\"type\" : \"highpass\"\n\t\t * \t},\n\t\t * \t\"envelope\" : {\n\t\t * \t\t\"attack\" : 0.25\n\t\t * \t}\n\t\t * });\n\t\t */\n\t Tone.PolySynth.prototype.set = function (params, value, rampTime) {\n\t for (var i = 0; i < this.voices.length; i++) {\n\t this.voices[i].set(params, value, rampTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the synth's attributes. Given no arguments get\n\t\t * will return all available object properties and their corresponding\n\t\t * values. Pass in a single attribute to retrieve or an array\n\t\t * of attributes. The attribute strings can also include a \".\"\n\t\t * to access deeper properties.\n\t\t * @param {Array=} params the parameters to get, otherwise will return\n\t\t * \t\t\t\t\t all available.\n\t\t */\n\t Tone.PolySynth.prototype.get = function (params) {\n\t return this.voices[0].get(params);\n\t };\n\t /**\n\t\t * Trigger the release portion of all the currently active voices.\n\t\t * @param {Time} [time=now] When the notes should be released.\n\t\t * @return {Tone.PolySynth} this\n\t\t */\n\t Tone.PolySynth.prototype.releaseAll = function (time) {\n\t time = this.toSeconds(time);\n\t for (var i = 0; i < this._triggers.length; i++) {\n\t var desc = this._triggers[i];\n\t if (desc.release > time) {\n\t desc.release = time;\n\t desc.voice.triggerRelease(time);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.PolySynth} this\n\t\t */\n\t Tone.PolySynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t for (var i = 0; i < this.voices.length; i++) {\n\t this.voices[i].dispose();\n\t this.voices[i] = null;\n\t }\n\t this._writable('detune');\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.voices = null;\n\t this._triggers = null;\n\t return this;\n\t };\n\t /**\n\t\t * The maximum number of notes that can be allocated\n\t\t * to a polysynth.\n\t\t * @type {Number}\n\t\t * @static\n\t\t */\n\t Tone.PolySynth.MAX_POLYPHONY = 20;\n\t return Tone.PolySynth;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Automatically interpolates between a set of pitched samples. Pass in an object which maps the note's pitch or midi value to the url, then you can trigger the attack and release of that note like other instruments. By automatically repitching the samples, it is possible to play pitches which were not explicitly included which can save loading time.\n\t\t * For sample or buffer playback where repitching is not necessary, use [Tone.Player](https://tonejs.github.io/docs/Player).\n\t\t * @param {Object} samples An object of samples mapping either Midi\n\t\t * Note Numbers or Scientific Pitch Notation\n\t\t * to the url of that sample.\n\t\t * @param {Function=} onload The callback to invoke when all of the samples are loaded.\n\t\t * @param {String=} baseUrl The root URL of all of the samples, which is prepended to all the URLs.\n\t\t * @example\n\t\t * var sampler = new Tone.Sampler({\n\t\t * \t\"C3\" : \"path/to/C3.mp3\",\n\t\t * \t\"D#3\" : \"path/to/Dsharp3.mp3\",\n\t\t * \t\"F#3\" : \"path/to/Fsharp3.mp3\",\n\t\t * \t\"A3\" : \"path/to/A3.mp3\",\n\t\t * }, function(){\n\t\t * \t//sampler will repitch the closest sample\n\t\t * \tsampler.triggerAttack(\"D3\")\n\t\t * })\n\t\t * @extends {Tone.Instrument}\n\t\t */\n\t Tone.Sampler = function (urls) {\n\t // shift arguments over one. Those are the remainder of the options\n\t var args = Array.prototype.slice.call(arguments);\n\t args.shift();\n\t var options = Tone.defaults(args, [\n\t 'onload',\n\t 'baseUrl'\n\t ], Tone.Sampler);\n\t Tone.Instrument.call(this, options);\n\t var urlMap = {};\n\t for (var note in urls) {\n\t if (Tone.isNote(note)) {\n\t //convert the note name to MIDI\n\t var mid = Tone.Frequency(note).toMidi();\n\t urlMap[mid] = urls[note];\n\t } else if (!isNaN(parseFloat(note))) {\n\t //otherwise if it's numbers assume it's midi\n\t urlMap[note] = urls[note];\n\t } else {\n\t throw new Error('Tone.Sampler: url keys must be the note\\'s pitch');\n\t }\n\t }\n\t /**\n\t\t\t * The stored and loaded buffers\n\t\t\t * @type {Tone.Buffers}\n\t\t\t * @private\n\t\t\t */\n\t this._buffers = new Tone.Buffers(urlMap, options.onload, options.baseUrl);\n\t /**\n\t\t\t * The object of all currently playing BufferSources\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._activeSources = {};\n\t /**\n\t\t\t * The envelope applied to the beginning of the sample.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.attack = options.attack;\n\t /**\n\t\t\t * The envelope applied to the end of the envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.release = options.release;\n\t };\n\t Tone.extend(Tone.Sampler, Tone.Instrument);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Sampler.defaults = {\n\t attack: 0,\n\t release: 0.1,\n\t onload: Tone.noOp,\n\t baseUrl: ''\n\t };\n\t /**\n\t\t * Returns the difference in steps between the given midi note at the closets sample.\n\t\t * @param {Midi} midi\n\t\t * @return {Interval}\n\t\t * @private\n\t\t */\n\t Tone.Sampler.prototype._findClosest = function (midi) {\n\t //searches within 8 octaves of the given midi note\n\t var MAX_INTERVAL = 96;\n\t var interval = 0;\n\t while (interval < MAX_INTERVAL) {\n\t // check above and below\n\t if (this._buffers.has(midi + interval)) {\n\t return -interval;\n\t } else if (this._buffers.has(midi - interval)) {\n\t return interval;\n\t }\n\t interval++;\n\t }\n\t return null;\n\t };\n\t /**\n\t\t * @param {Frequency} note The note to play\n\t\t * @param {Time=} time When to play the note\n\t\t * @param {NormalRange=} velocity The velocity to play the sample back.\n\t\t * @return {Tone.Sampler} this\n\t\t */\n\t Tone.Sampler.prototype.triggerAttack = function (note, time, velocity) {\n\t var midi = Tone.Frequency(note).toMidi();\n\t // find the closest note pitch\n\t var difference = this._findClosest(midi);\n\t if (difference !== null) {\n\t var closestNote = midi - difference;\n\t var buffer = this._buffers.get(closestNote);\n\t // play that note\n\t var source = new Tone.BufferSource({\n\t 'buffer': buffer,\n\t 'playbackRate': Tone.intervalToFrequencyRatio(difference),\n\t 'fadeIn': this.attack,\n\t 'fadeOut': this.release,\n\t 'curve': 'exponential'\n\t }).connect(this.output);\n\t source.start(time, 0, buffer.duration, velocity);\n\t // add it to the active sources\n\t if (!Tone.isArray(this._activeSources[midi])) {\n\t this._activeSources[midi] = [];\n\t }\n\t this._activeSources[midi].push({\n\t note: midi,\n\t source: source\n\t });\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * @param {Frequency} note The note to release.\n\t\t * @param {Time=} time \tWhen to release the note.\n\t\t * @return {Tone.Sampler}\tthis\n\t\t */\n\t Tone.Sampler.prototype.triggerRelease = function (note, time) {\n\t var midi = Tone.Frequency(note).toMidi();\n\t // find the note\n\t if (this._activeSources[midi] && this._activeSources[midi].length) {\n\t var source = this._activeSources[midi].shift().source;\n\t time = this.toSeconds(time);\n\t source.stop(time + this.release, this.release);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Release all currently active notes.\n\t\t * @param {Time=} time \tWhen to release the notes.\n\t\t * @return {Tone.Sampler}\tthis\n\t\t */\n\t Tone.Sampler.prototype.releaseAll = function (time) {\n\t time = this.toSeconds(time);\n\t for (var note in this._activeSources) {\n\t var sources = this._activeSources[note];\n\t while (sources.length) {\n\t var source = sources.shift().source;\n\t source.stop(time + this.release, this.release);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Sampler.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 1);\n\t this._syncMethod('triggerRelease', 1);\n\t return this;\n\t };\n\t /**\n\t\t * Invoke the attack phase, then after the duration, invoke the release.\n\t\t * @param {Frequency} note The note to play\n\t\t * @param {Time} duration The time the note should be held\n\t\t * @param {Time=} time When to start the attack\n\t\t * @param {NormalRange} [velocity=1] The velocity of the attack\n\t\t * @return {Tone.Sampler} this\n\t\t */\n\t Tone.Sampler.prototype.triggerAttackRelease = function (note, duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(note, time, velocity);\n\t this.triggerRelease(note, time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * Add a note to the sampler.\n\t\t * @param {Note|Midi} note The buffer's pitch.\n\t\t * @param {String|Tone.Buffer|Audiobuffer} url Either the url of the bufer,\n\t\t * or a buffer which will be added\n\t\t * with the given name.\n\t\t * @param {Function=} callback The callback to invoke\n\t\t * when the url is loaded.\n\t\t */\n\t Tone.Sampler.prototype.add = function (note, url, callback) {\n\t if (Tone.isNote(note)) {\n\t //convert the note name to MIDI\n\t var mid = Tone.Frequency(note).toMidi();\n\t this._buffers.add(mid, url, callback);\n\t } else if (!isNaN(parseFloat(note))) {\n\t //otherwise if it's numbers assume it's midi\n\t this._buffers.add(note, url, callback);\n\t } else {\n\t throw new Error('Tone.Sampler: note must be the note\\'s pitch. Instead got ' + note);\n\t }\n\t };\n\t /**\n\t\t * If the buffers are loaded or not\n\t\t * @memberOf Tone.Sampler#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Sampler.prototype, 'loaded', {\n\t get: function () {\n\t return this._buffers.loaded;\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Sampler} this\n\t\t */\n\t Tone.Sampler.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._buffers.dispose();\n\t this._buffers = null;\n\t for (var midi in this._activeSources) {\n\t this._activeSources[midi].forEach(function (event) {\n\t event.source.dispose();\n\t });\n\t }\n\t this._activeSources = null;\n\t return this;\n\t };\n\t return Tone.Sampler;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t if (!OscillatorNode.prototype.setPeriodicWave) {\n\t OscillatorNode.prototype.setPeriodicWave = OscillatorNode.prototype.setWaveTable;\n\t }\n\t if (!AudioContext.prototype.createPeriodicWave) {\n\t AudioContext.prototype.createPeriodicWave = AudioContext.prototype.createWaveTable;\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Maps a NormalRange [0, 1] to an AudioRange [-1, 1]. \n\t\t * See also Tone.AudioToGain. \n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @example\n\t\t * var g2a = new Tone.GainToAudio();\n\t\t */\n\t Tone.GainToAudio = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._norm = this.input = this.output = new Tone.WaveShaper(function (x) {\n\t return Math.abs(x) * 2 - 1;\n\t });\n\t };\n\t Tone.extend(Tone.GainToAudio, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.GainToAudio} this\n\t\t */\n\t Tone.GainToAudio.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._norm.dispose();\n\t this._norm = null;\n\t return this;\n\t };\n\t return Tone.GainToAudio;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Normalize takes an input min and max and maps it linearly to NormalRange [0,1]\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @param {number} inputMin the min input value\n\t\t * @param {number} inputMax the max input value\n\t\t * @example\n\t\t * var norm = new Tone.Normalize(2, 4);\n\t\t * var sig = new Tone.Signal(3).connect(norm);\n\t\t * //output of norm is 0.5. \n\t\t */\n\t Tone.Normalize = function (inputMin, inputMax) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * the min input value\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._inputMin = Tone.defaultArg(inputMin, 0);\n\t /**\n\t\t\t * the max input value\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._inputMax = Tone.defaultArg(inputMax, 1);\n\t /**\n\t\t\t * subtract the min from the input\n\t\t\t * @type {Tone.Add}\n\t\t\t * @private\n\t\t\t */\n\t this._sub = this.input = new Tone.Add(0);\n\t /**\n\t\t\t * divide by the difference between the input and output\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._div = this.output = new Tone.Multiply(1);\n\t this._sub.connect(this._div);\n\t this._setRange();\n\t };\n\t Tone.extend(Tone.Normalize, Tone.SignalBase);\n\t /**\n\t\t * The minimum value the input signal will reach.\n\t\t * @memberOf Tone.Normalize#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.Normalize.prototype, 'min', {\n\t get: function () {\n\t return this._inputMin;\n\t },\n\t set: function (min) {\n\t this._inputMin = min;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * The maximum value the input signal will reach.\n\t\t * @memberOf Tone.Normalize#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.Normalize.prototype, 'max', {\n\t get: function () {\n\t return this._inputMax;\n\t },\n\t set: function (max) {\n\t this._inputMax = max;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * set the values\n\t\t * @private\n\t\t */\n\t Tone.Normalize.prototype._setRange = function () {\n\t this._sub.value = -this._inputMin;\n\t this._div.value = 1 / (this._inputMax - this._inputMin);\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Normalize} this\n\t\t */\n\t Tone.Normalize.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._sub.dispose();\n\t this._sub = null;\n\t this._div.dispose();\n\t this._div = null;\n\t return this;\n\t };\n\t return Tone.Normalize;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportTimelineSignal extends Tone.Signal, but adds the ability to synchronize the signal to the signal to the Tone.Transport\n\t\t * @extends {Tone.Signal}\n\t\t */\n\t Tone.TransportTimelineSignal = function () {\n\t Tone.Signal.apply(this, arguments);\n\t /**\n\t\t\t * The real signal output\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this.output = this._outputSig = new Tone.Signal(this._initialValue);\n\t /**\n\t\t\t * Keep track of the last value. (small optimization)\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._lastVal = this.value;\n\t /**\n\t\t\t * The event id of the tick update loop\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._synced = Tone.Transport.scheduleRepeat(this._onTick.bind(this), '1i');\n\t /**\n\t\t\t * A bound version of the anchor value methods\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._bindAnchorValue = this._anchorValue.bind(this);\n\t Tone.Transport.on('start stop pause', this._bindAnchorValue);\n\t this._events.memory = Infinity;\n\t };\n\t Tone.extend(Tone.TransportTimelineSignal, Tone.Signal);\n\t /**\n\t\t * Callback which is invoked every tick.\n\t\t * @private\n\t\t * @param {Number} time\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype._onTick = function (time) {\n\t var val = this.getValueAtTime(Tone.Transport.seconds);\n\t if (this._lastVal !== val) {\n\t this._lastVal = val;\n\t //approximate ramp curves with linear ramps\n\t this._outputSig.linearRampToValueAtTime(val, time);\n\t }\n\t };\n\t /**\n\t\t * Anchor the value at the start and stop of the Transport\n\t\t * @param {Number} time The time of the event\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t * @private\n\t\t */\n\t Tone.TransportTimelineSignal.prototype._anchorValue = function (time) {\n\t var val = this.getValueAtTime(Tone.Transport.seconds);\n\t this._lastVal = val;\n\t this._outputSig.cancelScheduledValues(time);\n\t this._outputSig.setValueAtTime(val, time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the scheduled value at the given time. This will\n\t\t * return the unconverted (raw) value.\n\t\t * @param {TransportTime} time The time in seconds.\n\t\t * @return {Number} The scheduled value at the given time.\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.getValueAtTime = function (time) {\n\t time = Tone.TransportTime(time);\n\t return Tone.Signal.prototype.getValueAtTime.call(this, time);\n\t };\n\t /**\n\t\t * Set the output of the signal at the given time\n\t\t * @param {Number} value The value to change to at the given time\n\t\t * @param {TransportTime} time The time to change the signal\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.setValueAtTime = function (value, time) {\n\t time = Tone.TransportTime(time);\n\t Tone.Signal.prototype.setValueAtTime.call(this, value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Linear ramp to the given value from the previous scheduled point to the given value\n\t\t * @param {Number} value The value to change to at the given time\n\t\t * @param {TransportTime} time The time to change the signal\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.linearRampToValueAtTime = function (value, time) {\n\t time = Tone.TransportTime(time);\n\t Tone.Signal.prototype.linearRampToValueAtTime.call(this, value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Exponential ramp to the given value from the previous scheduled point to the given value\n\t\t * @param {Number} value The value to change to at the given time\n\t\t * @param {TransportTime} time The time to change the signal\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.exponentialRampToValueAtTime = function (value, time) {\n\t time = Tone.TransportTime(time);\n\t Tone.Signal.prototype.exponentialRampToValueAtTime.call(this, value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time with\n\t\t * a rate having the given time constant.\n\t\t * @param {number} value\n\t\t * @param {TransportTime} startTime\n\t\t * @param {number} timeConstant\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.setTargetAtTime = function (value, startTime, timeConstant) {\n\t startTime = Tone.TransportTime(startTime);\n\t Tone.Signal.prototype.setTargetAtTime.call(this, value, startTime, timeConstant);\n\t return this;\n\t };\n\t /**\n\t\t * Cancels all scheduled parameter changes with times greater than or\n\t\t * equal to startTime.\n\t\t * @param {TransportTime} startTime\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.cancelScheduledValues = function (startTime) {\n\t startTime = Tone.TransportTime(startTime);\n\t Tone.Signal.prototype.cancelScheduledValues.call(this, startTime);\n\t return this;\n\t };\n\t /**\n\t\t * Set an array of arbitrary values starting at the given time for the given duration.\n\t\t * @param {Float32Array} values\n\t\t * @param {Time} startTime\n\t\t * @param {Time} duration\n\t\t * @param {NormalRange} [scaling=1] If the values in the curve should be scaled by some value\n\t\t * @returns {Tone.Signal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.setValueCurveAtTime = function (values, startTime, duration, scaling) {\n\t startTime = Tone.TransportTime(startTime);\n\t duration = Tone.TransportTime(duration);\n\t Tone.Signal.prototype.setValueCurveAtTime.call(this, values, startTime, duration, scaling);\n\t return this;\n\t };\n\t /**\n\t\t * This is similar to [cancelScheduledValues](#cancelScheduledValues) except\n\t\t * it holds the automated value at time until the next automated event.\n\t\t * @param {Time} time\n\t\t * @returns {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.cancelAndHoldAtTime = function (time) {\n\t return Tone.Signal.prototype.cancelAndHoldAtTime.call(this, Tone.TransportTime(time));\n\t };\n\t /**\n\t\t * Dispose and disconnect\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.dispose = function () {\n\t Tone.Transport.clear(this._synced);\n\t Tone.Transport.off('start stop pause', this._syncedCallback);\n\t this._events.cancel(0);\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._outputSig.dispose();\n\t this._outputSig = null;\n\t };\n\t return Tone.TransportTimelineSignal;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.GrainPlayer implements [granular synthesis](https://en.wikipedia.org/wiki/Granular_synthesis).\n\t\t * Granular Synthesis enables you to adjust pitch and playback rate independently. The grainSize is the\n\t\t * amount of time each small chunk of audio is played for and the overlap is the\n\t\t * amount of crossfading transition time between successive grains.\n\t\t * @extends {Tone.Source}\n\t\t * @param {String|Tone.Buffer} url\tThe url to load, or the Tone.Buffer to play.\n\t\t * @param {Function=} callback The callback to invoke after the url is loaded.\n\t\t */\n\t Tone.GrainPlayer = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload'\n\t ], Tone.GrainPlayer);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The audio buffer belonging to the player.\n\t\t\t * @type {Tone.Buffer}\n\t\t\t */\n\t this.buffer = new Tone.Buffer(options.url, options.onload);\n\t /**\n\t\t\t * Create a repeating tick to schedule\n\t\t\t * the grains.\n\t\t\t * @type {Tone.Clock}\n\t\t\t * @private\n\t\t\t */\n\t this._clock = new Tone.Clock(this._tick.bind(this), options.grainSize);\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopStart = 0;\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopEnd = 0;\n\t /**\n\t\t\t * All of the currently playing BufferSources\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._activeSources = [];\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._playbackRate = options.playbackRate;\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._grainSize = options.grainSize;\n\t /**\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._overlap = options.overlap;\n\t /**\n\t\t\t * Adjust the pitch independently of the playbackRate.\n\t\t\t * @type {Cents}\n\t\t\t */\n\t this.detune = options.detune;\n\t //setup\n\t this.overlap = options.overlap;\n\t this.loop = options.loop;\n\t this.playbackRate = options.playbackRate;\n\t this.grainSize = options.grainSize;\n\t this.loopStart = options.loopStart;\n\t this.loopEnd = options.loopEnd;\n\t this.reverse = options.reverse;\n\t this._clock.on('stop', this._onstop.bind(this));\n\t };\n\t Tone.extend(Tone.GrainPlayer, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.GrainPlayer.defaults = {\n\t 'onload': Tone.noOp,\n\t 'overlap': 0.1,\n\t 'grainSize': 0.2,\n\t 'playbackRate': 1,\n\t 'detune': 0,\n\t 'loop': false,\n\t 'loopStart': 0,\n\t 'loopEnd': 0,\n\t 'reverse': false\n\t };\n\t /**\n\t\t * Play the buffer at the given startTime. Optionally add an offset\n\t\t * and/or duration which will play the buffer from a position\n\t\t * within the buffer for the given duration.\n\t\t *\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @returns {Tone.GrainPlayer} this\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @method start\n\t\t * @name start\n\t\t */\n\t /**\n\t\t * Internal start method\n\t\t * @param {Time} time\n\t\t * @param {Time} offset\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._start = function (time, offset, duration) {\n\t offset = Tone.defaultArg(offset, 0);\n\t offset = this.toSeconds(offset);\n\t time = this.toSeconds(time);\n\t this._offset = offset;\n\t this._clock.start(time);\n\t if (duration) {\n\t this.stop(time + this.toSeconds(duration));\n\t }\n\t };\n\t /**\n\t\t * Internal start method\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._stop = function (time) {\n\t this._clock.stop(time);\n\t };\n\t /**\n\t\t * Invoked when the clock is stopped\n\t\t * @param {Number} time\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._onstop = function (time) {\n\t //stop the players\n\t this._activeSources.forEach(function (source) {\n\t source.stop(time, 0);\n\t });\n\t };\n\t /**\n\t\t * Invoked on each clock tick. scheduled a new\n\t\t * grain at this time.\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._tick = function (time) {\n\t var fadeIn = this._offset < this._overlap ? 0 : this._overlap;\n\t var source = new Tone.BufferSource({\n\t 'buffer': this.buffer,\n\t 'fadeIn': fadeIn,\n\t 'fadeOut': this._overlap,\n\t 'loop': this.loop,\n\t 'loopStart': this._loopStart,\n\t 'loopEnd': this._loopEnd,\n\t 'playbackRate': Tone.intervalToFrequencyRatio(this.detune / 100)\n\t }).connect(this.output);\n\t source.start(time, this._offset);\n\t this._offset += this.grainSize;\n\t source.stop(time + this.grainSize);\n\t //add it to the active sources\n\t this._activeSources.push(source);\n\t //remove it when it's done\n\t source.onended = function () {\n\t var index = this._activeSources.indexOf(source);\n\t if (index !== -1) {\n\t this._activeSources.splice(index, 1);\n\t }\n\t }.bind(this);\n\t };\n\t /**\n\t\t * Jump to a specific time and play it.\n\t\t * @param {Time} offset The offset to jump to.\n\t\t * @param {Time=} time When to make the jump.\n\t\t * @return {Tone.GrainPlayer} this\n\t\t */\n\t Tone.GrainPlayer.prototype.seek = function (offset, time) {\n\t this._offset = this.toSeconds(offset);\n\t this._tick(this.toSeconds(time));\n\t return this;\n\t };\n\t /**\n\t\t * The playback rate of the sample\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Positive}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t this.grainSize = this._grainSize;\n\t }\n\t });\n\t /**\n\t\t * The loop start time.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'loopStart', {\n\t get: function () {\n\t return this._loopStart;\n\t },\n\t set: function (time) {\n\t this._loopStart = this.toSeconds(time);\n\t }\n\t });\n\t /**\n\t\t * The loop end time.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'loopEnd', {\n\t get: function () {\n\t return this._loopEnd;\n\t },\n\t set: function (time) {\n\t this._loopEnd = this.toSeconds(time);\n\t }\n\t });\n\t /**\n\t\t * The direction the buffer should play in\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {boolean}\n\t\t * @name reverse\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'reverse', {\n\t get: function () {\n\t return this.buffer.reverse;\n\t },\n\t set: function (rev) {\n\t this.buffer.reverse = rev;\n\t }\n\t });\n\t /**\n\t\t * The size of each chunk of audio that the\n\t\t * buffer is chopped into and played back at.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name grainSize\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'grainSize', {\n\t get: function () {\n\t return this._grainSize;\n\t },\n\t set: function (size) {\n\t this._grainSize = this.toSeconds(size);\n\t this._clock.frequency.value = this._playbackRate / this._grainSize;\n\t }\n\t });\n\t /**\n\t\t * This is the duration of the cross-fade between\n\t\t * sucessive grains.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name overlap\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'overlap', {\n\t get: function () {\n\t return this._overlap;\n\t },\n\t set: function (time) {\n\t this._overlap = this.toSeconds(time);\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.GrainPlayer} this\n\t\t */\n\t Tone.GrainPlayer.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this.buffer.dispose();\n\t this.buffer = null;\n\t this._clock.dispose();\n\t this._clock = null;\n\t this._activeSources.forEach(function (source) {\n\t source.dispose();\n\t });\n\t this._activeSources = null;\n\t return this;\n\t };\n\t return Tone.GrainPlayer;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Player is an audio file player with start, loop, and stop functions.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {string|AudioBuffer} url Either the AudioBuffer or the url from\n\t\t * which to load the AudioBuffer\n\t\t * @param {Function=} onload The function to invoke when the buffer is loaded.\n\t\t * Recommended to use Tone.Buffer.on('load') instead.\n\t\t * @example\n\t\t * var player = new Tone.Player(\"./path/to/sample.mp3\").toMaster();\n\t\t * //play as soon as the buffer is loaded\n\t\t * player.autostart = true;\n\t\t */\n\t Tone.Player = function (url) {\n\t var options;\n\t if (url instanceof Tone.Buffer && url.loaded) {\n\t url = url.get();\n\t options = Tone.Player.defaults;\n\t } else {\n\t options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload'\n\t ], Tone.Player);\n\t }\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * If the file should play as soon\n\t\t\t * as the buffer is loaded.\n\t\t\t * @type {Boolean}\n\t\t\t * @example\n\t\t\t * //will play as soon as it's loaded\n\t\t\t * var player = new Tone.Player({\n\t\t\t * \t\"url\" : \"./path/to/sample.mp3\",\n\t\t\t * \t\"autostart\" : true,\n\t\t\t * }).toMaster();\n\t\t\t */\n\t this.autostart = options.autostart;\n\t /**\n\t\t\t * the buffer\n\t\t\t * @private\n\t\t\t * @type {Tone.Buffer}\n\t\t\t */\n\t this._buffer = new Tone.Buffer({\n\t 'url': options.url,\n\t 'onload': this._onload.bind(this, options.onload),\n\t 'reverse': options.reverse\n\t });\n\t if (url instanceof AudioBuffer) {\n\t this._buffer.set(url);\n\t }\n\t /**\n\t\t\t * if the buffer should loop once it's over\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._loop = options.loop;\n\t /**\n\t\t\t * if 'loop' is true, the loop will start at this position\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._loopStart = options.loopStart;\n\t /**\n\t\t\t * if 'loop' is true, the loop will end at this position\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._loopEnd = options.loopEnd;\n\t /**\n\t\t\t * the playback rate\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._playbackRate = options.playbackRate;\n\t /**\n\t\t\t * All of the active buffer source nodes\n\t\t\t * @type {Array<Tone.BufferSource>}\n\t\t\t * @private\n\t\t\t */\n\t this._activeSources = [];\n\t /**\n\t\t\t * The elapsed time counter.\n\t\t\t * @type {Tone.TickSource}\n\t\t\t * @private\n\t\t\t */\n\t this._elapsedTime = new Tone.TickSource(options.playbackRate);\n\t /**\n\t\t\t * The fadeIn time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeIn = options.fadeIn;\n\t /**\n\t\t\t * The fadeOut time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeOut = options.fadeOut;\n\t };\n\t Tone.extend(Tone.Player, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Player.defaults = {\n\t 'onload': Tone.noOp,\n\t 'playbackRate': 1,\n\t 'loop': false,\n\t 'autostart': false,\n\t 'loopStart': 0,\n\t 'loopEnd': 0,\n\t 'retrigger': false,\n\t 'reverse': false,\n\t 'fadeIn': 0,\n\t 'fadeOut': 0\n\t };\n\t /**\n\t\t * Load the audio file as an audio buffer.\n\t\t * Decodes the audio asynchronously and invokes\n\t\t * the callback once the audio buffer loads.\n\t\t * Note: this does not need to be called if a url\n\t\t * was passed in to the constructor. Only use this\n\t\t * if you want to manually load a new url.\n\t\t * @param {string} url The url of the buffer to load.\n\t\t * Filetype support depends on the\n\t\t * browser.\n\t\t * @param {Function=} callback The function to invoke once\n\t\t * the sample is loaded.\n\t\t * @returns {Promise}\n\t\t */\n\t Tone.Player.prototype.load = function (url, callback) {\n\t return this._buffer.load(url, this._onload.bind(this, callback));\n\t };\n\t /**\n\t\t * Internal callback when the buffer is loaded.\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._onload = function (callback) {\n\t callback = Tone.defaultArg(callback, Tone.noOp);\n\t callback(this);\n\t if (this.autostart) {\n\t this.start();\n\t }\n\t };\n\t /**\n\t\t * Internal callback when the buffer is done playing.\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._onSourceEnd = function (source) {\n\t var index = this._activeSources.indexOf(source);\n\t this._activeSources.splice(index, 1);\n\t };\n\t /**\n\t\t * Play the buffer at the given startTime. Optionally add an offset\n\t\t * and/or duration which will play the buffer from a position\n\t\t * within the buffer for the given duration.\n\t\t *\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @returns {Tone.Player} this\n\t\t * @memberOf Tone.Player#\n\t\t * @method start\n\t\t * @name start\n\t\t */\n\t /**\n\t\t * Internal start method\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._start = function (startTime, offset, duration) {\n\t //if it's a loop the default offset is the loopstart point\n\t if (this._loop) {\n\t offset = Tone.defaultArg(offset, this._loopStart);\n\t } else {\n\t //otherwise the default offset is 0\n\t offset = Tone.defaultArg(offset, 0);\n\t }\n\t //compute the values in seconds\n\t offset = this.toSeconds(offset);\n\t var computedDuration = Tone.defaultArg(duration, Math.max(this._buffer.duration - offset, 0));\n\t computedDuration = this.toSeconds(computedDuration);\n\t startTime = this.toSeconds(startTime);\n\t //start the elapsed time counter\n\t this._elapsedTime.start(startTime, offset);\n\t //make the source\n\t var source = new Tone.BufferSource({\n\t 'buffer': this._buffer,\n\t 'loop': this._loop,\n\t 'loopStart': this._loopStart,\n\t 'loopEnd': this._loopEnd,\n\t 'onended': this._onSourceEnd.bind(this),\n\t 'playbackRate': this._playbackRate,\n\t 'fadeIn': this.fadeIn,\n\t 'fadeOut': this.fadeOut\n\t }).connect(this.output);\n\t //set the looping properties\n\t if (!this._loop && !this._synced) {\n\t //if it's not looping, set the state change at the end of the sample\n\t this._state.setStateAtTime(Tone.State.Stopped, startTime + computedDuration / this._playbackRate);\n\t }\n\t //add it to the array of active sources\n\t this._activeSources.push(source);\n\t //start it\n\t if (this._loop && Tone.isUndef(duration)) {\n\t source.start(startTime, offset);\n\t } else {\n\t source.start(startTime, offset, computedDuration);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop playback.\n\t\t * @private\n\t\t * @param {Time} [time=now]\n\t\t * @returns {Tone.Player} this\n\t\t */\n\t Tone.Player.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._elapsedTime.stop(time);\n\t this._activeSources.forEach(function (source) {\n\t source.stop(time);\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Stop and then restart the player from the beginning (or offset)\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @returns {Tone.Player} this\n\t\t */\n\t Tone.Player.prototype.restart = function (time, offset, duration) {\n\t this._stop(time);\n\t this._start(time, offset, duration);\n\t return this;\n\t };\n\t /**\n\t\t * Seek to a specific time in the player's buffer. If the\n\t\t * source is no longer playing at that time, it will stop.\n\t\t * If you seek to a time that\n\t\t * @param {Time} offset The time to seek to.\n\t\t * @param {Time=} time The time for the seek event to occur.\n\t\t * @return {Tone.Player} this\n\t\t * @example\n\t\t * source.start(0.2);\n\t\t * source.stop(0.4);\n\t\t */\n\t Tone.Player.prototype.seek = function (offset, time) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t offset = this.toSeconds(offset);\n\t // if it's currently playing, stop it\n\t this._stop(time);\n\t //restart it at the given time\n\t this._start(time, offset);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Set the loop start and end. Will only loop if loop is\n\t\t * set to true.\n\t\t * @param {Time} loopStart The loop end time\n\t\t * @param {Time} loopEnd The loop end time\n\t\t * @returns {Tone.Player} this\n\t\t * @example\n\t\t * //loop 0.1 seconds of the file.\n\t\t * player.setLoopPoints(0.2, 0.3);\n\t\t * player.loop = true;\n\t\t */\n\t Tone.Player.prototype.setLoopPoints = function (loopStart, loopEnd) {\n\t this.loopStart = loopStart;\n\t this.loopEnd = loopEnd;\n\t return this;\n\t };\n\t /**\n\t\t * If loop is true, the loop will start at this position.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loopStart', {\n\t get: function () {\n\t return this._loopStart;\n\t },\n\t set: function (loopStart) {\n\t this._loopStart = loopStart;\n\t //get the current source\n\t this._activeSources.forEach(function (source) {\n\t source.loopStart = loopStart;\n\t });\n\t }\n\t });\n\t /**\n\t\t * If loop is true, the loop will end at this position.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loopEnd', {\n\t get: function () {\n\t return this._loopEnd;\n\t },\n\t set: function (loopEnd) {\n\t this._loopEnd = loopEnd;\n\t //get the current source\n\t this._activeSources.forEach(function (source) {\n\t source.loopEnd = loopEnd;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The audio buffer belonging to the player.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Tone.Buffer}\n\t\t * @name buffer\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'buffer', {\n\t get: function () {\n\t return this._buffer;\n\t },\n\t set: function (buffer) {\n\t this._buffer.set(buffer);\n\t }\n\t });\n\t /**\n\t\t * If the buffer should loop once it's over.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Boolean}\n\t\t * @name loop\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loop', {\n\t get: function () {\n\t return this._loop;\n\t },\n\t set: function (loop) {\n\t //if no change, do nothing\n\t if (this._loop === loop) {\n\t return;\n\t }\n\t this._loop = loop;\n\t var now = this.now();\n\t if (!loop) {\n\t //stop the playback on the next cycle\n\t this._stopAtNextIteration(now);\n\t } else {\n\t //remove the next stopEvent\n\t var stopEvent = this._state.getNextState(Tone.State.Stopped, now);\n\t if (stopEvent) {\n\t this._activeSources.forEach(function (source) {\n\t source.loop = loop;\n\t });\n\t this._state.cancel(stopEvent.time);\n\t this._elapsedTime.cancel(stopEvent.time);\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * Schedules a stop event at the next full iteration. Used\n\t\t * for scheduling stop when the loop state or playbackRate changes\n\t\t * @param {Number} now The current time\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._stopAtNextIteration = function (now) {\n\t if (this._state.getValueAtTime(now) === Tone.State.Started) {\n\t var nextStop = this._state.getNextState(Tone.State.Stopped, now);\n\t var position = this._elapsedTime.getTicksAtTime(now);\n\t var iterations = Math.max(Math.ceil(position / this.buffer.duration), 1);\n\t var stopTime = this._elapsedTime.getTimeOfTick(iterations * this.buffer.duration, nextStop ? nextStop.time - this.sampleTime : Infinity);\n\t this.stop(stopTime);\n\t }\n\t };\n\t /**\n\t\t * The playback speed. 1 is normal speed. This is not a signal because\n\t\t * Safari and iOS currently don't support playbackRate as a signal.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Number}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t var now = this.now();\n\t this._elapsedTime.frequency.setValueAtTime(rate, now);\n\t //if it's not looping\n\t if (!this._loop) {\n\t this._stopAtNextIteration(now);\n\t }\n\t //set all the sources\n\t this._activeSources.forEach(function (source) {\n\t source.playbackRate.setValueAtTime(rate, now);\n\t });\n\t }\n\t });\n\t /**\n\t\t * The current playback position of the buffer. \n\t\t * @memberOf Tone.Player#\n\t\t * @type {Number}\n\t\t * @name position\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'position', {\n\t get: function () {\n\t var now = this.now();\n\t if (this._state.getValueAtTime(now) === Tone.State.Started && this.loaded) {\n\t var duration = this.buffer.duration;\n\t var position = this._elapsedTime.getTicksAtTime(now);\n\t return position % duration;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The direction the buffer should play in\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Boolean}\n\t\t * @name reverse\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'reverse', {\n\t get: function () {\n\t return this._buffer.reverse;\n\t },\n\t set: function (rev) {\n\t this._buffer.reverse = rev;\n\t }\n\t });\n\t /**\n\t\t * If all the buffer is loaded\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loaded', {\n\t get: function () {\n\t return this._buffer.loaded;\n\t }\n\t });\n\t /**\n\t\t * Dispose and disconnect.\n\t\t * @return {Tone.Player} this\n\t\t */\n\t Tone.Player.prototype.dispose = function () {\n\t //disconnect all of the players\n\t this._activeSources.forEach(function (source) {\n\t source.dispose();\n\t });\n\t this._activeSources = null;\n\t Tone.Source.prototype.dispose.call(this);\n\t this._buffer.dispose();\n\t this._buffer = null;\n\t this._elapsedTime.dispose();\n\t this._elapsedTime = null;\n\t return this;\n\t };\n\t return Tone.Player;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Players combines multiple [Tone.Player](Player) objects.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Object} urls An object mapping a name to a url.\n\t\t * @param {function=} onload The function to invoke when all buffers are loaded.\n\t\t */\n\t Tone.Players = function (urls) {\n\t var args = Array.prototype.slice.call(arguments);\n\t args.shift();\n\t var options = Tone.defaults(args, ['onload'], Tone.Players);\n\t Tone.call(this);\n\t /**\n\t\t\t * The output volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * source.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t //make the output explicitly stereo\n\t this._volume.output.output.channelCount = 2;\n\t this._volume.output.output.channelCountMode = 'explicit';\n\t //mute initially\n\t this.mute = options.mute;\n\t /**\n\t\t\t * The container of all of the players\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._players = {};\n\t /**\n\t\t\t * The loading count\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loadingCount = 0;\n\t /**\n\t\t\t * private holder of the fadeIn time\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._fadeIn = options.fadeIn;\n\t /**\n\t\t\t * private holder of the fadeOut time\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._fadeOut = options.fadeOut;\n\t //add all of the players\n\t for (var name in urls) {\n\t this._loadingCount++;\n\t this.add(name, urls[name], this._bufferLoaded.bind(this, options.onload));\n\t }\n\t };\n\t Tone.extend(Tone.Players, Tone.AudioNode);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t */\n\t Tone.Players.defaults = {\n\t 'volume': 0,\n\t 'mute': false,\n\t 'onload': Tone.noOp,\n\t 'fadeIn': 0,\n\t 'fadeOut': 0\n\t };\n\t /**\n\t\t * A buffer was loaded. decrement the counter.\n\t\t * @param {Function} callback\n\t\t * @private\n\t\t */\n\t Tone.Players.prototype._bufferLoaded = function (callback) {\n\t this._loadingCount--;\n\t if (this._loadingCount === 0 && callback) {\n\t callback(this);\n\t }\n\t };\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * source.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * The fadeIn time of the amplitude envelope.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {Time}\n\t\t * @name fadeIn\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'fadeIn', {\n\t get: function () {\n\t return this._fadeIn;\n\t },\n\t set: function (fadeIn) {\n\t this._fadeIn = fadeIn;\n\t this._forEach(function (player) {\n\t player.fadeIn = fadeIn;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The fadeOut time of the amplitude envelope.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {Time}\n\t\t * @name fadeOut\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'fadeOut', {\n\t get: function () {\n\t return this._fadeOut;\n\t },\n\t set: function (fadeOut) {\n\t this._fadeOut = fadeOut;\n\t this._forEach(function (player) {\n\t player.fadeOut = fadeOut;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The state of the players object. Returns \"started\" if any of the players are playing.\n\t\t * @memberOf Tone.Players#\n\t\t * @type {String}\n\t\t * @name state\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'state', {\n\t get: function () {\n\t var playing = false;\n\t this._forEach(function (player) {\n\t playing = playing || player.state === Tone.State.Started;\n\t });\n\t return playing ? Tone.State.Started : Tone.State.Stopped;\n\t }\n\t });\n\t /**\n\t\t * True if the buffers object has a buffer by that name.\n\t\t * @param {String|Number} name The key or index of the\n\t\t * buffer.\n\t\t * @return {Boolean}\n\t\t */\n\t Tone.Players.prototype.has = function (name) {\n\t return this._players.hasOwnProperty(name);\n\t };\n\t /**\n\t\t * Get a player by name.\n\t\t * @param {String} name The players name as defined in\n\t\t * the constructor object or `add` method.\n\t\t * @return {Tone.Player}\n\t\t */\n\t Tone.Players.prototype.get = function (name) {\n\t if (this.has(name)) {\n\t return this._players[name];\n\t } else {\n\t throw new Error('Tone.Players: no player named ' + name);\n\t }\n\t };\n\t /**\n\t\t * Iterate over all of the players\n\t\t * @param {Function} callback\n\t\t * @return {Tone.Players} this\n\t\t * @private\n\t\t */\n\t Tone.Players.prototype._forEach = function (callback) {\n\t for (var playerName in this._players) {\n\t callback(this._players[playerName], playerName);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * If all the buffers are loaded or not\n\t\t * @memberOf Tone.Players#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'loaded', {\n\t get: function () {\n\t var isLoaded = true;\n\t this._forEach(function (player) {\n\t isLoaded = isLoaded && player.loaded;\n\t });\n\t return isLoaded;\n\t }\n\t });\n\t /**\n\t\t * Add a player by name and url to the Players\n\t\t * @param {String} name A unique name to give the player\n\t\t * @param {String|Tone.Buffer|Audiobuffer} url Either the url of the bufer,\n\t\t * or a buffer which will be added\n\t\t * with the given name.\n\t\t * @param {Function=} callback The callback to invoke\n\t\t * when the url is loaded.\n\t\t */\n\t Tone.Players.prototype.add = function (name, url, callback) {\n\t this._players[name] = new Tone.Player(url, callback).connect(this.output);\n\t this._players[name].fadeIn = this._fadeIn;\n\t this._players[name].fadeOut = this._fadeOut;\n\t return this;\n\t };\n\t /**\n\t\t * Stop all of the players at the given time\n\t\t * @param {Time} time The time to stop all of the players.\n\t\t * @return {Tone.Players} this\n\t\t */\n\t Tone.Players.prototype.stopAll = function (time) {\n\t this._forEach(function (player) {\n\t player.stop(time);\n\t });\n\t };\n\t /**\n\t\t * Dispose and disconnect.\n\t\t * @return {Tone.Players} this\n\t\t */\n\t Tone.Players.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._volume.dispose();\n\t this._volume = null;\n\t this._writable('volume');\n\t this.volume = null;\n\t this.output = null;\n\t this._forEach(function (player) {\n\t player.dispose();\n\t });\n\t this._players = null;\n\t return this;\n\t };\n\t return Tone.Players;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.UserMedia uses MediaDevices.getUserMedia to open up\n\t\t * and external microphone or audio input. Check\n\t\t * [MediaDevices API Support](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia)\n\t\t * to see which browsers are supported. Access to an external input\n\t\t * is limited to secure (HTTPS) connections.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Decibels=} volume The level of the input\n\t\t * @example\n\t\t * //list the inputs and open the third one\n\t\t * var motu = new Tone.UserMedia();\n\t\t *\n\t\t * //opening the input asks the user to activate their mic\n\t\t * motu.open().then(function(){\n\t\t * \t//promise resolves when input is available\n\t\t * });\n\t\t */\n\t Tone.UserMedia = function () {\n\t var options = Tone.defaults(arguments, ['volume'], Tone.UserMedia);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The MediaStreamNode\n\t\t\t * @type {MediaStreamAudioSourceNode}\n\t\t\t * @private\n\t\t\t */\n\t this._mediaStream = null;\n\t /**\n\t\t\t * The media stream created by getUserMedia.\n\t\t\t * @type {LocalMediaStream}\n\t\t\t * @private\n\t\t\t */\n\t this._stream = null;\n\t /**\n\t\t\t * The open device\n\t\t\t * @type {MediaDeviceInfo}\n\t\t\t * @private\n\t\t\t */\n\t this._device = null;\n\t /**\n\t\t\t * The output volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * input.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t this.mute = options.mute;\n\t };\n\t Tone.extend(Tone.UserMedia, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @type {Object}\n\t\t */\n\t Tone.UserMedia.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Open the media stream. If a string is passed in, it is assumed\n\t\t * to be the label or id of the stream, if a number is passed in,\n\t\t * it is the input number of the stream.\n\t\t * @param {String|Number} [labelOrId=\"default\"] The label or id of the audio input media device.\n\t\t * With no argument, the default stream is opened.\n\t\t * @return {Promise} The promise is resolved when the stream is open.\n\t\t */\n\t Tone.UserMedia.prototype.open = function (labelOrId) {\n\t return Tone.UserMedia.enumerateDevices().then(function (devices) {\n\t var device;\n\t if (Tone.isNumber(labelOrId)) {\n\t device = devices[labelOrId];\n\t } else {\n\t device = devices.find(function (device) {\n\t return device.label === labelOrId || device.deviceId === labelOrId;\n\t });\n\t //didn't find a matching device\n\t if (!device && devices.length > 0) {\n\t device = devices[0];\n\t } else if (!device && Tone.isDefined(labelOrId)) {\n\t throw new Error('Tone.UserMedia: no matching device: ' + labelOrId);\n\t }\n\t }\n\t this._device = device;\n\t //do getUserMedia\n\t var constraints = {\n\t audio: {\n\t 'echoCancellation': false,\n\t 'sampleRate': this.context.sampleRate\n\t }\n\t };\n\t if (device) {\n\t constraints.audio.deviceId = device.deviceId;\n\t }\n\t return navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {\n\t //start a new source only if the previous one is closed\n\t if (!this._stream) {\n\t this._stream = stream;\n\t //Wrap a MediaStreamSourceNode around the live input stream.\n\t this._mediaStream = this.context.createMediaStreamSource(stream);\n\t //Connect the MediaStreamSourceNode to a gate gain node\n\t this._mediaStream.connect(this.output);\n\t }\n\t return this;\n\t }.bind(this));\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Close the media stream\n\t\t * @return {Tone.UserMedia} this\n\t\t */\n\t Tone.UserMedia.prototype.close = function () {\n\t if (this._stream) {\n\t this._stream.getAudioTracks().forEach(function (track) {\n\t track.stop();\n\t });\n\t this._stream = null;\n\t //remove the old media stream\n\t this._mediaStream.disconnect();\n\t this._mediaStream = null;\n\t }\n\t this._device = null;\n\t return this;\n\t };\n\t /**\n\t\t * Returns a promise which resolves with the list of audio input devices available.\n\t\t * @return {Promise} The promise that is resolved with the devices\n\t\t * @static\n\t\t * @example\n\t\t * Tone.UserMedia.enumerateDevices().then(function(devices){\n\t\t * \tconsole.log(devices)\n\t\t * })\n\t\t */\n\t Tone.UserMedia.enumerateDevices = function () {\n\t return navigator.mediaDevices.enumerateDevices().then(function (devices) {\n\t return devices.filter(function (device) {\n\t return device.kind === 'audioinput';\n\t });\n\t });\n\t };\n\t /**\n\t\t * Returns the playback state of the source, \"started\" when the microphone is open\n\t\t * and \"stopped\" when the mic is closed.\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'state', {\n\t get: function () {\n\t return this._stream && this._stream.active ? Tone.State.Started : Tone.State.Stopped;\n\t }\n\t });\n\t /**\n\t\t * \tReturns an identifier for the represented device that is\n\t\t * \tpersisted across sessions. It is un-guessable by other applications and\n\t\t * \tunique to the origin of the calling application. It is reset when the\n\t\t * \tuser clears cookies (for Private Browsing, a different identifier is\n\t\t * \tused that is not persisted across sessions). Returns undefined when the\n\t\t * \tdevice is not open.\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name deviceId\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'deviceId', {\n\t get: function () {\n\t if (this._device) {\n\t return this._device.deviceId;\n\t }\n\t }\n\t });\n\t /**\n\t\t * \tReturns a group identifier. Two devices have the\n\t\t * \tsame group identifier if they belong to the same physical device.\n\t\t * \tReturns undefined when the device is not open.\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name groupId\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'groupId', {\n\t get: function () {\n\t if (this._device) {\n\t return this._device.groupId;\n\t }\n\t }\n\t });\n\t /**\n\t\t * \tReturns a label describing this device (for example \"Built-in Microphone\").\n\t\t * \tReturns undefined when the device is not open or label is not available\n\t\t * \tbecause of permissions.\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name groupId\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'label', {\n\t get: function () {\n\t if (this._device) {\n\t return this._device.label;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * userMedia.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.UserMedia} this\n\t\t */\n\t Tone.UserMedia.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.close();\n\t this._writable('volume');\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t return this;\n\t };\n\t /**\n\t\t * If getUserMedia is supported by the browser.\n\t\t * @type {Boolean}\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name supported\n\t\t * @static\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.UserMedia, 'supported', {\n\t get: function () {\n\t return Tone.isDefined(navigator.mediaDevices) && Tone.isFunction(navigator.mediaDevices.getUserMedia);\n\t }\n\t });\n\t return Tone.UserMedia;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Midi is a primitive type for encoding Time values.\n\t\t * Tone.Midi can be constructed with or without the `new` keyword. Tone.Midi can be passed\n\t\t * into the parameter of any method which takes time as an argument.\n\t\t * @constructor\n\t\t * @extends {Tone.Frequency}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * var t = Tone.Midi(\"4n\");//a quarter note\n\t\t */\n\t Tone.Midi = function (val, units) {\n\t if (this instanceof Tone.Midi) {\n\t Tone.Frequency.call(this, val, units);\n\t } else {\n\t return new Tone.Midi(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Midi, Tone.Frequency);\n\t /**\n\t\t * The default units if none are given.\n\t\t * @type {String}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._defaultUnits = 'midi';\n\t /**\n\t\t * Returns the value of a frequency in the current units\n\t\t * @param {Frequency} freq\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._frequencyToUnits = function (freq) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._frequencyToUnits.call(this, freq));\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._ticksToUnits = function (ticks) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._ticksToUnits.call(this, ticks));\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._beatsToUnits = function (beats) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._beatsToUnits.call(this, beats));\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._secondsToUnits = function (seconds) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._secondsToUnits.call(this, seconds));\n\t };\n\t /**\n\t\t * Return the value of the frequency as a MIDI note\n\t\t * @return {MIDI}\n\t\t * @example\n\t\t * Tone.Midi(60).toMidi(); //60\n\t\t */\n\t Tone.Midi.prototype.toMidi = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the value of the frequency as a MIDI note\n\t\t * @return {MIDI}\n\t\t * @example\n\t\t * Tone.Midi(60).toMidi(); //60\n\t\t */\n\t Tone.Midi.prototype.toFrequency = function () {\n\t return Tone.Frequency.mtof(this.toMidi());\n\t };\n\t /**\n\t\t * Transposes the frequency by the given number of semitones.\n\t\t * @param {Interval} interval\n\t\t * @return {Tone.Frequency} A new transposed frequency\n\t\t * @example\n\t\t * Tone.Frequency(\"A4\").transpose(3); //\"C5\"\n\t\t */\n\t Tone.Midi.prototype.transpose = function (interval) {\n\t return new this.constructor(this.toMidi() + interval);\n\t };\n\t return Tone.Midi;\n\t});\n\t\n\treturn Tone;\n}));","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction valueEqual(a, b) {\n if (a === b) return true;\n\n if (a == null || b == null) return false;\n\n if (Array.isArray(a)) {\n return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {\n return valueEqual(item, b[index]);\n });\n }\n\n var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a);\n var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b);\n\n if (aType !== bType) return false;\n\n if (aType === 'object') {\n var aValue = a.valueOf();\n var bValue = b.valueOf();\n\n if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);\n\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n return aKeys.every(function (key) {\n return valueEqual(a[key], b[key]);\n });\n }\n\n return false;\n}\n\nexport default valueEqual;","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n\n if (format.length < 10 || (/^[s\\W]*$/).test(format)) {\n throw new Error(\n 'The warning format should be able to uniquely identify this ' +\n 'warning. Please, use a more descriptive format than: ' + format\n );\n }\n\n if (!condition) {\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch(x) {}\n }\n };\n}\n\nmodule.exports = warning;\n","module.exports = function() {\r\n\tthrow new Error(\"define cannot be used indirect\");\r\n};\r\n","/* globals __webpack_amd_options__ */\r\nmodule.exports = __webpack_amd_options__;\r\n","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n","module.exports = function(originalModule) {\r\n\tif (!originalModule.webpackPolyfill) {\r\n\t\tvar module = Object.create(originalModule);\r\n\t\t// module.parent = undefined by default\r\n\t\tif (!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"exports\", {\r\n\t\t\tenumerable: true\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n","module.exports = function(module) {\r\n\tif (!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif (!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA,WAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5vDA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7DA;AACA;AACA;AAAA;AAAA;AAAA;AACA,qBAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1fA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;;;;;;;;;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjSA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClTA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5JA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5EA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA,aACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3hBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpIA;AACA;;;;;;;;;;;ACDA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACJA;AACA;;;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACnBA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACNA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA;;;;;;;;;;;ACAA;AACA;AACA;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACfA;AACA;AACA;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5PA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3BA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACLA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7CA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACdA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACRA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5BA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7DA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACj1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnhDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnsCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACrnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7hBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAIA;;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACXA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChSA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5CA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACbA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1FA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjGA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpEA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1JA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5FA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC/BA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzaA;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACzEA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;;;;;;;;;;;;ACAA;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3kBA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzLA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvSA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAEA;AACA;AACA;AACA;;;;;;;;;;;;;;AClBA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA,UAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7zvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5GA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3DA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;;;;;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;A","sourceRoot":""}
\ No newline at end of file +{"version":3,"file":"bundle.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/client/actions.js","webpack:///./app/client/api/crud.actions.js","webpack:///./app/client/api/crud.fetch.js","webpack:///./app/client/api/crud.types.js","webpack:///./app/client/api/crud.upload.js","webpack:///./app/client/api/index.js","webpack:///./app/client/api/parser.js","webpack:///./app/client/audio/lib/draw.js","webpack:///./app/client/audio/lib/index.js","webpack:///./app/client/audio/lib/output.js","webpack:///./app/client/audio/lib/spectrum.js","webpack:///./app/client/audio/lib/startAudioContext.js","webpack:///./app/client/audio/pix2wav.js","webpack:///./app/client/audio/wav2pix.js","webpack:///./app/client/common/audioPlayer/audioPlayer.actions.js","webpack:///./app/client/common/audioPlayer/audioPlayer.component.js","webpack:///./app/client/common/audioPlayer/audioPlayer.reducer.js","webpack:///./app/client/common/augmentationGrid.component.js","webpack:///./app/client/common/button.component.js","webpack:///./app/client/common/buttonGrid.component.js","webpack:///./app/client/common/checkbox.component.js","webpack:///./app/client/common/currentTask.component.js","webpack:///./app/client/common/fileList.component.js","webpack:///./app/client/common/fileUpload.component.js","webpack:///./app/client/common/folderList.component.js","webpack:///./app/client/common/gallery.component.js","webpack:///./app/client/common/group.component.js","webpack:///./app/client/common/header.component.js","webpack:///./app/client/common/index.js","webpack:///./app/client/common/loading.component.js","webpack:///./app/client/common/numberInput.component.js","webpack:///./app/client/common/param.component.js","webpack:///./app/client/common/paramGroup.component.js","webpack:///./app/client/common/player.component.js","webpack:///./app/client/common/progress.component.js","webpack:///./app/client/common/select.component.js","webpack:///./app/client/common/selectGroup.component.js","webpack:///./app/client/common/slider.component.js","webpack:///./app/client/common/taskList.component.js","webpack:///./app/client/common/textInput.component.js","webpack:///./app/client/common/views/index.js","webpack:///./app/client/common/views/new.view.js","webpack:///./app/client/dashboard/dashboard.actions.js","webpack:///./app/client/dashboard/dashboard.component.js","webpack:///./app/client/dashboard/dashboard.reducer.js","webpack:///./app/client/dashboard/dashboardheader.component.js","webpack:///./app/client/dataset/dataset.actions.js","webpack:///./app/client/dataset/dataset.component.js","webpack:///./app/client/dataset/dataset.form.js","webpack:///./app/client/dataset/dataset.loader.js","webpack:///./app/client/dataset/dataset.new.js","webpack:///./app/client/dataset/dataset.reducer.js","webpack:///./app/client/dataset/upload.reducer.js","webpack:///./app/client/dataset/upload.status.js","webpack:///./app/client/index.jsx","webpack:///./app/client/live/live.actions.js","webpack:///./app/client/live/live.reducer.js","webpack:///./app/client/live/player.js","webpack:///./app/client/live/whammy.js","webpack:///./app/client/modules/index.js","webpack:///./app/client/modules/module.reducer.js","webpack:///./app/client/modules/morph/index.js","webpack:///./app/client/modules/morph/morph.actions.js","webpack:///./app/client/modules/morph/morph.module.js","webpack:///./app/client/modules/morph/morph.reducer.js","webpack:///./app/client/modules/morph/morph.tasks.js","webpack:///./app/client/modules/morph/views/morph.app.js","webpack:///./app/client/modules/pix2pix/index.js","webpack:///./app/client/modules/pix2pix/pix2pix.actions.js","webpack:///./app/client/modules/pix2pix/pix2pix.module.js","webpack:///./app/client/modules/pix2pix/pix2pix.reducer.js","webpack:///./app/client/modules/pix2pix/pix2pix.tasks.js","webpack:///./app/client/modules/pix2pix/views/pix2pix.live.js","webpack:///./app/client/modules/pix2pix/views/pix2pix.new.js","webpack:///./app/client/modules/pix2pix/views/pix2pix.show.js","webpack:///./app/client/modules/pix2pixhd/index.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.actions.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.module.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.reducer.js","webpack:///./app/client/modules/pix2pixhd/pix2pixhd.tasks.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.live.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.new.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.results.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.show.js","webpack:///./app/client/modules/pix2pixhd/views/pix2pixhd.train.js","webpack:///./app/client/modules/pix2wav/index.js","webpack:///./app/client/modules/pix2wav/pix2wav.actions.js","webpack:///./app/client/modules/pix2wav/pix2wav.module.js","webpack:///./app/client/modules/pix2wav/pix2wav.reducer.js","webpack:///./app/client/modules/pix2wav/pix2wav.tasks.js","webpack:///./app/client/modules/pix2wav/views/pix2wav.live.js","webpack:///./app/client/modules/pix2wav/views/pix2wav.new.js","webpack:///./app/client/modules/pix2wav/views/pix2wav.show.js","webpack:///./app/client/modules/pix2wav/views/spectrogram.upload.js","webpack:///./app/client/modules/samplernn/index.js","webpack:///./app/client/modules/samplernn/samplernn.actions.js","webpack:///./app/client/modules/samplernn/samplernn.module.js","webpack:///./app/client/modules/samplernn/samplernn.reducer.js","webpack:///./app/client/modules/samplernn/samplernn.tasks.js","webpack:///./app/client/modules/samplernn/views/samplernn.graph.js","webpack:///./app/client/modules/samplernn/views/samplernn.import.js","webpack:///./app/client/modules/samplernn/views/samplernn.new.js","webpack:///./app/client/modules/samplernn/views/samplernn.results.js","webpack:///./app/client/modules/samplernn/views/samplernn.show.js","webpack:///./app/client/queue/queue.actions.js","webpack:///./app/client/queue/queue.reducer.js","webpack:///./app/client/socket/index.js","webpack:///./app/client/socket/socket.actions.js","webpack:///./app/client/socket/socket.api.js","webpack:///./app/client/socket/socket.connection.js","webpack:///./app/client/socket/socket.live.js","webpack:///./app/client/socket/socket.system.js","webpack:///./app/client/socket/socket.task.js","webpack:///./app/client/store.js","webpack:///./app/client/system/system.actions.js","webpack:///./app/client/system/system.component.js","webpack:///./app/client/system/system.reducer.js","webpack:///./app/client/types.js","webpack:///./app/client/util/format.js","webpack:///./app/client/util/hidpi-canvas.js","webpack:///./app/client/util/index.js","webpack:///./app/client/util/math.js","webpack:///./app/client/util/sort.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/buffer/node_modules/isarray/index.js","webpack:///./node_modules/core-util-is/lib/util.js","webpack:///./node_modules/events/events.js","webpack:///./node_modules/fbjs/lib/emptyFunction.js","webpack:///./node_modules/fbjs/lib/invariant.js","webpack:///./node_modules/fbjs/lib/warning.js","webpack:///./node_modules/fetch-jsonp/build/fetch-jsonp.js","webpack:///./node_modules/fft.js/lib/fft.js","webpack:///./node_modules/file-saver/FileSaver.js","webpack:///./node_modules/history/DOMUtils.js","webpack:///./node_modules/history/LocationUtils.js","webpack:///./node_modules/history/PathUtils.js","webpack:///./node_modules/history/createBrowserHistory.js","webpack:///./node_modules/history/createHashHistory.js","webpack:///./node_modules/history/createMemoryHistory.js","webpack:///./node_modules/history/createTransitionManager.js","webpack:///./node_modules/history/es/DOMUtils.js","webpack:///./node_modules/history/es/LocationUtils.js","webpack:///./node_modules/history/es/PathUtils.js","webpack:///./node_modules/history/es/createBrowserHistory.js","webpack:///./node_modules/history/es/createHashHistory.js","webpack:///./node_modules/history/es/createMemoryHistory.js","webpack:///./node_modules/history/es/createTransitionManager.js","webpack:///./node_modules/history/es/index.js","webpack:///./node_modules/hoist-non-react-statics/index.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/immediate/lib/browser.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./node_modules/invariant/browser.js","webpack:///./node_modules/jszip/lib/base64.js","webpack:///./node_modules/jszip/lib/compressedObject.js","webpack:///./node_modules/jszip/lib/compressions.js","webpack:///./node_modules/jszip/lib/crc32.js","webpack:///./node_modules/jszip/lib/defaults.js","webpack:///./node_modules/jszip/lib/external.js","webpack:///./node_modules/jszip/lib/flate.js","webpack:///./node_modules/jszip/lib/generate/ZipFileWorker.js","webpack:///./node_modules/jszip/lib/generate/index.js","webpack:///./node_modules/jszip/lib/index.js","webpack:///./node_modules/jszip/lib/load.js","webpack:///./node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js","webpack:///./node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js","webpack:///./node_modules/jszip/lib/nodejsUtils.js","webpack:///./node_modules/jszip/lib/object.js","webpack:///./node_modules/jszip/lib/readable-stream-browser.js","webpack:///./node_modules/jszip/lib/reader/ArrayReader.js","webpack:///./node_modules/jszip/lib/reader/DataReader.js","webpack:///./node_modules/jszip/lib/reader/NodeBufferReader.js","webpack:///./node_modules/jszip/lib/reader/StringReader.js","webpack:///./node_modules/jszip/lib/reader/Uint8ArrayReader.js","webpack:///./node_modules/jszip/lib/reader/readerFor.js","webpack:///./node_modules/jszip/lib/signature.js","webpack:///./node_modules/jszip/lib/stream/ConvertWorker.js","webpack:///./node_modules/jszip/lib/stream/Crc32Probe.js","webpack:///./node_modules/jszip/lib/stream/DataLengthProbe.js","webpack:///./node_modules/jszip/lib/stream/DataWorker.js","webpack:///./node_modules/jszip/lib/stream/GenericWorker.js","webpack:///./node_modules/jszip/lib/stream/StreamHelper.js","webpack:///./node_modules/jszip/lib/support.js","webpack:///./node_modules/jszip/lib/utf8.js","webpack:///./node_modules/jszip/lib/utils.js","webpack:///./node_modules/jszip/lib/zipEntries.js","webpack:///./node_modules/jszip/lib/zipEntry.js","webpack:///./node_modules/jszip/lib/zipObject.js","webpack:///./node_modules/jszip/node_modules/core-js/library/fn/set-immediate.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_a-function.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_an-object.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_cof.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_core.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_ctx.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_descriptors.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_dom-create.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_export.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_fails.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_global.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_hide.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_html.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_ie8-dom-define.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_invoke.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_is-object.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_object-dp.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_property-desc.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_task.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/_to-primitive.js","webpack:///./node_modules/jszip/node_modules/core-js/library/modules/web.immediate.js","webpack:///./node_modules/lie/lib/browser.js","webpack:///./node_modules/lodash-es/_Symbol.js","webpack:///./node_modules/lodash-es/_baseGetTag.js","webpack:///./node_modules/lodash-es/_freeGlobal.js","webpack:///./node_modules/lodash-es/_getPrototype.js","webpack:///./node_modules/lodash-es/_getRawTag.js","webpack:///./node_modules/lodash-es/_objectToString.js","webpack:///./node_modules/lodash-es/_overArg.js","webpack:///./node_modules/lodash-es/_root.js","webpack:///./node_modules/lodash-es/isObjectLike.js","webpack:///./node_modules/lodash-es/isPlainObject.js","webpack:///./node_modules/moment/min/moment.min.js","webpack:///./node_modules/node-fetch/browser.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/pako/index.js","webpack:///./node_modules/pako/lib/deflate.js","webpack:///./node_modules/pako/lib/inflate.js","webpack:///./node_modules/pako/lib/utils/common.js","webpack:///./node_modules/pako/lib/utils/strings.js","webpack:///./node_modules/pako/lib/zlib/adler32.js","webpack:///./node_modules/pako/lib/zlib/constants.js","webpack:///./node_modules/pako/lib/zlib/crc32.js","webpack:///./node_modules/pako/lib/zlib/deflate.js","webpack:///./node_modules/pako/lib/zlib/gzheader.js","webpack:///./node_modules/pako/lib/zlib/inffast.js","webpack:///./node_modules/pako/lib/zlib/inflate.js","webpack:///./node_modules/pako/lib/zlib/inftrees.js","webpack:///./node_modules/pako/lib/zlib/messages.js","webpack:///./node_modules/pako/lib/zlib/trees.js","webpack:///./node_modules/pako/lib/zlib/zstream.js","webpack:///./node_modules/preact-compat/dist/preact-compat.es.js","webpack:///./node_modules/preact/dist/preact.esm.js","webpack:///./node_modules/process-nextick-args/index.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/react-redux/es/components/Provider.js","webpack:///./node_modules/react-redux/es/components/connectAdvanced.js","webpack:///./node_modules/react-redux/es/connect/connect.js","webpack:///./node_modules/react-redux/es/connect/mapDispatchToProps.js","webpack:///./node_modules/react-redux/es/connect/mapStateToProps.js","webpack:///./node_modules/react-redux/es/connect/mergeProps.js","webpack:///./node_modules/react-redux/es/connect/selectorFactory.js","webpack:///./node_modules/react-redux/es/connect/verifySubselectors.js","webpack:///./node_modules/react-redux/es/connect/wrapMapToProps.js","webpack:///./node_modules/react-redux/es/index.js","webpack:///./node_modules/react-redux/es/utils/PropTypes.js","webpack:///./node_modules/react-redux/es/utils/Subscription.js","webpack:///./node_modules/react-redux/es/utils/shallowEqual.js","webpack:///./node_modules/react-redux/es/utils/verifyPlainObject.js","webpack:///./node_modules/react-redux/es/utils/warning.js","webpack:///./node_modules/react-router-dom/es/BrowserRouter.js","webpack:///./node_modules/react-router-dom/es/HashRouter.js","webpack:///./node_modules/react-router-dom/es/Link.js","webpack:///./node_modules/react-router-dom/es/MemoryRouter.js","webpack:///./node_modules/react-router-dom/es/NavLink.js","webpack:///./node_modules/react-router-dom/es/Prompt.js","webpack:///./node_modules/react-router-dom/es/Redirect.js","webpack:///./node_modules/react-router-dom/es/Route.js","webpack:///./node_modules/react-router-dom/es/Router.js","webpack:///./node_modules/react-router-dom/es/StaticRouter.js","webpack:///./node_modules/react-router-dom/es/Switch.js","webpack:///./node_modules/react-router-dom/es/index.js","webpack:///./node_modules/react-router-dom/es/matchPath.js","webpack:///./node_modules/react-router-dom/es/withRouter.js","webpack:///./node_modules/react-router-redux/lib/actions.js","webpack:///./node_modules/react-router-redux/lib/index.js","webpack:///./node_modules/react-router-redux/lib/middleware.js","webpack:///./node_modules/react-router-redux/lib/reducer.js","webpack:///./node_modules/react-router-redux/lib/sync.js","webpack:///./node_modules/react-router/es/MemoryRouter.js","webpack:///./node_modules/react-router/es/Prompt.js","webpack:///./node_modules/react-router/es/Redirect.js","webpack:///./node_modules/react-router/es/Route.js","webpack:///./node_modules/react-router/es/Router.js","webpack:///./node_modules/react-router/es/StaticRouter.js","webpack:///./node_modules/react-router/es/Switch.js","webpack:///./node_modules/react-router/es/matchPath.js","webpack:///./node_modules/react-router/es/withRouter.js","webpack:///./node_modules/react-router/node_modules/isarray/index.js","webpack:///./node_modules/react-router/node_modules/path-to-regexp/index.js","webpack:///./node_modules/readable-stream/duplex-browser.js","webpack:///./node_modules/readable-stream/lib/_stream_duplex.js","webpack:///./node_modules/readable-stream/lib/_stream_passthrough.js","webpack:///./node_modules/readable-stream/lib/_stream_readable.js","webpack:///./node_modules/readable-stream/lib/_stream_transform.js","webpack:///./node_modules/readable-stream/lib/_stream_writable.js","webpack:///./node_modules/readable-stream/lib/internal/streams/BufferList.js","webpack:///./node_modules/readable-stream/lib/internal/streams/destroy.js","webpack:///./node_modules/readable-stream/lib/internal/streams/stream-browser.js","webpack:///./node_modules/readable-stream/node_modules/isarray/index.js","webpack:///./node_modules/readable-stream/passthrough.js","webpack:///./node_modules/readable-stream/readable-browser.js","webpack:///./node_modules/readable-stream/transform.js","webpack:///./node_modules/readable-stream/writable-browser.js","webpack:///./node_modules/redux-thunk/lib/index.js","webpack:///./node_modules/redux/es/redux.js","webpack:///./node_modules/resolve-pathname/index.js","webpack:///./node_modules/safe-buffer/index.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/signal-windows/index.js","webpack:///./node_modules/signal-windows/src/framer.js","webpack:///./node_modules/signal-windows/src/windows.js","webpack:///./node_modules/sprintf-js/src/sprintf.js","webpack:///./node_modules/stream-browserify/index.js","webpack:///./node_modules/string_decoder/lib/string_decoder.js","webpack:///./node_modules/symbol-observable/es/index.js","webpack:///./node_modules/symbol-observable/es/ponyfill.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./node_modules/tone/build/Tone.js","webpack:///./node_modules/util-deprecate/browser.js","webpack:///./node_modules/uuid/lib/bytesToUuid.js","webpack:///./node_modules/uuid/lib/rng-browser.js","webpack:///./node_modules/uuid/v1.js","webpack:///./node_modules/value-equal/index.js","webpack:///./node_modules/warning/browser.js","webpack:///(webpack)/buildin/amd-define.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///(webpack)/buildin/module.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/client/index.jsx\");\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _redux = require('redux');\n\nvar _api = require('./api');\n\nvar _live = require('./live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('./queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _system = require('./system/system.actions');\n\nvar systemActions = _interopRequireWildcard(_system);\n\nvar _socket = require('./socket/socket.actions');\n\nvar socketActions = _interopRequireWildcard(_socket);\n\nvar _dataset = require('./dataset/dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _audioPlayer = require('./common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _store = require('./store');\n\nfunction _interopRequireWildcard(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; } }\n\nexports.default = Object.keys(_api.actions).map(function (a) {\n return [a, _api.actions[a]];\n}).concat([['live', liveActions], ['queue', queueActions], ['system', systemActions], ['dataset', datasetActions], ['audioPlayer', audioPlayerActions]]).map(function (p) {\n return [p[0], (0, _redux.bindActionCreators)(p[1], _store.store.dispatch)];\n}).concat([['socket', socketActions]]).reduce(function (a, b) {\n return (a[b[0]] = b[1]) && a;\n}, {});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.crud_action = undefined;\nexports.crud_actions = crud_actions;\n\nvar _crud = require('./crud.fetch');\n\nvar _crud2 = require('./crud.types');\n\nvar _crud3 = require('./crud.upload');\n\nfunction crud_actions(type) {\n var fetch_type = (0, _crud.crud_fetch)(type);\n return ['index', 'show', 'create', 'update', 'destroy'].reduce(function (lookup, param) {\n lookup[param] = crud_action(type, param, function (q) {\n return fetch_type[param](q);\n });\n return lookup;\n }, {\n action: function action(method, fn) {\n return crud_action(type, method, fn);\n },\n upload: function upload(id, fd) {\n return (0, _crud3.upload_action)(type, id, fd);\n }\n });\n}\n\nvar crud_action = exports.crud_action = function crud_action(type, method, fn) {\n return function (q) {\n return function (dispatch) {\n return new Promise(function (resolve, reject) {\n dispatch({ type: (0, _crud2.as_type)(type, method + '_loading') });\n fn(q).then(function (data) {\n dispatch({ type: (0, _crud2.as_type)(type, method), data: data });\n resolve(data);\n }).catch(function (e) {\n dispatch({ type: (0, _crud2.as_type)(type, method + '_error') });\n reject(e);\n });\n });\n };\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.crud_fetch = crud_fetch;\nexports.postBody = postBody;\n\nvar _nodeFetch = require('node-fetch');\n\nvar _nodeFetch2 = _interopRequireDefault(_nodeFetch);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction crud_fetch(type, tag) {\n var uri = '/api/' + type + '/' + (tag || '');\n return {\n index: function index(q) {\n return (0, _nodeFetch2.default)(_get_url(uri, q), _get_headers()).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n show: function show(id) {\n return (0, _nodeFetch2.default)(uri + id).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n create: function create(data) {\n return (0, _nodeFetch2.default)(uri, post(data)).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n update: function update(data) {\n return (0, _nodeFetch2.default)(uri + data.id, put(data)).then(function (req) {\n return req.json();\n }).catch(error);\n },\n\n destroy: function destroy(data) {\n return (0, _nodeFetch2.default)(uri + data.id, _destroy(data)).then(function (req) {\n return req.json();\n }).catch(error);\n }\n };\n}\n\nfunction _get_url(_url, data) {\n var url = new URL(window.location.origin + _url);\n if (data) {\n Object.keys(data).forEach(function (key) {\n return url.searchParams.append(key, data[key]);\n });\n }\n return url;\n}\nfunction _get_headers() {\n return {\n method: 'GET',\n headers: {\n 'Accept': 'application/json'\n }\n };\n}\nfunction post(data) {\n return {\n method: 'POST',\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n}\nfunction postBody(data) {\n return {\n method: 'POST',\n body: data,\n headers: {\n 'Accept': 'application/json'\n }\n };\n}\nfunction put(data) {\n return {\n method: 'PUT',\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n}\nfunction _destroy(data) {\n return {\n method: 'DELETE',\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n}\nfunction error(err) {\n console.warn(err);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar as_type = exports.as_type = function as_type(a, b) {\n return [a, b].join('_').toUpperCase();\n};\n\nvar with_type = exports.with_type = function with_type(type, actions) {\n return actions.reduce(function (a, b) {\n return (a[b] = as_type(type, b)) && a;\n }, {});\n};\n\nvar crud_type = exports.crud_type = function crud_type(type) {\n var actions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return with_type(type, actions.concat(['index_loading', 'index', 'index_error', 'show_loading', 'show', 'show_error', 'create_loading', 'create', 'create_error', 'update_loading', 'update', 'update_error', 'destroy_loading', 'destroy', 'destroy_error', 'upload_loading', 'upload_progress', 'upload_waiting', 'upload_complete', 'upload_error', 'sort']));\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.upload_action = undefined;\nexports.crud_upload = crud_upload;\n\nvar _crud = require('./crud.types');\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction crud_upload(type, fd, data, dispatch) {\n return new Promise(function (resolve, reject) {\n var id = data.id;\n\n Object.keys(data).forEach(function (key) {\n if (key !== 'id') {\n fd.append(key, data[key]);\n }\n });\n\n console.log('/api/' + type + '/' + id + '/upload/');\n\n var xhr = new XMLHttpRequest();\n xhr.upload.addEventListener(\"progress\", uploadProgress, false);\n xhr.addEventListener(\"load\", uploadComplete, false);\n xhr.addEventListener(\"error\", uploadFailed, false);\n xhr.addEventListener(\"abort\", uploadCancelled, false);\n xhr.open(\"POST\", '/api/' + type + '/' + id + '/upload/');\n xhr.send(fd);\n\n dispatch && dispatch({ type: (0, _crud.as_type)(type, 'upload_loading') });\n\n var complete = false;\n\n function uploadProgress(e) {\n if (e.lengthComputable) {\n var percent = Math.round(e.loaded * 100 / e.total) || 0;\n if (percent > 99) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_waiting'),\n percent: percent\n }, type, id));\n } else {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_progress'),\n percent: percent\n }, type, id));\n }\n } else {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'unable to compute upload progress'\n }, type, id));\n }\n }\n\n function uploadComplete(e) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(e.target.responseText);\n } catch (e) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'upload failed'\n }, type, id));\n reject(e);\n return;\n }\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_complete'),\n data: parsed\n }, type, id));\n if (parsed.files && parsed.files.length) {\n parsed.files.forEach(function (file) {\n console.log(file);\n dispatch && dispatch({\n type: (0, _crud.as_type)('file', 'create'),\n data: file\n });\n });\n }\n resolve(parsed);\n }\n\n function uploadFailed(evt) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'upload failed'\n }, type, id));\n reject(evt);\n }\n\n function uploadCancelled(evt) {\n dispatch && dispatch(_defineProperty({\n type: (0, _crud.as_type)(type, 'upload_error'),\n error: 'upload cancelled'\n }, type, id));\n reject(evt);\n }\n });\n}\n\nvar upload_action = exports.upload_action = function upload_action(type, id, fd) {\n return function (dispatch) {\n return crud_upload(type, id, fd, dispatch);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.actions = exports.parser = exports.util = undefined;\n\nvar _crud = require('./crud.actions');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _parser = require('./parser');\n\nvar parser = _interopRequireWildcard(_parser);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*\nfor our crud events, create corresponding actions\nthe actions fire a 'loading' event, call the underlying api method, and then resolve.\nso you can do ... \n import { folderActions } from '../../api'\n folderActions.index({ module: 'samplernn' })\n folderActions.show(12)\n folderActions.create({ module: 'samplernn', name: 'foo' })\n folderActions.update(12, { module: 'pix2pix' })\n folderActions.destroy(12, { confirm: true })\n folderActions.upload(12, form_data)\n*/\n\nexports.util = _util2.default;\nexports.parser = parser;\nvar actions = exports.actions = ['folder', 'file', 'dataset', 'task', 'user'].reduce(function (a, b) {\n return (a[b] = (0, _crud.crud_actions)(b)) && a;\n}, {});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.tumblr = exports.thumbnail = exports.loadImage = exports.tag = exports.parse = exports.lookup = exports.integrations = undefined;\n\nvar _nodeFetch = require('node-fetch');\n\nvar _nodeFetch2 = _interopRequireDefault(_nodeFetch);\n\nvar _fetchJsonp = require('fetch-jsonp');\n\nvar _fetchJsonp2 = _interopRequireDefault(_fetchJsonp);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar integrations = exports.integrations = [{\n type: 'image',\n regex: /\\.(jpeg|jpg|gif|png|svg)(\\?.*)?$/i,\n fetch: function fetch(url, done) {\n var img = new Image();\n img.onload = function () {\n if (!img) return;\n var width = img.naturalWidth,\n height = img.naturalHeight;\n img = null;\n done({\n url: url,\n type: \"image\",\n token: \"\",\n thumbnail: \"\",\n title: \"\",\n width: width,\n height: height\n });\n };\n img.src = url;\n if (img.complete) {\n img.onload();\n }\n },\n tag: function tag(media) {\n return '<img src=\"' + media.url + '\">';\n }\n}, {\n type: 'video',\n regex: /\\.(mp4|webm)(\\?.*)?$/i,\n fetch: function fetch(url, done) {\n var video = document.createElement(\"video\");\n var url_parts = url.replace(/\\?.*$/, \"\").split(\"/\");\n var filename = url_parts[url_parts.length - 1];\n video.addEventListener(\"loadedmetadata\", function () {\n var width = video.videoWidth,\n height = video.videoHeight;\n video = null;\n done({\n url: url,\n type: \"video\",\n token: url,\n thumbnail: \"/public/assets/img/video-thumbnail.png\",\n title: filename,\n width: width,\n height: height\n });\n });\n video.src = url;\n video.load();\n },\n tag: function tag(media) {\n return '<video src=\"' + media.url + '\">';\n }\n}, {\n type: 'audio',\n regex: /\\.(wav|mp3)(\\?.*)?$/i,\n fetch: function fetch(url, done) {\n var audio = document.createElement(\"audio\");\n var url_parts = url.replace(/\\?.*$/, \"\").split(\"/\");\n var filename = url_parts[url_parts.length - 1];\n audio.addEventListener(\"loadedmetadata\", function () {\n var duration = audio.duration;\n audio = null;\n done({\n url: url,\n type: \"audio\",\n token: url,\n thumbnail: \"/public/assets/img/audio-thumbnail.png\",\n title: filename,\n duration: duration\n });\n });\n audio.src = url;\n audio.load();\n },\n tag: function tag(media) {\n return '<audio src=\"' + media.url + '\">';\n }\n}, {\n type: 'youtube',\n regex: /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i,\n fetch: function fetch(url, done) {\n var id = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0];\n var thumb = \"https://i.ytimg.com/vi/\" + id + \"/hqdefault.jpg\";\n\n var jsonp_url = new URL('https://www.googleapis.com/youtube/v3/videos');\n var data = {\n id: id,\n key: \"AIzaSyCaLRGY-hxs92045X-Jew7w1FgQPkStHgc\",\n part: \"id,contentDetails,snippet,status\"\n };\n Object.keys(data).forEach(function (key) {\n return jsonp_url.searchParams.append(key, data[key]);\n });\n\n (0, _fetchJsonp2.default)(jsonp_url.toString()).then(function (result) {\n return result.json();\n }).then(function (result) {\n if (!result || !result.items.length) {\n return alert(\"Sorry, this video URL is invalid.\");\n }\n var res = result.items[0];\n // console.log(res)\n\n var dd = res.contentDetails.duration.match(/\\d+/g).map(function (i) {\n return parseInt(i);\n });\n var duration = 0;\n if (dd.length == 3) {\n duration = dd[0] * 60 + dd[1] * 60 + dd[2];\n } else if (dd.length == 2) {\n duration = dd[0] * 60 + dd[1];\n } else {\n duration = dd[0];\n }\n\n [\"maxres\", \"high\", \"medium\", \"standard\", \"default\"].some(function (t) {\n if (res.snippet.thumbnails[t]) {\n thumb = res.snippet.thumbnails[t].url;\n return true;\n }\n return false;\n });\n\n done({\n url: url,\n type: \"youtube\",\n token: id,\n thumbnail: thumb,\n title: res.snippet.title,\n duration: duration,\n width: 640,\n height: 360\n });\n });\n },\n tag: function tag(media) {\n // return '<img class=\"video\" type=\"youtube\" vid=\"'+media.token+'\" src=\"'+media.thumbnail+'\"><span class=\"playvid\">▶</span>';\n return '<div class=\"video\" style=\"width: ' + media.width + 'px; height: ' + media.height + 'px; overflow: hidden; position: relative;\"><iframe frameborder=\"0\" scrolling=\"no\" seamless=\"seamless\" webkitallowfullscreen=\"webkitAllowFullScreen\" mozallowfullscreen=\"mozallowfullscreen\" allowfullscreen=\"allowfullscreen\" id=\"okplayer\" width=\"' + media.width + '\" height=\"' + media.height + '\" src=\"https://youtube.com/embed/' + media.token + '?showinfo=0\" style=\"position: absolute; top: 0px; left: 0px; width: ' + media.width + 'px; height: ' + media.height + 'px;\"></iframe></div>';\n }\n}, {\n type: 'vimeo',\n regex: /vimeo.com\\/\\d+$/i,\n fetch: function fetch(url, done) {\n var id = url.match(/\\d+$/i)[0];\n (0, _nodeFetch2.default)('https://vimeo.com/api/v2/video/' + id + '.json').then(function (result) {\n return result.json();\n }).then(function (result) {\n if (result.length == 0) {\n return done(id, \"\", 640, 360);\n }\n var res = result[0];\n if (res.embed_privacy != \"anywhere\") {\n alert(\"Sorry, the author of this video has marked it private, preventing it from being embedded.\", function () {});\n return;\n }\n done({\n url: url,\n type: \"vimeo\",\n token: id,\n thumbnail: res.thumbnail_large,\n duration: res.duration,\n title: res.title,\n width: res.width,\n height: res.height\n });\n });\n },\n tag: function tag(media) {\n // return '<img class=\"video\" type=\"vimeo\" vid=\"'+media.token+'\" src=\"'+media.thumbnail+'\"><span class=\"playvid\">▶</span>';\n return '<div class=\"video\" style=\"width: ' + media.width + 'px; height: ' + media.height + 'px; overflow: hidden; position: relative;\"><iframe frameborder=\"0\" scrolling=\"no\" seamless=\"seamless\" webkitallowfullscreen=\"webkitAllowFullScreen\" mozallowfullscreen=\"mozallowfullscreen\" allowfullscreen=\"allowfullscreen\" id=\"okplayer\" src=\"https://player.vimeo.com/video/' + media.token + '?api=1&title=0&byline=0&portrait=0&playbar=0&player_id=okplayer&loop=0&autoplay=0\" width=\"' + media.width + '\" height=\"' + media.height + '\" style=\"position: absolute; top: 0px; left: 0px; width: ' + media.width + 'px; height: ' + media.height + 'px;\"></iframe></div>';\n }\n},\n// {\n// type: 'soundcloud',\n// regex: /soundcloud.com\\/[-a-zA-Z0-9]+\\/[-a-zA-Z0-9]+\\/?$/i,\n// fetch: function (url, done) {\n// fetch('https://api.soundcloud.com/resolve.json?url=' \n// + url\n// + '&client_id=' \n// + '0673fbe6fc794a7750f680747e863b10')\n// .then(result => result.json())\n// .then(result => {\n// console.log(result)\n// done({\n// url: url,\n// type: \"soundcloud\",\n// token: result.id,\n// thumbnail: result.artwork_url || result.user.avatar_url,\n// title: result.user.username + \" - \" + result.title,\n// duration: result.duration,\n// width: 166,\n// height: 166,\n// })\n// })\n// },\n// tag: function (media) {\n// return '<iframe width=\"166\" height=\"166\" scrolling=\"no\" frameborder=\"no\"' +\n// 'src=\"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/' + media.token +\n// '&color=ff6600&auto_play=false&show_artwork=true\"></iframe>'\n// }\n// },\n{\n type: 'link',\n regex: /^http.+/i,\n fetch: function fetch(url, done) {\n done({\n url: url,\n type: \"link\",\n token: \"\",\n thumbnail: \"\",\n title: \"\",\n width: 100,\n height: 100\n });\n },\n tag: function tag(media) {\n return '<a href=\"' + media.url + '\" target=\"_blank\">' + media.url + '</a>';\n }\n}];\n\nvar lookup = exports.lookup = integrations.reduce(function (a, b) {\n return (a[b.type] = b) && a;\n}, {});\n\nvar parse = exports.parse = function parse(url, cb) {\n var matched = integrations.some(function (integration) {\n if (integration.regex.test(url)) {\n integration.fetch(url, function (res) {\n cb(res);\n });\n return true;\n }\n return false;\n });\n if (!matched) {\n cb(null);\n }\n};\n\nvar tag = exports.tag = function tag(media) {\n if (media.type in lookup) {\n return lookup[media.type].tag(media);\n }\n return \"\";\n};\n\nvar loadImage = exports.loadImage = function loadImage(url, cb, error) {\n if (lookup.image.regex.test(url)) {\n lookup.image.fetch(url, function (media) {\n cb(media);\n });\n } else error && error();\n};\n\nvar thumbnail = exports.thumbnail = function thumbnail(media) {\n return '<img src=\"' + (media.thumbnail || media.url) + '\" class=\"thumb\">';\n};\n\nvar tumblr = exports.tumblr = function tumblr(url, cb) {\n var domain = url.replace(/^https?:\\/\\//, \"\").split(\"/\")[0];\n if (domain.indexOf(\".\") == -1) {\n domain += \".tumblr.com\";\n }\n (0, _fetchJsonp2.default)(\"http://\" + domain + \"/api/read\").then(function (data) {\n // const blog = data.tumblelog\n var media_list = data.posts.reduce(parseTumblrPost, []);\n cb(media_list);\n });\n};\n\nfunction parseTumblrPost(media_list, post) {\n var media = void 0,\n caption = void 0,\n url = void 0;\n switch (post.type) {\n case 'photo':\n caption = stripHTML(post['photo-caption']);\n if (post.photos.length) {\n post.photos.forEach(function (photo) {\n media = {\n url: photo['photo-url-1280'],\n type: \"image\",\n token: \"\",\n thumbnail: photo['photo-url-500'],\n description: caption,\n width: parseInt(photo.width),\n height: parseInt(photo.height)\n };\n media_list.push(media);\n });\n } else {\n media = {\n url: post['photo-url-1280'],\n type: \"image\",\n token: \"\",\n thumbnail: post['photo-url-500'],\n description: caption,\n width: parseInt(post.width),\n height: parseInt(post.height)\n };\n media_list.push(media);\n }\n break;\n case 'video':\n url = post['video-source'];\n if (url.indexOf(\"http\") !== 0) {\n break;\n }\n if (lookup.youtube.regex.test(url)) {\n var id = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0];\n var thumb = \"https://i.ytimg.com/vi/\" + id + \"/hqdefault.jpg\";\n media = {\n url: post['video-source'],\n type: \"youtube\",\n token: id,\n thumbnail: thumb,\n title: stripHTML(post['video-caption']),\n width: 640,\n height: 360\n };\n media_list.push(media);\n }\n break;\n default:\n break;\n }\n return media_list;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.spectrum = spectrum;\nexports.raw_spectrum = raw_spectrum;\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar scratch = document.createElement('canvas');\nvar scratchCtx = scratch.getContext('2d-lodpi');\n\nvar w = 256;\nvar h = 256;\n\nfunction spectrum(spec, x0, y0, ww, hh) {\n var data = spec.data;\n var fft_size = spec.fft_size;\n var half_fft_size = spec.fft_size / 2;\n var spec_len = data.length;\n\n scratch.width = data.length;\n scratch.height = half_fft_size;\n\n var imageData = ctx.createImageData(scratch.width, scratch.height);\n var pixels = imageData.data;\n\n var i = void 0,\n j = void 0,\n u = void 0,\n v = void 0,\n _r = void 0,\n _i = void 0,\n col = void 0,\n hsl = void 0;\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n\n for (j = 0; j < half_fft_size; j++) {\n u = ((half_fft_size - j) * spec_len + i) * 4;\n v = j * 2;\n _r = col[v];\n _i = mod(col[v + 1], Math.PI * 2) / (Math.PI * 2);\n hsl = color.hsl2rgb((_i + 1) / 2, 1.0, 1 - Math.abs(_r / 10));\n // red - real part\n // pixels[u] = _r * 127 + 127\n // // green - imag part\n // pixels[u+1] = _i * 127 + 127\n // // blue - magnitude\n // pixels[u+2] = Math.sqrt(Math.pow(_r, 2) + Math.pow(_i, 2)) * 128 + 127\n // pixels[u+3] = 255\n pixels[u] = hsl[0];\n pixels[u + 1] = hsl[1];\n pixels[u + 2] = hsl[2];\n pixels[u + 3] = 255;\n }\n }\n\n scratchCtx.putImageData(imageData, 0, 0);\n\n var pcm_length = spec.fft_overlap * spec_len;\n\n x0 = x0 * devicePixelRatio || 0;\n y0 = y0 * devicePixelRatio || Math.floor(h / 4);\n ww = ww * devicePixelRatio || w;\n hh = hh * devicePixelRatio || h / 4;\n\n var width = Math.round(pcm_length / spec.sr * pixels_per_second);\n var height = Math.floor(hh);\n\n ctx.save();\n clear(1, x0, y0, w, height);\n ctx.drawImage(scratch, x0, y0, width, height);\n ctx.restore();\n}\n\nfunction raw_spectrum(spec, x0, y0, ww, hh, def_min_r, def_min_i) {\n var data = spec.data;\n var fft_size = spec.fft_size;\n var half_fft_size = spec.fft_size / 2;\n var spec_len = data.length;\n\n var _scratch = document.createElement('canvas');\n var _scratchCtx = _scratch.getContext('2d-lodpi');\n _scratch.width = data.length;\n _scratch.height = half_fft_size;\n // console.log(\"spectrum w/h:\", _scratch.width, _scratch.height)\n\n var imageData = _scratchCtx.createImageData(_scratch.width, _scratch.height);\n var pixels = imageData.data;\n\n var i = void 0,\n j = void 0,\n u = void 0,\n v = void 0,\n _r = void 0,\n _i = void 0,\n col = void 0,\n hsl = void 0;\n // let min_r = Infinity, max_r = -Infinity\n // let min_i = Infinity, max_i = -Infinity\n\n // determined empirically..\n // let min_r = -60.4894057005308\n // let max_r = 107.23800966675353\n // let min_i = -59.4894057005308\n // let max_i = 108.23800966675353\n var min_r = -def_min_r;\n var max_r = def_min_r;\n var min_i = -def_min_i;\n var max_i = def_min_i;\n var delta_r = max_r - min_r;\n var delta_i = max_i - min_i;\n var mean_r = 0;\n var mean_i = 0;\n var sum_mean_r = 0,\n sum_mean_i = 0;\n var real = void 0,\n imag = void 0;\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n mean_r = 0;\n mean_i = 0;\n\n for (j = 0; j < half_fft_size; j++) {\n u = (j * spec_len + i) * 4;\n v = j * 2;\n real = col[v];\n imag = col[v + 1];\n mean_r += real;\n mean_i += imag;\n _r = _util2.default.clamp((real - min_r) / delta_r * 255, 0, 255);\n _i = _util2.default.clamp((imag - min_i) / delta_i * 255, 0, 255);\n\n // hsl = color.hsl2rgb((_i + 1) / 2, 1.0, 1 - Math.abs(_r / 10))\n pixels[u + 0] = _r;\n pixels[u + 1] = _i;\n pixels[u + 2] = 127; // hsl[2]\n pixels[u + 3] = 255;\n\n // min_r = Math.min(min_r, col[v])\n // max_r = Math.max(max_r, col[v])\n // min_i = Math.min(min_i, col[v]+1)\n // max_i = Math.max(max_i, col[v]+1)\n }\n mean_r /= half_fft_size;\n mean_i /= half_fft_size;\n sum_mean_r += mean_r;\n sum_mean_i += mean_i;\n }\n\n sum_mean_r /= spec_len;\n sum_mean_i /= spec_len;\n // console.log(sum_mean_r, sum_mean_i)\n // console.log(\"r:\", min_r, max_r)\n // console.log(\"i:\", min_i, max_i)\n _scratchCtx.putImageData(imageData, 0, 0);\n\n return { canvas: _scratch, imageData: imageData };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.requestAudioContext = requestAudioContext;\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _startAudioContext = require('./startAudioContext');\n\nvar _startAudioContext2 = _interopRequireDefault(_startAudioContext);\n\nvar _util = require('../../util');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction requestAudioContext(fn) {\n if (_util.is_mobile) {\n var container = document.createElement('div');\n var button = document.createElement('div');\n button.innerHTML = 'Tap to start - please unmute your phone';\n Object.assign(container.style, {\n display: 'block',\n position: 'absolute',\n width: '100%',\n height: '100%',\n zIndex: '10000',\n top: '0px',\n left: '0px',\n backgroundColor: 'rgba(0, 0, 0, 0.8)'\n });\n Object.assign(button.style, {\n display: 'block',\n position: 'absolute',\n left: '50%',\n top: '50%',\n padding: '20px',\n backgroundColor: '#7F33ED',\n color: 'white',\n fontFamily: 'monospace',\n borderRadius: '3px',\n transform: 'translate3D(-50%,-50%,0)',\n textAlign: 'center',\n lineHeight: '1.5',\n width: '150px'\n });\n container.appendChild(button);\n document.body.appendChild(container);\n _startAudioContext2.default.setContext(_tone2.default.context);\n _startAudioContext2.default.on(button);\n _startAudioContext2.default.onStarted(function (_) {\n container.remove();\n fn();\n });\n } else {\n fn();\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// const compressor = new Tone.Compressor(-30, 3).toMaster()\n\nvar compressor = new _tone2.default.Compressor(-30, 3).toMaster();\nvar gain = new _tone2.default.Gain(1).connect(compressor);\n\nexports.default = gain;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _util = require('../../util');\n\nvar _signalWindows = require('signal-windows');\n\nvar _fft = require('fft.js');\n\nvar _fft2 = _interopRequireDefault(_fft);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fft_size = 512;\nvar fft_overlap = fft_size / 4;\n\nvar fft = new _fft2.default(fft_size);\n\nfunction toSpectrum(pcm, sr) {\n sr = sr || 44100;\n var ham = _signalWindows.windows.construct('ham', fft_size);\n var pcm_in = new Array(fft_size);\n var pcm_length = pcm.length;\n var pcm_q_length = Math.ceil(pcm_length / fft_size) * fft_size;\n var i = void 0,\n j = void 0,\n fft_out = void 0,\n data = [];\n for (i = -fft_size; i < pcm_q_length; i += fft_overlap) {\n for (j = 0; j < fft_size; j++) {\n pcm_in[j] = pcm[i + j] * ham[j] || 0;\n }\n fft_out = fft.createComplexArray();\n fft.realTransform(fft_out, pcm_in);\n fft.completeSpectrum(fft_out);\n data.push(fft_out);\n }\n return {\n data: data,\n sr: sr,\n fft_size: fft_size,\n fft_overlap: fft_overlap\n };\n}\n\nfunction fromSpectrum(spec) {\n var data = spec.data;\n var sr = spec.sr;\n var fft_size = spec.fft_size;\n var fft_overlap = spec.fft_overlap;\n var spec_len = data.length;\n\n var ham = _signalWindows.windows.construct('ham', fft_size);\n var out = fft.createComplexArray();\n var pcm_length = fft_overlap * spec_len;\n\n var audioBuffer = _tone2.default.context.createBuffer(1, pcm_length, sr);\n var pcm = audioBuffer.getChannelData(0);\n\n var i = void 0,\n j = void 0,\n u = void 0,\n col = void 0;\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n // for (j = fft_size; j < fft_size << 1; j++) {\n // col[j] = 0\n // }\n // if (i == 0) console.log(col)\n fft.inverseTransform(out, col);\n u = i * fft_overlap;\n for (j = 0; j < fft_size; j++) {\n pcm[u + j] += out[j * 2] * ham[j] || 0;\n }\n }\n\n fadeInOut(pcm, fft_size);\n // console.log(pcm)\n return audioBuffer;\n}\n\nfunction fromImageData(imageData, sr, _r, _i) {\n var pixels = imageData.data;\n var w = imageData.width;\n var h = imageData.height;\n var data = new Array(w);\n var x = void 0,\n y = void 0,\n u = void 0,\n v = void 0,\n v2 = void 0;\n for (y = 0; y < h; y++) {\n var col = data[y] = new Float32Array(h * 4);\n for (x = 0; x < w; x++) {\n u = (x * w + y) * 4;\n v = x * 2;\n col[v] = (pixels[u] / 255 - 0.5) * _r;\n col[v + 1] = (pixels[u + 1] / 255 - 0.5) * _i;\n v2 = (h - y + h) * 2;\n col[v2] = col[v];\n col[v2 + 1] = 0; // col[v+1]\n }\n col[h * 2] = col[h * 2 + 1] = col[h * 2 - 1] = col[h * 2 - 2] = 0;\n }\n var spec = {\n data: data,\n sr: sr,\n fft_size: fft_size, fft_overlap: fft_overlap\n };\n return spec;\n}\n\nfunction binToHz(spec, i) {\n return i / spec.fft_size * spec.sr;\n}\n\nfunction fadeInOut(pcm, fade_size) {\n var pcm_length = pcm.length;\n var fade = 0,\n i = void 0;\n for (i = 0; i < fade_size; i++) {\n fade = i / fade_size;\n fade *= fade;\n pcm[i] *= fade;\n pcm[pcm_length - i] *= fade;\n }\n}\nfunction rotatePhase(spec, theta) {\n var data = spec.data,\n fft_size = spec.fft_size;\n\n var i = void 0,\n j = void 0,\n col = void 0,\n len = data.length;\n for (i = 0; i < len; i++) {\n col = data[i];\n for (j = 0; j < fft_size; j++) {\n col[j * 2 + 1] += theta;\n }\n }\n return spec;\n}\n\nfunction linearBins(spec, n) {\n n = n || 1;\n\n var bins = [],\n i = void 0,\n q_i = void 0;\n for (q_i = 0; q_i < n; q_i++) {\n bins[q_i] = [];\n }\n var step = Math.floor(spec.fft_size / n);\n var len_quantize_n = (0, _util.quantize)(spec.fft_size, n);\n for (i = 0; i < len_quantize_n; i++) {\n q_i = Math.floor(i / step);\n bins[q_i] = bins[q_i] || [];\n bins[q_i].push(i);\n }\n // leftover bins get put at end\n for (; i < spec.fft_size; i++) {\n bins[q_i].push(i);\n }\n return bins;\n}\nfunction logarithmicBins(spec) {\n var bins = [],\n i = void 0,\n j = void 0,\n q_i = void 0;\n var binCount = Math.log2(spec.fft_size) - 1;\n for (i = 0, q_i = 0, j = 0; i < binCount; i++) {\n j += 1 << i;\n bins[i] = [];\n for (; q_i < j; q_i++) {\n bins[i].push(q_i);\n }\n }\n return bins;\n}\nfunction concatBins(bins) {\n return bins.reduce(function (acc, cv) {\n return acc.concat(cv);\n }, []);\n}\nfunction reverseBins(bins) {\n return bins.map(function (bin) {\n return bin.reverse();\n });\n}\nfunction minBins(bins) {\n return bins.map(function (bin) {\n var b = bin[0];\n return bin.map(function () {\n return b;\n });\n });\n}\nfunction maxBins(bins) {\n return bins.map(function (bin) {\n var b = bin[bin.length - 1];\n return bin.map(function () {\n return b;\n });\n });\n}\nfunction rotateSpectrum(spec, n) {\n var fft_size = spec.fft_size;\n\n if (n && n < 1) {\n n -= 0.5;\n n *= fft_size;\n }\n n = Math.floor(n);\n var order = new Array(fft_size),\n i = void 0;\n for (i = 0; i < fft_size; i++) {\n order[i] = (0, _util.mod)(i + n, fft_size / 2);\n }\n return reorderBins(spec, order);\n}\nfunction cloneSpectrum(spec) {\n var data = spec.data,\n fft_size = spec.fft_size,\n sr = spec.sr,\n fft_overlap = spec.fft_overlap;\n\n var spec_len = data.length;\n\n var new_data = new Array(spec_len);\n var i = void 0;\n for (i = 0; i < spec_len; i++) {\n new_data[i] = data[i].concat();\n new_data[i][2] = 0;\n }\n\n return {\n data: new_data,\n fft_size: fft_size,\n sr: sr, fft_overlap: fft_overlap\n };\n}\nfunction reverseSpectrum(spec) {\n var new_spec = cloneSpectrum(spec);\n new_spec.data = new_spec.data.reverse();\n return new_spec;\n}\nfunction shuffleSpectrum(spec) {\n var fft_size = spec.fft_size;\n\n var order = new Array(fft_size),\n i = void 0;\n for (i = 0; i < fft_size; i++) {\n order[i] = i;\n }\n (0, _util.shuffle)(order);\n return reorderBins(spec, order);\n}\nfunction invertSpectrum(spec) {\n var fft_size = spec.fft_size;\n\n var order = new Array(fft_size),\n i = void 0;\n for (i = 0; i < fft_size; i++) {\n order[i] = fft_size - i - 1;\n }\n return reorderBins(spec, order);\n}\nfunction reorderBins(spec, order) {\n var new_spec = cloneSpectrum(spec);\n var data = spec.data,\n sr = spec.sr,\n fft_size = spec.fft_size,\n fft_overlap = spec.fft_overlap;\n\n var spec_len = data.length;\n var new_data = new_spec.data;\n\n\n var i = void 0,\n j = void 0,\n col = void 0,\n new_col = void 0;\n for (j = order.length; j < fft_size; j++) {\n order[j] = j;\n }\n\n for (i = 0; i < spec_len; i++) {\n col = data[i];\n new_col = new_data[i] = data[i].concat();\n col[0] = 0;\n col[2] = 0;\n col[4] = 0;\n for (j = 0; j < fft_size / 2; j++) {\n new_col[j * 2] = col[order[j] * 2];\n new_col[j * 2 + 1] = col[order[j] * 2 + 1];\n }\n for (; j < fft_size; j++) {\n new_col[j * 2] = 0;\n new_col[j * 2 + 1] = 0;\n }\n }\n\n return {\n data: new_data,\n sr: sr, fft_size: fft_size, fft_overlap: fft_overlap\n };\n}\n\nexports.default = {\n fft_size: fft_size, fft_overlap: fft_overlap,\n toSpectrum: toSpectrum, fromSpectrum: fromSpectrum, fromImageData: fromImageData, binToHz: binToHz,\n fadeInOut: fadeInOut,\n cloneSpectrum: cloneSpectrum,\n reverseSpectrum: reverseSpectrum, shuffleSpectrum: shuffleSpectrum, invertSpectrum: invertSpectrum, rotateSpectrum: rotateSpectrum,\n reorderBins: reorderBins,\n linearBins: linearBins, logarithmicBins: logarithmicBins,\n concatBins: concatBins,\n reverseBins: reverseBins, minBins: minBins, maxBins: maxBins,\n rotatePhase: rotatePhase\n};","\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * StartAudioContext.js\n * @author Yotam Mann\n * @license http://opensource.org/licenses/MIT MIT License\n * @copyright 2016 Yotam Mann\n */\n(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = factory();\n } else {\n root.StartAudioContext = factory();\n }\n})(undefined, function () {\n\n /**\n * The StartAudioContext object\n */\n var StartAudioContext = {\n /**\n * The audio context passed in by the user\n * @type {AudioContext}\n */\n context: null,\n /**\n * The TapListeners bound to the elements\n * @type {Array}\n * @private\n */\n _tapListeners: [],\n /**\n * Callbacks to invoke when the audio context is started\n * @type {Array}\n * @private\n */\n _onStarted: []\n };\n\n /**\n * Set the context\n * @param {AudioContext} ctx\n * @returns {StartAudioContext}\n */\n StartAudioContext.setContext = function (ctx) {\n StartAudioContext.context = ctx;\n return StartAudioContext;\n };\n\n /**\n * Add a tap listener to the audio context\n * @param {Array|Element|String|jQuery} element\n * @returns {StartAudioContext}\n */\n StartAudioContext.on = function (element) {\n if (Array.isArray(element) || NodeList && element instanceof NodeList) {\n for (var i = 0; i < element.length; i++) {\n StartAudioContext.on(element[i]);\n }\n } else if (typeof element === \"string\") {\n StartAudioContext.on(document.querySelectorAll(element));\n } else if (element.jquery && typeof element.toArray === \"function\") {\n StartAudioContext.on(element.toArray());\n } else if (Element && element instanceof Element) {\n //if it's an element, create a TapListener\n var tap = new TapListener(element, onTap);\n StartAudioContext._tapListeners.push(tap);\n }\n return StartAudioContext;\n };\n\n /**\n * Bind a callback to when the audio context is started. \n * @param {Function} cb\n * @return {StartAudioContext}\n */\n StartAudioContext.onStarted = function (cb) {\n //if it's already started, invoke the callback\n if (StartAudioContext.isStarted()) {\n cb();\n } else {\n StartAudioContext._onStarted.push(cb);\n }\n return StartAudioContext;\n };\n\n /**\n * returns true if the context is started\n * @return {Boolean}\n */\n StartAudioContext.isStarted = function () {\n return StartAudioContext.context !== null && StartAudioContext.context.state === \"running\";\n };\n\n /**\n * @class Listens for non-dragging tap ends on the given element\n * @param {Element} element\n * @internal\n */\n var TapListener = function TapListener(element) {\n\n this._dragged = false;\n\n this._element = element;\n\n this._bindedMove = this._moved.bind(this);\n this._bindedEnd = this._ended.bind(this);\n\n element.addEventListener(\"touchmove\", this._bindedMove);\n element.addEventListener(\"touchend\", this._bindedEnd);\n element.addEventListener(\"mouseup\", this._bindedEnd);\n };\n\n /**\n * drag move event\n */\n TapListener.prototype._moved = function (e) {\n this._dragged = true;\n };\n\n /**\n * tap ended listener\n */\n TapListener.prototype._ended = function (e) {\n if (!this._dragged) {\n onTap();\n }\n this._dragged = false;\n };\n\n /**\n * remove all the bound events\n */\n TapListener.prototype.dispose = function () {\n this._element.removeEventListener(\"touchmove\", this._bindedMove);\n this._element.removeEventListener(\"touchend\", this._bindedEnd);\n this._element.removeEventListener(\"mouseup\", this._bindedEnd);\n this._bindedMove = null;\n this._bindedEnd = null;\n this._element = null;\n };\n\n /**\n * Invoked the first time of the elements is tapped.\n * Creates a silent oscillator when a non-dragging touchend \n * event has been triggered.\n */\n function onTap() {\n //start the audio context with a silent oscillator\n if (StartAudioContext.context && !StartAudioContext.isStarted()) {\n var osc = StartAudioContext.context.createOscillator();\n var silent = StartAudioContext.context.createGain();\n silent.gain.value = 0;\n osc.connect(silent);\n silent.connect(StartAudioContext.context.destination);\n var now = StartAudioContext.context.currentTime;\n osc.start(now);\n osc.stop(now + 0.5);\n }\n\n //dispose all the tap listeners\n if (StartAudioContext._tapListeners) {\n for (var i = 0; i < StartAudioContext._tapListeners.length; i++) {\n StartAudioContext._tapListeners[i].dispose();\n }\n StartAudioContext._tapListeners = null;\n }\n //the onstarted callbacks\n if (StartAudioContext._onStarted) {\n for (var j = 0; j < StartAudioContext._onStarted.length; j++) {\n StartAudioContext._onStarted[j]();\n }\n StartAudioContext._onStarted = null;\n }\n }\n\n return StartAudioContext;\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.play = play;\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _draw = require('./lib/draw');\n\nvar draw = _interopRequireWildcard(_draw);\n\nvar _output = require('./lib/output');\n\nvar _output2 = _interopRequireDefault(_output);\n\nvar _spectrum = require('./lib/spectrum');\n\nvar _spectrum2 = _interopRequireDefault(_spectrum);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _r = 8;\nvar _i = 8;\n\nfunction play(frame) {\n // const { canvas, imageData } = draw.raw_spectrum(fft, 0, 256, 0, 256, 1, 1)\n // console.log(_r, _i)\n // const { canvas, imageData } = draw.raw_spectrum(player.fft, 0, 256, 0, 256, _r, _i)\n var new_fft = _spectrum2.default.fromImageData(frame.imageData, 44100, _r, _i);\n // gallery.innerHTML = ''\n\n // console.log(player.fft.data, new_fft.data)\n var buf = _spectrum2.default.fromSpectrum(new_fft);\n var _p = new _tone2.default.Player(buf);\n _p.connect(_output2.default);\n _p.start(_tone2.default.now());\n // redraw(new_fft)\n}\n// function redraw(new_fft){\n// const { canvas, imageData } = draw.raw_spectrum(new_fft, 0, 256, 0, 256, _r, _i)\n// }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.buildZip = exports.renderFrames = exports.loadPCM = exports.loadBuffer = exports.spectrum = exports.FRAME_STEP = exports.FRAME_LENGTH = undefined;\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _tone = require('tone');\n\nvar _tone2 = _interopRequireDefault(_tone);\n\nvar _jszip = require('jszip');\n\nvar _jszip2 = _interopRequireDefault(_jszip);\n\nvar _sprintfJs = require('sprintf-js');\n\nvar _draw = require('./lib/draw');\n\nvar draw = _interopRequireWildcard(_draw);\n\nvar _output = require('./lib/output');\n\nvar _output2 = _interopRequireDefault(_output);\n\nvar _spectrum = require('./lib/spectrum');\n\nvar _spectrum2 = _interopRequireDefault(_spectrum);\n\nvar _lib = require('./lib');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar FRAME_LENGTH = exports.FRAME_LENGTH = 126 * 255;\nvar FRAME_STEP = exports.FRAME_STEP = Math.round(FRAME_LENGTH / 4);\n\nvar _r = 8;\nvar _i = 8;\n\nexports.spectrum = _spectrum2.default;\n// requestAudioContext(() => {})\n\nvar loadBuffer = exports.loadBuffer = function loadBuffer(file) {\n return new Promise(function (resolve, reject) {\n var url = URL.createObjectURL(file);\n var buffer = new _tone2.default.Buffer(url, loadBuffer, function (err) {\n console.error('err', err);\n reject(err);\n });\n function loadBuffer() {\n URL.revokeObjectURL(url);\n resolve(buffer);\n }\n });\n};\n\nvar loadPCM = exports.loadPCM = function loadPCM(file) {\n return new Promise(function (resolve, reject) {\n // if we've already fetched this file...\n if (file.pcm) {\n return resolve(file);\n }\n loadBuffer(file).then(function (buffer) {\n var pcm = buffer._buffer.getChannelData(0);\n var sr = buffer._buffer.sampleRate;\n if (!pcm) return reject();\n console.log(pcm.length, sr);\n resolve({ file: file, buffer: buffer, pcm: pcm, sr: sr });\n });\n });\n};\n\nvar renderFrames = exports.renderFrames = function renderFrames(file, _ref) {\n var _ref$frame_step = _ref.frame_step,\n frame_step = _ref$frame_step === undefined ? FRAME_STEP : _ref$frame_step,\n _ref$frame_start = _ref.frame_start,\n frame_start = _ref$frame_start === undefined ? 0 : _ref$frame_start,\n _ref$max = _ref.max,\n max = _ref$max === undefined ? 12 : _ref$max;\n return function (dispatch) {\n return new Promise(function (resolve, reject) {\n loadPCM(file).then(function (pcmProps) {\n var file = pcmProps.file,\n buffer = pcmProps.buffer,\n pcm = pcmProps.pcm,\n sr = pcmProps.sr;\n\n dispatch({ type: _types2.default.wav2pix.load });\n var frames = [];\n var count = 0;\n var _len = pcm.length - FRAME_LENGTH;\n var offset = Math.round(_len * frame_start);\n for (; offset < _len && count < max; offset += frame_step, count += 1) {\n frames.push(render(pcm.slice(offset, offset + FRAME_LENGTH), sr, count));\n }\n dispatch({ type: _types2.default.wav2pix.finish, message: 'Rendered ' + count + ' images' });\n resolve({ pcm: pcmProps, frames: frames });\n });\n });\n };\n};\n\nvar buildZip = exports.buildZip = function buildZip(name, file, _ref2) {\n var _ref2$frame_step = _ref2.frame_step,\n frame_step = _ref2$frame_step === undefined ? FRAME_STEP : _ref2$frame_step,\n _ref2$frame_start = _ref2.frame_start,\n frame_start = _ref2$frame_start === undefined ? 0 : _ref2$frame_start,\n _ref2$max = _ref2.max,\n max = _ref2$max === undefined ? 10000 : _ref2$max;\n return function (dispatch) {\n return new Promise(function (resolve, reject) {\n loadPCM(file).then(function (_ref3) {\n var buffer = _ref3.buffer,\n pcm = _ref3.pcm,\n sr = _ref3.sr;\n\n dispatch({ type: _types2.default.wav2pix.load });\n\n var zip = new _jszip2.default();\n var zip_folder = zip.folder(\"wav2pix_\" + name);\n\n var steps = (pcm.length - FRAME_LENGTH) / frame_step;\n console.log(steps);\n\n var count = 0;\n var _len = pcm.length - FRAME_LENGTH;\n var offset = Math.round(_len * frame_start);\n for (; offset < _len && count < max; offset += frame_step, count += 1) {\n if (count % 10 === 0) {\n dispatch({ type: _types2.default.wav2pix.progress, progress: { i: count / max * 6, n: 6 } });\n }\n render(pcm.slice(offset, offset + FRAME_LENGTH), sr, count, zip_folder);\n }\n\n // dispatch event\n dispatch({ type: _types2.default.wav2pix.finish, message: 'Rendered ' + count + ' images' });\n zip.generateAsync({ type: \"blob\" }).then(function (content) {\n dispatch({ type: _types2.default.wav2pix.zip, size: content.size });\n // FileSaver.saveAs(content, \"wav2pix_\" + name + \".zip\")\n resolve({\n zip: content,\n filename: \"wav2pix_\" + name + \".zip\",\n count: count\n });\n });\n });\n });\n };\n};\n\nfunction render(pcm, sr, count, zip) {\n var fft = _spectrum2.default.toSpectrum(pcm, sr);\n // console.log('render', fft)\n // const pcm_rev = pcm.slice().reverse()\n // const spec_rev = spectrum.toSpectrum(pcm_rev, spec.sr)\n\n var _draw$raw_spectrum = draw.raw_spectrum(fft, 0, 256, 0, 256, _r, _i),\n canvas = _draw$raw_spectrum.canvas,\n imageData = _draw$raw_spectrum.imageData;\n\n if (zip) {\n var name = (0, _sprintfJs.sprintf)('frame_%05d.png', count);\n var dataURL = canvas.toDataURL(\"image/png\");\n zip.file(name, dataURL.split(',')[1], { base64: true });\n }\n return { fft: fft, canvas: canvas, imageData: imageData };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.enqueue = exports.resume = exports.pause = exports.play = undefined;\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar play = exports.play = function play(file) {\n return { type: _types2.default.audioPlayer.play, file: file };\n};\nvar pause = exports.pause = function pause() {\n return { type: _types2.default.audioPlayer.pause };\n};\nvar resume = exports.resume = function resume() {\n return { type: _types2.default.audioPlayer.resume };\n};\nvar enqueue = exports.enqueue = function enqueue(file) {\n return { type: _types2.default.audioPlayer.enqueue, file: file };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _audioPlayer = require('./audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar AudioPlayer = function (_Component) {\n _inherits(AudioPlayer, _Component);\n\n function AudioPlayer(props) {\n _classCallCheck(this, AudioPlayer);\n\n var _this = _possibleConstructorReturn(this, (AudioPlayer.__proto__ || Object.getPrototypeOf(AudioPlayer)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(AudioPlayer, [{\n key: 'handleClick',\n value: function handleClick(e) {\n var _props = this.props,\n audioPlayer = _props.audioPlayer,\n actions = _props.actions;\n\n if (audioPlayer.playing) {\n actions.pause();\n } else {\n actions.resume();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var audioPlayer = this.props.audioPlayer;\n\n return (0, _preact.h)(\n 'div',\n { className: 'audioPlayer' },\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'button',\n {\n onClick: this.handleClick\n },\n audioPlayer.playing ? '▶' : '~'\n )\n );\n }\n }]);\n\n return AudioPlayer;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n audioPlayer: state.audioPlayer\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AudioPlayer);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar audioPlayerInitialState = {\n loading: false,\n error: null,\n status: '',\n current: null,\n index: -1,\n playlist: []\n};\n\nvar audio = document.createElement('audio');\n\nvar audioPlayerReducer = function audioPlayerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : audioPlayerInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.audioPlayer.play:\n if (!action.file.url) {\n return state;\n }\n audio.src = action.file.url;\n audio.play();\n return _extends({}, state, {\n playing: true,\n current: action.file\n });\n case _types2.default.audioPlayer.pause:\n audio.pause();\n return _extends({}, state, {\n playing: false\n });\n case _types2.default.audioPlayer.resume:\n audio.play();\n return _extends({}, state, {\n playing: true\n });\n default:\n return state;\n }\n};\n\nexports.default = audioPlayerReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _group = require('./group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('./param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _button = require('./button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _buttonGrid = require('./buttonGrid.component');\n\nvar _buttonGrid2 = _interopRequireDefault(_buttonGrid);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar AugmentationGrid = function (_Component) {\n _inherits(AugmentationGrid, _Component);\n\n function AugmentationGrid() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, AugmentationGrid);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AugmentationGrid.__proto__ || Object.getPrototypeOf(AugmentationGrid)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n x: 0, y: 0, sum: 0\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(AugmentationGrid, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n make = _props.make,\n take = _props.take,\n checkpoint = _props.checkpoint,\n onTrain = _props.onTrain,\n onAugment = _props.onAugment;\n var _state = this.state,\n x = _state.x,\n y = _state.y,\n sum = _state.sum;\n\n var rows = [];\n return (0, _preact.h)(\n _group2.default,\n { className: 'augmentationGrid' },\n (0, _preact.h)(_buttonGrid2.default, {\n x: make,\n y: take,\n max: 5000,\n onHover: function onHover(x, y) {\n return _this2.setState({ x: x, y: y });\n },\n onClick: function onClick(x, y) {\n _this2.setState({ sum: sum + x * y });\n onAugment(y, x);\n }\n }),\n (0, _preact.h)(\n _param2.default,\n { title: 'Name' },\n checkpoint.name\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Take' },\n y\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Make' },\n x\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Will add to dataset' },\n x * y\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Total added this epoch' },\n sum\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Sequence length' },\n checkpoint.sequenceCount\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Dataset size' },\n checkpoint.datasetCount\n ),\n (0, _preact.h)(\n _button2.default,\n { onClick: function onClick() {\n _this2.setState({ sum: 0 });\n onTrain();\n } },\n 'Train'\n )\n );\n }\n }]);\n\n return AugmentationGrid;\n}(_preact.Component);\n\nexports.default = AugmentationGrid;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Button = function (_Component) {\n _inherits(Button, _Component);\n\n function Button(props) {\n _classCallCheck(this, Button);\n\n var _this = _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Button, [{\n key: 'handleClick',\n value: function handleClick(e) {\n this.props.onClick && this.props.onClick();\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'button param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'button',\n {\n onClick: this.handleClick\n },\n this.props.value || this.props.children\n )\n )\n );\n }\n }]);\n\n return Button;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Button);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar ButtonGrid = function (_Component) {\n _inherits(ButtonGrid, _Component);\n\n function ButtonGrid() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, ButtonGrid);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ButtonGrid.__proto__ || Object.getPrototypeOf(ButtonGrid)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n x: 0, y: 0\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(ButtonGrid, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _state = this.state,\n _x = _state.x,\n _y = _state.y;\n var _props = this.props,\n X = _props.x,\n Y = _props.y,\n _props$max = _props.max,\n max = _props$max === undefined ? Infinity : _props$max,\n _onClick = _props.onClick,\n onHover = _props.onHover;\n\n return (0, _preact.h)(\n 'table',\n { className: 'buttonGrid' },\n (0, _preact.h)(\n 'tr',\n { className: 'row' },\n (0, _preact.h)(\n 'th',\n null,\n \" \"\n ),\n X.map(function (x) {\n return (0, _preact.h)(\n 'th',\n { className: x === _x && 'bold' },\n x\n );\n })\n ),\n Y.map(function (y) {\n return (0, _preact.h)(\n 'tr',\n { className: 'row' },\n (0, _preact.h)(\n 'th',\n { className: y === _y && 'bold' },\n y\n ),\n X.map(function (x) {\n return (0, _preact.h)(\n 'td',\n null,\n x * y > max ? \" \" : (0, _preact.h)(\n 'button',\n {\n onClick: function onClick() {\n return _onClick(x, y);\n },\n onMouseEnter: function onMouseEnter() {\n _this2.setState({ x: x, y: y });\n onHover(x, y);\n }\n },\n \" \"\n )\n );\n })\n );\n })\n );\n }\n }]);\n\n return ButtonGrid;\n}(_preact.Component);\n\nexports.default = ButtonGrid;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Checkbox = function (_Component) {\n _inherits(Checkbox, _Component);\n\n function Checkbox(props) {\n _classCallCheck(this, Checkbox);\n\n var _this = _possibleConstructorReturn(this, (Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Checkbox, [{\n key: 'handleClick',\n value: function handleClick(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.checked;\n this.props.onToggle && this.props.onToggle(new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var checked = this.props.value;\n var dim = !this.props.noDim;\n return (0, _preact.h)(\n 'div',\n { className: 'checkbox param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: 'checkbox',\n onClick: this.handleClick,\n checked: checked\n })\n )\n );\n }\n }]);\n\n return Checkbox;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n // actions: bindActionCreators(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Checkbox);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// import { Loading, CurrentTask, FileList, FileRow } from '../../../common'\n\nfunction CurrentTask(_ref) {\n var cpu = _ref.cpu,\n gpu = _ref.gpu,\n processor = _ref.processor;\n\n var processor_name = void 0;\n if (processor) {\n processor_name = processor === 'cpu' ? 'cpu' : 'gpu';\n } else if (gpu.status !== 'IDLE') {\n processor_name = 'gpu';\n } else if (cpu.status !== 'IDLE') {\n processor_name = 'cpu';\n }\n var p = processor_name === 'cpu' ? cpu : gpu;\n if (!p) return (0, _preact.h)('div', null);\n if (p.status === 'IDLE') {\n return (0, _preact.h)(\n 'div',\n null,\n processor_name,\n ' idle'\n );\n }\n var last_message = p.last_message,\n pid = p.pid,\n task = p.task;\n var activity = task.activity,\n epoch = task.epoch,\n epochs = task.epochs,\n dataset = task.dataset,\n module = task.module;\n\n return (0, _preact.h)(\n 'div',\n { className: 'currentTask' },\n '#',\n pid,\n ': ',\n (0, _preact.h)(\n 'b',\n null,\n module,\n ' ',\n activity\n ),\n ' ',\n (0, _preact.h)(\n 'i',\n null,\n dataset\n ),\n !!epochs ? (0, _preact.h)(\n 'span',\n null,\n epochs,\n ' epoch',\n _util2.default.courtesy_s(epochs)\n ) : \"\",\n epoch ? (0, _preact.h)(\n 'span',\n null,\n '(currently #',\n epoch,\n ')'\n ) : \"\",\n (0, _preact.h)('br', null),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'div',\n { 'class': 'quiet' },\n last_message\n )\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return state.system.runner;\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n // actions: bindActionCreators(samplernnActions, dispatch),\n // remote: bindActionCreators(samplernnTasks, dispatch),\n // audioPlayer: bindActionCreators(audioPlayerActions, dispatch),\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(CurrentTask);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FileRow = exports.FileList = undefined;\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fieldSet = _util2.default.fieldSet(new Set(['name', 'date', 'size']));\n\nvar FileList = exports.FileList = function FileList(props) {\n var files = props.files,\n fields = props.fields,\n sort = props.sort,\n title = props.title,\n linkFiles = props.linkFiles,\n onClick = props.onClick,\n onDelete = props.onDelete,\n _props$orderBy = props.orderBy,\n orderBy = _props$orderBy === undefined ? 'name asc' : _props$orderBy,\n _props$className = props.className,\n className = _props$className === undefined ? '' : _props$className,\n _props$fileListClassN = props.fileListClassName,\n fileListClassName = _props$fileListClassN === undefined ? 'filelist' : _props$fileListClassN,\n _props$rowClassName = props.rowClassName,\n rowClassName = _props$rowClassName === undefined ? 'row file' : _props$rowClassName;\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn(orderBy),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var fileList = (files || []).filter(function (f) {\n return !!f;\n }).map(mapFn).sort(sortFn).map(function (pair) {\n return (0, _preact.h)(FileRow, {\n file: pair[1],\n fields: fieldSet(fields),\n className: rowClassName,\n linkFiles: linkFiles,\n onDelete: onDelete,\n onClick: onClick\n });\n });\n if (!fileList || !fileList.length) {\n return (0, _preact.h)(\n 'div',\n { className: 'rows ' + className },\n (0, _preact.h)(\n 'div',\n { 'class': 'row heading' },\n (0, _preact.h)(\n 'h4',\n { 'class': 'noFiles' },\n 'No files'\n )\n )\n );\n }\n // console.log(files)\n return (0, _preact.h)(\n 'div',\n { className: 'rows ' + className },\n title && (0, _preact.h)(\n 'div',\n { 'class': 'row heading' },\n (0, _preact.h)(\n 'h3',\n null,\n title\n ),\n '}'\n ),\n (0, _preact.h)(\n 'div',\n { className: 'rows ' + fileListClassName },\n fileList\n )\n );\n};\n\nvar FileRow = exports.FileRow = function FileRow(props) {\n var file = props.file,\n linkFiles = props.linkFiles,\n onDelete = props.onDelete,\n _onClick = props.onClick,\n _props$className2 = props.className,\n className = _props$className2 === undefined ? 'row file' : _props$className2,\n _props$username = props.username,\n username = _props$username === undefined ? '' : _props$username;\n\n var fields = fieldSet(props.fields);\n\n var size = _util2.default.hush_size(file.size);\n var date = file.date || file.created_at;\n var epoch = file.epoch || file.epochs || 0;\n var count = file.count || 0;\n\n var name = void 0;\n var key = void 0;\n if (file.name) {\n name = file.name;\n key = name;\n } else if (file.url) {\n if (file.opt && file.opt.type) {\n name = file.opt.type + ': ' + file.opt.title;\n key = file.opt.token;\n } else {\n name = file.url.replace(/^https?:\\/\\//, '');\n key = name;\n }\n }\n\n return (0, _preact.h)(\n 'div',\n { 'class': className, key: key },\n fields.has('name') && (0, _preact.h)(\n 'div',\n { className: 'filename', title: file.name || file.url },\n file.persisted === false ? (0, _preact.h)(\n 'span',\n { className: 'unpersisted' },\n name\n ) : linkFiles && file.url ? (0, _preact.h)(\n 'a',\n { target: '_blank', onClick: function onClick(e) {\n if (!(e.metaKey || e.ctrlKey || e.altKey) && _onClick) {\n e.preventDefault();_onClick && _onClick(file, e);\n }\n }, href: file.url },\n name\n ) : (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick(e) {\n return _onClick && _onClick(file, e);\n } },\n name\n )\n ),\n fields.has('age') && (0, _preact.h)(\n 'div',\n { className: \"age \" + _util2.default.carbon_date(date) },\n _util2.default.get_age(date)\n ),\n fields.has('username') && (0, _preact.h)(\n 'div',\n { className: \"username\" },\n username\n ),\n fields.has('epoch') && (0, _preact.h)(\n 'div',\n { className: \"epoch \" + _util2.default.hush_null(epoch)[0] },\n epoch > 0 ? 'ep. ' + epoch : ''\n ),\n fields.has('date') && (0, _preact.h)(\n 'div',\n { className: \"date \" + _util2.default.carbon_date(date) },\n (0, _moment2.default)(date).format(\"YYYY-MM-DD\")\n ),\n fields.has('datetime') && (0, _preact.h)(\n 'div',\n { className: \"datetime \" + _util2.default.carbon_date(date) },\n (0, _moment2.default)(date).format(\"YYYY-MM-DD h:mm a\")\n ),\n fields.has('size') && (0, _preact.h)(\n 'div',\n { className: \"size \" + size[0] },\n size[1]\n ),\n fields.has('count') && (0, _preact.h)(\n 'div',\n { className: \"count \" + _util2.default.hush_null(count)[0] },\n count > 0 ? count + ' files' : ''\n ),\n (fields.has('activity') || fields.has('module')) && (0, _preact.h)(\n 'div',\n { className: 'activity' },\n fields.has('activity') && file.activity,\n fields.has('module') && file.module\n ),\n fields.has('delete') && onDelete && file.id && (0, _preact.h)(\n 'div',\n { className: 'destroy', onClick: function onClick(e) {\n return onDelete(file);\n } },\n 'x'\n ),\n props.options && props.options(file)\n );\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar FileUpload = function (_Component) {\n _inherits(FileUpload, _Component);\n\n function FileUpload(props) {\n _classCallCheck(this, FileUpload);\n\n var _this = _possibleConstructorReturn(this, (FileUpload.__proto__ || Object.getPrototypeOf(FileUpload)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(FileUpload, [{\n key: 'handleChange',\n value: function handleChange(e) {\n this.props.onChange && this.props.onChange();\n e.stopPropagation();\n e.preventDefault();\n this.setState({ thumbnails: [], images: [] });\n var files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n var i = void 0,\n f = void 0;\n for (i = 0, f; i < files.length; i++) {\n f = files[i];\n if (!f) continue;\n break;\n // if (!f.type.match(this.props.mime)) continue\n }\n this.props.onUpload && this.props.onUpload(f);\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'fileUpload param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: 'file',\n accept: this.props.accept || '*/*',\n multiple: this.props.multiple,\n onChange: this.handleChange\n }),\n (0, _preact.h)(\n 'button',\n null,\n this.props.label || 'Choose file...'\n )\n )\n );\n }\n }]);\n\n return FileUpload;\n}(_preact.Component);\n\nexports.default = FileUpload;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.default = FolderList;\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _group = require('./group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('./param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _loading = require('./loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction FolderList(_ref) {\n var db = _ref.db,\n path = _ref.path,\n emptyText = _ref.emptyText,\n activity = _ref.activity;\n\n if (!db) return null;\n if (db.loading || !db.data) {\n return (0, _preact.h)(\n 'div',\n { 'class': 'col folderList' },\n (0, _preact.h)(_loading2.default, { progress: db.progress })\n );\n }\n var folderList = db.data.folders;\n if (activity) {\n folderList = folderList.filter(function (f) {\n return f.activity === activity;\n });\n }\n if (!folderList.length && emptyText) {\n return (0, _preact.h)(\n 'div',\n { 'class': 'col folderList' },\n emptyText\n );\n }\n console.log(folders);\n var folders = folderList.map(function (raw_folder) {\n var folder = db.data.folderLookup[raw_folder.id];\n var fileCount = folder.files ? folder.files.length : 0;\n\n var _util$hush_null = _util2.default.hush_null(fileCount),\n _util$hush_null2 = _slicedToArray(_util$hush_null, 2),\n className = _util$hush_null2[0],\n size = _util$hush_null2[1];\n\n return (0, _preact.h)(\n _param2.default,\n { title: (0, _preact.h)(\n _reactRouterDom.Link,\n { to: path + folder.id + '/' },\n folder.name\n ) },\n (0, _preact.h)(\n 'span',\n { className: className },\n fileCount,\n ' file',\n _util2.default.courtesy_s(fileCount)\n )\n );\n });\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'col folderList' },\n (0, _preact.h)(\n _group2.default,\n { title: 'Projects' },\n folders\n )\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\t\tvalue: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Gallery = function (_Component) {\n\t\t_inherits(Gallery, _Component);\n\n\t\tfunction Gallery(props) {\n\t\t\t\t_classCallCheck(this, Gallery);\n\n\t\t\t\treturn _possibleConstructorReturn(this, (Gallery.__proto__ || Object.getPrototypeOf(Gallery)).call(this));\n\t\t}\n\n\t\t_createClass(Gallery, [{\n\t\t\t\tkey: 'render',\n\t\t\t\tvalue: function render() {\n\t\t\t\t\t\tvar _props = this.props,\n\t\t\t\t\t\t title = _props.title,\n\t\t\t\t\t\t images = _props.images;\n\n\t\t\t\t\t\tvar imageList = images.map(function (image) {\n\t\t\t\t\t\t\t\treturn (0, _preact.h)(\n\t\t\t\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t(0, _preact.h)('img', { src: image.url })\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn (0, _preact.h)(\n\t\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t\t{ 'class': 'gallery' },\n\t\t\t\t\t\t\t\timageList\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t}]);\n\n\t\treturn Gallery;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n\t\treturn {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n\t\treturn {\n\t\t\t\t// actions: bindActionCreators(liveActions, dispatch)\n\t\t};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Gallery);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Group;\n\nvar _preact = require('preact');\n\nfunction Group(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'group' },\n this.props.title && (0, _preact.h)(\n 'h3',\n null,\n this.props.title\n ),\n this.props.children\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _system = require('../system/system.actions');\n\nvar systemActions = _interopRequireWildcard(_system);\n\nvar _modules = require('../modules');\n\nvar _modules2 = _interopRequireDefault(_modules);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\nfunction NavLink(props) {\n if (!props.to) {\n return (0, _preact.h)(\n 'span',\n null,\n props.children\n );\n }\n var children = props.to === props.location.pathname ? (0, _preact.h)(\n 'b',\n null,\n props.children\n ) : props.children;\n return (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: props.to },\n children\n )\n );\n}\n\nfunction Header(props) {\n var site = props.site,\n app = props.app,\n fps = props.fps,\n playing = props.playing,\n actions = props.actions,\n location = props.location,\n history = props.history;\n\n var tool_list = Object.keys(_modules2.default).map(function (name, i) {\n var label = name.replace(/_/, \" \");\n return (0, _preact.h)(\n 'option',\n { value: name, key: i },\n label\n );\n });\n var tool = _modules2.default[app.tool];\n var links = tool.links().map(function (link, i) {\n return (0, _preact.h)(\n NavLink,\n { key: i, location: location, to: link.url },\n link.name\n );\n });\n return (0, _preact.h)(\n 'header',\n null,\n (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)(\n 'b',\n null,\n site.name,\n ' cortex'\n )\n ),\n (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)(\n 'select',\n { onChange: function onChange(e) {\n var path = window.location.pathname.split(\"/\");\n path.shift();\n console.log(path);\n if (path[0] in _modules2.default && path[1]) {\n history.push('/' + e.target.value + '/' + path[1] + '/');\n }\n actions.changeTool(e.target.value, true);\n }, value: app.tool },\n tool_list\n )\n ),\n (0, _preact.h)(\n NavLink,\n { location: location, to: '/system' },\n 'system'\n ),\n (0, _preact.h)(\n NavLink,\n { location: location, to: '/dashboard' },\n 'dashboard'\n ),\n (0, _preact.h)(\n 'span',\n null,\n links\n ),\n playing && (0, _preact.h)(\n 'span',\n null,\n fps,\n ' fps'\n )\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n site: state.system.site,\n app: state.system.app,\n fps: state.live.fps,\n playing: state.live.playing\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(systemActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Header);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AugmentationGrid = exports.ButtonGrid = exports.TaskList = exports.CurrentTask = exports.Checkbox = exports.Button = exports.SelectGroup = exports.Select = exports.Slider = exports.NumberInput = exports.TextInput = exports.Param = exports.ParamGroup = exports.Group = exports.Player = exports.Gallery = exports.FileUpload = exports.FileRow = exports.FileList = exports.FolderList = exports.Header = exports.Progress = exports.Loading = exports.Views = undefined;\n\nvar _augmentationGrid = require('./augmentationGrid.component');\n\nvar _augmentationGrid2 = _interopRequireDefault(_augmentationGrid);\n\nvar _button = require('./button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _buttonGrid = require('./buttonGrid.component');\n\nvar _buttonGrid2 = _interopRequireDefault(_buttonGrid);\n\nvar _checkbox = require('./checkbox.component');\n\nvar _checkbox2 = _interopRequireDefault(_checkbox);\n\nvar _currentTask = require('./currentTask.component');\n\nvar _currentTask2 = _interopRequireDefault(_currentTask);\n\nvar _fileList = require('./fileList.component');\n\nvar _fileUpload = require('./fileUpload.component');\n\nvar _fileUpload2 = _interopRequireDefault(_fileUpload);\n\nvar _folderList = require('./folderList.component');\n\nvar _folderList2 = _interopRequireDefault(_folderList);\n\nvar _gallery = require('./gallery.component');\n\nvar _gallery2 = _interopRequireDefault(_gallery);\n\nvar _group = require('./group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _header = require('./header.component');\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _loading = require('./loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _numberInput = require('./numberInput.component');\n\nvar _numberInput2 = _interopRequireDefault(_numberInput);\n\nvar _param = require('./param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _paramGroup = require('./paramGroup.component');\n\nvar _paramGroup2 = _interopRequireDefault(_paramGroup);\n\nvar _player = require('./player.component');\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _progress = require('./progress.component');\n\nvar _progress2 = _interopRequireDefault(_progress);\n\nvar _select = require('./select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _selectGroup = require('./selectGroup.component');\n\nvar _selectGroup2 = _interopRequireDefault(_selectGroup);\n\nvar _slider = require('./slider.component');\n\nvar _slider2 = _interopRequireDefault(_slider);\n\nvar _textInput = require('./textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nvar _taskList = require('./taskList.component');\n\nvar _taskList2 = _interopRequireDefault(_taskList);\n\nvar _views = require('./views');\n\nvar Views = _interopRequireWildcard(_views);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.Views = Views;\nexports.Loading = _loading2.default;\nexports.Progress = _progress2.default;\nexports.Header = _header2.default;\nexports.FolderList = _folderList2.default;\nexports.FileList = _fileList.FileList;\nexports.FileRow = _fileList.FileRow;\nexports.FileUpload = _fileUpload2.default;\nexports.Gallery = _gallery2.default;\nexports.Player = _player2.default;\nexports.Group = _group2.default;\nexports.ParamGroup = _paramGroup2.default;\nexports.Param = _param2.default;\nexports.TextInput = _textInput2.default;\nexports.NumberInput = _numberInput2.default;\nexports.Slider = _slider2.default;\nexports.Select = _select2.default;\nexports.SelectGroup = _selectGroup2.default;\nexports.Button = _button2.default;\nexports.Checkbox = _checkbox2.default;\nexports.CurrentTask = _currentTask2.default;\nexports.TaskList = _taskList2.default;\nexports.ButtonGrid = _buttonGrid2.default;\nexports.AugmentationGrid = _augmentationGrid2.default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Loading;\n\nvar _preact = require('preact');\n\nvar _progress = require('./progress.component');\n\nvar _progress2 = _interopRequireDefault(_progress);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Loading(_ref) {\n var progress = _ref.progress;\n\n return (0, _preact.h)(\n 'div',\n { className: 'loading' },\n 'Loading',\n (0, _preact.h)('br', null),\n progress && (0, _preact.h)(_progress2.default, { progress: progress })\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar NumberInput = function (_Component) {\n _inherits(NumberInput, _Component);\n\n function NumberInput(props) {\n _classCallCheck(this, NumberInput);\n\n var _this = _possibleConstructorReturn(this, (NumberInput.__proto__ || Object.getPrototypeOf(NumberInput)).call(this, props));\n\n _this.state = { value: null, changed: false };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(NumberInput, [{\n key: 'handleInput',\n value: function handleInput(e) {\n this.setState({\n value: e.target.value,\n changed: true\n });\n this.props.onInput && this.props.onInput(e.target.value, e.target.name);\n this.props.onChange && this.props.onChange(e.target.name, e.target.value);\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n if (e.keyCode === 13) {\n this.setState({\n value: e.target.value,\n changed: false\n });\n this.props.onSave && this.props.onSave(e.target.value, e.target.name);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'numberInput param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: 'number',\n name: this.props.name || 'number',\n value: this.state.changed ? this.state.value : this.props.value,\n onInput: this.handleInput,\n onKeydown: this.handleKeydown,\n placeholder: this.props.placeholder,\n autofocus: this.props.autofocus,\n min: this.props.min,\n max: this.props.max,\n step: this.props.step || this.props.type === 'int' ? 1 : 0.01\n })\n )\n );\n }\n }]);\n\n return NumberInput;\n}(_preact.Component);\n\nexports.default = NumberInput;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Param = function (_Component) {\n _inherits(Param, _Component);\n\n function Param(props) {\n _classCallCheck(this, Param);\n\n return _possibleConstructorReturn(this, (Param.__proto__ || Object.getPrototypeOf(Param)).call(this, props));\n }\n\n _createClass(Param, [{\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'button param' },\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'span',\n null,\n this.props.children\n )\n );\n }\n }]);\n\n return Param;\n}(_preact.Component);\n\nexports.default = Param;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar ParamGroup = function (_Component) {\n _inherits(ParamGroup, _Component);\n\n function ParamGroup(props) {\n _classCallCheck(this, ParamGroup);\n\n var _this = _possibleConstructorReturn(this, (ParamGroup.__proto__ || Object.getPrototypeOf(ParamGroup)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(ParamGroup, [{\n key: 'handleClick',\n value: function handleClick(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.checked;\n this.props.actions.set_param(this.props.name, new_value);\n this.props.onToggle && this.props.onToggle(new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var checked = this.props.opt[this.props.name];\n var toggle = !this.props.noToggle;\n var dim = !this.props.noDim;\n var className = !dim || !toggle || checked ? 'paramGroup active' : 'paramGroup inactive';\n return (0, _preact.h)(\n 'div',\n { className: className },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'h3',\n null,\n this.props.title\n ),\n toggle ? (0, _preact.h)('input', {\n type: 'checkbox',\n onClick: this.handleClick,\n checked: checked\n }) : null\n ),\n this.props.children\n );\n }\n }]);\n\n return ParamGroup;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n opt: state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ParamGroup);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nfunction Player(props) {\n var className = props.fullscreen ? 'player fullscreen' : 'player';\n return (0, _preact.h)(\n 'div',\n { className: className },\n (0, _preact.h)('canvas', { width: props.width, height: props.height })\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Player);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Progress;\n\nvar _preact = require('preact');\n\nfunction Progress(_ref) {\n var progress = _ref.progress;\n\n if (!progress) return;\n var i = progress.i,\n n = progress.n;\n\n var a = [];\n for (var j = 0; j < n; j++) {\n a.push((0, _preact.h)('div', { key: j, className: j < i ? 'x' : 'o' }));\n }\n return (0, _preact.h)(\n 'div',\n { className: 'progress' },\n a\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Select = function (_Component) {\n _inherits(Select, _Component);\n\n function Select(props) {\n _classCallCheck(this, Select);\n\n var _this = _possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(Select, [{\n key: 'handleChange',\n value: function handleChange(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.value;\n if (new_value === 'PLACEHOLDER') return;\n this.props.onChange && this.props.onChange(this.props.name, new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var currentValue = this.props.live ? this.props.opt[this.props.name] : this.props.value;\n var lastValue = void 0;\n var options = (this.props.options || []).map(function (key, i) {\n var name = void 0,\n value = void 0;\n if (typeof key === 'string') {\n name = key.length < 2 ? key.toUpperCase() : key;\n value = key;\n } else if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object') {\n if (key.length) {\n var _key = _slicedToArray(key, 2);\n\n name = _key[0];\n value = _key[1];\n } else if (key.count) {\n var frames = Math.round(key.count / 30) + ' s.';\n name = key.name.replace(/_/g, ' ') + ' (' + frames + ')';\n value = key.name;\n } else {\n name = key.name;\n value = key.value || key.name;\n }\n }\n lastValue = value;\n return (0, _preact.h)(\n 'option',\n { value: value, key: i },\n name\n );\n });\n return (0, _preact.h)(\n 'div',\n { className: 'select param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'select',\n {\n onChange: this.handleChange,\n value: currentValue || lastValue\n },\n this.props.placeholder && (0, _preact.h)(\n 'option',\n { value: 'PLACEHOLDER' },\n this.props.placeholder\n ),\n options\n )\n ),\n this.props.children\n );\n }\n }]);\n\n return Select;\n}(_preact.Component);\n\nfunction capitalize(s) {\n return (s || \"\").replace(/(?:^|\\s)\\S/g, function (a) {\n return a.toUpperCase();\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state, props) {\n return {\n opt: props.opt || state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Select);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SelectGroup = function (_Component) {\n _inherits(SelectGroup, _Component);\n\n function SelectGroup(props) {\n _classCallCheck(this, SelectGroup);\n\n var _this = _possibleConstructorReturn(this, (SelectGroup.__proto__ || Object.getPrototypeOf(SelectGroup)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(SelectGroup, [{\n key: 'handleChange',\n value: function handleChange(e) {\n clearTimeout(this.timeout);\n var new_value = e.target.value;\n if (new_value === 'PLACEHOLDER') return;\n this.props.onChange && this.props.onChange(this.props.name, new_value);\n }\n }, {\n key: 'render',\n value: function render() {\n var currentValue = this.props.live ? this.props.opt[this.props.name] : this.props.value;\n var lastValue = void 0;\n var options = (this.props.options || []).map(function (group, i) {\n var groupName = group.name;\n var children = group.options.map(function (key) {\n var name = key.length < 2 ? key.toUpperCase() : key;\n name = name.replace(/_/g, ' ');\n var value = key;\n lastValue = value;\n return (0, _preact.h)(\n 'option',\n { value: value, key: value },\n name\n );\n });\n return (0, _preact.h)(\n 'optgroup',\n { label: groupName, key: groupName },\n children\n );\n });\n return (0, _preact.h)(\n 'div',\n { className: 'select param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)(\n 'select',\n {\n onChange: this.handleChange,\n value: currentValue || lastValue\n },\n this.props.placeholder && (0, _preact.h)(\n 'option',\n { value: 'PLACEHOLDER' },\n this.props.placeholder\n ),\n options\n )\n ),\n this.props.children\n );\n }\n }]);\n\n return SelectGroup;\n}(_preact.Component);\n\nfunction capitalize(s) {\n return (s || \"\").replace(/(?:^|\\s)\\S/g, function (a) {\n return a.toUpperCase();\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state, props) {\n return {\n opt: props.opt || state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SelectGroup);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SLIDER_THROTTLE_TIME = 100;\n\nvar Slider = function (_Component) {\n _inherits(Slider, _Component);\n\n function Slider(props) {\n _classCallCheck(this, Slider);\n\n var _this = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, props));\n\n _this.timeout = 0;\n _this.state = {\n value: props.live ? props.opt[props.name] : props.value\n };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleRange = _this.handleRange.bind(_this);\n return _this;\n }\n\n _createClass(Slider, [{\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n var next_value = nextProps.value || nextProps.opt[nextProps.name];\n if (next_value !== this.state.value) {\n this.setState({ value: next_value });\n }\n }\n }, {\n key: 'handleInput',\n value: function handleInput(e) {\n var _props = this.props,\n name = _props.name,\n opt = _props.opt;\n\n var old_value = opt[name];\n var new_value = e.target.value;\n if (new_value === '') {\n new_value = this.props.defaultValue || (this.props.max - this.props.min) / 2;\n } else if (this.props.type === 'int') {\n new_value = parseInt(new_value);\n } else if (this.props.type === 'odd') {\n new_value = parseInt(Math.floor(new_value / 2) * 2 + 1);\n }\n if (old_value !== new_value) {\n this.setState({ value: new_value });\n this.props.live && this.props.actions.set_param(this.props.name, new_value);\n this.props.onChange && this.props.onChange(new_value);\n }\n clearTimeout(this.timeout);\n }\n }, {\n key: 'handleRange',\n value: function handleRange(e) {\n var _this2 = this;\n\n clearTimeout(this.timeout);\n var new_value = e.target.value;\n if (this.props.type === 'int') {\n new_value = parseInt(new_value);\n }\n if (this.props.type === 'odd') {\n new_value = parseInt(Math.floor(new_value / 2) * 2 + 1);\n }\n if (this.props.type === 'list') {\n new_value = this.props.options[new_value] || this.props.options[0];\n }\n this.setState({ value: new_value });\n this.timeout = setTimeout(function () {\n _this2.props.live && _this2.props.actions.set_param(_this2.props.name, new_value);\n _this2.props.onChange && _this2.props.onChange(new_value);\n }, SLIDER_THROTTLE_TIME);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n name = _props2.name,\n title = _props2.title;\n\n var value = this.state.value;\n if (typeof value === 'undefined') {\n value = this.props.min;\n }\n var text_value = value;\n var step = void 0;\n var min = this.props.min || 0;\n var max = this.props.max || 0;\n if (this.props.type === 'int') {\n step = 1;\n } else if (this.props.type === 'list') {\n min = 0;\n max = this.props.options.length - 1;\n step = 1;\n value = this.props.options.indexOf(value);\n } else {\n step = (this.props.max - this.props.min) / 100;\n text_value = parseFloat(value).toFixed(2);\n }\n return (0, _preact.h)(\n 'div',\n { 'class': 'slider param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n title || name.replace(/_/g, ' ')\n ),\n (0, _preact.h)('input', { type: 'text', value: text_value, onBlur: this.handleInput })\n ),\n (0, _preact.h)('input', {\n type: 'range',\n min: min,\n max: max,\n step: step,\n value: value,\n onInput: this.handleRange\n })\n );\n }\n }]);\n\n return Slider;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n opt: state.live.opt\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Slider);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar TaskList = function (_Component) {\n _inherits(TaskList, _Component);\n\n function TaskList(props) {\n _classCallCheck(this, TaskList);\n\n return _possibleConstructorReturn(this, (TaskList.__proto__ || Object.getPrototypeOf(TaskList)).call(this));\n }\n\n _createClass(TaskList, [{\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate(nextProps) {\n if (nextProps.tasks.length !== this.props.tasks.length) {\n return true;\n }\n if (nextProps.tasks[0] !== this.props.tasks[0]) {\n return true;\n }\n return false;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n title = _props.title,\n tasks = _props.tasks;\n\n var time = 0;\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn(this.props.sort || 'date desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var taskList = tasks.map(mapFn).sort(sortFn).map(function (pair) {\n var task = pair[1];\n var dataset = task.dataset;\n\n var dataset_link = void 0,\n label = dataset;\n // console.log(task)\n switch (task.activity) {\n case 'train':\n if (task.epoch === 0) {\n label += ', latest';\n } else {\n label += ', ' + task.epoch;\n }\n label += ' + ' + task.epochs;\n break;\n case 'augment':\n try {\n var opt = JSON.parse(task.opt);\n label += ', ' + opt.augment_take + ' x ' + opt.augment_make;\n } catch (e) {\n //\n }\n default:\n break;\n }\n if (task.folder_id) {\n var href = '/' + task.module + '/' + (task.module === 'samplernn' ? 'datasets' : 'sequences') + '/' + task.folder_id + '/';\n dataset_link = (0, _preact.h)(\n _reactRouterDom.Link,\n { to: href },\n label\n );\n } else {\n dataset_link = label;\n }\n return (0, _preact.h)(\n 'div',\n { 'class': 'row' },\n (0, _preact.h)(\n 'div',\n { 'class': 'activity' },\n task.activity,\n ' ',\n task.module\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'dataset' },\n dataset_link\n ),\n (0, _preact.h)(\n 'div',\n { className: \"age \" + _util2.default.carbon_date(task.updated_at) },\n _util2.default.get_age(task.updated_at)\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'options' },\n (0, _preact.h)(\n 'span',\n { 'class': 'destroy', onClick: function onClick() {\n return _this2.handleDestroy(task);\n } },\n 'x'\n )\n )\n );\n });\n return (0, _preact.h)(\n 'div',\n { 'class': 'tasklist rows' },\n taskList\n );\n }\n }, {\n key: 'handleDestroy',\n value: function handleDestroy(task) {\n var yes = confirm('Are you sure you want to delete this task?');\n if (yes) {\n _actions2.default.task.destroy(task);\n }\n }\n }]);\n\n return TaskList;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n // actions: bindActionCreators(liveActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(TaskList);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar TextInput = function (_Component) {\n _inherits(TextInput, _Component);\n\n function TextInput(props) {\n _classCallCheck(this, TextInput);\n\n var _this = _possibleConstructorReturn(this, (TextInput.__proto__ || Object.getPrototypeOf(TextInput)).call(this, props));\n\n _this.state = { value: null, changed: false };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(TextInput, [{\n key: 'handleInput',\n value: function handleInput(e) {\n this.setState({\n value: e.target.value,\n changed: true\n });\n this.props.onInput && this.props.onInput(e.target.value, e.target.name);\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n if (e.keyCode === 13) {\n this.setState({\n value: e.target.value,\n changed: false\n });\n this.props.onSave && this.props.onSave(e.target.value, e.target.name);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'textInput param' },\n (0, _preact.h)(\n 'label',\n null,\n (0, _preact.h)(\n 'span',\n null,\n this.props.title\n ),\n (0, _preact.h)('input', {\n type: this.props.type || 'text',\n name: this.props.name || 'text',\n value: this.state.changed ? this.state.value : this.props.value,\n onInput: this.handleInput,\n onKeydown: this.handleKeydown,\n placeholder: this.props.placeholder,\n autofocus: this.props.autofocus,\n className: this.props.className || ''\n })\n )\n );\n }\n }]);\n\n return TextInput;\n}(_preact.Component);\n\nexports.default = TextInput;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.New = undefined;\n\nvar _newView = require('./new.view.js');\n\nvar _newView2 = _interopRequireDefault(_newView);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar New = exports.New = _newView2.default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _group = require('../group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('../param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _loading = require('../loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _folderList = require('../folderList.component');\n\nvar _folderList2 = _interopRequireDefault(_folderList);\n\nvar _dataset = require('../../dataset/dataset.new');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar NewView = function (_Component) {\n _inherits(NewView, _Component);\n\n function NewView(props) {\n _classCallCheck(this, NewView);\n\n var _this = _possibleConstructorReturn(this, (NewView.__proto__ || Object.getPrototypeOf(NewView)).call(this, props));\n\n console.log(props);\n if (!props.db.data) {\n props.actions.load_directories();\n }\n return _this;\n }\n\n _createClass(NewView, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n module = _props.module,\n history = _props.history,\n db = _props.db,\n path = _props.path;\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'app new-view ' + module.name },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n module.displayName || module.name\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'col narrow' },\n (0, _preact.h)(_dataset2.default, {\n module: module,\n history: history\n }),\n (0, _preact.h)(_folderList2.default, {\n db: db,\n path: path,\n activity: 'dataset',\n emptyText: (0, _preact.h)(\n 'i',\n null,\n 'No projects yet. Please create one~'\n )\n })\n )\n );\n }\n }]);\n\n return NewView;\n}(_preact.Component);\n\nexports.default = NewView;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load = exports.load = function load() {\n return function (dispatch) {\n _util2.default.allProgress([_actions2.default.task.index({ limit: 40, orderBy: 'created_at desc' }), _actions2.default.folder.index({ activity: 'dataset' }), _actions2.default.file.index({ module: 'samplernn', generated: 1, limit: 15, orderBy: 'created_at desc' }), _actions2.default.file.index({ module: 'pix2pixhd', generated: 1, limit: 15, orderBy: 'created_at desc' }), _actions2.default.file.index({ module: 'morph', generated: 1, limit: 15, orderBy: 'created_at desc' })], function (percent, i, n) {\n // console.log('dashboard load progress', i, n)\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'dashboard' }\n });\n }).then(function (res) {\n var _res = _slicedToArray(res, 5),\n tasks = _res[0],\n folders = _res[1],\n samplernn = _res[2],\n pix2pixhd = _res[3],\n morph = _res[4];\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn('date desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var foldersByModule = folders.map(mapFn).sort(sortFn).reduce(function (a, b) {\n var module = b[1].module;\n a[module] = a[module] || [];\n a[module].push(b[1]);\n return a;\n }, {});\n dispatch({\n type: _types2.default.dashboard.load,\n data: {\n tasks: tasks,\n folders: folders,\n foldersByModule: foldersByModule,\n renders: {\n samplernn: samplernn,\n pix2pixhd: pix2pixhd,\n morph: morph\n }\n }\n });\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _player = require('../common/player.component');\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _group = require('../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _slider = require('../common/slider.component');\n\nvar _slider2 = _interopRequireDefault(_slider);\n\nvar _select = require('../common/select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _button = require('../common/button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _dashboardheader = require('./dashboardheader.component');\n\nvar _dashboardheader2 = _interopRequireDefault(_dashboardheader);\n\nvar _common = require('../common');\n\nvar _dashboard = require('./dashboard.actions');\n\nvar dashboardActions = _interopRequireWildcard(_dashboard);\n\nvar _audioPlayer = require('../common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _modules = require('../modules');\n\nvar _modules2 = _interopRequireDefault(_modules);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Dashboard = function (_Component) {\n _inherits(Dashboard, _Component);\n\n function Dashboard(props) {\n _classCallCheck(this, Dashboard);\n\n // console.log(props)\n var _this = _possibleConstructorReturn(this, (Dashboard.__proto__ || Object.getPrototypeOf(Dashboard)).call(this));\n\n props.actions.load();\n return _this;\n }\n\n _createClass(Dashboard, [{\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n // if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n // this.props.actions.list_epochs(nextProps.opt.checkpoint_name)\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n loading = _props.loading,\n progress = _props.progress,\n site = _props.site,\n foldersByModule = _props.foldersByModule,\n renders = _props.renders,\n queue = _props.queue,\n images = _props.images;\n\n if (loading) {\n return (0, _preact.h)(_common.Loading, { progress: progress });\n }\n var tasks = queue.tasks;\n\n var folders = foldersByModule && Object.keys(_modules2.default).sort().map(function (key) {\n var path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/';\n var folder_list = (foldersByModule[key] || []).map(function (folder) {\n return (0, _preact.h)(\n 'div',\n { key: folder.id },\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: path + folder.id + '/' },\n folder.name\n )\n );\n });\n\n var files = renders[key] && (0, _preact.h)(_common.FileList, {\n linkFiles: true,\n files: renders[key],\n orderBy: 'date desc',\n fields: 'name date epoch size',\n onClick: key === 'samplernn' ? function (file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n _this2.handlePick(file);\n } : null\n });\n\n return (0, _preact.h)(\n 'div',\n { className: 'dashboardModule', key: key },\n (0, _preact.h)(\n 'div',\n { className: 'row moduleHeading' },\n (0, _preact.h)(\n 'h3',\n null,\n key\n ),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: '/' + key + '/new/' },\n 'new'\n )\n ),\n folder_list\n ),\n files\n );\n }).filter(function (a) {\n return !!a;\n });\n return (0, _preact.h)(\n 'div',\n { className: 'app dashboard' },\n (0, _preact.h)(_dashboardheader2.default, null),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n !!queue.queue.length && (0, _preact.h)(\n _group2.default,\n { title: 'Upcoming Tasks' },\n (0, _preact.h)(_common.TaskList, { tasks: queue.queue.map(function (id) {\n return tasks[id];\n }) })\n ),\n !!queue.completed.length && (0, _preact.h)(\n _group2.default,\n { title: 'Completed Tasks' },\n (0, _preact.h)(_common.TaskList, { tasks: queue.completed.map(function (id) {\n return tasks[id];\n }) })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n folders\n )\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n this.props.audioPlayer.play(file);\n }\n }]);\n\n return Dashboard;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n loading: state.dashboard.loading,\n progress: state.dashboard.progress,\n site: state.system.site,\n foldersByModule: state.dashboard.data.foldersByModule,\n renders: state.dashboard.data.renders,\n images: state.dashboard.images,\n files: state.dashboard.files,\n queue: state.queue\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(dashboardActions, dispatch),\n audioPlayer: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Dashboard);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar FileSaver = require('file-saver');\n\nvar dashboardInitialState = {\n loading: false,\n progress: null,\n error: null,\n data: {},\n images: [],\n files: []\n};\n\nvar dashboardReducer = function dashboardReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : dashboardInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.app.load_progress:\n if (!action.data || action.data.module !== 'dashboard') {\n return state;\n }\n return _extends({}, state, {\n loading: true,\n progress: action.progress\n });\n case _types2.default.dashboard.load:\n return _extends({}, state, {\n loading: false,\n error: null,\n data: action.data\n });\n default:\n return state;\n }\n};\n\nexports.default = dashboardReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _redux = require('redux');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar DashboardHeader = function (_Component) {\n _inherits(DashboardHeader, _Component);\n\n function DashboardHeader(props) {\n _classCallCheck(this, DashboardHeader);\n\n var _this = _possibleConstructorReturn(this, (DashboardHeader.__proto__ || Object.getPrototypeOf(DashboardHeader)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(DashboardHeader, [{\n key: 'handleClick',\n value: function handleClick(e) {\n this.props.onClick && this.props.onClick();\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n site = _props.site,\n runner = _props.runner;\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'dashboardHeader heading' },\n (0, _preact.h)(\n 'h1',\n null,\n site.name,\n ' cortex'\n ),\n this.renderStatus(\"GPU\", runner.gpu),\n this.renderStatus(\"CPU\", runner.cpu)\n );\n }\n }, {\n key: 'renderStatus',\n value: function renderStatus(name, gpu) {\n if (gpu.status === 'IDLE') {\n return (0, _preact.h)(\n 'div',\n null,\n name,\n ' idle'\n );\n }\n var task = gpu.task;\n var activityPhrase = void 0,\n liveMessage = void 0;\n if (task.activity === 'live') {\n return (0, _preact.h)(\n 'div',\n null,\n name,\n ' running ',\n (0, _preact.h)(\n 'b',\n null,\n task.module\n ),\n ' live on \"',\n task.dataset,\n '\"'\n );\n } else {\n return (0, _preact.h)(\n 'div',\n null,\n name,\n ' ',\n _util2.default.gerund(task.activity),\n ' ',\n (0, _preact.h)(\n 'b',\n null,\n task.module\n ),\n ' on ',\n (0, _preact.h)(\n 'b',\n null,\n task.dataset\n ),\n !!task.epoch && (0, _preact.h)(\n 'span',\n null,\n 'Epoch: ',\n task.epoch,\n ' / ',\n task.epochs,\n (0, _preact.h)('br', null)\n )\n );\n }\n }\n }]);\n\n return DashboardHeader;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n runner: state.system.runner,\n site: state.system.site\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(DashboardHeader);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uploadFiles = exports.fetchURL = exports.uploadFile = exports.updateFolder = exports.createFolder = undefined;\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _api = require('../api');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createFolder = exports.createFolder = function createFolder(module, name) {\n return function (dispatch) {\n return _actions2.default.folder.create({\n // username... should get added inside the API\n module: module.name,\n datatype: module.datatype,\n activity: 'dataset',\n name: name\n });\n };\n}; // import socket from '../socket'\nvar updateFolder = exports.updateFolder = function updateFolder(module, folder, name) {\n var opt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return function (dispatch) {\n if (!folder || !folder.id) {\n return null;\n }\n return _actions2.default.folder.update({\n id: folder.id,\n module: module.name,\n datatype: module.datatype,\n activity: 'dataset',\n name: name,\n opt: opt\n });\n };\n};\n\nvar uploadFile = exports.uploadFile = function uploadFile(module, folder, file, filename, opt) {\n return function (dispatch) {\n var fd = new FormData();\n fd.append('file', file, filename);\n _actions2.default.folder.upload(fd, {\n id: folder.id,\n module: module.name,\n activity: 'file',\n epoch: 0,\n processed: false,\n generated: false,\n opt: opt\n });\n };\n};\n\nvar fetchURL = exports.fetchURL = function fetchURL(module, folder, url) {\n return function (dispatch) {\n // name url\n // mime datatype\n // duration analysis\n // size activity\n // opt created_at updated_at\n console.log(module, folder, url);\n var seenURL = folder.files.some(function (file) {\n return file.url === url;\n });\n console.log(seenURL);\n if (seenURL) {\n console.log('already seen this url');\n return;\n }\n _api.parser.parse(url, function (media) {\n if (!media) return;\n console.log('media', media);\n _actions2.default.file.create({\n folder_id: folder.id,\n name: (media.title || \"\").replace(/\\.[^.]+$/g, '').replace(/[^a-zA-Z0-9_]/g, '_').replace(/\\s+/g, '_').replace(/_+/g, '_'),\n module: module.name,\n dataset: media.token,\n activity: 'url',\n duration: parseInt(media.duration) || 0,\n epoch: 0,\n processed: false,\n generated: false,\n opt: media,\n url: url\n });\n });\n };\n};\n\nvar uploadFiles = exports.uploadFiles = function uploadFiles(files) {\n return { type: _types2.default.dataset.upload_files };\n};\n\n// export const uploadFiles = (files) => {\n// return dispatch => {\n// // return { type: types.dataset.upload_files }\n// }\n// }\n\n// export const fetchURL = (url) => { type: types.dataset.fetch_url }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _fileList = require('../common/fileList.component');\n\nvar _loading = require('../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar fieldSet = _util2.default.fieldSet(new Set(['input', 'status', 'checkpoint', 'output']));\n\nvar DatasetComponent = function (_Component) {\n _inherits(DatasetComponent, _Component);\n\n function DatasetComponent() {\n _classCallCheck(this, DatasetComponent);\n\n return _possibleConstructorReturn(this, (DatasetComponent.__proto__ || Object.getPrototypeOf(DatasetComponent)).apply(this, arguments));\n }\n\n _createClass(DatasetComponent, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n loading = _props.loading,\n progress = _props.progress,\n fields = _props.fields,\n module = _props.module,\n data = _props.data,\n folder = _props.folder,\n match = _props.match,\n history = _props.history;\n\n if (loading) {\n return (0, _preact.h)(_loading2.default, { progress: progress });\n }\n if (!data.folders.length) {\n console.log('no folders, redirect to /new');\n return history.push('/' + module.name + '/new/');\n }\n if (!folder || !folder.name) return;\n fields = fieldSet(fields);\n return (0, _preact.h)(\n 'div',\n { 'class': 'rows params datasets' },\n (0, _preact.h)(\n 'div',\n { 'class': 'row row-heading dataset' },\n fields.has('input') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'input'\n ),\n fields.has('status') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'status'\n ),\n fields.has('checkpoint') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'checkpoint'\n ),\n fields.has('output') && (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n 'output'\n )\n ),\n this.renderGroups()\n );\n }\n }, {\n key: 'renderGroups',\n value: function renderGroups() {\n var _this2 = this;\n\n var _props2 = this.props,\n module = _props2.module,\n data = _props2.data,\n folder = _props2.folder,\n fields = _props2.fields,\n runner = _props2.runner,\n onPickDataset = _props2.onPickDataset,\n onPickFile = _props2.onPickFile,\n datasetActions = _props2.datasetActions;\n\n fields = fieldSet(fields);\n var datasetLookup = data.datasetLookup,\n fileLookup = data.fileLookup;\n\n if (!datasetLookup) {\n return (0, _preact.h)('div', null);\n }\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn('date desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var moduleOnCPU = runner && runner.cpu.task && runner.cpu.task.module === module.name;\n var moduleOnGPU = runner && runner.gpu.task && runner.gpu.task.module === module.name;\n var datasets = folder.datasets.map(function (name) {\n return datasetLookup[name];\n }).map(mapFn).sort(sortFn).map(function (pair) {\n var dataset = pair[1];\n var status = '';\n var isProcessing = false,\n isFetching = false;\n if (moduleOnGPU && runner.gpu.task.dataset === dataset) {\n status = _util2.default.gerund(runner.gpu.task.activity);\n isProcessing = true;\n } else if (moduleOnCPU && runner.cpu.task.activity === 'fetch' && runner.cpu.task.opt.file_id === dataset.input[0]) {\n isProcessing = true;\n isFetching = true;\n }\n return (0, _preact.h)(\n 'div',\n { key: dataset.name, className: 'row dataset', onClick: function onClick() {\n return onPickDataset && onPickDataset(dataset);\n } },\n _this2.props.beforeRow && _this2.props.beforeRow(dataset),\n fields.has('input') && (0, _preact.h)(\n 'div',\n { className: 'col' },\n !!dataset.input.length && (0, _preact.h)(_fileList.FileList, {\n files: dataset.input.map(function (id) {\n return fileLookup[id];\n }),\n className: 'input_files',\n fileListClassName: '',\n rowClassName: 'input_file',\n fields: 'name date size delete',\n linkFiles: true,\n onClick: onPickFile,\n onDelete: function onDelete(file) {\n return _this2.onDeleteFile(file);\n }\n })\n ),\n fields.has('status') && (0, _preact.h)(\n 'div',\n { className: ['col', 'quiet', dataset.isBuilt ? 'built' : 'not_built', isProcessing ? 'processing' : 'not_processing'].join(' ') },\n _this2.props.datasetActions && _this2.props.datasetActions(dataset, isFetching, isProcessing),\n status\n ),\n fields.has('checkpoint') && (0, _preact.h)(\n 'div',\n { className: 'col checkpoint' },\n !!dataset.checkpoints.length && (0, _preact.h)(_fileList.FileRow, {\n file: dataset.checkpoints[0],\n fields: 'name date epoch',\n className: 'row checkpoint'\n })\n ),\n fields.has('output') && (0, _preact.h)(\n 'div',\n { className: 'col' },\n !!dataset.output.length && (0, _preact.h)(_fileList.FileList, {\n files: dataset.output.map(function (id) {\n return fileLookup[id];\n }),\n orderBy: 'epoch desc',\n fields: 'name date epoch size',\n linkFiles: true,\n onClick: onPickFile,\n onDelete: function onDelete(file) {\n return _this2.onDeleteFile(file);\n }\n })\n ),\n _this2.props.afterRow && _this2.props.afterRow(dataset)\n );\n });\n return datasets;\n }\n }, {\n key: 'onDeleteFile',\n value: function onDeleteFile(file) {\n var yes = confirm('Are you sure you want to delete this file?');\n if (yes) {\n console.log('delete: confirmed');\n if (this.props.onDeleteFile) {\n console.log('calling custom deletefile function');\n this.props.onDeleteFile(file);\n } else {\n _actions2.default.file.destroy(file);\n }\n }\n }\n }]);\n\n return DatasetComponent;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n runner: state.system.runner\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(DatasetComponent);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _dataset = require('./dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _group = require('../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('../common/param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _fileList = require('../common/fileList.component');\n\nvar _fileUpload = require('../common/fileUpload.component');\n\nvar _fileUpload2 = _interopRequireDefault(_fileUpload);\n\nvar _textInput = require('../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar DatasetForm = function (_Component) {\n _inherits(DatasetForm, _Component);\n\n function DatasetForm() {\n _classCallCheck(this, DatasetForm);\n\n return _possibleConstructorReturn(this, (DatasetForm.__proto__ || Object.getPrototypeOf(DatasetForm)).apply(this, arguments));\n }\n\n _createClass(DatasetForm, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n loading = _props.loading,\n status = _props.status,\n error = _props.error,\n module = _props.module,\n folder = _props.folder,\n _props$title = _props.title,\n title = _props$title === undefined ? 'Dataset' : _props$title,\n canRename = _props.canRename,\n canUpload = _props.canUpload,\n canAddURL = _props.canAddURL;\n // sort files??\n\n if (!folder.id) {\n return (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n this.renderFolderNameInput(folder.name)\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n { className: 'form params row' },\n (0, _preact.h)(\n 'div',\n { className: 'col' },\n (0, _preact.h)(\n _group2.default,\n null,\n canRename && this.renderFolderNameInput(folder.name),\n canUpload && this.renderUploadInput(),\n canAddURL && this.renderURLInput()\n )\n )\n );\n }\n }, {\n key: 'curry',\n value: function curry(action) {\n var _props2 = this.props,\n module = _props2.module,\n folder = _props2.folder;\n\n return function (param) {\n return action(module, folder, param);\n };\n }\n }, {\n key: 'renderFolderNameInput',\n value: function renderFolderNameInput(name) {\n return (0, _preact.h)(_textInput2.default, {\n title: 'Dataset name',\n value: name,\n onSave: this.curry(this.props.actions.dataset.updateFolder)\n });\n }\n }, {\n key: 'renderUploadInput',\n value: function renderUploadInput() {\n return (0, _preact.h)(_fileUpload2.default, {\n title: 'Upload a file',\n mime: 'image.*',\n onUpload: this.curry(this.props.actions.dataset.uploadFile)\n });\n }\n }, {\n key: 'renderURLInput',\n value: function renderURLInput() {\n return (0, _preact.h)(_textInput2.default, {\n title: 'Fetch a URL',\n placeholder: 'http://',\n onSave: this.curry(this.props.actions.dataset.fetchURL)\n });\n }\n }]);\n\n return DatasetForm;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return state.upload;\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n dataset: (0, _redux.bindActionCreators)(datasetActions, dispatch)\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(DatasetForm);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load = exports.getDataset = exports.emptyDataset = exports.unsortedFolder = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar unsortedFolders = {};\n\nvar unsortedFolder = exports.unsortedFolder = function unsortedFolder(module) {\n var instantiate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!unsortedFolders[module] || instantiate) {\n var folder = {\n id: 0,\n module: module,\n name: 'unsorted',\n files: [],\n datasets: []\n };\n unsortedFolders[module] = folder;\n }\n return unsortedFolders[module];\n};\n\nvar emptyDataset = exports.emptyDataset = function emptyDataset(module, datasetLookup, name, folder) {\n var dataset = {\n name: name,\n input: [],\n checkpoints: [],\n output: []\n };\n datasetLookup[name] = dataset;\n folder = folder || unsortedFolder(module);\n folder.datasets.push(name);\n return dataset;\n};\n\nvar getDataset = exports.getDataset = function getDataset(module, datasetLookup, name, folder, date) {\n name = name.toLowerCase();\n var dataset = datasetLookup[name] || emptyDataset(module, datasetLookup, name, folder);\n // folder = folder || unsortedFolder(module)\n if (date) {\n dataset.date = dataset.date && !isNaN(dataset.date) ? Math.max(+new Date(date), dataset.date) : +new Date(date);\n }\n return dataset;\n};\n\nvar load = exports.load = function load(module) {\n console.log(module);\n return Promise.all([_actions2.default.folder.index({ module: module, limit: 0 }), _actions2.default.file.index({ module: module, limit: 0 }), _actions2.default.task.index({ module: module })]).then(function (res) {\n var _res = _slicedToArray(res, 3),\n folders = _res[0],\n files = _res[1],\n tasks = _res[2];\n\n var datasetLookup = {};\n var folderLookup = {};\n var fileLookup = {};\n\n var resultsFolder = void 0;\n\n // take all of the folders and put them in a lookup\n folderLookup = folders.reduce(function (folderLookup, folder) {\n folderLookup[folder.id] = {\n id: folder.id,\n name: folder.name,\n folder: folder,\n files: [],\n datasets: []\n };\n if (folder.name === 'results') {\n resultsFolder = folder;\n }\n return folderLookup;\n }, {\n unsorted: unsortedFolder(module, true)\n });\n\n if (!resultsFolder) {\n console.log('creating results folder...');\n _actions2.default.folder.create({\n module: module,\n name: 'results',\n activity: 'results'\n }).then(function (folder) {\n console.log('created folder', folder);\n folderLookup.results = folder;\n });\n } else {\n console.log('got results folder', resultsFolder);\n }\n\n // prepare the files by splitting into two groups\n var generatedFiles = files.filter(function (file) {\n return file.generated;\n });\n var ungeneratedFiles = files.filter(function (file) {\n return !file.generated;\n });\n\n // build the initial dataset lookup table using the ungenerated files\n ungeneratedFiles.reduce(function (datasetLookup, file) {\n fileLookup[file.id] = file;\n if (!file.name) {\n if (file.opt && file.opt.media && file.opt.media.token) {\n file.name = file.opt.media.token;\n } else {\n file.name = file.url.replace(/^https?:\\/\\/(www.)?/, '').replace(/[^a-zA-Z0-9_]/g, '_').replace(/_+/g, '_') || 'unknown_' + Math.floor(1000 * Math.random());\n }\n }\n var name = (file.name || 'unsorted').split('.')[0];\n var folder = folderLookup[file.folder_id] || unsortedFolder(module);\n var dataset = getDataset(module, datasetLookup, file.dataset || name, folder, file.date || file.created_at);\n if (file.url.match(file.name)) file.persisted = true;\n dataset.input.push(file.id);\n folder.files.push(file.id);\n return datasetLookup;\n }, datasetLookup);\n\n // go over the generated files and add addl datasets (if the files were deleted)\n generatedFiles.map(function (file) {\n fileLookup[file.id] = file;\n var pair = file.name.split('.')[0].split('-');\n var folder = folderLookup[file.folder_id] || unsortedFolder(module);\n var dataset = getDataset(module, datasetLookup, file.dataset || pair[0], folder, file.date || file.created_at);\n dataset.output.push(file.id);\n folder.files.push(file.id);\n file.epoch = file.epoch || pair[1];\n });\n\n return {\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders,\n files: files,\n unsortedFolder: folderLookup.unsorted,\n resultsFolder: resultsFolder\n };\n }).catch(function (e) {\n console.error(e);\n });\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _dataset = require('./dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _loading = require('../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _textInput = require('../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\nfunction NewDatasetForm(props) {\n var loading = props.loading,\n status = props.status,\n error = props.error,\n history = props.history,\n actions = props.actions,\n module = props.module;\n\n if (loading) return (0, _preact.h)(_loading2.default, null);\n console.log(props);\n return (0, _preact.h)(\n 'div',\n { 'class': 'opaque' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'h2',\n null,\n 'Create a new ',\n module.displayName,\n ' project'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'params' },\n (0, _preact.h)(_textInput2.default, {\n autofocus: true,\n title: 'Name your project',\n onSave: function onSave(name) {\n actions.createFolder(module, name).then(function (folder) {\n window.location.href = '/' + module.name + '/datasets/' + folder.id + '/';\n });\n }\n })\n )\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {};\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(datasetActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(NewDatasetForm);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*\n Note:\n This is a sub-reducer intended to process the folder-file API output from the DB.\n Please run this from inside your module reducers :) \n*/\n\nvar datasetInitialState = function datasetInitialState() {\n return {\n loading: true,\n progress: null,\n error: null,\n data: null,\n folder_id: 0\n };\n};\n\nvar datasetReducer = function datasetReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : datasetInitialState();\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.app.load_progress:\n return _extends({}, state, {\n progress: action.progress\n });\n\n case _types2.default.dataset.load:\n return _extends({}, state, {\n loading: false,\n data: action.data\n });\n\n case _types2.default.dataset.set_folder:\n return _extends({}, state, {\n folder_id: action.data.folder_id\n });\n\n case _types2.default.folder.create:\n return _extends({}, state, {\n loading: false,\n data: {\n folders: state.data.folders.concat([action.data.id]),\n folderLookup: _extends({}, state.data.folderLookup, _defineProperty({}, action.data.id, action.data))\n }\n });\n return state;\n\n case _types2.default.file.create:\n return handleFileCreate(state, action);\n\n case _types2.default.file.update:\n return handleFileUpdate(state, action);\n\n case _types2.default.file.destroy:\n return handleFileDestroy(state, action);\n\n case _types2.default.dataset.list_epochs:\n return _extends({}, state, {\n data: _extends({}, state.data, {\n epochs: action.data.epochs\n })\n });\n\n default:\n return state;\n }\n};\n\nfunction handleFileCreate(state, action) {\n console.log(action.data);\n if (!state.data || !state.data.datasetLookup) return state;\n var dataset = void 0,\n old_dataset = void 0,\n folder = void 0,\n old_folder = void 0;\n var dataset_name = void 0;\n if (action.data.dataset) {\n dataset_name = action.data.dataset;\n } else if (action.data.name) {\n dataset_name = action.data.name.split('.')[0];\n } else if (action.data.url) {\n dataset_name = action.data.url;\n } else {\n dataset_name = null;\n }\n if (dataset_name in state.data.datasetLookup) {\n old_dataset = state.data.datasetLookup[dataset_name];\n dataset = _extends({}, old_dataset, {\n input: action.data.generated ? old_dataset.input : [action.data.id].concat(old_dataset.input),\n output: !action.data.generated ? old_dataset.output : [action.data.id].concat(old_dataset.output)\n });\n } else {\n console.log(action.data.created_at, action.data.date);\n dataset = {\n name: dataset_name,\n date: action.data.created_at || action.data.date,\n input: action.data.generated ? [] : [action.data.id],\n checkpoints: [],\n output: !action.data.generated ? [] : [action.data.id]\n };\n }\n old_folder = state.data.folderLookup[action.data.folder_id];\n folder = _extends({}, old_folder, {\n datasets: old_folder.datasets.concat([dataset_name]),\n files: old_folder.files.concat([action.data.id])\n });\n return _extends({}, state, {\n loading: false,\n data: _extends({}, state.data, {\n files: state.data.files.concat([action.data.id]),\n folderLookup: _extends({}, state.data.folderLookup, _defineProperty({}, action.data.folder_id, folder)),\n fileLookup: _extends({}, state.data.fileLookup, _defineProperty({}, action.data.id, action.data)),\n datasetLookup: _extends({}, state.data.datasetLookup, _defineProperty({}, dataset_name, dataset))\n })\n });\n}\n\nfunction handleFileUpdate(state, action) {\n var _extends6;\n\n var old_dataset = void 0;\n var new_dataset = state.data.datasetLookup[action.data.dataset];\n var old_file = state.data.fileLookup[action.data.id];\n var new_dataset_update = void 0;\n if (old_file && action.data.dataset !== old_file.dataset) {\n if (state.data.datasetLookup[old_file.dataset]) {\n old_dataset = state.data.datasetLookup[old_file.dataset];\n old_dataset_update = _extends({}, old_dataset, {\n input: old_dataset.input.filter(function (id) {\n return id !== action.data.id;\n }),\n output: old_dataset.output.filter(function (id) {\n return id !== action.data.id;\n })\n });\n }\n new_dataset_update = _extends({}, new_dataset, {\n input: action.data.generated ? [] : [action.data.id],\n output: !action.data.generated ? [] : [action.data.id]\n });\n }\n console.log('old_dataset', old_dataset_update.name);\n console.log('new_dataset', new_dataset_update.name);\n return _extends({}, state, {\n loading: false,\n data: _extends({}, state.data, {\n datasetLookup: old_dataset ? _extends({}, state.data.datasetLookup, (_extends6 = {}, _defineProperty(_extends6, old_dataset.name, old_dataset_update), _defineProperty(_extends6, new_dataset.name, new_dataset_update), _extends6)) : new_dataset_update ? _extends({}, state.data.datasetLookup, _defineProperty({}, new_dataset.name, new_dataset_update)) : state.data.datasetLookup,\n fileLookup: _extends({}, state.data.fileLookup, _defineProperty({}, action.data.id, action.data))\n })\n });\n return state;\n}\n\nfunction handleFileDestroy(state, action) {\n if (!state.data) return state;\n // delete the key from fileLookup\n var fileLookup = _extends({}, state.data.fileLookup);\n var datasetLookup = _extends({}, state.data.datasetLookup);\n var folderLookup = _extends({}, state.data.folderLookup);\n var old_file = fileLookup[action.data.id];\n if (!old_file) return state;\n var old_dataset = state.data.datasetLookup[old_file.dataset];\n var dataset = void 0;\n if (old_dataset) {\n dataset = _extends({}, old_dataset, {\n input: old_dataset.input.filter(function (id) {\n return id !== old_file.id;\n }),\n output: old_dataset.output.filter(function (id) {\n return id !== old_file.id;\n })\n });\n if (!dataset.input.length && !dataset.checkpoints.length && !dataset.output.length) {\n delete datasetLookup[old_file.dataset];\n var old_folder = folderLookup[old_file.folder_id];\n folderLookup[old_file.folder_id] = _extends({}, old_folder, {\n datasets: old_folder.datasets.filter(function (name) {\n return name !== old_file.dataset;\n })\n });\n } else {\n console.log('dataset just needs sweeping');\n datasetLookup[old_file.dataset] = dataset;\n }\n }\n delete fileLookup[old_file.id];\n\n return _extends({}, state, {\n loading: false,\n data: _extends({}, state.data, {\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup\n })\n });\n}\n\nexports.default = datasetReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar uploadInitialState = {\n loading: false,\n error: null,\n status: ''\n};\n\nvar uploadReducer = function uploadReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : uploadInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.folder.upload_loading:\n return {\n error: null,\n loading: true,\n status: 'Loading...'\n };\n case _types2.default.folder.upload_error:\n return {\n error: null,\n loading: false,\n status: 'Error uploading :('\n };\n case _types2.default.folder.upload_progress:\n return {\n error: null,\n loading: true,\n status: 'Upload progress ' + action.percent + '%'\n };\n case _types2.default.folder.upload_waiting:\n return {\n error: null,\n loading: true,\n status: 'Waiting for server to finish processing...'\n };\n case _types2.default.folder.upload_complete:\n return {\n error: null,\n loading: false,\n status: 'Upload complete'\n };\n case _types2.default.file.create_loading:\n return {\n error: null,\n loading: true,\n status: 'Creating file...'\n };\n default:\n return state;\n }\n};\n\nexports.default = uploadReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _loading = require('../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction UploadStatus(props) {\n return (0, _preact.h)(\n 'div',\n { 'class': 'status' },\n props.status\n );\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return state.upload;\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {};\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(UploadStatus);","'use strict';\n\nvar _preact = require('preact');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _store = require('./store');\n\nvar _socket = require('./socket');\n\nvar socket = _interopRequireWildcard(_socket);\n\nvar _util = require('./util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _header = require('./common/header.component');\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _audioPlayer = require('./common/audioPlayer/audioPlayer.component');\n\nvar _audioPlayer2 = _interopRequireDefault(_audioPlayer);\n\nvar _system = require('./system/system.component');\n\nvar _system2 = _interopRequireDefault(_system);\n\nvar _dashboard = require('./dashboard/dashboard.component');\n\nvar _dashboard2 = _interopRequireDefault(_dashboard);\n\nvar _modules = require('./modules');\n\nvar _modules2 = _interopRequireDefault(_modules);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(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; } }\n\n// import client from './client'\n\nvar module_list = Object.keys(_modules2.default).map(function (name) {\n var module = _modules2.default[name];\n return (0, _preact.h)(_reactRouterDom.Route, { path: '/' + module.name, component: module.router });\n});\n\nvar app = (0, _preact.h)(\n _reactRedux.Provider,\n { store: _store.store },\n (0, _preact.h)(\n _reactRouterDom.BrowserRouter,\n null,\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/', component: _dashboard2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { path: '/system/', component: _system2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { path: '/dashboard/', component: _dashboard2.default }),\n module_list,\n (0, _preact.h)(_reactRouterDom.Route, { path: '/', component: _header2.default }),\n (0, _preact.h)(_audioPlayer2.default, null)\n )\n )\n);\n\n(0, _preact.render)(app, document.getElementById('container'));","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.play = exports.pause = exports.seek = exports.load_epoch = exports.load_sequence = exports.list_sequences = exports.list_epochs = exports.list_checkpoints = exports.set_fullscreen = exports.set_param = exports.get_params = undefined;\n\nvar _socket = require('../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _player = require('./player');\n\nvar player = _interopRequireWildcard(_player);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar get_params = exports.get_params = function get_params() {\n _socket2.default.live.get_params();\n return { type: _types2.default.player.get_params };\n};\n\nvar set_param = exports.set_param = function set_param(key, value) {\n console.log('set param', key, value);\n _socket2.default.live.set_param(key, value);\n return { type: _types2.default.player.set_param, key: key, value: value };\n};\n\nvar set_fullscreen = exports.set_fullscreen = function set_fullscreen(value) {\n return { type: _types2.default.player.set_fullscreen, value: value };\n};\n\nvar list_checkpoints = exports.list_checkpoints = function list_checkpoints(module) {\n _socket2.default.live.list_checkpoints(module);\n return { type: _types2.default.player.loading_checkpoints };\n};\n\nvar list_epochs = exports.list_epochs = function list_epochs(module, checkpoint) {\n _socket2.default.live.list_epochs(module, checkpoint);\n return { type: _types2.default.player.loading_epochs };\n};\n\nvar list_sequences = exports.list_sequences = function list_sequences(module) {\n _socket2.default.live.list_sequences(module);\n return { type: _types2.default.player.loading_sequences };\n};\n\nvar load_sequence = exports.load_sequence = function load_sequence(sequence_name) {\n _socket2.default.live.load_sequence(sequence_name);\n return { type: _types2.default.player.loading_sequence, sequence_name: sequence_name };\n};\n\nvar load_epoch = exports.load_epoch = function load_epoch(checkpoint_name, epoch) {\n _socket2.default.live.load_epoch(checkpoint_name, epoch);\n return { type: _types2.default.player.loading_checkpoint, checkpoint_name: checkpoint_name, epoch: epoch };\n};\n\nvar seek = exports.seek = function seek(frame) {\n _socket2.default.live.seek(frame);\n return { type: _types2.default.player.seeking };\n};\n\nvar pause = exports.pause = function pause(frame) {\n _socket2.default.live.pause(pause);\n player.toggleFPS(false);\n return { type: _types2.default.player.pausing };\n};\n\nvar play = exports.play = function play(frame) {\n _socket2.default.live.play();\n player.toggleFPS(true);\n return { type: _types2.default.player.playing };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _fileSaver = require('file-saver');\n\nvar _fileSaver2 = _interopRequireDefault(_fileSaver);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar liveInitialState = {\n loading: false,\n error: null,\n opt: {\n hue: 0, saturation: 0, luminosity: 0,\n sequence_playing: true, sequence_step: 1,\n recurse_roll: 0, rotate: 0, scale: 0, process_frac: 0.5,\n view_mode: 'b'\n },\n all_checkpoints: [],\n checkpoints: [],\n epochs: ['latest'],\n sequences: [],\n fps: 0,\n playing: false,\n last_message: '',\n fullscreen: false,\n frame: { i: 0, sequence_i: 0, sequence_len: '1' }\n};\n\nvar liveReducer = function liveReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : liveInitialState;\n var action = arguments[1];\n\n var results = void 0;\n switch (action.type) {\n case _types2.default.socket.load_params:\n if (!action.opt || !Object.keys(action.opt).length) {\n return state;\n }\n return _extends({}, state, {\n loading: false,\n error: null,\n opt: action.opt\n });\n\n case _types2.default.player.set_param:\n return _extends({}, state, {\n opt: _extends({}, state.opt, _defineProperty({}, action.key, action.value))\n });\n\n case _types2.default.player.set_fullscreen:\n return _extends({}, state, {\n fullscreen: action.value\n });\n\n case _types2.default.socket.list_checkpoints:\n return _extends({}, state, {\n checkpoints: action.checkpoints,\n epochs: []\n });\n\n case _types2.default.socket.list_all_checkpoints:\n return _extends({}, state, {\n all_checkpoints: action.all_checkpoints,\n epochs: []\n });\n\n case _types2.default.socket.list_epochs:\n console.log(action);\n if (action.epochs === \"not found\") return _extends({}, state, { epochs: [] });\n return _extends({}, state, {\n epochs: (action.epochs || []).map(function (a) {\n return [a == 'latest' ? Infinity : a, a];\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).map(function (a) {\n return a[1];\n })\n });\n\n case _types2.default.socket.list_sequences:\n return _extends({}, state, {\n sequences: action.sequences\n });\n\n case _types2.default.player.loading_sequence:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n sequence_name: action.sequence_name\n })\n });\n\n case _types2.default.player.loading_checkpoint:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n checkpoint_name: action.checkpoint_name,\n epoch: action.epoch\n })\n });\n\n case _types2.default.player.set_fps:\n return _extends({}, state, {\n fps: action.fps\n });\n\n case _types2.default.system.stdout:\n if (action.data.processor === 'gpu') {\n return _extends({}, state, {\n last_message: action.data.data\n });\n }\n return state;\n\n case _types2.default.player.current_frame:\n return action.meta ? _extends({}, state, {\n frame: action.meta\n }) : state;\n\n case _types2.default.player.pausing:\n return _extends({}, state, {\n playing: false\n });\n\n case _types2.default.player.playing:\n return _extends({}, state, {\n playing: true\n });\n\n case _types2.default.player.start_recording:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n recording: true\n })\n });\n case _types2.default.player.add_record_frame:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n recordFrames: (state.opt.recordFrames || 0) + 1\n })\n });\n case _types2.default.player.save_frame:\n _fileSaver2.default.saveAs(action.blob, state.opt.checkpoint_name + \"_\" + state.opt.sequence + \"_\" + (0, _moment2.default)().format(\"YYYYMMDD_HHmm\") + \".png\");\n return state;\n\n case _types2.default.player.saving_video:\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n savingVideo: true\n })\n });\n case _types2.default.player.save_video:\n _fileSaver2.default.saveAs(action.blob, state.opt.checkpoint_name + \"_\" + state.opt.sequence + \"_\" + (0, _moment2.default)().format(\"YYYYMMDD_HHmm\") + \".webm\");\n return _extends({}, state, {\n opt: _extends({}, state.opt, {\n recording: false,\n savingVideo: false,\n recordFrames: 0\n })\n });\n\n default:\n return state;\n }\n};\n\nexports.default = liveReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.startSynthesizing = startSynthesizing;\nexports.stopSynthesizing = stopSynthesizing;\nexports.startRecording = startRecording;\nexports.stopRecording = stopRecording;\nexports.saveFrame = saveFrame;\nexports.onFrame = onFrame;\nexports.toggleFPS = toggleFPS;\nexports.startWatchingFPS = startWatchingFPS;\nexports.stopWatchingFPS = stopWatchingFPS;\n\nvar _store = require('../store');\n\nvar _whammy = require('./whammy');\n\nvar _whammy2 = _interopRequireDefault(_whammy);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _pix2wav = require('../audio/pix2wav');\n\nvar pix2wav = _interopRequireWildcard(_pix2wav);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fps = 0,\n last_frame = void 0;\nvar recording = false,\n saving = false,\n synthesizing = false;\nvar videoWriter = void 0;\n\nfunction startSynthesizing() {\n synthesizing = true;\n}\nfunction stopSynthesizing() {\n synthesizing = false;\n}\n\nfunction startRecording() {\n videoWriter = new _whammy2.default.Video(25, 0.95);\n recording = true;\n _store.store.dispatch({\n type: _types2.default.player.start_recording\n });\n}\n\nfunction stopRecording() {\n if (!recording) return;\n recording = false;\n _store.store.dispatch({\n type: _types2.default.player.saving_video\n });\n videoWriter.compile(false, function (blob) {\n // console.log(blob)\n _store.store.dispatch({\n type: _types2.default.player.save_video,\n blob: blob\n });\n });\n}\n\nfunction saveFrame() {\n saving = true;\n}\n\nfunction onFrame(data) {\n var blob = new Blob([data.frame], { type: 'image/jpg' });\n var url = URL.createObjectURL(blob);\n var img = new Image();\n var canvas = document.querySelector('.player canvas');\n if (!canvas) return console.error('no canvas for frame');\n img.onload = function () {\n img.onload = null;\n last_frame = data.meta;\n URL.revokeObjectURL(url);\n var ctx = canvas.getContext('2d-lodpi');\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n if (synthesizing) {\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n pix2wav.play({ imageData: imageData });\n }\n if (recording) {\n console.log('record frame');\n videoWriter.add(canvas);\n _store.store.dispatch({\n type: _types2.default.player.add_record_frame\n });\n }\n if (saving) {\n saving = false;\n canvas.toBlob(function (blob) {\n _store.store.dispatch({\n type: _types2.default.player.save_frame,\n blob: blob\n });\n });\n }\n fps += 1;\n };\n img.src = url;\n}\n\nvar previousValue = void 0,\n currentValue = void 0;\nfunction toggleFPS(state) {\n currentValue = typeof state !== 'undefined' ? state : _store.store.getState().live.playing;\n if (previousValue !== currentValue) {\n if (currentValue) {\n startWatchingFPS();\n } else {\n stopWatchingFPS();\n }\n }\n previousValue = currentValue;\n}\n\nvar fpsInterval = void 0;\n\nfunction startWatchingFPS() {\n clearInterval(fpsInterval);\n fpsInterval = setInterval(function () {\n _store.store.dispatch({\n type: _types2.default.player.set_fps,\n fps: fps\n });\n _store.store.dispatch({\n type: _types2.default.player.current_frame,\n meta: last_frame\n });\n fps = 0;\n }, 1000);\n}\nfunction stopWatchingFPS() {\n clearInterval(fpsInterval);\n}","\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nmodule.exports = function () {\n // in this case, frames has a very specific meaning, which will be\n // detailed once i finish writing the code\n\n function toWebM(frames, outputAsArray) {\n var info = checkFrames(frames);\n\n //max duration by cluster in milliseconds\n var CLUSTER_MAX_DURATION = 30000;\n\n var EBML = [{\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [{\n \"data\": 1,\n \"id\": 0x4286 // EBMLVersion\n }, {\n \"data\": 1,\n \"id\": 0x42f7 // EBMLReadVersion\n }, {\n \"data\": 4,\n \"id\": 0x42f2 // EBMLMaxIDLength\n }, {\n \"data\": 8,\n \"id\": 0x42f3 // EBMLMaxSizeLength\n }, {\n \"data\": \"webm\",\n \"id\": 0x4282 // DocType\n }, {\n \"data\": 2,\n \"id\": 0x4287 // DocTypeVersion\n }, {\n \"data\": 2,\n \"id\": 0x4285 // DocTypeReadVersion\n }]\n }, {\n \"id\": 0x18538067, // Segment\n \"data\": [{\n \"id\": 0x1549a966, // Info\n \"data\": [{\n \"data\": 1e6, //do things in millisecs (num of nanosecs for duration scale)\n \"id\": 0x2ad7b1 // TimecodeScale\n }, {\n \"data\": \"whammy\",\n \"id\": 0x4d80 // MuxingApp\n }, {\n \"data\": \"whammy\",\n \"id\": 0x5741 // WritingApp\n }, {\n \"data\": doubleToString(info.duration),\n \"id\": 0x4489 // Duration\n }]\n }, {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [{\n \"id\": 0xae, // TrackEntry\n \"data\": [{\n \"data\": 1,\n \"id\": 0xd7 // TrackNumber\n }, {\n \"data\": 1,\n \"id\": 0x73c5 // TrackUID\n }, {\n \"data\": 0,\n \"id\": 0x9c // FlagLacing\n }, {\n \"data\": \"und\",\n \"id\": 0x22b59c // Language\n }, {\n \"data\": \"V_VP8\",\n \"id\": 0x86 // CodecID\n }, {\n \"data\": \"VP8\",\n \"id\": 0x258688 // CodecName\n }, {\n \"data\": 1,\n \"id\": 0x83 // TrackType\n }, {\n \"id\": 0xe0, // Video\n \"data\": [{\n \"data\": info.width,\n \"id\": 0xb0 // PixelWidth\n }, {\n \"data\": info.height,\n \"id\": 0xba // PixelHeight\n }]\n }]\n }]\n }, {\n \"id\": 0x1c53bb6b, // Cues\n \"data\": [\n //cue insertion point\n ]\n\n //cluster insertion point\n }]\n }];\n\n var segment = EBML[1];\n var cues = segment.data[2];\n\n //Generate clusters (max duration)\n var frameNumber = 0;\n var clusterTimecode = 0;\n while (frameNumber < frames.length) {\n\n var cuePoint = {\n \"id\": 0xbb, // CuePoint\n \"data\": [{\n \"data\": Math.round(clusterTimecode),\n \"id\": 0xb3 // CueTime\n }, {\n \"id\": 0xb7, // CueTrackPositions\n \"data\": [{\n \"data\": 1,\n \"id\": 0xf7 // CueTrack\n }, {\n \"data\": 0, // to be filled in when we know it\n \"size\": 8,\n \"id\": 0xf1 // CueClusterPosition\n }]\n }]\n };\n\n cues.data.push(cuePoint);\n\n var clusterFrames = [];\n var clusterDuration = 0;\n do {\n clusterFrames.push(frames[frameNumber]);\n clusterDuration += frames[frameNumber].duration;\n frameNumber++;\n } while (frameNumber < frames.length && clusterDuration < CLUSTER_MAX_DURATION);\n\n var clusterCounter = 0;\n var cluster = {\n \"id\": 0x1f43b675, // Cluster\n \"data\": [{\n \"data\": Math.round(clusterTimecode),\n \"id\": 0xe7 // Timecode\n }].concat(clusterFrames.map(function (webp) {\n var block = makeSimpleBlock({\n discardable: 0,\n frame: webp.data.slice(4),\n invisible: 0,\n keyframe: 1,\n lacing: 0,\n trackNum: 1,\n timecode: Math.round(clusterCounter)\n });\n clusterCounter += webp.duration;\n return {\n data: block,\n id: 0xa3\n };\n }))\n\n //Add cluster to segment\n };segment.data.push(cluster);\n clusterTimecode += clusterDuration;\n }\n\n //First pass to compute cluster positions\n var position = 0;\n for (var i = 0; i < segment.data.length; i++) {\n if (i >= 3) {\n cues.data[i - 3].data[1].data[1].data = position;\n }\n var data = generateEBML([segment.data[i]], outputAsArray);\n position += data.size || data.byteLength || data.length;\n if (i != 2) {\n // not cues\n //Save results to avoid having to encode everything twice\n segment.data[i] = data;\n }\n }\n\n return generateEBML(EBML, outputAsArray);\n }\n\n // sums the lengths of all the frames and gets the duration, woo\n\n function checkFrames(frames) {\n var width = frames[0].width,\n height = frames[0].height,\n duration = frames[0].duration;\n for (var i = 1; i < frames.length; i++) {\n if (frames[i].width != width) throw \"Frame \" + (i + 1) + \" has a different width\";\n if (frames[i].height != height) throw \"Frame \" + (i + 1) + \" has a different height\";\n if (frames[i].duration < 0 || frames[i].duration > 0x7fff) throw \"Frame \" + (i + 1) + \" has a weird duration (must be between 0 and 32767)\";\n duration += frames[i].duration;\n }\n return {\n duration: duration,\n width: width,\n height: height\n };\n }\n\n function numToBuffer(num) {\n var parts = [];\n while (num > 0) {\n parts.push(num & 0xff);\n num = num >> 8;\n }\n return new Uint8Array(parts.reverse());\n }\n\n function numToFixedBuffer(num, size) {\n var parts = new Uint8Array(size);\n for (var i = size - 1; i >= 0; i--) {\n parts[i] = num & 0xff;\n num = num >> 8;\n }\n return parts;\n }\n\n function strToBuffer(str) {\n // return new Blob([str]);\n\n var arr = new Uint8Array(str.length);\n for (var i = 0; i < str.length; i++) {\n arr[i] = str.charCodeAt(i);\n }\n return arr;\n // this is slower\n // return new Uint8Array(str.split('').map(function(e){\n // return e.charCodeAt(0)\n // }))\n }\n\n //sorry this is ugly, and sort of hard to understand exactly why this was done\n // at all really, but the reason is that there's some code below that i dont really\n // feel like understanding, and this is easier than using my brain.\n\n function bitsToBuffer(bits) {\n var data = [];\n var pad = bits.length % 8 ? new Array(1 + 8 - bits.length % 8).join('0') : '';\n bits = pad + bits;\n for (var i = 0; i < bits.length; i += 8) {\n data.push(parseInt(bits.substr(i, 8), 2));\n }\n return new Uint8Array(data);\n }\n\n function generateEBML(json, outputAsArray) {\n var ebml = [];\n for (var i = 0; i < json.length; i++) {\n if (!('id' in json[i])) {\n //already encoded blob or byteArray\n ebml.push(json[i]);\n continue;\n }\n\n var data = json[i].data;\n if ((typeof data === \"undefined\" ? \"undefined\" : _typeof(data)) == 'object') data = generateEBML(data, outputAsArray);\n if (typeof data == 'number') data = 'size' in json[i] ? numToFixedBuffer(data, json[i].size) : bitsToBuffer(data.toString(2));\n if (typeof data == 'string') data = strToBuffer(data);\n\n if (data.length) {\n var z = z;\n }\n\n var len = data.size || data.byteLength || data.length;\n var zeroes = Math.ceil(Math.ceil(Math.log(len) / Math.log(2)) / 8);\n var size_str = len.toString(2);\n var padded = new Array(zeroes * 7 + 7 + 1 - size_str.length).join('0') + size_str;\n var size = new Array(zeroes).join('0') + '1' + padded;\n\n //i actually dont quite understand what went on up there, so I'm not really\n //going to fix this, i'm probably just going to write some hacky thing which\n //converts that string into a buffer-esque thing\n\n ebml.push(numToBuffer(json[i].id));\n ebml.push(bitsToBuffer(size));\n ebml.push(data);\n }\n\n //output as blob or byteArray\n if (outputAsArray) {\n //convert ebml to an array\n var buffer = toFlatArray(ebml);\n return new Uint8Array(buffer);\n } else {\n return new Blob(ebml, { type: \"video/webm\" });\n }\n }\n\n function toFlatArray(arr, outBuffer) {\n if (outBuffer == null) {\n outBuffer = [];\n }\n for (var i = 0; i < arr.length; i++) {\n if (_typeof(arr[i]) == 'object') {\n //an array\n toFlatArray(arr[i], outBuffer);\n } else {\n //a simple element\n outBuffer.push(arr[i]);\n }\n }\n return outBuffer;\n }\n\n //OKAY, so the following two functions are the string-based old stuff, the reason they're\n //still sort of in here, is that they're actually faster than the new blob stuff because\n //getAsFile isn't widely implemented, or at least, it doesn't work in chrome, which is the\n // only browser which supports get as webp\n\n //Converting between a string of 0010101001's and binary back and forth is probably inefficient\n //TODO: get rid of this function\n function toBinStr_old(bits) {\n var data = '';\n var pad = bits.length % 8 ? new Array(1 + 8 - bits.length % 8).join('0') : '';\n bits = pad + bits;\n for (var i = 0; i < bits.length; i += 8) {\n data += String.fromCharCode(parseInt(bits.substr(i, 8), 2));\n }\n return data;\n }\n\n function generateEBML_old(json) {\n var ebml = '';\n for (var i = 0; i < json.length; i++) {\n var data = json[i].data;\n if ((typeof data === \"undefined\" ? \"undefined\" : _typeof(data)) == 'object') data = generateEBML_old(data);\n if (typeof data == 'number') data = toBinStr_old(data.toString(2));\n\n var len = data.length;\n var zeroes = Math.ceil(Math.ceil(Math.log(len) / Math.log(2)) / 8);\n var size_str = len.toString(2);\n var padded = new Array(zeroes * 7 + 7 + 1 - size_str.length).join('0') + size_str;\n var size = new Array(zeroes).join('0') + '1' + padded;\n\n ebml += toBinStr_old(json[i].id.toString(2)) + toBinStr_old(size) + data;\n }\n return ebml;\n }\n\n //woot, a function that's actually written for this project!\n //this parses some json markup and makes it into that binary magic\n //which can then get shoved into the matroska comtainer (peaceably)\n\n function makeSimpleBlock(data) {\n var flags = 0;\n if (data.keyframe) flags |= 128;\n if (data.invisible) flags |= 8;\n if (data.lacing) flags |= data.lacing << 1;\n if (data.discardable) flags |= 1;\n if (data.trackNum > 127) {\n throw \"TrackNumber > 127 not supported\";\n }\n var out = [data.trackNum | 0x80, data.timecode >> 8, data.timecode & 0xff, flags].map(function (e) {\n return String.fromCharCode(e);\n }).join('') + data.frame;\n\n return out;\n }\n\n // here's something else taken verbatim from weppy, awesome rite?\n\n function parseWebP(riff) {\n var VP8 = riff.RIFF[0].WEBP[0];\n\n var frame_start = VP8.indexOf('\\x9d\\x01\\x2a'); //A VP8 keyframe starts with the 0x9d012a header\n for (var i = 0, c = []; i < 4; i++) {\n c[i] = VP8.charCodeAt(frame_start + 3 + i);\n }var width, horizontal_scale, height, vertical_scale, tmp;\n\n //the code below is literally copied verbatim from the bitstream spec\n tmp = c[1] << 8 | c[0];\n width = tmp & 0x3FFF;\n horizontal_scale = tmp >> 14;\n tmp = c[3] << 8 | c[2];\n height = tmp & 0x3FFF;\n vertical_scale = tmp >> 14;\n return {\n width: width,\n height: height,\n data: VP8,\n riff: riff\n };\n }\n\n // i think i'm going off on a riff by pretending this is some known\n // idiom which i'm making a casual and brilliant pun about, but since\n // i can't find anything on google which conforms to this idiomatic\n // usage, I'm assuming this is just a consequence of some psychotic\n // break which makes me make up puns. well, enough riff-raff (aha a\n // rescue of sorts), this function was ripped wholesale from weppy\n\n function parseRIFF(string) {\n var offset = 0;\n var chunks = {};\n\n while (offset < string.length) {\n var id = string.substr(offset, 4);\n chunks[id] = chunks[id] || [];\n if (id == 'RIFF' || id == 'LIST') {\n var len = parseInt(string.substr(offset + 4, 4).split('').map(function (i) {\n var unpadded = i.charCodeAt(0).toString(2);\n return new Array(8 - unpadded.length + 1).join('0') + unpadded;\n }).join(''), 2);\n var data = string.substr(offset + 4 + 4, len);\n offset += 4 + 4 + len;\n chunks[id].push(parseRIFF(data));\n } else if (id == 'WEBP') {\n // Use (offset + 8) to skip past \"VP8 \"/\"VP8L\"/\"VP8X\" field after \"WEBP\"\n chunks[id].push(string.substr(offset + 8));\n offset = string.length;\n } else {\n // Unknown chunk type; push entire payload\n chunks[id].push(string.substr(offset + 4));\n offset = string.length;\n }\n }\n return chunks;\n }\n\n // here's a little utility function that acts as a utility for other functions\n // basically, the only purpose is for encoding \"Duration\", which is encoded as\n // a double (considerably more difficult to encode than an integer)\n function doubleToString(num) {\n return [].slice.call(new Uint8Array(new Float64Array([num]) //create a float64 array\n .buffer) //extract the array buffer\n , 0) // convert the Uint8Array into a regular array\n .map(function (e) {\n //since it's a regular array, we can now use map\n return String.fromCharCode(e); // encode all the bytes individually\n }).reverse() //correct the byte endianness (assume it's little endian for now)\n .join(''); // join the bytes in holy matrimony as a string\n }\n\n function WhammyVideo(speed, quality) {\n // a more abstract-ish API\n this.frames = [];\n this.duration = 1000 / speed;\n this.quality = quality || 0.8;\n }\n\n WhammyVideo.prototype.add = function (frame, duration) {\n if (typeof duration != 'undefined' && this.duration) throw \"you can't pass a duration if the fps is set\";\n if (typeof duration == 'undefined' && !this.duration) throw \"if you don't have the fps set, you need to have durations here.\";\n if (frame.canvas) {\n //CanvasRenderingContext2D\n frame = frame.canvas;\n }\n if (frame.toDataURL) {\n // frame = frame.toDataURL('image/webp', this.quality);\n // quickly store image data so we don't block cpu. encode in compile method.\n frame = frame.getContext('2d-lodpi').getImageData(0, 0, frame.width, frame.height);\n } else if (typeof frame != \"string\") {\n throw \"frame must be a a HTMLCanvasElement, a CanvasRenderingContext2D or a DataURI formatted string\";\n }\n if (typeof frame === \"string\" && !/^data:image\\/webp;base64,/ig.test(frame)) {\n throw \"Input must be formatted properly as a base64 encoded DataURI of type image/webp\";\n }\n this.frames.push({\n image: frame,\n duration: duration || this.duration\n });\n };\n\n // deferred webp encoding. Draws image data to canvas, then encodes as dataUrl\n WhammyVideo.prototype.encodeFrames = function (callback) {\n\n if (this.frames[0].image instanceof ImageData) {\n\n var frames = this.frames;\n var tmpCanvas = document.createElement('canvas');\n var tmpContext = tmpCanvas.getContext('2d-lodpi');\n tmpCanvas.width = this.frames[0].image.width;\n tmpCanvas.height = this.frames[0].image.height;\n\n var encodeFrame = function (index) {\n console.log('encodeFrame', index);\n var frame = frames[index];\n tmpContext.putImageData(frame.image, 0, 0);\n frame.image = tmpCanvas.toDataURL('image/webp', this.quality);\n if (index < frames.length - 1) {\n setTimeout(function () {\n encodeFrame(index + 1);\n }, 1);\n } else {\n callback();\n }\n }.bind(this);\n\n encodeFrame(0);\n } else {\n callback();\n }\n };\n\n WhammyVideo.prototype.compile = function (outputAsArray, callback) {\n\n this.encodeFrames(function () {\n var width = 0;\n var height = 0;\n var webm = new toWebM(this.frames.map(function (frame) {\n var webp = parseWebP(parseRIFF(atob(frame.image.slice(23))));\n webp.duration = frame.duration;\n if (!webp || !webp.width || !webp.height) return null;\n if (!width) width = webp.width;else if (width !== webp.width) return null;\n if (!height) height = webp.height;else if (height !== webp.height) return null;\n return webp;\n }).filter(function (frame) {\n return !!frame;\n }), outputAsArray);\n callback(webm);\n }.bind(this));\n };\n\n return {\n Video: WhammyVideo,\n fromImageArray: function fromImageArray(images, fps, outputAsArray) {\n return toWebM(images.map(function (image) {\n var webp = parseWebP(parseRIFF(atob(image.slice(23))));\n webp.duration = 1000 / fps;\n return webp;\n }), outputAsArray);\n },\n toWebM: toWebM\n // expose methods of madness\n };\n}();","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _morph = require('./morph');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nvar _pix2pix = require('./pix2pix');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nvar _pix2pixhd = require('./pix2pixhd');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nvar _pix2wav = require('./pix2wav');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nvar _samplernn = require('./samplernn');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = {\n morph: _morph2.default, pix2pix: _pix2pix2.default, pix2pixhd: _pix2pixhd2.default, pix2wav: _pix2wav2.default, samplernn: _samplernn2.default\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.moduleReducer = undefined;\n\nvar _redux = require('redux');\n\nvar _morph = require('./morph/morph.reducer');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nvar _pix2pix = require('./pix2pix/pix2pix.reducer');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nvar _pix2pixhd = require('./pix2pixhd/pix2pixhd.reducer');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nvar _pix2wav = require('./pix2wav/pix2wav.reducer');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nvar _samplernn = require('./samplernn/samplernn.reducer');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar moduleReducer = exports.moduleReducer = (0, _redux.combineReducers)({\n morph: _morph2.default,\n pix2pix: _pix2pix2.default,\n pix2pixhd: _pix2pixhd2.default,\n pix2wav: _pix2wav2.default,\n samplernn: _samplernn2.default\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _morph = require('./views/morph.app');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('morph');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('morph');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/morph/app/', component: _morph2.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/morph/app/', name: 'morph' }];\n}\n\nexports.default = {\n name: 'morph',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load_data = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _morph = require('./morph.module');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_data = exports.load_data = function load_data(id) {\n return function (dispatch) {\n var module = _morph2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_sequences({ module: 'pix2pixhd', dir: 'sequences' }), _actions2.default.socket.list_directory({ module: module, dir: 'renders' })], function (percent, i, n) {\n console.log('morph load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'morph' }\n });\n }).then(function (res) {\n var _res = _slicedToArray(res, 3),\n datasetApiReport = _res[0],\n sequences = _res[1],\n renders = _res[2];\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder,\n resultsFolder = datasetApiReport.resultsFolder;\n\n\n dispatch({\n type: _types2.default.morph.load,\n data: datasetApiReport,\n app: {\n resultsFolder: resultsFolder,\n files: files,\n sequences: sequences,\n renders: renders\n }\n });\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar morphModule = {\n name: 'morph',\n displayName: 'Morph',\n datatype: 'video'\n};\n\nexports.default = morphModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar morphInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folder_id: 0,\n data: null,\n app: null\n};\n\nvar morphReducer = function morphReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : morphInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'morph') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.morph.load:\n console.log('morph load', action.app);\n return _extends({}, state, {\n app: action.app,\n loading: false,\n data: action.data\n });\n case _types2.default.file.create:\n console.log(action);\n if (action.data.module !== 'morph') return state;\n return _extends({}, state, {\n app: state.app && _extends({}, state.app, {\n files: [action.data].concat(state.app.files)\n })\n });\n default:\n return state;\n }\n};\n\nexports.default = morphReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.morph_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _morph = require('./morph.module');\n\nvar _morph2 = _interopRequireDefault(_morph);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar morph_task = exports.morph_task = function morph_task(state, folder) {\n return function (dispatch) {\n if (state.a === 'PLACEHOLDER' || state.b === 'PLACEHOLDER') return;\n var task = {\n module: _morph2.default.name,\n activity: 'morph',\n dataset: state.a,\n folder_id: folder.id,\n opt: state\n };\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _morph = require('../morph.actions');\n\nvar morphActions = _interopRequireWildcard(_morph);\n\nvar _morph2 = require('../morph.tasks');\n\nvar morphTasks = _interopRequireWildcard(_morph2);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _common = require('../../../common');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar yes_count = 0;\n\nvar MorphResults = function (_Component) {\n _inherits(MorphResults, _Component);\n\n function MorphResults(props) {\n _classCallCheck(this, MorphResults);\n\n var _this = _possibleConstructorReturn(this, (MorphResults.__proto__ || Object.getPrototypeOf(MorphResults)).call(this));\n\n _this.state = {\n dataset_module: 'pix2pixhd',\n a: \"PLACEHOLDER\",\n b: \"PLACEHOLDER\",\n a_offset: 0,\n a_duration: 1,\n a_pos: 0,\n b_offset: 0,\n b_duration: 1,\n b_pos: 0,\n steps: 16,\n dilate: 2,\n frames: 32,\n padding: 3,\n smooth: true,\n mode: 'mix'\n };\n if (!props.morph.data) props.actions.load_data();\n return _this;\n }\n\n _createClass(MorphResults, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n yes_count = 0;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (!this.props.morph.app) return (0, _preact.h)(_loading2.default, { progress: this.props.morph.progress });\n\n var _props$morph$app = this.props.morph.app,\n resultsFolder = _props$morph$app.resultsFolder,\n sequences = _props$morph$app.sequences,\n renders = _props$morph$app.renders,\n files = _props$morph$app.files;\n\n var sequence_options = sequences.map(function (sequence) {\n return [sequence.name.split(\"_\").slice(0, 3).join(\" \") + \"~ (\" + sequence.count + \")\", sequence.name];\n });\n var sequenceLookup = sequences.reduce(function (a, b) {\n return a[b.name] = b, a;\n }, {});\n\n var totalLength = this.state.frames / 25;\n var lengthWarning = void 0;\n if (this.state.steps / this.state.dilate > 64 && this.state.mode === 'mix') {\n lengthWarning = (0, _preact.h)(\n 'span',\n null,\n (0, _preact.h)('br', null),\n 'warning, this will take a while'\n );\n }\n\n return (0, _preact.h)(\n 'div',\n { className: 'app morph' },\n (0, _preact.h)(\n 'div',\n { className: 'heading row middle' },\n (0, _preact.h)(\n 'h1',\n null,\n 'Morph'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'rows params renders' },\n (0, _preact.h)(\n 'div',\n { 'class': 'column' },\n (0, _preact.h)(\n _common.Group,\n { title: 'From' },\n (0, _preact.h)(_common.Select, {\n title: 'Starting sequence',\n placeholder: 'Please choose a video',\n value: this.state.a,\n options: sequence_options,\n onChange: function onChange(name, key) {\n return _this2.setState({ a: key, a_duration: sequenceLookup[key].count, a_pos: 0, a_offset: 0 });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n title: 'Offset',\n value: this.state.a_pos,\n min: 0, max: 1, step: 0.01,\n onChange: function onChange(key) {\n return _this2.setState({ a_pos: key, a_offset: Math.floor(key * (_this2.state.a_duration - _this2.state.frames)) });\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'To' },\n (0, _preact.h)(_common.Select, {\n title: 'Ending sequence',\n placeholder: 'Please choose a video',\n value: this.state.b,\n options: sequence_options,\n onChange: function onChange(name, key) {\n return _this2.setState({ b: key, b_duration: sequenceLookup[key].count, b_pos: 0, b_offset: 0 });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n title: 'Offset',\n value: this.state.b_pos,\n min: 0, max: 1, step: 0.01,\n onChange: function onChange(key) {\n return _this2.setState({ b_pos: key, b_offset: Math.floor(key * (_this2.state.b_duration - _this2.state.frames)) });\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Morph Settings' },\n (0, _preact.h)(_common.Select, {\n title: \"Mode\",\n value: this.state.mode,\n options: ['mix', 'average', 'mix_images'],\n onChange: function onChange(name, key) {\n return _this2.setState({ mode: key });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n type: 'list',\n title: 'Steps',\n value: this.state.steps,\n options: [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096],\n onChange: function onChange(key) {\n return _this2.setState({ steps: key, frames: key * _this2.state.dilate });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n type: 'list',\n title: 'Dilate',\n value: this.state.dilate,\n options: [1, 2, 4, 8, 16, 32],\n onChange: function onChange(key) {\n return _this2.setState({ dilate: key, frames: _this2.state.steps * key });\n }\n }),\n (0, _preact.h)(_common.Checkbox, {\n title: 'Smooth',\n value: this.state.smooth,\n onToggle: function onToggle(key) {\n return _this2.setState({ smooth: key });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n type: 'int',\n title: 'Padding (in seconds)',\n value: this.state.padding,\n min: 0, max: 30, step: 1,\n onChange: function onChange(key) {\n return _this2.setState({ padding: key });\n }\n }),\n (0, _preact.h)(_common.Button, {\n title: 'Run task',\n value: 'Morph!',\n onClick: function onClick() {\n return _this2.props.remote.morph_task(_this2.state, resultsFolder);\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n _common.Param,\n { title: 'Total length' },\n totalLength.toFixed(1) + \" seconds\"\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Total frames' },\n this.state.frames + \" frames\"\n ),\n lengthWarning,\n (0, _preact.h)('br', null),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(\n 'h3',\n null,\n 'morphed videos'\n ),\n (0, _preact.h)(_common.FileList, {\n linkFiles: true,\n files: files,\n orderBy: 'date desc',\n fields: 'name datetime size delete',\n onDelete: function onDelete(file) {\n var yes = void 0;\n if (yes_count < 3) {\n yes = confirm('Are you sure you want to delete this file?');\n } else {\n yes = true;\n }\n if (yes) {\n yes_count += 1;\n console.log('delete: confirmed');\n _actions2.default.file.destroy(file);\n }\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'h3',\n null,\n 'renders on server'\n ),\n (0, _preact.h)(_common.FileList, {\n files: renders,\n orderBy: 'date desc',\n fields: 'name datetime time size',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a result', file);\n _this2.handlePick(file);\n }\n })\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n // this.props.audioPlayer.play(file)\n }\n }]);\n\n return MorphResults;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n morph: state.module.morph\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(morphActions, dispatch),\n remote: (0, _redux.bindActionCreators)(morphTasks, dispatch)\n // audioPlayer: bindActionCreators(audioPlayerActions, dispatch),\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(MorphResults);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pix = require('./views/pix2pix.new');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nvar _pix2pix3 = require('./views/pix2pix.show');\n\nvar _pix2pix4 = _interopRequireDefault(_pix2pix3);\n\nvar _pix2pix5 = require('./views/pix2pix.live');\n\nvar _pix2pix6 = _interopRequireDefault(_pix2pix5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('pix2pix');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #fde, #ffe)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('pix2pix');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #fde, #ffe)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/new/', component: _pix2pix2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/sequences/', component: _pix2pix4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/sequences/:id/', component: _pix2pix4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pix/live/', component: _pix2pix6.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/pix2pix/new/', name: 'new' }, { url: '/pix2pix/sequences/', name: 'sequences' }, { url: '/pix2pix/live/', name: 'live' }];\n}\n\nexports.default = {\n name: 'pix2pix',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pix = require('./pix2pix.module');\n\nvar _pix2pix2 = _interopRequireDefault(_pix2pix);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _pix2pix2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: module, dir: 'sequences/pix2pix/' }), _actions2.default.socket.list_directory({ module: module, dir: 'datasets/pix2pix/' }), _actions2.default.socket.list_directory({ module: module, dir: 'checkpoints/pix2pix/' })], function (percent, i, n) {\n console.log('pix2pix load progress', i, n);\n dispatch({ type: _types2.default.app.load_progress, progress: { i: i, n: n } });\n }).then(function (res) {\n var _res = _slicedToArray(res, 4),\n datasetApiReport = _res[0],\n sequences = _res[1],\n datasets = _res[2],\n checkpoints = _res[3]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder;\n // console.log(datasetUsage)\n\n var sequenceDirectories = sequences.filter(function (s) {\n return s.dir;\n });\n // console.log(sequenceDirectories)\n sequenceDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.isBuilt = true;\n // console.log(dir.name, dataset)\n });\n\n datasets.filter(function (s) {\n return s.dir;\n }).forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasDataset = true;\n });\n\n var checkpointDirectories = checkpoints.filter(function (s) {\n return s.dir;\n });\n checkpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dataset.checkpoints = [dir];\n });\n\n // console.log(res)\n\n // flatDatasets.forEach(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const name = file.name.split('.')[0]\n // const dataset = datasetLoader.getDataset(module, datasetLookup, name, unsortedFolder, file.date)\n // file.persisted = false\n // dataset.input.push(file.uuid)\n // })\n\n // // exp:coccokit_3-frame_sizes:8,2-n_rnn:2-dataset:coccokit_3\n // const checkpoints = results.filter(s => s.dir).map(s => {\n // const checkpoint = s.name\n // .split('-')\n // .map(s => s.split(':'))\n // .filter(b => b.length && b[1])\n // .reduce((a,b) => (a[b[0]] = b[1]) && a, {})\n // checkpoint.name = checkpoint.name || checkpoint.dataset || checkpoint.exp\n // checkpoint.date = s.date\n // checkpoint.dir = s\n // checkpoint.persisted = false\n // const dataset = datasetLoader.getDataset(module, datasetLookup, checkpoint.name, unsortedFolder, checkpoint.date)\n // const loss = lossReport[checkpoint.name]\n // if (loss) {\n // dataset.epoch = checkpoint.epoch = loss.length\n // checkpoint.training_loss = loss\n // }\n // dataset.checkpoints.push(checkpoint)\n // return checkpoint\n // })\n\n // output.map(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const pair = file.name.split('.')[0].split('-')\n // const dataset = datasetLoader.getDataset(module, datasetLookup, pair[0], unsortedFolder, file.date)\n // file.persisted = false\n // file.epoch = parseInt(file.epoch || pair[1].replace(/^\\D+/, '')) || 0\n // dataset.epoch = Math.max(file.epoch, dataset.epoch || 0)\n // // here check if the file exists in dataset, if so just check that it's persisted\n // const found = dataset.output.some(file_id => {\n // // if (f.name === \n // if (fileLookup[file_id].name === file.name) {\n // fileLookup[file_id].persisted = true\n // return true\n // }\n // return false\n // })\n // if (! found) {\n // dataset.output.push(file.uuid)\n // }\n // })\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n sequences: sequenceDirectories,\n datasets: datasets,\n checkpoints: checkpointDirectories\n }\n });\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar pix2pixModule = {\n name: 'pix2pix',\n displayName: 'Pix2Pix',\n datatype: 'video'\n};\n\nexports.default = pix2pixModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar pix2pixInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folder_id: 0,\n data: null\n};\n\nvar pix2pixReducer = function pix2pixReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : pix2pixInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'pix2pix') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexports.default = pix2pixReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.train_task = exports.live_task = exports.fetch_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fetch_task = exports.fetch_task = function fetch_task(url, file_id, dataset) {\n return function (dispatch) {\n if (!url) return console.log('input file inaccessible (no url)');\n var task = {\n module: 'pix2pix',\n activity: 'fetch',\n dataset: dataset,\n opt: {\n url: url,\n file_id: file_id,\n dataset: dataset\n }\n };\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar live_task = exports.live_task = function live_task(sequence, checkpoint) {\n return function (dispatch) {\n var task = {\n module: 'pix2pix',\n activity: 'live',\n dataset: sequence,\n checkpoint: checkpoint,\n opt: {\n poll_delay: 0.09\n }\n };\n console.log(task);\n console.log('add live task');\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar train_task = exports.train_task = function train_task(dataset, folder_id) {\n var epochs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n return function (dispatch) {\n var task = {\n module: 'pix2pix',\n activity: 'train',\n dataset: dataset.name,\n epoch: 0,\n epochs: epochs,\n opt: {\n folder_id: folder_id,\n load_size: 264 // switch to 256 for pix2wav\n }\n };\n console.log(task);\n return _actions2.default.queue.add_task(task);\n };\n};\n// export const log_task = (dataset) => dispatch => {\n// const task = {\n// module: 'samplernn',\n// activity: 'log',\n// dataset: dataset.name,\n// }\n// return actions.queue.add_task(task)\n// }\n// export const clear_cache_task = (dataset) => dispatch => {\n// const task = {\n// module: 'samplernn',\n// activity: 'clear_cache',\n// dataset: dataset.name,\n// }\n// return actions.queue.add_task(task)\n// }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _common = require('../../../common/');\n\nvar _player = require('../../../live/player');\n\nvar _live = require('../../../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../../../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _pix2pix = require('../pix2pix.tasks');\n\nvar pix2pixTasks = _interopRequireWildcard(_pix2pix);\n\nvar _pix2pix2 = require('../pix2pix.actions');\n\nvar pix2pixActions = _interopRequireWildcard(_pix2pix2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixLive = function (_Component) {\n _inherits(Pix2PixLive, _Component);\n\n function Pix2PixLive(props) {\n _classCallCheck(this, Pix2PixLive);\n\n // if (! props.pix2pix || ! props.pix2pix.data) {\n var _this = _possibleConstructorReturn(this, (Pix2PixLive.__proto__ || Object.getPrototypeOf(Pix2PixLive)).call(this));\n\n props.actions.pix2pix.load_directories();\n // }\n props.actions.live.get_params();\n // props.actions.live.list_checkpoints('pix2pix')\n // props.actions.live.list_sequences('pix2pix')\n _this.changeCheckpoint = _this.changeCheckpoint.bind(_this);\n _this.changeEpoch = _this.changeEpoch.bind(_this);\n _this.changeSequence = _this.changeSequence.bind(_this);\n _this.seek = _this.seek.bind(_this);\n _this.togglePlaying = _this.togglePlaying.bind(_this);\n _this.toggleRecording = _this.toggleRecording.bind(_this);\n return _this;\n }\n\n _createClass(Pix2PixLive, [{\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n this.props.actions.live.list_epochs('pix2pix', nextProps.opt.checkpoint_name);\n }\n }\n }, {\n key: 'changeCheckpoint',\n value: function changeCheckpoint(field, checkpoint_name) {\n this.props.actions.live.load_epoch(checkpoint_name, 'latest');\n }\n }, {\n key: 'changeEpoch',\n value: function changeEpoch(field, epoch_name) {\n this.props.actions.live.load_epoch(this.props.opt.checkpoint_name, epoch_name);\n }\n }, {\n key: 'changeSequence',\n value: function changeSequence(field, sequence) {\n console.log('load sequence', sequence);\n this.props.actions.live.load_sequence(sequence);\n }\n }, {\n key: 'seek',\n value: function seek(percentage) {\n var frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1);\n console.log(\"seek to frame\", percentage, frame);\n this.props.actions.live.seek(frame);\n }\n }, {\n key: 'start',\n value: function start() {\n // console.log(this.props)\n var sequence = this.props.pix2pix.data.sequences[0].name;\n var checkpoint = this.props.pix2pix.data.checkpoints[0].name;\n console.log('starting up!', sequence, checkpoint);\n this.props.actions.tasks.live_task(sequence, checkpoint);\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'togglePlaying',\n value: function togglePlaying() {\n if (this.props.opt.processing) {\n this.props.actions.live.pause();\n } else {\n this.props.actions.live.play();\n }\n }\n }, {\n key: 'toggleRecording',\n value: function toggleRecording() {\n if (this.props.opt.recording) {\n (0, _player.stopRecording)();\n this.props.actions.live.pause();\n } else {\n (0, _player.startRecording)();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n // console.log(this.props)\n if (this.props.pix2pix.loading) {\n return (0, _preact.h)(_common.Loading, null);\n }\n return (0, _preact.h)(\n 'div',\n { className: 'app centered' },\n (0, _preact.h)(_common.Player, { width: 424, height: 256 }),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Playback',\n noToggle: true\n },\n (0, _preact.h)(_common.Select, {\n name: 'send_image',\n title: 'view mode',\n options: ['a', 'b', 'sequence', 'recursive'],\n onChange: this.props.actions.live.set_param\n }),\n (0, _preact.h)(_common.Select, {\n name: 'sequence_name',\n title: 'sequence',\n options: this.props.pix2pix.data.sequences.map(function (file) {\n return file.name;\n }),\n onChange: this.changeSequence\n }),\n (0, _preact.h)(_common.Select, {\n name: 'checkpoint_name',\n title: 'checkpoint',\n options: this.props.pix2pix.data.checkpoints.map(function (file) {\n return file.name;\n }),\n onChange: this.changeCheckpoint\n }),\n (0, _preact.h)(_common.Select, {\n name: 'epoch',\n title: 'epoch',\n options: this.props.epochs,\n onChange: this.changeEpoch\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'position',\n min: 0.0, max: 1.0, type: 'float',\n value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1),\n onChange: this.seek\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'frame_delay',\n min: 0.05, max: 2.0, type: 'float'\n }),\n this.renderRestartButton(),\n (0, _preact.h)(\n _common.Button,\n {\n title: this.props.opt.savingVideo ? 'Saving video...' : this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames / 25) + ')' : 'Record video',\n onClick: this.toggleRecording\n },\n this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Save frame',\n onClick: _player.saveFrame\n },\n 'Save'\n ),\n (0, _preact.h)(_common.ParamGroup, {\n title: 'Render on server',\n name: 'store_b',\n onToggle: function onToggle(value) {\n // now storing frames on server...\n }\n }),\n (0, _preact.h)(\n 'p',\n { 'class': 'last_message' },\n this.props.last_message\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transition',\n name: 'transition'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_period',\n min: 10, max: 5000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_min',\n min: 0.001, max: 0.2, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_max',\n min: 0.1, max: 1.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Recursion',\n name: 'recursive'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recursive_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll',\n min: -64, max: 64, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll_axis',\n min: 0, max: 1, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Sequence',\n name: 'sequence'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'sequence_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'process_frac',\n min: 0, max: 1, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Clahe',\n name: 'clahe'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'clip_limit',\n min: 1.0, max: 4.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Posterize',\n name: 'posterize'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'spatial_window',\n min: 2, max: 128, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'color_window',\n min: 2, max: 128, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Blur',\n name: 'blur'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_radius',\n min: 3, max: 7, type: 'odd'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_sigma',\n min: 0, max: 2, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Canny Edge Detection',\n name: 'canny'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_lo',\n min: 10, max: 200, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_hi',\n min: 10, max: 200, type: 'int'\n })\n )\n )\n )\n );\n }\n }, {\n key: 'renderRestartButton',\n value: function renderRestartButton() {\n var _this2 = this;\n\n if (this.props.runner.gpu.status === 'IDLE') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Idle',\n onClick: function onClick() {\n return _this2.start();\n }\n },\n 'Start'\n );\n }\n if (this.props.runner.gpu.task.module !== 'pix2pix') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n );\n }\n if (!this.props.opt.processing) {\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Not processing',\n onClick: this.togglePlaying\n },\n 'Restart'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Processing',\n onClick: this.togglePlaying\n },\n 'Stop'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n }]);\n\n return Pix2PixLive;\n}(_preact.Component);\n\nfunction timeInSeconds(n) {\n return n.toFixed(1) + ' s.';\n}\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n last_message: state.live.last_message,\n opt: state.live.opt,\n frame: state.live.frame,\n checkpoints: state.live.checkpoints,\n epochs: state.live.epochs,\n sequences: state.live.sequences,\n runner: state.system.runner,\n pix2pix: state.module.pix2pix\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n live: (0, _redux.bindActionCreators)(liveActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n pix2pix: (0, _redux.bindActionCreators)(pix2pixActions, dispatch),\n tasks: (0, _redux.bindActionCreators)(pix2pixTasks, dispatch), s: s\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixLive);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _common = require('../../../common');\n\nvar _pix2pix = require('../pix2pix.actions');\n\nvar pix2pixActions = _interopRequireWildcard(_pix2pix);\n\nvar _pix2pix2 = require('../pix2pix.module');\n\nvar _pix2pix3 = _interopRequireDefault(_pix2pix2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Pix2PixNew(props) {\n return (0, _preact.h)(_common.Views.New, {\n db: props.pix2pix,\n path: '/pix2pix/sequences/',\n actions: props.actions,\n module: _pix2pix3.default,\n history: props.history\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pix: state.module.pix2pix\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixNew);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pix = require('../pix2pix.actions');\n\nvar pix2pixActions = _interopRequireWildcard(_pix2pix);\n\nvar _pix2pix2 = require('../pix2pix.tasks');\n\nvar pix2pixTasks = _interopRequireWildcard(_pix2pix2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2pix3 = require('../pix2pix.module');\n\nvar _pix2pix4 = _interopRequireDefault(_pix2pix3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2pixShow = function (_Component) {\n _inherits(Pix2pixShow, _Component);\n\n function Pix2pixShow(props) {\n _classCallCheck(this, Pix2pixShow);\n\n var _this = _possibleConstructorReturn(this, (Pix2pixShow.__proto__ || Object.getPrototypeOf(Pix2pixShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(Pix2pixShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2pix.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2pix = _props.pix2pix,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2pix.last_id', id);\n if (!pix2pix.folder || pix2pix.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2pix/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n pix2pix = _props2.pix2pix,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = pix2pix.data || {},\n folderLookup = _ref.folderLookup;\n\n var folder = (folderLookup || {})[pix2pix.folder_id] || {};\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pix' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'div',\n { 'class': 'spaced' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_common.Loading, null)\n ),\n (0, _preact.h)(_upload2.default, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n folder && folder.name && folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, {\n title: 'Add Files',\n module: _pix2pix4.default,\n folder: folder,\n canUpload: true, canAddURL: true\n }),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_upload2.default, null),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(_dataset6.default, {\n loading: pix2pix.loading,\n progress: pix2pix.progress,\n id: pix2pix.folder_id,\n module: _pix2pix4.default,\n data: pix2pix.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n pix2pix = _props3.pix2pix,\n remote = _props3.remote;\n\n var input = pix2pix.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n console.log(dataset);\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 5);\n } },\n '5x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 10);\n } },\n '10x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 20);\n } },\n '20x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pix.folder_id, 50);\n } },\n '50x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'rm'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }]);\n\n return Pix2pixShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pix: state.module.pix2pix\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2pixShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('./views/pix2pixhd.new');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nvar _pix2pixhd3 = require('./views/pix2pixhd.show');\n\nvar _pix2pixhd4 = _interopRequireDefault(_pix2pixhd3);\n\nvar _pix2pixhd5 = require('./views/pix2pixhd.results');\n\nvar _pix2pixhd6 = _interopRequireDefault(_pix2pixhd5);\n\nvar _pix2pixhd7 = require('./views/pix2pixhd.train');\n\nvar _pix2pixhd8 = _interopRequireDefault(_pix2pixhd7);\n\nvar _pix2pixhd9 = require('./views/pix2pixhd.live');\n\nvar _pix2pixhd10 = _interopRequireDefault(_pix2pixhd9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('pix2pixhd');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('pix2pixhd');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #def, #dfe)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/new/', component: _pix2pixhd2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/sequences/', component: _pix2pixhd4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/sequences/:id/', component: _pix2pixhd4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/train/', component: _pix2pixhd8.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/results/', component: _pix2pixhd6.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2pixhd/live/', component: _pix2pixhd10.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/pix2pixhd/new/', name: 'folders' }, { url: '/pix2pixhd/sequences/', name: 'sequences' }, { url: '/pix2pixhd/train/', name: 'checkpoints' }, { url: '/pix2pixhd/results/', name: 'results' }, { url: '/pix2pixhd/live/', name: 'live' }];\n}\n\nexports.default = {\n name: 'pix2pixhd',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.count_dataset = exports.list_epochs = exports.load_results = exports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('./pix2pixhd.module');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: module, dir: 'sequences' }), _actions2.default.socket.list_directory({ module: module, dir: 'datasets' }), _actions2.default.socket.list_directory({ module: module, dir: 'checkpoints' })], function (percent, i, n) {\n console.log('pix2pixhd load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'pix2pixhd' }\n });\n }).then(function (res) {\n var _res = _slicedToArray(res, 4),\n datasetApiReport = _res[0],\n sequences = _res[1],\n datasets = _res[2],\n checkpoints = _res[3]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder,\n resultsFolder = datasetApiReport.resultsFolder;\n // console.log(datasetUsage)\n\n var sequenceDirectories = sequences.filter(function (s) {\n return s.dir;\n });\n // console.log(sequenceDirectories)\n sequenceDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.isBuilt = true;\n // console.log(dir.name, dataset)\n });\n\n datasets.filter(function (s) {\n return s.dir;\n }).forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasDataset = true;\n });\n\n var checkpointDirectories = checkpoints.filter(function (s) {\n return s.dir;\n });\n checkpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dataset.checkpoints = [dir];\n });\n\n // console.log(res)\n\n // flatDatasets.forEach(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const name = file.name.split('.')[0]\n // const dataset = datasetLoader.getDataset(module, datasetLookup, name, unsortedFolder, file.date)\n // file.persisted = false\n // dataset.input.push(file.uuid)\n // })\n\n // // exp:coccokit_3-frame_sizes:8,2-n_rnn:2-dataset:coccokit_3\n // const checkpoints = results.filter(s => s.dir).map(s => {\n // const checkpoint = s.name\n // .split('-')\n // .map(s => s.split(':'))\n // .filter(b => b.length && b[1])\n // .reduce((a,b) => (a[b[0]] = b[1]) && a, {})\n // checkpoint.name = checkpoint.name || checkpoint.dataset || checkpoint.exp\n // checkpoint.date = s.date\n // checkpoint.dir = s\n // checkpoint.persisted = false\n // const dataset = datasetLoader.getDataset(module, datasetLookup, checkpoint.name, unsortedFolder, checkpoint.date)\n // const loss = lossReport[checkpoint.name]\n // if (loss) {\n // dataset.epoch = checkpoint.epoch = loss.length\n // checkpoint.training_loss = loss\n // }\n // dataset.checkpoints.push(checkpoint)\n // return checkpoint\n // })\n\n // output.map(file => {\n // file.uuid = uuidv1()\n // fileLookup[file.uuid] = file\n // const pair = file.name.split('.')[0].split('-')\n // const dataset = datasetLoader.getDataset(module, datasetLookup, pair[0], unsortedFolder, file.date)\n // file.persisted = false\n // file.epoch = parseInt(file.epoch || pair[1].replace(/^\\D+/, '')) || 0\n // dataset.epoch = Math.max(file.epoch, dataset.epoch || 0)\n // // here check if the file exists in dataset, if so just check that it's persisted\n // const found = dataset.output.some(file_id => {\n // // if (f.name === \n // if (fileLookup[file_id].name === file.name) {\n // fileLookup[file_id].persisted = true\n // return true\n // }\n // return false\n // })\n // if (! found) {\n // dataset.output.push(file.uuid)\n // }\n // })\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n sequences: sequenceDirectories,\n datasets: datasets,\n checkpoints: checkpointDirectories,\n resultsFolder: resultsFolder\n }\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};\n\nvar load_results = exports.load_results = function load_results(id) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _util2.default.allProgress([_actions2.default.folder.index({ name: 'results' }), _actions2.default.file.index({ module: module, generated: 1 }), _actions2.default.socket.list_sequences({ module: module, dir: 'results' }), _actions2.default.socket.list_directory({ module: module, dir: 'renders' })], function (percent, i, n) {\n console.log('pix2pixhd load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'pix2pixhd' }\n });\n }).then(function (res) {\n var _res2 = _slicedToArray(res, 4),\n folders = _res2[0],\n files = _res2[1],\n results = _res2[2],\n renders = _res2[3]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n console.log(files, results, renders);\n dispatch({\n type: _types2.default.pix2pixhd.load_results,\n results: {\n resultsFolder: folders[0],\n files: files,\n results: results,\n renders: renders\n }\n });\n });\n };\n};\n\nvar G_NET_REGEXP = new RegExp('_net_G.pth$');\n\nvar list_epochs = exports.list_epochs = function list_epochs(checkpoint_name) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _actions2.default.socket.list_directory({ module: module, dir: 'checkpoints/' + checkpoint_name }).then(function (files) {\n // console.log(files)\n var epochs = files.map(function (f) {\n if (!f.name.match(G_NET_REGEXP)) return null;\n return f.name.replace(G_NET_REGEXP, '');\n }).filter(function (f) {\n return !!f;\n });\n // console.log(epochs)\n dispatch({\n type: _types2.default.dataset.list_epochs,\n data: {\n epochs: epochs,\n module: module\n }\n });\n });\n };\n};\n\nvar count_dataset = exports.count_dataset = function count_dataset(checkpoint_name) {\n return function (dispatch) {\n var module = _pix2pixhd2.default.name;\n _util2.default.allProgress([_actions2.default.socket.count_directory({ module: module, dir: 'sequences/' + checkpoint_name + '/' }), _actions2.default.socket.count_directory({ module: module, dir: 'datasets/' + checkpoint_name + '/train_A/' })], function (percent, i, n) {\n console.log('pix2pixhd load progress', i, n);\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'pix2pixhd' }\n });\n }).then(function (res) {\n var _res3 = _slicedToArray(res, 2),\n sequenceCount = _res3[0],\n datasetCount = _res3[1]; //, datasets, results, output, datasetUsage, lossReport] = res\n\n\n console.log(sequenceCount, datasetCount);\n dispatch({\n type: _types2.default.pix2pixhd.load_dataset_count,\n data: {\n name: checkpoint_name,\n sequenceCount: sequenceCount,\n datasetCount: datasetCount\n }\n });\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar pix2pixhdModule = {\n name: 'pix2pixhd',\n displayName: 'Pix2PixHD',\n datatype: 'video'\n};\n\nexports.default = pix2pixhdModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar pix2pixhdInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folder_id: 0,\n data: null,\n results: null,\n checkpoint: {\n name: '',\n sequenceCount: 0,\n datasetCount: 0\n }\n};\n\nvar pix2pixhdReducer = function pix2pixhdReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : pix2pixhdInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'pix2pixhd') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.pix2pixhd.load_results:\n return _extends({}, state, {\n results: action.results\n });\n case _types2.default.pix2pixhd.load_dataset_count:\n return _extends({}, state, {\n checkpoint: action.data\n });\n case _types2.default.file.destroy:\n console.log('file destroy', state.results);\n return _extends({}, state, {\n results: _extends({}, state.results, {\n files: state.results.files.filter(function (f) {\n return f.id !== action.data.id;\n })\n })\n });\n default:\n return state;\n }\n};\n\nexports.default = pix2pixhdReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.clear_recursive_task = exports.augment_task = exports.live_task = exports.train_task = exports.fetch_task = undefined;\n\nvar _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; };\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _pix2pixhd = require('./pix2pixhd.module');\n\nvar _pix2pixhd2 = _interopRequireDefault(_pix2pixhd);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fetch_task = exports.fetch_task = function fetch_task(url, file_id, dataset) {\n return function (dispatch) {\n if (!url) return console.log('input file inaccessible (no url)');\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'fetch',\n dataset: dataset,\n opt: {\n url: url,\n file_id: file_id,\n dataset: dataset\n }\n };\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar train_task = exports.train_task = function train_task(dataset, folder_id) {\n var epochs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'train',\n dataset: dataset.name || dataset,\n epoch: 0,\n epochs: epochs,\n opt: {\n folder_id: folder_id\n }\n };\n if (!task.dataset) {\n console.error(\"train task: no dataset specified\");\n return;\n }\n console.log(task);\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar live_task = exports.live_task = function live_task(sequence, checkpoint, opt) {\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'live',\n dataset: sequence,\n checkpoint: checkpoint,\n opt: _extends({}, opt, {\n poll_delay: 0.01\n })\n };\n console.log(task);\n console.log('add live task');\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar augment_task = exports.augment_task = function augment_task(dataset, opt) {\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'augment',\n dataset: dataset,\n folder_id: opt.folder_id,\n opt: _extends({}, opt)\n };\n console.log(task);\n console.log('add augment task');\n return _actions2.default.queue.add_task(task);\n };\n};\n\nvar clear_recursive_task = exports.clear_recursive_task = function clear_recursive_task(dataset) {\n return function (dispatch) {\n var task = {\n module: _pix2pixhd2.default.name,\n activity: 'clear_recursive',\n dataset: dataset\n };\n console.log(task);\n console.log('add clear recursive task');\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _common = require('../../../common/');\n\nvar _player = require('../../../live/player');\n\nvar _live = require('../../../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../../../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _pix2pixhd = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixHDLive = function (_Component) {\n _inherits(Pix2PixHDLive, _Component);\n\n function Pix2PixHDLive(props) {\n _classCallCheck(this, Pix2PixHDLive);\n\n // if (! props.pix2pixhd || ! props.pix2pixhd.data) {\n var _this = _possibleConstructorReturn(this, (Pix2PixHDLive.__proto__ || Object.getPrototypeOf(Pix2PixHDLive)).call(this));\n\n props.actions.pix2pixhd.load_directories();\n // }\n props.actions.live.get_params();\n // props.actions.live.list_checkpoints('pix2pixhd')\n // props.actions.live.list_sequences('pix2pixhd')\n _this.changeCheckpoint = _this.changeCheckpoint.bind(_this);\n _this.changeEpoch = _this.changeEpoch.bind(_this);\n _this.changeSequence = _this.changeSequence.bind(_this);\n _this.seek = _this.seek.bind(_this);\n _this.togglePlaying = _this.togglePlaying.bind(_this);\n _this.toggleRecording = _this.toggleRecording.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(Pix2PixHDLive, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n document.addEventListener('keydown', this.handleKeydown);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.handleKeydown);\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n console.log('listing epochs');\n this.props.actions.live.list_epochs('pix2pixhd', nextProps.opt.checkpoint_name);\n }\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n console.log(e.keyCode);\n if (e.altKey || e.ctrlKey || e.metaKey) return;\n switch (e.keyCode) {\n case 27:\n // esc\n e.preventDefault();\n this.props.actions.live.set_fullscreen(!this.props.fullscreen);\n break;\n default:\n break;\n }\n }\n }, {\n key: 'changeCheckpoint',\n value: function changeCheckpoint(field, checkpoint_name) {\n this.props.actions.live.load_epoch(checkpoint_name, 'latest');\n }\n }, {\n key: 'changeEpoch',\n value: function changeEpoch(field, epoch_name) {\n this.props.actions.live.load_epoch(this.props.opt.checkpoint_name, epoch_name);\n }\n }, {\n key: 'changeSequence',\n value: function changeSequence(field, sequence) {\n console.log('load sequence', sequence);\n this.props.actions.live.load_sequence(sequence);\n }\n }, {\n key: 'seek',\n value: function seek(percentage) {\n var frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1);\n console.log(\"seek to frame\", percentage, frame);\n this.props.actions.live.seek(frame);\n }\n }, {\n key: 'start',\n value: function start() {\n console.log(this.props.opt);\n var sequence = this.props.opt.sequence_name || this.props.pix2pixhd.data.sequences[0].name;\n var checkpoint = this.props.opt.checkpoint_name || this.props.pix2pixhd.data.checkpoints[0].name;\n console.log('starting up!', sequence, checkpoint);\n this.props.actions.tasks.live_task(sequence, checkpoint, {\n folder_id: this.props.pix2pixhd.data.resultsFolder.id\n });\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'togglePlaying',\n value: function togglePlaying() {\n if (this.props.opt.processing) {\n this.props.actions.live.pause();\n } else {\n this.props.actions.live.play();\n }\n }\n }, {\n key: 'toggleRecording',\n value: function toggleRecording() {\n if (this.props.opt.recording) {\n (0, _player.stopRecording)();\n this.props.actions.live.pause();\n } else {\n (0, _player.startRecording)();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n // console.log(this.props)\n if (this.props.pix2pixhd.loading) {\n return (0, _preact.h)(_common.Loading, { progress: this.props.pix2pixhd.progress });\n }\n var _props$pix2pixhd$data = this.props.pix2pixhd.data,\n folderLookup = _props$pix2pixhd$data.folderLookup,\n datasetLookup = _props$pix2pixhd$data.datasetLookup,\n sequences = _props$pix2pixhd$data.sequences;\n\n\n var sequenceLookup = sequences.reduce(function (a, b) {\n a[b.name] = true;\n return a;\n }, {});\n\n var sequenceGroups = Object.keys(folderLookup).map(function (id) {\n var folder = _this2.props.pix2pixhd.data.folderLookup[id];\n if (folder.name === 'results') return;\n var datasets = folder.datasets.map(function (name) {\n var sequence = sequenceLookup[name];\n if (sequence) {\n return name;\n }\n return null;\n }).filter(function (n) {\n return !!n;\n });\n return {\n name: folder.name,\n options: datasets.sort()\n };\n }).filter(function (n) {\n return !!n && !!n.options.length;\n }).sort(function (a, b) {\n return a.name.localeCompare(b.name);\n });\n\n var checkpointGroups = Object.keys(folderLookup).map(function (id) {\n var folder = _this2.props.pix2pixhd.data.folderLookup[id];\n if (folder.name === 'results') return;\n var datasets = folder.datasets.map(function (name) {\n var dataset = datasetLookup[name];\n if (dataset.checkpoints.length) {\n return name;\n }\n return null;\n }).filter(function (n) {\n return !!n;\n });\n return {\n name: folder.name,\n options: datasets.sort()\n };\n }).filter(function (n) {\n return !!n && !!n.options.length;\n }).sort(function (a, b) {\n return a.name.localeCompare(b.name);\n });\n\n return (0, _preact.h)(\n 'div',\n { className: 'app live centered' },\n (0, _preact.h)(_common.Player, { width: 424, height: 256, fullscreen: this.props.fullscreen }),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Network',\n noToggle: true\n },\n (0, _preact.h)(_common.Select, { live: true,\n name: 'send_image',\n title: 'view mode',\n options: ['a', 'b', 'sequence', 'recursive'],\n onChange: this.props.actions.live.set_param\n }),\n (0, _preact.h)(_common.SelectGroup, { live: true,\n name: 'sequence_name',\n title: 'sequence',\n options: sequenceGroups,\n onChange: this.changeSequence\n }),\n (0, _preact.h)(_common.SelectGroup, { live: true,\n name: 'checkpoint_name',\n title: 'checkpoint',\n options: checkpointGroups,\n onChange: this.changeCheckpoint\n }),\n (0, _preact.h)(_common.Select, { live: true,\n name: 'epoch',\n title: 'epoch',\n options: this.props.epochs,\n onChange: this.changeEpoch\n })\n ),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Playback',\n name: 'sequence_playing'\n },\n (0, _preact.h)(_common.Slider, {\n name: 'position',\n min: 0.0, max: 1.0, type: 'float',\n value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1),\n onChange: this.seek\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n title: 'playback rate',\n name: 'sequence_step',\n min: -4.0, max: 4.0, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n title: 'skip frames',\n name: 'sequence_skip',\n min: 0, max: 1000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n title: 'fade sequence',\n name: 'fade_sequence',\n min: 0, max: 4.0, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'frame_delay',\n min: 0.0, max: 2.0, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n _common.Group,\n null,\n this.renderRestartButton(),\n this.renderLiveButtons(),\n this.renderRecordButton(),\n (0, _preact.h)(\n 'p',\n { 'class': 'last_message' },\n this.props.last_message\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transition',\n name: 'transition'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_period',\n min: 10, max: 5000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_min',\n min: 0.001, max: 0.2, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_max',\n min: 0.1, max: 1.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Recursion',\n name: 'recursive'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recursive_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll',\n min: -64, max: 64, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll_axis',\n min: 0, max: 1, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Sequence',\n name: 'sequence'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'sequence_frac',\n min: 0.0, max: 1.0, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'process_frac',\n min: 0, max: 1, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transform',\n name: 'transform'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'rotate',\n min: -1, max: 1, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'scale',\n min: 0.9, max: 1.1, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Clahe',\n name: 'clahe'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'clip_limit',\n min: 1.0, max: 4.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Posterize',\n name: 'posterize'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'spatial_window',\n min: 2, max: 128, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'color_window',\n min: 2, max: 128, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Blur',\n name: 'blur'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_radius',\n min: 3, max: 7, type: 'odd'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_sigma',\n min: 0, max: 2, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Canny Edge Detection',\n name: 'canny'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_lo',\n min: 10, max: 200, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_hi',\n min: 10, max: 200, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Hue / Saturation',\n name: 'hsl'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'hue',\n min: -127, max: 127, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'saturation',\n min: -255, max: 255, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'luminosity',\n min: -255, max: 255, type: 'int'\n })\n )\n )\n )\n );\n }\n }, {\n key: 'renderRestartButton',\n value: function renderRestartButton() {\n var _this3 = this;\n\n // console.log(this.props.runner.gpu)\n if (this.props.runner.gpu.status === 'IDLE') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Idle',\n onClick: function onClick() {\n return _this3.start();\n }\n },\n 'Start'\n );\n }\n if (this.props.runner.gpu.task.module !== 'pix2pixhd') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this3.interrupt();\n }\n },\n 'Interrupt'\n );\n }\n if (!this.props.opt.processing) {\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Not processing',\n onClick: this.togglePlaying\n },\n 'Restart'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this3.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Processing',\n onClick: this.togglePlaying\n },\n 'Stop'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this3.interrupt();\n }\n },\n 'Interrupt'\n )\n );\n }\n }, {\n key: 'renderRecordButton',\n value: function renderRecordButton() {\n return null;\n // return (\n // <Button\n // title={\n // this.props.opt.savingVideo\n // ? 'Saving video...'\n // : this.props.opt.recording\n // ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames/25) +')'\n // : 'Record video'\n // }\n // onClick={this.toggleRecording}\n // >\n // {this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'}\n // </Button>\n // )\n }\n }, {\n key: 'renderLiveButtons',\n value: function renderLiveButtons() {\n var _this4 = this;\n\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Save frame',\n onClick: _player.saveFrame\n },\n 'Save'\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Record video',\n name: 'store_b',\n noDim: true,\n onToggle: function onToggle(value) {\n // now storing frames on server...\n }\n },\n (0, _preact.h)(_common.TextInput, {\n title: 'Video name',\n name: 'final_tag',\n value: this.props.opt.final_tag,\n onSave: function onSave(value) {\n _this4.props.actions.live.set_param('final_tag', value);\n }\n })\n )\n );\n }\n }]);\n\n return Pix2PixHDLive;\n}(_preact.Component);\n\nfunction timeInSeconds(n) {\n return n.toFixed(1) + ' s.';\n}\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n last_message: state.live.last_message,\n fullscreen: state.live.fullscreen,\n opt: state.live.opt,\n frame: state.live.frame,\n checkpoints: state.live.checkpoints,\n epochs: state.live.epochs,\n sequences: state.live.sequences,\n runner: state.system.runner,\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n live: (0, _redux.bindActionCreators)(liveActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n pix2pixhd: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n tasks: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch), s: s\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDLive);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _common = require('../../../common');\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.module');\n\nvar _pix2pixhd3 = _interopRequireDefault(_pix2pixhd2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Pix2PixHDNew(props) {\n return (0, _preact.h)(_common.Views.New, {\n db: props.pix2pixhd,\n path: '/pix2pixhd/sequences/',\n actions: props.actions,\n module: _pix2pixhd3.default,\n history: props.history\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDNew);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _actions = require('../../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd2);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _fileList = require('../../../common/fileList.component');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar yes_count = 0;\n\nvar Pix2pixHDResults = function (_Component) {\n _inherits(Pix2pixHDResults, _Component);\n\n function Pix2pixHDResults(props) {\n _classCallCheck(this, Pix2pixHDResults);\n\n var _this = _possibleConstructorReturn(this, (Pix2pixHDResults.__proto__ || Object.getPrototypeOf(Pix2pixHDResults)).call(this));\n\n if (!props.pix2pixhd.results) props.actions.load_results();\n return _this;\n }\n\n _createClass(Pix2pixHDResults, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n yes_count = 0;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (!this.props.pix2pixhd.results) return (0, _preact.h)(_loading2.default, { progress: this.props.pix2pixhd.progress });\n\n var _props$pix2pixhd$resu = this.props.pix2pixhd.results,\n resultsFolder = _props$pix2pixhd$resu.resultsFolder,\n results = _props$pix2pixhd$resu.results,\n renders = _props$pix2pixhd$resu.renders,\n files = _props$pix2pixhd$resu.files;\n // console.log(resultsFolder, results)\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pixhd' },\n (0, _preact.h)(\n 'div',\n { className: 'heading row middle' },\n (0, _preact.h)(\n 'h1',\n null,\n 'Pix2PixHD Results'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'rows params renders' },\n (0, _preact.h)(_fileList.FileList, {\n linkFiles: true,\n files: files,\n orderBy: 'date desc',\n fields: 'name date size delete',\n onDelete: function onDelete(file) {\n var yes = void 0;\n if (yes_count < 3) {\n yes = confirm('Are you sure you want to delete this file?');\n } else {\n yes = true;\n }\n if (yes) {\n yes_count += 1;\n console.log('delete: confirmed');\n _actions2.default.file.destroy(file);\n }\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'h3',\n null,\n 'renders on server'\n ),\n (0, _preact.h)(_fileList.FileList, {\n files: renders,\n orderBy: 'date desc',\n fields: 'name date size',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a result', file);\n _this2.handlePick(file);\n }\n }),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n 'h3',\n null,\n 'folders on server'\n ),\n (0, _preact.h)(_fileList.FileList, {\n files: results,\n orderBy: 'date desc',\n fields: 'name date count',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a result', file);\n _this2.handlePick(file);\n }\n })\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n // this.props.audioPlayer.play(file)\n }\n }]);\n\n return Pix2pixHDResults;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch)\n // audioPlayer: bindActionCreators(audioPlayerActions, dispatch),\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2pixHDResults);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2pixhd3 = require('../pix2pixhd.module');\n\nvar _pix2pixhd4 = _interopRequireDefault(_pix2pixhd3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixHDShow = function (_Component) {\n _inherits(Pix2PixHDShow, _Component);\n\n function Pix2PixHDShow(props) {\n _classCallCheck(this, Pix2PixHDShow);\n\n var _this = _possibleConstructorReturn(this, (Pix2PixHDShow.__proto__ || Object.getPrototypeOf(Pix2PixHDShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(Pix2PixHDShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2pixhd.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2pixhd = _props.pix2pixhd,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2pixhd.last_id', id);\n if (!pix2pixhd.folder || pix2pixhd.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2pixhd/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n pix2pixhd = _props2.pix2pixhd,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = pix2pixhd.data || {},\n folderLookup = _ref.folderLookup;\n\n var folder = (folderLookup || {})[pix2pixhd.folder_id] || {};\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pixhd' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'div',\n { 'class': 'spaced' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_common.Loading, null)\n ),\n (0, _preact.h)(_upload2.default, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n folder && folder.name && folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, {\n title: 'Add Files',\n module: _pix2pixhd4.default,\n folder: folder,\n canUpload: true, canAddURL: true\n }),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_upload2.default, null),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(_dataset6.default, {\n loading: pix2pixhd.loading,\n progress: pix2pixhd.progress,\n id: pix2pixhd.folder_id,\n module: _pix2pixhd4.default,\n data: pix2pixhd.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n pix2pixhd = _props3.pix2pixhd,\n remote = _props3.remote;\n\n var input = pix2pixhd.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 5);\n } },\n '5x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 10);\n } },\n '10x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 20);\n } },\n '20x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2pixhd.folder_id, 50);\n } },\n '50x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'rm'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }]);\n\n return Pix2PixHDShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2pixhd = require('../pix2pixhd.actions');\n\nvar pix2pixhdActions = _interopRequireWildcard(_pix2pixhd);\n\nvar _pix2pixhd2 = require('../pix2pixhd.tasks');\n\nvar pix2pixhdTasks = _interopRequireWildcard(_pix2pixhd2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2pixhd3 = require('../pix2pixhd.module');\n\nvar _pix2pixhd4 = _interopRequireDefault(_pix2pixhd3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2PixHDTrain = function (_Component) {\n _inherits(Pix2PixHDTrain, _Component);\n\n function Pix2PixHDTrain(props) {\n _classCallCheck(this, Pix2PixHDTrain);\n\n var _this = _possibleConstructorReturn(this, (Pix2PixHDTrain.__proto__ || Object.getPrototypeOf(Pix2PixHDTrain)).call(this, props));\n\n _this.handleChange = _this.handleChange.bind(_this);\n _this.state = {\n checkpoint_name: 'PLACEHOLDER',\n epoch: 'latest',\n augment_name: '',\n augment_take: 100,\n augment_make: 20\n };\n return _this;\n }\n\n _createClass(Pix2PixHDTrain, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2pixhd.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2pixhd = _props.pix2pixhd,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2pixhd.last_id', id);\n if (!pix2pixhd.folder || pix2pixhd.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2pixhd/new/');\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n if (prevState.checkpoint_name !== this.state.checkpoint_name) {\n this.setState({ epoch: 'latest' });\n this.props.actions.list_epochs(this.state.checkpoint_name);\n this.props.actions.count_dataset(this.state.checkpoint_name);\n }\n }\n }, {\n key: 'handleChange',\n value: function handleChange(name, value) {\n console.log('name', name, 'value', value);\n this.setState(_defineProperty({}, name, value));\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (this.props.pix2pixhd.loading) {\n return (0, _preact.h)(_common.Loading, { progress: this.props.pix2pixhd.progress });\n }\n var _props2 = this.props,\n pix2pixhd = _props2.pix2pixhd,\n match = _props2.match,\n history = _props2.history,\n queue = _props2.queue;\n\n var _ref = pix2pixhd.data || {},\n folderLookup = _ref.folderLookup,\n datasetLookup = _ref.datasetLookup;\n\n var folder = (folderLookup || {})[pix2pixhd.folder_id] || {};\n // console.log(pix2pixhd)\n\n var checkpointGroups = Object.keys(folderLookup).map(function (id) {\n var folder = _this2.props.pix2pixhd.data.folderLookup[id];\n if (folder.name === 'results') return;\n var datasets = folder.datasets.map(function (name) {\n var dataset = datasetLookup[name];\n if (dataset.checkpoints.length) {\n return name;\n }\n return null;\n }).filter(function (n) {\n return !!n;\n });\n return {\n name: folder.name,\n options: datasets.sort()\n };\n }).filter(function (n) {\n return !!n && !!n.options.length;\n }).sort(function (a, b) {\n return a.name.localeCompare(b.name);\n });\n\n // console.log('state', this.props.pix2pixhd.data.epochs)\n // console.log(this.state.checkpoint_name, this.state.epoch)\n // console.log(queue)\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2pixhd' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n 'pix2pixhd training'\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'columns' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Dataset' },\n (0, _preact.h)(_common.SelectGroup, {\n name: 'checkpoint_name',\n title: 'Dataset',\n options: checkpointGroups,\n onChange: this.handleChange,\n placeholder: 'Pick a dataset',\n value: this.state.checkpoint_name\n }),\n (0, _preact.h)(_common.Select, {\n title: 'Epoch',\n name: 'epoch',\n options: this.props.pix2pixhd.data.epochs,\n onChange: this.handleChange,\n value: this.state.epoch\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Augment' },\n (0, _preact.h)(_common.NumberInput, {\n name: 'augment_take',\n title: 'Pick N random frames',\n value: this.state.augment_take,\n onChange: this.handleChange,\n type: 'int',\n min: '1',\n max: '1000'\n }),\n (0, _preact.h)(_common.NumberInput, {\n name: 'augment_make',\n title: 'Generate N recursively',\n value: this.state.augment_make,\n onChange: this.handleChange,\n type: 'int',\n min: '1',\n max: '1000'\n }),\n (0, _preact.h)(_common.Button, {\n title: 'Augment dataset',\n value: 'Augment',\n onClick: function onClick() {\n return _this2.props.remote.augment_task(_this2.state.checkpoint_name, _this2.state);\n }\n }),\n (0, _preact.h)(_common.Button, {\n title: 'Make a movie without augmenting',\n value: 'Generate',\n onClick: function onClick() {\n _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, {\n no_symlinks: true,\n mov: true,\n folder_id: _this2.props.pix2pixhd.data.resultsFolder.id\n }));\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Augmentation Grid' },\n (0, _preact.h)(_common.AugmentationGrid, {\n checkpoint: this.props.pix2pixhd.checkpoint,\n take: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200, 300, 400, 500, 1000],\n make: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200],\n onAugment: function onAugment(augment_take, augment_make) {\n _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, {\n augment_take: augment_take,\n augment_make: augment_make\n }));\n },\n onTrain: function onTrain() {\n _this2.props.remote.train_task(_this2.state.checkpoint_name, pix2pixhd.folder_id, 1);\n setTimeout(function () {\n // auto-generate epoch demo\n _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, {\n augment_take: 10,\n augment_make: 150,\n no_symlinks: true,\n mov: true,\n folder_id: _this2.props.pix2pixhd.data.resultsFolder.id\n }));\n }, 250);\n }\n })\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Status' },\n (0, _preact.h)(_common.Button, {\n title: 'GPU',\n value: this.props.runner.gpu.status === 'IDLE' ? \"Idle\" : \"Interrupt\",\n onClick: function onClick() {\n return _this2.interrupt();\n }\n }),\n (0, _preact.h)(_common.CurrentTask, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Upcoming Tasks' },\n (0, _preact.h)(_common.TaskList, { tasks: queue.queue.map(function (id) {\n return queue.tasks[id];\n }), sort: 'date asc' })\n )\n )\n )\n );\n }\n }]);\n\n return Pix2PixHDTrain;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2pixhd: state.module.pix2pixhd,\n runner: state.system.runner,\n queue: state.queue\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2pixhdActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2pixhdTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2PixHDTrain);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('./views/pix2wav.new');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nvar _pix2wav3 = require('./views/pix2wav.show');\n\nvar _pix2wav4 = _interopRequireDefault(_pix2wav3);\n\nvar _pix2wav5 = require('./views/pix2wav.live');\n\nvar _pix2wav6 = _interopRequireDefault(_pix2wav5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('pix2wav');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #bdf, #def)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('pix2wav');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #bdf, #def)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/new/', component: _pix2wav2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/datasets/', component: _pix2wav4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/datasets/:id/', component: _pix2wav4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/pix2wav/live/', component: _pix2wav6.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/pix2wav/new/', name: 'new' }, { url: '/pix2wav/datasets/', name: 'datasets' }, { url: '/pix2wav/live/', name: 'live' }];\n}\n\nexports.default = {\n name: 'pix2wav',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('./pix2wav.module');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _pix2wav2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'sequences/pix2wav/' }), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'datasets/pix2wav/' }), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'checkpoints/pix2wav/' }), _actions2.default.socket.list_directory({ module: 'pix2pix', dir: 'checkpoints/pix2pix/' })], function (percent, i, n) {\n console.log('progress', i, n);\n dispatch({ type: _types2.default.app.load_progress, progress: { i: i, n: n } });\n }).then(function (res) {\n var _res = _slicedToArray(res, 5),\n datasetApiReport = _res[0],\n sequences = _res[1],\n datasets = _res[2],\n checkpoints = _res[3],\n pix2pixCheckpoints = _res[4];\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder;\n\n\n var sequenceDirectories = sequences.filter(function (s) {\n return s.dir;\n });\n sequenceDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.isBuilt = true;\n });\n\n datasets.filter(function (s) {\n return s.dir;\n }).forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasDataset = true;\n });\n\n var checkpointDirectories = checkpoints.filter(function (s) {\n return s.dir;\n });\n checkpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dir.module = 'pix2wav';\n });\n\n var pix2pixCheckpointDirectories = pix2pixCheckpoints.filter(function (s) {\n return s.dir;\n });\n pix2pixCheckpointDirectories.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name);\n dataset.hasCheckpoints = true;\n dir.module = 'pix2pix';\n });\n\n console.log(res);\n console.log(checkpointDirectories);\n console.log(pix2pixCheckpointDirectories);\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n sequences: sequenceDirectories,\n datasets: datasets,\n checkpoints: checkpointDirectories.concat(pix2pixCheckpointDirectories)\n }\n });\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n console.log('folder id', id);\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar pix2wavModule = {\n name: 'pix2wav',\n displayName: 'Pix2Wav',\n datatype: 'spectrogram'\n};\n\nexports.default = pix2wavModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar pix2wavInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n status: '',\n error: null,\n folder_id: 0,\n data: null\n};\n\nvar pix2wavReducer = function pix2wavReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : pix2wavInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'pix2wav') {\n state = (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.wav2pix.load:\n return _extends({}, state, {\n status: 'Loaded buffer'\n });\n case _types2.default.wav2pix.progress:\n return _extends({}, state, {\n status: 'Rendering frame ' + action.count\n });\n case _types2.default.wav2pix.finish:\n return _extends({}, state, {\n status: action.message || 'Render complete'\n });\n case _types2.default.wav2pix.zip:\n return _extends({}, state, {\n status: 'Built zip file ' + _util2.default.hush_size(state.size)[1]\n });\n case _types2.default.wav2pix.uploading:\n return _extends({}, state, {\n status: 'Uploading zip file'\n });\n default:\n return state;\n }\n};\n\nexports.default = pix2wavReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.live_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar live_task = exports.live_task = function live_task(sequence, checkpoint) {\n return function (dispatch) {\n var task = {\n module: 'pix2wav',\n activity: 'live',\n dataset: sequence,\n checkpoint: checkpoint,\n opt: {\n poll_delay: 0.2\n }\n };\n console.log(task);\n console.log('add live task');\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _common = require('../../../common/');\n\nvar _player = require('../../../live/player');\n\nvar playerActions = _interopRequireWildcard(_player);\n\nvar _live = require('../../../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../../../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nvar _pix2wav = require('../pix2wav.tasks');\n\nvar pix2wavTasks = _interopRequireWildcard(_pix2wav);\n\nvar _pix2wav2 = require('../pix2wav.actions');\n\nvar pix2wavActions = _interopRequireWildcard(_pix2wav2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2WavLive = function (_Component) {\n _inherits(Pix2WavLive, _Component);\n\n function Pix2WavLive(props) {\n _classCallCheck(this, Pix2WavLive);\n\n var _this = _possibleConstructorReturn(this, (Pix2WavLive.__proto__ || Object.getPrototypeOf(Pix2WavLive)).call(this));\n\n props.actions.pix2wav.load_directories();\n props.actions.live.get_params();\n _this.changeCheckpoint = _this.changeCheckpoint.bind(_this);\n _this.changeEpoch = _this.changeEpoch.bind(_this);\n _this.changeSequence = _this.changeSequence.bind(_this);\n _this.seek = _this.seek.bind(_this);\n _this.togglePlaying = _this.togglePlaying.bind(_this);\n _this.toggleRecording = _this.toggleRecording.bind(_this);\n return _this;\n }\n\n _createClass(Pix2WavLive, [{\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {\n console.log('fetch checkpoint', nextProps.opt.checkpoint_name);\n this.props.actions.live.list_epochs('pix2wav', nextProps.opt.checkpoint_name);\n }\n }\n }, {\n key: 'changeCheckpoint',\n value: function changeCheckpoint(field, checkpoint_name) {\n this.props.actions.live.load_epoch(checkpoint_name, 'latest');\n }\n }, {\n key: 'changeEpoch',\n value: function changeEpoch(field, epoch_name) {\n this.props.actions.live.load_epoch(this.props.opt.checkpoint_name, epoch_name);\n }\n }, {\n key: 'changeSequence',\n value: function changeSequence(field, sequence) {\n console.log('got sequence', sequence);\n this.props.actions.live.load_sequence(sequence);\n }\n }, {\n key: 'seek',\n value: function seek(percentage) {\n var frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1);\n this.props.actions.live.seek(frame);\n }\n }, {\n key: 'start',\n value: function start() {\n // console.log(this.props)\n console.log(this.props.pix2wav.data);\n var sequence = this.props.pix2wav.data.sequences[0].name || '';\n var checkpoint = this.props.pix2wav.data.checkpoints[0].name || '';\n console.log('starting up!', sequence, checkpoint);\n this.props.actions.tasks.live_task(sequence, checkpoint);\n }\n }, {\n key: 'interrupt',\n value: function interrupt() {\n this.props.actions.queue.stop_task('gpu');\n }\n }, {\n key: 'exit',\n value: function exit() {\n this.props.actions.queue.stop_task('gpu', { sigkill: true });\n }\n }, {\n key: 'togglePlaying',\n value: function togglePlaying() {\n if (this.props.opt.processing) {\n this.props.actions.live.pause();\n } else {\n this.props.actions.live.play();\n }\n }\n }, {\n key: 'toggleRecording',\n value: function toggleRecording() {\n if (this.props.opt.recording) {\n (0, _player.stopRecording)();\n this.props.actions.live.pause();\n } else {\n (0, _player.startRecording)();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n // console.log(this.props)\n if (this.props.pix2wav.loading) {\n return (0, _preact.h)(_common.Loading, null);\n }\n // console.log('sequence', this.props.opt)\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2wav centered' },\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(_common.Player, { width: 256, height: 256 })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'params column audioParams' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Audio playback' },\n (0, _preact.h)(\n _common.Button,\n { title: 'Start playback',\n onClick: function onClick() {\n return playerActions.startSynthesizing();\n }\n },\n 'Start'\n ),\n (0, _preact.h)(\n _common.Button,\n { title: 'Stop playback',\n onClick: function onClick() {\n return playerActions.stopSynthesizing();\n }\n },\n 'Stop'\n )\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'params row' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Playback',\n noToggle: true\n },\n (0, _preact.h)(_common.Select, {\n name: 'send_image',\n title: 'view mode',\n options: ['a', 'b', 'sequence', 'recursive'],\n onChange: this.props.actions.live.set_param\n }),\n (0, _preact.h)(_common.Select, {\n name: 'sequence_name',\n title: 'sequence',\n options: this.props.pix2wav.data.sequences,\n onChange: this.changeSequence\n }),\n (0, _preact.h)(_common.Select, {\n name: 'output_format',\n title: 'format',\n options: ['JPEG', 'PNG']\n }),\n (0, _preact.h)(_common.Select, {\n name: 'checkpoint_name',\n title: 'checkpoint',\n options: this.props.pix2wav.data.checkpoints,\n onChange: this.changeCheckpoint\n }),\n (0, _preact.h)(_common.Select, {\n name: 'epoch',\n title: 'epoch',\n options: this.props.epochs,\n onChange: this.changeEpoch\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'position',\n min: 0.0, max: 1.0, type: 'float',\n value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1),\n onChange: this.seek\n }),\n this.renderRestartButton(),\n (0, _preact.h)(\n _common.Button,\n {\n title: this.props.opt.savingVideo ? 'Saving video...' : this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames) + ')' : 'Record video',\n onClick: this.toggleRecording\n },\n this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Save frame',\n onClick: _player.saveFrame\n },\n 'Save'\n ),\n (0, _preact.h)(\n 'p',\n { 'class': 'last_message' },\n this.props.last_message\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Transition',\n name: 'transition'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_period',\n min: 10, max: 5000, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_min',\n min: 0.001, max: 0.2, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'transition_max',\n min: 0.1, max: 1.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Recursion',\n name: 'recursive'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recursive_frac',\n min: 0.0, max: 0.5, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll',\n min: -64, max: 64, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'recurse_roll_axis',\n min: 0, max: 1, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Sequence',\n name: 'sequence'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'sequence_frac',\n min: 0.0, max: 1, type: 'float'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'process_frac',\n min: 0, max: 1, type: 'float'\n })\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Clahe',\n name: 'clahe'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'clip_limit',\n min: 1.0, max: 4.0, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Posterize',\n name: 'posterize'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'spatial_window',\n min: 2, max: 128, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'color_window',\n min: 2, max: 128, type: 'int'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Blur',\n name: 'blur'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_radius',\n min: 3, max: 7, type: 'odd'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'blur_sigma',\n min: 0, max: 2, type: 'float'\n })\n ),\n (0, _preact.h)(\n _common.ParamGroup,\n {\n title: 'Canny Edge Detection',\n name: 'canny'\n },\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_lo',\n min: 10, max: 200, type: 'int'\n }),\n (0, _preact.h)(_common.Slider, { live: true,\n name: 'canny_hi',\n min: 10, max: 200, type: 'int'\n })\n )\n )\n )\n );\n }\n }, {\n key: 'renderRestartButton',\n value: function renderRestartButton() {\n var _this2 = this;\n\n if (this.props.runner.gpu.status === 'IDLE') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Idle',\n onClick: function onClick() {\n return _this2.start();\n }\n },\n 'Start'\n );\n }\n if (this.props.runner.gpu.task.module !== 'pix2pix' && this.props.runner.gpu.task.module !== 'pix2wav') {\n return (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n );\n }\n if (!this.props.opt.processing) {\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Not processing',\n onClick: this.togglePlaying\n },\n 'Restart'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Last resort',\n onClick: function onClick() {\n return _this2.exit();\n }\n },\n 'Exit'\n )\n );\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Processing',\n onClick: this.togglePlaying\n },\n 'Pause'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'GPU Busy',\n onClick: function onClick() {\n return _this2.interrupt();\n }\n },\n 'Interrupt'\n ),\n (0, _preact.h)(\n _common.Button,\n {\n title: 'Last resort',\n onClick: function onClick() {\n return _this2.exit();\n }\n },\n 'Exit'\n )\n );\n }\n }]);\n\n return Pix2WavLive;\n}(_preact.Component);\n\nfunction timeInSeconds(n) {\n return (n / 10).toFixed(1) + ' s.';\n}\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n last_message: state.live.last_message,\n opt: state.live.opt,\n frame: state.live.frame,\n checkpoints: state.live.checkpoints,\n epochs: state.live.epochs,\n sequences: state.live.sequences,\n runner: state.system.runner,\n pix2wav: state.module.pix2wav\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n live: (0, _redux.bindActionCreators)(liveActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n pix2wav: (0, _redux.bindActionCreators)(pix2wavActions, dispatch),\n tasks: (0, _redux.bindActionCreators)(pix2wavTasks, dispatch), s: s\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2WavLive);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Pix2WavNew;\n\nvar _preact = require('preact');\n\nvar _dataset = require('../../../dataset/dataset.new');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _pix2wav = require('../pix2wav.module');\n\nvar _pix2wav2 = _interopRequireDefault(_pix2wav);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Pix2WavNew(_ref) {\n var history = _ref.history;\n\n return (0, _preact.h)(\n 'div',\n { 'class': 'app pix2wav' },\n (0, _preact.h)(_dataset2.default, { module: _pix2wav2.default, history: history })\n );\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('../pix2wav.actions');\n\nvar pix2wavActions = _interopRequireWildcard(_pix2wav);\n\nvar _pix2wav2 = require('../pix2wav.tasks');\n\nvar pix2wavTasks = _interopRequireWildcard(_pix2wav2);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _dataset3 = require('../../../dataset/dataset.new');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _fileList = require('../../../common/fileList.component');\n\nvar _spectrogram = require('./spectrogram.upload');\n\nvar _spectrogram2 = _interopRequireDefault(_spectrogram);\n\nvar _dataset5 = require('../../../dataset/dataset.component');\n\nvar _dataset6 = _interopRequireDefault(_dataset5);\n\nvar _pix2wav3 = require('../pix2wav.module');\n\nvar _pix2wav4 = _interopRequireDefault(_pix2wav3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Pix2wavShow = function (_Component) {\n _inherits(Pix2wavShow, _Component);\n\n function Pix2wavShow(props) {\n _classCallCheck(this, Pix2wavShow);\n\n var _this = _possibleConstructorReturn(this, (Pix2wavShow.__proto__ || Object.getPrototypeOf(Pix2wavShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(Pix2wavShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('pix2wav.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n pix2wav = _props.pix2wav,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('pix2wav.last_id', id);\n if (!pix2wav.folder || pix2wav.folder.id !== id) {\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/pix2wav/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n pix2wav = _props2.pix2wav,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = pix2wav.data || {},\n folderLookup = _ref.folderLookup;\n\n var folder = (folderLookup || {})[pix2wav.folder_id] || {};\n\n return (0, _preact.h)(\n 'div',\n { className: 'app pix2wav' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'div',\n { 'class': 'spaced' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_loading2.default, null)\n ),\n (0, _preact.h)(_upload2.default, null)\n )\n ),\n (0, _preact.h)(_spectrogram2.default, {\n loading: pix2wav.loading,\n progress: pix2wav.progress,\n id: pix2wav.folder_id,\n module: _pix2wav4.default,\n data: pix2wav.data,\n folder: folder\n }),\n (0, _preact.h)(_dataset6.default, {\n loading: pix2wav.loading,\n progress: pix2wav.progress,\n id: pix2wav.folder_id,\n module: _pix2wav4.default,\n data: pix2wav.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n pix2wav = _props3.pix2wav,\n remote = _props3.remote;\n\n var input = pix2wav.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 2);\n } },\n '2x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 4);\n } },\n '4x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 6);\n } },\n '6x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, pix2wav.folder_id, 18);\n } },\n '18x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'rm'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }]);\n\n return Pix2wavShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2wav: state.module.pix2wav\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(pix2wavActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2wavTasks, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Pix2wavShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _pix2wav = require('../pix2wav.actions');\n\nvar pix2wavActions = _interopRequireWildcard(_pix2wav);\n\nvar _pix2wav2 = require('../pix2wav.tasks');\n\nvar pix2wavTasks = _interopRequireWildcard(_pix2wav2);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.actions');\n\nvar datasetActions = _interopRequireWildcard(_dataset);\n\nvar _wav2pix = require('../../../audio/wav2pix');\n\nvar wav2pixActions = _interopRequireWildcard(_wav2pix);\n\nvar _pix2wav3 = require('../../../audio/pix2wav');\n\nvar pix2wavPlayer = _interopRequireWildcard(_pix2wav3);\n\nvar _pix2wav4 = require('../pix2wav.module');\n\nvar _pix2wav5 = _interopRequireDefault(_pix2wav4);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar date_stamp = function date_stamp() {\n return (0, _moment2.default)().format(\"_YYYYMMDD_HHmm\");\n};\n\nvar SpectrogramUpload = function (_Component) {\n _inherits(SpectrogramUpload, _Component);\n\n function SpectrogramUpload(props) {\n _classCallCheck(this, SpectrogramUpload);\n\n var _this = _possibleConstructorReturn(this, (SpectrogramUpload.__proto__ || Object.getPrototypeOf(SpectrogramUpload)).call(this, props));\n\n _this.state = {\n file: null,\n pcm: null,\n name: \"\",\n datasetName: \"\",\n frames: [],\n frame_start: 0,\n max: 1000,\n preview_count: 8 * 4,\n frame_step: wav2pixActions.FRAME_STEP\n };\n var audioElement = document.createElement('audio');\n audioElement.addEventListener('loadedmetadata', function () {\n var duration = audioElement.duration;\n var total_frame_count = Math.floor((duration * 44100 - wav2pixActions.FRAME_LENGTH) / _this.state.frame_step);\n _this.setState({\n duration: duration,\n max: Math.min(_this.state.max, total_frame_count, 1000)\n });\n });\n _this.audioElement = audioElement;\n return _this;\n }\n\n _createClass(SpectrogramUpload, [{\n key: 'pickFile',\n value: function pickFile(file) {\n var _this2 = this;\n\n var name = file.name.split('.')[0].replace(/\\s+/g, '_').replace(/-/g, '_').replace(/_+/g, '_');\n this.setState({\n file: file,\n name: name + date_stamp(),\n datasetName: name,\n pcm: ''\n }, function () {\n _this2.rebuildFrames();\n });\n this.audioElement.src = URL.createObjectURL(file);\n }\n }, {\n key: 'rebuildFrames',\n value: function rebuildFrames() {\n var _this3 = this;\n\n var _state = this.state,\n file = _state.file,\n pcm = _state.pcm,\n frame_step = _state.frame_step,\n frame_start = _state.frame_start,\n preview_count = _state.preview_count;\n\n this.props.wav2pix.renderFrames(pcm || file, { frame_start: frame_start, frame_step: frame_step, max: preview_count }).then(function (data) {\n console.log('got frames', data.frames.length);\n _this3.setState(_extends({}, _this3.state, {\n frames: data.frames,\n pcm: data.pcm\n }));\n });\n }\n }, {\n key: 'buildZip',\n value: function buildZip() {\n var _this4 = this;\n\n var _state2 = this.state,\n pcm = _state2.pcm,\n file = _state2.file,\n max = _state2.max,\n frame_step = _state2.frame_step,\n frame_start = _state2.frame_start;\n\n this.props.wav2pix.buildZip(this.state.name, pcm || file, { frame_start: frame_start, frame_step: frame_step, max: max }).then(function (_ref) {\n var zip = _ref.zip,\n filename = _ref.filename,\n count = _ref.count;\n\n _this4.props.datasetActions.uploadFile(_this4.props.module, _this4.props.folder, zip, filename, { count: count, max: max, frame_step: frame_step, frame_size: wav2pixActions.FRAME_LENGTH / 44100 });\n });\n }\n }, {\n key: 'playFrame',\n value: function playFrame(i) {\n var _this5 = this;\n\n return function () {\n var frame = _this5.state.frames[i];\n pix2wavPlayer.play(frame);\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _this6 = this;\n\n // loading={pix2wav.loading}\n // progress={pix2wav.progress}\n // id={pix2wav.folder_id}\n // module={pix2wavModule}\n // data={pix2wav.data}\n // folder={folder}\n var _state3 = this.state,\n file = _state3.file,\n frames = _state3.frames,\n preview_count = _state3.preview_count;\n\n var canvases = [];\n for (var i = 0, _len = preview_count; i < _len; i++) {\n canvases.push((0, _preact.h)('canvas', { key: i, onClick: this.playFrame(i) }));\n }\n return (0, _preact.h)(\n 'div',\n { className: 'row' },\n (0, _preact.h)(\n 'div',\n { className: 'col spectrogramBuilder' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Spectrogram Builder' },\n (0, _preact.h)(\n 'p',\n null,\n \"Convert your sounds into spectrograms. \",\n \"Sound files can be WAV, MP3, AIFF, or FLAC. \"\n ),\n (0, _preact.h)(_common.FileUpload, {\n title: 'Choose a sound file',\n accept: 'audio/*',\n onUpload: function onUpload(file) {\n return _this6.pickFile(file);\n }\n }),\n file && this.renderMetadata(file)\n )\n ),\n (0, _preact.h)(\n 'div',\n { ref: function ref(c) {\n _this6.canvases = c;\n }, className: 'thumbs', id: 'pix2wav_canvases' },\n canvases\n )\n );\n }\n }, {\n key: 'renderMetadata',\n value: function renderMetadata(file) {\n var _this7 = this;\n\n var _state4 = this.state,\n duration = _state4.duration,\n preview_count = _state4.preview_count;\n\n var size = _util2.default.hush_size(file.size);\n var total_frame_count = Math.floor((duration * 44100 - wav2pixActions.FRAME_LENGTH) / this.state.frame_step);\n var frame_size = Math.round(wav2pixActions.FRAME_LENGTH / 44100 * 1000) + ' ms.';\n var frame_step = Math.round(this.state.frame_step / 44100 * 1000) + ' ms.';\n return (0, _preact.h)(\n 'div',\n { className: 'fileMetadata' },\n (0, _preact.h)(\n _common.Group,\n { title: 'Metadata' },\n (0, _preact.h)(\n _common.Param,\n { title: 'Name' },\n file.name\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Type' },\n file.type\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Size' },\n (0, _preact.h)(\n 'span',\n { className: size[0] },\n size[1]\n )\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Date' },\n (0, _moment2.default)(file.lastModifiedDate).format(\"YYYY-MM-DD h:mm a\")\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Duration' },\n Math.floor(duration) + ' s.'\n ),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n _common.Param,\n { title: 'Frames' },\n total_frame_count\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Frame Size' },\n frame_size\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'Frame Step' },\n frame_step\n ),\n (0, _preact.h)(\n _common.Param,\n { title: 'FFT Size' },\n wav2pixActions.spectrum.fft_size\n ),\n (0, _preact.h)('br', null),\n (0, _preact.h)(\n _common.Param,\n { title: 'Status' },\n this.props.pix2wav.status\n ),\n (0, _preact.h)('br', null)\n ),\n (0, _preact.h)(\n _common.Group,\n { title: 'Data settings' },\n (0, _preact.h)(_common.TextInput, {\n title: 'Dataset name',\n onChange: function onChange(e) {\n return _this7.setState({ name: e.target.value });\n },\n value: this.state.name\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'Starting Frame',\n min: 0, max: 1, type: 'float',\n value: this.state.frame_start,\n defaultValue: 0,\n onChange: function onChange(frame_start) {\n _this7.setState({\n frame_start: frame_start\n }, function () {\n _this7.rebuildFrames();\n });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'No. Frames',\n min: 10, max: Math.min(total_frame_count, 1000), type: 'int',\n value: this.state.max,\n defaultValue: Math.min(total_frame_count, 300),\n onChange: function onChange(max) {\n return _this7.setState({ max: max });\n }\n }),\n (0, _preact.h)(_common.Slider, {\n name: 'Frame step',\n min: 10, max: 20000, type: 'int',\n value: this.state.frame_step,\n defaultValue: wav2pixActions.FRAME_STEP,\n onChange: function onChange(frame_step) {\n var total_frame_count = Math.floor((duration * 44100 - wav2pixActions.FRAME_LENGTH) / frame_step);\n _this7.setState({\n name: _this7.state.datasetName + '_step_' + frame_step + date_stamp(),\n frame_step: frame_step,\n max: Math.min(_this7.state.max, total_frame_count)\n }, function () {\n _this7.rebuildFrames();\n });\n }\n }),\n (0, _preact.h)(\n _common.Button,\n {\n onClick: function onClick() {\n return _this7.buildZip();\n }\n },\n 'Upload Frames'\n )\n ),\n (0, _preact.h)(_common.Progress, null)\n );\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n var _this8 = this;\n\n (this.state.frames || []).map(function (frame, i) {\n var canvas = _this8.canvases.children[i];\n var ctx = canvas.getContext('2d-lodpi');\n canvas.width = frame.canvas.width;\n canvas.height = frame.canvas.height;\n ctx.drawImage(frame.canvas, 0, 0);\n });\n }\n }]);\n\n return SpectrogramUpload;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n pix2wav: state.module.pix2wav,\n upload: state.upload\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n datasetActions: (0, _redux.bindActionCreators)(datasetActions, dispatch),\n actions: (0, _redux.bindActionCreators)(pix2wavActions, dispatch),\n remote: (0, _redux.bindActionCreators)(pix2wavTasks, dispatch),\n wav2pix: (0, _redux.bindActionCreators)(wav2pixActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SpectrogramUpload);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('./views/samplernn.new');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nvar _samplernn3 = require('./views/samplernn.show');\n\nvar _samplernn4 = _interopRequireDefault(_samplernn3);\n\nvar _samplernn5 = require('./views/samplernn.import');\n\nvar _samplernn6 = _interopRequireDefault(_samplernn5);\n\nvar _samplernn7 = require('./views/samplernn.results');\n\nvar _samplernn8 = _interopRequireDefault(_samplernn7);\n\nvar _samplernn9 = require('./views/samplernn.graph');\n\nvar _samplernn10 = _interopRequireDefault(_samplernn9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar router = function () {\n function router() {\n _classCallCheck(this, router);\n }\n\n _createClass(router, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n _actions2.default.system.changeTool('samplernn');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #eef, #fef)';\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n _actions2.default.system.changeTool('samplernn');\n document.body.style.backgroundImage = 'linear-gradient(' + (_util2.default.randint(40) + 40) + 'deg, #eef, #fef)';\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'section',\n null,\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/new', component: _samplernn2.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/datasets', component: _samplernn4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/datasets/:id', component: _samplernn4.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/import', component: _samplernn6.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/results', component: _samplernn8.default }),\n (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/samplernn/graph', component: _samplernn10.default })\n );\n }\n }]);\n\n return router;\n}();\n\nfunction links() {\n return [{ url: '/samplernn/new/', name: 'new' }, { url: '/samplernn/datasets/', name: 'datasets' }, { url: '/samplernn/graph/', name: 'graph' }, { url: '/samplernn/results/', name: 'results' }];\n}\n\nexports.default = {\n name: 'samplernn',\n router: router, links: links\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.import_files = exports.load_loss = exports.load_graph = exports.load_directories = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.loader');\n\nvar datasetLoader = _interopRequireWildcard(_dataset);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _util = require('../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('./samplernn.module');\n\nvar _samplernn2 = _interopRequireDefault(_samplernn);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }\n\nvar load_directories = exports.load_directories = function load_directories(id) {\n return function (dispatch) {\n var module = _samplernn2.default.name;\n _util2.default.allProgress([datasetLoader.load(module), _actions2.default.socket.list_directory({ module: module, dir: 'datasets' }), _actions2.default.socket.list_directory({ module: module, dir: 'results' }), _actions2.default.socket.list_directory({ module: module, dir: 'output' }), _actions2.default.socket.disk_usage({ module: module, dir: 'datasets' }), load_loss()(dispatch)], function (percent, i, n) {\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'samplernn' }\n });\n }).then(function (res) {\n // console.log(res)\n var _res = _slicedToArray(res, 6),\n datasetApiReport = _res[0],\n datasets = _res[1],\n results = _res[2],\n output = _res[3],\n datasetUsage = _res[4],\n lossReport = _res[5];\n\n var folderLookup = datasetApiReport.folderLookup,\n fileLookup = datasetApiReport.fileLookup,\n datasetLookup = datasetApiReport.datasetLookup,\n folders = datasetApiReport.folders,\n files = datasetApiReport.files,\n unsortedFolder = datasetApiReport.unsortedFolder;\n\n console.log(datasetUsage);\n\n // also show the various flat audio files we have, in the input area..\n var flatDatasets = datasets.filter(function (s) {\n return s.name.match(/(wav|aiff?|flac|mp3)$/) && !s.dir;\n });\n var builtDatasets = datasets.filter(function (s) {\n return s.dir;\n });\n builtDatasets.forEach(function (dir) {\n var dataset = datasetLoader.getDataset(module, datasetLookup, dir.name, unsortedFolder, dir.date);\n dataset.isBuilt = true;\n });\n\n flatDatasets.forEach(function (file) {\n file.uuid = (0, _v2.default)();\n fileLookup[file.uuid] = file;\n var name = file.name.split('.')[0];\n var dataset = datasetLoader.getDataset(module, datasetLookup, name, unsortedFolder, file.date);\n file.persisted = false;\n dataset.input.push(file.uuid);\n });\n\n // exp:coccokit_3-frame_sizes:8,2-n_rnn:2-dataset:coccokit_3\n var checkpoints = results.filter(function (s) {\n return s.dir;\n }).map(function (s) {\n var checkpoint = s.name.split('-').map(function (s) {\n return s.split(':');\n }).filter(function (b) {\n return b.length && b[1];\n }).reduce(function (a, b) {\n return (a[b[0]] = b[1]) && a;\n }, {});\n checkpoint.name = checkpoint.name || checkpoint.dataset || checkpoint.exp;\n checkpoint.date = s.date;\n checkpoint.dir = s;\n checkpoint.persisted = false;\n var dataset = datasetLoader.getDataset(module, datasetLookup, checkpoint.name, unsortedFolder, checkpoint.date);\n var loss = lossReport[checkpoint.name];\n if (loss) {\n dataset.epoch = checkpoint.epoch = loss.length;\n checkpoint.training_loss = loss;\n }\n dataset.checkpoints.push(checkpoint);\n return checkpoint;\n });\n\n output.map(function (file) {\n file.uuid = (0, _v2.default)();\n fileLookup[file.uuid] = file;\n var pair = file.name.split('.')[0].split('-');\n var dataset = datasetLoader.getDataset(module, datasetLookup, pair[0], unsortedFolder, file.date);\n file.persisted = false;\n file.epoch = parseInt(file.epoch || pair[1].replace(/^\\D+/, '')) || 0;\n dataset.epoch = Math.max(file.epoch, dataset.epoch || 0);\n // here check if the file exists in dataset, if so just check that it's persisted\n var found = dataset.output.some(function (file_id) {\n // if (f.name === \n if (fileLookup[file_id].name === file.name) {\n fileLookup[file_id].persisted = true;\n return true;\n }\n return false;\n });\n if (!found) {\n dataset.output.push(file.uuid);\n }\n });\n\n dispatch({\n type: _types2.default.dataset.load,\n data: {\n module: module,\n folderLookup: folderLookup,\n fileLookup: fileLookup,\n datasetLookup: datasetLookup,\n folders: folders, files: files,\n checkpoints: checkpoints,\n output: output\n }\n });\n }).catch(function (e) {\n console.error(e);\n });\n if (id) {\n dispatch({\n type: _types2.default.dataset.set_folder,\n data: {\n folder_id: id,\n module: module\n }\n });\n }\n };\n};\n\nvar load_graph = exports.load_graph = function load_graph() {\n return function (dispatch) {\n var module = _samplernn2.default.name;\n _util2.default.allProgress([load_loss()(dispatch), _actions2.default.socket.list_directory({ module: module, dir: 'results' })], function (percent, i, n) {\n dispatch({\n type: _types2.default.app.load_progress,\n progress: { i: i, n: n },\n data: { module: 'samplernn' }\n });\n }).then(function (res) {\n var _res2 = _slicedToArray(res, 2),\n lossReport = _res2[0],\n results = _res2[1];\n\n dispatch({\n type: _types2.default.samplernn.load_graph,\n lossReport: lossReport,\n results: results\n });\n });\n };\n};\n\nvar load_loss = exports.load_loss = function load_loss() {\n return function (dispatch) {\n return _actions2.default.socket.run_script({ module: 'samplernn', activity: 'report' }).then(function (report) {\n var lossReport = {};\n report.stdout.split('\\n\\n').filter(function (a) {\n return !!a;\n }).forEach(function (data) {\n var _data$split = data.split('\\n'),\n _data$split2 = _toArray(_data$split),\n name = _data$split2[0],\n lines = _data$split2.slice(1);\n\n lossReport[name] = lines.map(function (s) {\n return s.split('\\t').reduce(function (a, s) {\n var b = s.split(': ');\n a[b[0]] = b[1];\n return a;\n }, {});\n });\n // console.log(data, name, lossReport[name])\n });\n dispatch({\n type: _types2.default.samplernn.load_loss,\n lossReport: lossReport\n });\n return lossReport;\n });\n };\n};\n\nvar import_files = exports.import_files = function import_files(state, datasetLookup, fileLookup) {\n return function (dispatch) {\n var selected = state.selected,\n folder_id = state.folder_id,\n url_base = state.url_base,\n import_action = state.import_action;\n\n var names = Object.keys(selected).filter(function (k) {\n return selected[k];\n });\n var promises = void 0;\n switch (import_action) {\n case 'Hotlink':\n // in this case, create a new file for each file we see.\n promises = names.reduce(function (a, name) {\n return datasetLookup[name].output.map(function (id) {\n return fileLookup[id];\n }).map(function (file) {\n var partz = file.name.split('.');\n var ext = partz.pop();\n return _actions2.default.file.create({\n folder_id: folder_id,\n name: file.name,\n url: url_base + file.name,\n mime: 'audio/' + ext,\n epoch: file.epoch,\n size: file.size,\n module: 'samplernn',\n dataset: name,\n activity: 'train',\n datatype: 'audio',\n generated: true,\n created_at: new Date(file.date),\n updated_at: new Date(file.date)\n });\n }).concat(a);\n }, []);\n break;\n case 'Upload':\n promises = names.reduce(function (a, name) {\n return datasetLookup[name].input.map(function (id) {\n return fileLookup[id];\n }).map(function (file) {\n if (file.persisted) return null;\n var partz = file.name.split('.');\n var ext = partz.pop();\n if (ext === 'wav' || ext === 'flac') return;\n console.log(file);\n return _actions2.default.socket.upload_file({\n folder_id: folder_id,\n module: 'samplernn',\n activity: 'train',\n path: 'datasets',\n filename: file.name,\n generated: false,\n processed: false,\n datatype: 'audio',\n ttl: 60000\n });\n }).concat(a);\n }, []).filter(function (a) {\n return !!a;\n });\n break;\n default:\n break;\n }\n console.log(promises);\n return Promise.all(promises).then(function (data) {\n console.log(data);\n window.location.href = '/samplernn/datasets/' + folder_id + '/';\n }).catch(function (e) {\n console.error(e);\n });\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar samplernnModule = {\n name: 'samplernn',\n displayName: 'SampleRNN',\n datatype: 'audio'\n};\n\nexports.default = samplernnModule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _dataset = require('../../dataset/dataset.reducer');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar samplernnInitialState = {\n loading: true,\n progress: { i: 0, n: 0 },\n error: null,\n folders: [],\n folder_id: 0,\n data: null,\n lossReport: null,\n results: null\n};\n\nvar samplernnReducer = function samplernnReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : samplernnInitialState;\n var action = arguments[1];\n\n if (action.data && action.data.module === 'samplernn') {\n return (0, _dataset2.default)(state, action);\n }\n\n switch (action.type) {\n case _types2.default.samplernn.load_loss:\n return _extends({}, state, {\n lossReport: action.lossReport\n });\n case _types2.default.samplernn.load_graph:\n return _extends({}, state, {\n lossReport: action.lossReport,\n results: action.results\n });\n default:\n return state;\n }\n};\n\nexports.default = samplernnReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.clear_cache_task = exports.log_task = exports.fetch_task = exports.train_task = undefined;\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('../../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar train_task = exports.train_task = function train_task(dataset, folder_id) {\n var epochs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n return function (dispatch) {\n var task = {\n module: 'samplernn',\n activity: 'train',\n dataset: dataset.name,\n epoch: dataset.checkpoints.length ? dataset.checkpoints[0].epoch || 0 : 0,\n epochs: epochs,\n folder_id: folder_id,\n opt: {\n sample_length: 44100 * 5,\n n_samples: 6,\n keep_old_checkpoints: false\n }\n };\n console.log(task);\n return _actions2.default.queue.add_task(task);\n };\n};\nvar fetch_task = exports.fetch_task = function fetch_task(url, folder_id, file_id, dataset) {\n return function (dispatch) {\n if (!url) return console.log('input file inaccessible (no url)');\n var task = {\n module: 'samplernn',\n activity: 'fetch',\n dataset: dataset,\n folder_id: folder_id,\n opt: {\n url: url,\n file_id: file_id,\n dataset: dataset\n }\n };\n return _actions2.default.queue.add_task(task);\n };\n};\nvar log_task = exports.log_task = function log_task(dataset) {\n return function (dispatch) {\n var task = {\n module: 'samplernn',\n activity: 'log',\n dataset: dataset.name\n };\n return _actions2.default.queue.add_task(task);\n };\n};\nvar clear_cache_task = exports.clear_cache_task = function clear_cache_task(dataset) {\n return function (dispatch) {\n var task = {\n module: 'samplernn',\n activity: 'clear_cache',\n dataset: dataset.name\n };\n return _actions2.default.queue.add_task(task);\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _group = require('../../../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _slider = require('../../../common/slider.component');\n\nvar _slider2 = _interopRequireDefault(_slider);\n\nvar _select = require('../../../common/select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _button = require('../../../common/button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _fileList = require('../../../common/fileList.component');\n\nvar _textInput = require('../../../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar lerp = _util2.default.lerp,\n norm = _util2.default.norm,\n randint = _util2.default.randint,\n randrange = _util2.default.randrange;\n\nvar SampleRNNGraph = function (_Component) {\n _inherits(SampleRNNGraph, _Component);\n\n function SampleRNNGraph(props) {\n _classCallCheck(this, SampleRNNGraph);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNGraph.__proto__ || Object.getPrototypeOf(SampleRNNGraph)).call(this));\n\n props.actions.load_graph();\n return _this;\n }\n\n _createClass(SampleRNNGraph, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n this.refs = {};\n return (0, _preact.h)(\n 'div',\n { className: 'app lossGraph' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h3',\n null,\n 'SampleRNN Loss Graph'\n ),\n (0, _preact.h)('canvas', { ref: function ref(_ref) {\n return _this2.refs['canvas'] = _ref;\n } })\n )\n );\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n var _props$samplernn = this.props.samplernn,\n lossReport = _props$samplernn.lossReport,\n results = _props$samplernn.results;\n\n if (!lossReport || !results) return;\n var canvas = this.refs.canvas;\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n canvas.style.width = canvas.width + 'px';\n canvas.style.height = canvas.height + 'px';\n\n var ctx = canvas.getContext('2d');\n var w = canvas.width;\n var h = canvas.height;\n ctx.clearRect(0, 0, w, h);\n\n var resultsByDate = results.map(function (file) {\n if (!file.name.match(/^exp:/)) return null;\n var dataset = file.name.split(\"-\")[3].split(\":\")[1];\n return [+new Date(file.date), dataset];\n }).filter(function (a) {\n return !!a;\n }).sort(function (a, b) {\n return a[0] - a[1];\n });\n\n var keys = Object.keys(lossReport).filter(function (k) {\n return !!lossReport[k].length;\n });\n var scaleMax = 0;\n var scaleMin = Infinity;\n var epochsMax = 0;\n keys.forEach(function (key) {\n var loss = lossReport[key];\n epochsMax = Math.max(loss.length, epochsMax);\n loss.forEach(function (a) {\n var v = parseFloat(a.training_loss);\n if (!v) return;\n scaleMax = Math.max(v, scaleMax);\n scaleMin = Math.min(v, scaleMin);\n });\n });\n // scaleMax *= 10\n // console.log(scaleMax, scaleMin, epochsMax)\n\n scaleMax = 3;\n scaleMin = 0;\n var margin = 0;\n var wmin = 0;\n var wmax = w / 2;\n var hmin = 0;\n var hmax = h / 2;\n var epochsScaleFactor = 1; // 3/2\n\n ctx.save();\n var X = void 0,\n Y = void 0;\n for (var ii = 0; ii < epochsMax; ii++) {\n X = lerp(ii / (epochsMax / epochsScaleFactor) * epochsScaleFactor, wmin, wmax);\n ctx.strokeStyle = 'rgba(0,0,0,0.3)';\n ctx.beginPath(0, 0);\n ctx.moveTo(X, 0);\n ctx.lineTo(X, h);\n ctx.lineWidth = 0.5;\n // ctx.stroke()\n if ((ii + 1) % 6 === 0) {\n ctx.lineWidth = 0.5;\n ctx.stroke();\n var fontSize = 12;\n ctx.font = 'italic ' + fontSize + 'px \"Georgia\"';\n ctx.fillStyle = 'rgba(0,12,28,0.6)';\n ctx.fillText(ii / 5 * 6, X + 8, h - (fontSize + 4));\n }\n }\n for (var ii = scaleMin; ii < scaleMax; ii += 1) {\n Y = lerp(ii / scaleMax, hmin, hmax);\n // ctx.strokeStyle = 'rgba(255,255,255,1.0)'\n ctx.beginPath(0, 0);\n ctx.moveTo(0, h - Y);\n ctx.lineTo(w, h - Y);\n ctx.lineWidth = 1;\n // ctx.stroke() \n // if ( (ii % 1) < 0.1) {\n // ctx.strokeStyle = 'rgba(255,255,255,1.0)'\n ctx.lineWidth = 2;\n ctx.setLineDash([4, 4]);\n ctx.stroke();\n ctx.stroke();\n ctx.stroke();\n ctx.setLineDash([1, 1]);\n var _fontSize = 12;\n ctx.font = 'italic ' + _fontSize + 'px \"Georgia\"';\n ctx.fillStyle = 'rgba(0,12,28,0.6)';\n ctx.fillText(ii.toFixed(1), w - 50, h - Y + _fontSize + 10);\n // }\n }\n ctx.lineWidth = 1;\n ctx.restore();\n\n var min_date = resultsByDate[0][0];\n var max_date = resultsByDate[resultsByDate.length - 1][0];\n resultsByDate.forEach(function (pair) {\n var date = pair[0];\n var key = pair[1];\n var loss = lossReport[key];\n if (!key || !loss || !loss.length) return;\n var vf = parseFloat(loss[loss.length - 1].training_loss) || 0;\n var vg = parseFloat(loss[0].training_loss) || 5;\n // console.log(vf)\n var vv = 1 - norm(vf, scaleMin, scaleMax / 2);\n ctx.lineWidth = (1 - norm(vf, scaleMin, scaleMax)) * 4;\n // ctx.lineWidth = norm(date, min_date, max_date) * 3\n // console.log(date, min_date, max_date)\n ctx.strokeStyle = 'rgba(' + [randrange(30, 190), randrange(30, 150), randrange(60, 120)].join(',') + ',' + 0.8 + ')';\n var begun = false;\n loss.forEach(function (a, i) {\n var v = parseFloat(a.training_loss);\n if (!v) return;\n var x = lerp(i / (epochsMax / epochsScaleFactor) * epochsScaleFactor, wmin, wmax);\n var y = lerp(norm(v, scaleMin, scaleMax), hmax, hmin);\n if (!begun) {\n begun = true;\n ctx.beginPath(0, 0);\n ctx.moveTo(x, y);\n } else {\n ctx.lineTo(x, y);\n // ctx.stroke()\n }\n });\n ctx.stroke();\n var i = loss.length - 1;\n var v = parseFloat(loss[i].training_loss);\n var x = lerp(i / (epochsMax / epochsScaleFactor) * epochsScaleFactor, wmin, wmax);\n var y = lerp(norm(v, scaleMin, scaleMax), hmax, hmin);\n var fontSize = 9;\n ctx.font = 'italic ' + fontSize + 'px \"Georgia\"';\n ctx.fillStyle = 'rgba(0,12,28,0.6)';\n ctx.fillText(key, x + 4, y + fontSize / 2);\n });\n }\n }]);\n\n return SampleRNNGraph;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNGraph);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _select = require('../../../common/select.component');\n\nvar _select2 = _interopRequireDefault(_select);\n\nvar _textInput = require('../../../common/textInput.component');\n\nvar _textInput2 = _interopRequireDefault(_textInput);\n\nvar _button = require('../../../common/button.component');\n\nvar _button2 = _interopRequireDefault(_button);\n\nvar _dataset = require('../../../dataset/dataset.component');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar samplernnModule = {\n name: 'samplernn',\n datatype: 'audio'\n};\n\nvar SampleRNNImport = function (_Component) {\n _inherits(SampleRNNImport, _Component);\n\n function SampleRNNImport() {\n _classCallCheck(this, SampleRNNImport);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNImport.__proto__ || Object.getPrototypeOf(SampleRNNImport)).call(this));\n\n _this.state = {\n folder_id: 1,\n import_action: 'Hotlink',\n url_base: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4279/',\n selected: {}\n };\n return _this;\n }\n\n _createClass(SampleRNNImport, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('samplernn.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n samplernn = _props.samplernn,\n samplernnActions = _props.samplernnActions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('samplernn.last_id', id);\n if (!samplernn.folder || samplernn.folder.id !== id) {\n this.props.actions.load_directories(id);\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var samplernn = this.props.samplernn;\n\n var datasets = [],\n folder = void 0;\n if (this.props.samplernn.data) {\n datasets = (this.props.samplernn.data.folders || []).map(function (folder) {\n return [folder.name, folder.id];\n });\n folder = this.props.samplernn.data.folderLookup.unsorted;\n }\n return (0, _preact.h)(\n 'div',\n { className: 'app top' },\n (0, _preact.h)(\n 'div',\n { 'class': 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n 'Import'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'params form row datasets' },\n (0, _preact.h)(\n 'div',\n { 'class': 'row dataset' },\n (0, _preact.h)('div', { 'class': 'col' }),\n (0, _preact.h)('div', { 'class': 'col' }),\n (0, _preact.h)('div', { 'class': 'col' }),\n (0, _preact.h)(\n 'div',\n { 'class': 'col' },\n (0, _preact.h)(\n 'h2',\n null,\n 'Import to dataset'\n ),\n (0, _preact.h)(_select2.default, {\n title: 'Destination dataset',\n options: datasets,\n name: 'folder_id',\n opt: this.state,\n onChange: function onChange(name, value) {\n return _this2.setState({ folder_id: value });\n }\n }),\n (0, _preact.h)(_select2.default, {\n title: 'Import action',\n options: ['Hotlink', 'Upload'],\n name: 'import_action',\n opt: this.state,\n onChange: function onChange(name, value) {\n return _this2.setState({ import_action: value });\n }\n }),\n (0, _preact.h)(_textInput2.default, {\n title: 'Remote URL base',\n value: this.state.url_base,\n placeholder: 'http://',\n onSave: function onSave(value) {\n return _this2.setState({ url_base: value });\n }\n }),\n (0, _preact.h)(\n _button2.default,\n {\n title: '',\n onClick: function onClick() {\n return _this2.doImport();\n }\n },\n 'Import'\n )\n )\n )\n ),\n (0, _preact.h)(_dataset2.default, {\n loading: samplernn.loading,\n progress: samplernn.progress,\n module: samplernnModule,\n data: samplernn.data,\n id: 'unsorted',\n folder: folder,\n history: this.props.history,\n onPickDataset: function onPickDataset(dataset) {\n return _this2.toggle(dataset.name, _this2.state.selected[name]);\n },\n beforeRow: function beforeRow(dataset) {\n return _this2.beforeRow(dataset);\n },\n afterRow: function afterRow(dataset) {\n return _this2.afterRow(dataset);\n }\n })\n );\n }\n }, {\n key: 'toggle',\n value: function toggle(name) {\n this.setState(_extends({}, this.state, {\n selected: _extends({}, this.state.selected, _defineProperty({}, name, !this.state.selected[name]))\n }));\n }\n }, {\n key: 'beforeRow',\n value: function beforeRow(dataset) {\n // console.log(dataset)\n }\n }, {\n key: 'afterRow',\n value: function afterRow(dataset) {\n var name = dataset.name;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)('input', {\n type: 'checkbox',\n value: name,\n checked: !!this.state.selected[name]\n })\n );\n }\n }, {\n key: 'doImport',\n value: function doImport() {\n var samplernn = this.props.samplernn;\n\n console.log(this.state);\n this.props.actions.import_files(this.state, samplernn.data.datasetLookup, samplernn.data.fileLookup);\n }\n }]);\n\n return SampleRNNImport;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn,\n runner: state.system.runner,\n task: state.task\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNImport);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _common = require('../../../common');\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _samplernn2 = require('../samplernn.module');\n\nvar _samplernn3 = _interopRequireDefault(_samplernn2);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction SampleRNNNew(props) {\n return (0, _preact.h)(_common.Views.New, {\n db: props.samplernn,\n path: '/samplernn/datasets/',\n actions: props.actions,\n module: _samplernn3.default,\n history: props.history\n });\n}\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNNew);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRouterDom = require('react-router-dom');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _audioPlayer = require('../../../common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _loading = require('../../../common/loading.component');\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _fileList = require('../../../common/fileList.component');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SampleRNNResults = function (_Component) {\n _inherits(SampleRNNResults, _Component);\n\n function SampleRNNResults(props) {\n _classCallCheck(this, SampleRNNResults);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNResults.__proto__ || Object.getPrototypeOf(SampleRNNResults)).call(this));\n\n if (!props.samplernn.data) props.actions.load_directories();\n return _this;\n }\n\n _createClass(SampleRNNResults, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n if (this.props.samplernn.loading) return (0, _preact.h)(_loading2.default, { progress: this.props.samplernn.progress });\n var _props$samplernn$data = this.props.samplernn.data,\n folderLookup = _props$samplernn$data.folderLookup,\n fileLookup = _props$samplernn$data.fileLookup,\n datasetLookup = _props$samplernn$data.datasetLookup;\n // const { folderLookup } = samplernn\n\n var renders = Object.keys(folderLookup).sort(_util2.default.sort.stringSort.asc).map(function (key) {\n var folder = folderLookup[key];\n\n var _util$sort$orderByFn = _util2.default.sort.orderByFn('epoch desc'),\n mapFn = _util$sort$orderByFn.mapFn,\n sortFn = _util$sort$orderByFn.sortFn;\n\n var datasetPairs = folder.datasets.map(function (name) {\n return datasetLookup[name];\n }).map(mapFn).sort(sortFn);\n var bestRenders = datasetPairs.map(function (pair) {\n return pair[1];\n }).filter(function (dataset) {\n return dataset.output.length;\n }).map(function (dataset) {\n var output = dataset.output;\n\n return output.map(function (id) {\n return fileLookup[id];\n }).map(mapFn).sort(sortFn)[0][1];\n });\n // console.log(bestRenders.map(r => r.epoch))\n var path = folder.name === 'unsorted' ? \"/samplernn/import/\" : \"/samplernn/datasets/\" + folder.id + \"/\";\n return (0, _preact.h)(\n 'div',\n { className: 'col bestRenders' },\n (0, _preact.h)(\n 'h3',\n null,\n (0, _preact.h)(\n _reactRouterDom.Link,\n { to: path },\n folder.name\n )\n ),\n (0, _preact.h)(_fileList.FileList, {\n linkFiles: true,\n files: bestRenders,\n orderBy: 'date desc',\n fields: 'name date epoch size',\n onClick: function onClick(file, e) {\n e.preventDefault();\n e.stopPropagation();\n console.log('picked a file', file);\n _this2.handlePick(file);\n }\n })\n );\n });\n\n return (0, _preact.h)(\n 'div',\n { className: 'app samplernn' },\n (0, _preact.h)(\n 'div',\n { className: 'heading row middle' },\n (0, _preact.h)(\n 'h1',\n null,\n 'SampleRNN Results'\n )\n ),\n (0, _preact.h)(\n 'div',\n { 'class': 'rows params renders' },\n renders\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n this.props.audioPlayer.play(file);\n }\n }]);\n\n return SampleRNNResults;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch),\n audioPlayer: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNResults);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _util = require('../../../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _samplernn = require('../samplernn.actions');\n\nvar samplernnActions = _interopRequireWildcard(_samplernn);\n\nvar _samplernn2 = require('../samplernn.tasks');\n\nvar samplernnTasks = _interopRequireWildcard(_samplernn2);\n\nvar _audioPlayer = require('../../../common/audioPlayer/audioPlayer.actions');\n\nvar audioPlayerActions = _interopRequireWildcard(_audioPlayer);\n\nvar _common = require('../../../common');\n\nvar _dataset = require('../../../dataset/dataset.form');\n\nvar _dataset2 = _interopRequireDefault(_dataset);\n\nvar _upload = require('../../../dataset/upload.status');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _dataset3 = require('../../../dataset/dataset.component');\n\nvar _dataset4 = _interopRequireDefault(_dataset3);\n\nvar _samplernn3 = require('../samplernn.module');\n\nvar _samplernn4 = _interopRequireDefault(_samplernn3);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar SampleRNNShow = function (_Component) {\n _inherits(SampleRNNShow, _Component);\n\n function SampleRNNShow(props) {\n _classCallCheck(this, SampleRNNShow);\n\n var _this = _possibleConstructorReturn(this, (SampleRNNShow.__proto__ || Object.getPrototypeOf(SampleRNNShow)).call(this, props));\n\n _this.datasetActions = _this.datasetActions.bind(_this);\n return _this;\n }\n\n _createClass(SampleRNNShow, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var id = this.props.match.params.id || localStorage.getItem('samplernn.last_id');\n console.log('load dataset:', id);\n var _props = this.props,\n match = _props.match,\n samplernn = _props.samplernn,\n actions = _props.actions;\n\n if (id === 'new') return;\n if (id) {\n if (parseInt(id)) localStorage.setItem('samplernn.last_id', id);\n if (!samplernn.folder || samplernn.folder.id !== id) {\n // console.log('looooooooooad', id)\n actions.load_directories(id);\n }\n } else {\n this.props.history.push('/samplernn/new/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props2 = this.props,\n samplernn = _props2.samplernn,\n runner = _props2.runner,\n match = _props2.match,\n history = _props2.history;\n\n var _ref = samplernn.data || {},\n folderLookup = _ref.folderLookup;\n // console.log(runner)\n\n\n var folder = (folderLookup || {})[samplernn.folder_id] || {};\n return (0, _preact.h)(\n 'div',\n { className: 'app samplernn' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n folder ? folder.name : (0, _preact.h)(_common.Loading, null)\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row' },\n folder && folder.name && folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, {\n title: 'Add Files',\n module: _samplernn4.default,\n folder: folder,\n canUpload: true, canAddURL: true\n }),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(_upload2.default, null),\n (0, _preact.h)(_common.CurrentTask, { processor: 'gpu' })\n )\n ),\n (0, _preact.h)(_dataset4.default, {\n loading: samplernn.loading,\n progress: samplernn.progress,\n id: samplernn.folder_id,\n module: _samplernn4.default,\n data: samplernn.data,\n folder: folder,\n history: history,\n onPickFile: function onPickFile(file, e) {\n e.preventDefault();\n e.stopPropagation();\n // console.log('picked a file', file)\n _this2.handlePick(file);\n },\n datasetActions: this.datasetActions\n })\n );\n }\n }, {\n key: 'datasetActions',\n value: function datasetActions(dataset) {\n var isFetching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isProcessing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _props3 = this.props,\n samplernn = _props3.samplernn,\n remote = _props3.remote;\n\n var input = samplernn.data.fileLookup[dataset.input[0]];\n if (!input) return null;\n if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null;\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { 'class': 'actions' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 1);\n } },\n 'train'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 2);\n } },\n '2x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 4);\n } },\n '4x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 6);\n } },\n '6x'\n ),\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.train_task(dataset, samplernn.folder_id, 18);\n } },\n '18x'\n )\n ),\n dataset.isBuilt ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetched ',\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.clear_cache_task(dataset);\n } },\n 'x'\n )\n ) : isFetching ? (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n 'fetching'\n ) : (0, _preact.h)(\n 'div',\n { 'class': 'subtext' },\n (0, _preact.h)(\n 'span',\n { 'class': 'link', onClick: function onClick() {\n return remote.fetch_task(input.url, samplernn.folder_id, input.id, dataset.name);\n } },\n 'fetch'\n )\n )\n );\n }\n }, {\n key: 'handlePick',\n value: function handlePick(file) {\n // console.log(file)\n this.props.audioPlayer.play(file);\n }\n }]);\n\n return SampleRNNShow;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n samplernn: state.module.samplernn,\n runner: state.system.runner\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: (0, _redux.bindActionCreators)(samplernnActions, dispatch),\n remote: (0, _redux.bindActionCreators)(samplernnTasks, dispatch),\n audioPlayer: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch)\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SampleRNNShow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.stop_queue = exports.start_queue = exports.add_task = exports.stop_task = exports.start_task = undefined;\n\nvar _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; };\n\nvar _socket = require('../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _actions = require('../actions');\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar start_task = exports.start_task = function start_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.start_task(task, opt);\n return _extends({ type: _types2.default.task.starting_task, task: task }, opt);\n};\n\nvar stop_task = exports.stop_task = function stop_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.stop_task(task, opt);\n return _extends({ type: _types2.default.task.stopping_task, task: task }, opt);\n};\n\nvar add_task = exports.add_task = function add_task(new_task) {\n return function (dispatch) {\n _actions2.default.task.create(new_task).then(function (task) {\n _socket2.default.task.add_task(task);\n });\n };\n};\n\nvar start_queue = exports.start_queue = function start_queue(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.start_queue(task, opt);\n return _extends({ type: _types2.default.task.starting_queue, task: task }, opt);\n};\n\nvar stop_queue = exports.stop_queue = function stop_queue(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _socket2.default.task.stop_queue(task, opt);\n return _extends({ type: _types2.default.task.stopping_queue, task: task }, opt);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _util = require('../util');\n\nvar _util2 = _interopRequireDefault(_util);\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar queueInitialState = {\n loading: false,\n error: null,\n tasks: {},\n queue: [],\n completed: []\n};\n\nvar dateSort = _util2.default.sort.orderByFn('updated_at desc');\nvar prioritySort = _util2.default.sort.orderByFn('priority asc');\n\nvar queueReducer = function queueReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : queueInitialState;\n var action = arguments[1];\n\n switch (action.type) {\n case _types2.default.task.index:\n return _extends({}, state, {\n tasks: action.data.reduce(function (a, b) {\n return a[b.id] = b, a;\n }, {}),\n queue: action.data.filter(function (a) {\n return !a.completed;\n }).map(dateSort.mapFn).sort(dateSort.sortFn).map(function (pair) {\n return pair[1].id;\n }),\n completed: action.data.filter(function (a) {\n return a.completed;\n }).map(prioritySort.mapFn).sort(prioritySort.sortFn).map(function (pair) {\n return pair[1].id;\n })\n });\n case _types2.default.task.create:\n console.log(action.data);\n return _extends({}, state, {\n tasks: _extends({}, state.tasks, _defineProperty({}, action.data.id, action.data)),\n queue: state.queue.concat([action.data.id])\n });\n case _types2.default.task.update:\n return _extends({}, state, {\n tasks: _extends({}, state.tasks, _defineProperty({}, action.data.id, action.data))\n });\n case _types2.default.task.destroy:\n var _state$tasks = state.tasks,\n deletedTask = _state$tasks[action.data.id],\n taskLookup = _objectWithoutProperties(_state$tasks, [action.data.id]);\n\n return _extends({}, state, {\n queue: state.queue.filter(function (id) {\n return id !== deletedTask.id;\n }),\n completed: state.completed.filter(function (id) {\n return id !== deletedTask.id;\n }),\n tasks: taskLookup\n });\n case _types2.default.task.task_finish:\n return _extends({}, state, {\n queue: state.queue.filter(function (a) {\n return a !== action.task.id;\n }),\n completed: [action.task.id].concat(state.completed)\n });\n default:\n return state;\n }\n};\n\nexports.default = queueReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nvar _socket2 = require('./socket.actions');\n\nvar actions = _interopRequireWildcard(_socket2);\n\nvar _socket3 = require('./socket.system');\n\nvar system = _interopRequireWildcard(_socket3);\n\nvar _socket4 = require('./socket.live');\n\nvar live = _interopRequireWildcard(_socket4);\n\nvar _socket5 = require('./socket.task');\n\nvar task = _interopRequireWildcard(_socket5);\n\nvar _socket6 = require('./socket.api');\n\nvar api = _interopRequireWildcard(_socket6);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = {\n socket: _socket.socket,\n actions: actions,\n system: system,\n live: live,\n task: task,\n api: api\n};\n\n\n_socket.socket.on('status', function (data) {\n console.log('got status', data.key, data.value);\n _store.store.dispatch(_extends({ type: _types2.default.socket.status }, data));\n switch (data.key) {\n case 'processing':\n _store.store.dispatch(_extends({\n type: 'SET_PARAM'\n }, data));\n break;\n default:\n break;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.syscall_async = exports.upload_file = exports.run_script = exports.list_sequences = exports.count_directory = exports.list_directory = exports.disk_usage = exports.run_system_command = undefined;\n\nvar _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; };\n\nvar _v = require('uuid/v1');\n\nvar _v2 = _interopRequireDefault(_v);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar run_system_command = exports.run_system_command = function run_system_command(opt) {\n return syscall_async('run_system_command', opt);\n};\nvar disk_usage = exports.disk_usage = function disk_usage(opt) {\n return syscall_async('run_system_command', _extends({ cmd: 'du' }, opt));\n};\nvar list_directory = exports.list_directory = function list_directory(opt) {\n return syscall_async('list_directory', opt).then(function (res) {\n return res.files;\n });\n};\nvar count_directory = exports.count_directory = function count_directory(opt) {\n return syscall_async('count_directory', opt).then(function (res) {\n return res.count;\n });\n};\nvar list_sequences = exports.list_sequences = function list_sequences(opt) {\n return syscall_async('list_sequences', opt).then(function (res) {\n return res.sequences;\n });\n};\nvar run_script = exports.run_script = function run_script(opt) {\n return syscall_async('run_script', opt);\n};\nvar upload_file = exports.upload_file = function upload_file(opt) {\n return syscall_async('upload_file', opt);\n};\n\nvar syscall_async = exports.syscall_async = function syscall_async(tag, payload) {\n var ttl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10000;\n\n ttl = payload.ttl || ttl;\n return new Promise(function (resolve, reject) {\n var uuid = (0, _v2.default)();\n var timeout = setTimeout(function () {\n _socket.socket.off('system_res', cb);\n reject('timeout');\n }, ttl);\n var cb = function cb(data) {\n if (!data.uuid) return;\n if (data.uuid === uuid) {\n clearTimeout(timeout);\n _socket.socket.off('system_res', cb);\n resolve(data);\n }\n };\n _socket.socket.emit('system', { cmd: tag, payload: payload, uuid: uuid });\n _socket.socket.on('system_res', cb);\n });\n};","'use strict';\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_socket.socket.on('api_res', function (data) {\n // console.log('system response', data)\n data = parse(data);\n var type = _types2.default[data.datatype];\n console.log('api_res', data.type, data.datatype);\n if (!type) return console.error('socket:api_res bad datatype', data.datatype);\n switch (data.type) {\n case 'create':\n return (0, _store.dispatch)({\n type: type.create,\n source: 'socket',\n data: data.data\n });\n case 'update':\n return (0, _store.dispatch)({\n type: type.update,\n source: 'socket',\n data: data.data\n });\n case 'destroy':\n return (0, _store.dispatch)({\n type: type.destroy,\n source: 'socket',\n data: data.data\n });\n default:\n break;\n }\n});\n\nfunction parse(s) {\n if (typeof s === 'string') {\n try {\n var d = JSON.parse(s);\n return d;\n } catch (e) {\n console.error('not valid json');\n return s;\n }\n }\n return s;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.socket = undefined;\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar socket = exports.socket = io.connect('/client');\n\n// SOCKET ACTIONS\n\nsocket.on('connect', function () {\n return _store.store.dispatch({ type: _types2.default.socket.connect });\n});\nsocket.on('connect_error', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.connect_error, error: error });\n});\nsocket.on('reconnect', function (attempt) {\n return _store.store.dispatch({ type: _types2.default.socket.reconnect, attempt: attempt });\n});\nsocket.on('reconnecting', function () {\n return _store.store.dispatch({ type: _types2.default.socket.reconnecting });\n});\nsocket.on('reconnect_error', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.reconnect_error, error: error });\n});\nsocket.on('reconnect_failed', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.reconnect_failed, error: error });\n});\nsocket.on('disconnect', function () {\n return _store.store.dispatch({ type: _types2.default.socket.disconnect });\n});\nsocket.on('error', function (error) {\n return _store.store.dispatch({ type: _types2.default.socket.error, error: error });\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.list_checkpoints = list_checkpoints;\nexports.list_all_checkpoints = list_all_checkpoints;\nexports.list_epochs = list_epochs;\nexports.list_sequences = list_sequences;\nexports.load_epoch = load_epoch;\nexports.load_sequence = load_sequence;\nexports.seek = seek;\nexports.pause = pause;\nexports.play = play;\nexports.get_params = get_params;\nexports.set_param = set_param;\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _player = require('../live/player');\n\nvar player = _interopRequireWildcard(_player);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_socket.socket.on('res', function (data) {\n // console.log('socket:', data.cmd)\n switch (data.cmd) {\n case 'get_last_frame':\n if (data.res !== 'working') {\n _socket.socket.emit('cmd', {\n cmd: 'get_last_frame'\n });\n }\n break;\n case 'get_params':\n data.res && (0, _store.dispatch)({\n type: _types2.default.socket.load_params,\n opt: data.res\n });\n data.res && player.toggleFPS(data.res.processing);\n break;\n case 'list_checkpoints':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_checkpoints,\n checkpoints: data.res\n });\n break;\n case 'list_all_checkpoints':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_all_checkpoints,\n checkpoints: data.res\n });\n break;\n case 'list_epochs':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_epochs,\n epochs: data.res\n });\n break;\n case 'list_sequences':\n (0, _store.dispatch)({\n type: _types2.default.socket.list_sequences,\n sequences: data.res\n });\n break;\n default:\n break;\n }\n // console.log(data)\n});\n\n_socket.socket.on('frame', player.onFrame);\n\nfunction list_checkpoints(module) {\n _socket.socket.emit('cmd', {\n cmd: 'list_checkpoints',\n payload: module\n });\n}\nfunction list_all_checkpoints(module) {\n _socket.socket.emit('cmd', {\n cmd: 'list_all_checkpoints',\n payload: module\n });\n}\nfunction list_epochs(module, checkpoint_name) {\n _socket.socket.emit('cmd', {\n cmd: 'list_epochs',\n payload: module === 'pix2pix' || module === 'pix2wav' ? module + '/' + checkpoint_name : checkpoint_name\n });\n}\nfunction list_sequences(module) {\n _socket.socket.emit('cmd', {\n cmd: 'list_sequences',\n payload: module\n });\n}\nfunction load_epoch(checkpoint_name, epoch) {\n console.log(\">> SWITCH CHECKPOINT\", checkpoint_name, epoch);\n _socket.socket.emit('cmd', {\n cmd: 'load_epoch',\n payload: checkpoint_name + ':' + epoch\n });\n}\nfunction load_sequence(sequence) {\n _socket.socket.emit('cmd', {\n cmd: 'load_sequence',\n payload: sequence\n });\n}\nfunction seek(frame) {\n _socket.socket.emit('cmd', {\n cmd: 'seek',\n payload: frame\n });\n}\nfunction pause(frame) {\n _socket.socket.emit('cmd', {\n cmd: 'pause'\n });\n}\nfunction play(frame) {\n _socket.socket.emit('cmd', {\n cmd: 'play'\n });\n}\nfunction get_params() {\n _socket.socket.emit('cmd', {\n cmd: 'get_params'\n });\n}\nfunction set_param(key, value) {\n _socket.socket.emit('cmd', {\n cmd: 'set_param',\n payload: {\n 'key': key,\n 'value': value\n }\n });\n}","'use strict';\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_socket.socket.on('system_res', function (data) {\n // console.log('system response', data)\n switch (data.type) {\n case 'relay_connected':\n return (0, _store.dispatch)({\n type: _types2.default.system.relay_connected\n });\n case 'relay_disconnected':\n return (0, _store.dispatch)({\n type: _types2.default.system.relay_disconnected\n });\n case 'rpc_connected':\n return (0, _store.dispatch)({\n type: _types2.default.system.rpc_connected,\n runner: data.runner\n });\n case 'rpc_disconnected':\n return (0, _store.dispatch)({\n type: _types2.default.system.rpc_disconnected\n });\n case 'relay_status':\n return (0, _store.dispatch)({\n type: data.rpc_connected ? _types2.default.system.rpc_connected : _types2.default.system.rpc_disconnected,\n runner: data.runner\n });\n case 'site':\n return (0, _store.dispatch)({\n type: _types2.default.system.load_site,\n site: data.site\n });\n default:\n break;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.stop_queue = exports.start_queue = exports.stop_task = exports.start_task = exports.remove_task = exports.add_task = undefined;\n\nvar _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; };\n\nexports.emit = emit;\n\nvar _store = require('../store');\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _socket = require('./socket.connection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar finishTimeout = void 0;\n\n_socket.socket.on('task_res', function (raw_data) {\n // does not like the nested task object for some reason..\n var data = void 0;\n try {\n if (typeof raw_data === 'string') {\n data = JSON.parse(raw_data);\n if (typeof data === 'string') {\n data = JSON.parse(data);\n }\n } else {\n data = raw_data;\n }\n } catch (e) {\n console.warn('problem with json', e);\n return;\n }\n if (data.task) {\n (0, _store.dispatch)({ type: _types2.default.task.update, data: data.task });\n }\n // console.log('task', data.type)\n switch (data.type) {\n case 'start':\n // return dispatch({ type: types.system.rpc_connected, runner: data.runner })\n break;\n case 'stop':\n break;\n // begin and finish calls often arrive out of order, if the old task was preempted\n case 'task_begin':\n (0, _store.dispatch)({ type: _types2.default.task.task_begin, task: data.task });\n break;\n case 'task_finish':\n (0, _store.dispatch)({ type: _types2.default.task.task_finish, task: data.task });\n break;\n case 'kill':\n break;\n case 'stdout':\n return (0, _store.dispatch)({ type: _types2.default.system.stdout, data: data });\n break;\n case 'stderr':\n return (0, _store.dispatch)({ type: _types2.default.system.stderr, data: data });\n break;\n case 'add':\n break;\n case 'remove':\n break;\n case 'start_queue':\n break;\n case 'stop_queue':\n break;\n case 'list':\n break;\n case 'set_priority':\n break;\n case 'progress':\n (0, _store.dispatch)({ type: _types2.default.task.progress, task: data.task });\n break;\n case 'epoch':\n (0, _store.dispatch)({ type: _types2.default.task.epoch, task: data.task });\n break;\n case 'task_error':\n return console.log('task error', data);\n default:\n console.log(data);\n return console.log('no such task command', data.type);\n }\n});\n\nfunction emit(type) {\n var task = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var opt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _socket.socket.emit('task', _extends({ type: type, task: task }, opt));\n}\n\nvar add_task = exports.add_task = function add_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('add', task, opt);\n};\nvar remove_task = exports.remove_task = function remove_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('remove', task, opt);\n};\nvar start_task = exports.start_task = function start_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('start', task, opt);\n};\nvar stop_task = exports.stop_task = function stop_task(task) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return emit('stop', task, opt);\n};\nvar start_queue = exports.start_queue = function start_queue() {\n var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return emit('start_queue', {}, opt);\n};\nvar stop_queue = exports.stop_queue = function stop_queue() {\n var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return emit('stop_queue', {}, opt);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dispatch = exports.store = exports.history = undefined;\n\nvar _redux = require('redux');\n\nvar _reactRouterRedux = require('react-router-redux');\n\nvar _reduxThunk = require('redux-thunk');\n\nvar _reduxThunk2 = _interopRequireDefault(_reduxThunk);\n\nvar _createBrowserHistory = require('history/createBrowserHistory');\n\nvar _createBrowserHistory2 = _interopRequireDefault(_createBrowserHistory);\n\nvar _system = require('./system/system.reducer');\n\nvar _system2 = _interopRequireDefault(_system);\n\nvar _dashboard = require('./dashboard/dashboard.reducer');\n\nvar _dashboard2 = _interopRequireDefault(_dashboard);\n\nvar _live = require('./live/live.reducer');\n\nvar _live2 = _interopRequireDefault(_live);\n\nvar _upload = require('./dataset/upload.reducer');\n\nvar _upload2 = _interopRequireDefault(_upload);\n\nvar _queue = require('./queue/queue.reducer');\n\nvar _queue2 = _interopRequireDefault(_queue);\n\nvar _audioPlayer = require('./common/audioPlayer/audioPlayer.reducer');\n\nvar _audioPlayer2 = _interopRequireDefault(_audioPlayer);\n\nvar _module = require('./modules/module.reducer');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar appReducer = (0, _redux.combineReducers)({\n system: _system2.default,\n dashboard: _dashboard2.default,\n live: _live2.default,\n upload: _upload2.default,\n queue: _queue2.default,\n router: _reactRouterRedux.routerReducer,\n module: _module.moduleReducer,\n audioPlayer: _audioPlayer2.default\n});\n\n// import navReducer from './nav.reducer'\nvar history = exports.history = (0, _createBrowserHistory2.default)();\nvar store = exports.store = (0, _redux.createStore)(appReducer, (0, _redux.compose)((0, _redux.applyMiddleware)(\n// createLogger(),\n_reduxThunk2.default, (0, _reactRouterRedux.routerMiddleware)(history))));\n\nvar dispatch = exports.dispatch = store.dispatch;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.enqueue_test_task = exports.changeTool = exports.countDirectory = exports.listDirectory = exports.run = undefined;\n\nvar _socket = require('../socket');\n\nvar _socket2 = _interopRequireDefault(_socket);\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// import actions from '../actions'\n\nvar run = exports.run = function run(cmd) {\n return function (dispatch) {\n dispatch({ type: _types2.default.system.running_command, cmd: cmd });\n _socket2.default.actions.run_system_command({ cmd: cmd }).then(function (data) {\n dispatch({\n type: _types2.default.system.command_output,\n data: data\n });\n });\n };\n};\n\nvar listDirectory = exports.listDirectory = function listDirectory(opt) {\n return function (dispatch) {\n dispatch({ type: _types2.default.system.listing_directory, opt: opt });\n _socket2.default.actions.list_directory(opt).then(function (data) {\n dispatch({\n type: _types2.default.system.list_directory,\n data: data\n });\n });\n };\n};\n\nvar countDirectory = exports.countDirectory = function countDirectory(opt) {\n return function (dispatch) {\n dispatch({ type: _types2.default.system.counting_directory, opt: opt });\n _socket2.default.actions.count_directory(opt).then(function (data) {\n dispatch({\n type: _types2.default.system.count_directory,\n data: data\n });\n });\n };\n};\n\nvar changeTool = exports.changeTool = function changeTool(tool) {\n localStorage.setItem('system.last_tool', tool);\n return { type: _types2.default.app.change_tool, tool: tool };\n};\n\nvar enqueue_test_task = exports.enqueue_test_task = function enqueue_test_task(dataset) {\n return function (dispatch) {\n var task = {\n module: 'test',\n activity: 'cpu',\n dataset: dataset\n // return actions.queue.add_task(task)\n };\n };\n};\n\nwindow.addEventListener('keyDown', function (e) {\n if (e.altKey) {\n switch (e.keyCode) {\n case 192:\n // tilde - switch tool\n break;\n case 49:\n // 1\n break;\n case 50:\n // 2\n break;\n case 51:\n // 3\n break;\n case 52:\n // 4\n break;\n case 53:\n // 5\n break;\n case 54:\n // 6\n break;\n case 55:\n // 7\n break;\n case 56:\n // 8\n break;\n case 57:\n // 9\n break;\n case 48:\n // 0\n break;\n }\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _preact = require('preact');\n\nvar _redux = require('redux');\n\nvar _reactRedux = require('react-redux');\n\nvar _group = require('../common/group.component');\n\nvar _group2 = _interopRequireDefault(_group);\n\nvar _param = require('../common/param.component');\n\nvar _param2 = _interopRequireDefault(_param);\n\nvar _system = require('./system.actions');\n\nvar systemActions = _interopRequireWildcard(_system);\n\nvar _live = require('../live/live.actions');\n\nvar liveActions = _interopRequireWildcard(_live);\n\nvar _queue = require('../queue/queue.actions');\n\nvar queueActions = _interopRequireWildcard(_queue);\n\nfunction _interopRequireWildcard(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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar cpu_test_task = {\n activity: 'cpu',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar gpu_test_task = {\n activity: 'gpu',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar live_test_task = {\n activity: 'live',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar wait_test_task = {\n activity: 'wait',\n module: 'test',\n dataset: 'test',\n epochs: 1,\n opt: {}\n};\nvar fruits = [\"apple\", \"pear\", \"orange\", \"strawberry\"];\nfunction choice(a) {\n return a[Math.floor(Math.random() * a.length)];\n}\n\nvar System = function (_Component) {\n _inherits(System, _Component);\n\n function System(props) {\n _classCallCheck(this, System);\n\n return _possibleConstructorReturn(this, (System.__proto__ || Object.getPrototypeOf(System)).call(this));\n }\n\n _createClass(System, [{\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n if (this._screen.scrollHeight > this._screen.scrollTop - this._screen.offsetHeight + 100) {\n this._screen.scrollTop = this._screen.scrollHeight;\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n site = _props.site,\n server = _props.server,\n relay = _props.relay,\n runner = _props.runner,\n rpc = _props.rpc,\n actions = _props.actions;\n\n return (0, _preact.h)(\n 'div',\n { className: 'app system' },\n (0, _preact.h)(\n 'div',\n { className: 'heading' },\n (0, _preact.h)(\n 'h1',\n null,\n site.name,\n ' system'\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'row params' },\n (0, _preact.h)(\n 'div',\n { className: 'column' },\n (0, _preact.h)(\n _group2.default,\n { title: 'Status' },\n (0, _preact.h)(\n _param2.default,\n { title: 'Server' },\n server.status\n ),\n server.error && (0, _preact.h)(\n _param2.default,\n { title: 'Server error' },\n server.error.message\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Relay' },\n relay.status\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'RPC' },\n rpc.status\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'CPU' },\n this.renderStatus(runner.cpu)\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'GPU' },\n this.renderStatus(runner.gpu)\n )\n ),\n (0, _preact.h)(\n _group2.default,\n { title: 'Diagnostics' },\n (0, _preact.h)(\n _param2.default,\n { title: 'Check GPU' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('nvidia-smi');\n } },\n 'nvidia-smi'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'List processes' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('ps');\n } },\n 'ps'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'List users' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('w');\n } },\n 'w'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Disk free space' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.run('df');\n } },\n 'df'\n )\n )\n ),\n (0, _preact.h)(\n _group2.default,\n { title: 'Tasks' },\n (0, _preact.h)(\n _param2.default,\n { title: 'Kill task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task('cpu');\n } },\n 'CPU'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task('gpu');\n } },\n 'GPU'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Queue' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_queue();\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_queue();\n } },\n 'Stop'\n )\n )\n ),\n (0, _preact.h)(\n _group2.default,\n { title: 'Test' },\n (0, _preact.h)(\n _param2.default,\n { title: 'CPU Test Task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(cpu_test_task, { preempt: true, watch: true });\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task(runner.cpu.task);\n } },\n 'Stop'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'GPU Test Task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(gpu_test_task, { preempt: true, watch: true });\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task(runner.gpu.task);\n } },\n 'Stop'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Live Test Task' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(live_test_task, { preempt: true, watch: true });\n } },\n 'Start'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.stop_task(runner.cpu.task);\n } },\n 'Stop'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Test Live RPC' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.live.get_params();\n } },\n 'Get'\n ),\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.live.set_param('fruit', choice(fruits));\n } },\n 'Set'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: 'Queue Tests' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.system.enqueue_test_task(choice(fruits));\n } },\n '+Add test task'\n )\n ),\n (0, _preact.h)(\n _param2.default,\n { title: '' },\n (0, _preact.h)(\n 'button',\n { onClick: function onClick() {\n return actions.queue.start_task(wait_test_task, { preempt: true, watch: true });\n } },\n 'Wait and Buzz'\n )\n )\n )\n ),\n this.renderCommandOutput()\n )\n );\n }\n }, {\n key: 'renderStatus',\n value: function renderStatus(processor) {\n if (!processor) {\n return 'unknown';\n }\n if (processor.status === 'IDLE') {\n return 'idle';\n }\n var task = processor.task;\n return task.activity + ' ' + task.module;\n }\n }, {\n key: 'renderCommandOutput',\n value: function renderCommandOutput() {\n var _this2 = this;\n\n var _props2 = this.props,\n cmd = _props2.cmd,\n stdout = _props2.stdout,\n stderr = _props2.stderr;\n\n var output = void 0;\n if (cmd.loading) {\n output = 'Loading: ' + cmd.name;\n } else if (cmd.loaded) {\n if (cmd.error) {\n output = 'Error: ' + cmd.name + '\\n\\n' + JSON.stringify(cmd.error, null, 2);\n } else {\n output = cmd.stdout;\n if (cmd.stderr) {\n output += '\\n\\n_________________________________\\n\\n';\n output += cmd.stderr;\n }\n }\n } else {\n output = stdout;\n if (stderr.length) {\n output += '\\n\\n_________________________________\\n\\n';\n output += stderr;\n }\n }\n return (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { ref: function ref(_ref) {\n return _this2._screen = _ref;\n }, className: 'screen' },\n output\n )\n );\n }\n }]);\n\n return System;\n}(_preact.Component);\n\nvar mapStateToProps = function mapStateToProps(state) {\n return _extends({}, state.system, state.live);\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {\n return {\n actions: {\n system: (0, _redux.bindActionCreators)(systemActions, dispatch),\n queue: (0, _redux.bindActionCreators)(queueActions, dispatch),\n live: (0, _redux.bindActionCreators)(liveActions, dispatch)\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(System);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _types = require('../types');\n\nvar _types2 = _interopRequireDefault(_types);\n\nvar _moment = require('moment/min/moment.min');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar FileSaver = require('file-saver');\n\nvar systemInitialState = {\n loading: false,\n error: null,\n\n site: {\n name: 'loading'\n },\n app: {\n tool: localStorage.getItem('system.last_tool') || 'pix2pix'\n },\n server: {\n connected: false,\n status: \"disconnected\",\n error: null\n },\n relay: {\n connected: false,\n status: \"unknown\",\n error: null\n },\n rpc: {\n connected: false,\n status: \"disconnected\",\n error: null\n },\n cmd: {\n loading: false,\n loaded: false,\n name: null,\n error: null,\n stdout: \"\",\n stderr: \"\"\n },\n runner: {\n cpu: { status: 'IDLE', task: {} },\n gpu: { status: 'IDLE', task: {} }\n },\n stdout: \"\",\n stderr: \"\"\n};\n\nvar modules = ['pix2pix', 'samplernn', 'pix2wav'].reduce(function (a, b) {\n return a[b] = b, a;\n}, {});\n\nvar systemReducer = function systemReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : systemInitialState;\n var action = arguments[1];\n\n // console.log(action.type)\n var processor = null;\n switch (action.type) {\n case _types2.default.socket.connect:\n case _types2.default.socket.reconnecting:\n return _extends({}, state, {\n server: {\n status: 'connected',\n connected: true,\n error: null\n }\n });\n case _types2.default.socket.reconnect:\n return _extends({}, state, {\n server: {\n status: 'reconnecting (attempt ' + action.attempt + ')',\n connected: false,\n error: null\n }\n });\n case _types2.default.socket.connect_error:\n case _types2.default.socket.reconnect_error:\n case _types2.default.socket.disconnect:\n case _types2.default.socket.reconnect_failed:\n return _extends({}, state, {\n server: {\n status: 'disconnected',\n connected: false,\n error: action.error || null\n }\n });\n case _types2.default.socket.error:\n return _extends({}, state, {\n server: _extends({}, state.socket, {\n error: action.error\n })\n });\n case _types2.default.system.relay_connected:\n return _extends({}, state, {\n relay: {\n status: 'connected',\n connected: true,\n error: null\n }\n });\n case _types2.default.system.relay_disconnected:\n return _extends({}, state, {\n relay: {\n status: 'disconnected',\n connected: false,\n error: null\n },\n rpc: {\n status: 'disconnected',\n connected: false,\n error: null\n }\n });\n case _types2.default.system.rpc_connected:\n return _extends({}, state, {\n rpc: {\n status: 'connected',\n connected: true,\n error: null\n },\n runner: action.runner\n });\n case _types2.default.system.rpc_disconnected:\n return _extends({}, state, {\n rpc: {\n status: 'disconnected',\n connected: false,\n error: null\n },\n runner: action.runner || state.runner\n });\n case _types2.default.system.load_site:\n document.querySelector('title').innerHTML = action.site.name + '.cortex';\n var tool = state.app.tool;\n var path = window.location.pathname.split('/')[1];\n if (path in modules) {\n tool = path;\n }\n return _extends({}, state, {\n site: action.site,\n app: _extends({}, state.app, {\n tool: tool\n })\n });\n case _types2.default.system.running_command:\n return _extends({}, state, {\n cmd: {\n loading: true,\n loaded: false,\n name: action.cmd,\n error: null,\n stdout: null,\n stderr: null\n }\n });\n case _types2.default.system.command_output:\n return _extends({}, state, {\n cmd: {\n loading: false,\n loaded: true,\n name: action.data.cmd,\n error: action.data.error,\n stdout: action.data.stdout,\n stderr: action.data.stderr\n }\n });\n case _types2.default.task.task_begin:\n console.log('task begin', action.task, action.task.processor);\n return _extends({}, state, {\n runner: _extends({}, state.runner, _defineProperty({}, action.task.processor, { status: 'RUNNING', task: action.task })),\n cmd: _extends({}, state.cmd, {\n loaded: false,\n stdout: \"\",\n stderr: \"\"\n }),\n stdout: \"\",\n stderr: \"\"\n });\n case _types2.default.task.task_finish:\n if (action.task.processor === 'cpu' || state.runner.cpu.task && state.runner.cpu.task.uuid === action.task.uuid) {\n processor = 'cpu';\n } else if (action.task.processor === 'gpu' || state.runner.gpu.task && state.runner.gpu.task.uuid === action.task.uuid) {\n processor = 'gpu';\n } else {\n processor = null;\n }\n console.log('task finish', action);\n return _extends({}, state, {\n rpc: {\n connected: false,\n status: \"disconnected\",\n error: null\n },\n runner: processor ? _extends({}, state.runner, _defineProperty({}, processor, { status: 'IDLE', task: {} })) : state.runner\n });\n case _types2.default.app.change_tool:\n return _extends({}, state, {\n app: _extends({}, state.app, {\n tool: action.tool\n })\n });\n case _types2.default.system.stdout:\n if (action.data.processor && state.runner[action.data.processor]) {\n return _extends({}, state, {\n runner: _extends({}, state.runner, _defineProperty({}, action.data.processor, _extends({}, state.runner[action.data.processor], {\n last_message: action.data.data\n }))),\n stdout: state.stdout + action.data.data\n });\n }\n return _extends({}, state, {\n stdout: state.stdout + action.data.data\n });\n case _types2.default.system.stderr:\n return _extends({}, state, {\n last_message: action.data.data,\n stderr: state.stderr + action.data.data\n });\n default:\n return state;\n }\n};\n\nexports.default = systemReducer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _crud = require('./api/crud.types');\n\nexports.default = {\n\tsystem: {\n\t\tload_site: 'SYSTEM_LOAD_SITE',\n\t\trunning_command: 'SYSTEM_RUNNING_COMMAND',\n\t\tcommand_output: 'SYSTEM_COMMAND_OUTPUT',\n\t\trelay_connected: 'SYSTEM_RELAY_CONNECTED',\n\t\trelay_disconnected: 'SYSTEM_RELAY_DISCONNECTED',\n\t\trpc_connected: 'SYSTEM_RPC_CONNECTED',\n\t\trpc_disconnected: 'SYSTEM_RPC_DISCONNECTED',\n\t\tlist_directory: 'SYSTEM_LIST_DIRECTORY',\n\t\tlisting_directory: 'SYSTEM_LISTING_DIRECTORY',\n\t\tcount_directory: 'SYSTEM_COUNT_DIRECTORY',\n\t\tcounting_directory: 'SYSTEM_COUNTING_DIRECTORY',\n\t\tstdout: 'SYSTEM_STDOUT',\n\t\tstderr: 'SYSTEM_STDERR'\n\t},\n\tapp: {\n\t\tchange_tool: \"APP_CHANGE_TOOL\",\n\t\tload_progress: \"APP_LOAD_PROGRESS\"\n\t},\n\tfolder: (0, _crud.crud_type)('folder', []),\n\tfile: (0, _crud.crud_type)('file', []),\n\ttask: (0, _crud.crud_type)('task', ['starting_task', 'stopping_task', 'task_begin', 'task_finish', 'start_queue', 'stop_queue', 'starting_queue', 'stopping_queue', 'progress', 'epoch']),\n\tsocket: {\n\t\tconnect: 'SOCKET_CONNECT',\n\t\tconnect_error: 'SOCKET_CONNECT_ERROR',\n\t\treconnect: 'SOCKET_RECONNECT',\n\t\treconnecting: 'SOCKET_RECONNECTING',\n\t\treconnect_error: 'SOCKET_RECONNECT_ERROR',\n\t\treconnect_failed: 'SOCKET_RECONNECT_FAILED',\n\t\tdisconnect: 'SOCKET_DISCONNECT',\n\t\terror: 'SOCKET_ERROR',\n\t\tstatus: 'SOCKET_STATUS',\n\n\t\tload_params: 'SOCKET_LOAD_PARAMS',\n\t\tlist_checkpoints: 'SOCKET_LIST_CHECKPOINTS',\n\t\tlist_sequences: 'SOCKET_LIST_SEQUENCES',\n\t\tlist_epochs: 'SOCKET_LIST_EPOCHS'\n\t},\n\tplayer: {\n\t\tget_params: 'GET_PARAMS',\n\t\tset_param: 'SET_PARAM',\n\n\t\tloading_checkpoints: 'LOADING_CHECKPOINTS',\n\t\tloading_checkpoint: 'LOADING_CHECKPOINT',\n\t\tlist_checkpoints: 'LIST_CHECKPOINTS',\n\n\t\tloading_sequences: 'LOADING_SEQUENCES',\n\t\tloading_sequence: 'LOADING_SEQUENCE',\n\t\tload_sequence: 'LOAD_SEQUENCE',\n\n\t\tloading_epochs: 'LOADING_EPOCHS',\n\t\tload_epoch: 'LOAD_EPOCH',\n\n\t\tset_fps: 'SET_FPS',\n\t\tseeking: 'SEEKING',\n\t\tpausing: 'PAUSING',\n\t\tplaying: 'PLAYING',\n\t\tcurrent_frame: 'CURRENT_FRAME',\n\t\tstart_recording: 'START_RECORDING',\n\t\tadd_record_frame: 'ADD_RECORD_FRAME',\n\t\tsave_frame: 'SAVE_FRAME',\n\t\tsaving_video: 'SAVING_VIDEO',\n\t\tsave_video: 'SAVE_VIDEO',\n\n\t\tset_fullscreen: 'SET_FULLSCREEN'\n\t},\n\taudioPlayer: {\n\t\tplay: 'AUDIO_PLAY',\n\t\tpause: 'AUDIO_PAUSE',\n\t\tresume: 'AUDIO_RESUME',\n\t\tenqueue: 'AUDIO_ENQUEUE'\n\t},\n\tdataset: {\n\t\tload: 'DATASET_LOAD',\n\t\tset_folder: 'DATASET_SET_FOLDER',\n\t\tupload_files: 'DATASET_UPLOAD_FILES',\n\t\tfile_progress: 'DATASET_FILE_PROGRESS',\n\t\tfile_uploaded: 'DATASET_FILE_UPLOADED',\n\t\tfetch_url: 'DATASET_FETCH_URL',\n\t\tfetch_progress: 'DATASET_FETCH_PROGRESS',\n\t\tlist_epochs: 'DATASET_LIST_EPOCHS'\n\t},\n\tsamplernn: {\n\t\tinit: 'SAMPLERNN_INIT',\n\t\tset_folder: 'SAMPLERNN_SET_FOLDER',\n\t\tload_loss: 'SAMPLERNN_LOAD_LOSS',\n\t\tload_graph: 'SAMPLERNN_LOAD_GRAPH'\n\t\t// queue and train\n\t\t// update checkpoint settings\n\t\t// reset checkpoint settings\n\t\t// queue new checkpoint\n\t},\n\tpix2pix: (0, _crud.with_type)('pix2pix', ['init', 'set_folder']),\n\tpix2pixhd: (0, _crud.with_type)('pix2pixhd', ['init', 'set_folder', 'load_results', 'load_dataset_count']),\n\tpix2wav: (0, _crud.with_type)('pix2wav', ['init', 'set_folder']),\n\twav2pix: (0, _crud.with_type)('wav2pix', ['load', 'progress', 'finish', 'zip', 'uploading']),\n\tdashboard: (0, _crud.with_type)('dashboard', ['load']),\n\tmorph: (0, _crud.with_type)('morph', ['load'])\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.timeInSeconds = timeInSeconds;\nexports.gerund = gerund;\nexports.commatize = commatize;\nexports.carbon_date = carbon_date;\nexports.hush_views = hush_views;\nexports.hush_threads = hush_threads;\nexports.hush_size = hush_size;\nexports.hush_null = hush_null;\nexports.get_age = get_age;\nexports.courtesy_s = courtesy_s;\nfunction timeInSeconds(n) {\n return (n / 10).toFixed(1) + ' s.';\n}\nfunction gerund(s) {\n return s.replace(/e?$/, 'ing');\n}\nfunction commatize(n, radix) {\n radix = radix || 1024;\n var nums = [],\n i,\n counter = 0,\n r = Math.floor;\n if (n > radix) {\n n /= radix;\n nums.unshift(r(n * 10 % 10));\n nums.unshift(\".\");\n }\n do {\n i = n % 10;\n n = r(n / 10);\n if (n && !(++counter % 3)) {\n i = ' ' + r(i);\n }\n nums.unshift(r(i));\n } while (n);\n return nums.join(\"\");\n}\nfunction carbon_date(date, no_bold) {\n var span = (+new Date() - new Date(date)) / 1000,\n color;\n if (!no_bold && span < 86400) // modified today\n {\n color = \"new\";\n } else if (span < 604800) // modifed this week\n {\n color = \"recent\";\n } else if (span < 1209600) // modifed 2 weeks ago\n {\n color = \"med\";\n } else if (span < 3024000) // modifed 5 weeks ago\n {\n color = \"old\";\n } else if (span < 12315200) // modifed 6 months ago\n {\n color = \"older\";\n } else {\n color = \"quiet\";\n }\n return color;\n}\nfunction hush_views(n, bias, no_bold) {\n var txt = commatize(n, 1000);\n bias = bias || 1;\n n = n || 0;\n if (n < 30) {\n return [\"quiet\", n + \" v.\"];\n }\n if (n < 200) {\n return [\"quiet\", txt + \" v.\"];\n } else if (n < 500) {\n return [\"quiet\", txt + \" v.\"];\n } else if (n < 1000) {\n return [\"old\", txt + \" v.\"];\n } else if (n < 5000) {\n return [\"med\", txt + \" kv.\"];\n } else if (no_bold || n < 10000) {\n return [\"recent\", txt + \" kv.\"];\n } else {\n return [\"new\", txt + \" kv.\"];\n }\n}\nfunction hush_threads(n, bias, no_bold) {\n var txt = commatize(n, 1000);\n bias = bias || 1;\n n = n || 0;\n if (n < 10) {\n return [\"quiet\", n + \" t.\"];\n } else if (n < 25) {\n return [\"old\", txt + \" t.\"];\n } else if (n < 50) {\n return [\"med\", txt + \" t.\"];\n } else if (no_bold || n < 100) {\n return [\"recent\", txt + \" t.\"];\n } else {\n return [\"new\", txt + \" t.\"];\n }\n}\nfunction hush_size(n, bias, no_bold) {\n var txt = commatize(Math.round(n / 1024));\n bias = 1 || bias;\n n = n || 0;\n if (!n) {\n return ['', ''];\n }\n if (n < 1000) {\n return [\"quiet\", n + \" b.\"];\n }\n if (n < 1000000) {\n return [\"quiet\", txt + \" kb.\"];\n } else if (n < 20000000 / bias) {\n return [\"quiet\", txt + \" mb.\"];\n } else if (n < 50000000 / bias) {\n return [\"old\", txt + \" mb.\"];\n } else if (n < 80000000 / bias) {\n return [\"med\", txt + \" mb.\"];\n } else if (no_bold || n < 170000000 / bias) {\n return [\"recent\", txt + \" mb.\"];\n } else {\n return [\"new\", txt + \" mb.\"];\n }\n}\nfunction hush_null(n, unit, no_bold) {\n var s = unit ? n + \" \" + unit + \".\" : n;\n if (n < 3) {\n return [\"quiet\", s];\n } else if (n < 6) {\n return [\"older\", s];\n } else if (n < 10) {\n return [\"old\", s];\n } else if (n < 16) {\n return [\"med\", s];\n } else if (no_bold || n < 21) {\n return [\"recent\", s];\n } else {\n return [\"new\", s];\n }\n}\nfunction get_age(t) {\n var age = Math.abs(+Date.now() - new Date(t)) / 1000;\n var r = Math.floor;\n var m;\n if (age < 5) {\n return \"now\";\n }\n if (age < 60) {\n return r(age) + \"s\";\n }\n age /= 60;\n if (age < 60) {\n return r(age) + \"m\";\n }\n m = r(age % 60);\n age /= 60;\n if (m > 0 && age < 2) {\n return r(age) + \"h\" + m + \"m\";\n }\n if (age < 24) {\n return r(age) + \"h\";\n }\n age /= 24;\n if (age < 7) {\n return r(age) + \"d\";\n }\n age /= 7;\n if (age < 12) {\n return r(age) + \"w\";\n }\n age /= 4;\n if (age < 12) {\n return r(age) + \"m\";\n }\n age /= 12;\n return r(age) + \"y\";\n}\nfunction courtesy_s(n, s) {\n return n == 1 ? \"\" : s || \"s\";\n}","'use strict';\n\n/**\n * HiDPI Canvas Polyfill (1.0.10)\n *\n * Author: Jonathan D. Johnson (http://jondavidjohn.com)\n * Homepage: https://github.com/jondavidjohn/hidpi-canvas-polyfill\n * Issue Tracker: https://github.com/jondavidjohn/hidpi-canvas-polyfill/issues\n * License: Apache-2.0\n*/\n(function (prototype) {\n\n var pixelRatio = function () {\n var canvas = window.document.createElement('canvas'),\n context = canvas.getContext('2d'),\n backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;\n\n return (window.devicePixelRatio || 1) / backingStore;\n }(),\n forEach = function forEach(obj, func) {\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n func(obj[p], p);\n }\n }\n },\n ratioArgs = {\n 'fillRect': 'all',\n 'clearRect': 'all',\n 'strokeRect': 'all',\n 'moveTo': 'all',\n 'lineTo': 'all',\n 'arc': [0, 1, 2],\n 'arcTo': 'all',\n 'bezierCurveTo': 'all',\n 'isPointinPath': 'all',\n 'isPointinStroke': 'all',\n 'quadraticCurveTo': 'all',\n 'rect': 'all',\n 'translate': 'all',\n 'createRadialGradient': 'all',\n 'createLinearGradient': 'all'\n };\n\n if (pixelRatio === 1) return;\n\n forEach(ratioArgs, function (value, key) {\n prototype[key] = function (_super) {\n return function () {\n var i,\n len,\n args = Array.prototype.slice.call(arguments);\n\n if (value === 'all') {\n args = args.map(function (a) {\n return a * pixelRatio;\n });\n } else if (Array.isArray(value)) {\n for (i = 0, len = value.length; i < len; i++) {\n args[value[i]] *= pixelRatio;\n }\n }\n\n return _super.apply(this, args);\n };\n }(prototype[key]);\n });\n\n // Stroke lineWidth adjustment\n prototype.stroke = function (_super) {\n return function () {\n this.lineWidth *= pixelRatio;\n _super.apply(this, arguments);\n this.lineWidth /= pixelRatio;\n };\n }(prototype.stroke);\n\n // Text\n //\n prototype.fillText = function (_super) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n\n args[1] *= pixelRatio; // x\n args[2] *= pixelRatio; // y\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m * pixelRatio + u;\n });\n\n _super.apply(this, args);\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m / pixelRatio + u;\n });\n };\n }(prototype.fillText);\n\n prototype.strokeText = function (_super) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n\n args[1] *= pixelRatio; // x\n args[2] *= pixelRatio; // y\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m * pixelRatio + u;\n });\n\n _super.apply(this, args);\n\n this.font = this.font.replace(/(\\d+)(px|em|rem|pt)/g, function (w, m, u) {\n return m / pixelRatio + u;\n });\n };\n }(prototype.strokeText);\n})(window.CanvasRenderingContext2D.prototype);\n;(function (prototype) {\n prototype.getContext = function (_super) {\n return function (type) {\n var backingStore, ratio, context;\n\n if (type == '2d-lodpi') {\n context = _super.call(this, '2d');\n } else if (type === '2d') {\n context = _super.call(this, '2d');\n\n backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;\n\n ratio = (window.devicePixelRatio || 1) / backingStore;\n\n if (ratio > 1) {\n this.style.height = this.height + 'px';\n this.style.width = this.width + 'px';\n this.width *= ratio;\n this.height *= ratio;\n }\n } else {\n context = _super.call(this, type);\n }\n\n return context;\n };\n }(prototype.getContext);\n})(window.HTMLCanvasElement.prototype);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _sort = require('./sort');\n\nvar sort = _interopRequireWildcard(_sort);\n\nvar _format = require('./format');\n\nvar format = _interopRequireWildcard(_format);\n\nvar _math = require('./math');\n\nvar maths = _interopRequireWildcard(_math);\n\nrequire('./hidpi-canvas');\n\nfunction _interopRequireWildcard(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; } }\n\nvar is_iphone = !!(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i));\nvar is_ipad = !!navigator.userAgent.match(/iPad/i);\nvar is_android = !!navigator.userAgent.match(/Android/i);\nvar is_mobile = is_iphone || is_ipad || is_android;\nvar is_desktop = !is_mobile;\n\nvar htmlClassList = document.body.parentNode.classList;\nhtmlClassList.add(is_desktop ? 'desktop' : 'mobile');\nhtmlClassList.remove('loading');\n\n// window.debug = false\n\nvar allProgress = function allProgress(promises, progress_cb) {\n var d = 0;\n progress_cb(0, 0, promises.length);\n promises.forEach(function (p) {\n p.then(function (s) {\n d += 1;\n progress_cb(Math.floor(d * 100 / promises.length), d, promises.length);\n return s;\n });\n });\n return Promise.all(promises);\n};\n\ndocument.body.style.backgroundImage = 'linear-gradient(' + (maths.randint(40) + 40) + 'deg, #fde, #ffe)';\n\nvar fieldSet = function fieldSet(defaultFields) {\n return function (fields) {\n if (fields) {\n if (fields instanceof Set) {\n return fields;\n }\n return new Set(fields.split(' '));\n }\n return defaultFields;\n };\n};\n\nexports.default = _extends({}, maths, format, {\n sort: sort,\n allProgress: allProgress, fieldSet: fieldSet,\n is_iphone: is_iphone, is_ipad: is_ipad, is_android: is_android, is_mobile: is_mobile, is_desktop: is_desktop\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.randrange = randrange;\nexports.randsign = randsign;\nexports.choice = choice;\nexports.angle = angle;\nexports.dist = dist;\nexports.xor = xor;\nexports.quantize = quantize;\nexports.shuffle = shuffle;\nexports.gaussian = gaussian;\nvar mod = exports.mod = function mod(n, m) {\n return n - m * Math.floor(n / m);\n};\nvar clamp = exports.clamp = function clamp(n, a, b) {\n return n < a ? a : n < b ? n : b;\n};\nvar norm = exports.norm = function norm(n, a, b) {\n return (n - a) / (b - a);\n};\nvar lerp = exports.lerp = function lerp(n, a, b) {\n return (b - a) * n + a;\n};\nvar mix = exports.mix = function mix(n, a, b) {\n return a * (1 - n) + b * n;\n};\nvar randint = exports.randint = function randint(n) {\n return Math.floor(Math.random() * n);\n};\nfunction randrange(a, b) {\n return Math.random() * (b - a) + a;\n}\nfunction randsign() {\n return Math.random() >= 0.5 ? -1 : 1;\n}\nfunction choice(a) {\n return a[Math.floor(Math.random() * a.length)];\n}\nfunction angle(x0, y0, x1, y1) {\n return Math.atan2(y1 - y0, x1 - x0);\n}\nfunction dist(x0, y0, x1, y1) {\n return Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));\n}\nfunction xor(a, b) {\n a = !!a;b = !!b;return (a || b) && !(a && b);\n}\nfunction quantize(a, b) {\n return Math.floor(a / b) * b;\n}\nfunction shuffle(a) {\n for (var i = a.length; i > 0; i--) {\n var r = randint(i);\n var swap = a[i - 1];\n a[i - 1] = a[r];\n a[r] = swap;\n }\n return a;\n}\n// returns a gaussian random function with the given mean and stdev.\nfunction gaussian(mean, stdev) {\n var y2 = void 0;\n var use_last = false;\n return function () {\n var y1 = void 0;\n if (use_last) {\n y1 = y2;\n use_last = false;\n } else {\n var x1 = void 0,\n x2 = void 0,\n w = void 0;\n do {\n x1 = 2.0 * Math.random() - 1.0;\n x2 = 2.0 * Math.random() - 1.0;\n w = x1 * x1 + x2 * x2;\n } while (w >= 1.0);\n w = Math.sqrt(-2.0 * Math.log(w) / w);\n y1 = x1 * w;\n y2 = x2 * w;\n use_last = true;\n }\n\n var retval = mean + stdev * y1;\n if (retval > 0) return retval;\n return -retval;\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar numericSort = exports.numericSort = {\n asc: function asc(a, b) {\n return a[0] - b[0];\n },\n desc: function desc(a, b) {\n return b[0] - a[0];\n }\n};\nvar stringSort = exports.stringSort = {\n asc: function asc(a, b) {\n return a[0].localeCompare(b[0]);\n },\n desc: function desc(a, b) {\n return b[0].localeCompare(a[0]);\n }\n};\nvar orderByFn = exports.orderByFn = function orderByFn() {\n var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'name asc';\n\n var _s$split = s.split(' '),\n _s$split2 = _slicedToArray(_s$split, 2),\n _s$split2$ = _s$split2[0],\n field = _s$split2$ === undefined ? 'name' : _s$split2$,\n _s$split2$2 = _s$split2[1],\n direction = _s$split2$2 === undefined ? 'asc' : _s$split2$2;\n\n var mapFn = void 0,\n sortFn = void 0;\n switch (field) {\n case 'epoch':\n mapFn = function mapFn(a) {\n return [parseInt(a.epoch || a.epochs) || 0, a];\n };\n sortFn = numericSort[direction];\n break;\n case 'size':\n mapFn = function mapFn(a) {\n return [parseInt(a.size) || 0, a];\n };\n sortFn = numericSort[direction];\n break;\n case 'date':\n mapFn = function mapFn(a) {\n return [+new Date(a.date || a.created_at), a];\n };\n sortFn = numericSort[direction];\n break;\n case 'updated_at':\n mapFn = function mapFn(a) {\n return [+new Date(a.updated_at), a];\n };\n sortFn = numericSort[direction];\n break;\n case 'priority':\n mapFn = function mapFn(a) {\n return [parseInt(a.priority) || parseInt(a.id) || 1000, a];\n };\n sortFn = numericSort[direction];\n case 'name':\n default:\n mapFn = function mapFn(a) {\n return [a.name || \"\", a];\n };\n sortFn = stringSort[direction];\n break;\n }\n return { mapFn: mapFn, sortFn: sortFn };\n};","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n if (script) {\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n if (options.charset) {\n jsonpScript.setAttribute('charset', options.charset);\n }\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + _url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n window[callbackFunction] = function () {\n clearFunction(callbackFunction);\n };\n }, timeout);\n\n // Caught if got 404/500\n jsonpScript.onerror = function () {\n reject(new Error('JSONP request to ' + _url + ' failed'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n if (timeoutId) clearTimeout(timeoutId);\n };\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","'use strict';\n\nfunction FFT(size) {\n this.size = size | 0;\n if (this.size <= 1 || (this.size & (this.size - 1)) !== 0)\n throw new Error('FFT size must be a power of two and bigger than 1');\n\n this._csize = size << 1;\n\n // NOTE: Use of `var` is intentional for old V8 versions\n var table = new Array(this.size * 2);\n for (var i = 0; i < table.length; i += 2) {\n const angle = Math.PI * i / this.size;\n table[i] = Math.cos(angle);\n table[i + 1] = -Math.sin(angle);\n }\n this.table = table;\n\n // Find size's power of two\n var power = 0;\n for (var t = 1; this.size > t; t <<= 1)\n power++;\n\n // Calculate initial step's width:\n // * If we are full radix-4 - it is 2x smaller to give inital len=8\n // * Otherwise it is the same as `power` to give len=4\n this._width = power % 2 === 0 ? power - 1 : power;\n\n // Pre-compute bit-reversal patterns\n this._bitrev = new Array(1 << this._width);\n for (var j = 0; j < this._bitrev.length; j++) {\n this._bitrev[j] = 0;\n for (var shift = 0; shift < this._width; shift += 2) {\n var revShift = this._width - shift - 2;\n this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\n }\n }\n\n this._out = null;\n this._data = null;\n this._inv = 0;\n}\nmodule.exports = FFT;\n\nFFT.prototype.fromComplexArray = function fromComplexArray(complex, storage) {\n var res = storage || new Array(complex.length >>> 1);\n for (var i = 0; i < complex.length; i += 2)\n res[i >>> 1] = complex[i];\n return res;\n};\n\nFFT.prototype.createComplexArray = function createComplexArray() {\n const res = new Array(this._csize);\n for (var i = 0; i < res.length; i++)\n res[i] = 0;\n return res;\n};\n\nFFT.prototype.toComplexArray = function toComplexArray(input, storage) {\n var res = storage || this.createComplexArray();\n for (var i = 0; i < res.length; i += 2) {\n res[i] = input[i >>> 1];\n res[i + 1] = 0;\n }\n return res;\n};\n\nFFT.prototype.completeSpectrum = function completeSpectrum(spectrum) {\n var size = this._csize;\n var half = size >>> 1;\n for (var i = 2; i < half; i += 2) {\n spectrum[size - i] = spectrum[i];\n spectrum[size - i + 1] = -spectrum[i + 1];\n }\n};\n\nFFT.prototype.transform = function transform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._out = out;\n this._data = data;\n this._inv = 0;\n this._transform4();\n this._out = null;\n this._data = null;\n};\n\nFFT.prototype.realTransform = function realTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._out = out;\n this._data = data;\n this._inv = 0;\n this._realTransform4();\n this._out = null;\n this._data = null;\n};\n\nFFT.prototype.inverseTransform = function inverseTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._out = out;\n this._data = data;\n this._inv = 1;\n this._transform4();\n for (var i = 0; i < out.length; i++)\n out[i] /= this.size;\n this._out = null;\n this._data = null;\n};\n\n// radix-4 implementation\n//\n// NOTE: Uses of `var` are intentional for older V8 version that do not\n// support both `let compound assignments` and `const phi`\nFFT.prototype._transform4 = function _transform4() {\n var out = this._out;\n var size = this._csize;\n\n // Initial step (permute and transform)\n var width = this._width;\n var step = 1 << width;\n var len = (size / step) << 1;\n\n var outOff;\n var t;\n var bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleTransform2(outOff, off, step);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleTransform4(outOff, off, step);\n }\n }\n\n // Loop through steps in decreasing order\n var inv = this._inv ? -1 : 1;\n var table = this.table;\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n var quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n var limit = outOff + quarterLen;\n for (var i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n // Middle values\n const MAr = Ar;\n const MAi = Ai;\n\n const tableBr = table[k];\n const tableBi = inv * table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = table[2 * k];\n const tableCi = inv * table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = table[3 * k];\n const tableDi = inv * table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = MAr + MCr;\n const T0i = MAi + MCi;\n const T1r = MAr - MCr;\n const T1i = MAi - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n const FAr = T0r + T2r;\n const FAi = T0i + T2i;\n\n const FCr = T0r - T2r;\n const FCi = T0i - T2i;\n\n const FBr = T1r + T3i;\n const FBi = T1i - T3r;\n\n const FDr = T1r - T3i;\n const FDi = T1i + T3r;\n\n out[A] = FAr;\n out[A + 1] = FAi;\n out[B] = FBr;\n out[B + 1] = FBi;\n out[C] = FCr;\n out[C + 1] = FCi;\n out[D] = FDr;\n out[D + 1] = FDi;\n }\n }\n }\n};\n\n// radix-2 implementation\n//\n// NOTE: Only called for len=4\nFFT.prototype._singleTransform2 = function _singleTransform2(outOff, off,\n step) {\n const out = this._out;\n const data = this._data;\n\n const evenR = data[off];\n const evenI = data[off + 1];\n const oddR = data[off + step];\n const oddI = data[off + step + 1];\n\n const leftR = evenR + oddR;\n const leftI = evenI + oddI;\n const rightR = evenR - oddR;\n const rightI = evenI - oddI;\n\n out[outOff] = leftR;\n out[outOff + 1] = leftI;\n out[outOff + 2] = rightR;\n out[outOff + 3] = rightI;\n};\n\n// radix-4\n//\n// NOTE: Only called for len=8\nFFT.prototype._singleTransform4 = function _singleTransform4(outOff, off,\n step) {\n const out = this._out;\n const data = this._data;\n const inv = this._inv ? -1 : 1;\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Ai = data[off + 1];\n const Br = data[off + step];\n const Bi = data[off + step + 1];\n const Cr = data[off + step2];\n const Ci = data[off + step2 + 1];\n const Dr = data[off + step3];\n const Di = data[off + step3 + 1];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T0i = Ai + Ci;\n const T1r = Ar - Cr;\n const T1i = Ai - Ci;\n const T2r = Br + Dr;\n const T2i = Bi + Di;\n const T3r = inv * (Br - Dr);\n const T3i = inv * (Bi - Di);\n\n // Final values\n const FAr = T0r + T2r;\n const FAi = T0i + T2i;\n\n const FBr = T1r + T3i;\n const FBi = T1i - T3r;\n\n const FCr = T0r - T2r;\n const FCi = T0i - T2i;\n\n const FDr = T1r - T3i;\n const FDi = T1i + T3r;\n\n out[outOff] = FAr;\n out[outOff + 1] = FAi;\n out[outOff + 2] = FBr;\n out[outOff + 3] = FBi;\n out[outOff + 4] = FCr;\n out[outOff + 5] = FCi;\n out[outOff + 6] = FDr;\n out[outOff + 7] = FDi;\n};\n\n// Real input radix-4 implementation\nFFT.prototype._realTransform4 = function _realTransform4() {\n var out = this._out;\n var size = this._csize;\n\n // Initial step (permute and transform)\n var width = this._width;\n var step = 1 << width;\n var len = (size / step) << 1;\n\n var outOff;\n var t;\n var bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleRealTransform2(outOff, off >>> 1, step >>> 1);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n const off = bitrev[t];\n this._singleRealTransform4(outOff, off >>> 1, step >>> 1);\n }\n }\n\n // Loop through steps in decreasing order\n var inv = this._inv ? -1 : 1;\n var table = this.table;\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n var halfLen = len >>> 1;\n var quarterLen = halfLen >>> 1;\n var hquarterLen = quarterLen >>> 1;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n for (var i = 0, k = 0; i <= hquarterLen; i += 2, k += step) {\n var A = outOff + i;\n var B = A + quarterLen;\n var C = B + quarterLen;\n var D = C + quarterLen;\n\n // Original values\n var Ar = out[A];\n var Ai = out[A + 1];\n var Br = out[B];\n var Bi = out[B + 1];\n var Cr = out[C];\n var Ci = out[C + 1];\n var Dr = out[D];\n var Di = out[D + 1];\n\n // Middle values\n var MAr = Ar;\n var MAi = Ai;\n\n var tableBr = table[k];\n var tableBi = inv * table[k + 1];\n var MBr = Br * tableBr - Bi * tableBi;\n var MBi = Br * tableBi + Bi * tableBr;\n\n var tableCr = table[2 * k];\n var tableCi = inv * table[2 * k + 1];\n var MCr = Cr * tableCr - Ci * tableCi;\n var MCi = Cr * tableCi + Ci * tableCr;\n\n var tableDr = table[3 * k];\n var tableDi = inv * table[3 * k + 1];\n var MDr = Dr * tableDr - Di * tableDi;\n var MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n var T0r = MAr + MCr;\n var T0i = MAi + MCi;\n var T1r = MAr - MCr;\n var T1i = MAi - MCi;\n var T2r = MBr + MDr;\n var T2i = MBi + MDi;\n var T3r = inv * (MBr - MDr);\n var T3i = inv * (MBi - MDi);\n\n // Final values\n var FAr = T0r + T2r;\n var FAi = T0i + T2i;\n\n var FBr = T1r + T3i;\n var FBi = T1i - T3r;\n\n out[A] = FAr;\n out[A + 1] = FAi;\n out[B] = FBr;\n out[B + 1] = FBi;\n\n // Output final middle point\n if (i === 0) {\n var FCr = T0r - T2r;\n var FCi = T0i - T2i;\n out[C] = FCr;\n out[C + 1] = FCi;\n continue;\n }\n\n // Do not overwrite ourselves\n if (i === hquarterLen)\n continue;\n\n // In the flipped case:\n // MAi = -MAi\n // MBr=-MBi, MBi=-MBr\n // MCr=-MCr\n // MDr=MDi, MDi=MDr\n var ST0r = T1r;\n var ST0i = -T1i;\n var ST1r = T0r;\n var ST1i = -T0i;\n var ST2r = -inv * T3i;\n var ST2i = -inv * T3r;\n var ST3r = -inv * T2i;\n var ST3i = -inv * T2r;\n\n var SFAr = ST0r + ST2r;\n var SFAi = ST0i + ST2i;\n\n var SFBr = ST1r + ST3i;\n var SFBi = ST1i - ST3r;\n\n var SA = outOff + quarterLen - i;\n var SB = outOff + halfLen - i;\n\n out[SA] = SFAr;\n out[SA + 1] = SFAi;\n out[SB] = SFBr;\n out[SB + 1] = SFBi;\n }\n }\n }\n};\n\n// radix-2 implementation\n//\n// NOTE: Only called for len=4\nFFT.prototype._singleRealTransform2 = function _singleRealTransform2(outOff,\n off,\n step) {\n const out = this._out;\n const data = this._data;\n\n const evenR = data[off];\n const oddR = data[off + step];\n\n const leftR = evenR + oddR;\n const rightR = evenR - oddR;\n\n out[outOff] = leftR;\n out[outOff + 1] = 0;\n out[outOff + 2] = rightR;\n out[outOff + 3] = 0;\n};\n\n// radix-4\n//\n// NOTE: Only called for len=8\nFFT.prototype._singleRealTransform4 = function _singleRealTransform4(outOff,\n off,\n step) {\n const out = this._out;\n const data = this._data;\n const inv = this._inv ? -1 : 1;\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Br = data[off + step];\n const Cr = data[off + step2];\n const Dr = data[off + step3];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T1r = Ar - Cr;\n const T2r = Br + Dr;\n const T3r = inv * (Br - Dr);\n\n // Final values\n const FAr = T0r + T2r;\n\n const FBr = T1r;\n const FBi = -T3r;\n\n const FCr = T0r - T2r;\n\n const FDr = T1r;\n const FDi = T3r;\n\n out[outOff] = FAr;\n out[outOff + 1] = 0;\n out[outOff + 2] = FBr;\n out[outOff + 3] = FBi;\n out[outOff + 4] = FCr;\n out[outOff + 5] = 0;\n out[outOff + 6] = FDr;\n out[outOff + 7] = FDi;\n};\n","/* FileSaver.js\n * A saveAs() FileSaver implementation.\n * 1.3.2\n * 2016-06-16 18:25:19\n *\n * By Eli Grey, http://eligrey.com\n * License: MIT\n * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n */\n\n/*global self */\n/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */\n\n/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */\n\nvar saveAs = saveAs || (function(view) {\n\t\"use strict\";\n\t// IE <10 is explicitly unsupported\n\tif (typeof view === \"undefined\" || typeof navigator !== \"undefined\" && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n\t\treturn;\n\t}\n\tvar\n\t\t doc = view.document\n\t\t // only get URL when necessary in case Blob.js hasn't overridden it yet\n\t\t, get_URL = function() {\n\t\t\treturn view.URL || view.webkitURL || view;\n\t\t}\n\t\t, save_link = doc.createElementNS(\"http://www.w3.org/1999/xhtml\", \"a\")\n\t\t, can_use_save_link = \"download\" in save_link\n\t\t, click = function(node) {\n\t\t\tvar event = new MouseEvent(\"click\");\n\t\t\tnode.dispatchEvent(event);\n\t\t}\n\t\t, is_safari = /constructor/i.test(view.HTMLElement) || view.safari\n\t\t, is_chrome_ios =/CriOS\\/[\\d]+/.test(navigator.userAgent)\n\t\t, throw_outside = function(ex) {\n\t\t\t(view.setImmediate || view.setTimeout)(function() {\n\t\t\t\tthrow ex;\n\t\t\t}, 0);\n\t\t}\n\t\t, force_saveable_type = \"application/octet-stream\"\n\t\t// the Blob API is fundamentally broken as there is no \"downloadfinished\" event to subscribe to\n\t\t, arbitrary_revoke_timeout = 1000 * 40 // in ms\n\t\t, revoke = function(file) {\n\t\t\tvar revoker = function() {\n\t\t\t\tif (typeof file === \"string\") { // file is an object URL\n\t\t\t\t\tget_URL().revokeObjectURL(file);\n\t\t\t\t} else { // file is a File\n\t\t\t\t\tfile.remove();\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetTimeout(revoker, arbitrary_revoke_timeout);\n\t\t}\n\t\t, dispatch = function(filesaver, event_types, event) {\n\t\t\tevent_types = [].concat(event_types);\n\t\t\tvar i = event_types.length;\n\t\t\twhile (i--) {\n\t\t\t\tvar listener = filesaver[\"on\" + event_types[i]];\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener.call(filesaver, event || filesaver);\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthrow_outside(ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t, auto_bom = function(blob) {\n\t\t\t// prepend BOM for UTF-8 XML and text/* types (including HTML)\n\t\t\t// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n\t\t\tif (/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n\t\t\t\treturn new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});\n\t\t\t}\n\t\t\treturn blob;\n\t\t}\n\t\t, FileSaver = function(blob, name, no_auto_bom) {\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\t// First try a.download, then web filesystem, then object URLs\n\t\t\tvar\n\t\t\t\t filesaver = this\n\t\t\t\t, type = blob.type\n\t\t\t\t, force = type === force_saveable_type\n\t\t\t\t, object_url\n\t\t\t\t, dispatch_all = function() {\n\t\t\t\t\tdispatch(filesaver, \"writestart progress write writeend\".split(\" \"));\n\t\t\t\t}\n\t\t\t\t// on any filesys errors revert to saving with object URLs\n\t\t\t\t, fs_error = function() {\n\t\t\t\t\tif ((is_chrome_ios || (force && is_safari)) && view.FileReader) {\n\t\t\t\t\t\t// Safari doesn't allow downloading of blob urls\n\t\t\t\t\t\tvar reader = new FileReader();\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');\n\t\t\t\t\t\t\tvar popup = view.open(url, '_blank');\n\t\t\t\t\t\t\tif(!popup) view.location.href = url;\n\t\t\t\t\t\t\turl=undefined; // release reference before dispatching\n\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\tdispatch_all();\n\t\t\t\t\t\t};\n\t\t\t\t\t\treader.readAsDataURL(blob);\n\t\t\t\t\t\tfilesaver.readyState = filesaver.INIT;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// don't create more object URLs than needed\n\t\t\t\t\tif (!object_url) {\n\t\t\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t\t}\n\t\t\t\t\tif (force) {\n\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar opened = view.open(object_url, \"_blank\");\n\t\t\t\t\t\tif (!opened) {\n\t\t\t\t\t\t\t// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html\n\t\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t}\n\t\t\t;\n\t\t\tfilesaver.readyState = filesaver.INIT;\n\n\t\t\tif (can_use_save_link) {\n\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsave_link.href = object_url;\n\t\t\t\t\tsave_link.download = name;\n\t\t\t\t\tclick(save_link);\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs_error();\n\t\t}\n\t\t, FS_proto = FileSaver.prototype\n\t\t, saveAs = function(blob, name, no_auto_bom) {\n\t\t\treturn new FileSaver(blob, name || blob.name || \"download\", no_auto_bom);\n\t\t}\n\t;\n\t// IE 10+ (native saveAs)\n\tif (typeof navigator !== \"undefined\" && navigator.msSaveOrOpenBlob) {\n\t\treturn function(blob, name, no_auto_bom) {\n\t\t\tname = name || blob.name || \"download\";\n\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\treturn navigator.msSaveOrOpenBlob(blob, name);\n\t\t};\n\t}\n\n\tFS_proto.abort = function(){};\n\tFS_proto.readyState = FS_proto.INIT = 0;\n\tFS_proto.WRITING = 1;\n\tFS_proto.DONE = 2;\n\n\tFS_proto.error =\n\tFS_proto.onwritestart =\n\tFS_proto.onprogress =\n\tFS_proto.onwrite =\n\tFS_proto.onabort =\n\tFS_proto.onerror =\n\tFS_proto.onwriteend =\n\t\tnull;\n\n\treturn saveAs;\n}(\n\t typeof self !== \"undefined\" && self\n\t|| typeof window !== \"undefined\" && window\n\t|| this.content\n));\n// `self` is undefined in Firefox for Android content script context\n// while `this` is nsIContentFrameMessageManager\n// with an attribute `content` that corresponds to the window\n\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports.saveAs = saveAs;\n} else if ((typeof define !== \"undefined\" && define !== null) && (define.amd !== null)) {\n define(\"FileSaver.js\", function() {\n return saveAs;\n });\n}\n","'use strict';\n\nexports.__esModule = true;\nvar canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nvar addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {\n return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);\n};\n\nvar removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {\n return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);\n};\n\nvar getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) {\n return callback(window.confirm(message));\n}; // eslint-disable-line no-alert\n\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\nvar supportsHistory = exports.supportsHistory = function supportsHistory() {\n var ua = window.navigator.userAgent;\n\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n\n return window.history && 'pushState' in window.history;\n};\n\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\nvar supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n};\n\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\nvar supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n};\n\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\nvar isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n};","'use strict';\n\nexports.__esModule = true;\nexports.locationsAreEqual = exports.createLocation = undefined;\n\nvar _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; };\n\nvar _resolvePathname = require('resolve-pathname');\n\nvar _resolvePathname2 = _interopRequireDefault(_resolvePathname);\n\nvar _valueEqual = require('value-equal');\n\nvar _valueEqual2 = _interopRequireDefault(_valueEqual);\n\nvar _PathUtils = require('./PathUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) {\n var location = void 0;\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = (0, _PathUtils.parsePath)(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n};\n\nvar locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state);\n};","'use strict';\n\nexports.__esModule = true;\nvar addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n};\n\nvar stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n};\n\nvar hasBasename = exports.hasBasename = function hasBasename(path, prefix) {\n return new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path);\n};\n\nvar stripBasename = exports.stripBasename = function stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n};\n\nvar stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n};\n\nvar parsePath = exports.parsePath = function parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n\n var hashIndex = pathname.indexOf('#');\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nvar createPath = exports.createPath = function createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n\n\n var path = pathname || '/';\n\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;\n\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;\n\n return path;\n};","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _PathUtils = require('./PathUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nvar _DOMUtils = require('./DOMUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nvar getHistoryState = function getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n};\n\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\nvar createBrowserHistory = function createBrowserHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM');\n\n var globalHistory = window.history;\n var canUseHistory = (0, _DOMUtils.supportsHistory)();\n var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)();\n\n var _props$forceRefresh = props.forceRefresh,\n forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,\n _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';\n\n var getDOMLocation = function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n\n\n var path = pathname + search + hash;\n\n (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = (0, _PathUtils.stripBasename)(path, basename);\n\n return (0, _LocationUtils.createLocation)(path, state, key);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var handlePopState = function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return;\n\n handlePop(getDOMLocation(event.state));\n };\n\n var handleHashChange = function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n };\n\n var forceNextPop = false;\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allKeys.indexOf(fromLocation.key);\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return basename + (0, _PathUtils.createPath)(location);\n };\n\n var push = function push(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.pushState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextKeys.push(location.key);\n allKeys = nextKeys;\n\n setState({ action: action, location: location });\n }\n } else {\n (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n\n window.location.href = href;\n }\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.replaceState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n\n setState({ action: action, location: location });\n }\n } else {\n (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n\n window.location.replace(href);\n }\n });\n };\n\n var go = function go(n) {\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createBrowserHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _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; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _PathUtils = require('./PathUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nvar _DOMUtils = require('./DOMUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HashChangeEvent = 'hashchange';\n\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: _PathUtils.stripLeadingSlash,\n decodePath: _PathUtils.addLeadingSlash\n },\n slash: {\n encodePath: _PathUtils.addLeadingSlash,\n decodePath: _PathUtils.addLeadingSlash\n }\n};\n\nvar getHashPath = function getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n};\n\nvar pushHashPath = function pushHashPath(path) {\n return window.location.hash = path;\n};\n\nvar replaceHashPath = function replaceHashPath(path) {\n var hashIndex = window.location.href.indexOf('#');\n\n window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);\n};\n\nvar createHashHistory = function createHashHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM');\n\n var globalHistory = window.history;\n var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();\n\n var _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,\n _props$hashType = props.hashType,\n hashType = _props$hashType === undefined ? 'slash' : _props$hashType;\n\n var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';\n\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n\n var getDOMLocation = function getDOMLocation() {\n var path = decodePath(getHashPath());\n\n (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = (0, _PathUtils.stripBasename)(path, basename);\n\n return (0, _LocationUtils.createLocation)(path);\n };\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var forceNextPop = false;\n var ignorePath = null;\n\n var handleHashChange = function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n\n if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n\n handlePop(location);\n }\n };\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation));\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation));\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n // Ensure the hash is encoded properly before doing anything else.\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) replaceHashPath(encodedPath);\n\n var initialLocation = getDOMLocation();\n var allPaths = [(0, _PathUtils.createPath)(initialLocation)];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return '#' + encodePath(basename + (0, _PathUtils.createPath)(location));\n };\n\n var push = function push(path, state) {\n (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = (0, _PathUtils.createPath)(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n\n var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location));\n var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextPaths.push(path);\n allPaths = nextPaths;\n\n setState({ action: action, location: location });\n } else {\n (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');\n\n setState();\n }\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = (0, _PathUtils.createPath)(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location));\n\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');\n\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createHashHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _PathUtils = require('./PathUtils');\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar clamp = function clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n};\n\n/**\n * Creates a history object that stores locations in memory.\n */\nvar createMemoryHistory = function createMemoryHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var getUserConfirmation = props.getUserConfirmation,\n _props$initialEntries = props.initialEntries,\n initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries,\n _props$initialIndex = props.initialIndex,\n initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey());\n });\n\n // Public interface\n\n var createHref = _PathUtils.createPath;\n\n var push = function push(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n\n var nextEntries = history.entries.slice(0);\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n history.entries[history.index] = location;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n\n var action = 'POP';\n var location = history.entries[nextIndex];\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var canGo = function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n };\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n return transitionManager.setPrompt(prompt);\n };\n\n var listen = function listen(listener) {\n return transitionManager.appendListener(listener);\n };\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createMemoryHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createTransitionManager = function createTransitionManager() {\n var prompt = null;\n\n var setPrompt = function setPrompt(nextPrompt) {\n (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');\n\n prompt = nextPrompt;\n\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n };\n\n var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');\n\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n };\n\n var listeners = [];\n\n var appendListener = function appendListener(fn) {\n var isActive = true;\n\n var listener = function listener() {\n if (isActive) fn.apply(undefined, arguments);\n };\n\n listeners.push(listener);\n\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n };\n\n var notifyListeners = function notifyListeners() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(undefined, args);\n });\n };\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n};\n\nexports.default = createTransitionManager;","export var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nexport var addEventListener = function addEventListener(node, event, listener) {\n return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);\n};\n\nexport var removeEventListener = function removeEventListener(node, event, listener) {\n return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);\n};\n\nexport var getConfirmation = function getConfirmation(message, callback) {\n return callback(window.confirm(message));\n}; // eslint-disable-line no-alert\n\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\nexport var supportsHistory = function supportsHistory() {\n var ua = window.navigator.userAgent;\n\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n\n return window.history && 'pushState' in window.history;\n};\n\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\nexport var supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n};\n\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\nexport var supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n};\n\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\nexport var isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n};","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; };\n\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport { parsePath } from './PathUtils';\n\nexport var createLocation = function createLocation(path, state, key, currentLocation) {\n var location = void 0;\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n};\n\nexport var locationsAreEqual = function locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n};","export var addLeadingSlash = function addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n};\n\nexport var stripLeadingSlash = function stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n};\n\nexport var hasBasename = function hasBasename(path, prefix) {\n return new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path);\n};\n\nexport var stripBasename = function stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n};\n\nexport var stripTrailingSlash = function stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n};\n\nexport var parsePath = function parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n\n var hashIndex = pathname.indexOf('#');\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nexport var createPath = function createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n\n\n var path = pathname || '/';\n\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;\n\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;\n\n return path;\n};","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport { createLocation } from './LocationUtils';\nimport { addLeadingSlash, stripTrailingSlash, hasBasename, stripBasename, createPath } from './PathUtils';\nimport createTransitionManager from './createTransitionManager';\nimport { canUseDOM, addEventListener, removeEventListener, getConfirmation, supportsHistory, supportsPopStateOnHashChange, isExtraneousPopstateEvent } from './DOMUtils';\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nvar getHistoryState = function getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n};\n\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\nvar createBrowserHistory = function createBrowserHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n invariant(canUseDOM, 'Browser history needs a DOM');\n\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n\n var _props$forceRefresh = props.forceRefresh,\n forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,\n _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n var getDOMLocation = function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n\n\n var path = pathname + search + hash;\n\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = stripBasename(path, basename);\n\n return createLocation(path, state, key);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var transitionManager = createTransitionManager();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var handlePopState = function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n\n handlePop(getDOMLocation(event.state));\n };\n\n var handleHashChange = function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n };\n\n var forceNextPop = false;\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allKeys.indexOf(fromLocation.key);\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return basename + createPath(location);\n };\n\n var push = function push(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.pushState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextKeys.push(location.key);\n allKeys = nextKeys;\n\n setState({ action: action, location: location });\n }\n } else {\n warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n\n window.location.href = href;\n }\n });\n };\n\n var replace = function replace(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.replaceState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n\n setState({ action: action, location: location });\n }\n } else {\n warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n\n window.location.replace(href);\n }\n });\n };\n\n var go = function go(n) {\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n addEventListener(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) addEventListener(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n removeEventListener(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) removeEventListener(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexport default createBrowserHistory;","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; };\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport { createLocation, locationsAreEqual } from './LocationUtils';\nimport { addLeadingSlash, stripLeadingSlash, stripTrailingSlash, hasBasename, stripBasename, createPath } from './PathUtils';\nimport createTransitionManager from './createTransitionManager';\nimport { canUseDOM, addEventListener, removeEventListener, getConfirmation, supportsGoWithoutReloadUsingHash } from './DOMUtils';\n\nvar HashChangeEvent = 'hashchange';\n\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nvar getHashPath = function getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n};\n\nvar pushHashPath = function pushHashPath(path) {\n return window.location.hash = path;\n};\n\nvar replaceHashPath = function replaceHashPath(path) {\n var hashIndex = window.location.href.indexOf('#');\n\n window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);\n};\n\nvar createHashHistory = function createHashHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n invariant(canUseDOM, 'Hash history needs a DOM');\n\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n\n var _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? getConfirmation : _props$getUserConfirm,\n _props$hashType = props.hashType,\n hashType = _props$hashType === undefined ? 'slash' : _props$hashType;\n\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n\n var getDOMLocation = function getDOMLocation() {\n var path = decodePath(getHashPath());\n\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = stripBasename(path, basename);\n\n return createLocation(path);\n };\n\n var transitionManager = createTransitionManager();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var forceNextPop = false;\n var ignorePath = null;\n\n var handleHashChange = function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n\n if (!forceNextPop && locationsAreEqual(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n\n handlePop(location);\n }\n };\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n // Ensure the hash is encoded properly before doing anything else.\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) replaceHashPath(encodedPath);\n\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return '#' + encodePath(basename + createPath(location));\n };\n\n var push = function push(path, state) {\n warning(state === undefined, 'Hash history cannot push state; it is ignored');\n\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextPaths.push(path);\n allPaths = nextPaths;\n\n setState({ action: action, location: location });\n } else {\n warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');\n\n setState();\n }\n });\n };\n\n var replace = function replace(path, state) {\n warning(state === undefined, 'Hash history cannot replace state; it is ignored');\n\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');\n\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n addEventListener(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n removeEventListener(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexport default createHashHistory;","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _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; };\n\nimport warning from 'warning';\nimport { createPath } from './PathUtils';\nimport { createLocation } from './LocationUtils';\nimport createTransitionManager from './createTransitionManager';\n\nvar clamp = function clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n};\n\n/**\n * Creates a history object that stores locations in memory.\n */\nvar createMemoryHistory = function createMemoryHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var getUserConfirmation = props.getUserConfirmation,\n _props$initialEntries = props.initialEntries,\n initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries,\n _props$initialIndex = props.initialIndex,\n initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n\n var transitionManager = createTransitionManager();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n });\n\n // Public interface\n\n var createHref = createPath;\n\n var push = function push(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n\n var nextEntries = history.entries.slice(0);\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n };\n\n var replace = function replace(path, state) {\n warning(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n history.entries[history.index] = location;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n\n var action = 'POP';\n var location = history.entries[nextIndex];\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var canGo = function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n };\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n return transitionManager.setPrompt(prompt);\n };\n\n var listen = function listen(listener) {\n return transitionManager.appendListener(listener);\n };\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexport default createMemoryHistory;","import warning from 'warning';\n\nvar createTransitionManager = function createTransitionManager() {\n var prompt = null;\n\n var setPrompt = function setPrompt(nextPrompt) {\n warning(prompt == null, 'A history supports only one prompt at a time');\n\n prompt = nextPrompt;\n\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n };\n\n var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message');\n\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n };\n\n var listeners = [];\n\n var appendListener = function appendListener(fn) {\n var isActive = true;\n\n var listener = function listener() {\n if (isActive) fn.apply(undefined, arguments);\n };\n\n listeners.push(listener);\n\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n };\n\n var notifyListeners = function notifyListeners() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(undefined, args);\n });\n };\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n};\n\nexport default createTransitionManager;","import _createBrowserHistory from './createBrowserHistory';\nexport { _createBrowserHistory as createBrowserHistory };\nimport _createHashHistory from './createHashHistory';\nexport { _createHashHistory as createHashHistory };\nimport _createMemoryHistory from './createMemoryHistory';\nexport { _createMemoryHistory as createMemoryHistory };\n\nexport { createLocation, locationsAreEqual } from './LocationUtils';\nexport { parsePath, createPath } from './PathUtils';","/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.hoistNonReactStatics = factory());\n}(this, (function () {\n 'use strict';\n \n var REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n };\n \n var KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n };\n \n var defineProperty = Object.defineProperty;\n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertySymbols = Object.getOwnPropertySymbols;\n var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var getPrototypeOf = Object.getPrototypeOf;\n var objectPrototype = getPrototypeOf && getPrototypeOf(Object);\n \n return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n \n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n \n var keys = getOwnPropertyNames(sourceComponent);\n \n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n \n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try { // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n \n return targetComponent;\n }\n \n return targetComponent;\n };\n})));\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","'use strict';\nvar utils = require('./utils');\nvar support = require('./support');\n// private property\nvar _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n\n// public method for encoding\nexports.encode = function(input) {\n var output = [];\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0, len = input.length, remainingBytes = len;\n\n var isArray = utils.getTypeOf(input) !== \"string\";\n while (i < input.length) {\n remainingBytes = len - i;\n\n if (!isArray) {\n chr1 = input.charCodeAt(i++);\n chr2 = i < len ? input.charCodeAt(i++) : 0;\n chr3 = i < len ? input.charCodeAt(i++) : 0;\n } else {\n chr1 = input[i++];\n chr2 = i < len ? input[i++] : 0;\n chr3 = i < len ? input[i++] : 0;\n }\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = remainingBytes > 1 ? (((chr2 & 15) << 2) | (chr3 >> 6)) : 64;\n enc4 = remainingBytes > 2 ? (chr3 & 63) : 64;\n\n output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4));\n\n }\n\n return output.join(\"\");\n};\n\n// public method for decoding\nexports.decode = function(input) {\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0, resultIndex = 0;\n\n var dataUrlPrefix = \"data:\";\n\n if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) {\n // This is a common error: people give a data url\n // (data:image/png;base64,iVBOR...) with a {base64: true} and\n // wonders why things don't work.\n // We can detect that the string input looks like a data url but we\n // *can't* be sure it is one: removing everything up to the comma would\n // be too dangerous.\n throw new Error(\"Invalid base64 input, it looks like a data url.\");\n }\n\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n var totalLength = input.length * 3 / 4;\n if(input.charAt(input.length - 1) === _keyStr.charAt(64)) {\n totalLength--;\n }\n if(input.charAt(input.length - 2) === _keyStr.charAt(64)) {\n totalLength--;\n }\n if (totalLength % 1 !== 0) {\n // totalLength is not an integer, the length does not match a valid\n // base64 content. That can happen if:\n // - the input is not a base64 content\n // - the input is *almost* a base64 content, with a extra chars at the\n // beginning or at the end\n // - the input uses a base64 variant (base64url for example)\n throw new Error(\"Invalid base64 input, bad content length.\");\n }\n var output;\n if (support.uint8array) {\n output = new Uint8Array(totalLength|0);\n } else {\n output = new Array(totalLength|0);\n }\n\n while (i < input.length) {\n\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output[resultIndex++] = chr1;\n\n if (enc3 !== 64) {\n output[resultIndex++] = chr2;\n }\n if (enc4 !== 64) {\n output[resultIndex++] = chr3;\n }\n\n }\n\n return output;\n};\n","'use strict';\n\nvar external = require(\"./external\");\nvar DataWorker = require('./stream/DataWorker');\nvar DataLengthProbe = require('./stream/DataLengthProbe');\nvar Crc32Probe = require('./stream/Crc32Probe');\nvar DataLengthProbe = require('./stream/DataLengthProbe');\n\n/**\n * Represent a compressed object, with everything needed to decompress it.\n * @constructor\n * @param {number} compressedSize the size of the data compressed.\n * @param {number} uncompressedSize the size of the data after decompression.\n * @param {number} crc32 the crc32 of the decompressed file.\n * @param {object} compression the type of compression, see lib/compressions.js.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the compressed data.\n */\nfunction CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) {\n this.compressedSize = compressedSize;\n this.uncompressedSize = uncompressedSize;\n this.crc32 = crc32;\n this.compression = compression;\n this.compressedContent = data;\n}\n\nCompressedObject.prototype = {\n /**\n * Create a worker to get the uncompressed content.\n * @return {GenericWorker} the worker.\n */\n getContentWorker : function () {\n var worker = new DataWorker(external.Promise.resolve(this.compressedContent))\n .pipe(this.compression.uncompressWorker())\n .pipe(new DataLengthProbe(\"data_length\"));\n\n var that = this;\n worker.on(\"end\", function () {\n if(this.streamInfo['data_length'] !== that.uncompressedSize) {\n throw new Error(\"Bug : uncompressed data size mismatch\");\n }\n });\n return worker;\n },\n /**\n * Create a worker to get the compressed content.\n * @return {GenericWorker} the worker.\n */\n getCompressedWorker : function () {\n return new DataWorker(external.Promise.resolve(this.compressedContent))\n .withStreamInfo(\"compressedSize\", this.compressedSize)\n .withStreamInfo(\"uncompressedSize\", this.uncompressedSize)\n .withStreamInfo(\"crc32\", this.crc32)\n .withStreamInfo(\"compression\", this.compression)\n ;\n }\n};\n\n/**\n * Chain the given worker with other workers to compress the content with the\n * given compresion.\n * @param {GenericWorker} uncompressedWorker the worker to pipe.\n * @param {Object} compression the compression object.\n * @param {Object} compressionOptions the options to use when compressing.\n * @return {GenericWorker} the new worker compressing the content.\n */\nCompressedObject.createWorkerFrom = function (uncompressedWorker, compression, compressionOptions) {\n return uncompressedWorker\n .pipe(new Crc32Probe())\n .pipe(new DataLengthProbe(\"uncompressedSize\"))\n .pipe(compression.compressWorker(compressionOptions))\n .pipe(new DataLengthProbe(\"compressedSize\"))\n .withStreamInfo(\"compression\", compression);\n};\n\nmodule.exports = CompressedObject;\n","'use strict';\n\nvar GenericWorker = require(\"./stream/GenericWorker\");\n\nexports.STORE = {\n magic: \"\\x00\\x00\",\n compressWorker : function (compressionOptions) {\n return new GenericWorker(\"STORE compression\");\n },\n uncompressWorker : function () {\n return new GenericWorker(\"STORE decompression\");\n }\n};\nexports.DEFLATE = require('./flate');\n","'use strict';\n\nvar utils = require('./utils');\n\n/**\n * The following functions come from pako, from pako/lib/zlib/crc32.js\n * released under the MIT license, see pako https://github.com/nodeca/pako/\n */\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n\n crc = crc ^ (-1);\n\n for (var i = pos; i < end; i++ ) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n// That's all for the pako functions.\n\n/**\n * Compute the crc32 of a string.\n * This is almost the same as the function crc32, but for strings. Using the\n * same function for the two use cases leads to horrible performances.\n * @param {Number} crc the starting value of the crc.\n * @param {String} str the string to use.\n * @param {Number} len the length of the string.\n * @param {Number} pos the starting position for the crc32 computation.\n * @return {Number} the computed crc32.\n */\nfunction crc32str(crc, str, len, pos) {\n var t = crcTable, end = pos + len;\n\n crc = crc ^ (-1);\n\n for (var i = pos; i < end; i++ ) {\n crc = (crc >>> 8) ^ t[(crc ^ str.charCodeAt(i)) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\nmodule.exports = function crc32wrapper(input, crc) {\n if (typeof input === \"undefined\" || !input.length) {\n return 0;\n }\n\n var isArray = utils.getTypeOf(input) !== \"string\";\n\n if(isArray) {\n return crc32(crc|0, input, input.length, 0);\n } else {\n return crc32str(crc|0, input, input.length, 0);\n }\n};\n","'use strict';\nexports.base64 = false;\nexports.binary = false;\nexports.dir = false;\nexports.createFolders = true;\nexports.date = null;\nexports.compression = null;\nexports.compressionOptions = null;\nexports.comment = null;\nexports.unixPermissions = null;\nexports.dosPermissions = null;\n","/* global Promise */\n'use strict';\n\n// load the global object first:\n// - it should be better integrated in the system (unhandledRejection in node)\n// - the environment may have a custom Promise implementation (see zone.js)\nvar ES6Promise = null;\nif (typeof Promise !== \"undefined\") {\n ES6Promise = Promise;\n} else {\n ES6Promise = require(\"lie\");\n}\n\n/**\n * Let the user use/change some implementations.\n */\nmodule.exports = {\n Promise: ES6Promise\n};\n","'use strict';\nvar USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');\n\nvar pako = require(\"pako\");\nvar utils = require(\"./utils\");\nvar GenericWorker = require(\"./stream/GenericWorker\");\n\nvar ARRAY_TYPE = USE_TYPEDARRAY ? \"uint8array\" : \"array\";\n\nexports.magic = \"\\x08\\x00\";\n\n/**\n * Create a worker that uses pako to inflate/deflate.\n * @constructor\n * @param {String} action the name of the pako function to call : either \"Deflate\" or \"Inflate\".\n * @param {Object} options the options to use when (de)compressing.\n */\nfunction FlateWorker(action, options) {\n GenericWorker.call(this, \"FlateWorker/\" + action);\n\n this._pako = null;\n this._pakoAction = action;\n this._pakoOptions = options;\n // the `meta` object from the last chunk received\n // this allow this worker to pass around metadata\n this.meta = {};\n}\n\nutils.inherits(FlateWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nFlateWorker.prototype.processChunk = function (chunk) {\n this.meta = chunk.meta;\n if (this._pako === null) {\n this._createPako();\n }\n this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false);\n};\n\n/**\n * @see GenericWorker.flush\n */\nFlateWorker.prototype.flush = function () {\n GenericWorker.prototype.flush.call(this);\n if (this._pako === null) {\n this._createPako();\n }\n this._pako.push([], true);\n};\n/**\n * @see GenericWorker.cleanUp\n */\nFlateWorker.prototype.cleanUp = function () {\n GenericWorker.prototype.cleanUp.call(this);\n this._pako = null;\n};\n\n/**\n * Create the _pako object.\n * TODO: lazy-loading this object isn't the best solution but it's the\n * quickest. The best solution is to lazy-load the worker list. See also the\n * issue #446.\n */\nFlateWorker.prototype._createPako = function () {\n this._pako = new pako[this._pakoAction]({\n raw: true,\n level: this._pakoOptions.level || -1 // default compression\n });\n var self = this;\n this._pako.onData = function(data) {\n self.push({\n data : data,\n meta : self.meta\n });\n };\n};\n\nexports.compressWorker = function (compressionOptions) {\n return new FlateWorker(\"Deflate\", compressionOptions);\n};\nexports.uncompressWorker = function () {\n return new FlateWorker(\"Inflate\", {});\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar GenericWorker = require('../stream/GenericWorker');\nvar utf8 = require('../utf8');\nvar crc32 = require('../crc32');\nvar signature = require('../signature');\n\n/**\n * Transform an integer into a string in hexadecimal.\n * @private\n * @param {number} dec the number to convert.\n * @param {number} bytes the number of bytes to generate.\n * @returns {string} the result.\n */\nvar decToHex = function(dec, bytes) {\n var hex = \"\", i;\n for (i = 0; i < bytes; i++) {\n hex += String.fromCharCode(dec & 0xff);\n dec = dec >>> 8;\n }\n return hex;\n};\n\n/**\n * Generate the UNIX part of the external file attributes.\n * @param {Object} unixPermissions the unix permissions or null.\n * @param {Boolean} isDir true if the entry is a directory, false otherwise.\n * @return {Number} a 32 bit integer.\n *\n * adapted from http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute :\n *\n * TTTTsstrwxrwxrwx0000000000ADVSHR\n * ^^^^____________________________ file type, see zipinfo.c (UNX_*)\n * ^^^_________________________ setuid, setgid, sticky\n * ^^^^^^^^^________________ permissions\n * ^^^^^^^^^^______ not used ?\n * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only\n */\nvar generateUnixExternalFileAttr = function (unixPermissions, isDir) {\n\n var result = unixPermissions;\n if (!unixPermissions) {\n // I can't use octal values in strict mode, hence the hexa.\n // 040775 => 0x41fd\n // 0100664 => 0x81b4\n result = isDir ? 0x41fd : 0x81b4;\n }\n return (result & 0xFFFF) << 16;\n};\n\n/**\n * Generate the DOS part of the external file attributes.\n * @param {Object} dosPermissions the dos permissions or null.\n * @param {Boolean} isDir true if the entry is a directory, false otherwise.\n * @return {Number} a 32 bit integer.\n *\n * Bit 0 Read-Only\n * Bit 1 Hidden\n * Bit 2 System\n * Bit 3 Volume Label\n * Bit 4 Directory\n * Bit 5 Archive\n */\nvar generateDosExternalFileAttr = function (dosPermissions, isDir) {\n\n // the dir flag is already set for compatibility\n return (dosPermissions || 0) & 0x3F;\n};\n\n/**\n * Generate the various parts used in the construction of the final zip file.\n * @param {Object} streamInfo the hash with informations about the compressed file.\n * @param {Boolean} streamedContent is the content streamed ?\n * @param {Boolean} streamingEnded is the stream finished ?\n * @param {number} offset the current offset from the start of the zip file.\n * @param {String} platform let's pretend we are this platform (change platform dependents fields)\n * @param {Function} encodeFileName the function to encode the file name / comment.\n * @return {Object} the zip parts.\n */\nvar generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) {\n var file = streamInfo['file'],\n compression = streamInfo['compression'],\n useCustomEncoding = encodeFileName !== utf8.utf8encode,\n encodedFileName = utils.transformTo(\"string\", encodeFileName(file.name)),\n utfEncodedFileName = utils.transformTo(\"string\", utf8.utf8encode(file.name)),\n comment = file.comment,\n encodedComment = utils.transformTo(\"string\", encodeFileName(comment)),\n utfEncodedComment = utils.transformTo(\"string\", utf8.utf8encode(comment)),\n useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,\n useUTF8ForComment = utfEncodedComment.length !== comment.length,\n dosTime,\n dosDate,\n extraFields = \"\",\n unicodePathExtraField = \"\",\n unicodeCommentExtraField = \"\",\n dir = file.dir,\n date = file.date;\n\n\n var dataInfo = {\n crc32 : 0,\n compressedSize : 0,\n uncompressedSize : 0\n };\n\n // if the content is streamed, the sizes/crc32 are only available AFTER\n // the end of the stream.\n if (!streamedContent || streamingEnded) {\n dataInfo.crc32 = streamInfo['crc32'];\n dataInfo.compressedSize = streamInfo['compressedSize'];\n dataInfo.uncompressedSize = streamInfo['uncompressedSize'];\n }\n\n var bitflag = 0;\n if (streamedContent) {\n // Bit 3: the sizes/crc32 are set to zero in the local header.\n // The correct values are put in the data descriptor immediately\n // following the compressed data.\n bitflag |= 0x0008;\n }\n if (!useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment)) {\n // Bit 11: Language encoding flag (EFS).\n bitflag |= 0x0800;\n }\n\n\n var extFileAttr = 0;\n var versionMadeBy = 0;\n if (dir) {\n // dos or unix, we set the dos dir flag\n extFileAttr |= 0x00010;\n }\n if(platform === \"UNIX\") {\n versionMadeBy = 0x031E; // UNIX, version 3.0\n extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir);\n } else { // DOS or other, fallback to DOS\n versionMadeBy = 0x0014; // DOS, version 2.0\n extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir);\n }\n\n // date\n // @see http://www.delorie.com/djgpp/doc/rbinter/it/52/13.html\n // @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html\n // @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html\n\n dosTime = date.getUTCHours();\n dosTime = dosTime << 6;\n dosTime = dosTime | date.getUTCMinutes();\n dosTime = dosTime << 5;\n dosTime = dosTime | date.getUTCSeconds() / 2;\n\n dosDate = date.getUTCFullYear() - 1980;\n dosDate = dosDate << 4;\n dosDate = dosDate | (date.getUTCMonth() + 1);\n dosDate = dosDate << 5;\n dosDate = dosDate | date.getUTCDate();\n\n if (useUTF8ForFileName) {\n // set the unicode path extra field. unzip needs at least one extra\n // field to correctly handle unicode path, so using the path is as good\n // as any other information. This could improve the situation with\n // other archive managers too.\n // This field is usually used without the utf8 flag, with a non\n // unicode path in the header (winrar, winzip). This helps (a bit)\n // with the messy Windows' default compressed folders feature but\n // breaks on p7zip which doesn't seek the unicode path extra field.\n // So for now, UTF-8 everywhere !\n unicodePathExtraField =\n // Version\n decToHex(1, 1) +\n // NameCRC32\n decToHex(crc32(encodedFileName), 4) +\n // UnicodeName\n utfEncodedFileName;\n\n extraFields +=\n // Info-ZIP Unicode Path Extra Field\n \"\\x75\\x70\" +\n // size\n decToHex(unicodePathExtraField.length, 2) +\n // content\n unicodePathExtraField;\n }\n\n if(useUTF8ForComment) {\n\n unicodeCommentExtraField =\n // Version\n decToHex(1, 1) +\n // CommentCRC32\n decToHex(crc32(encodedComment), 4) +\n // UnicodeName\n utfEncodedComment;\n\n extraFields +=\n // Info-ZIP Unicode Path Extra Field\n \"\\x75\\x63\" +\n // size\n decToHex(unicodeCommentExtraField.length, 2) +\n // content\n unicodeCommentExtraField;\n }\n\n var header = \"\";\n\n // version needed to extract\n header += \"\\x0A\\x00\";\n // general purpose bit flag\n header += decToHex(bitflag, 2);\n // compression method\n header += compression.magic;\n // last mod file time\n header += decToHex(dosTime, 2);\n // last mod file date\n header += decToHex(dosDate, 2);\n // crc-32\n header += decToHex(dataInfo.crc32, 4);\n // compressed size\n header += decToHex(dataInfo.compressedSize, 4);\n // uncompressed size\n header += decToHex(dataInfo.uncompressedSize, 4);\n // file name length\n header += decToHex(encodedFileName.length, 2);\n // extra field length\n header += decToHex(extraFields.length, 2);\n\n\n var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields;\n\n var dirRecord = signature.CENTRAL_FILE_HEADER +\n // version made by (00: DOS)\n decToHex(versionMadeBy, 2) +\n // file header (common to file and central directory)\n header +\n // file comment length\n decToHex(encodedComment.length, 2) +\n // disk number start\n \"\\x00\\x00\" +\n // internal file attributes TODO\n \"\\x00\\x00\" +\n // external file attributes\n decToHex(extFileAttr, 4) +\n // relative offset of local header\n decToHex(offset, 4) +\n // file name\n encodedFileName +\n // extra field\n extraFields +\n // file comment\n encodedComment;\n\n return {\n fileRecord: fileRecord,\n dirRecord: dirRecord\n };\n};\n\n/**\n * Generate the EOCD record.\n * @param {Number} entriesCount the number of entries in the zip file.\n * @param {Number} centralDirLength the length (in bytes) of the central dir.\n * @param {Number} localDirLength the length (in bytes) of the local dir.\n * @param {String} comment the zip file comment as a binary string.\n * @param {Function} encodeFileName the function to encode the comment.\n * @return {String} the EOCD record.\n */\nvar generateCentralDirectoryEnd = function (entriesCount, centralDirLength, localDirLength, comment, encodeFileName) {\n var dirEnd = \"\";\n var encodedComment = utils.transformTo(\"string\", encodeFileName(comment));\n\n // end of central dir signature\n dirEnd = signature.CENTRAL_DIRECTORY_END +\n // number of this disk\n \"\\x00\\x00\" +\n // number of the disk with the start of the central directory\n \"\\x00\\x00\" +\n // total number of entries in the central directory on this disk\n decToHex(entriesCount, 2) +\n // total number of entries in the central directory\n decToHex(entriesCount, 2) +\n // size of the central directory 4 bytes\n decToHex(centralDirLength, 4) +\n // offset of start of central directory with respect to the starting disk number\n decToHex(localDirLength, 4) +\n // .ZIP file comment length\n decToHex(encodedComment.length, 2) +\n // .ZIP file comment\n encodedComment;\n\n return dirEnd;\n};\n\n/**\n * Generate data descriptors for a file entry.\n * @param {Object} streamInfo the hash generated by a worker, containing informations\n * on the file entry.\n * @return {String} the data descriptors.\n */\nvar generateDataDescriptors = function (streamInfo) {\n var descriptor = \"\";\n descriptor = signature.DATA_DESCRIPTOR +\n // crc-32 4 bytes\n decToHex(streamInfo['crc32'], 4) +\n // compressed size 4 bytes\n decToHex(streamInfo['compressedSize'], 4) +\n // uncompressed size 4 bytes\n decToHex(streamInfo['uncompressedSize'], 4);\n\n return descriptor;\n};\n\n\n/**\n * A worker to concatenate other workers to create a zip file.\n * @param {Boolean} streamFiles `true` to stream the content of the files,\n * `false` to accumulate it.\n * @param {String} comment the comment to use.\n * @param {String} platform the platform to use, \"UNIX\" or \"DOS\".\n * @param {Function} encodeFileName the function to encode file names and comments.\n */\nfunction ZipFileWorker(streamFiles, comment, platform, encodeFileName) {\n GenericWorker.call(this, \"ZipFileWorker\");\n // The number of bytes written so far. This doesn't count accumulated chunks.\n this.bytesWritten = 0;\n // The comment of the zip file\n this.zipComment = comment;\n // The platform \"generating\" the zip file.\n this.zipPlatform = platform;\n // the function to encode file names and comments.\n this.encodeFileName = encodeFileName;\n // Should we stream the content of the files ?\n this.streamFiles = streamFiles;\n // If `streamFiles` is false, we will need to accumulate the content of the\n // files to calculate sizes / crc32 (and write them *before* the content).\n // This boolean indicates if we are accumulating chunks (it will change a lot\n // during the lifetime of this worker).\n this.accumulate = false;\n // The buffer receiving chunks when accumulating content.\n this.contentBuffer = [];\n // The list of generated directory records.\n this.dirRecords = [];\n // The offset (in bytes) from the beginning of the zip file for the current source.\n this.currentSourceOffset = 0;\n // The total number of entries in this zip file.\n this.entriesCount = 0;\n // the name of the file currently being added, null when handling the end of the zip file.\n // Used for the emited metadata.\n this.currentFile = null;\n\n\n\n this._sources = [];\n}\nutils.inherits(ZipFileWorker, GenericWorker);\n\n/**\n * @see GenericWorker.push\n */\nZipFileWorker.prototype.push = function (chunk) {\n\n var currentFilePercent = chunk.meta.percent || 0;\n var entriesCount = this.entriesCount;\n var remainingFiles = this._sources.length;\n\n if(this.accumulate) {\n this.contentBuffer.push(chunk);\n } else {\n this.bytesWritten += chunk.data.length;\n\n GenericWorker.prototype.push.call(this, {\n data : chunk.data,\n meta : {\n currentFile : this.currentFile,\n percent : entriesCount ? (currentFilePercent + 100 * (entriesCount - remainingFiles - 1)) / entriesCount : 100\n }\n });\n }\n};\n\n/**\n * The worker started a new source (an other worker).\n * @param {Object} streamInfo the streamInfo object from the new source.\n */\nZipFileWorker.prototype.openedSource = function (streamInfo) {\n this.currentSourceOffset = this.bytesWritten;\n this.currentFile = streamInfo['file'].name;\n\n var streamedContent = this.streamFiles && !streamInfo['file'].dir;\n\n // don't stream folders (because they don't have any content)\n if(streamedContent) {\n var record = generateZipParts(streamInfo, streamedContent, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);\n this.push({\n data : record.fileRecord,\n meta : {percent:0}\n });\n } else {\n // we need to wait for the whole file before pushing anything\n this.accumulate = true;\n }\n};\n\n/**\n * The worker finished a source (an other worker).\n * @param {Object} streamInfo the streamInfo object from the finished source.\n */\nZipFileWorker.prototype.closedSource = function (streamInfo) {\n this.accumulate = false;\n var streamedContent = this.streamFiles && !streamInfo['file'].dir;\n var record = generateZipParts(streamInfo, streamedContent, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);\n\n this.dirRecords.push(record.dirRecord);\n if(streamedContent) {\n // after the streamed file, we put data descriptors\n this.push({\n data : generateDataDescriptors(streamInfo),\n meta : {percent:100}\n });\n } else {\n // the content wasn't streamed, we need to push everything now\n // first the file record, then the content\n this.push({\n data : record.fileRecord,\n meta : {percent:0}\n });\n while(this.contentBuffer.length) {\n this.push(this.contentBuffer.shift());\n }\n }\n this.currentFile = null;\n};\n\n/**\n * @see GenericWorker.flush\n */\nZipFileWorker.prototype.flush = function () {\n\n var localDirLength = this.bytesWritten;\n for(var i = 0; i < this.dirRecords.length; i++) {\n this.push({\n data : this.dirRecords[i],\n meta : {percent:100}\n });\n }\n var centralDirLength = this.bytesWritten - localDirLength;\n\n var dirEnd = generateCentralDirectoryEnd(this.dirRecords.length, centralDirLength, localDirLength, this.zipComment, this.encodeFileName);\n\n this.push({\n data : dirEnd,\n meta : {percent:100}\n });\n};\n\n/**\n * Prepare the next source to be read.\n */\nZipFileWorker.prototype.prepareNextSource = function () {\n this.previous = this._sources.shift();\n this.openedSource(this.previous.streamInfo);\n if (this.isPaused) {\n this.previous.pause();\n } else {\n this.previous.resume();\n }\n};\n\n/**\n * @see GenericWorker.registerPrevious\n */\nZipFileWorker.prototype.registerPrevious = function (previous) {\n this._sources.push(previous);\n var self = this;\n\n previous.on('data', function (chunk) {\n self.processChunk(chunk);\n });\n previous.on('end', function () {\n self.closedSource(self.previous.streamInfo);\n if(self._sources.length) {\n self.prepareNextSource();\n } else {\n self.end();\n }\n });\n previous.on('error', function (e) {\n self.error(e);\n });\n return this;\n};\n\n/**\n * @see GenericWorker.resume\n */\nZipFileWorker.prototype.resume = function () {\n if(!GenericWorker.prototype.resume.call(this)) {\n return false;\n }\n\n if (!this.previous && this._sources.length) {\n this.prepareNextSource();\n return true;\n }\n if (!this.previous && !this._sources.length && !this.generatedError) {\n this.end();\n return true;\n }\n};\n\n/**\n * @see GenericWorker.error\n */\nZipFileWorker.prototype.error = function (e) {\n var sources = this._sources;\n if(!GenericWorker.prototype.error.call(this, e)) {\n return false;\n }\n for(var i = 0; i < sources.length; i++) {\n try {\n sources[i].error(e);\n } catch(e) {\n // the `error` exploded, nothing to do\n }\n }\n return true;\n};\n\n/**\n * @see GenericWorker.lock\n */\nZipFileWorker.prototype.lock = function () {\n GenericWorker.prototype.lock.call(this);\n var sources = this._sources;\n for(var i = 0; i < sources.length; i++) {\n sources[i].lock();\n }\n};\n\nmodule.exports = ZipFileWorker;\n","'use strict';\n\nvar compressions = require('../compressions');\nvar ZipFileWorker = require('./ZipFileWorker');\n\n/**\n * Find the compression to use.\n * @param {String} fileCompression the compression defined at the file level, if any.\n * @param {String} zipCompression the compression defined at the load() level.\n * @return {Object} the compression object to use.\n */\nvar getCompression = function (fileCompression, zipCompression) {\n\n var compressionName = fileCompression || zipCompression;\n var compression = compressions[compressionName];\n if (!compression) {\n throw new Error(compressionName + \" is not a valid compression method !\");\n }\n return compression;\n};\n\n/**\n * Create a worker to generate a zip file.\n * @param {JSZip} zip the JSZip instance at the right root level.\n * @param {Object} options to generate the zip file.\n * @param {String} comment the comment to use.\n */\nexports.generateWorker = function (zip, options, comment) {\n\n var zipFileWorker = new ZipFileWorker(options.streamFiles, comment, options.platform, options.encodeFileName);\n var entriesCount = 0;\n try {\n\n zip.forEach(function (relativePath, file) {\n entriesCount++;\n var compression = getCompression(file.options.compression, options.compression);\n var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};\n var dir = file.dir, date = file.date;\n\n file._compressWorker(compression, compressionOptions)\n .withStreamInfo(\"file\", {\n name : relativePath,\n dir : dir,\n date : date,\n comment : file.comment || \"\",\n unixPermissions : file.unixPermissions,\n dosPermissions : file.dosPermissions\n })\n .pipe(zipFileWorker);\n });\n zipFileWorker.entriesCount = entriesCount;\n } catch (e) {\n zipFileWorker.error(e);\n }\n\n return zipFileWorker;\n};\n","'use strict';\n\n/**\n * Representation a of zip file in js\n * @constructor\n */\nfunction JSZip() {\n // if this constructor is used without `new`, it adds `new` before itself:\n if(!(this instanceof JSZip)) {\n return new JSZip();\n }\n\n if(arguments.length) {\n throw new Error(\"The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.\");\n }\n\n // object containing the files :\n // {\n // \"folder/\" : {...},\n // \"folder/data.txt\" : {...}\n // }\n this.files = {};\n\n this.comment = null;\n\n // Where we are in the hierarchy\n this.root = \"\";\n this.clone = function() {\n var newObj = new JSZip();\n for (var i in this) {\n if (typeof this[i] !== \"function\") {\n newObj[i] = this[i];\n }\n }\n return newObj;\n };\n}\nJSZip.prototype = require('./object');\nJSZip.prototype.loadAsync = require('./load');\nJSZip.support = require('./support');\nJSZip.defaults = require('./defaults');\n\n// TODO find a better way to handle this version,\n// a require('package.json').version doesn't work with webpack, see #327\nJSZip.version = \"3.1.5\";\n\nJSZip.loadAsync = function (content, options) {\n return new JSZip().loadAsync(content, options);\n};\n\nJSZip.external = require(\"./external\");\nmodule.exports = JSZip;\n","'use strict';\nvar utils = require('./utils');\nvar external = require(\"./external\");\nvar utf8 = require('./utf8');\nvar utils = require('./utils');\nvar ZipEntries = require('./zipEntries');\nvar Crc32Probe = require('./stream/Crc32Probe');\nvar nodejsUtils = require(\"./nodejsUtils\");\n\n/**\n * Check the CRC32 of an entry.\n * @param {ZipEntry} zipEntry the zip entry to check.\n * @return {Promise} the result.\n */\nfunction checkEntryCRC32(zipEntry) {\n return new external.Promise(function (resolve, reject) {\n var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe());\n worker.on(\"error\", function (e) {\n reject(e);\n })\n .on(\"end\", function () {\n if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {\n reject(new Error(\"Corrupted zip : CRC32 mismatch\"));\n } else {\n resolve();\n }\n })\n .resume();\n });\n}\n\nmodule.exports = function(data, options) {\n var zip = this;\n options = utils.extend(options || {}, {\n base64: false,\n checkCRC32: false,\n optimizedBinaryString: false,\n createFolders: false,\n decodeFileName: utf8.utf8decode\n });\n\n if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {\n return external.Promise.reject(new Error(\"JSZip can't accept a stream when loading a zip file.\"));\n }\n\n return utils.prepareContent(\"the loaded zip file\", data, true, options.optimizedBinaryString, options.base64)\n .then(function(data) {\n var zipEntries = new ZipEntries(options);\n zipEntries.load(data);\n return zipEntries;\n }).then(function checkCRC32(zipEntries) {\n var promises = [external.Promise.resolve(zipEntries)];\n var files = zipEntries.files;\n if (options.checkCRC32) {\n for (var i = 0; i < files.length; i++) {\n promises.push(checkEntryCRC32(files[i]));\n }\n }\n return external.Promise.all(promises);\n }).then(function addFiles(results) {\n var zipEntries = results.shift();\n var files = zipEntries.files;\n for (var i = 0; i < files.length; i++) {\n var input = files[i];\n zip.file(input.fileNameStr, input.decompressed, {\n binary: true,\n optimizedBinaryString: true,\n date: input.date,\n dir: input.dir,\n comment : input.fileCommentStr.length ? input.fileCommentStr : null,\n unixPermissions : input.unixPermissions,\n dosPermissions : input.dosPermissions,\n createFolders: options.createFolders\n });\n }\n if (zipEntries.zipComment.length) {\n zip.comment = zipEntries.zipComment;\n }\n\n return zip;\n });\n};\n","\"use strict\";\n\nvar utils = require('../utils');\nvar GenericWorker = require('../stream/GenericWorker');\n\n/**\n * A worker that use a nodejs stream as source.\n * @constructor\n * @param {String} filename the name of the file entry for this stream.\n * @param {Readable} stream the nodejs stream.\n */\nfunction NodejsStreamInputAdapter(filename, stream) {\n GenericWorker.call(this, \"Nodejs stream input adapter for \" + filename);\n this._upstreamEnded = false;\n this._bindStream(stream);\n}\n\nutils.inherits(NodejsStreamInputAdapter, GenericWorker);\n\n/**\n * Prepare the stream and bind the callbacks on it.\n * Do this ASAP on node 0.10 ! A lazy binding doesn't always work.\n * @param {Stream} stream the nodejs stream to use.\n */\nNodejsStreamInputAdapter.prototype._bindStream = function (stream) {\n var self = this;\n this._stream = stream;\n stream.pause();\n stream\n .on(\"data\", function (chunk) {\n self.push({\n data: chunk,\n meta : {\n percent : 0\n }\n });\n })\n .on(\"error\", function (e) {\n if(self.isPaused) {\n this.generatedError = e;\n } else {\n self.error(e);\n }\n })\n .on(\"end\", function () {\n if(self.isPaused) {\n self._upstreamEnded = true;\n } else {\n self.end();\n }\n });\n};\nNodejsStreamInputAdapter.prototype.pause = function () {\n if(!GenericWorker.prototype.pause.call(this)) {\n return false;\n }\n this._stream.pause();\n return true;\n};\nNodejsStreamInputAdapter.prototype.resume = function () {\n if(!GenericWorker.prototype.resume.call(this)) {\n return false;\n }\n\n if(this._upstreamEnded) {\n this.end();\n } else {\n this._stream.resume();\n }\n\n return true;\n};\n\nmodule.exports = NodejsStreamInputAdapter;\n","'use strict';\n\nvar Readable = require('readable-stream').Readable;\n\nvar utils = require('../utils');\nutils.inherits(NodejsStreamOutputAdapter, Readable);\n\n/**\n* A nodejs stream using a worker as source.\n* @see the SourceWrapper in http://nodejs.org/api/stream.html\n* @constructor\n* @param {StreamHelper} helper the helper wrapping the worker\n* @param {Object} options the nodejs stream options\n* @param {Function} updateCb the update callback.\n*/\nfunction NodejsStreamOutputAdapter(helper, options, updateCb) {\n Readable.call(this, options);\n this._helper = helper;\n\n var self = this;\n helper.on(\"data\", function (data, meta) {\n if (!self.push(data)) {\n self._helper.pause();\n }\n if(updateCb) {\n updateCb(meta);\n }\n })\n .on(\"error\", function(e) {\n self.emit('error', e);\n })\n .on(\"end\", function () {\n self.push(null);\n });\n}\n\n\nNodejsStreamOutputAdapter.prototype._read = function() {\n this._helper.resume();\n};\n\nmodule.exports = NodejsStreamOutputAdapter;\n","'use strict';\n\nmodule.exports = {\n /**\n * True if this is running in Nodejs, will be undefined in a browser.\n * In a browser, browserify won't include this file and the whole module\n * will be resolved an empty object.\n */\n isNode : typeof Buffer !== \"undefined\",\n /**\n * Create a new nodejs Buffer from an existing content.\n * @param {Object} data the data to pass to the constructor.\n * @param {String} encoding the encoding to use.\n * @return {Buffer} a new Buffer.\n */\n newBufferFrom: function(data, encoding) {\n // XXX We can't use `Buffer.from` which comes from `Uint8Array.from`\n // in nodejs v4 (< v.4.5). It's not the expected implementation (and\n // has a different signature).\n // see https://github.com/nodejs/node/issues/8053\n // A condition on nodejs' version won't solve the issue as we don't\n // control the Buffer polyfills that may or may not be used.\n return new Buffer(data, encoding);\n },\n /**\n * Create a new nodejs Buffer with the specified size.\n * @param {Integer} size the size of the buffer.\n * @return {Buffer} a new Buffer.\n */\n allocBuffer: function (size) {\n if (Buffer.alloc) {\n return Buffer.alloc(size);\n } else {\n return new Buffer(size);\n }\n },\n /**\n * Find out if an object is a Buffer.\n * @param {Object} b the object to test.\n * @return {Boolean} true if the object is a Buffer, false otherwise.\n */\n isBuffer : function(b){\n return Buffer.isBuffer(b);\n },\n\n isStream : function (obj) {\n return obj &&\n typeof obj.on === \"function\" &&\n typeof obj.pause === \"function\" &&\n typeof obj.resume === \"function\";\n }\n};\n","'use strict';\nvar utf8 = require('./utf8');\nvar utils = require('./utils');\nvar GenericWorker = require('./stream/GenericWorker');\nvar StreamHelper = require('./stream/StreamHelper');\nvar defaults = require('./defaults');\nvar CompressedObject = require('./compressedObject');\nvar ZipObject = require('./zipObject');\nvar generate = require(\"./generate\");\nvar nodejsUtils = require(\"./nodejsUtils\");\nvar NodejsStreamInputAdapter = require(\"./nodejs/NodejsStreamInputAdapter\");\n\n\n/**\n * Add a file in the current folder.\n * @private\n * @param {string} name the name of the file\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file\n * @param {Object} originalOptions the options of the file\n * @return {Object} the new file.\n */\nvar fileAdd = function(name, data, originalOptions) {\n // be sure sub folders exist\n var dataType = utils.getTypeOf(data),\n parent;\n\n\n /*\n * Correct options.\n */\n\n var o = utils.extend(originalOptions || {}, defaults);\n o.date = o.date || new Date();\n if (o.compression !== null) {\n o.compression = o.compression.toUpperCase();\n }\n\n if (typeof o.unixPermissions === \"string\") {\n o.unixPermissions = parseInt(o.unixPermissions, 8);\n }\n\n // UNX_IFDIR 0040000 see zipinfo.c\n if (o.unixPermissions && (o.unixPermissions & 0x4000)) {\n o.dir = true;\n }\n // Bit 4 Directory\n if (o.dosPermissions && (o.dosPermissions & 0x0010)) {\n o.dir = true;\n }\n\n if (o.dir) {\n name = forceTrailingSlash(name);\n }\n if (o.createFolders && (parent = parentFolder(name))) {\n folderAdd.call(this, parent, true);\n }\n\n var isUnicodeString = dataType === \"string\" && o.binary === false && o.base64 === false;\n if (!originalOptions || typeof originalOptions.binary === \"undefined\") {\n o.binary = !isUnicodeString;\n }\n\n\n var isCompressedEmpty = (data instanceof CompressedObject) && data.uncompressedSize === 0;\n\n if (isCompressedEmpty || o.dir || !data || data.length === 0) {\n o.base64 = false;\n o.binary = true;\n data = \"\";\n o.compression = \"STORE\";\n dataType = \"string\";\n }\n\n /*\n * Convert content to fit.\n */\n\n var zipObjectContent = null;\n if (data instanceof CompressedObject || data instanceof GenericWorker) {\n zipObjectContent = data;\n } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {\n zipObjectContent = new NodejsStreamInputAdapter(name, data);\n } else {\n zipObjectContent = utils.prepareContent(name, data, o.binary, o.optimizedBinaryString, o.base64);\n }\n\n var object = new ZipObject(name, zipObjectContent, o);\n this.files[name] = object;\n /*\n TODO: we can't throw an exception because we have async promises\n (we can have a promise of a Date() for example) but returning a\n promise is useless because file(name, data) returns the JSZip\n object for chaining. Should we break that to allow the user\n to catch the error ?\n\n return external.Promise.resolve(zipObjectContent)\n .then(function () {\n return object;\n });\n */\n};\n\n/**\n * Find the parent folder of the path.\n * @private\n * @param {string} path the path to use\n * @return {string} the parent folder, or \"\"\n */\nvar parentFolder = function (path) {\n if (path.slice(-1) === '/') {\n path = path.substring(0, path.length - 1);\n }\n var lastSlash = path.lastIndexOf('/');\n return (lastSlash > 0) ? path.substring(0, lastSlash) : \"\";\n};\n\n/**\n * Returns the path with a slash at the end.\n * @private\n * @param {String} path the path to check.\n * @return {String} the path with a trailing slash.\n */\nvar forceTrailingSlash = function(path) {\n // Check the name ends with a /\n if (path.slice(-1) !== \"/\") {\n path += \"/\"; // IE doesn't like substr(-1)\n }\n return path;\n};\n\n/**\n * Add a (sub) folder in the current folder.\n * @private\n * @param {string} name the folder's name\n * @param {boolean=} [createFolders] If true, automatically create sub\n * folders. Defaults to false.\n * @return {Object} the new folder.\n */\nvar folderAdd = function(name, createFolders) {\n createFolders = (typeof createFolders !== 'undefined') ? createFolders : defaults.createFolders;\n\n name = forceTrailingSlash(name);\n\n // Does this folder already exist?\n if (!this.files[name]) {\n fileAdd.call(this, name, null, {\n dir: true,\n createFolders: createFolders\n });\n }\n return this.files[name];\n};\n\n/**\n* Cross-window, cross-Node-context regular expression detection\n* @param {Object} object Anything\n* @return {Boolean} true if the object is a regular expression,\n* false otherwise\n*/\nfunction isRegExp(object) {\n return Object.prototype.toString.call(object) === \"[object RegExp]\";\n}\n\n// return the actual prototype of JSZip\nvar out = {\n /**\n * @see loadAsync\n */\n load: function() {\n throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\");\n },\n\n\n /**\n * Call a callback function for each entry at this folder level.\n * @param {Function} cb the callback function:\n * function (relativePath, file) {...}\n * It takes 2 arguments : the relative path and the file.\n */\n forEach: function(cb) {\n var filename, relativePath, file;\n for (filename in this.files) {\n if (!this.files.hasOwnProperty(filename)) {\n continue;\n }\n file = this.files[filename];\n relativePath = filename.slice(this.root.length, filename.length);\n if (relativePath && filename.slice(0, this.root.length) === this.root) { // the file is in the current root\n cb(relativePath, file); // TODO reverse the parameters ? need to be clean AND consistent with the filter search fn...\n }\n }\n },\n\n /**\n * Filter nested files/folders with the specified function.\n * @param {Function} search the predicate to use :\n * function (relativePath, file) {...}\n * It takes 2 arguments : the relative path and the file.\n * @return {Array} An array of matching elements.\n */\n filter: function(search) {\n var result = [];\n this.forEach(function (relativePath, entry) {\n if (search(relativePath, entry)) { // the file matches the function\n result.push(entry);\n }\n\n });\n return result;\n },\n\n /**\n * Add a file to the zip file, or search a file.\n * @param {string|RegExp} name The name of the file to add (if data is defined),\n * the name of the file to find (if no data) or a regex to match files.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded\n * @param {Object} o File options\n * @return {JSZip|Object|Array} this JSZip object (when adding a file),\n * a file (when searching by string) or an array of files (when searching by regex).\n */\n file: function(name, data, o) {\n if (arguments.length === 1) {\n if (isRegExp(name)) {\n var regexp = name;\n return this.filter(function(relativePath, file) {\n return !file.dir && regexp.test(relativePath);\n });\n }\n else { // text\n var obj = this.files[this.root + name];\n if (obj && !obj.dir) {\n return obj;\n } else {\n return null;\n }\n }\n }\n else { // more than one argument : we have data !\n name = this.root + name;\n fileAdd.call(this, name, data, o);\n }\n return this;\n },\n\n /**\n * Add a directory to the zip file, or search.\n * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders.\n * @return {JSZip} an object with the new directory as the root, or an array containing matching folders.\n */\n folder: function(arg) {\n if (!arg) {\n return this;\n }\n\n if (isRegExp(arg)) {\n return this.filter(function(relativePath, file) {\n return file.dir && arg.test(relativePath);\n });\n }\n\n // else, name is a new folder\n var name = this.root + arg;\n var newFolder = folderAdd.call(this, name);\n\n // Allow chaining by returning a new object with this folder as the root\n var ret = this.clone();\n ret.root = newFolder.name;\n return ret;\n },\n\n /**\n * Delete a file, or a directory and all sub-files, from the zip\n * @param {string} name the name of the file to delete\n * @return {JSZip} this JSZip object\n */\n remove: function(name) {\n name = this.root + name;\n var file = this.files[name];\n if (!file) {\n // Look for any folders\n if (name.slice(-1) !== \"/\") {\n name += \"/\";\n }\n file = this.files[name];\n }\n\n if (file && !file.dir) {\n // file\n delete this.files[name];\n } else {\n // maybe a folder, delete recursively\n var kids = this.filter(function(relativePath, file) {\n return file.name.slice(0, name.length) === name;\n });\n for (var i = 0; i < kids.length; i++) {\n delete this.files[kids[i].name];\n }\n }\n\n return this;\n },\n\n /**\n * Generate the complete zip file\n * @param {Object} options the options to generate the zip file :\n * - compression, \"STORE\" by default.\n * - type, \"base64\" by default. Values are : string, base64, uint8array, arraybuffer, blob.\n * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file\n */\n generate: function(options) {\n throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\");\n },\n\n /**\n * Generate the complete zip file as an internal stream.\n * @param {Object} options the options to generate the zip file :\n * - compression, \"STORE\" by default.\n * - type, \"base64\" by default. Values are : string, base64, uint8array, arraybuffer, blob.\n * @return {StreamHelper} the streamed zip file.\n */\n generateInternalStream: function(options) {\n var worker, opts = {};\n try {\n opts = utils.extend(options || {}, {\n streamFiles: false,\n compression: \"STORE\",\n compressionOptions : null,\n type: \"\",\n platform: \"DOS\",\n comment: null,\n mimeType: 'application/zip',\n encodeFileName: utf8.utf8encode\n });\n\n opts.type = opts.type.toLowerCase();\n opts.compression = opts.compression.toUpperCase();\n\n // \"binarystring\" is prefered but the internals use \"string\".\n if(opts.type === \"binarystring\") {\n opts.type = \"string\";\n }\n\n if (!opts.type) {\n throw new Error(\"No output type specified.\");\n }\n\n utils.checkSupport(opts.type);\n\n // accept nodejs `process.platform`\n if(\n opts.platform === 'darwin' ||\n opts.platform === 'freebsd' ||\n opts.platform === 'linux' ||\n opts.platform === 'sunos'\n ) {\n opts.platform = \"UNIX\";\n }\n if (opts.platform === 'win32') {\n opts.platform = \"DOS\";\n }\n\n var comment = opts.comment || this.comment || \"\";\n worker = generate.generateWorker(this, opts, comment);\n } catch (e) {\n worker = new GenericWorker(\"error\");\n worker.error(e);\n }\n return new StreamHelper(worker, opts.type || \"string\", opts.mimeType);\n },\n /**\n * Generate the complete zip file asynchronously.\n * @see generateInternalStream\n */\n generateAsync: function(options, onUpdate) {\n return this.generateInternalStream(options).accumulate(onUpdate);\n },\n /**\n * Generate the complete zip file asynchronously.\n * @see generateInternalStream\n */\n generateNodeStream: function(options, onUpdate) {\n options = options || {};\n if (!options.type) {\n options.type = \"nodebuffer\";\n }\n return this.generateInternalStream(options).toNodejsStream(onUpdate);\n }\n};\nmodule.exports = out;\n","/*\n * This file is used by module bundlers (browserify/webpack/etc) when\n * including a stream implementation. We use \"readable-stream\" to get a\n * consistent behavior between nodejs versions but bundlers often have a shim\n * for \"stream\". Using this shim greatly improve the compatibility and greatly\n * reduce the final size of the bundle (only one stream implementation, not\n * two).\n */\nmodule.exports = require(\"stream\");\n","'use strict';\nvar DataReader = require('./DataReader');\nvar utils = require('../utils');\n\nfunction ArrayReader(data) {\n DataReader.call(this, data);\n\tfor(var i = 0; i < this.data.length; i++) {\n\t\tdata[i] = data[i] & 0xFF;\n\t}\n}\nutils.inherits(ArrayReader, DataReader);\n/**\n * @see DataReader.byteAt\n */\nArrayReader.prototype.byteAt = function(i) {\n return this.data[this.zero + i];\n};\n/**\n * @see DataReader.lastIndexOfSignature\n */\nArrayReader.prototype.lastIndexOfSignature = function(sig) {\n var sig0 = sig.charCodeAt(0),\n sig1 = sig.charCodeAt(1),\n sig2 = sig.charCodeAt(2),\n sig3 = sig.charCodeAt(3);\n for (var i = this.length - 4; i >= 0; --i) {\n if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {\n return i - this.zero;\n }\n }\n\n return -1;\n};\n/**\n * @see DataReader.readAndCheckSignature\n */\nArrayReader.prototype.readAndCheckSignature = function (sig) {\n var sig0 = sig.charCodeAt(0),\n sig1 = sig.charCodeAt(1),\n sig2 = sig.charCodeAt(2),\n sig3 = sig.charCodeAt(3),\n data = this.readData(4);\n return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3];\n};\n/**\n * @see DataReader.readData\n */\nArrayReader.prototype.readData = function(size) {\n this.checkOffset(size);\n if(size === 0) {\n return [];\n }\n var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = ArrayReader;\n","'use strict';\nvar utils = require('../utils');\n\nfunction DataReader(data) {\n this.data = data; // type : see implementation\n this.length = data.length;\n this.index = 0;\n this.zero = 0;\n}\nDataReader.prototype = {\n /**\n * Check that the offset will not go too far.\n * @param {string} offset the additional offset to check.\n * @throws {Error} an Error if the offset is out of bounds.\n */\n checkOffset: function(offset) {\n this.checkIndex(this.index + offset);\n },\n /**\n * Check that the specified index will not be too far.\n * @param {string} newIndex the index to check.\n * @throws {Error} an Error if the index is out of bounds.\n */\n checkIndex: function(newIndex) {\n if (this.length < this.zero + newIndex || newIndex < 0) {\n throw new Error(\"End of data reached (data length = \" + this.length + \", asked index = \" + (newIndex) + \"). Corrupted zip ?\");\n }\n },\n /**\n * Change the index.\n * @param {number} newIndex The new index.\n * @throws {Error} if the new index is out of the data.\n */\n setIndex: function(newIndex) {\n this.checkIndex(newIndex);\n this.index = newIndex;\n },\n /**\n * Skip the next n bytes.\n * @param {number} n the number of bytes to skip.\n * @throws {Error} if the new index is out of the data.\n */\n skip: function(n) {\n this.setIndex(this.index + n);\n },\n /**\n * Get the byte at the specified index.\n * @param {number} i the index to use.\n * @return {number} a byte.\n */\n byteAt: function(i) {\n // see implementations\n },\n /**\n * Get the next number with a given byte size.\n * @param {number} size the number of bytes to read.\n * @return {number} the corresponding number.\n */\n readInt: function(size) {\n var result = 0,\n i;\n this.checkOffset(size);\n for (i = this.index + size - 1; i >= this.index; i--) {\n result = (result << 8) + this.byteAt(i);\n }\n this.index += size;\n return result;\n },\n /**\n * Get the next string with a given byte size.\n * @param {number} size the number of bytes to read.\n * @return {string} the corresponding string.\n */\n readString: function(size) {\n return utils.transformTo(\"string\", this.readData(size));\n },\n /**\n * Get raw data without conversion, <size> bytes.\n * @param {number} size the number of bytes to read.\n * @return {Object} the raw data, implementation specific.\n */\n readData: function(size) {\n // see implementations\n },\n /**\n * Find the last occurence of a zip signature (4 bytes).\n * @param {string} sig the signature to find.\n * @return {number} the index of the last occurence, -1 if not found.\n */\n lastIndexOfSignature: function(sig) {\n // see implementations\n },\n /**\n * Read the signature (4 bytes) at the current position and compare it with sig.\n * @param {string} sig the expected signature\n * @return {boolean} true if the signature matches, false otherwise.\n */\n readAndCheckSignature: function(sig) {\n // see implementations\n },\n /**\n * Get the next date.\n * @return {Date} the date.\n */\n readDate: function() {\n var dostime = this.readInt(4);\n return new Date(Date.UTC(\n ((dostime >> 25) & 0x7f) + 1980, // year\n ((dostime >> 21) & 0x0f) - 1, // month\n (dostime >> 16) & 0x1f, // day\n (dostime >> 11) & 0x1f, // hour\n (dostime >> 5) & 0x3f, // minute\n (dostime & 0x1f) << 1)); // second\n }\n};\nmodule.exports = DataReader;\n","'use strict';\nvar Uint8ArrayReader = require('./Uint8ArrayReader');\nvar utils = require('../utils');\n\nfunction NodeBufferReader(data) {\n Uint8ArrayReader.call(this, data);\n}\nutils.inherits(NodeBufferReader, Uint8ArrayReader);\n\n/**\n * @see DataReader.readData\n */\nNodeBufferReader.prototype.readData = function(size) {\n this.checkOffset(size);\n var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = NodeBufferReader;\n","'use strict';\nvar DataReader = require('./DataReader');\nvar utils = require('../utils');\n\nfunction StringReader(data) {\n DataReader.call(this, data);\n}\nutils.inherits(StringReader, DataReader);\n/**\n * @see DataReader.byteAt\n */\nStringReader.prototype.byteAt = function(i) {\n return this.data.charCodeAt(this.zero + i);\n};\n/**\n * @see DataReader.lastIndexOfSignature\n */\nStringReader.prototype.lastIndexOfSignature = function(sig) {\n return this.data.lastIndexOf(sig) - this.zero;\n};\n/**\n * @see DataReader.readAndCheckSignature\n */\nStringReader.prototype.readAndCheckSignature = function (sig) {\n var data = this.readData(4);\n return sig === data;\n};\n/**\n * @see DataReader.readData\n */\nStringReader.prototype.readData = function(size) {\n this.checkOffset(size);\n // this will work because the constructor applied the \"& 0xff\" mask.\n var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = StringReader;\n","'use strict';\nvar ArrayReader = require('./ArrayReader');\nvar utils = require('../utils');\n\nfunction Uint8ArrayReader(data) {\n ArrayReader.call(this, data);\n}\nutils.inherits(Uint8ArrayReader, ArrayReader);\n/**\n * @see DataReader.readData\n */\nUint8ArrayReader.prototype.readData = function(size) {\n this.checkOffset(size);\n if(size === 0) {\n // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].\n return new Uint8Array(0);\n }\n var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size);\n this.index += size;\n return result;\n};\nmodule.exports = Uint8ArrayReader;\n","'use strict';\n\nvar utils = require('../utils');\nvar support = require('../support');\nvar ArrayReader = require('./ArrayReader');\nvar StringReader = require('./StringReader');\nvar NodeBufferReader = require('./NodeBufferReader');\nvar Uint8ArrayReader = require('./Uint8ArrayReader');\n\n/**\n * Create a reader adapted to the data.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data to read.\n * @return {DataReader} the data reader.\n */\nmodule.exports = function (data) {\n var type = utils.getTypeOf(data);\n utils.checkSupport(type);\n if (type === \"string\" && !support.uint8array) {\n return new StringReader(data);\n }\n if (type === \"nodebuffer\") {\n return new NodeBufferReader(data);\n }\n if (support.uint8array) {\n return new Uint8ArrayReader(utils.transformTo(\"uint8array\", data));\n }\n return new ArrayReader(utils.transformTo(\"array\", data));\n};\n","'use strict';\nexports.LOCAL_FILE_HEADER = \"PK\\x03\\x04\";\nexports.CENTRAL_FILE_HEADER = \"PK\\x01\\x02\";\nexports.CENTRAL_DIRECTORY_END = \"PK\\x05\\x06\";\nexports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = \"PK\\x06\\x07\";\nexports.ZIP64_CENTRAL_DIRECTORY_END = \"PK\\x06\\x06\";\nexports.DATA_DESCRIPTOR = \"PK\\x07\\x08\";\n","'use strict';\n\nvar GenericWorker = require('./GenericWorker');\nvar utils = require('../utils');\n\n/**\n * A worker which convert chunks to a specified type.\n * @constructor\n * @param {String} destType the destination type.\n */\nfunction ConvertWorker(destType) {\n GenericWorker.call(this, \"ConvertWorker to \" + destType);\n this.destType = destType;\n}\nutils.inherits(ConvertWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nConvertWorker.prototype.processChunk = function (chunk) {\n this.push({\n data : utils.transformTo(this.destType, chunk.data),\n meta : chunk.meta\n });\n};\nmodule.exports = ConvertWorker;\n","'use strict';\n\nvar GenericWorker = require('./GenericWorker');\nvar crc32 = require('../crc32');\nvar utils = require('../utils');\n\n/**\n * A worker which calculate the crc32 of the data flowing through.\n * @constructor\n */\nfunction Crc32Probe() {\n GenericWorker.call(this, \"Crc32Probe\");\n this.withStreamInfo(\"crc32\", 0);\n}\nutils.inherits(Crc32Probe, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nCrc32Probe.prototype.processChunk = function (chunk) {\n this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0);\n this.push(chunk);\n};\nmodule.exports = Crc32Probe;\n","'use strict';\n\nvar utils = require('../utils');\nvar GenericWorker = require('./GenericWorker');\n\n/**\n * A worker which calculate the total length of the data flowing through.\n * @constructor\n * @param {String} propName the name used to expose the length\n */\nfunction DataLengthProbe(propName) {\n GenericWorker.call(this, \"DataLengthProbe for \" + propName);\n this.propName = propName;\n this.withStreamInfo(propName, 0);\n}\nutils.inherits(DataLengthProbe, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nDataLengthProbe.prototype.processChunk = function (chunk) {\n if(chunk) {\n var length = this.streamInfo[this.propName] || 0;\n this.streamInfo[this.propName] = length + chunk.data.length;\n }\n GenericWorker.prototype.processChunk.call(this, chunk);\n};\nmodule.exports = DataLengthProbe;\n\n","'use strict';\n\nvar utils = require('../utils');\nvar GenericWorker = require('./GenericWorker');\n\n// the size of the generated chunks\n// TODO expose this as a public variable\nvar DEFAULT_BLOCK_SIZE = 16 * 1024;\n\n/**\n * A worker that reads a content and emits chunks.\n * @constructor\n * @param {Promise} dataP the promise of the data to split\n */\nfunction DataWorker(dataP) {\n GenericWorker.call(this, \"DataWorker\");\n var self = this;\n this.dataIsReady = false;\n this.index = 0;\n this.max = 0;\n this.data = null;\n this.type = \"\";\n\n this._tickScheduled = false;\n\n dataP.then(function (data) {\n self.dataIsReady = true;\n self.data = data;\n self.max = data && data.length || 0;\n self.type = utils.getTypeOf(data);\n if(!self.isPaused) {\n self._tickAndRepeat();\n }\n }, function (e) {\n self.error(e);\n });\n}\n\nutils.inherits(DataWorker, GenericWorker);\n\n/**\n * @see GenericWorker.cleanUp\n */\nDataWorker.prototype.cleanUp = function () {\n GenericWorker.prototype.cleanUp.call(this);\n this.data = null;\n};\n\n/**\n * @see GenericWorker.resume\n */\nDataWorker.prototype.resume = function () {\n if(!GenericWorker.prototype.resume.call(this)) {\n return false;\n }\n\n if (!this._tickScheduled && this.dataIsReady) {\n this._tickScheduled = true;\n utils.delay(this._tickAndRepeat, [], this);\n }\n return true;\n};\n\n/**\n * Trigger a tick a schedule an other call to this function.\n */\nDataWorker.prototype._tickAndRepeat = function() {\n this._tickScheduled = false;\n if(this.isPaused || this.isFinished) {\n return;\n }\n this._tick();\n if(!this.isFinished) {\n utils.delay(this._tickAndRepeat, [], this);\n this._tickScheduled = true;\n }\n};\n\n/**\n * Read and push a chunk.\n */\nDataWorker.prototype._tick = function() {\n\n if(this.isPaused || this.isFinished) {\n return false;\n }\n\n var size = DEFAULT_BLOCK_SIZE;\n var data = null, nextIndex = Math.min(this.max, this.index + size);\n if (this.index >= this.max) {\n // EOF\n return this.end();\n } else {\n switch(this.type) {\n case \"string\":\n data = this.data.substring(this.index, nextIndex);\n break;\n case \"uint8array\":\n data = this.data.subarray(this.index, nextIndex);\n break;\n case \"array\":\n case \"nodebuffer\":\n data = this.data.slice(this.index, nextIndex);\n break;\n }\n this.index = nextIndex;\n return this.push({\n data : data,\n meta : {\n percent : this.max ? this.index / this.max * 100 : 0\n }\n });\n }\n};\n\nmodule.exports = DataWorker;\n","'use strict';\n\n/**\n * A worker that does nothing but passing chunks to the next one. This is like\n * a nodejs stream but with some differences. On the good side :\n * - it works on IE 6-9 without any issue / polyfill\n * - it weights less than the full dependencies bundled with browserify\n * - it forwards errors (no need to declare an error handler EVERYWHERE)\n *\n * A chunk is an object with 2 attributes : `meta` and `data`. The former is an\n * object containing anything (`percent` for example), see each worker for more\n * details. The latter is the real data (String, Uint8Array, etc).\n *\n * @constructor\n * @param {String} name the name of the stream (mainly used for debugging purposes)\n */\nfunction GenericWorker(name) {\n // the name of the worker\n this.name = name || \"default\";\n // an object containing metadata about the workers chain\n this.streamInfo = {};\n // an error which happened when the worker was paused\n this.generatedError = null;\n // an object containing metadata to be merged by this worker into the general metadata\n this.extraStreamInfo = {};\n // true if the stream is paused (and should not do anything), false otherwise\n this.isPaused = true;\n // true if the stream is finished (and should not do anything), false otherwise\n this.isFinished = false;\n // true if the stream is locked to prevent further structure updates (pipe), false otherwise\n this.isLocked = false;\n // the event listeners\n this._listeners = {\n 'data':[],\n 'end':[],\n 'error':[]\n };\n // the previous worker, if any\n this.previous = null;\n}\n\nGenericWorker.prototype = {\n /**\n * Push a chunk to the next workers.\n * @param {Object} chunk the chunk to push\n */\n push : function (chunk) {\n this.emit(\"data\", chunk);\n },\n /**\n * End the stream.\n * @return {Boolean} true if this call ended the worker, false otherwise.\n */\n end : function () {\n if (this.isFinished) {\n return false;\n }\n\n this.flush();\n try {\n this.emit(\"end\");\n this.cleanUp();\n this.isFinished = true;\n } catch (e) {\n this.emit(\"error\", e);\n }\n return true;\n },\n /**\n * End the stream with an error.\n * @param {Error} e the error which caused the premature end.\n * @return {Boolean} true if this call ended the worker with an error, false otherwise.\n */\n error : function (e) {\n if (this.isFinished) {\n return false;\n }\n\n if(this.isPaused) {\n this.generatedError = e;\n } else {\n this.isFinished = true;\n\n this.emit(\"error\", e);\n\n // in the workers chain exploded in the middle of the chain,\n // the error event will go downward but we also need to notify\n // workers upward that there has been an error.\n if(this.previous) {\n this.previous.error(e);\n }\n\n this.cleanUp();\n }\n return true;\n },\n /**\n * Add a callback on an event.\n * @param {String} name the name of the event (data, end, error)\n * @param {Function} listener the function to call when the event is triggered\n * @return {GenericWorker} the current object for chainability\n */\n on : function (name, listener) {\n this._listeners[name].push(listener);\n return this;\n },\n /**\n * Clean any references when a worker is ending.\n */\n cleanUp : function () {\n this.streamInfo = this.generatedError = this.extraStreamInfo = null;\n this._listeners = [];\n },\n /**\n * Trigger an event. This will call registered callback with the provided arg.\n * @param {String} name the name of the event (data, end, error)\n * @param {Object} arg the argument to call the callback with.\n */\n emit : function (name, arg) {\n if (this._listeners[name]) {\n for(var i = 0; i < this._listeners[name].length; i++) {\n this._listeners[name][i].call(this, arg);\n }\n }\n },\n /**\n * Chain a worker with an other.\n * @param {Worker} next the worker receiving events from the current one.\n * @return {worker} the next worker for chainability\n */\n pipe : function (next) {\n return next.registerPrevious(this);\n },\n /**\n * Same as `pipe` in the other direction.\n * Using an API with `pipe(next)` is very easy.\n * Implementing the API with the point of view of the next one registering\n * a source is easier, see the ZipFileWorker.\n * @param {Worker} previous the previous worker, sending events to this one\n * @return {Worker} the current worker for chainability\n */\n registerPrevious : function (previous) {\n if (this.isLocked) {\n throw new Error(\"The stream '\" + this + \"' has already been used.\");\n }\n\n // sharing the streamInfo...\n this.streamInfo = previous.streamInfo;\n // ... and adding our own bits\n this.mergeStreamInfo();\n this.previous = previous;\n var self = this;\n previous.on('data', function (chunk) {\n self.processChunk(chunk);\n });\n previous.on('end', function () {\n self.end();\n });\n previous.on('error', function (e) {\n self.error(e);\n });\n return this;\n },\n /**\n * Pause the stream so it doesn't send events anymore.\n * @return {Boolean} true if this call paused the worker, false otherwise.\n */\n pause : function () {\n if(this.isPaused || this.isFinished) {\n return false;\n }\n this.isPaused = true;\n\n if(this.previous) {\n this.previous.pause();\n }\n return true;\n },\n /**\n * Resume a paused stream.\n * @return {Boolean} true if this call resumed the worker, false otherwise.\n */\n resume : function () {\n if(!this.isPaused || this.isFinished) {\n return false;\n }\n this.isPaused = false;\n\n // if true, the worker tried to resume but failed\n var withError = false;\n if(this.generatedError) {\n this.error(this.generatedError);\n withError = true;\n }\n if(this.previous) {\n this.previous.resume();\n }\n\n return !withError;\n },\n /**\n * Flush any remaining bytes as the stream is ending.\n */\n flush : function () {},\n /**\n * Process a chunk. This is usually the method overridden.\n * @param {Object} chunk the chunk to process.\n */\n processChunk : function(chunk) {\n this.push(chunk);\n },\n /**\n * Add a key/value to be added in the workers chain streamInfo once activated.\n * @param {String} key the key to use\n * @param {Object} value the associated value\n * @return {Worker} the current worker for chainability\n */\n withStreamInfo : function (key, value) {\n this.extraStreamInfo[key] = value;\n this.mergeStreamInfo();\n return this;\n },\n /**\n * Merge this worker's streamInfo into the chain's streamInfo.\n */\n mergeStreamInfo : function () {\n for(var key in this.extraStreamInfo) {\n if (!this.extraStreamInfo.hasOwnProperty(key)) {\n continue;\n }\n this.streamInfo[key] = this.extraStreamInfo[key];\n }\n },\n\n /**\n * Lock the stream to prevent further updates on the workers chain.\n * After calling this method, all calls to pipe will fail.\n */\n lock: function () {\n if (this.isLocked) {\n throw new Error(\"The stream '\" + this + \"' has already been used.\");\n }\n this.isLocked = true;\n if (this.previous) {\n this.previous.lock();\n }\n },\n\n /**\n *\n * Pretty print the workers chain.\n */\n toString : function () {\n var me = \"Worker \" + this.name;\n if (this.previous) {\n return this.previous + \" -> \" + me;\n } else {\n return me;\n }\n }\n};\n\nmodule.exports = GenericWorker;\n","'use strict';\n\nvar utils = require('../utils');\nvar ConvertWorker = require('./ConvertWorker');\nvar GenericWorker = require('./GenericWorker');\nvar base64 = require('../base64');\nvar support = require(\"../support\");\nvar external = require(\"../external\");\n\nvar NodejsStreamOutputAdapter = null;\nif (support.nodestream) {\n try {\n NodejsStreamOutputAdapter = require('../nodejs/NodejsStreamOutputAdapter');\n } catch(e) {}\n}\n\n/**\n * Apply the final transformation of the data. If the user wants a Blob for\n * example, it's easier to work with an U8intArray and finally do the\n * ArrayBuffer/Blob conversion.\n * @param {String} type the name of the final type\n * @param {String|Uint8Array|Buffer} content the content to transform\n * @param {String} mimeType the mime type of the content, if applicable.\n * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format.\n */\nfunction transformZipOutput(type, content, mimeType) {\n switch(type) {\n case \"blob\" :\n return utils.newBlob(utils.transformTo(\"arraybuffer\", content), mimeType);\n case \"base64\" :\n return base64.encode(content);\n default :\n return utils.transformTo(type, content);\n }\n}\n\n/**\n * Concatenate an array of data of the given type.\n * @param {String} type the type of the data in the given array.\n * @param {Array} dataArray the array containing the data chunks to concatenate\n * @return {String|Uint8Array|Buffer} the concatenated data\n * @throws Error if the asked type is unsupported\n */\nfunction concat (type, dataArray) {\n var i, index = 0, res = null, totalLength = 0;\n for(i = 0; i < dataArray.length; i++) {\n totalLength += dataArray[i].length;\n }\n switch(type) {\n case \"string\":\n return dataArray.join(\"\");\n case \"array\":\n return Array.prototype.concat.apply([], dataArray);\n case \"uint8array\":\n res = new Uint8Array(totalLength);\n for(i = 0; i < dataArray.length; i++) {\n res.set(dataArray[i], index);\n index += dataArray[i].length;\n }\n return res;\n case \"nodebuffer\":\n return Buffer.concat(dataArray);\n default:\n throw new Error(\"concat : unsupported type '\" + type + \"'\");\n }\n}\n\n/**\n * Listen a StreamHelper, accumulate its content and concatenate it into a\n * complete block.\n * @param {StreamHelper} helper the helper to use.\n * @param {Function} updateCallback a callback called on each update. Called\n * with one arg :\n * - the metadata linked to the update received.\n * @return Promise the promise for the accumulation.\n */\nfunction accumulate(helper, updateCallback) {\n return new external.Promise(function (resolve, reject){\n var dataArray = [];\n var chunkType = helper._internalType,\n resultType = helper._outputType,\n mimeType = helper._mimeType;\n helper\n .on('data', function (data, meta) {\n dataArray.push(data);\n if(updateCallback) {\n updateCallback(meta);\n }\n })\n .on('error', function(err) {\n dataArray = [];\n reject(err);\n })\n .on('end', function (){\n try {\n var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n dataArray = [];\n })\n .resume();\n });\n}\n\n/**\n * An helper to easily use workers outside of JSZip.\n * @constructor\n * @param {Worker} worker the worker to wrap\n * @param {String} outputType the type of data expected by the use\n * @param {String} mimeType the mime type of the content, if applicable.\n */\nfunction StreamHelper(worker, outputType, mimeType) {\n var internalType = outputType;\n switch(outputType) {\n case \"blob\":\n case \"arraybuffer\":\n internalType = \"uint8array\";\n break;\n case \"base64\":\n internalType = \"string\";\n break;\n }\n\n try {\n // the type used internally\n this._internalType = internalType;\n // the type used to output results\n this._outputType = outputType;\n // the mime type\n this._mimeType = mimeType;\n utils.checkSupport(internalType);\n this._worker = worker.pipe(new ConvertWorker(internalType));\n // the last workers can be rewired without issues but we need to\n // prevent any updates on previous workers.\n worker.lock();\n } catch(e) {\n this._worker = new GenericWorker(\"error\");\n this._worker.error(e);\n }\n}\n\nStreamHelper.prototype = {\n /**\n * Listen a StreamHelper, accumulate its content and concatenate it into a\n * complete block.\n * @param {Function} updateCb the update callback.\n * @return Promise the promise for the accumulation.\n */\n accumulate : function (updateCb) {\n return accumulate(this, updateCb);\n },\n /**\n * Add a listener on an event triggered on a stream.\n * @param {String} evt the name of the event\n * @param {Function} fn the listener\n * @return {StreamHelper} the current helper.\n */\n on : function (evt, fn) {\n var self = this;\n\n if(evt === \"data\") {\n this._worker.on(evt, function (chunk) {\n fn.call(self, chunk.data, chunk.meta);\n });\n } else {\n this._worker.on(evt, function () {\n utils.delay(fn, arguments, self);\n });\n }\n return this;\n },\n /**\n * Resume the flow of chunks.\n * @return {StreamHelper} the current helper.\n */\n resume : function () {\n utils.delay(this._worker.resume, [], this._worker);\n return this;\n },\n /**\n * Pause the flow of chunks.\n * @return {StreamHelper} the current helper.\n */\n pause : function () {\n this._worker.pause();\n return this;\n },\n /**\n * Return a nodejs stream for this helper.\n * @param {Function} updateCb the update callback.\n * @return {NodejsStreamOutputAdapter} the nodejs stream.\n */\n toNodejsStream : function (updateCb) {\n utils.checkSupport(\"nodestream\");\n if (this._outputType !== \"nodebuffer\") {\n // an object stream containing blob/arraybuffer/uint8array/string\n // is strange and I don't know if it would be useful.\n // I you find this comment and have a good usecase, please open a\n // bug report !\n throw new Error(this._outputType + \" is not supported by this method\");\n }\n\n return new NodejsStreamOutputAdapter(this, {\n objectMode : this._outputType !== \"nodebuffer\"\n }, updateCb);\n }\n};\n\n\nmodule.exports = StreamHelper;\n","'use strict';\n\nexports.base64 = true;\nexports.array = true;\nexports.string = true;\nexports.arraybuffer = typeof ArrayBuffer !== \"undefined\" && typeof Uint8Array !== \"undefined\";\nexports.nodebuffer = typeof Buffer !== \"undefined\";\n// contains true if JSZip can read/generate Uint8Array, false otherwise.\nexports.uint8array = typeof Uint8Array !== \"undefined\";\n\nif (typeof ArrayBuffer === \"undefined\") {\n exports.blob = false;\n}\nelse {\n var buffer = new ArrayBuffer(0);\n try {\n exports.blob = new Blob([buffer], {\n type: \"application/zip\"\n }).size === 0;\n }\n catch (e) {\n try {\n var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;\n var builder = new Builder();\n builder.append(buffer);\n exports.blob = builder.getBlob('application/zip').size === 0;\n }\n catch (e) {\n exports.blob = false;\n }\n }\n}\n\ntry {\n exports.nodestream = !!require('readable-stream').Readable;\n} catch(e) {\n exports.nodestream = false;\n}\n","'use strict';\n\nvar utils = require('./utils');\nvar support = require('./support');\nvar nodejsUtils = require('./nodejsUtils');\nvar GenericWorker = require('./stream/GenericWorker');\n\n/**\n * The following functions come from pako, from pako/lib/utils/strings\n * released under the MIT license, see pako https://github.com/nodeca/pako/\n */\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new Array(256);\nfor (var i=0; i<256; i++) {\n _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);\n}\n_utf8len[254]=_utf8len[254]=1; // Invalid sequence start\n\n// convert string to array (typed, when possible)\nvar string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {\n c2 = str.charCodeAt(m_pos+1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n if (support.uint8array) {\n buf = new Uint8Array(buf_len);\n } else {\n buf = new Array(buf_len);\n }\n\n // convert\n for (i=0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {\n c2 = str.charCodeAt(m_pos+1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nvar utf8border = function(buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max-1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Fuckup - very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means vuffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\n// convert array to string\nvar buf2string = function (buf) {\n var str, i, out, c, c_len;\n var len = buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len*2);\n\n for (out=0, i=0; i<len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n // shrinkBuf(utf16buf, out)\n if (utf16buf.length !== out) {\n if(utf16buf.subarray) {\n utf16buf = utf16buf.subarray(0, out);\n } else {\n utf16buf.length = out;\n }\n }\n\n // return String.fromCharCode.apply(null, utf16buf);\n return utils.applyFromCharCode(utf16buf);\n};\n\n\n// That's all for the pako functions.\n\n\n/**\n * Transform a javascript string into an array (typed if possible) of bytes,\n * UTF-8 encoded.\n * @param {String} str the string to encode\n * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string.\n */\nexports.utf8encode = function utf8encode(str) {\n if (support.nodebuffer) {\n return nodejsUtils.newBufferFrom(str, \"utf-8\");\n }\n\n return string2buf(str);\n};\n\n\n/**\n * Transform a bytes array (or a representation) representing an UTF-8 encoded\n * string into a javascript string.\n * @param {Array|Uint8Array|Buffer} buf the data de decode\n * @return {String} the decoded string.\n */\nexports.utf8decode = function utf8decode(buf) {\n if (support.nodebuffer) {\n return utils.transformTo(\"nodebuffer\", buf).toString(\"utf-8\");\n }\n\n buf = utils.transformTo(support.uint8array ? \"uint8array\" : \"array\", buf);\n\n return buf2string(buf);\n};\n\n/**\n * A worker to decode utf8 encoded binary chunks into string chunks.\n * @constructor\n */\nfunction Utf8DecodeWorker() {\n GenericWorker.call(this, \"utf-8 decode\");\n // the last bytes if a chunk didn't end with a complete codepoint.\n this.leftOver = null;\n}\nutils.inherits(Utf8DecodeWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nUtf8DecodeWorker.prototype.processChunk = function (chunk) {\n\n var data = utils.transformTo(support.uint8array ? \"uint8array\" : \"array\", chunk.data);\n\n // 1st step, re-use what's left of the previous chunk\n if (this.leftOver && this.leftOver.length) {\n if(support.uint8array) {\n var previousData = data;\n data = new Uint8Array(previousData.length + this.leftOver.length);\n data.set(this.leftOver, 0);\n data.set(previousData, this.leftOver.length);\n } else {\n data = this.leftOver.concat(data);\n }\n this.leftOver = null;\n }\n\n var nextBoundary = utf8border(data);\n var usableData = data;\n if (nextBoundary !== data.length) {\n if (support.uint8array) {\n usableData = data.subarray(0, nextBoundary);\n this.leftOver = data.subarray(nextBoundary, data.length);\n } else {\n usableData = data.slice(0, nextBoundary);\n this.leftOver = data.slice(nextBoundary, data.length);\n }\n }\n\n this.push({\n data : exports.utf8decode(usableData),\n meta : chunk.meta\n });\n};\n\n/**\n * @see GenericWorker.flush\n */\nUtf8DecodeWorker.prototype.flush = function () {\n if(this.leftOver && this.leftOver.length) {\n this.push({\n data : exports.utf8decode(this.leftOver),\n meta : {}\n });\n this.leftOver = null;\n }\n};\nexports.Utf8DecodeWorker = Utf8DecodeWorker;\n\n/**\n * A worker to endcode string chunks into utf8 encoded binary chunks.\n * @constructor\n */\nfunction Utf8EncodeWorker() {\n GenericWorker.call(this, \"utf-8 encode\");\n}\nutils.inherits(Utf8EncodeWorker, GenericWorker);\n\n/**\n * @see GenericWorker.processChunk\n */\nUtf8EncodeWorker.prototype.processChunk = function (chunk) {\n this.push({\n data : exports.utf8encode(chunk.data),\n meta : chunk.meta\n });\n};\nexports.Utf8EncodeWorker = Utf8EncodeWorker;\n","'use strict';\n\nvar support = require('./support');\nvar base64 = require('./base64');\nvar nodejsUtils = require('./nodejsUtils');\nvar setImmediate = require('core-js/library/fn/set-immediate');\nvar external = require(\"./external\");\n\n\n/**\n * Convert a string that pass as a \"binary string\": it should represent a byte\n * array but may have > 255 char codes. Be sure to take only the first byte\n * and returns the byte array.\n * @param {String} str the string to transform.\n * @return {Array|Uint8Array} the string in a binary format.\n */\nfunction string2binary(str) {\n var result = null;\n if (support.uint8array) {\n result = new Uint8Array(str.length);\n } else {\n result = new Array(str.length);\n }\n return stringToArrayLike(str, result);\n}\n\n/**\n * Create a new blob with the given content and the given type.\n * @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use\n * an Uint8Array because the stock browser of android 4 won't accept it (it\n * will be silently converted to a string, \"[object Uint8Array]\").\n *\n * Use only ONE part to build the blob to avoid a memory leak in IE11 / Edge:\n * when a large amount of Array is used to create the Blob, the amount of\n * memory consumed is nearly 100 times the original data amount.\n *\n * @param {String} type the mime type of the blob.\n * @return {Blob} the created blob.\n */\nexports.newBlob = function(part, type) {\n exports.checkSupport(\"blob\");\n\n try {\n // Blob constructor\n return new Blob([part], {\n type: type\n });\n }\n catch (e) {\n\n try {\n // deprecated, browser only, old way\n var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;\n var builder = new Builder();\n builder.append(part);\n return builder.getBlob(type);\n }\n catch (e) {\n\n // well, fuck ?!\n throw new Error(\"Bug : can't construct the Blob.\");\n }\n }\n\n\n};\n/**\n * The identity function.\n * @param {Object} input the input.\n * @return {Object} the same input.\n */\nfunction identity(input) {\n return input;\n}\n\n/**\n * Fill in an array with a string.\n * @param {String} str the string to use.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated).\n * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.\n */\nfunction stringToArrayLike(str, array) {\n for (var i = 0; i < str.length; ++i) {\n array[i] = str.charCodeAt(i) & 0xFF;\n }\n return array;\n}\n\n/**\n * An helper for the function arrayLikeToString.\n * This contains static informations and functions that\n * can be optimized by the browser JIT compiler.\n */\nvar arrayToStringHelper = {\n /**\n * Transform an array of int into a string, chunk by chunk.\n * See the performances notes on arrayLikeToString.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.\n * @param {String} type the type of the array.\n * @param {Integer} chunk the chunk size.\n * @return {String} the resulting string.\n * @throws Error if the chunk is too big for the stack.\n */\n stringifyByChunk: function(array, type, chunk) {\n var result = [], k = 0, len = array.length;\n // shortcut\n if (len <= chunk) {\n return String.fromCharCode.apply(null, array);\n }\n while (k < len) {\n if (type === \"array\" || type === \"nodebuffer\") {\n result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));\n }\n else {\n result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));\n }\n k += chunk;\n }\n return result.join(\"\");\n },\n /**\n * Call String.fromCharCode on every item in the array.\n * This is the naive implementation, which generate A LOT of intermediate string.\n * This should be used when everything else fail.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.\n * @return {String} the result.\n */\n stringifyByChar: function(array){\n var resultStr = \"\";\n for(var i = 0; i < array.length; i++) {\n resultStr += String.fromCharCode(array[i]);\n }\n return resultStr;\n },\n applyCanBeUsed : {\n /**\n * true if the browser accepts to use String.fromCharCode on Uint8Array\n */\n uint8array : (function () {\n try {\n return support.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;\n } catch (e) {\n return false;\n }\n })(),\n /**\n * true if the browser accepts to use String.fromCharCode on nodejs Buffer.\n */\n nodebuffer : (function () {\n try {\n return support.nodebuffer && String.fromCharCode.apply(null, nodejsUtils.allocBuffer(1)).length === 1;\n } catch (e) {\n return false;\n }\n })()\n }\n};\n\n/**\n * Transform an array-like object to a string.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.\n * @return {String} the result.\n */\nfunction arrayLikeToString(array) {\n // Performances notes :\n // --------------------\n // String.fromCharCode.apply(null, array) is the fastest, see\n // see http://jsperf.com/converting-a-uint8array-to-a-string/2\n // but the stack is limited (and we can get huge arrays !).\n //\n // result += String.fromCharCode(array[i]); generate too many strings !\n //\n // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2\n // TODO : we now have workers that split the work. Do we still need that ?\n var chunk = 65536,\n type = exports.getTypeOf(array),\n canUseApply = true;\n if (type === \"uint8array\") {\n canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array;\n } else if (type === \"nodebuffer\") {\n canUseApply = arrayToStringHelper.applyCanBeUsed.nodebuffer;\n }\n\n if (canUseApply) {\n while (chunk > 1) {\n try {\n return arrayToStringHelper.stringifyByChunk(array, type, chunk);\n } catch (e) {\n chunk = Math.floor(chunk / 2);\n }\n }\n }\n\n // no apply or chunk error : slow and painful algorithm\n // default browser on android 4.*\n return arrayToStringHelper.stringifyByChar(array);\n}\n\nexports.applyFromCharCode = arrayLikeToString;\n\n\n/**\n * Copy the data from an array-like to an other array-like.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated.\n * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array.\n */\nfunction arrayLikeToArrayLike(arrayFrom, arrayTo) {\n for (var i = 0; i < arrayFrom.length; i++) {\n arrayTo[i] = arrayFrom[i];\n }\n return arrayTo;\n}\n\n// a matrix containing functions to transform everything into everything.\nvar transform = {};\n\n// string to ?\ntransform[\"string\"] = {\n \"string\": identity,\n \"array\": function(input) {\n return stringToArrayLike(input, new Array(input.length));\n },\n \"arraybuffer\": function(input) {\n return transform[\"string\"][\"uint8array\"](input).buffer;\n },\n \"uint8array\": function(input) {\n return stringToArrayLike(input, new Uint8Array(input.length));\n },\n \"nodebuffer\": function(input) {\n return stringToArrayLike(input, nodejsUtils.allocBuffer(input.length));\n }\n};\n\n// array to ?\ntransform[\"array\"] = {\n \"string\": arrayLikeToString,\n \"array\": identity,\n \"arraybuffer\": function(input) {\n return (new Uint8Array(input)).buffer;\n },\n \"uint8array\": function(input) {\n return new Uint8Array(input);\n },\n \"nodebuffer\": function(input) {\n return nodejsUtils.newBufferFrom(input);\n }\n};\n\n// arraybuffer to ?\ntransform[\"arraybuffer\"] = {\n \"string\": function(input) {\n return arrayLikeToString(new Uint8Array(input));\n },\n \"array\": function(input) {\n return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength));\n },\n \"arraybuffer\": identity,\n \"uint8array\": function(input) {\n return new Uint8Array(input);\n },\n \"nodebuffer\": function(input) {\n return nodejsUtils.newBufferFrom(new Uint8Array(input));\n }\n};\n\n// uint8array to ?\ntransform[\"uint8array\"] = {\n \"string\": arrayLikeToString,\n \"array\": function(input) {\n return arrayLikeToArrayLike(input, new Array(input.length));\n },\n \"arraybuffer\": function(input) {\n return input.buffer;\n },\n \"uint8array\": identity,\n \"nodebuffer\": function(input) {\n return nodejsUtils.newBufferFrom(input);\n }\n};\n\n// nodebuffer to ?\ntransform[\"nodebuffer\"] = {\n \"string\": arrayLikeToString,\n \"array\": function(input) {\n return arrayLikeToArrayLike(input, new Array(input.length));\n },\n \"arraybuffer\": function(input) {\n return transform[\"nodebuffer\"][\"uint8array\"](input).buffer;\n },\n \"uint8array\": function(input) {\n return arrayLikeToArrayLike(input, new Uint8Array(input.length));\n },\n \"nodebuffer\": identity\n};\n\n/**\n * Transform an input into any type.\n * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer.\n * If no output type is specified, the unmodified input will be returned.\n * @param {String} outputType the output type.\n * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert.\n * @throws {Error} an Error if the browser doesn't support the requested output type.\n */\nexports.transformTo = function(outputType, input) {\n if (!input) {\n // undefined, null, etc\n // an empty string won't harm.\n input = \"\";\n }\n if (!outputType) {\n return input;\n }\n exports.checkSupport(outputType);\n var inputType = exports.getTypeOf(input);\n var result = transform[inputType][outputType](input);\n return result;\n};\n\n/**\n * Return the type of the input.\n * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.\n * @param {Object} input the input to identify.\n * @return {String} the (lowercase) type of the input.\n */\nexports.getTypeOf = function(input) {\n if (typeof input === \"string\") {\n return \"string\";\n }\n if (Object.prototype.toString.call(input) === \"[object Array]\") {\n return \"array\";\n }\n if (support.nodebuffer && nodejsUtils.isBuffer(input)) {\n return \"nodebuffer\";\n }\n if (support.uint8array && input instanceof Uint8Array) {\n return \"uint8array\";\n }\n if (support.arraybuffer && input instanceof ArrayBuffer) {\n return \"arraybuffer\";\n }\n};\n\n/**\n * Throw an exception if the type is not supported.\n * @param {String} type the type to check.\n * @throws {Error} an Error if the browser doesn't support the requested type.\n */\nexports.checkSupport = function(type) {\n var supported = support[type.toLowerCase()];\n if (!supported) {\n throw new Error(type + \" is not supported by this platform\");\n }\n};\n\nexports.MAX_VALUE_16BITS = 65535;\nexports.MAX_VALUE_32BITS = -1; // well, \"\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\" is parsed as -1\n\n/**\n * Prettify a string read as binary.\n * @param {string} str the string to prettify.\n * @return {string} a pretty string.\n */\nexports.pretty = function(str) {\n var res = '',\n code, i;\n for (i = 0; i < (str || \"\").length; i++) {\n code = str.charCodeAt(i);\n res += '\\\\x' + (code < 16 ? \"0\" : \"\") + code.toString(16).toUpperCase();\n }\n return res;\n};\n\n/**\n * Defer the call of a function.\n * @param {Function} callback the function to call asynchronously.\n * @param {Array} args the arguments to give to the callback.\n */\nexports.delay = function(callback, args, self) {\n setImmediate(function () {\n callback.apply(self || null, args || []);\n });\n};\n\n/**\n * Extends a prototype with an other, without calling a constructor with\n * side effects. Inspired by nodejs' `utils.inherits`\n * @param {Function} ctor the constructor to augment\n * @param {Function} superCtor the parent constructor to use\n */\nexports.inherits = function (ctor, superCtor) {\n var Obj = function() {};\n Obj.prototype = superCtor.prototype;\n ctor.prototype = new Obj();\n};\n\n/**\n * Merge the objects passed as parameters into a new one.\n * @private\n * @param {...Object} var_args All objects to merge.\n * @return {Object} a new object with the data of the others.\n */\nexports.extend = function() {\n var result = {}, i, attr;\n for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers\n for (attr in arguments[i]) {\n if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === \"undefined\") {\n result[attr] = arguments[i][attr];\n }\n }\n }\n return result;\n};\n\n/**\n * Transform arbitrary content into a Promise.\n * @param {String} name a name for the content being processed.\n * @param {Object} inputData the content to process.\n * @param {Boolean} isBinary true if the content is not an unicode string\n * @param {Boolean} isOptimizedBinaryString true if the string content only has one byte per character.\n * @param {Boolean} isBase64 true if the string content is encoded with base64.\n * @return {Promise} a promise in a format usable by JSZip.\n */\nexports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {\n\n // if inputData is already a promise, this flatten it.\n var promise = external.Promise.resolve(inputData).then(function(data) {\n \n \n var isBlob = support.blob && (data instanceof Blob || ['[object File]', '[object Blob]'].indexOf(Object.prototype.toString.call(data)) !== -1);\n\n if (isBlob && typeof FileReader !== \"undefined\") {\n return new external.Promise(function (resolve, reject) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n resolve(e.target.result);\n };\n reader.onerror = function(e) {\n reject(e.target.error);\n };\n reader.readAsArrayBuffer(data);\n });\n } else {\n return data;\n }\n });\n\n return promise.then(function(data) {\n var dataType = exports.getTypeOf(data);\n\n if (!dataType) {\n return external.Promise.reject(\n new Error(\"Can't read the data of '\" + name + \"'. Is it \" +\n \"in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?\")\n );\n }\n // special case : it's way easier to work with Uint8Array than with ArrayBuffer\n if (dataType === \"arraybuffer\") {\n data = exports.transformTo(\"uint8array\", data);\n } else if (dataType === \"string\") {\n if (isBase64) {\n data = base64.decode(data);\n }\n else if (isBinary) {\n // optimizedBinaryString === true means that the file has already been filtered with a 0xFF mask\n if (isOptimizedBinaryString !== true) {\n // this is a string, not in a base64 format.\n // Be sure that this is a correct \"binary string\"\n data = string2binary(data);\n }\n }\n }\n return data;\n });\n};\n","'use strict';\nvar readerFor = require('./reader/readerFor');\nvar utils = require('./utils');\nvar sig = require('./signature');\nvar ZipEntry = require('./zipEntry');\nvar utf8 = require('./utf8');\nvar support = require('./support');\n// class ZipEntries {{{\n/**\n * All the entries in the zip file.\n * @constructor\n * @param {Object} loadOptions Options for loading the stream.\n */\nfunction ZipEntries(loadOptions) {\n this.files = [];\n this.loadOptions = loadOptions;\n}\nZipEntries.prototype = {\n /**\n * Check that the reader is on the specified signature.\n * @param {string} expectedSignature the expected signature.\n * @throws {Error} if it is an other signature.\n */\n checkSignature: function(expectedSignature) {\n if (!this.reader.readAndCheckSignature(expectedSignature)) {\n this.reader.index -= 4;\n var signature = this.reader.readString(4);\n throw new Error(\"Corrupted zip or bug: unexpected signature \" + \"(\" + utils.pretty(signature) + \", expected \" + utils.pretty(expectedSignature) + \")\");\n }\n },\n /**\n * Check if the given signature is at the given index.\n * @param {number} askedIndex the index to check.\n * @param {string} expectedSignature the signature to expect.\n * @return {boolean} true if the signature is here, false otherwise.\n */\n isSignature: function(askedIndex, expectedSignature) {\n var currentIndex = this.reader.index;\n this.reader.setIndex(askedIndex);\n var signature = this.reader.readString(4);\n var result = signature === expectedSignature;\n this.reader.setIndex(currentIndex);\n return result;\n },\n /**\n * Read the end of the central directory.\n */\n readBlockEndOfCentral: function() {\n this.diskNumber = this.reader.readInt(2);\n this.diskWithCentralDirStart = this.reader.readInt(2);\n this.centralDirRecordsOnThisDisk = this.reader.readInt(2);\n this.centralDirRecords = this.reader.readInt(2);\n this.centralDirSize = this.reader.readInt(4);\n this.centralDirOffset = this.reader.readInt(4);\n\n this.zipCommentLength = this.reader.readInt(2);\n // warning : the encoding depends of the system locale\n // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.\n // On a windows machine, this field is encoded with the localized windows code page.\n var zipComment = this.reader.readData(this.zipCommentLength);\n var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n // To get consistent behavior with the generation part, we will assume that\n // this is utf8 encoded unless specified otherwise.\n var decodeContent = utils.transformTo(decodeParamType, zipComment);\n this.zipComment = this.loadOptions.decodeFileName(decodeContent);\n },\n /**\n * Read the end of the Zip 64 central directory.\n * Not merged with the method readEndOfCentral :\n * The end of central can coexist with its Zip64 brother,\n * I don't want to read the wrong number of bytes !\n */\n readBlockZip64EndOfCentral: function() {\n this.zip64EndOfCentralSize = this.reader.readInt(8);\n this.reader.skip(4);\n // this.versionMadeBy = this.reader.readString(2);\n // this.versionNeeded = this.reader.readInt(2);\n this.diskNumber = this.reader.readInt(4);\n this.diskWithCentralDirStart = this.reader.readInt(4);\n this.centralDirRecordsOnThisDisk = this.reader.readInt(8);\n this.centralDirRecords = this.reader.readInt(8);\n this.centralDirSize = this.reader.readInt(8);\n this.centralDirOffset = this.reader.readInt(8);\n\n this.zip64ExtensibleData = {};\n var extraDataSize = this.zip64EndOfCentralSize - 44,\n index = 0,\n extraFieldId,\n extraFieldLength,\n extraFieldValue;\n while (index < extraDataSize) {\n extraFieldId = this.reader.readInt(2);\n extraFieldLength = this.reader.readInt(4);\n extraFieldValue = this.reader.readData(extraFieldLength);\n this.zip64ExtensibleData[extraFieldId] = {\n id: extraFieldId,\n length: extraFieldLength,\n value: extraFieldValue\n };\n }\n },\n /**\n * Read the end of the Zip 64 central directory locator.\n */\n readBlockZip64EndOfCentralLocator: function() {\n this.diskWithZip64CentralDirStart = this.reader.readInt(4);\n this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8);\n this.disksCount = this.reader.readInt(4);\n if (this.disksCount > 1) {\n throw new Error(\"Multi-volumes zip are not supported\");\n }\n },\n /**\n * Read the local files, based on the offset read in the central part.\n */\n readLocalFiles: function() {\n var i, file;\n for (i = 0; i < this.files.length; i++) {\n file = this.files[i];\n this.reader.setIndex(file.localHeaderOffset);\n this.checkSignature(sig.LOCAL_FILE_HEADER);\n file.readLocalPart(this.reader);\n file.handleUTF8();\n file.processAttributes();\n }\n },\n /**\n * Read the central directory.\n */\n readCentralDir: function() {\n var file;\n\n this.reader.setIndex(this.centralDirOffset);\n while (this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER)) {\n file = new ZipEntry({\n zip64: this.zip64\n }, this.loadOptions);\n file.readCentralPart(this.reader);\n this.files.push(file);\n }\n\n if (this.centralDirRecords !== this.files.length) {\n if (this.centralDirRecords !== 0 && this.files.length === 0) {\n // We expected some records but couldn't find ANY.\n // This is really suspicious, as if something went wrong.\n throw new Error(\"Corrupted zip or bug: expected \" + this.centralDirRecords + \" records in central dir, got \" + this.files.length);\n } else {\n // We found some records but not all.\n // Something is wrong but we got something for the user: no error here.\n // console.warn(\"expected\", this.centralDirRecords, \"records in central dir, got\", this.files.length);\n }\n }\n },\n /**\n * Read the end of central directory.\n */\n readEndOfCentral: function() {\n var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);\n if (offset < 0) {\n // Check if the content is a truncated zip or complete garbage.\n // A \"LOCAL_FILE_HEADER\" is not required at the beginning (auto\n // extractible zip for example) but it can give a good hint.\n // If an ajax request was used without responseType, we will also\n // get unreadable data.\n var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER);\n\n if (isGarbage) {\n throw new Error(\"Can't find end of central directory : is this a zip file ? \" +\n \"If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html\");\n } else {\n throw new Error(\"Corrupted zip: can't find end of central directory\");\n }\n\n }\n this.reader.setIndex(offset);\n var endOfCentralDirOffset = offset;\n this.checkSignature(sig.CENTRAL_DIRECTORY_END);\n this.readBlockEndOfCentral();\n\n\n /* extract from the zip spec :\n 4) If one of the fields in the end of central directory\n record is too small to hold required data, the field\n should be set to -1 (0xFFFF or 0xFFFFFFFF) and the\n ZIP64 format record should be created.\n 5) The end of central directory record and the\n Zip64 end of central directory locator record must\n reside on the same disk when splitting or spanning\n an archive.\n */\n if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) {\n this.zip64 = true;\n\n /*\n Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from\n the zip file can fit into a 32bits integer. This cannot be solved : JavaScript represents\n all numbers as 64-bit double precision IEEE 754 floating point numbers.\n So, we have 53bits for integers and bitwise operations treat everything as 32bits.\n see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators\n and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5\n */\n\n // should look for a zip64 EOCD locator\n offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);\n if (offset < 0) {\n throw new Error(\"Corrupted zip: can't find the ZIP64 end of central directory locator\");\n }\n this.reader.setIndex(offset);\n this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);\n this.readBlockZip64EndOfCentralLocator();\n\n // now the zip64 EOCD record\n if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) {\n // console.warn(\"ZIP64 end of central directory not where expected.\");\n this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);\n if (this.relativeOffsetEndOfZip64CentralDir < 0) {\n throw new Error(\"Corrupted zip: can't find the ZIP64 end of central directory\");\n }\n }\n this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);\n this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);\n this.readBlockZip64EndOfCentral();\n }\n\n var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize;\n if (this.zip64) {\n expectedEndOfCentralDirOffset += 20; // end of central dir 64 locator\n expectedEndOfCentralDirOffset += 12 /* should not include the leading 12 bytes */ + this.zip64EndOfCentralSize;\n }\n\n var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset;\n\n if (extraBytes > 0) {\n // console.warn(extraBytes, \"extra bytes at beginning or within zipfile\");\n if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) {\n // The offsets seem wrong, but we have something at the specified offset.\n // So… we keep it.\n } else {\n // the offset is wrong, update the \"zero\" of the reader\n // this happens if data has been prepended (crx files for example)\n this.reader.zero = extraBytes;\n }\n } else if (extraBytes < 0) {\n throw new Error(\"Corrupted zip: missing \" + Math.abs(extraBytes) + \" bytes.\");\n }\n },\n prepareReader: function(data) {\n this.reader = readerFor(data);\n },\n /**\n * Read a zip file and create ZipEntries.\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.\n */\n load: function(data) {\n this.prepareReader(data);\n this.readEndOfCentral();\n this.readCentralDir();\n this.readLocalFiles();\n }\n};\n// }}} end of ZipEntries\nmodule.exports = ZipEntries;\n","'use strict';\nvar readerFor = require('./reader/readerFor');\nvar utils = require('./utils');\nvar CompressedObject = require('./compressedObject');\nvar crc32fn = require('./crc32');\nvar utf8 = require('./utf8');\nvar compressions = require('./compressions');\nvar support = require('./support');\n\nvar MADE_BY_DOS = 0x00;\nvar MADE_BY_UNIX = 0x03;\n\n/**\n * Find a compression registered in JSZip.\n * @param {string} compressionMethod the method magic to find.\n * @return {Object|null} the JSZip compression object, null if none found.\n */\nvar findCompression = function(compressionMethod) {\n for (var method in compressions) {\n if (!compressions.hasOwnProperty(method)) {\n continue;\n }\n if (compressions[method].magic === compressionMethod) {\n return compressions[method];\n }\n }\n return null;\n};\n\n// class ZipEntry {{{\n/**\n * An entry in the zip file.\n * @constructor\n * @param {Object} options Options of the current file.\n * @param {Object} loadOptions Options for loading the stream.\n */\nfunction ZipEntry(options, loadOptions) {\n this.options = options;\n this.loadOptions = loadOptions;\n}\nZipEntry.prototype = {\n /**\n * say if the file is encrypted.\n * @return {boolean} true if the file is encrypted, false otherwise.\n */\n isEncrypted: function() {\n // bit 1 is set\n return (this.bitFlag & 0x0001) === 0x0001;\n },\n /**\n * say if the file has utf-8 filename/comment.\n * @return {boolean} true if the filename/comment is in utf-8, false otherwise.\n */\n useUTF8: function() {\n // bit 11 is set\n return (this.bitFlag & 0x0800) === 0x0800;\n },\n /**\n * Read the local part of a zip file and add the info in this object.\n * @param {DataReader} reader the reader to use.\n */\n readLocalPart: function(reader) {\n var compression, localExtraFieldsLength;\n\n // we already know everything from the central dir !\n // If the central dir data are false, we are doomed.\n // On the bright side, the local part is scary : zip64, data descriptors, both, etc.\n // The less data we get here, the more reliable this should be.\n // Let's skip the whole header and dash to the data !\n reader.skip(22);\n // in some zip created on windows, the filename stored in the central dir contains \\ instead of /.\n // Strangely, the filename here is OK.\n // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes\n // or APPNOTE#4.4.17.1, \"All slashes MUST be forward slashes '/'\") but there are a lot of bad zip generators...\n // Search \"unzip mismatching \"local\" filename continuing with \"central\" filename version\" on\n // the internet.\n //\n // I think I see the logic here : the central directory is used to display\n // content and the local directory is used to extract the files. Mixing / and \\\n // may be used to display \\ to windows users and use / when extracting the files.\n // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394\n this.fileNameLength = reader.readInt(2);\n localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir\n // the fileName is stored as binary data, the handleUTF8 method will take care of the encoding.\n this.fileName = reader.readData(this.fileNameLength);\n reader.skip(localExtraFieldsLength);\n\n if (this.compressedSize === -1 || this.uncompressedSize === -1) {\n throw new Error(\"Bug or corrupted zip : didn't get enough informations from the central directory \" + \"(compressedSize === -1 || uncompressedSize === -1)\");\n }\n\n compression = findCompression(this.compressionMethod);\n if (compression === null) { // no compression found\n throw new Error(\"Corrupted zip : compression \" + utils.pretty(this.compressionMethod) + \" unknown (inner file : \" + utils.transformTo(\"string\", this.fileName) + \")\");\n }\n this.decompressed = new CompressedObject(this.compressedSize, this.uncompressedSize, this.crc32, compression, reader.readData(this.compressedSize));\n },\n\n /**\n * Read the central part of a zip file and add the info in this object.\n * @param {DataReader} reader the reader to use.\n */\n readCentralPart: function(reader) {\n this.versionMadeBy = reader.readInt(2);\n reader.skip(2);\n // this.versionNeeded = reader.readInt(2);\n this.bitFlag = reader.readInt(2);\n this.compressionMethod = reader.readString(2);\n this.date = reader.readDate();\n this.crc32 = reader.readInt(4);\n this.compressedSize = reader.readInt(4);\n this.uncompressedSize = reader.readInt(4);\n var fileNameLength = reader.readInt(2);\n this.extraFieldsLength = reader.readInt(2);\n this.fileCommentLength = reader.readInt(2);\n this.diskNumberStart = reader.readInt(2);\n this.internalFileAttributes = reader.readInt(2);\n this.externalFileAttributes = reader.readInt(4);\n this.localHeaderOffset = reader.readInt(4);\n\n if (this.isEncrypted()) {\n throw new Error(\"Encrypted zip are not supported\");\n }\n\n // will be read in the local part, see the comments there\n reader.skip(fileNameLength);\n this.readExtraFields(reader);\n this.parseZIP64ExtraField(reader);\n this.fileComment = reader.readData(this.fileCommentLength);\n },\n\n /**\n * Parse the external file attributes and get the unix/dos permissions.\n */\n processAttributes: function () {\n this.unixPermissions = null;\n this.dosPermissions = null;\n var madeBy = this.versionMadeBy >> 8;\n\n // Check if we have the DOS directory flag set.\n // We look for it in the DOS and UNIX permissions\n // but some unknown platform could set it as a compatibility flag.\n this.dir = this.externalFileAttributes & 0x0010 ? true : false;\n\n if(madeBy === MADE_BY_DOS) {\n // first 6 bits (0 to 5)\n this.dosPermissions = this.externalFileAttributes & 0x3F;\n }\n\n if(madeBy === MADE_BY_UNIX) {\n this.unixPermissions = (this.externalFileAttributes >> 16) & 0xFFFF;\n // the octal permissions are in (this.unixPermissions & 0x01FF).toString(8);\n }\n\n // fail safe : if the name ends with a / it probably means a folder\n if (!this.dir && this.fileNameStr.slice(-1) === '/') {\n this.dir = true;\n }\n },\n\n /**\n * Parse the ZIP64 extra field and merge the info in the current ZipEntry.\n * @param {DataReader} reader the reader to use.\n */\n parseZIP64ExtraField: function(reader) {\n\n if (!this.extraFields[0x0001]) {\n return;\n }\n\n // should be something, preparing the extra reader\n var extraReader = readerFor(this.extraFields[0x0001].value);\n\n // I really hope that these 64bits integer can fit in 32 bits integer, because js\n // won't let us have more.\n if (this.uncompressedSize === utils.MAX_VALUE_32BITS) {\n this.uncompressedSize = extraReader.readInt(8);\n }\n if (this.compressedSize === utils.MAX_VALUE_32BITS) {\n this.compressedSize = extraReader.readInt(8);\n }\n if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) {\n this.localHeaderOffset = extraReader.readInt(8);\n }\n if (this.diskNumberStart === utils.MAX_VALUE_32BITS) {\n this.diskNumberStart = extraReader.readInt(4);\n }\n },\n /**\n * Read the central part of a zip file and add the info in this object.\n * @param {DataReader} reader the reader to use.\n */\n readExtraFields: function(reader) {\n var end = reader.index + this.extraFieldsLength,\n extraFieldId,\n extraFieldLength,\n extraFieldValue;\n\n if (!this.extraFields) {\n this.extraFields = {};\n }\n\n while (reader.index < end) {\n extraFieldId = reader.readInt(2);\n extraFieldLength = reader.readInt(2);\n extraFieldValue = reader.readData(extraFieldLength);\n\n this.extraFields[extraFieldId] = {\n id: extraFieldId,\n length: extraFieldLength,\n value: extraFieldValue\n };\n }\n },\n /**\n * Apply an UTF8 transformation if needed.\n */\n handleUTF8: function() {\n var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n if (this.useUTF8()) {\n this.fileNameStr = utf8.utf8decode(this.fileName);\n this.fileCommentStr = utf8.utf8decode(this.fileComment);\n } else {\n var upath = this.findExtraFieldUnicodePath();\n if (upath !== null) {\n this.fileNameStr = upath;\n } else {\n // ASCII text or unsupported code page\n var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName);\n this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);\n }\n\n var ucomment = this.findExtraFieldUnicodeComment();\n if (ucomment !== null) {\n this.fileCommentStr = ucomment;\n } else {\n // ASCII text or unsupported code page\n var commentByteArray = utils.transformTo(decodeParamType, this.fileComment);\n this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray);\n }\n }\n },\n\n /**\n * Find the unicode path declared in the extra field, if any.\n * @return {String} the unicode path, null otherwise.\n */\n findExtraFieldUnicodePath: function() {\n var upathField = this.extraFields[0x7075];\n if (upathField) {\n var extraReader = readerFor(upathField.value);\n\n // wrong version\n if (extraReader.readInt(1) !== 1) {\n return null;\n }\n\n // the crc of the filename changed, this field is out of date.\n if (crc32fn(this.fileName) !== extraReader.readInt(4)) {\n return null;\n }\n\n return utf8.utf8decode(extraReader.readData(upathField.length - 5));\n }\n return null;\n },\n\n /**\n * Find the unicode comment declared in the extra field, if any.\n * @return {String} the unicode comment, null otherwise.\n */\n findExtraFieldUnicodeComment: function() {\n var ucommentField = this.extraFields[0x6375];\n if (ucommentField) {\n var extraReader = readerFor(ucommentField.value);\n\n // wrong version\n if (extraReader.readInt(1) !== 1) {\n return null;\n }\n\n // the crc of the comment changed, this field is out of date.\n if (crc32fn(this.fileComment) !== extraReader.readInt(4)) {\n return null;\n }\n\n return utf8.utf8decode(extraReader.readData(ucommentField.length - 5));\n }\n return null;\n }\n};\nmodule.exports = ZipEntry;\n","'use strict';\n\nvar StreamHelper = require('./stream/StreamHelper');\nvar DataWorker = require('./stream/DataWorker');\nvar utf8 = require('./utf8');\nvar CompressedObject = require('./compressedObject');\nvar GenericWorker = require('./stream/GenericWorker');\n\n/**\n * A simple object representing a file in the zip file.\n * @constructor\n * @param {string} name the name of the file\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data\n * @param {Object} options the options of the file\n */\nvar ZipObject = function(name, data, options) {\n this.name = name;\n this.dir = options.dir;\n this.date = options.date;\n this.comment = options.comment;\n this.unixPermissions = options.unixPermissions;\n this.dosPermissions = options.dosPermissions;\n\n this._data = data;\n this._dataBinary = options.binary;\n // keep only the compression\n this.options = {\n compression : options.compression,\n compressionOptions : options.compressionOptions\n };\n};\n\nZipObject.prototype = {\n /**\n * Create an internal stream for the content of this object.\n * @param {String} type the type of each chunk.\n * @return StreamHelper the stream.\n */\n internalStream: function (type) {\n var result = null, outputType = \"string\";\n try {\n if (!type) {\n throw new Error(\"No output type specified.\");\n }\n outputType = type.toLowerCase();\n var askUnicodeString = outputType === \"string\" || outputType === \"text\";\n if (outputType === \"binarystring\" || outputType === \"text\") {\n outputType = \"string\";\n }\n result = this._decompressWorker();\n\n var isUnicodeString = !this._dataBinary;\n\n if (isUnicodeString && !askUnicodeString) {\n result = result.pipe(new utf8.Utf8EncodeWorker());\n }\n if (!isUnicodeString && askUnicodeString) {\n result = result.pipe(new utf8.Utf8DecodeWorker());\n }\n } catch (e) {\n result = new GenericWorker(\"error\");\n result.error(e);\n }\n\n return new StreamHelper(result, outputType, \"\");\n },\n\n /**\n * Prepare the content in the asked type.\n * @param {String} type the type of the result.\n * @param {Function} onUpdate a function to call on each internal update.\n * @return Promise the promise of the result.\n */\n async: function (type, onUpdate) {\n return this.internalStream(type).accumulate(onUpdate);\n },\n\n /**\n * Prepare the content as a nodejs stream.\n * @param {String} type the type of each chunk.\n * @param {Function} onUpdate a function to call on each internal update.\n * @return Stream the stream.\n */\n nodeStream: function (type, onUpdate) {\n return this.internalStream(type || \"nodebuffer\").toNodejsStream(onUpdate);\n },\n\n /**\n * Return a worker for the compressed content.\n * @private\n * @param {Object} compression the compression object to use.\n * @param {Object} compressionOptions the options to use when compressing.\n * @return Worker the worker.\n */\n _compressWorker: function (compression, compressionOptions) {\n if (\n this._data instanceof CompressedObject &&\n this._data.compression.magic === compression.magic\n ) {\n return this._data.getCompressedWorker();\n } else {\n var result = this._decompressWorker();\n if(!this._dataBinary) {\n result = result.pipe(new utf8.Utf8EncodeWorker());\n }\n return CompressedObject.createWorkerFrom(result, compression, compressionOptions);\n }\n },\n /**\n * Return a worker for the decompressed content.\n * @private\n * @return Worker the worker.\n */\n _decompressWorker : function () {\n if (this._data instanceof CompressedObject) {\n return this._data.getContentWorker();\n } else if (this._data instanceof GenericWorker) {\n return this._data;\n } else {\n return new DataWorker(this._data);\n }\n }\n};\n\nvar removedMethods = [\"asText\", \"asBinary\", \"asNodeBuffer\", \"asUint8Array\", \"asArrayBuffer\"];\nvar removedFn = function () {\n throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\");\n};\n\nfor(var i = 0; i < removedMethods.length; i++) {\n ZipObject.prototype[removedMethods[i]] = removedFn;\n}\nmodule.exports = ZipObject;\n","require('../modules/web.immediate');\nmodule.exports = require('../modules/_core').setImmediate;","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","var core = module.exports = {version: '2.3.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","var global = require('./_global')\n , core = require('./_core')\n , ctx = require('./_ctx')\n , hide = require('./_hide')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , IS_WRAP = type & $export.W\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE]\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]\n , key, own, out;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if(own && key in exports)continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function(C){\n var F = function(a, b, c){\n if(this instanceof C){\n switch(arguments.length){\n case 0: return new C;\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if(IS_PROTO){\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","module.exports = require('./_global').document && document.documentElement;","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\r\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\r\n});","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function(fn, args, that){\n var un = that === undefined;\n switch(args.length){\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var ctx = require('./_ctx')\n , invoke = require('./_invoke')\n , html = require('./_html')\n , cel = require('./_dom-create')\n , global = require('./_global')\n , process = global.process\n , setTask = global.setImmediate\n , clearTask = global.clearImmediate\n , MessageChannel = global.MessageChannel\n , counter = 0\n , queue = {}\n , ONREADYSTATECHANGE = 'onreadystatechange'\n , defer, channel, port;\nvar run = function(){\n var id = +this;\n if(queue.hasOwnProperty(id)){\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function(event){\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif(!setTask || !clearTask){\n setTask = function setImmediate(fn){\n var args = [], i = 1;\n while(arguments.length > i)args.push(arguments[i++]);\n queue[++counter] = function(){\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id){\n delete queue[id];\n };\n // Node.js 0.8-\n if(require('./_cof')(process) == 'process'){\n defer = function(id){\n process.nextTick(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if(MessageChannel){\n channel = new MessageChannel;\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){\n defer = function(id){\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if(ONREADYSTATECHANGE in cel('script')){\n defer = function(id){\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function(id){\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var $export = require('./_export')\n , $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});","'use strict';\nvar immediate = require('immediate');\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){\"use strict\";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||\"[object Array]\"===Object.prototype.toString.call(e)}function u(e){return null!=e&&\"[object Object]\"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return\"number\"==typeof e||\"[object Number]\"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||\"[object Date]\"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,\"toString\")&&(e.toString=t.toString),m(t,\"valueOf\")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Ot(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={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}),e._pf}function p(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function v(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function S(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function D(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=D(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&k(e[s])!==k(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&\"undefined\"!=typeof console&&console.warn&&console.warn(\"Deprecation warning: \"+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e=\"\",\"object\"==typeof arguments[n]){for(var s in e+=\"\\n[\"+n+\"] \",arguments[0])e+=s+\": \"+arguments[0][s]+\", \";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+\"\\nArguments: \"+Array.prototype.slice.call(t).join(\"\")+\"\\n\"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function x(e){return e instanceof Function||\"[object Function]\"===Object.prototype.toString.call(e)}function b(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function H(e,t){var n=e.toLowerCase();W[n]=W[n+\"s\"]=W[t]=e}function R(e){return\"string\"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function C(e){var t,n,s={};for(n in e)m(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var F={};function L(e,t){F[e]=t}function U(e,t,n){var s=\"\"+Math.abs(e),i=t-s.length;return(0<=e?n?\"+\":\"\":\"-\")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\\[[^\\[]*\\])|(\\\\)?([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,G=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;\"string\"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return U(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\\[[\\s\\S]/)?t.replace(/^\\[|\\]$/g,\"\"):t.replace(/\\\\/g,\"\");return function(e){var t,n=\"\";for(t=0;t<i;t++)n+=x(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\\d/,z=/\\d\\d/,$=/\\d{3}/,q=/\\d{4}/,J=/[+-]?\\d{6}/,B=/\\d\\d?/,Q=/\\d\\d\\d\\d?/,X=/\\d\\d\\d\\d\\d\\d?/,K=/\\d{1,3}/,ee=/\\d{1,4}/,te=/[+-]?\\d{1,6}/,ne=/\\d+/,se=/[+-]?\\d+/,ie=/Z|[+-]\\d\\d:?\\d\\d/gi,re=/Z|[+-]\\d\\d(?::?\\d\\d)?/gi,ae=/[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=x(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(de(e.replace(\"\\\\\",\"\").replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function de(e){return e.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")}var he={};function ce(e,n){var t,s=n;for(\"string\"==typeof e&&(e=[e]),d(n)&&(s=function(e,t){t[n]=k(e)}),t=0;t<e.length;t++)he[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,pe=4,ve=5,we=6,Me=7,Se=8;function De(e){return ke(e)?366:365}function ke(e){return e%4==0&&e%100!=0||e%400==0}I(\"Y\",0,0,function(){var e=this.year();return e<=9999?\"\"+e:\"+\"+e}),I(0,[\"YY\",2],0,function(){return this.year()%100}),I(0,[\"YYYY\",4],0,\"year\"),I(0,[\"YYYYY\",5],0,\"year\"),I(0,[\"YYYYYY\",6,!0],0,\"year\"),H(\"year\",\"y\"),L(\"year\",1),ue(\"Y\",se),ue(\"YY\",B,z),ue(\"YYYY\",ee,q),ue(\"YYYYY\",te,J),ue(\"YYYYYY\",te,J),ce([\"YYYYY\",\"YYYYYY\"],me),ce(\"YYYY\",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):k(e)}),ce(\"YY\",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce(\"Y\",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ye,Oe=Te(\"FullYear\",!0);function Te(t,n){return function(e){return null!=e?(be(this,t,e),c.updateOffset(this,n),this):xe(this,t)}}function xe(e,t){return e.isValid()?e._d[\"get\"+(e._isUTC?\"UTC\":\"\")+t]():NaN}function be(e,t,n){e.isValid()&&!isNaN(n)&&(\"FullYear\"===t&&ke(e.year())&&1===e.month()&&29===e.date()?e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n,e.month(),Pe(n,e.month())):e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ke(e)?29:28:31-s%7%2}Ye=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},I(\"M\",[\"MM\",2],\"Mo\",function(){return this.month()+1}),I(\"MMM\",0,0,function(e){return this.localeData().monthsShort(this,e)}),I(\"MMMM\",0,0,function(e){return this.localeData().months(this,e)}),H(\"month\",\"M\"),L(\"month\",8),ue(\"M\",B),ue(\"MM\",B,z),ue(\"MMM\",function(e,t){return t.monthsShortRegex(e)}),ue(\"MMMM\",function(e,t){return t.monthsRegex(e)}),ce([\"M\",\"MM\"],function(e,t){t[_e]=k(e)-1}),ce([\"MMM\",\"MMMM\"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,He=\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\");var Re=\"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec\".split(\"_\");function Ce(e,t){var n;if(!e.isValid())return e;if(\"string\"==typeof t)if(/^\\d+$/.test(t))t=k(t);else if(!d(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+\"Month\"](t,n),e}function Fe(e){return null!=e?(Ce(this,e),c.updateOffset(this,!0),this):xe(this,\"Month\")}var Le=ae;var Ue=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,\"\")),i.push(this.months(n,\"\")),r.push(this.months(n,\"\")),r.push(this.monthsShort(n,\"\"));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=de(s[t]),i[t]=de(i[t]);for(t=0;t<24;t++)r[t]=de(r[t]);this._monthsRegex=new RegExp(\"^(\"+r.join(\"|\")+\")\",\"i\"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp(\"^(\"+i.join(\"|\")+\")\",\"i\"),this._monthsShortStrictRegex=new RegExp(\"^(\"+s.join(\"|\")+\")\",\"i\")}function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I(\"w\",[\"ww\",2],\"wo\",\"week\"),I(\"W\",[\"WW\",2],\"Wo\",\"isoWeek\"),H(\"week\",\"w\"),H(\"isoWeek\",\"W\"),L(\"week\",5),L(\"isoWeek\",5),ue(\"w\",B),ue(\"ww\",B,z),ue(\"W\",B),ue(\"WW\",B,z),fe([\"w\",\"ww\",\"W\",\"WW\"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I(\"d\",0,\"do\",\"day\"),I(\"dd\",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I(\"ddd\",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I(\"dddd\",0,0,function(e){return this.localeData().weekdays(this,e)}),I(\"e\",0,0,\"weekday\"),I(\"E\",0,0,\"isoWeekday\"),H(\"day\",\"d\"),H(\"weekday\",\"e\"),H(\"isoWeekday\",\"E\"),L(\"day\",11),L(\"weekday\",11),L(\"isoWeekday\",11),ue(\"d\",B),ue(\"e\",B),ue(\"E\",B),ue(\"dd\",function(e,t){return t.weekdaysMinRegex(e)}),ue(\"ddd\",function(e,t){return t.weekdaysShortRegex(e)}),ue(\"dddd\",function(e,t){return t.weekdaysRegex(e)}),fe([\"dd\",\"ddd\",\"dddd\"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe([\"d\",\"e\",\"E\"],function(e,t,n,s){t[s]=k(e)});var je=\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\");var Ze=\"Sun_Mon_Tue_Wed_Thu_Fri_Sat\".split(\"_\");var ze=\"Su_Mo_Tu_We_Th_Fr_Sa\".split(\"_\");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,\"\"),i=this.weekdaysShort(n,\"\"),r=this.weekdays(n,\"\"),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp(\"^(\"+l.join(\"|\")+\")\",\"i\"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp(\"^(\"+u.join(\"|\")+\")\",\"i\"),this._weekdaysShortStrictRegex=new RegExp(\"^(\"+o.join(\"|\")+\")\",\"i\"),this._weekdaysMinStrictRegex=new RegExp(\"^(\"+a.join(\"|\")+\")\",\"i\")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I(\"H\",[\"HH\",2],0,\"hour\"),I(\"h\",[\"hh\",2],0,Qe),I(\"k\",[\"kk\",2],0,function(){return this.hours()||24}),I(\"hmm\",0,0,function(){return\"\"+Qe.apply(this)+U(this.minutes(),2)}),I(\"hmmss\",0,0,function(){return\"\"+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I(\"Hmm\",0,0,function(){return\"\"+this.hours()+U(this.minutes(),2)}),I(\"Hmmss\",0,0,function(){return\"\"+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe(\"a\",!0),Xe(\"A\",!1),H(\"hour\",\"h\"),L(\"hour\",13),ue(\"a\",Ke),ue(\"A\",Ke),ue(\"H\",B),ue(\"h\",B),ue(\"k\",B),ue(\"HH\",B,z),ue(\"hh\",B,z),ue(\"kk\",B,z),ue(\"hmm\",Q),ue(\"hmmss\",X),ue(\"Hmm\",Q),ue(\"Hmmss\",X),ce([\"H\",\"HH\"],ge),ce([\"k\",\"kk\"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce([\"a\",\"A\"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce([\"h\",\"hh\"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce(\"hmm\",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce(\"hmmss\",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce(\"Hmm\",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce(\"Hmmss\",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te(\"Hours\",!0),nt={calendar:{sameDay:\"[Today at] LT\",nextDay:\"[Tomorrow at] LT\",nextWeek:\"dddd [at] LT\",lastDay:\"[Yesterday at] LT\",lastWeek:\"[Last] dddd [at] LT\",sameElse:\"L\"},longDateFormat:{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\"},invalidDate:\"Invalid date\",ordinal:\"%d\",dayOfMonthOrdinalParse:/\\d{1,2}/,relativeTime:{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\"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\\.?m?\\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace(\"_\",\"-\"):e}function at(e){var t=null;if(!st[e]&&\"undefined\"!=typeof module&&module&&module.exports)try{t=et._abbr,require(\"./locale/\"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:\"undefined\"!=typeof console&&console.warn&&console.warn(\"Locale \"+e+\" not found. Did you forget to load it?\")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T(\"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.\"),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=rt(e[r]).split(\"-\")).length,n=(n=rt(e[r+1]))?n.split(\"-\"):null;0<t;){if(s=at(i.slice(0,t).join(\"-\")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?ge:n[pe]<0||59<n[pe]?pe:n[ve]<0||59<n[ve]?ve:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=Se),g(e).overflow=t),e}function ht(e,t,n){return null!=e?e:null!=t?t:n}function ct(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ht(t.GG,e._a[me],Ie(Tt(),1,4).year),s=ht(t.W,1),((i=ht(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(Tt(),r,a);n=ht(t.gg,e._a[me],l.year),s=ht(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\\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)?)?$/,mt=/^\\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)?)?$/,_t=/Z|[+-]\\d\\d(?::?\\d\\d)?/,yt=[[\"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}/]],gt=[[\"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/]],pt=/^\\/?Date\\((\\-?\\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||\" \")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a=\"Z\"}e._f=i+(r||\"\")+(a||\"\"),kt(e)}else e._isValid=!1}var wt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=wt.exec(e._i.replace(/\\([^)]*\\)|[\\n\\t]/g,\" \").replace(/(\\s\\s+)/g,\" \").trim());if(i){var r=Mt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&Ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function kt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=\"\"+e._i,d=l.length,h=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),h+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(he,a)&&he[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=d-h,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ct(e),dt(e)}else Dt(e);else vt(e)}function Yt(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||lt(e._l),null===r||void 0===a&&\"\"===r?v({nullInput:!0}):(\"string\"==typeof r&&(e._i=r=e._locale.preparse(r)),S(r)?new M(dt(r)):(h(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],kt(t),p(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?kt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):h(n)?t._d=new Date(n.valueOf()):\"string\"==typeof n?(s=t,null===(i=pt.exec(s._i))?(vt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ct(t)):u(n)?function(e){if(!e._d){var t=C(e._i);e._a=f([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)}}(t):d(n)?t._d=new Date(n):c.createFromInputFallback(t),p(e)||(e._d=null),e))}function Ot(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Yt(a))))._nextDay&&(r.add(1,\"d\"),r._nextDay=void 0),r}function Tt(e,t,n,s){return Ot(e,t,n,s,!1)}c.createFromInputFallback=n(\"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\":\"\"))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n(\"moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/\",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),bt=n(\"moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/\",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:v()});function Pt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=[\"year\",\"quarter\",\"month\",\"week\",\"day\",\"hour\",\"minute\",\"second\",\"millisecond\"];function Ht(e){var t=C(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Wt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Wt.length;++s)if(e[Wt[s]]){if(n)return!1;parseFloat(e[Wt[s]])!==k(e[Wt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Ht}function Ct(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t=\"+\";return e<0&&(e=-e,t=\"-\"),t+U(~~(e/60),2)+n+U(~~e%60,2)})}Ft(\"Z\",\":\"),Ft(\"ZZ\",\"\"),ue(\"Z\",re),ue(\"ZZ\",re),ce([\"Z\",\"ZZ\"],function(e,t,n){n._useUTC=!0,n._tzm=Ut(re,e)});var Lt=/([\\+\\-]|\\d\\d)/gi;function Ut(e,t){var n=(t||\"\").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+\"\").match(Lt)||[\"-\",0,0],i=60*s[1]+k(s[2]);return 0===i?0:\"+\"===s[0]?i:-i}function Nt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(S(e)||h(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):Tt(e).local()}function Gt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Et=/^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/,It=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function At(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=Et.exec(e))?(n=\"-\"===a[1]?-1:1,r={y:0,d:k(a[ye])*n,h:k(a[ge])*n,m:k(a[pe])*n,s:k(a[ve])*n,ms:k(Ct(1e3*a[we]))*n}):(a=It.exec(e))?(n=\"-\"===a[1]?-1:(a[1],1),r={y:jt(a[2],n),M:jt(a[3],n),w:jt(a[4],n),d:jt(a[5],n),h:jt(a[6],n),m:jt(a[7],n),s:jt(a[8],n)}):null==r?r={}:\"object\"==typeof r&&(\"from\"in r||\"to\"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Zt(e,t):((n=Zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,\"_locale\")&&(s._locale=e._locale),s}function jt(e,t){var n=e&&parseFloat(e.replace(\",\",\".\"));return(isNaN(n)?0:n)*t}function Zt(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 zt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,\"moment().\"+i+\"(period, number) is deprecated. Please use moment().\"+i+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),n=e,e=t,t=n),$t(this,At(e=\"string\"==typeof e?+e:e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ct(t._days),a=Ct(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,xe(e,\"Month\")+a*n),r&&be(e,\"Date\",xe(e,\"Date\")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}At.fn=Ht.prototype,At.invalid=function(){return At(NaN)};var qt=zt(1,\"add\"),Jt=zt(-1,\"subtract\");function Bt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,\"months\");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,\"months\")):(t-s)/(e.clone().add(n+1,\"months\")-s)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}c.defaultFormat=\"YYYY-MM-DDTHH:mm:ssZ\",c.defaultFormatUtc=\"YYYY-MM-DDTHH:mm:ss[Z]\";var Xt=n(\"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)});function Kt(){return this._locale}function en(e,t){I(0,[e,e.length],0,t)}function tn(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,[\"gg\",2],0,function(){return this.weekYear()%100}),I(0,[\"GG\",2],0,function(){return this.isoWeekYear()%100}),en(\"gggg\",\"weekYear\"),en(\"ggggg\",\"weekYear\"),en(\"GGGG\",\"isoWeekYear\"),en(\"GGGGG\",\"isoWeekYear\"),H(\"weekYear\",\"gg\"),H(\"isoWeekYear\",\"GG\"),L(\"weekYear\",1),L(\"isoWeekYear\",1),ue(\"G\",se),ue(\"g\",se),ue(\"GG\",B,z),ue(\"gg\",B,z),ue(\"GGGG\",ee,q),ue(\"gggg\",ee,q),ue(\"GGGGG\",te,J),ue(\"ggggg\",te,J),fe([\"gggg\",\"ggggg\",\"GGGG\",\"GGGGG\"],function(e,t,n,s){t[s.substr(0,2)]=k(e)}),fe([\"gg\",\"GG\"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I(\"Q\",0,\"Qo\",\"quarter\"),H(\"quarter\",\"Q\"),L(\"quarter\",7),ue(\"Q\",Z),ce(\"Q\",function(e,t){t[_e]=3*(k(e)-1)}),I(\"D\",[\"DD\",2],\"Do\",\"date\"),H(\"date\",\"D\"),L(\"date\",9),ue(\"D\",B),ue(\"DD\",B,z),ue(\"Do\",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce([\"D\",\"DD\"],ye),ce(\"Do\",function(e,t){t[ye]=k(e.match(B)[0])});var nn=Te(\"Date\",!0);I(\"DDD\",[\"DDDD\",3],\"DDDo\",\"dayOfYear\"),H(\"dayOfYear\",\"DDD\"),L(\"dayOfYear\",4),ue(\"DDD\",K),ue(\"DDDD\",$),ce([\"DDD\",\"DDDD\"],function(e,t,n){n._dayOfYear=k(e)}),I(\"m\",[\"mm\",2],0,\"minute\"),H(\"minute\",\"m\"),L(\"minute\",14),ue(\"m\",B),ue(\"mm\",B,z),ce([\"m\",\"mm\"],pe);var sn=Te(\"Minutes\",!1);I(\"s\",[\"ss\",2],0,\"second\"),H(\"second\",\"s\"),L(\"second\",15),ue(\"s\",B),ue(\"ss\",B,z),ce([\"s\",\"ss\"],ve);var rn,an=Te(\"Seconds\",!1);for(I(\"S\",0,0,function(){return~~(this.millisecond()/100)}),I(0,[\"SS\",2],0,function(){return~~(this.millisecond()/10)}),I(0,[\"SSS\",3],0,\"millisecond\"),I(0,[\"SSSS\",4],0,function(){return 10*this.millisecond()}),I(0,[\"SSSSS\",5],0,function(){return 100*this.millisecond()}),I(0,[\"SSSSSS\",6],0,function(){return 1e3*this.millisecond()}),I(0,[\"SSSSSSS\",7],0,function(){return 1e4*this.millisecond()}),I(0,[\"SSSSSSSS\",8],0,function(){return 1e5*this.millisecond()}),I(0,[\"SSSSSSSSS\",9],0,function(){return 1e6*this.millisecond()}),H(\"millisecond\",\"ms\"),L(\"millisecond\",16),ue(\"S\",K,Z),ue(\"SS\",K,z),ue(\"SSS\",K,$),rn=\"SSSS\";rn.length<=9;rn+=\"S\")ue(rn,ne);function on(e,t){t[we]=k(1e3*(\"0.\"+e))}for(rn=\"S\";rn.length<=9;rn+=\"S\")ce(rn,on);var un=Te(\"Milliseconds\",!1);I(\"z\",0,0,\"zoneAbbr\"),I(\"zz\",0,0,\"zoneName\");var ln=M.prototype;function dn(e){return e}ln.add=qt,ln.calendar=function(e,t){var n=e||Tt(),s=Nt(n,this).startOf(\"day\"),i=c.calendarFormat(this,s)||\"sameElse\",r=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},ln.clone=function(){return new M(this)},ln.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Nt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case\"year\":r=Bt(this,s)/12;break;case\"month\":r=Bt(this,s);break;case\"quarter\":r=Bt(this,s)/3;break;case\"second\":r=(this-s)/1e3;break;case\"minute\":r=(this-s)/6e4;break;case\"hour\":r=(this-s)/36e5;break;case\"day\":r=(this-s-i)/864e5;break;case\"week\":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:D(r)},ln.endOf=function(e){return void 0===(e=R(e))||\"millisecond\"===e?this:(\"date\"===e&&(e=\"day\"),this.startOf(e).add(1,\"isoWeek\"===e?\"week\":e).subtract(1,\"ms\"))},ln.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},ln.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.fromNow=function(e){return this.from(Tt(),e)},ln.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.toNow=function(e){return this.to(Tt(),e)},ln.get=function(e){return x(this[e=R(e)])?this[e]():this},ln.invalidAt=function(){return g(this).overflow},ln.isAfter=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=R(l(t)?\"millisecond\":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},ln.isBefore=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=R(l(t)?\"millisecond\":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return(\"(\"===(s=s||\"()\")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(\")\"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},ln.isSame=function(e,t){var n,s=S(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&(\"millisecond\"===(t=R(t||\"millisecond\"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},ln.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},ln.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},ln.isValid=function(){return p(this)},ln.lang=Xt,ln.locale=Qt,ln.localeData=Kt,ln.max=bt,ln.min=xt,ln.parsingFlags=function(){return _({},g(this))},ln.set=function(e,t){if(\"object\"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=C(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},ln.startOf=function(e){switch(e=R(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},ln.subtract=Jt,ln.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},ln.toObject=function(){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()}},ln.toDate=function(){return new Date(this.valueOf())},ln.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?\"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ\"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace(\"Z\",A(n,\"Z\")):A(n,t?\"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYY-MM-DD[T]HH:mm:ss.SSSZ\")},ln.inspect=function(){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+'(\"]',s=0<=this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",i=t+'[\")]';return this.format(n+s+\"-MM-DD[T]HH:mm:ss.SSS\"+i)},ln.toJSON=function(){return this.isValid()?this.toISOString():null},ln.toString=function(){return this.clone().locale(\"en\").format(\"ddd MMM DD YYYY HH:mm:ss [GMT]ZZ\")},ln.unix=function(){return Math.floor(this.valueOf()/1e3)},ln.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ln.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ln.year=Oe,ln.isLeapYear=function(){return ke(this.year())},ln.weekYear=function(e){return tn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ln.isoWeekYear=function(e){return tn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},ln.quarter=ln.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},ln.month=Fe,ln.daysInMonth=function(){return Pe(this.year(),this.month())},ln.week=ln.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),\"d\")},ln.isoWeek=ln.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),\"d\")},ln.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},ln.isoWeeksInYear=function(){return Ae(this.year(),1,4)},ln.date=nn,ln.day=ln.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e=\"string\"!=typeof t?t:isNaN(t)?\"number\"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,\"d\")):s},ln.weekday=function(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\")},ln.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=(n=e,s=this.localeData(),\"string\"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},ln.dayOfYear=function(e){var t=Math.round((this.clone().startOf(\"day\")-this.clone().startOf(\"year\"))/864e5)+1;return null==e?t:this.add(e-t,\"d\")},ln.hour=ln.hours=tt,ln.minute=ln.minutes=sn,ln.second=ln.seconds=an,ln.millisecond=ln.milliseconds=un,ln.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if(\"string\"==typeof e){if(null===(e=Ut(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Gt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,\"m\"),i!==e&&(!t||this._changeInProgress?$t(this,At(e-i,\"m\"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Gt(this)},ln.utc=function(e){return this.utcOffset(0,e)},ln.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),\"m\")),this},ln.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if(\"string\"==typeof this._i){var e=Ut(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},ln.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},ln.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?\"UTC\":\"\"},ln.zoneName=function(){return this._isUTC?\"Coordinated Universal Time\":\"\"},ln.dates=n(\"dates accessor is deprecated. Use date instead.\",nn),ln.months=n(\"months accessor is deprecated. Use month instead\",Fe),ln.years=n(\"years accessor is deprecated. Use year instead\",Oe),ln.zone=n(\"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/\",function(e,t){return null!=e?(\"string\"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n(\"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information\",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=P.prototype;function cn(e,t,n,s){var i=lt(),r=y().set(s,t);return i[n](r,e)}function fn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||\"\",null!=t)return cn(e,t,n,\"month\");var s,i=[];for(s=0;s<12;s++)i[s]=cn(e,s,n,\"month\");return i}function mn(e,t,n,s){\"boolean\"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=t||\"\";var i,r=lt(),a=e?r._week.dow:0;if(null!=n)return cn(t,(n+a)%7,s,\"day\");var o=[];for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,\"day\");return o}hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},hn.longDateFormat=function(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])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace(\"%d\",e)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var n=this._relativeTime[0<e?\"future\":\"past\"];return x(n)?n(t):n.replace(/%s/i,t)},hn.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this[\"_\"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+\"|\"+/\\d{1,2}/.source)},hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?\"format\":\"standalone\"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?\"format\":\"standalone\"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,\"\").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,\"\").toLocaleLowerCase();return n?\"MMM\"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:\"MMM\"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp(\"^\"+this.months(i,\"\").replace(\".\",\"\")+\"$\",\"i\"),this._shortMonthsParse[s]=new RegExp(\"^\"+this.monthsShort(i,\"\").replace(\".\",\"\")+\"$\",\"i\")),n||this._monthsParse[s]||(r=\"^\"+this.months(i,\"\")+\"|^\"+this.monthsShort(i,\"\"),this._monthsParse[s]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"MMMM\"===t&&this._longMonthsParse[s].test(e))return s;if(n&&\"MMM\"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},hn.monthsRegex=function(e){return this._monthsParseExact?(m(this,\"_monthsRegex\")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,\"_monthsRegex\")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,\"_monthsRegex\")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,\"_monthsShortRegex\")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?\"format\":\"standalone\"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,\"\").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,\"\").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,\"\").toLocaleLowerCase();return n?\"dddd\"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:\"ddd\"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:\"dddd\"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:\"ddd\"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp(\"^\"+this.weekdays(i,\"\").replace(\".\",\".?\")+\"$\",\"i\"),this._shortWeekdaysParse[s]=new RegExp(\"^\"+this.weekdaysShort(i,\"\").replace(\".\",\".?\")+\"$\",\"i\"),this._minWeekdaysParse[s]=new RegExp(\"^\"+this.weekdaysMin(i,\"\").replace(\".\",\".?\")+\"$\",\"i\")),this._weekdaysParse[s]||(r=\"^\"+this.weekdays(i,\"\")+\"|^\"+this.weekdaysShort(i,\"\")+\"|^\"+this.weekdaysMin(i,\"\"),this._weekdaysParse[s]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"dddd\"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&\"ddd\"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&\"dd\"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,\"_weekdaysRegex\")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,\"_weekdaysRegex\")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,\"_weekdaysRegex\")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,\"_weekdaysShortRegex\")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,\"_weekdaysRegex\")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,\"_weekdaysMinRegex\")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return\"p\"===(e+\"\").toLowerCase().charAt(0)},hn.meridiem=function(e,t,n){return 11<e?n?\"pm\":\"PM\":n?\"am\":\"AM\"},ot(\"en\",{dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?\"th\":1===t?\"st\":2===t?\"nd\":3===t?\"rd\":\"th\")}}),c.lang=n(\"moment.lang is deprecated. Use moment.locale instead.\",ot),c.langData=n(\"moment.langData is deprecated. Use moment.localeData instead.\",lt);var _n=Math.abs;function yn(e,t,n,s){var i=At(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function pn(e){return 4800*e/146097}function vn(e){return 146097*e/4800}function wn(e){return function(){return this.as(e)}}var Mn=wn(\"ms\"),Sn=wn(\"s\"),Dn=wn(\"m\"),kn=wn(\"h\"),Yn=wn(\"d\"),On=wn(\"w\"),Tn=wn(\"M\"),xn=wn(\"y\");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=bn(\"milliseconds\"),Wn=bn(\"seconds\"),Hn=bn(\"minutes\"),Rn=bn(\"hours\"),Cn=bn(\"days\"),Fn=bn(\"months\"),Ln=bn(\"years\");var Un=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Gn=Math.abs;function Vn(e){return(0<e)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,s=Gn(this._days),i=Gn(this._months);t=D((e=D(n/60))/60),n%=60,e%=60;var r=D(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\\.?0+$/,\"\"):\"\",h=this.asSeconds();if(!h)return\"P0D\";var c=h<0?\"-\":\"\",f=Vn(this._months)!==Vn(h)?\"-\":\"\",m=Vn(this._days)!==Vn(h)?\"-\":\"\",_=Vn(this._milliseconds)!==Vn(h)?\"-\":\"\";return c+\"P\"+(r?f+r+\"Y\":\"\")+(a?f+a+\"M\":\"\")+(o?m+o+\"D\":\"\")+(u||l||d?\"T\":\"\")+(u?_+u+\"H\":\"\")+(l?_+l+\"M\":\"\")+(d?_+d+\"S\":\"\")}var In=Ht.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},In.add=function(e,t){return yn(this,e,t,1)},In.subtract=function(e,t){return yn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(\"month\"===(e=R(e))||\"year\"===e)return t=this._days+s/864e5,n=this._months+pn(t),\"month\"===e?n:n/12;switch(t=this._days+Math.round(vn(this._months)),e){case\"week\":return t/7+s/6048e5;case\"day\":return t+s/864e5;case\"hour\":return 24*t+s/36e5;case\"minute\":return 1440*t+s/6e4;case\"second\":return 86400*t+s/1e3;case\"millisecond\":return Math.floor(864e5*t)+s;default:throw new Error(\"Unknown unit \"+e)}},In.asMilliseconds=Mn,In.asSeconds=Sn,In.asMinutes=Dn,In.asHours=kn,In.asDays=Yn,In.asWeeks=On,In.asMonths=Tn,In.asYears=xn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},In._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*gn(vn(o)+a),o=a=0),u.milliseconds=r%1e3,e=D(r/1e3),u.seconds=e%60,t=D(e/60),u.minutes=t%60,n=D(t/60),u.hours=n%24,o+=i=D(pn(a+=D(n/24))),a-=gn(vn(i)),s=D(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},In.clone=function(){return At(this)},In.get=function(e){return e=R(e),this.isValid()?this[e+\"s\"]():NaN},In.milliseconds=Pn,In.seconds=Wn,In.minutes=Hn,In.hours=Rn,In.days=Cn,In.weeks=function(){return D(this.days()/7)},In.months=Fn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,d,h,c=this.localeData(),f=(n=!e,s=c,i=At(t=this).abs(),r=Un(i.as(\"s\")),a=Un(i.as(\"m\")),o=Un(i.as(\"h\")),u=Un(i.as(\"d\")),l=Un(i.as(\"M\")),d=Un(i.as(\"y\")),(h=r<=Nn.ss&&[\"s\",r]||r<Nn.s&&[\"ss\",r]||a<=1&&[\"m\"]||a<Nn.m&&[\"mm\",a]||o<=1&&[\"h\"]||o<Nn.h&&[\"hh\",o]||u<=1&&[\"d\"]||u<Nn.d&&[\"dd\",u]||l<=1&&[\"M\"]||l<Nn.M&&[\"MM\",l]||d<=1&&[\"y\"]||[\"yy\",d])[2]=n,h[3]=0<+t,h[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,h));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},In.toISOString=En,In.toString=En,In.toJSON=En,In.locale=Qt,In.localeData=Kt,In.toIsoString=n(\"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)\",En),In.lang=Xt,I(\"X\",0,0,\"unix\"),I(\"x\",0,0,\"valueOf\"),ue(\"x\",se),ue(\"X\",/[+-]?\\d+(\\.\\d{1,3})?/),ce(\"X\",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce(\"x\",function(e,t,n){n._d=new Date(k(e))}),c.version=\"2.22.1\",e=Tt,c.fn=ln,c.min=function(){return Pt(\"isBefore\",[].slice.call(arguments,0))},c.max=function(){return Pt(\"isAfter\",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return Tt(1e3*e)},c.months=function(e,t){return fn(e,t,\"months\")},c.isDate=h,c.locale=ot,c.invalid=v,c.duration=At,c.isMoment=S,c.weekdays=function(e,t,n){return mn(e,t,n,\"weekdays\")},c.parseZone=function(){return Tt.apply(null,arguments).parseZone()},c.localeData=lt,c.isDuration=Rt,c.monthsShort=function(e,t){return fn(e,t,\"monthsShort\")},c.weekdaysMin=function(e,t,n){return mn(e,t,n,\"weekdaysMin\")},c.defineLocale=ut,c.updateLocale=function(e,t){if(null!=t){var n,s,i=nt;null!=(s=at(e))&&(i=s._config),(n=new P(t=b(i,t))).parentLocale=st[e],st[e]=n,ot(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},c.locales=function(){return s(st)},c.weekdaysShort=function(e,t,n){return mn(e,t,n,\"weekdaysShort\")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?Un:\"function\"==typeof e&&(Un=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,\"s\"===e&&(Nn.ss=t-1),!0))},c.calendarFormat=function(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\"},c.prototype=ln,c.HTML5_FMT={DATETIME_LOCAL:\"YYYY-MM-DDTHH:mm\",DATETIME_LOCAL_SECONDS:\"YYYY-MM-DDTHH:mm:ss\",DATETIME_LOCAL_MS:\"YYYY-MM-DDTHH:mm:ss.SSS\",DATE:\"YYYY-MM-DD\",TIME:\"HH:mm\",TIME_SECONDS:\"HH:mm:ss\",TIME_MS:\"HH:mm:ss.SSS\",WEEK:\"YYYY-[W]WW\",MONTH:\"YYYY-MM\"},c});","module.exports = exports = window.fetch;\n\n// Needed for TypeScript and Webpack.\nexports.default = window.fetch.bind(window);\n\nexports.Headers = window.Headers;\nexports.Request = window.Request;\nexports.Response = window.Response;\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n var dict;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n // Convert data if needed\n if (typeof dictionary === 'string') {\n dict = strings.string2buf(dictionary);\n } else if (toString.call(dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(dictionary);\n } else {\n dict = dictionary;\n }\n\n status = zlib_inflate.inflateSetDictionary(this.strm, dict);\n\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // use fallback for big arrays to avoid stack overflow\n if (len < 65537) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}\n\n\n/* ===========================================================================\n * Initialize the various 'constant' tables.\n */\nfunction tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","import PropTypes from 'prop-types';\nimport { Component, cloneElement, h, options, render } from 'preact';\n\nvar version = '15.1.0'; // trick libraries to think we are react\n\nvar ELEMENTS = 'a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan'.split(' ');\n\nvar REACT_ELEMENT_TYPE = (typeof Symbol!=='undefined' && Symbol.for && Symbol.for('react.element')) || 0xeac7;\n\nvar COMPONENT_WRAPPER_KEY = (typeof Symbol!=='undefined' && Symbol.for) ? Symbol.for('__preactCompatWrapper') : '__preactCompatWrapper';\n\n// don't autobind these methods since they already have guaranteed context.\nvar AUTOBIND_BLACKLIST = {\n\tconstructor: 1,\n\trender: 1,\n\tshouldComponentUpdate: 1,\n\tcomponentWillReceiveProps: 1,\n\tcomponentWillUpdate: 1,\n\tcomponentDidUpdate: 1,\n\tcomponentWillMount: 1,\n\tcomponentDidMount: 1,\n\tcomponentWillUnmount: 1,\n\tcomponentDidUnmount: 1\n};\n\n\nvar CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/;\n\n\nvar BYPASS_HOOK = {};\n\n/*global process*/\nvar DEV = typeof process==='undefined' || !process.env || process.env.NODE_ENV!=='production';\n\n// a component that renders nothing. Used to replace components for unmountComponentAtNode.\nfunction EmptyComponent() { return null; }\n\n\n\n// make react think we're react.\nvar VNode = h('a', null).constructor;\nVNode.prototype.$$typeof = REACT_ELEMENT_TYPE;\nVNode.prototype.preactCompatUpgraded = false;\nVNode.prototype.preactCompatNormalized = false;\n\nObject.defineProperty(VNode.prototype, 'type', {\n\tget: function() { return this.nodeName; },\n\tset: function(v) { this.nodeName = v; },\n\tconfigurable:true\n});\n\nObject.defineProperty(VNode.prototype, 'props', {\n\tget: function() { return this.attributes; },\n\tset: function(v) { this.attributes = v; },\n\tconfigurable:true\n});\n\n\n\nvar oldEventHook = options.event;\noptions.event = function (e) {\n\tif (oldEventHook) { e = oldEventHook(e); }\n\te.persist = Object;\n\te.nativeEvent = e;\n\treturn e;\n};\n\n\nvar oldVnodeHook = options.vnode;\noptions.vnode = function (vnode) {\n\tif (!vnode.preactCompatUpgraded) {\n\t\tvnode.preactCompatUpgraded = true;\n\n\t\tvar tag = vnode.nodeName,\n\t\t\tattrs = vnode.attributes = extend({}, vnode.attributes);\n\n\t\tif (typeof tag==='function') {\n\t\t\tif (tag[COMPONENT_WRAPPER_KEY]===true || (tag.prototype && 'isReactComponent' in tag.prototype)) {\n\t\t\t\tif (vnode.children && String(vnode.children)==='') { vnode.children = undefined; }\n\t\t\t\tif (vnode.children) { attrs.children = vnode.children; }\n\n\t\t\t\tif (!vnode.preactCompatNormalized) {\n\t\t\t\t\tnormalizeVNode(vnode);\n\t\t\t\t}\n\t\t\t\thandleComponentVNode(vnode);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (vnode.children && String(vnode.children)==='') { vnode.children = undefined; }\n\t\t\tif (vnode.children) { attrs.children = vnode.children; }\n\n\t\t\tif (attrs.defaultValue) {\n\t\t\t\tif (!attrs.value && attrs.value!==0) {\n\t\t\t\t\tattrs.value = attrs.defaultValue;\n\t\t\t\t}\n\t\t\t\tdelete attrs.defaultValue;\n\t\t\t}\n\n\t\t\thandleElementVNode(vnode, attrs);\n\t\t}\n\t}\n\n\tif (oldVnodeHook) { oldVnodeHook(vnode); }\n};\n\nfunction handleComponentVNode(vnode) {\n\tvar tag = vnode.nodeName,\n\t\ta = vnode.attributes;\n\n\tvnode.attributes = {};\n\tif (tag.defaultProps) { extend(vnode.attributes, tag.defaultProps); }\n\tif (a) { extend(vnode.attributes, a); }\n}\n\nfunction handleElementVNode(vnode, a) {\n\tvar shouldSanitize, attrs, i;\n\tif (a) {\n\t\tfor (i in a) { if ((shouldSanitize = CAMEL_PROPS.test(i))) { break; } }\n\t\tif (shouldSanitize) {\n\t\t\tattrs = vnode.attributes = {};\n\t\t\tfor (i in a) {\n\t\t\t\tif (a.hasOwnProperty(i)) {\n\t\t\t\t\tattrs[ CAMEL_PROPS.test(i) ? i.replace(/([A-Z0-9])/, '-$1').toLowerCase() : i ] = a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n\n// proxy render() since React returns a Component reference.\nfunction render$1(vnode, parent, callback) {\n\tvar prev = parent && parent._preactCompatRendered && parent._preactCompatRendered.base;\n\n\t// ignore impossible previous renders\n\tif (prev && prev.parentNode!==parent) { prev = null; }\n\n\t// default to first Element child\n\tif (!prev && parent) { prev = parent.firstElementChild; }\n\n\t// remove unaffected siblings\n\tfor (var i=parent.childNodes.length; i--; ) {\n\t\tif (parent.childNodes[i]!==prev) {\n\t\t\tparent.removeChild(parent.childNodes[i]);\n\t\t}\n\t}\n\n\tvar out = render(vnode, parent, prev);\n\tif (parent) { parent._preactCompatRendered = out && (out._component || { base: out }); }\n\tif (typeof callback==='function') { callback(); }\n\treturn out && out._component || out;\n}\n\n\nvar ContextProvider = function () {};\n\nContextProvider.prototype.getChildContext = function () {\n\treturn this.props.context;\n};\nContextProvider.prototype.render = function (props) {\n\treturn props.children[0];\n};\n\nfunction renderSubtreeIntoContainer(parentComponent, vnode, container, callback) {\n\tvar wrap = h(ContextProvider, { context: parentComponent.context }, vnode);\n\tvar renderContainer = render$1(wrap, container);\n\tvar component = renderContainer._component || renderContainer.base;\n\tif (callback) { callback.call(component, renderContainer); }\n\treturn component;\n}\n\n\nfunction unmountComponentAtNode(container) {\n\tvar existing = container._preactCompatRendered && container._preactCompatRendered.base;\n\tif (existing && existing.parentNode===container) {\n\t\trender(h(EmptyComponent), container, existing);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n\nvar ARR = [];\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nvar Children = {\n\tmap: function(children, fn, ctx) {\n\t\tif (children == null) { return null; }\n\t\tchildren = Children.toArray(children);\n\t\tif (ctx && ctx!==children) { fn = fn.bind(ctx); }\n\t\treturn children.map(fn);\n\t},\n\tforEach: function(children, fn, ctx) {\n\t\tif (children == null) { return null; }\n\t\tchildren = Children.toArray(children);\n\t\tif (ctx && ctx!==children) { fn = fn.bind(ctx); }\n\t\tchildren.forEach(fn);\n\t},\n\tcount: function(children) {\n\t\treturn children && children.length || 0;\n\t},\n\tonly: function(children) {\n\t\tchildren = Children.toArray(children);\n\t\tif (children.length!==1) { throw new Error('Children.only() expects only one child.'); }\n\t\treturn children[0];\n\t},\n\ttoArray: function(children) {\n\t\tif (children == null) { return []; }\n\t\treturn ARR.concat(children);\n\t}\n};\n\n\n/** Track current render() component for ref assignment */\nvar currentComponent;\n\n\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n\nvar DOM = {};\nfor (var i=ELEMENTS.length; i--; ) {\n\tDOM[ELEMENTS[i]] = createFactory(ELEMENTS[i]);\n}\n\nfunction upgradeToVNodes(arr, offset) {\n\tfor (var i=offset || 0; i<arr.length; i++) {\n\t\tvar obj = arr[i];\n\t\tif (Array.isArray(obj)) {\n\t\t\tupgradeToVNodes(obj);\n\t\t}\n\t\telse if (obj && typeof obj==='object' && !isValidElement(obj) && ((obj.props && obj.type) || (obj.attributes && obj.nodeName) || obj.children)) {\n\t\t\tarr[i] = createElement(obj.type || obj.nodeName, obj.props || obj.attributes, obj.children);\n\t\t}\n\t}\n}\n\nfunction isStatelessComponent(c) {\n\treturn typeof c==='function' && !(c.prototype && c.prototype.render);\n}\n\n\n// wraps stateless functional components in a PropTypes validator\nfunction wrapStatelessComponent(WrappedComponent) {\n\treturn createClass({\n\t\tdisplayName: WrappedComponent.displayName || WrappedComponent.name,\n\t\trender: function() {\n\t\t\treturn WrappedComponent(this.props, this.context);\n\t\t}\n\t});\n}\n\n\nfunction statelessComponentHook(Ctor) {\n\tvar Wrapped = Ctor[COMPONENT_WRAPPER_KEY];\n\tif (Wrapped) { return Wrapped===true ? Ctor : Wrapped; }\n\n\tWrapped = wrapStatelessComponent(Ctor);\n\n\tObject.defineProperty(Wrapped, COMPONENT_WRAPPER_KEY, { configurable:true, value:true });\n\tWrapped.displayName = Ctor.displayName;\n\tWrapped.propTypes = Ctor.propTypes;\n\tWrapped.defaultProps = Ctor.defaultProps;\n\n\tObject.defineProperty(Ctor, COMPONENT_WRAPPER_KEY, { configurable:true, value:Wrapped });\n\n\treturn Wrapped;\n}\n\n\nfunction createElement() {\n\tvar args = [], len = arguments.length;\n\twhile ( len-- ) args[ len ] = arguments[ len ];\n\n\tupgradeToVNodes(args, 2);\n\treturn normalizeVNode(h.apply(void 0, args));\n}\n\n\nfunction normalizeVNode(vnode) {\n\tvnode.preactCompatNormalized = true;\n\n\tapplyClassName(vnode);\n\n\tif (isStatelessComponent(vnode.nodeName)) {\n\t\tvnode.nodeName = statelessComponentHook(vnode.nodeName);\n\t}\n\n\tvar ref = vnode.attributes.ref,\n\t\ttype = ref && typeof ref;\n\tif (currentComponent && (type==='string' || type==='number')) {\n\t\tvnode.attributes.ref = createStringRefProxy(ref, currentComponent);\n\t}\n\n\tapplyEventNormalization(vnode);\n\n\treturn vnode;\n}\n\n\nfunction cloneElement$1(element, props) {\n\tvar children = [], len = arguments.length - 2;\n\twhile ( len-- > 0 ) children[ len ] = arguments[ len + 2 ];\n\n\tif (!isValidElement(element)) { return element; }\n\tvar elementProps = element.attributes || element.props;\n\tvar node = h(\n\t\telement.nodeName || element.type,\n\t\textend({}, elementProps),\n\t\telement.children || elementProps && elementProps.children\n\t);\n\t// Only provide the 3rd argument if needed.\n\t// Arguments 3+ overwrite element.children in preactCloneElement\n\tvar cloneArgs = [node, props];\n\tif (children && children.length) {\n\t\tcloneArgs.push(children);\n\t}\n\telse if (props && props.children) {\n\t\tcloneArgs.push(props.children);\n\t}\n\treturn normalizeVNode(cloneElement.apply(void 0, cloneArgs));\n}\n\n\nfunction isValidElement(element) {\n\treturn element && ((element instanceof VNode) || element.$$typeof===REACT_ELEMENT_TYPE);\n}\n\n\nfunction createStringRefProxy(name, component) {\n\treturn component._refProxies[name] || (component._refProxies[name] = function (resolved) {\n\t\tif (component && component.refs) {\n\t\t\tcomponent.refs[name] = resolved;\n\t\t\tif (resolved===null) {\n\t\t\t\tdelete component._refProxies[name];\n\t\t\t\tcomponent = null;\n\t\t\t}\n\t\t}\n\t});\n}\n\n\nfunction applyEventNormalization(ref) {\n\tvar nodeName = ref.nodeName;\n\tvar attributes = ref.attributes;\n\n\tif (!attributes || typeof nodeName!=='string') { return; }\n\tvar props = {};\n\tfor (var i in attributes) {\n\t\tprops[i.toLowerCase()] = i;\n\t}\n\tif (props.ondoubleclick) {\n\t\tattributes.ondblclick = attributes[props.ondoubleclick];\n\t\tdelete attributes[props.ondoubleclick];\n\t}\n\t// for *textual inputs* (incl textarea), normalize `onChange` -> `onInput`:\n\tif (props.onchange && (nodeName==='textarea' || (nodeName.toLowerCase()==='input' && !/^fil|che|rad/i.test(attributes.type)))) {\n\t\tvar normalized = props.oninput || 'oninput';\n\t\tif (!attributes[normalized]) {\n\t\t\tattributes[normalized] = multihook([attributes[normalized], attributes[props.onchange]]);\n\t\t\tdelete attributes[props.onchange];\n\t\t}\n\t}\n}\n\n\nfunction applyClassName(vnode) {\n\tvar a = vnode.attributes || (vnode.attributes = {});\n\tclassNameDescriptor.enumerable = 'className' in a;\n\tif (a.className) { a.class = a.className; }\n\tObject.defineProperty(a, 'className', classNameDescriptor);\n}\n\n\nvar classNameDescriptor = {\n\tconfigurable: true,\n\tget: function() { return this.class; },\n\tset: function(v) { this.class = v; }\n};\n\nfunction extend(base, props) {\n\tvar arguments$1 = arguments;\n\n\tfor (var i=1, obj = (void 0); i<arguments.length; i++) {\n\t\tif ((obj = arguments$1[i])) {\n\t\t\tfor (var key in obj) {\n\t\t\t\tif (obj.hasOwnProperty(key)) {\n\t\t\t\t\tbase[key] = obj[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn base;\n}\n\n\nfunction shallowDiffers(a, b) {\n\tfor (var i in a) { if (!(i in b)) { return true; } }\n\tfor (var i$1 in b) { if (a[i$1]!==b[i$1]) { return true; } }\n\treturn false;\n}\n\n\nfunction findDOMNode(component) {\n\treturn component && component.base || component;\n}\n\n\nfunction F(){}\n\nfunction createClass(obj) {\n\tfunction cl(props, context) {\n\t\tbindAll(this);\n\t\tComponent$1.call(this, props, context, BYPASS_HOOK);\n\t\tnewComponentHook.call(this, props, context);\n\t}\n\n\tobj = extend({ constructor: cl }, obj);\n\n\t// We need to apply mixins here so that getDefaultProps is correctly mixed\n\tif (obj.mixins) {\n\t\tapplyMixins(obj, collateMixins(obj.mixins));\n\t}\n\tif (obj.statics) {\n\t\textend(cl, obj.statics);\n\t}\n\tif (obj.propTypes) {\n\t\tcl.propTypes = obj.propTypes;\n\t}\n\tif (obj.defaultProps) {\n\t\tcl.defaultProps = obj.defaultProps;\n\t}\n\tif (obj.getDefaultProps) {\n\t\tcl.defaultProps = obj.getDefaultProps.call(cl);\n\t}\n\n\tF.prototype = Component$1.prototype;\n\tcl.prototype = extend(new F(), obj);\n\n\tcl.displayName = obj.displayName || 'Component';\n\n\treturn cl;\n}\n\n\n// Flatten an Array of mixins to a map of method name to mixin implementations\nfunction collateMixins(mixins) {\n\tvar keyed = {};\n\tfor (var i=0; i<mixins.length; i++) {\n\t\tvar mixin = mixins[i];\n\t\tfor (var key in mixin) {\n\t\t\tif (mixin.hasOwnProperty(key) && typeof mixin[key]==='function') {\n\t\t\t\t(keyed[key] || (keyed[key]=[])).push(mixin[key]);\n\t\t\t}\n\t\t}\n\t}\n\treturn keyed;\n}\n\n\n// apply a mapping of Arrays of mixin methods to a component prototype\nfunction applyMixins(proto, mixins) {\n\tfor (var key in mixins) { if (mixins.hasOwnProperty(key)) {\n\t\tproto[key] = multihook(\n\t\t\tmixins[key].concat(proto[key] || ARR),\n\t\t\tkey==='getDefaultProps' || key==='getInitialState' || key==='getChildContext'\n\t\t);\n\t} }\n}\n\n\nfunction bindAll(ctx) {\n\tfor (var i in ctx) {\n\t\tvar v = ctx[i];\n\t\tif (typeof v==='function' && !v.__bound && !AUTOBIND_BLACKLIST.hasOwnProperty(i)) {\n\t\t\t(ctx[i] = v.bind(ctx)).__bound = true;\n\t\t}\n\t}\n}\n\n\nfunction callMethod(ctx, m, args) {\n\tif (typeof m==='string') {\n\t\tm = ctx.constructor.prototype[m];\n\t}\n\tif (typeof m==='function') {\n\t\treturn m.apply(ctx, args);\n\t}\n}\n\nfunction multihook(hooks, skipDuplicates) {\n\treturn function() {\n\t\tvar arguments$1 = arguments;\n\t\tvar this$1 = this;\n\n\t\tvar ret;\n\t\tfor (var i=0; i<hooks.length; i++) {\n\t\t\tvar r = callMethod(this$1, hooks[i], arguments$1);\n\n\t\t\tif (skipDuplicates && r!=null) {\n\t\t\t\tif (!ret) { ret = {}; }\n\t\t\t\tfor (var key in r) { if (r.hasOwnProperty(key)) {\n\t\t\t\t\tret[key] = r[key];\n\t\t\t\t} }\n\t\t\t}\n\t\t\telse if (typeof r!=='undefined') { ret = r; }\n\t\t}\n\t\treturn ret;\n\t};\n}\n\n\nfunction newComponentHook(props, context) {\n\tpropsHook.call(this, props, context);\n\tthis.componentWillReceiveProps = multihook([propsHook, this.componentWillReceiveProps || 'componentWillReceiveProps']);\n\tthis.render = multihook([propsHook, beforeRender, this.render || 'render', afterRender]);\n}\n\n\nfunction propsHook(props, context) {\n\tif (!props) { return; }\n\n\t// React annoyingly special-cases single children, and some react components are ridiculously strict about this.\n\tvar c = props.children;\n\tif (c && Array.isArray(c) && c.length===1 && (typeof c[0]==='string' || typeof c[0]==='function' || c[0] instanceof VNode)) {\n\t\tprops.children = c[0];\n\n\t\t// but its totally still going to be an Array.\n\t\tif (props.children && typeof props.children==='object') {\n\t\t\tprops.children.length = 1;\n\t\t\tprops.children[0] = props.children;\n\t\t}\n\t}\n\n\t// add proptype checking\n\tif (DEV) {\n\t\tvar ctor = typeof this==='function' ? this : this.constructor,\n\t\t\tpropTypes = this.propTypes || ctor.propTypes;\n\t\tvar displayName = this.displayName || ctor.name;\n\n\t\tif (propTypes) {\n\t\t\tPropTypes.checkPropTypes(propTypes, props, 'prop', displayName);\n\t\t}\n\t}\n}\n\n\nfunction beforeRender(props) {\n\tcurrentComponent = this;\n}\n\nfunction afterRender() {\n\tif (currentComponent===this) {\n\t\tcurrentComponent = null;\n\t}\n}\n\n\n\nfunction Component$1(props, context, opts) {\n\tComponent.call(this, props, context);\n\tthis.state = this.getInitialState ? this.getInitialState() : {};\n\tthis.refs = {};\n\tthis._refProxies = {};\n\tif (opts!==BYPASS_HOOK) {\n\t\tnewComponentHook.call(this, props, context);\n\t}\n}\nextend(Component$1.prototype = new Component(), {\n\tconstructor: Component$1,\n\n\tisReactComponent: {},\n\n\treplaceState: function(state, callback) {\n\t\tvar this$1 = this;\n\n\t\tthis.setState(state, callback);\n\t\tfor (var i in this$1.state) {\n\t\t\tif (!(i in state)) {\n\t\t\t\tdelete this$1.state[i];\n\t\t\t}\n\t\t}\n\t},\n\n\tgetDOMNode: function() {\n\t\treturn this.base;\n\t},\n\n\tisMounted: function() {\n\t\treturn !!this.base;\n\t}\n});\n\n\n\nfunction PureComponent(props, context) {\n\tComponent$1.call(this, props, context);\n}\nF.prototype = Component$1.prototype;\nPureComponent.prototype = new F();\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function(props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n\nvar index = {\n\tversion: version,\n\tDOM: DOM,\n\tPropTypes: PropTypes,\n\tChildren: Children,\n\trender: render$1,\n\tcreateClass: createClass,\n\tcreateFactory: createFactory,\n\tcreateElement: createElement,\n\tcloneElement: cloneElement$1,\n\tisValidElement: isValidElement,\n\tfindDOMNode: findDOMNode,\n\tunmountComponentAtNode: unmountComponentAtNode,\n\tComponent: Component$1,\n\tPureComponent: PureComponent,\n\tunstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer,\n\t__spread: extend\n};\n\nexport { version, DOM, PropTypes, Children, render$1 as render, createClass, createFactory, createElement, cloneElement$1 as cloneElement, isValidElement, findDOMNode, unmountComponentAtNode, Component$1 as Component, PureComponent, renderSubtreeIntoContainer as unstable_renderSubtreeIntoContainer, extend as __spread };export default index;\n//# sourceMappingURL=preact-compat.es.js.map\n","/** Virtual DOM Node */\nfunction VNode() {}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nvar options = {\n\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n *\t@name syncComponentUpdates\n *\t@type Boolean\n *\t@default true\n */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t// afterMount(component) { }\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t// afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\n * the current _actual_ DOM structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `<div id=\"foo\" name=\"bar\">Hello!</div>`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\n * @param {Object} attributes\tAny attributes/props to set on the created element.\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\n *\n * @public\n */\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\n/**\n * Copy all properties from `props` onto `obj`.\n * @param {Object} obj\t\tObject onto which properties should be copied.\n * @param {Object} props\tObject from which to copy properties.\n * @returns obj\n * @private\n */\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n *\n * @param {Function} callback\n */\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\n// DOM properties that should NOT have \"px\" added when numeric\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n/** Managed queue of dirty components to be re-rendered */\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p,\n\t list = items;\n\titems = [];\n\twhile (p = list.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nfunction isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined;\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n }\n return hydrating || node._componentConstructor === vnode.nodeName;\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nfunction isNamedNode(node, nodeName) {\n return node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nfunction getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n\n var defaultProps = vnode.nodeName.defaultProps;\n if (defaultProps !== undefined) {\n for (var i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i];\n }\n }\n }\n\n return props;\n}\n\n/** Create an element with the given nodeName.\n *\t@param {String} nodeName\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\n *\t@returns {Element} node\n */\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\n/** Remove a child node from its parent if attached.\n *\t@param {Element} node\t\tThe node to remove\n */\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\n *\tIf `value` is `null`, the attribute/handler will be removed.\n *\t@param {Element} node\tAn element to mutate\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\n *\t@param {any} old\tThe last value that was set for this name/node pair\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\n *\t@private\n */\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {\n\t\t// ignore\n\t} else if (name === 'ref') {\n\t\tif (old) old(null);\n\t\tif (value) value(node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\tsetProperty(node, name, value == null ? '' : value);\n\t\tif (value == null || value === false) node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n/** Attempt to set a DOM property to the given value.\n *\tIE & FF throw for certain property-value combinations.\n */\nfunction setProperty(node, name, value) {\n\ttry {\n\t\tnode[name] = value;\n\t} catch (e) {}\n}\n\n/** Proxy an event to hooked event handlers\n *\t@private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nvar mounts = [];\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nvar diffLevel = 0;\n\n/** Global flag indicating if the diff is currently within an SVG */\nvar isSvgMode = false;\n\n/** Global flag indicating if the diff is performing hydration */\nvar hydrating = false;\n\n/** Invoke queued componentDidMount lifecycle methods */\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\t// If the VNode represents a Component, perform a component diff:\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t} // if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props);\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\t// attempt to find a node based on key matching\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// attempt to pluck a node of the same type from the existing children\n\t\t\telse if (!child && min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove unused keyed children:\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\t// remove orphaned unkeyed children:\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\n\t\tunmountComponent(component);\n\t} else {\n\t\t// If the node's VNode had a ref function, invoke it with null here.\n\t\t// (this is part of the React spec, and smart for unsetting references)\n\t\tif (node['__preactattr_'] != null && node['__preactattr_'].ref) node['__preactattr_'].ref(null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\t// remove attributes no longer present on the vnode by setting them to undefined\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\t// add new & update changed attributes\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\n/** Retains a pool of Components for re-use, keyed on component name.\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\n *\t@private\n */\nvar components = {};\n\n/** Reclaim a component for later re-use by the recycler. */\nfunction collectComponent(component) {\n\tvar name = component.constructor.name;\n\t(components[name] || (components[name] = [])).push(component);\n}\n\n/** Create a component. Normalizes differences between PFC's and classful Components. */\nfunction createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\n/** Set a component's `props` (generally derived from JSX attributes).\n *\t@param {Object} props\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\n */\nfunction setComponentProps(component, props, opts, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tif (component.__ref = props.ref) delete props.ref;\n\tif (component.__key = props.key) delete props.key;\n\n\tif (!component.base || mountAll) {\n\t\tif (component.componentWillMount) component.componentWillMount();\n\t} else if (component.componentWillReceiveProps) {\n\t\tcomponent.componentWillReceiveProps(props, context);\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (opts !== 0) {\n\t\tif (opts === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tif (component.__ref) component.__ref(component);\n}\n\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\n *\t@param {Component} component\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\n *\t@private\n */\nfunction renderComponent(component, opts, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t rendered,\n\t inst,\n\t cbase;\n\n\t// if updating\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (opts !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\t// context to pass to the child, can be updated via (grand-)parent component\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\t\t\t// set up high order component link\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\t// destroy high order component link\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || opts === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.unshift(component);\n\t} else if (!skip) {\n\t\t// Ensure that pending componentDidMount() hooks of child components\n\t\t// are called before the componentDidUpdate() hook in the parent.\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n\t\t// flushMounts();\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\tif (component._renderCallbacks != null) {\n\t\twhile (component._renderCallbacks.length) {\n\t\t\tcomponent._renderCallbacks.pop().call(component);\n\t\t}\n\t}\n\n\tif (!diffLevel && !isChild) flushMounts();\n}\n\n/** Apply the Component referenced by a VNode to the DOM.\n *\t@param {Element} dom\tThe DOM node to mutate\n *\t@param {VNode} vnode\tA Component-referencing VNode\n *\t@returns {Element} dom\tThe created/mutated element\n *\t@private\n */\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/** Remove a component from the DOM and recycle it.\n *\t@param {Component} component\tThe Component instance to unmount\n *\t@private\n */\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\t// recursively tear down & recollect high-order component children:\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] && base['__preactattr_'].ref) base['__preactattr_'].ref(null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\tcollectComponent(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tif (component.__ref) component.__ref(null);\n}\n\n/** Base Component class.\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\n *\t@public\n *\n *\t@example\n *\tclass MyFoo extends Component {\n *\t\trender(props, state) {\n *\t\t\treturn <div />;\n *\t\t}\n *\t}\n */\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.context = context;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.props = props;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.state = this.state || {};\n}\n\nextend(Component.prototype, {\n\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\n *\t@param {object} nextProps\n *\t@param {object} nextState\n *\t@param {object} nextContext\n *\t@returns {Boolean} should the component re-render\n *\t@name shouldComponentUpdate\n *\t@function\n */\n\n\t/** Update component state by copying properties from `state` to `this.state`.\n *\t@param {object} state\t\tA hash of state properties to update with new values\n *\t@param {function} callback\tA function to be called once component state is updated\n */\n\tsetState: function setState(state, callback) {\n\t\tvar s = this.state;\n\t\tif (!this.prevState) this.prevState = extend({}, s);\n\t\textend(s, typeof state === 'function' ? state(s, this.props) : state);\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\tenqueueRender(this);\n\t},\n\n\n\t/** Immediately perform a synchronous re-render of the component.\n *\t@param {function} callback\t\tA function to be called after component is re-rendered.\n *\t@private\n */\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\n\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\n *\t@param {object} state\t\tThe component's current state\n *\t@param {object} context\t\tContext object (if a parent component has provided context)\n *\t@returns VNode\n */\n\trender: function render() {}\n});\n\n/** Render JSX into a `parent` Element.\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\n *\t@param {Element} parent\t\tDOM element to render into\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\n *\t@public\n *\n *\t@example\n *\t// render a div into <body>:\n *\trender(<div id=\"hello\">hello!</div>, document.body);\n *\n *\t@example\n *\t// render a \"Thing\" component into #foo:\n *\tconst Thing = ({ name }) => <span>{ name }</span>;\n *\trender(<Thing name=\"one\" />, document.querySelector('#foo'));\n */\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, Component, render, rerender, options };\n//# sourceMappingURL=preact.esm.js.map\n","'use strict';\n\nif (!process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // 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\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // 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.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n 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', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<<anonymous>>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport { Component, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport { storeShape, subscriptionShape } from '../utils/PropTypes';\nimport warning from '../utils/warning';\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nexport function createProvider() {\n var _Provider$childContex;\n\n var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store';\n var subKey = arguments[1];\n\n var subscriptionKey = subKey || storeKey + 'Subscription';\n\n var Provider = function (_Component) {\n _inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref;\n };\n\n function Provider(props, context) {\n _classCallCheck(this, Provider);\n\n var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this[storeKey] = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n }(Component);\n\n if (process.env.NODE_ENV !== 'production') {\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n if (this[storeKey] !== nextProps.store) {\n warnAboutReceivingStore();\n }\n };\n }\n\n Provider.propTypes = {\n store: storeShape.isRequired,\n children: PropTypes.element.isRequired\n };\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = storeShape.isRequired, _Provider$childContex[subscriptionKey] = subscriptionShape, _Provider$childContex);\n\n return Provider;\n}\n\nexport default createProvider();","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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _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; }\n\nimport hoistStatics from 'hoist-non-react-statics';\nimport invariant from 'invariant';\nimport { Component, createElement } from 'react';\n\nimport Subscription from '../utils/Subscription';\nimport { storeShape, subscriptionShape } from '../utils/PropTypes';\n\nvar hotReloadingVersion = 0;\nvar dummyState = {};\nfunction noop() {}\nfunction makeSelectorStateful(sourceSelector, store) {\n // wrap the selector in an object that tracks its results between runs.\n var selector = {\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(store.getState(), props);\n if (nextProps !== selector.props || selector.error) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n\n return selector;\n}\n\nexport default function connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$getDisplayName = _ref.getDisplayName,\n getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName,\n _ref$methodName = _ref.methodName,\n methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName,\n _ref$renderCountProp = _ref.renderCountProp,\n renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp,\n _ref$shouldHandleStat = _ref.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat,\n _ref$storeKey = _ref.storeKey,\n storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey,\n _ref$withRef = _ref.withRef,\n withRef = _ref$withRef === undefined ? false : _ref$withRef,\n connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = subscriptionShape, _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = subscriptionShape, _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + (methodName + '. Instead received ' + JSON.stringify(WrappedComponent)));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n _inherits(Connect, _Component);\n\n function Connect(props, context) {\n _classCallCheck(this, Connect);\n\n var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = props[storeKey] || context[storeKey];\n _this.propsMode = Boolean(props[storeKey]);\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or props of ' + ('\"' + displayName + '\". Either wrap the root component in a <Provider>, ') + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n // If this component received store from props, its subscription should be transparent\n // to any descendants receiving store+subscription from context; it passes along\n // subscription passed to it. Otherwise, it shadows the parent subscription, which allows\n // Connect to control ordering of notifications to flow top-down.\n var subscription = this.propsMode ? null : this.subscription;\n return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.subscription = null;\n this.notifyNestedSubs = noop;\n this.store = null;\n this.selector.run = noop;\n this.selector.shouldComponentUpdate = false;\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);\n this.selector = makeSelectorStateful(sourceSelector, this.store);\n this.selector.run(this.props);\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n if (!shouldHandleStateChanges) return;\n\n // parentSub's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];\n this.subscription = new Subscription(this.store, parentSub, this.onStateChange.bind(this));\n\n // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `this.subscription` will then be null. An\n // extra null check every change can be avoided by copying the method onto `this` and then\n // replacing it with a no-op on unmount. This can probably be avoided if Subscription's\n // listeners logic is changed to not call listeners that have been unsubscribed in the\n // middle of the notification loop.\n this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);\n };\n\n Connect.prototype.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n this.notifyNestedSubs();\n } else {\n this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;\n this.setState(dummyState);\n }\n };\n\n Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {\n // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it\n // needs to notify nested subs. Once called, it unimplements itself until further state\n // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does\n // a boolean check every time avoids an extra method call most of the time, resulting\n // in some perf boost.\n this.componentDidUpdate = undefined;\n this.notifyNestedSubs();\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return createElement(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n Connect.propTypes = contextTypes;\n\n if (process.env.NODE_ENV !== 'production') {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n var _this2 = this;\n\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n // If any connected descendants don't hot reload (and resubscribe in the process), their\n // listeners will be lost when we unsubscribe. Unfortunately, by copying over all\n // listeners, this does mean that the old versions of connected descendants will still be\n // notified of state changes; however, their onStateChange function is a no-op so this\n // isn't a huge deal.\n var oldListeners = [];\n\n if (this.subscription) {\n oldListeners = this.subscription.listeners.get();\n this.subscription.tryUnsubscribe();\n }\n this.initSubscription();\n if (shouldHandleStateChanges) {\n this.subscription.trySubscribe();\n oldListeners.forEach(function (listener) {\n return _this2.subscription.listeners.subscribe(listener);\n });\n }\n }\n };\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","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; };\n\nfunction _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; }\n\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nexport function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nexport default createConnect();","import { bindActionCreators } from 'redux';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\n\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\n\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","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; };\n\nimport verifyPlainObject from '../utils/verifyPlainObject';\n\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","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; }\n\nimport verifySubselectors from './verifySubselectors';\n\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import warning from '../utils/warning';\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nexport default function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}","import verifyPlainObject from '../utils/verifyPlainObject';\n\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}","import Provider, { createProvider } from './components/Provider';\nimport connectAdvanced from './components/connectAdvanced';\nimport connect from './connect/connect';\n\nexport { Provider, createProvider, connectAdvanced, connect };","import PropTypes from 'prop-types';\n\nexport var subscriptionShape = PropTypes.shape({\n trySubscribe: PropTypes.func.isRequired,\n tryUnsubscribe: PropTypes.func.isRequired,\n notifyNestedSubs: PropTypes.func.isRequired,\n isSubscribed: PropTypes.func.isRequired\n});\n\nexport var storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n get: function get() {\n return next;\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub, onStateChange) {\n _classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.onStateChange = onStateChange;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nexport { Subscription as default };","var hasOwn = Object.prototype.hasOwnProperty;\n\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","import isPlainObject from 'lodash-es/isPlainObject';\nimport warning from './warning';\n\nexport default function verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}","/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport createHistory from 'history/createBrowserHistory';\nimport Router from './Router';\n\n/**\n * The public API for a <Router> that uses HTML5 history.\n */\n\nvar BrowserRouter = function (_React$Component) {\n _inherits(BrowserRouter, _React$Component);\n\n function BrowserRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, BrowserRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n BrowserRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<BrowserRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { BrowserRouter as Router }`.');\n };\n\n BrowserRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return BrowserRouter;\n}(React.Component);\n\nBrowserRouter.propTypes = {\n basename: PropTypes.string,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n};\n\n\nexport default BrowserRouter;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport createHistory from 'history/createHashHistory';\nimport Router from './Router';\n\n/**\n * The public API for a <Router> that uses window.location.hash.\n */\n\nvar HashRouter = function (_React$Component) {\n _inherits(HashRouter, _React$Component);\n\n function HashRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, HashRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n HashRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<HashRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { HashRouter as Router }`.');\n };\n\n HashRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return HashRouter;\n}(React.Component);\n\nHashRouter.propTypes = {\n basename: PropTypes.string,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf(['hashbang', 'noslash', 'slash']),\n children: PropTypes.node\n};\n\n\nexport default HashRouter;","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; };\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\n\nvar isModifiedEvent = function isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n};\n\n/**\n * The public API for rendering a history-aware <a>.\n */\n\nvar Link = function (_React$Component) {\n _inherits(Link, _React$Component);\n\n function Link() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Link);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {\n if (_this.props.onClick) _this.props.onClick(event);\n\n if (!event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore right clicks\n !_this.props.target && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n\n var history = _this.context.router.history;\n var _this$props = _this.props,\n replace = _this$props.replace,\n to = _this$props.to;\n\n\n if (replace) {\n history.replace(to);\n } else {\n history.push(to);\n }\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Link.prototype.render = function render() {\n var _props = this.props,\n replace = _props.replace,\n to = _props.to,\n innerRef = _props.innerRef,\n props = _objectWithoutProperties(_props, ['replace', 'to', 'innerRef']); // eslint-disable-line no-unused-vars\n\n invariant(this.context.router, 'You should not use <Link> outside a <Router>');\n\n var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);\n\n return React.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));\n };\n\n return Link;\n}(React.Component);\n\nLink.propTypes = {\n onClick: PropTypes.func,\n target: PropTypes.string,\n replace: PropTypes.bool,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func])\n};\nLink.defaultProps = {\n replace: false\n};\nLink.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n push: PropTypes.func.isRequired,\n replace: PropTypes.func.isRequired,\n createHref: PropTypes.func.isRequired\n }).isRequired\n }).isRequired\n};\n\n\nexport default Link;","// Written in this round about way for babel-transform-imports\nimport MemoryRouter from 'react-router/es/MemoryRouter';\n\nexport default MemoryRouter;","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; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Route from './Route';\nimport Link from './Link';\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nvar NavLink = function NavLink(_ref) {\n var to = _ref.to,\n exact = _ref.exact,\n strict = _ref.strict,\n location = _ref.location,\n activeClassName = _ref.activeClassName,\n className = _ref.className,\n activeStyle = _ref.activeStyle,\n style = _ref.style,\n getIsActive = _ref.isActive,\n ariaCurrent = _ref.ariaCurrent,\n rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive', 'ariaCurrent']);\n\n return React.createElement(Route, {\n path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to,\n exact: exact,\n strict: strict,\n location: location,\n children: function children(_ref2) {\n var location = _ref2.location,\n match = _ref2.match;\n\n var isActive = !!(getIsActive ? getIsActive(match, location) : match);\n\n return React.createElement(Link, _extends({\n to: to,\n className: isActive ? [className, activeClassName].filter(function (i) {\n return i;\n }).join(' ') : className,\n style: isActive ? _extends({}, style, activeStyle) : style,\n 'aria-current': isActive && ariaCurrent\n }, rest));\n }\n });\n};\n\nNavLink.propTypes = {\n to: Link.propTypes.to,\n exact: PropTypes.bool,\n strict: PropTypes.bool,\n location: PropTypes.object,\n activeClassName: PropTypes.string,\n className: PropTypes.string,\n activeStyle: PropTypes.object,\n style: PropTypes.object,\n isActive: PropTypes.func,\n ariaCurrent: PropTypes.oneOf(['page', 'step', 'location', 'true'])\n};\n\nNavLink.defaultProps = {\n activeClassName: 'active',\n ariaCurrent: 'true'\n};\n\nexport default NavLink;","// Written in this round about way for babel-transform-imports\nimport Prompt from 'react-router/es/Prompt';\n\nexport default Prompt;","// Written in this round about way for babel-transform-imports\nimport Redirect from 'react-router/es/Redirect';\n\nexport default Redirect;","// Written in this round about way for babel-transform-imports\nimport Route from 'react-router/es/Route';\n\nexport default Route;","// Written in this round about way for babel-transform-imports\nimport Router from 'react-router/es/Router';\n\nexport default Router;","// Written in this round about way for babel-transform-imports\nimport StaticRouter from 'react-router/es/StaticRouter';\n\nexport default StaticRouter;","// Written in this round about way for babel-transform-imports\nimport Switch from 'react-router/es/Switch';\n\nexport default Switch;","import _BrowserRouter from './BrowserRouter';\nexport { _BrowserRouter as BrowserRouter };\nimport _HashRouter from './HashRouter';\nexport { _HashRouter as HashRouter };\nimport _Link from './Link';\nexport { _Link as Link };\nimport _MemoryRouter from './MemoryRouter';\nexport { _MemoryRouter as MemoryRouter };\nimport _NavLink from './NavLink';\nexport { _NavLink as NavLink };\nimport _Prompt from './Prompt';\nexport { _Prompt as Prompt };\nimport _Redirect from './Redirect';\nexport { _Redirect as Redirect };\nimport _Route from './Route';\nexport { _Route as Route };\nimport _Router from './Router';\nexport { _Router as Router };\nimport _StaticRouter from './StaticRouter';\nexport { _StaticRouter as StaticRouter };\nimport _Switch from './Switch';\nexport { _Switch as Switch };\nimport _matchPath from './matchPath';\nexport { _matchPath as matchPath };\nimport _withRouter from './withRouter';\nexport { _withRouter as withRouter };","// Written in this round about way for babel-transform-imports\nimport matchPath from 'react-router/es/matchPath';\n\nexport default matchPath;","// Written in this round about way for babel-transform-imports\nimport withRouter from 'react-router/es/withRouter';\n\nexport default withRouter;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * This action type will be dispatched by the history actions below.\n * If you're writing a middleware to watch for navigation events, be sure to\n * look for actions of this type.\n */\nvar CALL_HISTORY_METHOD = exports.CALL_HISTORY_METHOD = '@@router/CALL_HISTORY_METHOD';\n\nfunction updateLocation(method) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return {\n type: CALL_HISTORY_METHOD,\n payload: { method: method, args: args }\n };\n };\n}\n\n/**\n * These actions correspond to the history API.\n * The associated routerMiddleware will capture these events before they get to\n * your reducer and reissue them as the matching function on your history.\n */\nvar push = exports.push = updateLocation('push');\nvar replace = exports.replace = updateLocation('replace');\nvar go = exports.go = updateLocation('go');\nvar goBack = exports.goBack = updateLocation('goBack');\nvar goForward = exports.goForward = updateLocation('goForward');\n\nvar routerActions = exports.routerActions = { push: push, replace: replace, go: go, goBack: goBack, goForward: goForward };","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.routerMiddleware = exports.routerActions = exports.goForward = exports.goBack = exports.go = exports.replace = exports.push = exports.CALL_HISTORY_METHOD = exports.routerReducer = exports.LOCATION_CHANGE = exports.syncHistoryWithStore = undefined;\n\nvar _reducer = require('./reducer');\n\nObject.defineProperty(exports, 'LOCATION_CHANGE', {\n enumerable: true,\n get: function get() {\n return _reducer.LOCATION_CHANGE;\n }\n});\nObject.defineProperty(exports, 'routerReducer', {\n enumerable: true,\n get: function get() {\n return _reducer.routerReducer;\n }\n});\n\nvar _actions = require('./actions');\n\nObject.defineProperty(exports, 'CALL_HISTORY_METHOD', {\n enumerable: true,\n get: function get() {\n return _actions.CALL_HISTORY_METHOD;\n }\n});\nObject.defineProperty(exports, 'push', {\n enumerable: true,\n get: function get() {\n return _actions.push;\n }\n});\nObject.defineProperty(exports, 'replace', {\n enumerable: true,\n get: function get() {\n return _actions.replace;\n }\n});\nObject.defineProperty(exports, 'go', {\n enumerable: true,\n get: function get() {\n return _actions.go;\n }\n});\nObject.defineProperty(exports, 'goBack', {\n enumerable: true,\n get: function get() {\n return _actions.goBack;\n }\n});\nObject.defineProperty(exports, 'goForward', {\n enumerable: true,\n get: function get() {\n return _actions.goForward;\n }\n});\nObject.defineProperty(exports, 'routerActions', {\n enumerable: true,\n get: function get() {\n return _actions.routerActions;\n }\n});\n\nvar _sync = require('./sync');\n\nvar _sync2 = _interopRequireDefault(_sync);\n\nvar _middleware = require('./middleware');\n\nvar _middleware2 = _interopRequireDefault(_middleware);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nexports.syncHistoryWithStore = _sync2['default'];\nexports.routerMiddleware = _middleware2['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = routerMiddleware;\n\nvar _actions = require('./actions');\n\nfunction _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); } }\n\n/**\n * This middleware captures CALL_HISTORY_METHOD actions to redirect to the\n * provided history object. This will prevent these actions from reaching your\n * reducer or any middleware that comes after this one.\n */\nfunction routerMiddleware(history) {\n return function () {\n return function (next) {\n return function (action) {\n if (action.type !== _actions.CALL_HISTORY_METHOD) {\n return next(action);\n }\n\n var _action$payload = action.payload,\n method = _action$payload.method,\n args = _action$payload.args;\n\n history[method].apply(history, _toConsumableArray(args));\n };\n };\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports.routerReducer = routerReducer;\n/**\n * This action type will be dispatched when your history\n * receives a location change.\n */\nvar LOCATION_CHANGE = exports.LOCATION_CHANGE = '@@router/LOCATION_CHANGE';\n\nvar initialState = {\n locationBeforeTransitions: null\n};\n\n/**\n * This reducer will update the state with the most recent location history\n * has transitioned to. This may not be in sync with the router, particularly\n * if you have asynchronously-loaded routes, so reading from and relying on\n * this state is discouraged.\n */\nfunction routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports['default'] = syncHistoryWithStore;\n\nvar _reducer = require('./reducer');\n\nvar defaultSelectLocationState = function defaultSelectLocationState(state) {\n return state.routing;\n};\n\n/**\n * This function synchronizes your history state with the Redux store.\n * Location changes flow from history to the store. An enhanced history is\n * returned with a listen method that responds to store updates for location.\n *\n * When this history is provided to the router, this means the location data\n * will flow like this:\n * history.push -> store.dispatch -> enhancedHistory.listen -> router\n * This ensures that when the store state changes due to a replay or other\n * event, the router will be updated appropriately and can transition to the\n * correct router state.\n */\nfunction syncHistoryWithStore(history, store) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n _ref$selectLocationSt = _ref.selectLocationState,\n selectLocationState = _ref$selectLocationSt === undefined ? defaultSelectLocationState : _ref$selectLocationSt,\n _ref$adjustUrlOnRepla = _ref.adjustUrlOnReplay,\n adjustUrlOnReplay = _ref$adjustUrlOnRepla === undefined ? true : _ref$adjustUrlOnRepla;\n\n // Ensure that the reducer is mounted on the store and functioning properly.\n if (typeof selectLocationState(store.getState()) === 'undefined') {\n throw new Error('Expected the routing state to be available either as `state.routing` ' + 'or as the custom expression you can specify as `selectLocationState` ' + 'in the `syncHistoryWithStore()` options. ' + 'Ensure you have added the `routerReducer` to your store\\'s ' + 'reducers via `combineReducers` or whatever method you use to isolate ' + 'your reducers.');\n }\n\n var initialLocation = void 0;\n var isTimeTraveling = void 0;\n var unsubscribeFromStore = void 0;\n var unsubscribeFromHistory = void 0;\n var currentLocation = void 0;\n\n // What does the store say about current location?\n var getLocationInStore = function getLocationInStore(useInitialIfEmpty) {\n var locationState = selectLocationState(store.getState());\n return locationState.locationBeforeTransitions || (useInitialIfEmpty ? initialLocation : undefined);\n };\n\n // Init initialLocation with potential location in store\n initialLocation = getLocationInStore();\n\n // If the store is replayed, update the URL in the browser to match.\n if (adjustUrlOnReplay) {\n var handleStoreChange = function handleStoreChange() {\n var locationInStore = getLocationInStore(true);\n if (currentLocation === locationInStore || initialLocation === locationInStore) {\n return;\n }\n\n // Update address bar to reflect store state\n isTimeTraveling = true;\n currentLocation = locationInStore;\n history.transitionTo(_extends({}, locationInStore, {\n action: 'PUSH'\n }));\n isTimeTraveling = false;\n };\n\n unsubscribeFromStore = store.subscribe(handleStoreChange);\n handleStoreChange();\n }\n\n // Whenever location changes, dispatch an action to get it in the store\n var handleLocationChange = function handleLocationChange(location) {\n // ... unless we just caused that location change\n if (isTimeTraveling) {\n return;\n }\n\n // Remember where we are\n currentLocation = location;\n\n // Are we being called for the first time?\n if (!initialLocation) {\n // Remember as a fallback in case state is reset\n initialLocation = location;\n\n // Respect persisted location, if any\n if (getLocationInStore()) {\n return;\n }\n }\n\n // Tell the store to update by dispatching an action\n store.dispatch({\n type: _reducer.LOCATION_CHANGE,\n payload: location\n });\n };\n unsubscribeFromHistory = history.listen(handleLocationChange);\n\n // History 3.x doesn't call listen synchronously, so fire the initial location change ourselves\n if (history.getCurrentLocation) {\n handleLocationChange(history.getCurrentLocation());\n }\n\n // The enhanced history uses store as source of truth\n return _extends({}, history, {\n // The listeners are subscribed to the store instead of history\n listen: function listen(listener) {\n // Copy of last location.\n var lastPublishedLocation = getLocationInStore(true);\n\n // Keep track of whether we unsubscribed, as Redux store\n // only applies changes in subscriptions on next dispatch\n var unsubscribed = false;\n var unsubscribeFromStore = store.subscribe(function () {\n var currentLocation = getLocationInStore(true);\n if (currentLocation === lastPublishedLocation) {\n return;\n }\n lastPublishedLocation = currentLocation;\n if (!unsubscribed) {\n listener(lastPublishedLocation);\n }\n });\n\n // History 2.x listeners expect a synchronous call. Make the first call to the\n // listener after subscribing to the store, in case the listener causes a\n // location change (e.g. when it redirects)\n if (!history.getCurrentLocation) {\n listener(lastPublishedLocation);\n }\n\n // Let user unsubscribe later\n return function () {\n unsubscribed = true;\n unsubscribeFromStore();\n };\n },\n\n\n // It also provides a way to destroy internal listeners\n unsubscribe: function unsubscribe() {\n if (adjustUrlOnReplay) {\n unsubscribeFromStore();\n }\n unsubscribeFromHistory();\n }\n });\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport createHistory from 'history/createMemoryHistory';\nimport Router from './Router';\n\n/**\n * The public API for a <Router> that stores location in memory.\n */\n\nvar MemoryRouter = function (_React$Component) {\n _inherits(MemoryRouter, _React$Component);\n\n function MemoryRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, MemoryRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n MemoryRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<MemoryRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { MemoryRouter as Router }`.');\n };\n\n MemoryRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return MemoryRouter;\n}(React.Component);\n\nMemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n};\n\n\nexport default MemoryRouter;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\n\n/**\n * The public API for prompting the user before navigating away\n * from a screen with a component.\n */\n\nvar Prompt = function (_React$Component) {\n _inherits(Prompt, _React$Component);\n\n function Prompt() {\n _classCallCheck(this, Prompt);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Prompt.prototype.enable = function enable(message) {\n if (this.unblock) this.unblock();\n\n this.unblock = this.context.router.history.block(message);\n };\n\n Prompt.prototype.disable = function disable() {\n if (this.unblock) {\n this.unblock();\n this.unblock = null;\n }\n };\n\n Prompt.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, 'You should not use <Prompt> outside a <Router>');\n\n if (this.props.when) this.enable(this.props.message);\n };\n\n Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (nextProps.when) {\n if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);\n } else {\n this.disable();\n }\n };\n\n Prompt.prototype.componentWillUnmount = function componentWillUnmount() {\n this.disable();\n };\n\n Prompt.prototype.render = function render() {\n return null;\n };\n\n return Prompt;\n}(React.Component);\n\nPrompt.propTypes = {\n when: PropTypes.bool,\n message: PropTypes.oneOfType([PropTypes.func, PropTypes.string]).isRequired\n};\nPrompt.defaultProps = {\n when: true\n};\nPrompt.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n block: PropTypes.func.isRequired\n }).isRequired\n }).isRequired\n};\n\n\nexport default Prompt;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport { createLocation, locationsAreEqual } from 'history';\n\n/**\n * The public API for updating the location programmatically\n * with a component.\n */\n\nvar Redirect = function (_React$Component) {\n _inherits(Redirect, _React$Component);\n\n function Redirect() {\n _classCallCheck(this, Redirect);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Redirect.prototype.isStatic = function isStatic() {\n return this.context.router && this.context.router.staticContext;\n };\n\n Redirect.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, 'You should not use <Redirect> outside a <Router>');\n\n if (this.isStatic()) this.perform();\n };\n\n Redirect.prototype.componentDidMount = function componentDidMount() {\n if (!this.isStatic()) this.perform();\n };\n\n Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {\n var prevTo = createLocation(prevProps.to);\n var nextTo = createLocation(this.props.to);\n\n if (locationsAreEqual(prevTo, nextTo)) {\n warning(false, 'You tried to redirect to the same route you\\'re currently on: ' + ('\"' + nextTo.pathname + nextTo.search + '\"'));\n return;\n }\n\n this.perform();\n };\n\n Redirect.prototype.perform = function perform() {\n var history = this.context.router.history;\n var _props = this.props,\n push = _props.push,\n to = _props.to;\n\n\n if (push) {\n history.push(to);\n } else {\n history.replace(to);\n }\n };\n\n Redirect.prototype.render = function render() {\n return null;\n };\n\n return Redirect;\n}(React.Component);\n\nRedirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n};\nRedirect.defaultProps = {\n push: false\n};\nRedirect.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n push: PropTypes.func.isRequired,\n replace: PropTypes.func.isRequired\n }).isRequired,\n staticContext: PropTypes.object\n }).isRequired\n};\n\n\nexport default Redirect;","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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport matchPath from './matchPath';\n\nvar isEmptyChildren = function isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n};\n\n/**\n * The public API for matching a single path and rendering.\n */\n\nvar Route = function (_React$Component) {\n _inherits(Route, _React$Component);\n\n function Route() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Route);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n match: _this.computeMatch(_this.props, _this.context.router)\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Route.prototype.getChildContext = function getChildContext() {\n return {\n router: _extends({}, this.context.router, {\n route: {\n location: this.props.location || this.context.router.route.location,\n match: this.state.match\n }\n })\n };\n };\n\n Route.prototype.computeMatch = function computeMatch(_ref, router) {\n var computedMatch = _ref.computedMatch,\n location = _ref.location,\n path = _ref.path,\n strict = _ref.strict,\n exact = _ref.exact,\n sensitive = _ref.sensitive;\n\n if (computedMatch) return computedMatch; // <Switch> already computed the match for us\n\n invariant(router, 'You should not use <Route> or withRouter() outside a <Router>');\n\n var route = router.route;\n\n var pathname = (location || route.location).pathname;\n\n return path ? matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }) : route.match;\n };\n\n Route.prototype.componentWillMount = function componentWillMount() {\n warning(!(this.props.component && this.props.render), 'You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored');\n\n warning(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored');\n\n warning(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored');\n };\n\n Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {\n warning(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.');\n\n warning(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.');\n\n this.setState({\n match: this.computeMatch(nextProps, nextContext.router)\n });\n };\n\n Route.prototype.render = function render() {\n var match = this.state.match;\n var _props = this.props,\n children = _props.children,\n component = _props.component,\n render = _props.render;\n var _context$router = this.context.router,\n history = _context$router.history,\n route = _context$router.route,\n staticContext = _context$router.staticContext;\n\n var location = this.props.location || route.location;\n var props = { match: match, location: location, history: history, staticContext: staticContext };\n\n return component ? // component prop gets first priority, only called if there's a match\n match ? React.createElement(component, props) : null : render ? // render prop is next, only called if there's a match\n match ? render(props) : null : children ? // children come last, always called\n typeof children === 'function' ? children(props) : !isEmptyChildren(children) ? React.Children.only(children) : null : null;\n };\n\n return Route;\n}(React.Component);\n\nRoute.propTypes = {\n computedMatch: PropTypes.object, // private, from <Switch>\n path: PropTypes.string,\n exact: PropTypes.bool,\n strict: PropTypes.bool,\n sensitive: PropTypes.bool,\n component: PropTypes.func,\n render: PropTypes.func,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n location: PropTypes.object\n};\nRoute.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n })\n};\nRoute.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default Route;","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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\n/**\n * The public API for putting history on context.\n */\n\nvar Router = function (_React$Component) {\n _inherits(Router, _React$Component);\n\n function Router() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Router);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n match: _this.computeMatch(_this.props.history.location.pathname)\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Router.prototype.getChildContext = function getChildContext() {\n return {\n router: _extends({}, this.context.router, {\n history: this.props.history,\n route: {\n location: this.props.history.location,\n match: this.state.match\n }\n })\n };\n };\n\n Router.prototype.computeMatch = function computeMatch(pathname) {\n return {\n path: '/',\n url: '/',\n params: {},\n isExact: pathname === '/'\n };\n };\n\n Router.prototype.componentWillMount = function componentWillMount() {\n var _this2 = this;\n\n var _props = this.props,\n children = _props.children,\n history = _props.history;\n\n\n invariant(children == null || React.Children.count(children) === 1, 'A <Router> may have only one child element');\n\n // Do this here so we can setState when a <Redirect> changes the\n // location in componentWillMount. This happens e.g. when doing\n // server rendering using a <StaticRouter>.\n this.unlisten = history.listen(function () {\n _this2.setState({\n match: _this2.computeMatch(history.location.pathname)\n });\n });\n };\n\n Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n warning(this.props.history === nextProps.history, 'You cannot change <Router history>');\n };\n\n Router.prototype.componentWillUnmount = function componentWillUnmount() {\n this.unlisten();\n };\n\n Router.prototype.render = function render() {\n var children = this.props.children;\n\n return children ? React.Children.only(children) : null;\n };\n\n return Router;\n}(React.Component);\n\nRouter.propTypes = {\n history: PropTypes.object.isRequired,\n children: PropTypes.node\n};\nRouter.contextTypes = {\n router: PropTypes.object\n};\nRouter.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default Router;","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; };\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { addLeadingSlash, createPath, parsePath } from 'history/PathUtils';\nimport Router from './Router';\n\nvar normalizeLocation = function normalizeLocation(object) {\n var _object$pathname = object.pathname,\n pathname = _object$pathname === undefined ? '/' : _object$pathname,\n _object$search = object.search,\n search = _object$search === undefined ? '' : _object$search,\n _object$hash = object.hash,\n hash = _object$hash === undefined ? '' : _object$hash;\n\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nvar addBasename = function addBasename(basename, location) {\n if (!basename) return location;\n\n return _extends({}, location, {\n pathname: addLeadingSlash(basename) + location.pathname\n });\n};\n\nvar stripBasename = function stripBasename(basename, location) {\n if (!basename) return location;\n\n var base = addLeadingSlash(basename);\n\n if (location.pathname.indexOf(base) !== 0) return location;\n\n return _extends({}, location, {\n pathname: location.pathname.substr(base.length)\n });\n};\n\nvar createLocation = function createLocation(location) {\n return typeof location === 'string' ? parsePath(location) : normalizeLocation(location);\n};\n\nvar createURL = function createURL(location) {\n return typeof location === 'string' ? location : createPath(location);\n};\n\nvar staticHandler = function staticHandler(methodName) {\n return function () {\n invariant(false, 'You cannot %s with <StaticRouter>', methodName);\n };\n};\n\nvar noop = function noop() {};\n\n/**\n * The public top-level API for a \"static\" <Router>, so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\n\nvar StaticRouter = function (_React$Component) {\n _inherits(StaticRouter, _React$Component);\n\n function StaticRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, StaticRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {\n return addLeadingSlash(_this.props.basename + createURL(path));\n }, _this.handlePush = function (location) {\n var _this$props = _this.props,\n basename = _this$props.basename,\n context = _this$props.context;\n\n context.action = 'PUSH';\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }, _this.handleReplace = function (location) {\n var _this$props2 = _this.props,\n basename = _this$props2.basename,\n context = _this$props2.context;\n\n context.action = 'REPLACE';\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }, _this.handleListen = function () {\n return noop;\n }, _this.handleBlock = function () {\n return noop;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n StaticRouter.prototype.getChildContext = function getChildContext() {\n return {\n router: {\n staticContext: this.props.context\n }\n };\n };\n\n StaticRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, '<StaticRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { StaticRouter as Router }`.');\n };\n\n StaticRouter.prototype.render = function render() {\n var _props = this.props,\n basename = _props.basename,\n context = _props.context,\n location = _props.location,\n props = _objectWithoutProperties(_props, ['basename', 'context', 'location']);\n\n var history = {\n createHref: this.createHref,\n action: 'POP',\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler('go'),\n goBack: staticHandler('goBack'),\n goForward: staticHandler('goForward'),\n listen: this.handleListen,\n block: this.handleBlock\n };\n\n return React.createElement(Router, _extends({}, props, { history: history }));\n };\n\n return StaticRouter;\n}(React.Component);\n\nStaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object.isRequired,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n};\nStaticRouter.defaultProps = {\n basename: '',\n location: '/'\n};\nStaticRouter.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default StaticRouter;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport warning from 'warning';\nimport invariant from 'invariant';\nimport matchPath from './matchPath';\n\n/**\n * The public API for rendering the first <Route> that matches.\n */\n\nvar Switch = function (_React$Component) {\n _inherits(Switch, _React$Component);\n\n function Switch() {\n _classCallCheck(this, Switch);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Switch.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, 'You should not use <Switch> outside a <Router>');\n };\n\n Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n warning(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.');\n\n warning(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.');\n };\n\n Switch.prototype.render = function render() {\n var route = this.context.router.route;\n var children = this.props.children;\n\n var location = this.props.location || route.location;\n\n var match = void 0,\n child = void 0;\n React.Children.forEach(children, function (element) {\n if (!React.isValidElement(element)) return;\n\n var _element$props = element.props,\n pathProp = _element$props.path,\n exact = _element$props.exact,\n strict = _element$props.strict,\n sensitive = _element$props.sensitive,\n from = _element$props.from;\n\n var path = pathProp || from;\n\n if (match == null) {\n child = element;\n match = path ? matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }) : route.match;\n }\n });\n\n return match ? React.cloneElement(child, { location: location, computedMatch: match }) : null;\n };\n\n return Switch;\n}(React.Component);\n\nSwitch.contextTypes = {\n router: PropTypes.shape({\n route: PropTypes.object.isRequired\n }).isRequired\n};\nSwitch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n};\n\n\nexport default Switch;","import pathToRegexp from 'path-to-regexp';\n\nvar patternCache = {};\nvar cacheLimit = 10000;\nvar cacheCount = 0;\n\nvar compilePath = function compilePath(pattern, options) {\n var cacheKey = '' + options.end + options.strict + options.sensitive;\n var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});\n\n if (cache[pattern]) return cache[pattern];\n\n var keys = [];\n var re = pathToRegexp(pattern, keys, options);\n var compiledPattern = { re: re, keys: keys };\n\n if (cacheCount < cacheLimit) {\n cache[pattern] = compiledPattern;\n cacheCount++;\n }\n\n return compiledPattern;\n};\n\n/**\n * Public API for matching a URL pathname to a path pattern.\n */\nvar matchPath = function matchPath(pathname) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (typeof options === 'string') options = { path: options };\n\n var _options = options,\n _options$path = _options.path,\n path = _options$path === undefined ? '/' : _options$path,\n _options$exact = _options.exact,\n exact = _options$exact === undefined ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === undefined ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === undefined ? false : _options$sensitive;\n\n var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),\n re = _compilePath.re,\n keys = _compilePath.keys;\n\n var match = re.exec(pathname);\n\n if (!match) return null;\n\n var url = match[0],\n values = match.slice(1);\n\n var isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path: path, // the path pattern used to match\n url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL\n isExact: isExact, // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n};\n\nexport default matchPath;","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; };\n\nfunction _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; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport hoistStatics from 'hoist-non-react-statics';\nimport Route from './Route';\n\n/**\n * A public higher-order component to access the imperative API\n */\nvar withRouter = function withRouter(Component) {\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']);\n\n return React.createElement(Route, { render: function render(routeComponentProps) {\n return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef }));\n } });\n };\n\n C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';\n C.WrappedComponent = Component;\n C.propTypes = {\n wrappedComponentRef: PropTypes.func\n };\n\n return hoistStatics(C, Component);\n};\n\nexport default withRouter;","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n","var isarray = require('isarray')\n\n/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = options && options.delimiter || '/'\n var res\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n continue\n }\n\n var next = str[index]\n var prefix = res[2]\n var name = res[3]\n var capture = res[4]\n var group = res[5]\n var modifier = res[6]\n var asterisk = res[7]\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n }\n\n var partial = prefix != null && next != null && next !== prefix\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var delimiter = res[2] || defaultDelimiter\n var pattern = capture || group\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n })\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index)\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path)\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options))\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n })\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n var strict = options.strict\n var end = options.end !== false\n var route = ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var prefix = escapeString(token.prefix)\n var capture = '(?:' + token.pattern + ')'\n\n keys.push(token)\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*'\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?'\n } else {\n capture = prefix + '(' + capture + ')?'\n }\n } else {\n capture = prefix + '(' + capture + ')'\n }\n\n route += capture\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/')\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'\n }\n\n if (end) {\n route += '$'\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\n","module.exports = require('./lib/_stream_duplex.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = require('isarray');\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}","'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","module.exports = require('events').EventEmitter;\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","module.exports = require('./readable').PassThrough\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","module.exports = require('./readable').Transform\n","module.exports = require('./lib/_stream_writable.js');\n","'use strict';\n\nexports.__esModule = true;\nfunction createThunkMiddleware(extraArgument) {\n return function (_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n if (typeof action === 'function') {\n return action(dispatch, getState, extraArgument);\n }\n\n return next(action);\n };\n };\n };\n}\n\nvar thunk = createThunkMiddleware();\nthunk.withExtraArgument = createThunkMiddleware;\n\nexports['default'] = thunk;","import $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar ActionTypes = {\n INIT: '@@redux/INIT' + Math.random().toString(36).substring(7).split('').join('.'),\n REPLACE: '@@redux/REPLACE' + Math.random().toString(36).substring(7).split('').join('.')\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) return false;\n\n var proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.REPLACE });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if ((typeof observer === 'undefined' ? 'undefined' : _typeof(observer)) !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && 'action \"' + String(actionType) + '\"' || 'an action';\n\n return 'Given ' + actionDescription + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if ((typeof actionCreators === 'undefined' ? 'undefined' : _typeof(actionCreators)) !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators === 'undefined' ? 'undefined' : _typeof(actionCreators)) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nfunction compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var store = createStore.apply(undefined, args);\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(undefined, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning(\"You are currently using minified code outside of NODE_ENV === 'production'. \" + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { createStore, combineReducers, bindActionCreators, applyMiddleware, compose, ActionTypes as __DO_NOT_USE__ActionTypes };\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n","module.exports = {\n framer: require('./src/framer.js'),\n windows: require('./src/windows.js')\n};\n","/*===========================================================================*\\\n * Framer for breaking a U-Law ByteBuffer or Array into windows of a particular\n * size at an arbitrary step.\n *\n * (c) Vail Systems. Joshua Jung and Ben Bryan. 2015\n\\*===========================================================================*/\nvar Framer = function (options) {\n options = options || {};\n\n this.frameIx = 0;\n this.frameSize = options.frameSize || 64;\n this.frameStep = options.frameStep|| this.frameSize;\n this.map = options.map || undefined;\n this.scale = options.scale || undefined;\n this.offset = options.offset ? options.offset : 0;\n this.sampleType = options.sampleType || 'UInt8';\n this.wordSize = options.wordSize || 1;\n};\n\nFramer.prototype = {\n /**\n * Frames a buffer of single-byte char values or an array of Numbers into windows of the specified size.\n */\n frame: function(bufferOrArray, callback) {\n var self = this,\n ix = this.offset,\n frame = [],\n isArray = Object.prototype.toString.call( bufferOrArray) === '[object Array]';\n\n self.frameIx = 0;\n\n while (ix < bufferOrArray.length) {\n var value = isArray ? bufferOrArray[ix] : bufferOrArray['read' + self.sampleType](ix); \n\n frame.push(this.map ? this.map[value] : value);\n\n if (frame.length == this.frameSize || ix+self.wordSize == bufferOrArray.length) finishFrame(frame);\n\n ix += self.wordSize;\n }\n\n // Did we not process any frames at all for some reason?\n if (this.frameIx == 0) callback(undefined);\n\n function finishFrame(frame) {\n if (this.scale) frame = frame.map(function (s, ix) {return s * self.scale[ix];});\n\n callback(frame, self.frameIx);\n\n if (ix != bufferOrArray.length - self.wordSize)\n {\n ix -= (self.frameSize - self.frameStep) * self.wordSize;\n\n self.frameIx++;\n frame.length = 0;\n }\n }\n }\n};\n\nmodule.exports = Framer;\n","/*===========================================================================*\\\n * Method for producing the coefficients for windowing functions of an\n * arbitrary length.\n *\n * (c) Vail Systems. Joshua Jung and Ben Bryan. 2015\n\\*===========================================================================*/\nmodule.exports = {\n construct: function (type, sampleCount, alpha) {\n var coef = [];\n switch (type)\n {\n case 'ham': \n for (var i = 0; i < sampleCount; i++) {\n coef[i] = 0.54 - 0.46 * Math.cos((2 * Math.PI * i)/(sampleCount - 1));\n }\n break;\n case 'tukey':\n var sm1 = sampleCount - 1,\n asm1 = alpha * sm1;\n for (var i = 0; i < sampleCount; i++) {\n // Left tail\n if (i < asm1 / 2)\n coef[i] = 0.5 * (1 + Math.cos(Math.PI * ((2 * sampleCount)/(asm1) - 1))); \n // Right tail\n else if (i > (sm1 * (1 - alpha / 2)))\n coef[i] = 0.5 * (1 + Math.cos(Math.PI * ((2 * sampleCount)/(asm1) - (2 / alpha) + 1)));\n // Middle (rectangular)\n else coef[i] = 1;\n }\n break;\n case 'rectangular':\n for (var i = 0; i < sampleCount; i++)\n coef[i] = 1.0;\n break;\n }\n return coef;\n }\n};\n","/* global window, exports, define */\n\n!function() {\n 'use strict'\n\n var re = {\n not_string: /[^s]/,\n not_bool: /[^t]/,\n not_type: /[^T]/,\n not_primitive: /[^v]/,\n number: /[diefg]/,\n numeric_arg: /[bcdiefguxX]/,\n json: /[j]/,\n not_json: /[^j]/,\n text: /^[^\\x25]+/,\n modulo: /^\\x25{2}/,\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\n key: /^([a-z_][a-z_\\d]*)/i,\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\n index_access: /^\\[(\\d+)\\]/,\n sign: /^[\\+\\-]/\n }\n\n function sprintf(key) {\n // `arguments` is not an array, but should be fine for this call\n return sprintf_format(sprintf_parse(key), arguments)\n }\n\n function vsprintf(fmt, argv) {\n return sprintf.apply(null, [fmt].concat(argv || []))\n }\n\n function sprintf_format(parse_tree, argv) {\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, match, pad, pad_character, pad_length, is_positive, sign\n for (i = 0; i < tree_length; i++) {\n if (typeof parse_tree[i] === 'string') {\n output += parse_tree[i]\n }\n else if (Array.isArray(parse_tree[i])) {\n match = parse_tree[i] // convenience purposes only\n if (match[2]) { // keyword argument\n arg = argv[cursor]\n for (k = 0; k < match[2].length; k++) {\n if (!arg.hasOwnProperty(match[2][k])) {\n throw new Error(sprintf('[sprintf] property \"%s\" does not exist', match[2][k]))\n }\n arg = arg[match[2][k]]\n }\n }\n else if (match[1]) { // positional argument (explicit)\n arg = argv[match[1]]\n }\n else { // positional argument (implicit)\n arg = argv[cursor++]\n }\n\n if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && arg instanceof Function) {\n arg = arg()\n }\n\n if (re.numeric_arg.test(match[8]) && (typeof arg !== 'number' && isNaN(arg))) {\n throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))\n }\n\n if (re.number.test(match[8])) {\n is_positive = arg >= 0\n }\n\n switch (match[8]) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)\n break\n case 'e':\n arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)\n break\n case 'g':\n arg = match[7] ? String(Number(arg.toPrecision(match[7]))) : parseFloat(arg)\n break\n case 'o':\n arg = (parseInt(arg, 10) >>> 0).toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'T':\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'x':\n arg = (parseInt(arg, 10) >>> 0).toString(16)\n break\n case 'X':\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n break\n }\n if (re.json.test(match[8])) {\n output += arg\n }\n else {\n if (re.number.test(match[8]) && (!is_positive || match[3])) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '\n pad_length = match[6] - (sign + arg).length\n pad = match[6] ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n output += match[5] ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output\n }\n\n var sprintf_cache = Object.create(null)\n\n function sprintf_parse(fmt) {\n if (sprintf_cache[fmt]) {\n return sprintf_cache[fmt]\n }\n\n var _fmt = fmt, match, parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree.push(match[0])\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree.push('%')\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n }\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n }\n parse_tree.push(match)\n }\n else {\n throw new SyntaxError('[sprintf] unexpected placeholder')\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return sprintf_cache[fmt] = parse_tree\n }\n\n /**\n * export to either browser or node.js\n */\n /* eslint-disable quote-props */\n if (typeof exports !== 'undefined') {\n exports['sprintf'] = sprintf\n exports['vsprintf'] = vsprintf\n }\n if (typeof window !== 'undefined') {\n window['sprintf'] = sprintf\n window['vsprintf'] = vsprintf\n\n if (typeof define === 'function' && define['amd']) {\n define(function() {\n return {\n 'sprintf': sprintf,\n 'vsprintf': vsprintf\n }\n })\n }\n }\n /* eslint-enable quote-props */\n}()\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n 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':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","(function(root, factory){\n\n\t//UMD\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\tdefine(function() {\n\t\t\treturn factory();\n\t\t});\n\t} else if (typeof module === \"object\") {\n\t\tmodule.exports = factory();\n \t} else {\n\t\troot.Tone = factory();\n\t}\n\n}(this, function(){\n\n\t\"use strict\";\n\t\n\tvar Tone;\n\t//constructs the main Tone object\n\tfunction Main(func){\n\t\tTone = func();\n\t}\n\t//invokes each of the modules with the main Tone object as the argument\n\tfunction Module(func){\n\t\tfunc(Tone);\n\t}\t/**\n\t * Tone.js\n\t * @author Yotam Mann\n\t * @license http://opensource.org/licenses/MIT MIT License\n\t * @copyright 2014-2018 Yotam Mann\n\t */\n\tMain(function () {\n\t \n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTONE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * @class Tone is the base class of all other classes.\n\t\t * @constructor\n\t\t */\n\t var Tone = function () {\n\t if (!(this instanceof Tone)) {\n\t throw new Error('constructor needs to be called with the \\'new\\' keyword');\n\t }\n\t };\n\t /**\n\t\t * @memberOf Tone#\n\t\t * @returns {String} returns the name of the class as a string\n\t\t */\n\t Tone.prototype.toString = function () {\n\t for (var className in Tone) {\n\t var isLetter = className[0].match(/^[A-Z]$/);\n\t var sameConstructor = Tone[className] === this.constructor;\n\t if (Tone.isFunction(Tone[className]) && isLetter && sameConstructor) {\n\t return className;\n\t }\n\t }\n\t return 'Tone';\n\t };\n\t /**\n\t\t * @memberOf Tone#\n\t\t * disconnect and dispose\n\t\t * @returns {Tone} this\n\t\t */\n\t Tone.prototype.dispose = function () {\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tGET/SET\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Set the parameters at once. Either pass in an\n\t\t * object mapping parameters to values, or to set a\n\t\t * single parameter, by passing in a string and value.\n\t\t * The last argument is an optional ramp time which\n\t\t * will ramp any signal values to their destination value\n\t\t * over the duration of the rampTime.\n\t\t * @param {Object|String} params\n\t\t * @param {Number=} value\n\t\t * @param {Time=} rampTime\n\t\t * @returns {Tone} this\n\t\t * @memberOf Tone#\n\t\t * @example\n\t\t * //set values using an object\n\t\t * filter.set({\n\t\t * \t\"frequency\" : 300,\n\t\t * \t\"type\" : highpass\n\t\t * });\n\t\t * @example\n\t\t * filter.set(\"type\", \"highpass\");\n\t\t * @example\n\t\t * //ramp to the value 220 over 3 seconds.\n\t\t * oscillator.set({\n\t\t * \t\"frequency\" : 220\n\t\t * }, 3);\n\t\t */\n\t Tone.prototype.set = function (params, value, rampTime) {\n\t if (Tone.isObject(params)) {\n\t rampTime = value;\n\t } else if (Tone.isString(params)) {\n\t var tmpObj = {};\n\t tmpObj[params] = value;\n\t params = tmpObj;\n\t }\n\t paramLoop:\n\t for (var attr in params) {\n\t value = params[attr];\n\t var parent = this;\n\t if (attr.indexOf('.') !== -1) {\n\t var attrSplit = attr.split('.');\n\t for (var i = 0; i < attrSplit.length - 1; i++) {\n\t parent = parent[attrSplit[i]];\n\t if (parent instanceof Tone) {\n\t attrSplit.splice(0, i + 1);\n\t var innerParam = attrSplit.join('.');\n\t parent.set(innerParam, value);\n\t continue paramLoop;\n\t }\n\t }\n\t attr = attrSplit[attrSplit.length - 1];\n\t }\n\t var param = parent[attr];\n\t if (Tone.isUndef(param)) {\n\t continue;\n\t }\n\t if (Tone.Signal && param instanceof Tone.Signal || Tone.Param && param instanceof Tone.Param) {\n\t if (param.value !== value) {\n\t if (Tone.isUndef(rampTime)) {\n\t param.value = value;\n\t } else {\n\t param.rampTo(value, rampTime);\n\t }\n\t }\n\t } else if (param instanceof AudioParam) {\n\t if (param.value !== value) {\n\t param.value = value;\n\t }\n\t } else if (Tone.TimeBase && param instanceof Tone.TimeBase) {\n\t parent[attr] = value;\n\t } else if (param instanceof Tone) {\n\t param.set(value);\n\t } else if (param !== value) {\n\t parent[attr] = value;\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the object's attributes. Given no arguments get\n\t\t * will return all available object properties and their corresponding\n\t\t * values. Pass in a single attribute to retrieve or an array\n\t\t * of attributes. The attribute strings can also include a \".\"\n\t\t * to access deeper properties.\n\t\t * @memberOf Tone#\n\t\t * @example\n\t\t * osc.get();\n\t\t * //returns {\"type\" : \"sine\", \"frequency\" : 440, ...etc}\n\t\t * @example\n\t\t * osc.get(\"type\");\n\t\t * //returns { \"type\" : \"sine\"}\n\t\t * @example\n\t\t * //use dot notation to access deep properties\n\t\t * synth.get([\"envelope.attack\", \"envelope.release\"]);\n\t\t * //returns {\"envelope\" : {\"attack\" : 0.2, \"release\" : 0.4}}\n\t\t * @param {Array=|string|undefined} params the parameters to get, otherwise will return\n\t\t * \t\t\t\t\t all available.\n\t\t * @returns {Object}\n\t\t */\n\t Tone.prototype.get = function (params) {\n\t if (Tone.isUndef(params)) {\n\t params = this._collectDefaults(this.constructor);\n\t } else if (Tone.isString(params)) {\n\t params = [params];\n\t }\n\t var ret = {};\n\t for (var i = 0; i < params.length; i++) {\n\t var attr = params[i];\n\t var parent = this;\n\t var subRet = ret;\n\t if (attr.indexOf('.') !== -1) {\n\t var attrSplit = attr.split('.');\n\t for (var j = 0; j < attrSplit.length - 1; j++) {\n\t var subAttr = attrSplit[j];\n\t subRet[subAttr] = subRet[subAttr] || {};\n\t subRet = subRet[subAttr];\n\t parent = parent[subAttr];\n\t }\n\t attr = attrSplit[attrSplit.length - 1];\n\t }\n\t var param = parent[attr];\n\t if (Tone.isObject(params[attr])) {\n\t subRet[attr] = param.get();\n\t } else if (Tone.Signal && param instanceof Tone.Signal) {\n\t subRet[attr] = param.value;\n\t } else if (Tone.Param && param instanceof Tone.Param) {\n\t subRet[attr] = param.value;\n\t } else if (param instanceof AudioParam) {\n\t subRet[attr] = param.value;\n\t } else if (param instanceof Tone) {\n\t subRet[attr] = param.get();\n\t } else if (!Tone.isFunction(param) && Tone.isDefined(param)) {\n\t subRet[attr] = param;\n\t }\n\t }\n\t return ret;\n\t };\n\t /**\n\t\t * collect all of the default attributes in one\n\t\t * @private\n\t\t * @param {Function} constr the constructor to find the defaults from\n\t\t * @return {Array} all of the attributes which belong to the class\n\t\t */\n\t Tone.prototype._collectDefaults = function (constr) {\n\t var ret = [];\n\t if (Tone.isDefined(constr.defaults)) {\n\t ret = Object.keys(constr.defaults);\n\t }\n\t if (Tone.isDefined(constr._super)) {\n\t var superDefs = this._collectDefaults(constr._super);\n\t //filter out repeats\n\t for (var i = 0; i < superDefs.length; i++) {\n\t if (ret.indexOf(superDefs[i]) === -1) {\n\t ret.push(superDefs[i]);\n\t }\n\t }\n\t }\n\t return ret;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tDEFAULTS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * @memberOf Tone\n\t\t * @param {Array} values The arguments array\n\t\t * @param {Array} keys The names of the arguments\n\t\t * @param {Function|Object} constr The class constructor\n\t\t * @return {Object} An object composed of the defaults between the class' defaults\n\t\t * and the passed in arguments.\n\t\t */\n\t Tone.defaults = function (values, keys, constr) {\n\t var options = {};\n\t if (values.length === 1 && Tone.isObject(values[0])) {\n\t options = values[0];\n\t } else {\n\t for (var i = 0; i < keys.length; i++) {\n\t options[keys[i]] = values[i];\n\t }\n\t }\n\t if (Tone.isDefined(constr.defaults)) {\n\t return Tone.defaultArg(options, constr.defaults);\n\t } else if (Tone.isObject(constr)) {\n\t return Tone.defaultArg(options, constr);\n\t } else {\n\t return options;\n\t }\n\t };\n\t /**\n\t\t * If the `given` parameter is undefined, use the `fallback`.\n\t\t * If both `given` and `fallback` are object literals, it will\n\t\t * return a deep copy which includes all of the parameters from both\n\t\t * objects. If a parameter is undefined in given, it will return\n\t\t * the fallback property.\n\t\t * <br><br>\n\t\t * WARNING: if object is self referential, it will go into an an\n\t\t * infinite recursive loop.\n\t\t * @memberOf Tone\n\t\t * @param {*} given\n\t\t * @param {*} fallback\n\t\t * @return {*}\n\t\t */\n\t Tone.defaultArg = function (given, fallback) {\n\t if (Tone.isObject(given) && Tone.isObject(fallback)) {\n\t var ret = {};\n\t //make a deep copy of the given object\n\t for (var givenProp in given) {\n\t ret[givenProp] = Tone.defaultArg(fallback[givenProp], given[givenProp]);\n\t }\n\t for (var fallbackProp in fallback) {\n\t ret[fallbackProp] = Tone.defaultArg(given[fallbackProp], fallback[fallbackProp]);\n\t }\n\t return ret;\n\t } else {\n\t return Tone.isUndef(given) ? fallback : given;\n\t }\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tCONNECTIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * connect together all of the arguments in series\n\t\t * @param {...AudioParam|Tone|AudioNode} nodes\n\t\t * @returns {Tone}\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t */\n\t Tone.connectSeries = function () {\n\t var currentUnit = arguments[0];\n\t for (var i = 1; i < arguments.length; i++) {\n\t var toUnit = arguments[i];\n\t currentUnit.connect(toUnit);\n\t currentUnit = toUnit;\n\t }\n\t return Tone;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // TYPE CHECKING\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Test if the arg is undefined\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is undefined\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isUndef = function (val) {\n\t return typeof val === 'undefined';\n\t };\n\t /**\n\t\t * Test if the arg is not undefined\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is undefined\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isDefined = function (val) {\n\t return !Tone.isUndef(val);\n\t };\n\t /**\n\t\t * Test if the arg is a function\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a function\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isFunction = function (val) {\n\t return typeof val === 'function';\n\t };\n\t /**\n\t\t * Test if the argument is a number.\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a number\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isNumber = function (arg) {\n\t return typeof arg === 'number';\n\t };\n\t /**\n\t\t * Test if the given argument is an object literal (i.e. `{}`);\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is an object literal.\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isObject = function (arg) {\n\t return Object.prototype.toString.call(arg) === '[object Object]' && arg.constructor === Object;\n\t };\n\t /**\n\t\t * Test if the argument is a boolean.\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a boolean\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isBoolean = function (arg) {\n\t return typeof arg === 'boolean';\n\t };\n\t /**\n\t\t * Test if the argument is an Array\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is an array\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isArray = function (arg) {\n\t return Array.isArray(arg);\n\t };\n\t /**\n\t\t * Test if the argument is a string.\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a string\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isString = function (arg) {\n\t return typeof arg === 'string';\n\t };\n\t /**\n\t\t * Test if the argument is in the form of a note in scientific pitch notation.\n\t\t * e.g. \"C4\"\n\t\t * @param {*} arg the argument to test\n\t\t * @returns {Boolean} true if the arg is a string\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.isNote = function (arg) {\n\t return Tone.isString(arg) && /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(arg);\n\t };\n\t /**\n\t\t * An empty function.\n\t\t * @static\n\t\t */\n\t Tone.noOp = function () {\n\t };\n\t /**\n\t\t * Make the property not writable. Internal use only.\n\t\t * @private\n\t\t * @param {String} property the property to make not writable\n\t\t */\n\t Tone.prototype._readOnly = function (property) {\n\t if (Array.isArray(property)) {\n\t for (var i = 0; i < property.length; i++) {\n\t this._readOnly(property[i]);\n\t }\n\t } else {\n\t Object.defineProperty(this, property, {\n\t writable: false,\n\t enumerable: true\n\t });\n\t }\n\t };\n\t /**\n\t\t * Make an attribute writeable. Interal use only.\n\t\t * @private\n\t\t * @param {String} property the property to make writable\n\t\t */\n\t Tone.prototype._writable = function (property) {\n\t if (Array.isArray(property)) {\n\t for (var i = 0; i < property.length; i++) {\n\t this._writable(property[i]);\n\t }\n\t } else {\n\t Object.defineProperty(this, property, { writable: true });\n\t }\n\t };\n\t /**\n\t\t * Possible play states.\n\t\t * @enum {String}\n\t\t */\n\t Tone.State = {\n\t Started: 'started',\n\t Stopped: 'stopped',\n\t Paused: 'paused'\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Equal power gain scale. Good for cross-fading.\n\t\t * @param {NormalRange} percent (0-1)\n\t\t * @return {Number} output gain (0-1)\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.equalPowerScale = function (percent) {\n\t var piFactor = 0.5 * Math.PI;\n\t return Math.sin(percent * piFactor);\n\t };\n\t /**\n\t\t * Convert decibels into gain.\n\t\t * @param {Decibels} db\n\t\t * @return {Number}\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.dbToGain = function (db) {\n\t return Math.pow(10, db / 20);\n\t };\n\t /**\n\t\t * Convert gain to decibels.\n\t\t * @param {Number} gain (0-1)\n\t\t * @return {Decibels}\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.gainToDb = function (gain) {\n\t return 20 * (Math.log(gain) / Math.LN10);\n\t };\n\t /**\n\t\t * Convert an interval (in semitones) to a frequency ratio.\n\t\t * @param {Interval} interval the number of semitones above the base note\n\t\t * @return {Number} the frequency ratio\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t * @example\n\t\t * tone.intervalToFrequencyRatio(0); // 1\n\t\t * tone.intervalToFrequencyRatio(12); // 2\n\t\t * tone.intervalToFrequencyRatio(-12); // 0.5\n\t\t */\n\t Tone.intervalToFrequencyRatio = function (interval) {\n\t return Math.pow(2, interval / 12);\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTIMING\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Return the current time of the AudioContext clock.\n\t\t * @return {Number} the currentTime from the AudioContext\n\t\t * @memberOf Tone#\n\t\t */\n\t Tone.prototype.now = function () {\n\t return Tone.context.now();\n\t };\n\t /**\n\t\t * Return the current time of the AudioContext clock.\n\t\t * @return {Number} the currentTime from the AudioContext\n\t\t * @static\n\t\t * @memberOf Tone\n\t\t */\n\t Tone.now = function () {\n\t return Tone.context.now();\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tINHERITANCE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * have a child inherit all of Tone's (or a parent's) prototype\n\t\t * to inherit the parent's properties, make sure to call\n\t\t * Parent.call(this) in the child's constructor\n\t\t *\n\t\t * based on closure library's inherit function\n\t\t *\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @param {Function} \tchild\n\t\t * @param {Function=} parent (optional) parent to inherit from\n\t\t * if no parent is supplied, the child\n\t\t * will inherit from Tone\n\t\t */\n\t Tone.extend = function (child, parent) {\n\t if (Tone.isUndef(parent)) {\n\t parent = Tone;\n\t }\n\t function TempConstructor() {\n\t }\n\t TempConstructor.prototype = parent.prototype;\n\t child.prototype = new TempConstructor();\n\t /** @override */\n\t child.prototype.constructor = child;\n\t child._super = parent;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tCONTEXT\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Private reference to the global AudioContext\n\t\t * @type {AudioContext}\n\t\t * @private\n\t\t */\n\t var audioContext = null;\n\t /**\n\t\t * A static pointer to the audio context accessible as Tone.context.\n\t\t * @type {Tone.Context}\n\t\t * @name context\n\t\t * @memberOf Tone\n\t\t */\n\t Object.defineProperty(Tone, 'context', {\n\t get: function () {\n\t return audioContext;\n\t },\n\t set: function (context) {\n\t if (Tone.Context && context instanceof Tone.Context) {\n\t audioContext = context;\n\t } else {\n\t audioContext = new Tone.Context(context);\n\t }\n\t //initialize the new audio context\n\t Tone.Context.emit('init', audioContext);\n\t }\n\t });\n\t /**\n\t\t * The AudioContext\n\t\t * @type {Tone.Context}\n\t\t * @name context\n\t\t * @memberOf Tone#\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.prototype, 'context', {\n\t get: function () {\n\t return Tone.context;\n\t }\n\t });\n\t /**\n\t\t * Tone automatically creates a context on init, but if you are working\n\t\t * with other libraries which also create an AudioContext, it can be\n\t\t * useful to set your own. If you are going to set your own context,\n\t\t * be sure to do it at the start of your code, before creating any objects.\n\t\t * @static\n\t\t * @param {AudioContext} ctx The new audio context to set\n\t\t */\n\t Tone.setContext = function (ctx) {\n\t Tone.context = ctx;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tATTRIBUTES\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * The number of seconds of 1 processing block (128 samples)\n\t\t * @type {Number}\n\t\t * @name blockTime\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.prototype, 'blockTime', {\n\t get: function () {\n\t return 128 / this.context.sampleRate;\n\t }\n\t });\n\t /**\n\t\t * The duration in seconds of one sample.\n\t\t * @type {Number}\n\t\t * @name sampleTime\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.prototype, 'sampleTime', {\n\t get: function () {\n\t return 1 / this.context.sampleRate;\n\t }\n\t });\n\t /**\n\t\t * Whether or not all the technologies that Tone.js relies on are supported by the current browser.\n\t\t * @type {Boolean}\n\t\t * @name supported\n\t\t * @memberOf Tone\n\t\t * @readOnly\n\t\t * @static\n\t\t */\n\t Object.defineProperty(Tone, 'supported', {\n\t get: function () {\n\t var hasAudioContext = window.hasOwnProperty('AudioContext') || window.hasOwnProperty('webkitAudioContext');\n\t var hasPromises = window.hasOwnProperty('Promise');\n\t var hasWorkers = window.hasOwnProperty('Worker');\n\t return hasAudioContext && hasPromises && hasWorkers;\n\t }\n\t });\n\t /**\n\t\t * Boolean value if the audio context has been initialized.\n\t\t * @type {Boolean}\n\t\t * @memberOf Tone\n\t\t * @static\n\t\t * @name initialized\n\t\t */\n\t Object.defineProperty(Tone, 'initialized', {\n\t get: function () {\n\t return audioContext !== null;\n\t }\n\t });\n\t /**\n\t\t * Get the context when it becomes available\n\t\t * @param {Function} resolve Callback when the context is initialized\n\t\t * @return {Tone}\n\t\t */\n\t Tone.getContext = function (resolve) {\n\t if (Tone.initialized) {\n\t resolve(Tone.context);\n\t } else {\n\t var resCallback = function () {\n\t resolve(Tone.context);\n\t Tone.Context.off('init', resCallback);\n\t };\n\t Tone.Context.on('init', resCallback);\n\t }\n\t return Tone;\n\t };\n\t /**\n\t\t * The version number\n\t\t * @type {String}\n\t\t * @static\n\t\t */\n\t Tone.version = 'r12';\n\t return Tone;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Emitter gives classes which extend it\n\t\t * the ability to listen for and emit events.\n\t\t * Inspiration and reference from Jerome Etienne's [MicroEvent](https://github.com/jeromeetienne/microevent.js).\n\t\t * MIT (c) 2011 Jerome Etienne.\n\t\t *\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.Emitter = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * Contains all of the events.\n\t\t\t * @private\n\t\t\t * @type {Object}\n\t\t\t */\n\t this._events = {};\n\t };\n\t Tone.extend(Tone.Emitter);\n\t /**\n\t\t * Bind a callback to a specific event.\n\t\t * @param {String} event The name of the event to listen for.\n\t\t * @param {Function} callback The callback to invoke when the\n\t\t * event is emitted\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.on = function (event, callback) {\n\t //split the event\n\t var events = event.split(/\\W+/);\n\t for (var i = 0; i < events.length; i++) {\n\t var eventName = events[i];\n\t if (!this._events.hasOwnProperty(eventName)) {\n\t this._events[eventName] = [];\n\t }\n\t this._events[eventName].push(callback);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Bind a callback which is only invoked once\n\t\t * @param {String} event The name of the event to listen for.\n\t\t * @param {Function} callback The callback to invoke when the\n\t\t * event is emitted\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.once = function (event, callback) {\n\t var boundCallback = function () {\n\t //invoke the callback\n\t callback.apply(this, arguments);\n\t this.off(event, boundCallback);\n\t }.bind(this);\n\t this.on(event, boundCallback);\n\t return this;\n\t };\n\t /**\n\t\t * Remove the event listener.\n\t\t * @param {String} event The event to stop listening to.\n\t\t * @param {Function=} callback The callback which was bound to\n\t\t * the event with Tone.Emitter.on.\n\t\t * If no callback is given, all callbacks\n\t\t * events are removed.\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.off = function (event, callback) {\n\t var events = event.split(/\\W+/);\n\t for (var ev = 0; ev < events.length; ev++) {\n\t event = events[ev];\n\t if (this._events.hasOwnProperty(event)) {\n\t if (Tone.isUndef(callback)) {\n\t this._events[event] = [];\n\t } else {\n\t var eventList = this._events[event];\n\t for (var i = 0; i < eventList.length; i++) {\n\t if (eventList[i] === callback) {\n\t eventList.splice(i, 1);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Invoke all of the callbacks bound to the event\n\t\t * with any arguments passed in.\n\t\t * @param {String} event The name of the event.\n\t\t * @param {*} args... The arguments to pass to the functions listening.\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.emit = function (event) {\n\t if (this._events) {\n\t var args = Array.apply(null, arguments).slice(1);\n\t if (this._events.hasOwnProperty(event)) {\n\t var eventList = this._events[event].slice(0);\n\t for (var i = 0, len = eventList.length; i < len; i++) {\n\t eventList[i].apply(this, args);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Add Emitter functions (on/off/emit) to the object\n\t\t * @param {Object|Function} object The object or class to extend.\n\t\t * @returns {Tone.Emitter}\n\t\t */\n\t Tone.Emitter.mixin = function (object) {\n\t var functions = [\n\t 'on',\n\t 'once',\n\t 'off',\n\t 'emit'\n\t ];\n\t object._events = {};\n\t for (var i = 0; i < functions.length; i++) {\n\t var func = functions[i];\n\t var emitterFunc = Tone.Emitter.prototype[func];\n\t object[func] = emitterFunc;\n\t }\n\t return Tone.Emitter;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Emitter} this\n\t\t */\n\t Tone.Emitter.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this._events = null;\n\t return this;\n\t };\n\t return Tone.Emitter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A Timeline class for scheduling and maintaining state\n\t\t * along a timeline. All events must have a \"time\" property.\n\t\t * Internally, events are stored in time order for fast\n\t\t * retrieval.\n\t\t * @extends {Tone}\n\t\t * @param {Positive} [memory=Infinity] The number of previous events that are retained.\n\t\t */\n\t Tone.Timeline = function () {\n\t var options = Tone.defaults(arguments, ['memory'], Tone.Timeline);\n\t Tone.call(this);\n\t /**\n\t\t\t * The array of scheduled timeline events\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._timeline = [];\n\t /**\n\t\t\t * The memory of the timeline, i.e.\n\t\t\t * how many events in the past it will retain\n\t\t\t * @type {Positive}\n\t\t\t */\n\t this.memory = options.memory;\n\t };\n\t Tone.extend(Tone.Timeline);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Timeline.defaults = { 'memory': Infinity };\n\t /**\n\t\t * The number of items in the timeline.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Timeline#\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Timeline.prototype, 'length', {\n\t get: function () {\n\t return this._timeline.length;\n\t }\n\t });\n\t /**\n\t\t * Insert an event object onto the timeline. Events must have a \"time\" attribute.\n\t\t * @param {Object} event The event object to insert into the\n\t\t * timeline.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.add = function (event) {\n\t //the event needs to have a time attribute\n\t if (Tone.isUndef(event.time)) {\n\t throw new Error('Tone.Timeline: events must have a time attribute');\n\t }\n\t event.time = event.time.valueOf();\n\t var index = this._search(event.time);\n\t this._timeline.splice(index + 1, 0, event);\n\t //if the length is more than the memory, remove the previous ones\n\t if (this.length > this.memory) {\n\t var diff = this.length - this.memory;\n\t this._timeline.splice(0, diff);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Remove an event from the timeline.\n\t\t * @param {Object} event The event object to remove from the list.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.remove = function (event) {\n\t var index = this._timeline.indexOf(event);\n\t if (index !== -1) {\n\t this._timeline.splice(index, 1);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the nearest event whose time is less than or equal to the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @returns {Object} The event object set after that time.\n\t\t */\n\t Tone.Timeline.prototype.get = function (time, comparator) {\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var index = this._search(time, comparator);\n\t if (index !== -1) {\n\t return this._timeline[index];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Return the first event in the timeline without removing it\n\t\t * @returns {Object} The first event object\n\t\t */\n\t Tone.Timeline.prototype.peek = function () {\n\t return this._timeline[0];\n\t };\n\t /**\n\t\t * Return the first event in the timeline and remove it\n\t\t * @returns {Object} The first event object\n\t\t */\n\t Tone.Timeline.prototype.shift = function () {\n\t return this._timeline.shift();\n\t };\n\t /**\n\t\t * Get the event which is scheduled after the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @returns {Object} The event object after the given time\n\t\t */\n\t Tone.Timeline.prototype.getAfter = function (time, comparator) {\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var index = this._search(time, comparator);\n\t if (index + 1 < this._timeline.length) {\n\t return this._timeline[index + 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Get the event before the event at the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @returns {Object} The event object before the given time\n\t\t */\n\t Tone.Timeline.prototype.getBefore = function (time, comparator) {\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var len = this._timeline.length;\n\t //if it's after the last item, return the last item\n\t if (len > 0 && this._timeline[len - 1][comparator] < time) {\n\t return this._timeline[len - 1];\n\t }\n\t var index = this._search(time, comparator);\n\t if (index - 1 >= 0) {\n\t return this._timeline[index - 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Cancel events after the given time\n\t\t * @param {Number} time The time to query.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.cancel = function (after) {\n\t if (this._timeline.length > 1) {\n\t var index = this._search(after);\n\t if (index >= 0) {\n\t if (this._timeline[index].time === after) {\n\t //get the first item with that time\n\t for (var i = index; i >= 0; i--) {\n\t if (this._timeline[i].time === after) {\n\t index = i;\n\t } else {\n\t break;\n\t }\n\t }\n\t this._timeline = this._timeline.slice(0, index);\n\t } else {\n\t this._timeline = this._timeline.slice(0, index + 1);\n\t }\n\t } else {\n\t this._timeline = [];\n\t }\n\t } else if (this._timeline.length === 1) {\n\t //the first item's time\n\t if (this._timeline[0].time >= after) {\n\t this._timeline = [];\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel events before or equal to the given time.\n\t\t * @param {Number} time The time to cancel before.\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.cancelBefore = function (time) {\n\t var index = this._search(time);\n\t if (index >= 0) {\n\t this._timeline = this._timeline.slice(index + 1);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Returns the previous event if there is one. null otherwise\n\t\t * @param {Object} event The event to find the previous one of\n\t\t * @return {Object} The event right before the given event\n\t\t */\n\t Tone.Timeline.prototype.previousEvent = function (event) {\n\t var index = this._timeline.indexOf(event);\n\t if (index > 0) {\n\t return this._timeline[index - 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Does a binary search on the timeline array and returns the\n\t\t * nearest event index whose time is after or equal to the given time.\n\t\t * If a time is searched before the first index in the timeline, -1 is returned.\n\t\t * If the time is after the end, the index of the last item is returned.\n\t\t * @param {Number} time\n\t\t * @param {String} comparator Which value in the object to compare\n\t\t * @return {Number} the index in the timeline array\n\t\t * @private\n\t\t */\n\t Tone.Timeline.prototype._search = function (time, comparator) {\n\t if (this._timeline.length === 0) {\n\t return -1;\n\t }\n\t comparator = Tone.defaultArg(comparator, 'time');\n\t var beginning = 0;\n\t var len = this._timeline.length;\n\t var end = len;\n\t if (len > 0 && this._timeline[len - 1][comparator] <= time) {\n\t return len - 1;\n\t }\n\t while (beginning < end) {\n\t // calculate the midpoint for roughly equal partition\n\t var midPoint = Math.floor(beginning + (end - beginning) / 2);\n\t var event = this._timeline[midPoint];\n\t var nextEvent = this._timeline[midPoint + 1];\n\t if (event[comparator] === time) {\n\t //choose the last one that has the same time\n\t for (var i = midPoint; i < this._timeline.length; i++) {\n\t var testEvent = this._timeline[i];\n\t if (testEvent[comparator] === time) {\n\t midPoint = i;\n\t }\n\t }\n\t return midPoint;\n\t } else if (event[comparator] < time && nextEvent[comparator] > time) {\n\t return midPoint;\n\t } else if (event[comparator] > time) {\n\t //search lower\n\t end = midPoint;\n\t } else {\n\t //search upper\n\t beginning = midPoint + 1;\n\t }\n\t }\n\t return -1;\n\t };\n\t /**\n\t\t * Internal iterator. Applies extra safety checks for\n\t\t * removing items from the array.\n\t\t * @param {Function} callback\n\t\t * @param {Number=} lowerBound\n\t\t * @param {Number=} upperBound\n\t\t * @private\n\t\t */\n\t Tone.Timeline.prototype._iterate = function (callback, lowerBound, upperBound) {\n\t lowerBound = Tone.defaultArg(lowerBound, 0);\n\t upperBound = Tone.defaultArg(upperBound, this._timeline.length - 1);\n\t this._timeline.slice(lowerBound, upperBound + 1).forEach(function (event) {\n\t callback.call(this, event);\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Iterate over everything in the array\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEach = function (callback) {\n\t this._iterate(callback);\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array at or before the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachBefore = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var upperBound = this._search(time);\n\t if (upperBound !== -1) {\n\t this._iterate(callback, 0, upperBound);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array after the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachAfter = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var lowerBound = this._search(time);\n\t this._iterate(callback, lowerBound + 1);\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array between the startTime and endTime. \n\t\t * The timerange is inclusive of the startTime, but exclusive of the endTime. \n\t\t * range = [startTime, endTime). \n\t\t * @param {Number} startTime The time to check if items are before\n\t\t * @param {Number} endTime The end of the test interval. \n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachBetween = function (startTime, endTime, callback) {\n\t var lowerBound = this._search(startTime);\n\t var upperBound = this._search(endTime);\n\t if (lowerBound !== -1 && upperBound !== -1) {\n\t if (this._timeline[lowerBound].time !== startTime) {\n\t lowerBound += 1;\n\t }\n\t //exclusive of the end time\n\t if (this._timeline[upperBound].time === endTime) {\n\t upperBound -= 1;\n\t }\n\t this._iterate(callback, lowerBound, upperBound);\n\t } else if (lowerBound === -1) {\n\t this._iterate(callback, 0, upperBound);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array at or after the given time. Similar to\n\t\t * forEachAfter, but includes the item(s) at the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachFrom = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var lowerBound = this._search(time);\n\t //work backwards until the event time is less than time\n\t while (lowerBound >= 0 && this._timeline[lowerBound].time >= time) {\n\t lowerBound--;\n\t }\n\t this._iterate(callback, lowerBound + 1);\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array at the given time\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.forEachAtTime = function (time, callback) {\n\t //iterate over the items in reverse so that removing an item doesn't break things\n\t var upperBound = this._search(time);\n\t if (upperBound !== -1) {\n\t this._iterate(function (event) {\n\t if (event.time === time) {\n\t callback.call(this, event);\n\t }\n\t }, 0, upperBound);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Timeline} this\n\t\t */\n\t Tone.Timeline.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this._timeline = null;\n\t return this;\n\t };\n\t return Tone.Timeline;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t if (!window.hasOwnProperty('OfflineAudioContext') && window.hasOwnProperty('webkitOfflineAudioContext')) {\n\t window.OfflineAudioContext = window.webkitOfflineAudioContext;\n\t }\n\t //returns promise?\n\t var context = new OfflineAudioContext(1, 1, 44100);\n\t var ret = context.startRendering();\n\t if (!(ret instanceof Promise)) {\n\t OfflineAudioContext.prototype._native_startRendering = OfflineAudioContext.prototype.startRendering;\n\t OfflineAudioContext.prototype.startRendering = function () {\n\t return new Promise(function (done) {\n\t this.oncomplete = function (e) {\n\t done(e.renderedBuffer);\n\t };\n\t this._native_startRendering();\n\t }.bind(this));\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t if (!window.hasOwnProperty('AudioContext') && window.hasOwnProperty('webkitAudioContext')) {\n\t window.AudioContext = window.webkitAudioContext;\n\t }\n\t //not functionally equivalent, but only an API placeholder\n\t if (!AudioContext.prototype.close) {\n\t AudioContext.prototype.close = function () {\n\t if (Tone.isFunction(this.suspend)) {\n\t this.suspend();\n\t }\n\t return Promise.resolve();\n\t };\n\t }\n\t //not functionally equivalent\n\t if (!AudioContext.prototype.resume) {\n\t AudioContext.prototype.resume = function () {\n\t return Promise.resolve();\n\t };\n\t }\n\t //createGain\n\t if (!AudioContext.prototype.createGain && AudioContext.prototype.createGainNode) {\n\t AudioContext.prototype.createGain = AudioContext.prototype.createGainNode;\n\t }\n\t //createDelay\n\t if (!AudioContext.prototype.createDelay && AudioContext.prototype.createDelayNode) {\n\t AudioContext.prototype.createDelay = AudioContext.prototype.createDelayNode;\n\t }\n\t //test decodeAudioData returns a promise\n\t // https://github.com/mohayonao/web-audio-api-shim/blob/master/src/AudioContext.js\n\t // MIT License (c) 2015 @mohayonao\n\t var decodeAudioDataPromise = false;\n\t var offlineContext = new OfflineAudioContext(1, 1, 44100);\n\t var audioData = new Uint32Array([\n\t 1179011410,\n\t 48,\n\t 1163280727,\n\t 544501094,\n\t 16,\n\t 131073,\n\t 44100,\n\t 176400,\n\t 1048580,\n\t 1635017060,\n\t 8,\n\t 0,\n\t 0,\n\t 0,\n\t 0\n\t ]).buffer;\n\t try {\n\t var ret = offlineContext.decodeAudioData(audioData);\n\t if (ret instanceof Promise) {\n\t decodeAudioDataPromise = true;\n\t }\n\t } catch (e) {\n\t decodeAudioDataPromise = false;\n\t }\n\t if (!decodeAudioDataPromise) {\n\t AudioContext.prototype._native_decodeAudioData = AudioContext.prototype.decodeAudioData;\n\t AudioContext.prototype.decodeAudioData = function (audioData) {\n\t return new Promise(function (success, error) {\n\t this._native_decodeAudioData(audioData, success, error);\n\t }.bind(this));\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the native AudioContext.\n\t\t * @extends {Tone.Emitter}\n\t\t * @param {AudioContext=} context optionally pass in a context\n\t\t */\n\t Tone.Context = function () {\n\t Tone.Emitter.call(this);\n\t var options = Tone.defaults(arguments, ['context'], Tone.Context);\n\t if (!options.context) {\n\t options.context = new window.AudioContext();\n\t if (!options.context) {\n\t throw new Error('could not create AudioContext. Possibly too many AudioContexts running already.');\n\t }\n\t }\n\t this._context = options.context;\n\t // extend all of the methods\n\t for (var prop in this._context) {\n\t this._defineProperty(this._context, prop);\n\t }\n\t /**\n\t\t\t * The default latency hint\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._latencyHint = options.latencyHint;\n\t /**\n\t\t\t * An object containing all of the constants AudioBufferSourceNodes\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._constants = {};\n\t ///////////////////////////////////////////////////////////////////////\n\t // WORKER\n\t ///////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t * The amount of time events are scheduled\n\t\t\t * into the future\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.lookAhead = options.lookAhead;\n\t /**\n\t\t\t * A reference to the actual computed update interval\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._computedUpdateInterval = 0;\n\t /**\n\t\t\t * A reliable callback method\n\t\t\t * @private\n\t\t\t * @type {Ticker}\n\t\t\t */\n\t this._ticker = new Ticker(this.emit.bind(this, 'tick'), options.clockSource, options.updateInterval);\n\t ///////////////////////////////////////////////////////////////////////\n\t // TIMEOUTS\n\t ///////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t * All of the setTimeout events.\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._timeouts = new Tone.Timeline();\n\t /**\n\t\t\t * The timeout id counter\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._timeoutIds = 0;\n\t this.on('tick', this._timeoutLoop.bind(this));\n\t };\n\t Tone.extend(Tone.Context, Tone.Emitter);\n\t Tone.Emitter.mixin(Tone.Context);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Context.defaults = {\n\t 'clockSource': 'worker',\n\t 'latencyHint': 'interactive',\n\t 'lookAhead': 0.1,\n\t 'updateInterval': 0.03\n\t };\n\t /**\n\t\t * Define a property on this Tone.Context.\n\t\t * This is used to extend the native AudioContext\n\t\t * @param {AudioContext} context\n\t\t * @param {String} prop\n\t\t * @private\n\t\t */\n\t Tone.Context.prototype._defineProperty = function (context, prop) {\n\t if (Tone.isUndef(this[prop])) {\n\t Object.defineProperty(this, prop, {\n\t get: function () {\n\t if (typeof context[prop] === 'function') {\n\t return context[prop].bind(context);\n\t } else {\n\t return context[prop];\n\t }\n\t },\n\t set: function (val) {\n\t context[prop] = val;\n\t }\n\t });\n\t }\n\t };\n\t /**\n\t\t * The current audio context time\n\t\t * @return {Number}\n\t\t */\n\t Tone.Context.prototype.now = function () {\n\t return this._context.currentTime + this.lookAhead;\n\t };\n\t /**\n\t\t * Promise which is invoked when the context is running.\n\t\t * Tries to resume the context if it's not started.\n\t\t * @return {Promise}\n\t\t */\n\t Tone.Context.prototype.ready = function () {\n\t return new Promise(function (done) {\n\t if (this._context.state === 'running') {\n\t done();\n\t } else {\n\t this._context.resume().then(function () {\n\t done();\n\t });\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Promise which is invoked when the context is running.\n\t\t * Tries to resume the context if it's not started.\n\t\t * @return {Promise}\n\t\t */\n\t Tone.Context.prototype.close = function () {\n\t return this._context.close().then(function () {\n\t Tone.Context.emit('close', this);\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Generate a looped buffer at some constant value.\n\t\t * @param {Number} val\n\t\t * @return {BufferSourceNode}\n\t\t */\n\t Tone.Context.prototype.getConstant = function (val) {\n\t if (this._constants[val]) {\n\t return this._constants[val];\n\t } else {\n\t var buffer = this._context.createBuffer(1, 128, this._context.sampleRate);\n\t var arr = buffer.getChannelData(0);\n\t for (var i = 0; i < arr.length; i++) {\n\t arr[i] = val;\n\t }\n\t var constant = this._context.createBufferSource();\n\t constant.channelCount = 1;\n\t constant.channelCountMode = 'explicit';\n\t constant.buffer = buffer;\n\t constant.loop = true;\n\t constant.start(0);\n\t this._constants[val] = constant;\n\t return constant;\n\t }\n\t };\n\t /**\n\t\t * The private loop which keeps track of the context scheduled timeouts\n\t\t * Is invoked from the clock source\n\t\t * @private\n\t\t */\n\t Tone.Context.prototype._timeoutLoop = function () {\n\t var now = this.now();\n\t while (this._timeouts && this._timeouts.length && this._timeouts.peek().time <= now) {\n\t this._timeouts.shift().callback();\n\t }\n\t };\n\t /**\n\t\t * A setTimeout which is gaurenteed by the clock source.\n\t\t * Also runs in the offline context.\n\t\t * @param {Function} fn The callback to invoke\n\t\t * @param {Seconds} timeout The timeout in seconds\n\t\t * @returns {Number} ID to use when invoking Tone.Context.clearTimeout\n\t\t */\n\t Tone.Context.prototype.setTimeout = function (fn, timeout) {\n\t this._timeoutIds++;\n\t var now = this.now();\n\t this._timeouts.add({\n\t callback: fn,\n\t time: now + timeout,\n\t id: this._timeoutIds\n\t });\n\t return this._timeoutIds;\n\t };\n\t /**\n\t\t * Clears a previously scheduled timeout with Tone.context.setTimeout\n\t\t * @param {Number} id The ID returned from setTimeout\n\t\t * @return {Tone.Context} this\n\t\t */\n\t Tone.Context.prototype.clearTimeout = function (id) {\n\t this._timeouts.forEach(function (event) {\n\t if (event.id === id) {\n\t this.remove(event);\n\t }\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * How often the Web Worker callback is invoked.\n\t\t * This number corresponds to how responsive the scheduling\n\t\t * can be. Context.updateInterval + Context.lookAhead gives you the\n\t\t * total latency between scheduling an event and hearing it.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Context#\n\t\t * @name updateInterval\n\t\t */\n\t Object.defineProperty(Tone.Context.prototype, 'updateInterval', {\n\t get: function () {\n\t return this._ticker.updateInterval;\n\t },\n\t set: function (interval) {\n\t this._ticker.updateInterval = interval;\n\t }\n\t });\n\t /**\n\t\t * What the source of the clock is, either \"worker\" (Web Worker [default]),\n\t\t * \"timeout\" (setTimeout), or \"offline\" (none).\n\t\t * @type {String}\n\t\t * @memberOf Tone.Context#\n\t\t * @name clockSource\n\t\t */\n\t Object.defineProperty(Tone.Context.prototype, 'clockSource', {\n\t get: function () {\n\t return this._ticker.type;\n\t },\n\t set: function (type) {\n\t this._ticker.type = type;\n\t }\n\t });\n\t /**\n\t\t * The type of playback, which affects tradeoffs between audio\n\t\t * output latency and responsiveness.\n\t\t *\n\t\t * In addition to setting the value in seconds, the latencyHint also\n\t\t * accepts the strings \"interactive\" (prioritizes low latency),\n\t\t * \"playback\" (prioritizes sustained playback), \"balanced\" (balances\n\t\t * latency and performance), and \"fastest\" (lowest latency, might glitch more often).\n\t\t * @type {String|Seconds}\n\t\t * @memberOf Tone.Context#\n\t\t * @name latencyHint\n\t\t * @example\n\t\t * //set the lookAhead to 0.3 seconds\n\t\t * Tone.context.latencyHint = 0.3;\n\t\t */\n\t Object.defineProperty(Tone.Context.prototype, 'latencyHint', {\n\t get: function () {\n\t return this._latencyHint;\n\t },\n\t set: function (hint) {\n\t var lookAhead = hint;\n\t this._latencyHint = hint;\n\t if (Tone.isString(hint)) {\n\t switch (hint) {\n\t case 'interactive':\n\t lookAhead = 0.1;\n\t this._context.latencyHint = hint;\n\t break;\n\t case 'playback':\n\t lookAhead = 0.8;\n\t this._context.latencyHint = hint;\n\t break;\n\t case 'balanced':\n\t lookAhead = 0.25;\n\t this._context.latencyHint = hint;\n\t break;\n\t case 'fastest':\n\t this._context.latencyHint = 'interactive';\n\t lookAhead = 0.01;\n\t break;\n\t }\n\t }\n\t this.lookAhead = lookAhead;\n\t this.updateInterval = lookAhead / 3;\n\t }\n\t });\n\t /**\n\t\t * Unlike other dispose methods, this returns a Promise\n\t\t * which executes when the context is closed and disposed\n\t\t * @returns {Promise} this\n\t\t */\n\t Tone.Context.prototype.dispose = function () {\n\t return this.close().then(function () {\n\t Tone.Emitter.prototype.dispose.call(this);\n\t this._ticker.dispose();\n\t this._ticker = null;\n\t this._timeouts.dispose();\n\t this._timeouts = null;\n\t for (var con in this._constants) {\n\t this._constants[con].disconnect();\n\t }\n\t this._constants = null;\n\t }.bind(this));\n\t };\n\t /**\n\t\t * @class A class which provides a reliable callback using either\n\t\t * a Web Worker, or if that isn't supported, falls back to setTimeout.\n\t\t * @private\n\t\t */\n\t var Ticker = function (callback, type, updateInterval) {\n\t /**\n\t\t\t * Either \"worker\" or \"timeout\"\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._type = type;\n\t /**\n\t\t\t * The update interval of the worker\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._updateInterval = updateInterval;\n\t /**\n\t\t\t * The callback to invoke at regular intervals\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._callback = Tone.defaultArg(callback, Tone.noOp);\n\t //create the clock source for the first time\n\t this._createClock();\n\t };\n\t /**\n\t\t * The possible ticker types\n\t\t * @private\n\t\t * @type {Object}\n\t\t */\n\t Ticker.Type = {\n\t Worker: 'worker',\n\t Timeout: 'timeout',\n\t Offline: 'offline'\n\t };\n\t /**\n\t\t * Generate a web worker\n\t\t * @return {WebWorker}\n\t\t * @private\n\t\t */\n\t Ticker.prototype._createWorker = function () {\n\t //URL Shim\n\t window.URL = window.URL || window.webkitURL;\n\t var blob = new Blob([//the initial timeout time\n\t 'var timeoutTime = ' + (this._updateInterval * 1000).toFixed(1) + ';' + //onmessage callback\n\t 'self.onmessage = function(msg){' + '\\ttimeoutTime = parseInt(msg.data);' + '};' + //the tick function which posts a message\n\t //and schedules a new tick\n\t 'function tick(){' + '\\tsetTimeout(tick, timeoutTime);' + '\\tself.postMessage(\\'tick\\');' + '}' + //call tick initially\n\t 'tick();']);\n\t var blobUrl = URL.createObjectURL(blob);\n\t var worker = new Worker(blobUrl);\n\t worker.onmessage = this._callback.bind(this);\n\t this._worker = worker;\n\t };\n\t /**\n\t\t * Create a timeout loop\n\t\t * @private\n\t\t */\n\t Ticker.prototype._createTimeout = function () {\n\t this._timeout = setTimeout(function () {\n\t this._createTimeout();\n\t this._callback();\n\t }.bind(this), this._updateInterval * 1000);\n\t };\n\t /**\n\t\t * Create the clock source.\n\t\t * @private\n\t\t */\n\t Ticker.prototype._createClock = function () {\n\t if (this._type === Ticker.Type.Worker) {\n\t try {\n\t this._createWorker();\n\t } catch (e) {\n\t // workers not supported, fallback to timeout\n\t this._type = Ticker.Type.Timeout;\n\t this._createClock();\n\t }\n\t } else if (this._type === Ticker.Type.Timeout) {\n\t this._createTimeout();\n\t }\n\t };\n\t /**\n\t\t * @memberOf Ticker#\n\t\t * @type {Number}\n\t\t * @name updateInterval\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Ticker.prototype, 'updateInterval', {\n\t get: function () {\n\t return this._updateInterval;\n\t },\n\t set: function (interval) {\n\t this._updateInterval = Math.max(interval, 128 / 44100);\n\t if (this._type === Ticker.Type.Worker) {\n\t this._worker.postMessage(Math.max(interval * 1000, 1));\n\t }\n\t }\n\t });\n\t /**\n\t\t * The type of the ticker, either a worker or a timeout\n\t\t * @memberOf Ticker#\n\t\t * @type {Number}\n\t\t * @name type\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Ticker.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t this._disposeClock();\n\t this._type = type;\n\t this._createClock();\n\t }\n\t });\n\t /**\n\t\t * Clean up the current clock source\n\t\t * @private\n\t\t */\n\t Ticker.prototype._disposeClock = function () {\n\t if (this._timeout) {\n\t clearTimeout(this._timeout);\n\t this._timeout = null;\n\t }\n\t if (this._worker) {\n\t this._worker.terminate();\n\t this._worker.onmessage = null;\n\t this._worker = null;\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @private\n\t\t */\n\t Ticker.prototype.dispose = function () {\n\t this._disposeClock();\n\t this._callback = null;\n\t };\n\t /**\n\t\t * Shim all connect/disconnect and some deprecated methods which are still in\n\t\t * some older implementations.\n\t\t * @private\n\t\t */\n\t Tone.getContext(function () {\n\t var nativeConnect = AudioNode.prototype.connect;\n\t var nativeDisconnect = AudioNode.prototype.disconnect;\n\t //replace the old connect method\n\t function toneConnect(B, outNum, inNum) {\n\t if (B.input) {\n\t inNum = Tone.defaultArg(inNum, 0);\n\t if (Tone.isArray(B.input)) {\n\t return this.connect(B.input[inNum]);\n\t } else {\n\t return this.connect(B.input, outNum, inNum);\n\t }\n\t } else {\n\t try {\n\t if (B instanceof AudioNode) {\n\t nativeConnect.call(this, B, outNum, inNum);\n\t return B;\n\t } else {\n\t nativeConnect.call(this, B, outNum);\n\t return B;\n\t }\n\t } catch (e) {\n\t throw new Error('error connecting to node: ' + B + '\\n' + e);\n\t }\n\t }\n\t }\n\t //replace the old disconnect method\n\t function toneDisconnect(B, outNum, inNum) {\n\t if (B && B.input && Tone.isArray(B.input)) {\n\t inNum = Tone.defaultArg(inNum, 0);\n\t this.disconnect(B.input[inNum], outNum, 0);\n\t } else if (B && B.input) {\n\t this.disconnect(B.input, outNum, inNum);\n\t } else {\n\t try {\n\t nativeDisconnect.apply(this, arguments);\n\t } catch (e) {\n\t throw new Error('error disconnecting node: ' + B + '\\n' + e);\n\t }\n\t }\n\t }\n\t if (AudioNode.prototype.connect !== toneConnect) {\n\t AudioNode.prototype.connect = toneConnect;\n\t AudioNode.prototype.disconnect = toneDisconnect;\n\t }\n\t });\n\t // set the audio context initially, and if one is not already created\n\t if (Tone.supported && !Tone.initialized) {\n\t Tone.context = new Tone.Context();\n\t // log on first initialization\n\t // allow optional silencing of this log\n\t if (!window.TONE_SILENCE_VERSION_LOGGING) {\n\t // eslint-disable-next-line no-console\n\t console.log('%c * Tone.js ' + Tone.version + ' * ', 'background: #000; color: #fff');\n\t }\n\t } else if (!Tone.supported) {\n\t // eslint-disable-next-line no-console\n\t console.warn('This browser does not support Tone.js');\n\t }\n\t return Tone.Context;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.AudioNode is the base class for classes which process audio.\n\t\t * AudioNodes have inputs and outputs.\n\t\t * @param\t{AudioContext=} context\tThe audio context to use with the class\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.AudioNode = function () {\n\t Tone.call(this);\n\t //use the default context if one is not passed in\n\t var options = Tone.defaults(arguments, ['context'], { 'context': Tone.context });\n\t /**\n\t\t\t * The AudioContext of this instance\n\t\t\t * @private\n\t\t\t * @type {AudioContext}\n\t\t\t */\n\t this._context = options.context;\n\t };\n\t Tone.extend(Tone.AudioNode);\n\t /**\n\t\t * Get the audio context belonging to this instance.\n\t\t * @type {Tone.Context}\n\t\t * @memberOf Tone.AudioNode#\n\t\t * @name context\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'context', {\n\t get: function () {\n\t return this._context;\n\t }\n\t });\n\t /**\n\t\t * Create input and outputs for this object.\n\t\t * @param {Number} [input=0] The number of inputs\n\t\t * @param {Number} [outputs=0] The number of outputs\n\t\t * @return {Tone.AudioNode} this\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype.createInsOuts = function (inputs, outputs) {\n\t if (inputs === 1) {\n\t this.input = this.context.createGain();\n\t } else if (inputs > 1) {\n\t this.input = new Array(inputs);\n\t }\n\t if (outputs === 1) {\n\t this.output = this.context.createGain();\n\t } else if (outputs > 1) {\n\t this.output = new Array(outputs);\n\t }\n\t };\n\t /**\n\t\t * channelCount is the number of channels used when up-mixing and down-mixing\n\t\t * connections to any inputs to the node. The default value is 2 except for\n\t\t * specific nodes where its value is specially determined.\n\t\t *\n\t\t * @memberof Tone.AudioNode#\n\t\t * @type {Number}\n\t\t * @name channelCount\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'channelCount', {\n\t get: function () {\n\t return this.output.channelCount;\n\t },\n\t set: function (c) {\n\t return this.output.channelCount = c;\n\t }\n\t });\n\t /**\n\t\t * channelCountMode determines how channels will be counted when up-mixing and\n\t\t * down-mixing connections to any inputs to the node.\n\t\t * The default value is \"max\". This attribute has no effect for nodes with no inputs.\n\t\t * @memberof Tone.AudioNode#\n\t\t * @type {String}\n\t\t * @name channelCountMode\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'channelCountMode', {\n\t get: function () {\n\t return this.output.channelCountMode;\n\t },\n\t set: function (m) {\n\t return this.output.channelCountMode = m;\n\t }\n\t });\n\t /**\n\t\t * channelInterpretation determines how individual channels will be treated\n\t\t * when up-mixing and down-mixing connections to any inputs to the node.\n\t\t * The default value is \"speakers\".\n\t\t * @memberof Tone.AudioNode#\n\t\t * @type {String}\n\t\t * @name channelInterpretation\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'channelInterpretation', {\n\t get: function () {\n\t return this.output.channelInterpretation;\n\t },\n\t set: function (i) {\n\t return this.output.channelInterpretation = i;\n\t }\n\t });\n\t /**\n\t\t * The number of inputs feeding into the AudioNode.\n\t\t * For source nodes, this will be 0.\n\t\t * @type {Number}\n\t\t * @name numberOfInputs\n\t\t * @memberof Tone.AudioNode#\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'numberOfInputs', {\n\t get: function () {\n\t if (this.input) {\n\t if (Tone.isArray(this.input)) {\n\t return this.input.length;\n\t } else {\n\t return 1;\n\t }\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of outputs coming out of the AudioNode.\n\t\t * @type {Number}\n\t\t * @name numberOfOutputs\n\t\t * @memberof Tone.AudioNode#\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.AudioNode.prototype, 'numberOfOutputs', {\n\t get: function () {\n\t if (this.output) {\n\t if (Tone.isArray(this.output)) {\n\t return this.output.length;\n\t } else {\n\t return 1;\n\t }\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Called when an audio param connects to this node\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype._onConnect = function () {\n\t };\n\t /**\n\t\t * connect the output of a ToneNode to an AudioParam, AudioNode, or ToneNode\n\t\t * @param {Tone | AudioParam | AudioNode} unit\n\t\t * @param {number} [outputNum=0] optionally which output to connect from\n\t\t * @param {number} [inputNum=0] optionally which input to connect to\n\t\t * @returns {Tone.AudioNode} this\n\t\t */\n\t Tone.AudioNode.prototype.connect = function (unit, outputNum, inputNum) {\n\t if (unit._onConnect) {\n\t unit._onConnect(this);\n\t }\n\t if (Tone.isArray(this.output)) {\n\t outputNum = Tone.defaultArg(outputNum, 0);\n\t this.output[outputNum].connect(unit, 0, inputNum);\n\t } else {\n\t this.output.connect(unit, outputNum, inputNum);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * disconnect the output\n\t\t * @param {Number|AudioNode} output Either the output index to disconnect\n\t\t * if the output is an array, or the\n\t\t * node to disconnect from.\n\t\t * @returns {Tone.AudioNode} this\n\t\t */\n\t Tone.AudioNode.prototype.disconnect = function (destination, outputNum, inputNum) {\n\t if (Tone.isArray(this.output)) {\n\t if (Tone.isNumber(destination)) {\n\t this.output[destination].disconnect();\n\t } else {\n\t outputNum = Tone.defaultArg(outputNum, 0);\n\t this.output[outputNum].disconnect(destination, 0, inputNum);\n\t }\n\t } else {\n\t this.output.disconnect.apply(this.output, arguments);\n\t }\n\t };\n\t /**\n\t\t * Connect the output of this node to the rest of the nodes in series.\n\t\t * @example\n\t\t * //connect a node to an effect, panVol and then to the master output\n\t\t * node.chain(effect, panVol, Tone.Master);\n\t\t * @param {...AudioParam|Tone|AudioNode} nodes\n\t\t * @returns {Tone.AudioNode} this\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype.chain = function () {\n\t var currentUnit = this;\n\t for (var i = 0; i < arguments.length; i++) {\n\t var toUnit = arguments[i];\n\t currentUnit.connect(toUnit);\n\t currentUnit = toUnit;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * connect the output of this node to the rest of the nodes in parallel.\n\t\t * @param {...AudioParam|Tone|AudioNode} nodes\n\t\t * @returns {Tone.AudioNode} this\n\t\t * @private\n\t\t */\n\t Tone.AudioNode.prototype.fan = function () {\n\t for (var i = 0; i < arguments.length; i++) {\n\t this.connect(arguments[i]);\n\t }\n\t return this;\n\t };\n\t if (window.AudioNode) {\n\t //give native nodes chain and fan methods\n\t AudioNode.prototype.chain = Tone.AudioNode.prototype.chain;\n\t AudioNode.prototype.fan = Tone.AudioNode.prototype.fan;\n\t }\n\t /**\n\t\t * Dispose and disconnect\n\t\t * @return {Tone.AudioNode} this\n\t\t */\n\t Tone.AudioNode.prototype.dispose = function () {\n\t if (Tone.isDefined(this.input)) {\n\t if (this.input instanceof AudioNode) {\n\t this.input.disconnect();\n\t }\n\t this.input = null;\n\t }\n\t if (Tone.isDefined(this.output)) {\n\t if (this.output instanceof AudioNode) {\n\t this.output.disconnect();\n\t }\n\t this.output = null;\n\t }\n\t this._context = null;\n\t return this;\n\t };\n\t return Tone.AudioNode;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for all Signals. Used Internally.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.SignalBase = function () {\n\t Tone.AudioNode.call(this);\n\t };\n\t Tone.extend(Tone.SignalBase, Tone.AudioNode);\n\t /**\n\t\t * When signals connect to other signals or AudioParams,\n\t\t * they take over the output value of that signal or AudioParam.\n\t\t * For all other nodes, the behavior is the same as a default <code>connect</code>.\n\t\t *\n\t\t * @override\n\t\t * @param {AudioParam|AudioNode|Tone.Signal|Tone} node\n\t\t * @param {number} [outputNumber=0] The output number to connect from.\n\t\t * @param {number} [inputNumber=0] The input number to connect to.\n\t\t * @returns {Tone.SignalBase} this\n\t\t */\n\t Tone.SignalBase.prototype.connect = function (node, outputNumber, inputNumber) {\n\t //zero it out so that the signal can have full control\n\t if (Tone.Signal && Tone.Signal === node.constructor || Tone.Param && Tone.Param === node.constructor) {\n\t //cancel changes\n\t node._param.cancelScheduledValues(0);\n\t //reset the value\n\t node._param.value = 0;\n\t //mark the value as overridden\n\t node.overridden = true;\n\t } else if (node instanceof AudioParam) {\n\t node.cancelScheduledValues(0);\n\t node.value = 0;\n\t }\n\t Tone.AudioNode.prototype.connect.call(this, node, outputNumber, inputNumber);\n\t return this;\n\t };\n\t return Tone.SignalBase;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t //fixes safari only bug which is still present in 11\n\t var ua = navigator.userAgent.toLowerCase();\n\t var isSafari = ua.includes('safari') && !ua.includes('chrome');\n\t if (isSafari) {\n\t var WaveShaperNode = function (context) {\n\t this._internalNode = this.input = this.output = context._native_createWaveShaper();\n\t this._curve = null;\n\t for (var prop in this._internalNode) {\n\t this._defineProperty(this._internalNode, prop);\n\t }\n\t };\n\t Object.defineProperty(WaveShaperNode.prototype, 'curve', {\n\t get: function () {\n\t return this._curve;\n\t },\n\t set: function (curve) {\n\t this._curve = curve;\n\t var array = new Float32Array(curve.length + 1);\n\t array.set(curve, 1);\n\t array[0] = curve[0];\n\t this._internalNode.curve = array;\n\t }\n\t });\n\t WaveShaperNode.prototype._defineProperty = function (context, prop) {\n\t if (Tone.isUndef(this[prop])) {\n\t Object.defineProperty(this, prop, {\n\t get: function () {\n\t if (typeof context[prop] === 'function') {\n\t return context[prop].bind(context);\n\t } else {\n\t return context[prop];\n\t }\n\t },\n\t set: function (val) {\n\t context[prop] = val;\n\t }\n\t });\n\t }\n\t };\n\t AudioContext.prototype._native_createWaveShaper = AudioContext.prototype.createWaveShaper;\n\t AudioContext.prototype.createWaveShaper = function () {\n\t return new WaveShaperNode(this);\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Wraps the native Web Audio API\n\t\t * [WaveShaperNode](http://webaudio.github.io/web-audio-api/#the-waveshapernode-interface).\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @param {function|Array|Number} mapping The function used to define the values.\n\t\t * The mapping function should take two arguments:\n\t\t * the first is the value at the current position\n\t\t * and the second is the array position.\n\t\t * If the argument is an array, that array will be\n\t\t * set as the wave shaping function. The input\n\t\t * signal is an AudioRange [-1, 1] value and the output\n\t\t * signal can take on any numerical values.\n\t\t *\n\t\t * @param {Number} [bufferLen=1024] The length of the WaveShaperNode buffer.\n\t\t * @example\n\t\t * var timesTwo = new Tone.WaveShaper(function(val){\n\t\t * \treturn val * 2;\n\t\t * }, 2048);\n\t\t * @example\n\t\t * //a waveshaper can also be constructed with an array of values\n\t\t * var invert = new Tone.WaveShaper([1, -1]);\n\t\t */\n\t Tone.WaveShaper = function (mapping, bufferLen) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * the waveshaper\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._shaper = this.input = this.output = this.context.createWaveShaper();\n\t /**\n\t\t\t * the waveshapers curve\n\t\t\t * @type {Float32Array}\n\t\t\t * @private\n\t\t\t */\n\t this._curve = null;\n\t if (Array.isArray(mapping)) {\n\t this.curve = mapping;\n\t } else if (isFinite(mapping) || Tone.isUndef(mapping)) {\n\t this._curve = new Float32Array(Tone.defaultArg(mapping, 1024));\n\t } else if (Tone.isFunction(mapping)) {\n\t this._curve = new Float32Array(Tone.defaultArg(bufferLen, 1024));\n\t this.setMap(mapping);\n\t }\n\t };\n\t Tone.extend(Tone.WaveShaper, Tone.SignalBase);\n\t /**\n\t\t * Uses a mapping function to set the value of the curve.\n\t\t * @param {function} mapping The function used to define the values.\n\t\t * The mapping function take two arguments:\n\t\t * the first is the value at the current position\n\t\t * which goes from -1 to 1 over the number of elements\n\t\t * in the curve array. The second argument is the array position.\n\t\t * @returns {Tone.WaveShaper} this\n\t\t * @example\n\t\t * //map the input signal from [-1, 1] to [0, 10]\n\t\t * shaper.setMap(function(val, index){\n\t\t * \treturn (val + 1) * 5;\n\t\t * })\n\t\t */\n\t Tone.WaveShaper.prototype.setMap = function (mapping) {\n\t var array = new Array(this._curve.length);\n\t for (var i = 0, len = this._curve.length; i < len; i++) {\n\t var normalized = i / (len - 1) * 2 - 1;\n\t array[i] = mapping(normalized, i);\n\t }\n\t this.curve = array;\n\t return this;\n\t };\n\t /**\n\t\t * The array to set as the waveshaper curve. For linear curves\n\t\t * array length does not make much difference, but for complex curves\n\t\t * longer arrays will provide smoother interpolation.\n\t\t * @memberOf Tone.WaveShaper#\n\t\t * @type {Array}\n\t\t * @name curve\n\t\t */\n\t Object.defineProperty(Tone.WaveShaper.prototype, 'curve', {\n\t get: function () {\n\t return this._shaper.curve;\n\t },\n\t set: function (mapping) {\n\t this._curve = new Float32Array(mapping);\n\t this._shaper.curve = this._curve;\n\t }\n\t });\n\t /**\n\t\t * Specifies what type of oversampling (if any) should be used when\n\t\t * applying the shaping curve. Can either be \"none\", \"2x\" or \"4x\".\n\t\t * @memberOf Tone.WaveShaper#\n\t\t * @type {string}\n\t\t * @name oversample\n\t\t */\n\t Object.defineProperty(Tone.WaveShaper.prototype, 'oversample', {\n\t get: function () {\n\t return this._shaper.oversample;\n\t },\n\t set: function (oversampling) {\n\t if ([\n\t 'none',\n\t '2x',\n\t '4x'\n\t ].includes(oversampling)) {\n\t this._shaper.oversample = oversampling;\n\t } else {\n\t throw new RangeError('Tone.WaveShaper: oversampling must be either \\'none\\', \\'2x\\', or \\'4x\\'');\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.WaveShaper} this\n\t\t */\n\t Tone.WaveShaper.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._shaper.disconnect();\n\t this._shaper = null;\n\t this._curve = null;\n\t return this;\n\t };\n\t return Tone.WaveShaper;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TimeBase is a flexible encoding of time\n\t\t * which can be evaluated to and from a string.\n\t\t * @extends {Tone}\n\t\t * @param {Time} val The time value as a number or string\n\t\t * @param {String=} units Unit values\n\t\t * @example\n\t\t * Tone.TimeBase(4, \"n\")\n\t\t * Tone.TimeBase(2, \"t\")\n\t\t * Tone.TimeBase(\"2t\")\n\t\t * Tone.TimeBase(\"2t\") + Tone.TimeBase(\"4n\");\n\t\t */\n\t Tone.TimeBase = function (val, units) {\n\t //allows it to be constructed with or without 'new'\n\t if (this instanceof Tone.TimeBase) {\n\t /**\n\t\t\t\t * The value\n\t\t\t\t * @type {Number|String|Tone.TimeBase}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._val = val;\n\t /**\n\t\t\t\t * The units\n\t\t\t\t * @type {String?}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._units = units;\n\t //test if the value is a string representation of a number\n\t if (Tone.isUndef(this._units) && Tone.isString(this._val) && // eslint-disable-next-line eqeqeq\n\t parseFloat(this._val) == this._val && this._val.charAt(0) !== '+') {\n\t this._val = parseFloat(this._val);\n\t this._units = this._defaultUnits;\n\t } else if (val && val.constructor === this.constructor) {\n\t //if they're the same type, just copy values over\n\t this._val = val._val;\n\t this._units = val._units;\n\t } else if (val instanceof Tone.TimeBase) {\n\t switch (this._defaultUnits) {\n\t case 's':\n\t this._val = val.toSeconds();\n\t break;\n\t case 'i':\n\t this._val = val.toTicks();\n\t break;\n\t case 'hz':\n\t this._val = val.toFrequency();\n\t break;\n\t case 'midi':\n\t this._val = val.toMidi();\n\t break;\n\t default:\n\t throw new Error('Unrecognized default units ' + this._defaultUnits);\n\t }\n\t }\n\t } else {\n\t return new Tone.TimeBase(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.TimeBase);\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tABSTRACT SYNTAX TREE PARSER\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * All the primary expressions.\n\t\t * @private\n\t\t * @type {Object}\n\t\t */\n\t Tone.TimeBase.prototype._expressions = {\n\t 'n': {\n\t regexp: /^(\\d+)n(\\.?)$/i,\n\t method: function (value, dot) {\n\t value = parseInt(value);\n\t var scalar = dot === '.' ? 1.5 : 1;\n\t if (value === 1) {\n\t return this._beatsToUnits(this._getTimeSignature()) * scalar;\n\t } else {\n\t return this._beatsToUnits(4 / value) * scalar;\n\t }\n\t }\n\t },\n\t 't': {\n\t regexp: /^(\\d+)t$/i,\n\t method: function (value) {\n\t value = parseInt(value);\n\t return this._beatsToUnits(8 / (parseInt(value) * 3));\n\t }\n\t },\n\t 'm': {\n\t regexp: /^(\\d+)m$/i,\n\t method: function (value) {\n\t return this._beatsToUnits(parseInt(value) * this._getTimeSignature());\n\t }\n\t },\n\t 'i': {\n\t regexp: /^(\\d+)i$/i,\n\t method: function (value) {\n\t return this._ticksToUnits(parseInt(value));\n\t }\n\t },\n\t 'hz': {\n\t regexp: /^(\\d+(?:\\.\\d+)?)hz$/i,\n\t method: function (value) {\n\t return this._frequencyToUnits(parseFloat(value));\n\t }\n\t },\n\t 'tr': {\n\t regexp: /^(\\d+(?:\\.\\d+)?):(\\d+(?:\\.\\d+)?):?(\\d+(?:\\.\\d+)?)?$/,\n\t method: function (m, q, s) {\n\t var total = 0;\n\t if (m && m !== '0') {\n\t total += this._beatsToUnits(this._getTimeSignature() * parseFloat(m));\n\t }\n\t if (q && q !== '0') {\n\t total += this._beatsToUnits(parseFloat(q));\n\t }\n\t if (s && s !== '0') {\n\t total += this._beatsToUnits(parseFloat(s) / 4);\n\t }\n\t return total;\n\t }\n\t },\n\t 's': {\n\t regexp: /^(\\d+(?:\\.\\d+)?)s$/,\n\t method: function (value) {\n\t return this._secondsToUnits(parseFloat(value));\n\t }\n\t },\n\t 'samples': {\n\t regexp: /^(\\d+)samples$/,\n\t method: function (value) {\n\t return parseInt(value) / this.context.sampleRate;\n\t }\n\t },\n\t 'default': {\n\t regexp: /^(\\d+(?:\\.\\d+)?)$/,\n\t method: function (value) {\n\t return this._expressions[this._defaultUnits].method.call(this, value);\n\t }\n\t }\n\t };\n\t /**\n\t\t * The default units if none are given.\n\t\t * @type {String}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._defaultUnits = 's';\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTRANSPORT FALLBACKS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Return the bpm, or 120 if Transport is not available\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._getBpm = function () {\n\t if (Tone.Transport) {\n\t return Tone.Transport.bpm.value;\n\t } else {\n\t return 120;\n\t }\n\t };\n\t /**\n\t\t * Return the timeSignature or 4 if Transport is not available\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._getTimeSignature = function () {\n\t if (Tone.Transport) {\n\t return Tone.Transport.timeSignature;\n\t } else {\n\t return 4;\n\t }\n\t };\n\t /**\n\t\t * Return the PPQ or 192 if Transport is not available\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._getPPQ = function () {\n\t if (Tone.Transport) {\n\t return Tone.Transport.PPQ;\n\t } else {\n\t return 192;\n\t }\n\t };\n\t /**\n\t\t * Return the current time in whichever context is relevant\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._now = function () {\n\t return this.now();\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tUNIT CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Returns the value of a frequency in the current units\n\t\t * @param {Frequency} freq\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._frequencyToUnits = function (freq) {\n\t return 1 / freq;\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._beatsToUnits = function (beats) {\n\t return 60 / this._getBpm() * beats;\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._secondsToUnits = function (seconds) {\n\t return seconds;\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._ticksToUnits = function (ticks) {\n\t return ticks * (this._beatsToUnits(1) / this._getPPQ());\n\t };\n\t /**\n\t\t * With no arguments, return 'now'\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.TimeBase.prototype._noArg = function () {\n\t return this._now();\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tEXPRESSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Evaluate the time value. Returns the time\n\t\t * in seconds.\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.TimeBase.prototype.valueOf = function () {\n\t if (Tone.isUndef(this._val)) {\n\t return this._noArg();\n\t } else if (Tone.isString(this._val) && Tone.isUndef(this._units)) {\n\t for (var units in this._expressions) {\n\t if (this._expressions[units].regexp.test(this._val.trim())) {\n\t this._units = units;\n\t break;\n\t }\n\t }\n\t }\n\t if (Tone.isDefined(this._units)) {\n\t var expr = this._expressions[this._units];\n\t var matching = this._val.toString().trim().match(expr.regexp);\n\t if (matching) {\n\t return expr.method.apply(this, matching.slice(1));\n\t } else {\n\t return expr.method.call(this, parseFloat(this._val));\n\t }\n\t } else {\n\t return this._val;\n\t }\n\t };\n\t /**\n\t\t * Return the value in seconds\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.TimeBase.prototype.toSeconds = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the value in hertz\n\t\t * @return {Frequency}\n\t\t */\n\t Tone.TimeBase.prototype.toFrequency = function () {\n\t return 1 / this.toSeconds();\n\t };\n\t /**\n\t\t * Return the time in samples\n\t\t * @return {Samples}\n\t\t */\n\t Tone.TimeBase.prototype.toSamples = function () {\n\t return this.toSeconds() * this.context.sampleRate;\n\t };\n\t /**\n\t\t * Return the time in milliseconds.\n\t\t * @return {Milliseconds}\n\t\t */\n\t Tone.TimeBase.prototype.toMilliseconds = function () {\n\t return this.toSeconds() * 1000;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.TimeBase} this\n\t\t */\n\t Tone.TimeBase.prototype.dispose = function () {\n\t this._val = null;\n\t this._units = null;\n\t };\n\t return Tone.TimeBase;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Frequency is a primitive type for encoding Frequency values.\n\t\t * Eventually all time values are evaluated to hertz\n\t\t * using the `eval` method.\n\t\t * @constructor\n\t\t * @extends {Tone.TimeBase}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * Tone.Frequency(\"C3\") // 261\n\t\t * Tone.Frequency(38, \"midi\") //\n\t\t * Tone.Frequency(\"C3\").transpose(4);\n\t\t */\n\t Tone.Frequency = function (val, units) {\n\t if (this instanceof Tone.Frequency) {\n\t Tone.TimeBase.call(this, val, units);\n\t } else {\n\t return new Tone.Frequency(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Frequency, Tone.TimeBase);\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tAUGMENT BASE EXPRESSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t Tone.Frequency.prototype._expressions = Object.assign({}, Tone.TimeBase.prototype._expressions, {\n\t 'midi': {\n\t regexp: /^(\\d+(?:\\.\\d+)?midi)/,\n\t method: function (value) {\n\t if (this._defaultUnits === 'midi') {\n\t return value;\n\t } else {\n\t return Tone.Frequency.mtof(value);\n\t }\n\t }\n\t },\n\t 'note': {\n\t regexp: /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,\n\t method: function (pitch, octave) {\n\t var index = noteToScaleIndex[pitch.toLowerCase()];\n\t var noteNumber = index + (parseInt(octave) + 1) * 12;\n\t if (this._defaultUnits === 'midi') {\n\t return noteNumber;\n\t } else {\n\t return Tone.Frequency.mtof(noteNumber);\n\t }\n\t }\n\t },\n\t 'tr': {\n\t regexp: /^(\\d+(?:\\.\\d+)?):(\\d+(?:\\.\\d+)?):?(\\d+(?:\\.\\d+)?)?/,\n\t method: function (m, q, s) {\n\t var total = 1;\n\t if (m && m !== '0') {\n\t total *= this._beatsToUnits(this._getTimeSignature() * parseFloat(m));\n\t }\n\t if (q && q !== '0') {\n\t total *= this._beatsToUnits(parseFloat(q));\n\t }\n\t if (s && s !== '0') {\n\t total *= this._beatsToUnits(parseFloat(s) / 4);\n\t }\n\t return total;\n\t }\n\t }\n\t });\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tEXPRESSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Transposes the frequency by the given number of semitones.\n\t\t * @param {Interval} interval\n\t\t * @return {Tone.Frequency} A new transposed frequency\n\t\t * @example\n\t\t * Tone.Frequency(\"A4\").transpose(3); //\"C5\"\n\t\t */\n\t Tone.Frequency.prototype.transpose = function (interval) {\n\t return new this.constructor(this.valueOf() * Tone.intervalToFrequencyRatio(interval));\n\t };\n\t /**\n\t\t * Takes an array of semitone intervals and returns\n\t\t * an array of frequencies transposed by those intervals.\n\t\t * @param {Array} intervals\n\t\t * @return {Array<Tone.Frequency>} Returns an array of Frequencies\n\t\t * @example\n\t\t * Tone.Frequency(\"A4\").harmonize([0, 3, 7]); //[\"A4\", \"C5\", \"E5\"]\n\t\t */\n\t Tone.Frequency.prototype.harmonize = function (intervals) {\n\t return intervals.map(function (interval) {\n\t return this.transpose(interval);\n\t }.bind(this));\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tUNIT CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Return the value of the frequency as a MIDI note\n\t\t * @return {MIDI}\n\t\t * @example\n\t\t * Tone.Frequency(\"C4\").toMidi(); //60\n\t\t */\n\t Tone.Frequency.prototype.toMidi = function () {\n\t return Tone.Frequency.ftom(this.valueOf());\n\t };\n\t /**\n\t\t * Return the value of the frequency in Scientific Pitch Notation\n\t\t * @return {Note}\n\t\t * @example\n\t\t * Tone.Frequency(69, \"midi\").toNote(); //\"A4\"\n\t\t */\n\t Tone.Frequency.prototype.toNote = function () {\n\t var freq = this.toFrequency();\n\t var log = Math.log2(freq / Tone.Frequency.A4);\n\t var noteNumber = Math.round(12 * log) + 57;\n\t var octave = Math.floor(noteNumber / 12);\n\t if (octave < 0) {\n\t noteNumber += -12 * octave;\n\t }\n\t var noteName = scaleIndexToNote[noteNumber % 12];\n\t return noteName + octave.toString();\n\t };\n\t /**\n\t\t * Return the duration of one cycle in seconds.\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.Frequency.prototype.toSeconds = function () {\n\t return 1 / Tone.TimeBase.prototype.toSeconds.call(this);\n\t };\n\t /**\n\t\t * Return the value in Hertz\n\t\t * @return {Frequency}\n\t\t */\n\t Tone.Frequency.prototype.toFrequency = function () {\n\t return Tone.TimeBase.prototype.toFrequency.call(this);\n\t };\n\t /**\n\t\t * Return the duration of one cycle in ticks\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Frequency.prototype.toTicks = function () {\n\t var quarterTime = this._beatsToUnits(1);\n\t var quarters = this.valueOf() / quarterTime;\n\t return Math.floor(quarters * Tone.Transport.PPQ);\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tUNIT CONVERSIONS HELPERS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * With no arguments, return 0\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._noArg = function () {\n\t return 0;\n\t };\n\t /**\n\t\t * Returns the value of a frequency in the current units\n\t\t * @param {Frequency} freq\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._frequencyToUnits = function (freq) {\n\t return freq;\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._ticksToUnits = function (ticks) {\n\t return 1 / (ticks * 60 / (Tone.Transport.bpm.value * Tone.Transport.PPQ));\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._beatsToUnits = function (beats) {\n\t return 1 / Tone.TimeBase.prototype._beatsToUnits.call(this, beats);\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._secondsToUnits = function (seconds) {\n\t return 1 / seconds;\n\t };\n\t /**\n\t\t * The default units if none are given.\n\t\t * @private\n\t\t */\n\t Tone.Frequency.prototype._defaultUnits = 'hz';\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tFREQUENCY CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Note to scale index\n\t\t * @type {Object}\n\t\t */\n\t var noteToScaleIndex = {\n\t 'cbb': -2,\n\t 'cb': -1,\n\t 'c': 0,\n\t 'c#': 1,\n\t 'cx': 2,\n\t 'dbb': 0,\n\t 'db': 1,\n\t 'd': 2,\n\t 'd#': 3,\n\t 'dx': 4,\n\t 'ebb': 2,\n\t 'eb': 3,\n\t 'e': 4,\n\t 'e#': 5,\n\t 'ex': 6,\n\t 'fbb': 3,\n\t 'fb': 4,\n\t 'f': 5,\n\t 'f#': 6,\n\t 'fx': 7,\n\t 'gbb': 5,\n\t 'gb': 6,\n\t 'g': 7,\n\t 'g#': 8,\n\t 'gx': 9,\n\t 'abb': 7,\n\t 'ab': 8,\n\t 'a': 9,\n\t 'a#': 10,\n\t 'ax': 11,\n\t 'bbb': 9,\n\t 'bb': 10,\n\t 'b': 11,\n\t 'b#': 12,\n\t 'bx': 13\n\t };\n\t /**\n\t\t * scale index to note (sharps)\n\t\t * @type {Array}\n\t\t */\n\t var scaleIndexToNote = [\n\t 'C',\n\t 'C#',\n\t 'D',\n\t 'D#',\n\t 'E',\n\t 'F',\n\t 'F#',\n\t 'G',\n\t 'G#',\n\t 'A',\n\t 'A#',\n\t 'B'\n\t ];\n\t /**\n\t\t * The [concert pitch](https://en.wikipedia.org/wiki/Concert_pitch)\n\t\t * A4's values in Hertz.\n\t\t * @type {Frequency}\n\t\t * @static\n\t\t */\n\t Tone.Frequency.A4 = 440;\n\t /**\n\t\t * Convert a MIDI note to frequency value.\n\t\t * @param {MIDI} midi The midi number to convert.\n\t\t * @return {Frequency} the corresponding frequency value\n\t\t * @static\n\t\t * @example\n\t\t * Tone.Frequency.mtof(69); // returns 440\n\t\t */\n\t Tone.Frequency.mtof = function (midi) {\n\t return Tone.Frequency.A4 * Math.pow(2, (midi - 69) / 12);\n\t };\n\t /**\n\t\t * Convert a frequency value to a MIDI note.\n\t\t * @param {Frequency} frequency The value to frequency value to convert.\n\t\t * @returns {MIDI}\n\t\t * @static\n\t\t * @example\n\t\t * Tone.Frequency.ftom(440); // returns 69\n\t\t */\n\t Tone.Frequency.ftom = function (frequency) {\n\t return 69 + Math.round(12 * Math.log2(frequency / Tone.Frequency.A4));\n\t };\n\t return Tone.Frequency;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Time is a primitive type for encoding Time values.\n\t\t * Tone.Time can be constructed with or without the `new` keyword. Tone.Time can be passed\n\t\t * into the parameter of any method which takes time as an argument.\n\t\t * @constructor\n\t\t * @extends {Tone.TimeBase}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * var t = Tone.Time(\"4n\");//a quarter note\n\t\t */\n\t Tone.Time = function (val, units) {\n\t if (this instanceof Tone.Time) {\n\t Tone.TimeBase.call(this, val, units);\n\t } else {\n\t return new Tone.Time(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Time, Tone.TimeBase);\n\t /**\n\t\t * Extend the base expressions\n\t\t */\n\t Tone.Time.prototype._expressions = Object.assign({}, Tone.TimeBase.prototype._expressions, {\n\t 'quantize': {\n\t regexp: /^@(.+)/,\n\t method: function (capture) {\n\t if (Tone.Transport) {\n\t var quantTo = new this.constructor(capture);\n\t return Tone.Transport.nextSubdivision(quantTo);\n\t } else {\n\t return 0;\n\t }\n\t }\n\t },\n\t 'now': {\n\t regexp: /^\\+(.+)/,\n\t method: function (capture) {\n\t return this._now() + new this.constructor(capture);\n\t }\n\t }\n\t });\n\t /**\n\t\t * Quantize the time by the given subdivision. Optionally add a\n\t\t * percentage which will move the time value towards the ideal\n\t\t * quantized value by that percentage.\n\t\t * @param {Number|Time} val The subdivision to quantize to\n\t\t * @param {NormalRange} [percent=1] Move the time value\n\t\t * towards the quantized value by\n\t\t * a percentage.\n\t\t * @return {Number} this\n\t\t * @example\n\t\t * Tone.Time(21).quantize(2) //returns 22\n\t\t * Tone.Time(0.6).quantize(\"4n\", 0.5) //returns 0.55\n\t\t */\n\t Tone.Time.prototype.quantize = function (subdiv, percent) {\n\t percent = Tone.defaultArg(percent, 1);\n\t var subdivision = new this.constructor(subdiv);\n\t var value = this.valueOf();\n\t var multiple = Math.round(value / subdivision);\n\t var ideal = multiple * subdivision;\n\t var diff = ideal - value;\n\t return value + diff * percent;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // CONVERSIONS\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Convert a Time to Notation. The notation values are will be the\n\t\t * closest representation between 1m to 128th note.\n\t\t * @return {Notation}\n\t\t * @example\n\t\t * //if the Transport is at 120bpm:\n\t\t * Tone.Time(2).toNotation();//returns \"1m\"\n\t\t */\n\t Tone.Time.prototype.toNotation = function () {\n\t var time = this.toSeconds();\n\t var testNotations = ['1m'];\n\t for (var power = 1; power < 8; power++) {\n\t var subdiv = Math.pow(2, power);\n\t testNotations.push(subdiv + 'n.');\n\t testNotations.push(subdiv + 'n');\n\t testNotations.push(subdiv + 't');\n\t }\n\t testNotations.push('0');\n\t //find the closets notation representation\n\t var closest = testNotations[0];\n\t var closestSeconds = Tone.Time(testNotations[0]).toSeconds();\n\t testNotations.forEach(function (notation) {\n\t var notationSeconds = Tone.Time(notation).toSeconds();\n\t if (Math.abs(notationSeconds - time) < Math.abs(closestSeconds - time)) {\n\t closest = notation;\n\t closestSeconds = notationSeconds;\n\t }\n\t });\n\t return closest;\n\t };\n\t /**\n\t\t * Return the time encoded as Bars:Beats:Sixteenths.\n\t\t * @return {BarsBeatsSixteenths}\n\t\t */\n\t Tone.Time.prototype.toBarsBeatsSixteenths = function () {\n\t var quarterTime = this._beatsToUnits(1);\n\t var quarters = this.valueOf() / quarterTime;\n\t var measures = Math.floor(quarters / this._getTimeSignature());\n\t var sixteenths = quarters % 1 * 4;\n\t quarters = Math.floor(quarters) % this._getTimeSignature();\n\t sixteenths = sixteenths.toString();\n\t if (sixteenths.length > 3) {\n\t // the additional parseFloat removes insignificant trailing zeroes\n\t sixteenths = parseFloat(parseFloat(sixteenths).toFixed(3));\n\t }\n\t var progress = [\n\t measures,\n\t quarters,\n\t sixteenths\n\t ];\n\t return progress.join(':');\n\t };\n\t /**\n\t\t * Return the time in ticks.\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Time.prototype.toTicks = function () {\n\t var quarterTime = this._beatsToUnits(1);\n\t var quarters = this.valueOf() / quarterTime;\n\t return Math.round(quarters * this._getPPQ());\n\t };\n\t /**\n\t\t * Return the time in seconds.\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.Time.prototype.toSeconds = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the value as a midi note.\n\t\t * @return {Midi}\n\t\t */\n\t Tone.Time.prototype.toMidi = function () {\n\t return Tone.Frequency.ftom(this.toFrequency());\n\t };\n\t return Tone.Time;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportTime is a the time along the Transport's\n\t\t * timeline. It is similar to Tone.Time, but instead of evaluating\n\t\t * against the AudioContext's clock, it is evaluated against\n\t\t * the Transport's position. See [TransportTime wiki](https://github.com/Tonejs/Tone.js/wiki/TransportTime).\n\t\t * @constructor\n\t\t * @param {Time} val The time value as a number or string\n\t\t * @param {String=} units Unit values\n\t\t * @extends {Tone.Time}\n\t\t */\n\t Tone.TransportTime = function (val, units) {\n\t if (this instanceof Tone.TransportTime) {\n\t Tone.Time.call(this, val, units);\n\t } else {\n\t return new Tone.TransportTime(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.TransportTime, Tone.Time);\n\t /**\n\t\t * Return the current time in whichever context is relevant\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.TransportTime.prototype._now = function () {\n\t return Tone.Transport.seconds;\n\t };\n\t return Tone.TransportTime;\n\t});\n\tModule(function (Tone) {\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tTYPES\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Units which a value can take on.\n\t\t * @enum {String}\n\t\t */\n\t Tone.Type = {\n\t /**\n\t\t\t * Default units\n\t\t\t * @typedef {Default}\n\t\t\t */\n\t Default: 'number',\n\t /**\n\t\t\t * Time can be described in a number of ways. Read more [Time](https://github.com/Tonejs/Tone.js/wiki/Time).\n\t\t\t *\n\t\t\t * * Numbers, which will be taken literally as the time (in seconds).\n\t\t\t * * Notation, (\"4n\", \"8t\") describes time in BPM and time signature relative values.\n\t\t\t * * TransportTime, (\"4:3:2\") will also provide tempo and time signature relative times\n\t\t\t * in the form BARS:QUARTERS:SIXTEENTHS.\n\t\t\t * * Frequency, (\"8hz\") is converted to the length of the cycle in seconds.\n\t\t\t * * Now-Relative, (\"+1\") prefix any of the above with \"+\" and it will be interpreted as\n\t\t\t * \"the current time plus whatever expression follows\".\n\t\t\t * * Expressions, (\"3:0 + 2 - (1m / 7)\") any of the above can also be combined\n\t\t\t * into a mathematical expression which will be evaluated to compute the desired time.\n\t\t\t * * No Argument, for methods which accept time, no argument will be interpreted as\n\t\t\t * \"now\" (i.e. the currentTime).\n\t\t\t *\n\t\t\t * @typedef {Time}\n\t\t\t */\n\t Time: 'time',\n\t /**\n\t\t\t * Frequency can be described similar to time, except ultimately the\n\t\t\t * values are converted to frequency instead of seconds. A number\n\t\t\t * is taken literally as the value in hertz. Additionally any of the\n\t\t\t * Time encodings can be used. Note names in the form\n\t\t\t * of NOTE OCTAVE (i.e. C4) are also accepted and converted to their\n\t\t\t * frequency value.\n\t\t\t * @typedef {Frequency}\n\t\t\t */\n\t Frequency: 'frequency',\n\t /**\n\t\t\t * TransportTime describes a position along the Transport's timeline. It is\n\t\t\t * similar to Time in that it uses all the same encodings, but TransportTime specifically\n\t\t\t * pertains to the Transport's timeline, which is startable, stoppable, loopable, and seekable.\n\t\t\t * [Read more](https://github.com/Tonejs/Tone.js/wiki/TransportTime)\n\t\t\t * @typedef {TransportTime}\n\t\t\t */\n\t TransportTime: 'transportTime',\n\t /**\n\t\t\t * Ticks are the basic subunit of the Transport. They are\n\t\t\t * the smallest unit of time that the Transport supports.\n\t\t\t * @typedef {Ticks}\n\t\t\t */\n\t Ticks: 'ticks',\n\t /**\n\t\t\t * Normal values are within the range [0, 1].\n\t\t\t * @typedef {NormalRange}\n\t\t\t */\n\t NormalRange: 'normalRange',\n\t /**\n\t\t\t * AudioRange values are between [-1, 1].\n\t\t\t * @typedef {AudioRange}\n\t\t\t */\n\t AudioRange: 'audioRange',\n\t /**\n\t\t\t * Decibels are a logarithmic unit of measurement which is useful for volume\n\t\t\t * because of the logarithmic way that we perceive loudness. 0 decibels\n\t\t\t * means no change in volume. -10db is approximately half as loud and 10db\n\t\t\t * is twice is loud.\n\t\t\t * @typedef {Decibels}\n\t\t\t */\n\t Decibels: 'db',\n\t /**\n\t\t\t * Half-step note increments, i.e. 12 is an octave above the root. and 1 is a half-step up.\n\t\t\t * @typedef {Interval}\n\t\t\t */\n\t Interval: 'interval',\n\t /**\n\t\t\t * Beats per minute.\n\t\t\t * @typedef {BPM}\n\t\t\t */\n\t BPM: 'bpm',\n\t /**\n\t\t\t * The value must be greater than or equal to 0.\n\t\t\t * @typedef {Positive}\n\t\t\t */\n\t Positive: 'positive',\n\t /**\n\t\t\t * Gain is the ratio between input and output of a signal.\n\t\t\t * A gain of 0 is the same as silencing the signal. A gain of\n\t\t\t * 1, causes no change to the incoming signal.\n\t\t\t * @typedef {Gain}\n\t\t\t */\n\t Gain: 'gain',\n\t /**\n\t\t\t * A cent is a hundredth of a semitone.\n\t\t\t * @typedef {Cents}\n\t\t\t */\n\t Cents: 'cents',\n\t /**\n\t\t\t * Angle between 0 and 360.\n\t\t\t * @typedef {Degrees}\n\t\t\t */\n\t Degrees: 'degrees',\n\t /**\n\t\t\t * A number representing a midi note.\n\t\t\t * @typedef {MIDI}\n\t\t\t */\n\t MIDI: 'midi',\n\t /**\n\t\t\t * A colon-separated representation of time in the form of\n\t\t\t * Bars:Beats:Sixteenths.\n\t\t\t * @typedef {BarsBeatsSixteenths}\n\t\t\t */\n\t BarsBeatsSixteenths: 'barsBeatsSixteenths',\n\t /**\n\t\t\t * Sampling is the reduction of a continuous signal to a discrete signal.\n\t\t\t * Audio is typically sampled 44100 times per second.\n\t\t\t * @typedef {Samples}\n\t\t\t */\n\t Samples: 'samples',\n\t /**\n\t\t\t * Hertz are a frequency representation defined as one cycle per second.\n\t\t\t * @typedef {Hertz}\n\t\t\t */\n\t Hertz: 'hertz',\n\t /**\n\t\t\t * A frequency represented by a letter name,\n\t\t\t * accidental and octave. This system is known as\n\t\t\t * [Scientific Pitch Notation](https://en.wikipedia.org/wiki/Scientific_pitch_notation).\n\t\t\t * @typedef {Note}\n\t\t\t */\n\t Note: 'note',\n\t /**\n\t\t\t * One millisecond is a thousandth of a second.\n\t\t\t * @typedef {Milliseconds}\n\t\t\t */\n\t Milliseconds: 'milliseconds',\n\t /**\n\t\t\t * Seconds are the time unit of the AudioContext. In the end,\n\t\t\t * all values need to be evaluated to seconds.\n\t\t\t * @typedef {Seconds}\n\t\t\t */\n\t Seconds: 'seconds',\n\t /**\n\t\t\t * A string representing a duration relative to a measure.\n\t\t\t * * \"4n\" = quarter note\n\t\t\t * * \"2m\" = two measures\n\t\t\t * * \"8t\" = eighth-note triplet\n\t\t\t * @typedef {Notation}\n\t\t\t */\n\t Notation: 'notation'\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // AUGMENT TONE's PROTOTYPE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Convert Time into seconds.\n\t\t *\n\t\t * Unlike the method which it overrides, this takes into account\n\t\t * transporttime and musical notation.\n\t\t *\n\t\t * Time : 1.40\n\t\t * Notation: 4n or 1m or 2t\n\t\t * Now Relative: +3n\n\t\t * Math: 3n+16n or even complicated expressions ((3n*2)/6 + 1)\n\t\t *\n\t\t * @param {Time} time\n\t\t * @return {Seconds}\n\t\t */\n\t Tone.prototype.toSeconds = function (time) {\n\t if (Tone.isNumber(time)) {\n\t return time;\n\t } else if (Tone.isUndef(time)) {\n\t return this.now();\n\t } else if (Tone.isString(time)) {\n\t return new Tone.Time(time).toSeconds();\n\t } else if (time instanceof Tone.TimeBase) {\n\t return time.toSeconds();\n\t }\n\t };\n\t /**\n\t\t * Convert a frequency representation into a number.\n\t\t * @param {Frequency} freq\n\t\t * @return {Hertz} the frequency in hertz\n\t\t */\n\t Tone.prototype.toFrequency = function (freq) {\n\t if (Tone.isNumber(freq)) {\n\t return freq;\n\t } else if (Tone.isString(freq) || Tone.isUndef(freq)) {\n\t return new Tone.Frequency(freq).valueOf();\n\t } else if (freq instanceof Tone.TimeBase) {\n\t return freq.toFrequency();\n\t }\n\t };\n\t /**\n\t\t * Convert a time representation into ticks.\n\t\t * @param {Time} time\n\t\t * @return {Ticks} the time in ticks\n\t\t */\n\t Tone.prototype.toTicks = function (time) {\n\t if (Tone.isNumber(time) || Tone.isString(time)) {\n\t return new Tone.TransportTime(time).toTicks();\n\t } else if (Tone.isUndef(time)) {\n\t return Tone.Transport.ticks;\n\t } else if (time instanceof Tone.TimeBase) {\n\t return time.toTicks();\n\t }\n\t };\n\t return Tone;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Param wraps the native Web Audio's AudioParam to provide\n\t\t * additional unit conversion functionality. It also\n\t\t * serves as a base-class for classes which have a single,\n\t\t * automatable parameter.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {AudioParam} param The parameter to wrap.\n\t\t * @param {Tone.Type} units The units of the audio param.\n\t\t * @param {Boolean} convert If the param should be converted.\n\t\t */\n\t Tone.Param = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'param',\n\t 'units',\n\t 'convert'\n\t ], Tone.Param);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The native parameter to control\n\t\t\t * @type {AudioParam}\n\t\t\t * @private\n\t\t\t */\n\t this._param = this.input = options.param;\n\t /**\n\t\t\t * The units of the parameter\n\t\t\t * @type {Tone.Type}\n\t\t\t */\n\t this.units = options.units;\n\t /**\n\t\t\t * If the value should be converted or not\n\t\t\t * @type {Boolean}\n\t\t\t */\n\t this.convert = options.convert;\n\t /**\n\t\t\t * True if the signal value is being overridden by\n\t\t\t * a connected signal.\n\t\t\t * @readOnly\n\t\t\t * @type {boolean}\n\t\t\t * @private\n\t\t\t */\n\t this.overridden = false;\n\t /**\n\t\t\t * The timeline which tracks all of the automations.\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._events = new Tone.Timeline(1000);\n\t if (Tone.isDefined(options.value) && this._param) {\n\t this.value = options.value;\n\t }\n\t };\n\t Tone.extend(Tone.Param, Tone.AudioNode);\n\t /**\n\t\t * Defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Param.defaults = {\n\t 'units': Tone.Type.Default,\n\t 'convert': true,\n\t 'param': undefined\n\t };\n\t /**\n\t\t * The current value of the parameter.\n\t\t * @memberOf Tone.Param#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Param.prototype, 'value', {\n\t get: function () {\n\t var now = this.now();\n\t return this._toUnits(this.getValueAtTime(now));\n\t },\n\t set: function (value) {\n\t this._initialValue = this._fromUnits(value);\n\t this.cancelScheduledValues(this.context.currentTime);\n\t this.setValueAtTime(value, this.context.currentTime);\n\t }\n\t });\n\t /**\n\t\t * The minimum output value of the parameter\n\t\t * @memberOf Tone.Param#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Param.prototype, 'minValue', {\n\t get: function () {\n\t if (this.units === Tone.Type.Time || this.units === Tone.Type.Frequency || this.units === Tone.Type.NormalRange || this.units === Tone.Type.Positive || this.units === Tone.Type.BPM) {\n\t return 0;\n\t } else if (this.units === Tone.Type.AudioRange) {\n\t return -1;\n\t } else if (this.units === Tone.Type.Decibels) {\n\t return -Infinity;\n\t } else {\n\t return this._param.minValue;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The maximum output value of the parameter\n\t\t * @memberOf Tone.Param#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Param.prototype, 'maxValue', {\n\t get: function () {\n\t if (this.units === Tone.Type.NormalRange || this.units === Tone.Type.AudioRange) {\n\t return 1;\n\t } else {\n\t return this._param.maxValue;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Convert the given value from the type specified by Tone.Param.units\n\t\t * into the destination value (such as Gain or Frequency).\n\t\t * @private\n\t\t * @param {*} val the value to convert\n\t\t * @return {number} the number which the value should be set to\n\t\t */\n\t Tone.Param.prototype._fromUnits = function (val) {\n\t if ((this.convert || Tone.isUndef(this.convert)) && !this.overridden) {\n\t switch (this.units) {\n\t case Tone.Type.Time:\n\t return this.toSeconds(val);\n\t case Tone.Type.Frequency:\n\t return this.toFrequency(val);\n\t case Tone.Type.Decibels:\n\t return Tone.dbToGain(val);\n\t case Tone.Type.NormalRange:\n\t return Math.min(Math.max(val, 0), 1);\n\t case Tone.Type.AudioRange:\n\t return Math.min(Math.max(val, -1), 1);\n\t case Tone.Type.Positive:\n\t return Math.max(val, 0);\n\t default:\n\t return val;\n\t }\n\t } else {\n\t return val;\n\t }\n\t };\n\t /**\n\t\t * Convert the parameters value into the units specified by Tone.Param.units.\n\t\t * @private\n\t\t * @param {number} val the value to convert\n\t\t * @return {number}\n\t\t */\n\t Tone.Param.prototype._toUnits = function (val) {\n\t if (this.convert || Tone.isUndef(this.convert)) {\n\t switch (this.units) {\n\t case Tone.Type.Decibels:\n\t return Tone.gainToDb(val);\n\t default:\n\t return val;\n\t }\n\t } else {\n\t return val;\n\t }\n\t };\n\t /**\n\t\t * the minimum output value\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.Param.prototype._minOutput = 0.00001;\n\t /**\n\t\t * The event types\n\t\t * @enum {String}\n\t\t * @private\n\t\t */\n\t Tone.Param.AutomationType = {\n\t Linear: 'linearRampToValueAtTime',\n\t Exponential: 'exponentialRampToValueAtTime',\n\t Target: 'setTargetAtTime',\n\t SetValue: 'setValueAtTime'\n\t };\n\t /**\n\t\t * Schedules a parameter value change at the given time.\n\t\t * @param {*}\tvalue The value to set the signal.\n\t\t * @param {Time} time The time when the change should occur.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //set the frequency to \"G4\" in exactly 1 second from now.\n\t\t * freq.setValueAtTime(\"G4\", \"+1\");\n\t\t */\n\t Tone.Param.prototype.setValueAtTime = function (value, time) {\n\t time = this.toSeconds(time);\n\t value = this._fromUnits(value);\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.SetValue,\n\t 'value': value,\n\t 'time': time\n\t });\n\t this._param.setValueAtTime(value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the signals value at the given time. Subsequent scheduling\n\t\t * may invalidate the returned value.\n\t\t * @param {Time} time When to get the value\n\t\t * @returns {Number} The value at the given time\n\t\t */\n\t Tone.Param.prototype.getValueAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var after = this._events.getAfter(time);\n\t var before = this._events.get(time);\n\t var initialValue = Tone.defaultArg(this._initialValue, this._param.defaultValue);\n\t var value = initialValue;\n\t //if it was set by\n\t if (before === null) {\n\t value = initialValue;\n\t } else if (before.type === Tone.Param.AutomationType.Target) {\n\t var previous = this._events.getBefore(before.time);\n\t var previousVal;\n\t if (previous === null) {\n\t previousVal = initialValue;\n\t } else {\n\t previousVal = previous.value;\n\t }\n\t value = this._exponentialApproach(before.time, previousVal, before.value, before.constant, time);\n\t } else if (after === null) {\n\t value = before.value;\n\t } else if (after.type === Tone.Param.AutomationType.Linear) {\n\t value = this._linearInterpolate(before.time, before.value, after.time, after.value, time);\n\t } else if (after.type === Tone.Param.AutomationType.Exponential) {\n\t value = this._exponentialInterpolate(before.time, before.value, after.time, after.value, time);\n\t } else {\n\t value = before.value;\n\t }\n\t return value;\n\t };\n\t /**\n\t\t * Creates a schedule point with the current value at the current time.\n\t\t * This is useful for creating an automation anchor point in order to\n\t\t * schedule changes from the current value.\n\t\t *\n\t\t * @param {number=} now (Optionally) pass the now value in.\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.setRampPoint = function (time) {\n\t time = this.toSeconds(time);\n\t var currentVal = this.getValueAtTime(time);\n\t this.cancelAndHoldAtTime(time);\n\t if (currentVal === 0) {\n\t currentVal = this._minOutput;\n\t }\n\t this.setValueAtTime(this._toUnits(currentVal), time);\n\t return this;\n\t };\n\t /**\n\t\t * Schedules a linear continuous change in parameter value from the\n\t\t * previous scheduled parameter value to the given value.\n\t\t *\n\t\t * @param {number} value\n\t\t * @param {Time} endTime\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.linearRampToValueAtTime = function (value, endTime) {\n\t value = this._fromUnits(value);\n\t endTime = this.toSeconds(endTime);\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Linear,\n\t 'value': value,\n\t 'time': endTime\n\t });\n\t this._param.linearRampToValueAtTime(value, endTime);\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an exponential continuous change in parameter value from\n\t\t * the previous scheduled parameter value to the given value.\n\t\t *\n\t\t * @param {number} value\n\t\t * @param {Time} endTime\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.exponentialRampToValueAtTime = function (value, endTime) {\n\t value = this._fromUnits(value);\n\t value = Math.max(this._minOutput, value);\n\t endTime = this.toSeconds(endTime);\n\t //store the event\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Exponential,\n\t 'time': endTime,\n\t 'value': value\n\t });\n\t this._param.exponentialRampToValueAtTime(value, endTime);\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an exponential continuous change in parameter value from\n\t\t * the current time and current value to the given value over the\n\t\t * duration of the rampTime.\n\t\t *\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //exponentially ramp to the value 2 over 4 seconds.\n\t\t * signal.exponentialRampTo(2, 4);\n\t\t */\n\t Tone.Param.prototype.exponentialRampTo = function (value, rampTime, startTime) {\n\t startTime = this.toSeconds(startTime);\n\t this.setRampPoint(startTime);\n\t this.exponentialRampToValueAtTime(value, startTime + this.toSeconds(rampTime));\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an linear continuous change in parameter value from\n\t\t * the current time and current value to the given value over the\n\t\t * duration of the rampTime.\n\t\t *\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //linearly ramp to the value 4 over 3 seconds.\n\t\t * signal.linearRampTo(4, 3);\n\t\t */\n\t Tone.Param.prototype.linearRampTo = function (value, rampTime, startTime) {\n\t startTime = this.toSeconds(startTime);\n\t this.setRampPoint(startTime);\n\t this.linearRampToValueAtTime(value, startTime + this.toSeconds(rampTime));\n\t return this;\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time. Since it\n\t\t * is an exponential approach it will continue approaching after the ramp duration. The\n\t\t * rampTime is the time that it takes to reach over 99% of the way towards the value.\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //exponentially ramp to the value 2 over 4 seconds.\n\t\t * signal.exponentialRampTo(2, 4);\n\t\t */\n\t Tone.Param.prototype.targetRampTo = function (value, rampTime, startTime) {\n\t startTime = this.toSeconds(startTime);\n\t this.setRampPoint(startTime);\n\t this.exponentialApproachValueAtTime(value, startTime, rampTime);\n\t return this;\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time. Since it\n\t\t * is an exponential approach it will continue approaching after the ramp duration. The\n\t\t * rampTime is the time that it takes to reach over 99% of the way towards the value. This methods\n\t\t * is similar to setTargetAtTime except the third argument is a time instead of a 'timeConstant'\n\t\t * @param {number} value The value to ramp to.\n\t\t * @param {Time}\ttime \tWhen the ramp should start.\n\t\t * @param {Time} rampTime the time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //exponentially ramp to the value 2 over 4 seconds.\n\t\t * signal.exponentialRampTo(2, 4);\n\t\t */\n\t Tone.Param.prototype.exponentialApproachValueAtTime = function (value, time, rampTime) {\n\t var timeConstant = Math.log(this.toSeconds(rampTime) + 1) / Math.log(200);\n\t time = this.toSeconds(time);\n\t return this.setTargetAtTime(value, time, timeConstant);\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time with\n\t\t * a rate having the given time constant.\n\t\t * @param {number} value\n\t\t * @param {Time} startTime\n\t\t * @param {number} timeConstant\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.setTargetAtTime = function (value, startTime, timeConstant) {\n\t value = this._fromUnits(value);\n\t // The value will never be able to approach without timeConstant > 0.\n\t if (timeConstant <= 0) {\n\t throw new Error('timeConstant must be greater than 0');\n\t }\n\t startTime = this.toSeconds(startTime);\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Target,\n\t 'value': value,\n\t 'time': startTime,\n\t 'constant': timeConstant\n\t });\n\t this._param.setTargetAtTime(value, startTime, timeConstant);\n\t return this;\n\t };\n\t /**\n\t\t * Sets an array of arbitrary parameter values starting at the given time\n\t\t * for the given duration.\n\t\t *\n\t\t * @param {Array} values\n\t\t * @param {Time} startTime\n\t\t * @param {Time} duration\n\t\t * @param {NormalRange} [scaling=1] If the values in the curve should be scaled by some value\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.setValueCurveAtTime = function (values, startTime, duration, scaling) {\n\t scaling = Tone.defaultArg(scaling, 1);\n\t duration = this.toSeconds(duration);\n\t startTime = this.toSeconds(startTime);\n\t this.setValueAtTime(values[0] * scaling, startTime);\n\t var segTime = duration / (values.length - 1);\n\t for (var i = 1; i < values.length; i++) {\n\t this.linearRampToValueAtTime(values[i] * scaling, startTime + i * segTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancels all scheduled parameter changes with times greater than or\n\t\t * equal to startTime.\n\t\t *\n\t\t * @param {Time} time\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.cancelScheduledValues = function (time) {\n\t time = this.toSeconds(time);\n\t this._events.cancel(time);\n\t this._param.cancelScheduledValues(time);\n\t return this;\n\t };\n\t /**\n\t\t * This is similar to [cancelScheduledValues](#cancelScheduledValues) except\n\t\t * it holds the automated value at time until the next automated event.\n\t\t * @param {Time} time\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.cancelAndHoldAtTime = function (time) {\n\t var valueAtTime = this.getValueAtTime(time);\n\t //if there is an event at the given time\n\t //and that even is not a \"set\"\n\t var before = this._events.get(time);\n\t var after = this._events.getAfter(time);\n\t if (before && before.time === time) {\n\t //remove everything after\n\t if (after) {\n\t this._events.cancel(after.time);\n\t } else {\n\t this._events.cancel(time + 0.000001);\n\t }\n\t } else if (after) {\n\t //cancel the next event(s)\n\t this._events.cancel(after.time);\n\t if (!this._param.cancelAndHoldAtTime) {\n\t this._param.cancelScheduledValues(time);\n\t }\n\t if (after.type === Tone.Param.AutomationType.Linear) {\n\t if (!this._param.cancelAndHoldAtTime) {\n\t this.linearRampToValueAtTime(valueAtTime, time);\n\t } else {\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Linear,\n\t 'value': valueAtTime,\n\t 'time': time\n\t });\n\t }\n\t } else if (after.type === Tone.Param.AutomationType.Exponential) {\n\t if (!this._param.cancelAndHoldAtTime) {\n\t this.exponentialRampToValueAtTime(valueAtTime, time);\n\t } else {\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.Exponential,\n\t 'value': valueAtTime,\n\t 'time': time\n\t });\n\t }\n\t }\n\t }\n\t //set the value at the given time\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.SetValue,\n\t 'value': valueAtTime,\n\t 'time': time\n\t });\n\t if (this._param.cancelAndHoldAtTime) {\n\t this._param.cancelAndHoldAtTime(time);\n\t } else {\n\t this._param.setValueAtTime(valueAtTime, time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Ramps to the given value over the duration of the rampTime.\n\t\t * Automatically selects the best ramp type (exponential or linear)\n\t\t * depending on the `units` of the signal\n\t\t *\n\t\t * @param {number} value\n\t\t * @param {Time} rampTime \tThe time that it takes the\n\t\t * value to ramp from it's current value\n\t\t * @param {Time}\t[startTime=now] \tWhen the ramp should start.\n\t\t * @returns {Tone.Param} this\n\t\t * @example\n\t\t * //ramp to the value either linearly or exponentially\n\t\t * //depending on the \"units\" value of the signal\n\t\t * signal.rampTo(0, 10);\n\t\t * @example\n\t\t * //schedule it to ramp starting at a specific time\n\t\t * signal.rampTo(0, 10, 5)\n\t\t */\n\t Tone.Param.prototype.rampTo = function (value, rampTime, startTime) {\n\t rampTime = Tone.defaultArg(rampTime, 0.1);\n\t if (this.units === Tone.Type.Frequency || this.units === Tone.Type.BPM || this.units === Tone.Type.Decibels) {\n\t this.exponentialRampTo(value, rampTime, startTime);\n\t } else {\n\t this.linearRampTo(value, rampTime, startTime);\n\t }\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tAUTOMATION CURVE CALCULATIONS\n\t //\tMIT License, copyright (c) 2014 Jordan Santell\n\t ///////////////////////////////////////////////////////////////////////////\n\t // Calculates the the value along the curve produced by setTargetAtTime\n\t Tone.Param.prototype._exponentialApproach = function (t0, v0, v1, timeConstant, t) {\n\t return v1 + (v0 - v1) * Math.exp(-(t - t0) / timeConstant);\n\t };\n\t // Calculates the the value along the curve produced by linearRampToValueAtTime\n\t Tone.Param.prototype._linearInterpolate = function (t0, v0, t1, v1, t) {\n\t return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));\n\t };\n\t // Calculates the the value along the curve produced by exponentialRampToValueAtTime\n\t Tone.Param.prototype._exponentialInterpolate = function (t0, v0, t1, v1, t) {\n\t return v0 * Math.pow(v1 / v0, (t - t0) / (t1 - t0));\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.Param.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._param = null;\n\t this._events = null;\n\t return this;\n\t };\n\t return Tone.Param;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the OfflineAudioContext\n\t\t * @extends {Tone.Context}\n\t\t * @param {Number} channels The number of channels to render\n\t\t * @param {Number} duration The duration to render in samples\n\t\t * @param {Number} sampleRate the sample rate to render at\n\t\t */\n\t Tone.OfflineContext = function (channels, duration, sampleRate) {\n\t /**\n\t\t\t * The offline context\n\t\t\t * @private\n\t\t\t * @type {OfflineAudioContext}\n\t\t\t */\n\t var offlineContext = new OfflineAudioContext(channels, duration * sampleRate, sampleRate);\n\t //wrap the methods/members\n\t Tone.Context.call(this, {\n\t 'context': offlineContext,\n\t 'clockSource': 'offline',\n\t 'lookAhead': 0,\n\t 'updateInterval': 128 / sampleRate\n\t });\n\t /**\n\t\t\t * A private reference to the duration\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._duration = duration;\n\t /**\n\t\t\t * An artificial clock source\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._currentTime = 0;\n\t };\n\t Tone.extend(Tone.OfflineContext, Tone.Context);\n\t /**\n\t\t * Override the now method to point to the internal clock time\n\t\t * @return {Number}\n\t\t */\n\t Tone.OfflineContext.prototype.now = function () {\n\t return this._currentTime;\n\t };\n\t /**\n\t\t * Render the output of the OfflineContext\n\t\t * @return {Promise}\n\t\t */\n\t Tone.OfflineContext.prototype.render = function () {\n\t while (this._duration - this._currentTime >= 0) {\n\t //invoke all the callbacks on that time\n\t this.emit('tick');\n\t //increment the clock\n\t this._currentTime += this.blockTime;\n\t }\n\t return this._context.startRendering();\n\t };\n\t /**\n\t\t * Close the context\n\t\t * @return {Promise}\n\t\t */\n\t Tone.OfflineContext.prototype.close = function () {\n\t this._context = null;\n\t return Promise.resolve();\n\t };\n\t return Tone.OfflineContext;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t var ua = navigator.userAgent.toLowerCase();\n\t var isMobileSafari = ua.includes('safari') && !ua.includes('chrome') && ua.includes('mobile');\n\t if (isMobileSafari) {\n\t //mobile safari has a bizarre bug with the offline context\n\t //when a BufferSourceNode is started, it starts the offline context\n\t //\n\t //deferring all BufferSource starts till the last possible moment\n\t //reduces the likelihood of this happening\n\t Tone.OfflineContext.prototype.createBufferSource = function () {\n\t var bufferSource = this._context.createBufferSource();\n\t var _native_start = bufferSource.start;\n\t bufferSource.start = function (time) {\n\t this.setTimeout(function () {\n\t _native_start.call(bufferSource, time);\n\t }.bind(this), 0);\n\t }.bind(this);\n\t return bufferSource;\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A thin wrapper around the Native Web Audio GainNode.\n\t\t * The GainNode is a basic building block of the Web Audio\n\t\t * API and is useful for routing audio and adjusting gains.\n\t\t * @extends {Tone}\n\t\t * @param {Number=} gain The initial gain of the GainNode\n\t\t * @param {Tone.Type=} units The units of the gain parameter.\n\t\t */\n\t Tone.Gain = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'gain',\n\t 'units'\n\t ], Tone.Gain);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The GainNode\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.input = this.output = this._gainNode = this.context.createGain();\n\t /**\n\t\t\t * The gain parameter of the gain node.\n\t\t\t * @type {Gain}\n\t\t\t * @signal\n\t\t\t */\n\t this.gain = new Tone.Param({\n\t 'param': this._gainNode.gain,\n\t 'units': options.units,\n\t 'value': options.gain,\n\t 'convert': options.convert\n\t });\n\t this._readOnly('gain');\n\t };\n\t Tone.extend(Tone.Gain, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Gain.defaults = {\n\t 'gain': 1,\n\t 'convert': true\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Gain} this\n\t\t */\n\t Tone.Gain.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._gainNode.disconnect();\n\t this._gainNode = null;\n\t this._writable('gain');\n\t this.gain.dispose();\n\t this.gain = null;\n\t };\n\t return Tone.Gain;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported && !AudioContext.prototype.createConstantSource) {\n\t var ConstantSourceNode = function (context) {\n\t this.context = context;\n\t var buffer = context.createBuffer(1, 128, context.sampleRate);\n\t var arr = buffer.getChannelData(0);\n\t for (var i = 0; i < arr.length; i++) {\n\t arr[i] = 1;\n\t }\n\t this._bufferSource = context.createBufferSource();\n\t this._bufferSource.channelCount = 1;\n\t this._bufferSource.channelCountMode = 'explicit';\n\t this._bufferSource.buffer = buffer;\n\t this._bufferSource.loop = true;\n\t var gainNode = this._output = context.createGain();\n\t this.offset = gainNode.gain;\n\t this._bufferSource.connect(gainNode);\n\t };\n\t ConstantSourceNode.prototype.start = function (time) {\n\t this._bufferSource.start(time);\n\t return this;\n\t };\n\t ConstantSourceNode.prototype.stop = function (time) {\n\t this._bufferSource.stop(time);\n\t return this;\n\t };\n\t ConstantSourceNode.prototype.connect = function () {\n\t this._output.connect.apply(this._output, arguments);\n\t return this;\n\t };\n\t ConstantSourceNode.prototype.disconnect = function () {\n\t this._output.disconnect.apply(this._output, arguments);\n\t return this;\n\t };\n\t AudioContext.prototype.createConstantSource = function () {\n\t return new ConstantSourceNode(this);\n\t };\n\t Tone.Context.prototype.createConstantSource = function () {\n\t return new ConstantSourceNode(this);\n\t };\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A signal is an audio-rate value. Tone.Signal is a core component of the library.\n\t\t * Unlike a number, Signals can be scheduled with sample-level accuracy. Tone.Signal\n\t\t * has all of the methods available to native Web Audio\n\t\t * [AudioParam](http://webaudio.github.io/web-audio-api/#the-audioparam-interface)\n\t\t * as well as additional conveniences. Read more about working with signals\n\t\t * [here](https://github.com/Tonejs/Tone.js/wiki/Signals).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Param}\n\t\t * @param {Number|AudioParam} [value] Initial value of the signal. If an AudioParam\n\t\t * is passed in, that parameter will be wrapped\n\t\t * and controlled by the Signal.\n\t\t * @param {string} [units=Number] unit The units the signal is in.\n\t\t * @example\n\t\t * var signal = new Tone.Signal(10);\n\t\t */\n\t Tone.Signal = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'value',\n\t 'units'\n\t ], Tone.Signal);\n\t Tone.Param.call(this, options);\n\t /**\n\t\t\t* When a signal is connected to another signal or audio param,\n\t\t\t* this signal becomes a proxy for it\n\t\t\t* @type {Array}\n\t\t\t* @private\n\t\t\t*/\n\t this._proxies = [];\n\t /**\n\t\t\t* Indicates if the constant source was started or not\n\t\t\t* @private\n\t\t\t* @type {Boolean}\n\t\t\t*/\n\t this._sourceStarted = false;\n\t /**\n\t\t\t * The constant source node which generates the signal\n\t\t\t * @type {ConstantSourceNode}\n\t\t\t * @private\n\t\t\t */\n\t this._constantSource = this.context.createConstantSource();\n\t this._param = this._constantSource.offset;\n\t this.value = options.value;\n\t /**\n\t\t\t * The node where the constant signal value is scaled.\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.output = this._constantSource;\n\t /**\n\t\t\t * The node where the value is set.\n\t\t\t * @type {Tone.Param}\n\t\t\t * @private\n\t\t\t */\n\t this.input = this._param = this.output.offset;\n\t };\n\t Tone.extend(Tone.Signal, Tone.Param);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Signal.defaults = {\n\t 'value': 0,\n\t 'units': Tone.Type.Default,\n\t 'convert': true\n\t };\n\t /**\n\t\t * When signals connect to other signals or AudioParams,\n\t\t * they take over the output value of that signal or AudioParam.\n\t\t * For all other nodes, the behavior is the same as a default <code>connect</code>.\n\t\t *\n\t\t * @override\n\t\t * @param {AudioParam|AudioNode|Tone.Signal|Tone} node\n\t\t * @param {number} [outputNumber=0] The output number to connect from.\n\t\t * @param {number} [inputNumber=0] The input number to connect to.\n\t\t * @returns {Tone.Signal} this\n\t\t * @method\n\t\t */\n\t Tone.Signal.prototype.connect = function (node) {\n\t //this is an optimization where this node will forward automations\n\t //to connected nodes without any signal if possible.\n\t if (this._isParam(node) && !this._sourceStarted) {\n\t this._proxies.push(node);\n\t node.overridden = true;\n\t this._applyAutomations(node);\n\t } else {\n\t Tone.SignalBase.prototype.connect.apply(this, arguments);\n\t if (!this._sourceStarted) {\n\t this._sourceStarted = true;\n\t this._constantSource.start(0);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Takes a node as an argument and returns if it is a Param or AudioParam\n\t\t * @param {*} node The node to test\n\t\t * @return {Boolean}\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._isParam = function (node) {\n\t return Tone.Param && Tone.Param === node.constructor || node instanceof AudioParam;\n\t };\n\t /**\n\t\t * Discard the optimization and connect all of the proxies\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._connectProxies = function () {\n\t if (!this._sourceStarted) {\n\t this._sourceStarted = true;\n\t this._constantSource.start(0);\n\t }\n\t this._proxies.forEach(function (proxy) {\n\t Tone.SignalBase.prototype.connect.call(this, proxy);\n\t if (proxy._proxies) {\n\t proxy._connectProxies();\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Invoked when a node is connected to this\n\t\t * @param {AudioNode} from\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._onConnect = function (from) {\n\t if (!this._isParam(from)) {\n\t //connect all the proxies\n\t this._connectProxies();\n\t }\n\t };\n\t /**\n\t\t * Apply all the current automations to the given parameter\n\t\t * @param {AudioParam} param\n\t\t * @private\n\t\t */\n\t Tone.Signal.prototype._applyAutomations = function (param) {\n\t var now = this.context.currentTime;\n\t param.cancelScheduledValues(now);\n\t var currentVal = this.getValueAtTime(now);\n\t param.setValueAtTime(currentVal, now);\n\t this._events.forEachFrom(now, function (event) {\n\t param[event.type](event.value, event.time, event.constant);\n\t });\n\t };\n\t /**\n\t\t * Disconnect from the given node or all nodes if no param is given.\n\t\t * @param {AudioNode|AudioParam} node\n\t\t * @return {Tone.Signal} this\n\t\t */\n\t Tone.Signal.prototype.disconnect = function (node) {\n\t if (this._proxies.includes(node)) {\n\t var index = this._proxies.indexOf(node);\n\t this._proxies.splice(index, 1);\n\t } else if (!node) {\n\t //no argument, disconnect everything\n\t this._proxies = [];\n\t }\n\t return Tone.SignalBase.prototype.disconnect.apply(this, arguments);\n\t };\n\t /**\n\t\t * Return the current signal value at the given time.\n\t\t * @param {Time} time When to get the signal value\n\t\t * @return {Number}\n\t\t */\n\t Tone.Signal.prototype.getValueAtTime = function (time) {\n\t if (this._param.getValueAtTime) {\n\t return this._param.getValueAtTime(time);\n\t } else {\n\t return Tone.Param.prototype.getValueAtTime.call(this, time);\n\t }\n\t };\n\t //wrap all of the automation methods\n\t [\n\t 'setValueAtTime',\n\t 'linearRampToValueAtTime',\n\t 'exponentialRampToValueAtTime',\n\t 'setTargetAtTime'\n\t ].forEach(function (method) {\n\t var previousMethod = Tone.Signal.prototype[method];\n\t Tone.Signal.prototype[method] = function () {\n\t var args = arguments;\n\t previousMethod.apply(this, arguments);\n\t args[0] = this._fromUnits(args[0]);\n\t args[1] = this.toSeconds(args[1]);\n\t //apply it to the proxies\n\t this._proxies.forEach(function (signal) {\n\t signal[method].apply(signal, args);\n\t });\n\t };\n\t });\n\t [\n\t 'cancelScheduledValues',\n\t 'cancelAndHoldAtTime'\n\t ].forEach(function (method) {\n\t var previousMethod = Tone.Signal.prototype[method];\n\t Tone.Signal.prototype[method] = function () {\n\t var args = arguments;\n\t previousMethod.apply(this, arguments);\n\t args[0] = this.toSeconds(args[0]);\n\t //apply it to the proxies\n\t this._proxies.forEach(function (signal) {\n\t signal[method].apply(signal, args);\n\t });\n\t };\n\t });\n\t /**\n\t\t * dispose and disconnect\n\t\t * @returns {Tone.Signal} this\n\t\t */\n\t Tone.Signal.prototype.dispose = function () {\n\t Tone.Param.prototype.dispose.call(this);\n\t this._constantSource.disconnect();\n\t this._constantSource = null;\n\t this._proxies = null;\n\t return this;\n\t };\n\t return Tone.Signal;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Pow applies an exponent to the incoming signal. The incoming signal\n\t\t * must be AudioRange.\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @param {Positive} exp The exponent to apply to the incoming signal, must be at least 2. \n\t\t * @example\n\t\t * var pow = new Tone.Pow(2);\n\t\t * var sig = new Tone.Signal(0.5).connect(pow);\n\t\t * //output of pow is 0.25. \n\t\t */\n\t Tone.Pow = function (exp) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * the exponent\n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._exp = Tone.defaultArg(exp, 1);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._expScaler = this.input = this.output = new Tone.WaveShaper(this._expFunc(this._exp), 8192);\n\t };\n\t Tone.extend(Tone.Pow, Tone.SignalBase);\n\t /**\n\t\t * The value of the exponent.\n\t\t * @memberOf Tone.Pow#\n\t\t * @type {number}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Pow.prototype, 'value', {\n\t get: function () {\n\t return this._exp;\n\t },\n\t set: function (exp) {\n\t this._exp = exp;\n\t this._expScaler.setMap(this._expFunc(this._exp));\n\t }\n\t });\n\t /**\n\t\t * the function which maps the waveshaper\n\t\t * @param {number} exp\n\t\t * @return {function}\n\t\t * @private\n\t\t */\n\t Tone.Pow.prototype._expFunc = function (exp) {\n\t return function (val) {\n\t return Math.pow(Math.abs(val), exp);\n\t };\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Pow} this\n\t\t */\n\t Tone.Pow.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._expScaler.dispose();\n\t this._expScaler = null;\n\t return this;\n\t };\n\t return Tone.Pow;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Envelope is an [ADSR](https://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope)\n\t\t * envelope generator. Tone.Envelope outputs a signal which\n\t\t * can be connected to an AudioParam or Tone.Signal.\n\t\t * <img src=\"https://upload.wikimedia.org/wikipedia/commons/e/ea/ADSR_parameter.svg\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Time} [attack] The amount of time it takes for the envelope to go from\n\t\t * 0 to it's maximum value.\n\t\t * @param {Time} [decay]\tThe period of time after the attack that it takes for the envelope\n\t\t * \tto fall to the sustain value.\n\t\t * @param {NormalRange} [sustain]\tThe percent of the maximum value that the envelope rests at until\n\t\t * \tthe release is triggered.\n\t\t * @param {Time} [release]\tThe amount of time after the release is triggered it takes to reach 0.\n\t\t * @example\n\t\t * //an amplitude envelope\n\t\t * var gainNode = Tone.context.createGain();\n\t\t * var env = new Tone.Envelope({\n\t\t * \t\"attack\" : 0.1,\n\t\t * \t\"decay\" : 0.2,\n\t\t * \t\"sustain\" : 1,\n\t\t * \t\"release\" : 0.8,\n\t\t * });\n\t\t * env.connect(gainNode.gain);\n\t\t */\n\t Tone.Envelope = function () {\n\t //get all of the defaults\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'decay',\n\t 'sustain',\n\t 'release'\n\t ], Tone.Envelope);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * When triggerAttack is called, the attack time is the amount of\n\t\t\t * time it takes for the envelope to reach it's maximum value.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.attack = options.attack;\n\t /**\n\t\t\t * After the attack portion of the envelope, the value will fall\n\t\t\t * over the duration of the decay time to it's sustain value.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.decay = options.decay;\n\t /**\n\t\t\t * \tThe sustain value is the value\n\t\t\t * \twhich the envelope rests at after triggerAttack is\n\t\t\t * \tcalled, but before triggerRelease is invoked.\n\t\t\t * @type {NormalRange}\n\t\t\t */\n\t this.sustain = options.sustain;\n\t /**\n\t\t\t * After triggerRelease is called, the envelope's\n\t\t\t * value will fall to it's miminum value over the\n\t\t\t * duration of the release time.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.release = options.release;\n\t /**\n\t\t\t * the next time the envelope is at standby\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._attackCurve = 'linear';\n\t /**\n\t\t\t * the next time the envelope is at standby\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._releaseCurve = 'exponential';\n\t /**\n\t\t\t * the signal\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._sig = this.output = new Tone.Signal(0);\n\t //set the attackCurve initially\n\t this.attackCurve = options.attackCurve;\n\t this.releaseCurve = options.releaseCurve;\n\t };\n\t Tone.extend(Tone.Envelope, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Envelope.defaults = {\n\t 'attack': 0.01,\n\t 'decay': 0.1,\n\t 'sustain': 0.5,\n\t 'release': 1,\n\t 'attackCurve': 'linear',\n\t 'releaseCurve': 'exponential'\n\t };\n\t /**\n\t\t * Read the current value of the envelope. Useful for\n\t\t * syncronizing visual output to the envelope.\n\t\t * @memberOf Tone.Envelope#\n\t\t * @type {Number}\n\t\t * @name value\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Envelope.prototype, 'value', {\n\t get: function () {\n\t return this.getValueAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * The shape of the attack.\n\t\t * Can be any of these strings:\n\t\t * <ul>\n\t\t * <li>linear</li>\n\t\t * <li>exponential</li>\n\t\t * <li>sine</li>\n\t\t * <li>cosine</li>\n\t\t * <li>bounce</li>\n\t\t * <li>ripple</li>\n\t\t * <li>step</li>\n\t\t * </ul>\n\t\t * Can also be an array which describes the curve. Values\n\t\t * in the array are evenly subdivided and linearly\n\t\t * interpolated over the duration of the attack.\n\t\t * @memberOf Tone.Envelope#\n\t\t * @type {String|Array}\n\t\t * @name attackCurve\n\t\t * @example\n\t\t * env.attackCurve = \"linear\";\n\t\t * @example\n\t\t * //can also be an array\n\t\t * env.attackCurve = [0, 0.2, 0.3, 0.4, 1]\n\t\t */\n\t Object.defineProperty(Tone.Envelope.prototype, 'attackCurve', {\n\t get: function () {\n\t if (Tone.isString(this._attackCurve)) {\n\t return this._attackCurve;\n\t } else if (Tone.isArray(this._attackCurve)) {\n\t //look up the name in the curves array\n\t for (var type in Tone.Envelope.Type) {\n\t if (Tone.Envelope.Type[type].In === this._attackCurve) {\n\t return type;\n\t }\n\t }\n\t //otherwise just return the array\n\t return this._attackCurve;\n\t }\n\t },\n\t set: function (curve) {\n\t //check if it's a valid type\n\t if (Tone.Envelope.Type.hasOwnProperty(curve)) {\n\t var curveDef = Tone.Envelope.Type[curve];\n\t if (Tone.isObject(curveDef)) {\n\t this._attackCurve = curveDef.In;\n\t } else {\n\t this._attackCurve = curveDef;\n\t }\n\t } else if (Tone.isArray(curve)) {\n\t this._attackCurve = curve;\n\t } else {\n\t throw new Error('Tone.Envelope: invalid curve: ' + curve);\n\t }\n\t }\n\t });\n\t /**\n\t\t * The shape of the release. See the attack curve types.\n\t\t * @memberOf Tone.Envelope#\n\t\t * @type {String|Array}\n\t\t * @name releaseCurve\n\t\t * @example\n\t\t * env.releaseCurve = \"linear\";\n\t\t */\n\t Object.defineProperty(Tone.Envelope.prototype, 'releaseCurve', {\n\t get: function () {\n\t if (Tone.isString(this._releaseCurve)) {\n\t return this._releaseCurve;\n\t } else if (Tone.isArray(this._releaseCurve)) {\n\t //look up the name in the curves array\n\t for (var type in Tone.Envelope.Type) {\n\t if (Tone.Envelope.Type[type].Out === this._releaseCurve) {\n\t return type;\n\t }\n\t }\n\t //otherwise just return the array\n\t return this._releaseCurve;\n\t }\n\t },\n\t set: function (curve) {\n\t //check if it's a valid type\n\t if (Tone.Envelope.Type.hasOwnProperty(curve)) {\n\t var curveDef = Tone.Envelope.Type[curve];\n\t if (Tone.isObject(curveDef)) {\n\t this._releaseCurve = curveDef.Out;\n\t } else {\n\t this._releaseCurve = curveDef;\n\t }\n\t } else if (Tone.isArray(curve)) {\n\t this._releaseCurve = curve;\n\t } else {\n\t throw new Error('Tone.Envelope: invalid curve: ' + curve);\n\t }\n\t }\n\t });\n\t /**\n\t\t * Trigger the attack/decay portion of the ADSR envelope.\n\t\t * @param {Time} [time=now] When the attack should start.\n\t\t * @param {NormalRange} [velocity=1] The velocity of the envelope scales the vales.\n\t\t * number between 0-1\n\t\t * @returns {Tone.Envelope} this\n\t\t * @example\n\t\t * //trigger the attack 0.5 seconds from now with a velocity of 0.2\n\t\t * env.triggerAttack(\"+0.5\", 0.2);\n\t\t */\n\t Tone.Envelope.prototype.triggerAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t var originalAttack = this.toSeconds(this.attack);\n\t var attack = originalAttack;\n\t var decay = this.toSeconds(this.decay);\n\t velocity = Tone.defaultArg(velocity, 1);\n\t //check if it's not a complete attack\n\t var currentValue = this.getValueAtTime(time);\n\t if (currentValue > 0) {\n\t //subtract the current value from the attack time\n\t var attackRate = 1 / attack;\n\t var remainingDistance = 1 - currentValue;\n\t //the attack is now the remaining time\n\t attack = remainingDistance / attackRate;\n\t }\n\t //attack\n\t if (this._attackCurve === 'linear') {\n\t this._sig.linearRampTo(velocity, attack, time);\n\t } else if (this._attackCurve === 'exponential') {\n\t this._sig.targetRampTo(velocity, attack, time);\n\t } else if (attack > 0) {\n\t this._sig.cancelAndHoldAtTime(time);\n\t var curve = this._attackCurve;\n\t //take only a portion of the curve\n\t if (attack < originalAttack) {\n\t var percentComplete = 1 - attack / originalAttack;\n\t var sliceIndex = Math.floor(percentComplete * this._attackCurve.length);\n\t curve = this._attackCurve.slice(sliceIndex);\n\t //the first index is the current value\n\t curve[0] = currentValue;\n\t }\n\t this._sig.setValueCurveAtTime(curve, time, attack, velocity);\n\t }\n\t //decay\n\t if (decay) {\n\t this._sig.targetRampTo(velocity * this.sustain, decay, attack + time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Triggers the release of the envelope.\n\t\t * @param {Time} [time=now] When the release portion of the envelope should start.\n\t\t * @returns {Tone.Envelope} this\n\t\t * @example\n\t\t * //trigger release immediately\n\t\t * env.triggerRelease();\n\t\t */\n\t Tone.Envelope.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t var currentValue = this.getValueAtTime(time);\n\t if (currentValue > 0) {\n\t var release = this.toSeconds(this.release);\n\t if (this._releaseCurve === 'linear') {\n\t this._sig.linearRampTo(0, release, time);\n\t } else if (this._releaseCurve === 'exponential') {\n\t this._sig.targetRampTo(0, release, time);\n\t } else {\n\t var curve = this._releaseCurve;\n\t if (Tone.isArray(curve)) {\n\t this._sig.cancelAndHoldAtTime(time);\n\t this._sig.setValueCurveAtTime(curve, time, release, currentValue);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the scheduled value at the given time. This will\n\t\t * return the unconverted (raw) value.\n\t\t * @param {Number} time The time in seconds.\n\t\t * @return {Number} The scheduled value at the given time.\n\t\t */\n\t Tone.Envelope.prototype.getValueAtTime = function (time) {\n\t return this._sig.getValueAtTime(time);\n\t };\n\t /**\n\t\t * triggerAttackRelease is shorthand for triggerAttack, then waiting\n\t\t * some duration, then triggerRelease.\n\t\t * @param {Time} duration The duration of the sustain.\n\t\t * @param {Time} [time=now] When the attack should be triggered.\n\t\t * @param {number} [velocity=1] The velocity of the envelope.\n\t\t * @returns {Tone.Envelope} this\n\t\t * @example\n\t\t * //trigger the attack and then the release after 0.6 seconds.\n\t\t * env.triggerAttackRelease(0.6);\n\t\t */\n\t Tone.Envelope.prototype.triggerAttackRelease = function (duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t this.triggerAttack(time, velocity);\n\t this.triggerRelease(time + this.toSeconds(duration));\n\t return this;\n\t };\n\t /**\n\t\t * Cancels all scheduled envelope changes after the given time.\n\t\t * @param {Time} after\n\t\t * @returns {Tone.Envelope} this\n\t\t */\n\t Tone.Envelope.prototype.cancel = function (after) {\n\t this._sig.cancelScheduledValues(after);\n\t return this;\n\t };\n\t /**\n\t\t * Borrows the connect method from Tone.Signal.\n\t\t * @function\n\t\t * @private\n\t\t */\n\t Tone.Envelope.prototype.connect = Tone.SignalBase.prototype.connect;\n\t /**\n\t \t * Generate some complex envelope curves.\n\t \t */\n\t (function _createCurves() {\n\t var curveLen = 128;\n\t var i, k;\n\t //cosine curve\n\t var cosineCurve = [];\n\t for (i = 0; i < curveLen; i++) {\n\t cosineCurve[i] = Math.sin(i / (curveLen - 1) * (Math.PI / 2));\n\t }\n\t //ripple curve\n\t var rippleCurve = [];\n\t var rippleCurveFreq = 6.4;\n\t for (i = 0; i < curveLen - 1; i++) {\n\t k = i / (curveLen - 1);\n\t var sineWave = Math.sin(k * (Math.PI * 2) * rippleCurveFreq - Math.PI / 2) + 1;\n\t rippleCurve[i] = sineWave / 10 + k * 0.83;\n\t }\n\t rippleCurve[curveLen - 1] = 1;\n\t //stairs curve\n\t var stairsCurve = [];\n\t var steps = 5;\n\t for (i = 0; i < curveLen; i++) {\n\t stairsCurve[i] = Math.ceil(i / (curveLen - 1) * steps) / steps;\n\t }\n\t //in-out easing curve\n\t var sineCurve = [];\n\t for (i = 0; i < curveLen; i++) {\n\t k = i / (curveLen - 1);\n\t sineCurve[i] = 0.5 * (1 - Math.cos(Math.PI * k));\n\t }\n\t //a bounce curve\n\t var bounceCurve = [];\n\t for (i = 0; i < curveLen; i++) {\n\t k = i / (curveLen - 1);\n\t var freq = Math.pow(k, 3) * 4 + 0.2;\n\t var val = Math.cos(freq * Math.PI * 2 * k);\n\t bounceCurve[i] = Math.abs(val * (1 - k));\n\t }\n\t /**\n\t\t\t * Invert a value curve to make it work for the release\n\t\t\t * @private\n\t\t\t */\n\t function invertCurve(curve) {\n\t var out = new Array(curve.length);\n\t for (var j = 0; j < curve.length; j++) {\n\t out[j] = 1 - curve[j];\n\t }\n\t return out;\n\t }\n\t /**\n\t\t\t * reverse the curve\n\t\t\t * @private\n\t\t\t */\n\t function reverseCurve(curve) {\n\t return curve.slice(0).reverse();\n\t }\n\t /**\n\t\t\t * attack and release curve arrays\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t Tone.Envelope.Type = {\n\t 'linear': 'linear',\n\t 'exponential': 'exponential',\n\t 'bounce': {\n\t In: invertCurve(bounceCurve),\n\t Out: bounceCurve\n\t },\n\t 'cosine': {\n\t In: cosineCurve,\n\t Out: reverseCurve(cosineCurve)\n\t },\n\t 'step': {\n\t In: stairsCurve,\n\t Out: invertCurve(stairsCurve)\n\t },\n\t 'ripple': {\n\t In: rippleCurve,\n\t Out: invertCurve(rippleCurve)\n\t },\n\t 'sine': {\n\t In: sineCurve,\n\t Out: invertCurve(sineCurve)\n\t }\n\t };\n\t }());\n\t /**\n\t\t * Disconnect and dispose.\n\t\t * @returns {Tone.Envelope} this\n\t\t */\n\t Tone.Envelope.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._sig.dispose();\n\t this._sig = null;\n\t this._attackCurve = null;\n\t this._releaseCurve = null;\n\t return this;\n\t };\n\t return Tone.Envelope;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AmplitudeEnvelope is a Tone.Envelope connected to a gain node.\n\t\t * Unlike Tone.Envelope, which outputs the envelope's value, Tone.AmplitudeEnvelope accepts\n\t\t * an audio signal as the input and will apply the envelope to the amplitude\n\t\t * of the signal. Read more about ADSR Envelopes on [Wikipedia](https://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Envelope}\n\t\t * @param {Time|Object} [attack] The amount of time it takes for the envelope to go from\n\t\t * 0 to it's maximum value.\n\t\t * @param {Time} [decay]\tThe period of time after the attack that it takes for the envelope\n\t\t * \tto fall to the sustain value.\n\t\t * @param {NormalRange} [sustain]\tThe percent of the maximum value that the envelope rests at until\n\t\t * \tthe release is triggered.\n\t\t * @param {Time} [release]\tThe amount of time after the release is triggered it takes to reach 0.\n\t\t * @example\n\t\t * var ampEnv = new Tone.AmplitudeEnvelope({\n\t\t * \t\"attack\": 0.1,\n\t\t * \t\"decay\": 0.2,\n\t\t * \t\"sustain\": 1.0,\n\t\t * \t\"release\": 0.8\n\t\t * }).toMaster();\n\t\t * //create an oscillator and connect it\n\t\t * var osc = new Tone.Oscillator().connect(ampEnv).start();\n\t\t * //trigger the envelopes attack and release \"8t\" apart\n\t\t * ampEnv.triggerAttackRelease(\"8t\");\n\t\t */\n\t Tone.AmplitudeEnvelope = function () {\n\t Tone.Envelope.apply(this, arguments);\n\t /**\n\t\t\t * the input node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.input = this.output = new Tone.Gain();\n\t this._sig.connect(this.output.gain);\n\t };\n\t Tone.extend(Tone.AmplitudeEnvelope, Tone.Envelope);\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.AmplitudeEnvelope} this\n\t\t */\n\t Tone.AmplitudeEnvelope.prototype.dispose = function () {\n\t Tone.Envelope.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.AmplitudeEnvelope;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * AnalyserNode.getFloatTimeDomainData polyfill\n\t\t * @private\n\t\t */\n\t if (Tone.supported) {\n\t if (!AnalyserNode.prototype.getFloatTimeDomainData) {\n\t //referenced https://github.com/mohayonao/get-float-time-domain-data\n\t AnalyserNode.prototype.getFloatTimeDomainData = function (array) {\n\t var uint8 = new Uint8Array(array.length);\n\t this.getByteTimeDomainData(uint8);\n\t for (var i = 0; i < uint8.length; i++) {\n\t array[i] = (uint8[i] - 128) / 128;\n\t }\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Wrapper around the native Web Audio's\n\t\t * [AnalyserNode](http://webaudio.github.io/web-audio-api/#idl-def-AnalyserNode).\n\t\t * Extracts FFT or Waveform data from the incoming signal.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {String=} type The return type of the analysis, either \"fft\", or \"waveform\".\n\t\t * @param {Number=} size The size of the FFT. Value must be a power of\n\t\t * two in the range 32 to 32768.\n\t\t */\n\t Tone.Analyser = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'type',\n\t 'size'\n\t ], Tone.Analyser);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node.\n\t\t\t * @private\n\t\t\t * @type {AnalyserNode}\n\t\t\t */\n\t this._analyser = this.input = this.output = this.context.createAnalyser();\n\t /**\n\t\t\t * The analysis type\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * The buffer that the FFT data is written to\n\t\t\t * @type {TypedArray}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = null;\n\t //set the values initially\n\t this.size = options.size;\n\t this.type = options.type;\n\t };\n\t Tone.extend(Tone.Analyser, Tone.AudioNode);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Analyser.defaults = {\n\t 'size': 1024,\n\t 'type': 'fft',\n\t 'smoothing': 0.8\n\t };\n\t /**\n\t\t * Possible return types of analyser.getValue()\n\t\t * @enum {String}\n\t\t */\n\t Tone.Analyser.Type = {\n\t Waveform: 'waveform',\n\t FFT: 'fft'\n\t };\n\t /**\n\t\t * Run the analysis given the current settings and return the\n\t\t * result as a TypedArray.\n\t\t * @returns {TypedArray}\n\t\t */\n\t Tone.Analyser.prototype.getValue = function () {\n\t if (this._type === Tone.Analyser.Type.FFT) {\n\t this._analyser.getFloatFrequencyData(this._buffer);\n\t } else if (this._type === Tone.Analyser.Type.Waveform) {\n\t this._analyser.getFloatTimeDomainData(this._buffer);\n\t }\n\t return this._buffer;\n\t };\n\t /**\n\t\t * The size of analysis. This must be a power of two in the range 32 to 32768.\n\t\t * @memberOf Tone.Analyser#\n\t\t * @type {Number}\n\t\t * @name size\n\t\t */\n\t Object.defineProperty(Tone.Analyser.prototype, 'size', {\n\t get: function () {\n\t return this._analyser.frequencyBinCount;\n\t },\n\t set: function (size) {\n\t this._analyser.fftSize = size * 2;\n\t this._buffer = new Float32Array(size);\n\t }\n\t });\n\t /**\n\t\t * The analysis function returned by analyser.getValue(), either \"fft\" or \"waveform\".\n\t\t * @memberOf Tone.Analyser#\n\t\t * @type {String}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Analyser.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t if (type !== Tone.Analyser.Type.Waveform && type !== Tone.Analyser.Type.FFT) {\n\t throw new TypeError('Tone.Analyser: invalid type: ' + type);\n\t }\n\t this._type = type;\n\t }\n\t });\n\t /**\n\t\t * 0 represents no time averaging with the last analysis frame.\n\t\t * @memberOf Tone.Analyser#\n\t\t * @type {NormalRange}\n\t\t * @name smoothing\n\t\t */\n\t Object.defineProperty(Tone.Analyser.prototype, 'smoothing', {\n\t get: function () {\n\t return this._analyser.smoothingTimeConstant;\n\t },\n\t set: function (val) {\n\t this._analyser.smoothingTimeConstant = val;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Analyser} this\n\t\t */\n\t Tone.Analyser.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.disconnect();\n\t this._analyser = null;\n\t this._buffer = null;\n\t };\n\t return Tone.Analyser;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Compressor is a thin wrapper around the Web Audio\n\t\t * [DynamicsCompressorNode](http://webaudio.github.io/web-audio-api/#the-dynamicscompressornode-interface).\n\t\t * Compression reduces the volume of loud sounds or amplifies quiet sounds\n\t\t * by narrowing or \"compressing\" an audio signal's dynamic range.\n\t\t * Read more on [Wikipedia](https://en.wikipedia.org/wiki/Dynamic_range_compression).\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Decibels|Object} [threshold] The value above which the compression starts to be applied.\n\t\t * @param {Positive} [ratio] The gain reduction ratio.\n\t\t * @example\n\t\t * var comp = new Tone.Compressor(-30, 3);\n\t\t */\n\t Tone.Compressor = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'threshold',\n\t 'ratio'\n\t ], Tone.Compressor);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the compressor node\n\t\t\t * @type {DynamicsCompressorNode}\n\t\t\t * @private\n\t\t\t */\n\t this._compressor = this.input = this.output = this.context.createDynamicsCompressor();\n\t /**\n\t\t\t * the threshold vaue\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.threshold = new Tone.Param({\n\t 'param': this._compressor.threshold,\n\t 'units': Tone.Type.Decibels,\n\t 'convert': false\n\t });\n\t /**\n\t\t\t * The attack parameter\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.attack = new Tone.Param(this._compressor.attack, Tone.Type.Time);\n\t /**\n\t\t\t * The release parameter\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.release = new Tone.Param(this._compressor.release, Tone.Type.Time);\n\t /**\n\t\t\t * The knee parameter\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.knee = new Tone.Param({\n\t 'param': this._compressor.knee,\n\t 'units': Tone.Type.Decibels,\n\t 'convert': false\n\t });\n\t /**\n\t\t\t * The ratio value\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.ratio = new Tone.Param({\n\t 'param': this._compressor.ratio,\n\t 'convert': false\n\t });\n\t //set the defaults\n\t this._readOnly([\n\t 'knee',\n\t 'release',\n\t 'attack',\n\t 'ratio',\n\t 'threshold'\n\t ]);\n\t this.set(options);\n\t };\n\t Tone.extend(Tone.Compressor, Tone.AudioNode);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Compressor.defaults = {\n\t 'ratio': 12,\n\t 'threshold': -24,\n\t 'release': 0.25,\n\t 'attack': 0.003,\n\t 'knee': 30\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Compressor} this\n\t\t */\n\t Tone.Compressor.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'knee',\n\t 'release',\n\t 'attack',\n\t 'ratio',\n\t 'threshold'\n\t ]);\n\t this._compressor.disconnect();\n\t this._compressor = null;\n\t this.attack.dispose();\n\t this.attack = null;\n\t this.release.dispose();\n\t this.release = null;\n\t this.threshold.dispose();\n\t this.threshold = null;\n\t this.ratio.dispose();\n\t this.ratio = null;\n\t this.knee.dispose();\n\t this.knee = null;\n\t return this;\n\t };\n\t return Tone.Compressor;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Add a signal and a number or two signals. When no value is\n\t\t * passed into the constructor, Tone.Add will sum <code>input[0]</code>\n\t\t * and <code>input[1]</code>. If a value is passed into the constructor, \n\t\t * the it will be added to the input.\n\t\t * \n\t\t * @constructor\n\t\t * @extends {Tone.Signal}\n\t\t * @param {number=} value If no value is provided, Tone.Add will sum the first\n\t\t * and second inputs. \n\t\t * @example\n\t\t * var signal = new Tone.Signal(2);\n\t\t * var add = new Tone.Add(2);\n\t\t * signal.connect(add);\n\t\t * //the output of add equals 4\n\t\t * @example\n\t\t * //if constructed with no arguments\n\t\t * //it will add the first and second inputs\n\t\t * var add = new Tone.Add();\n\t\t * var sig0 = new Tone.Signal(3).connect(add, 0, 0);\n\t\t * var sig1 = new Tone.Signal(4).connect(add, 0, 1);\n\t\t * //the output of add equals 7. \n\t\t */\n\t Tone.Add = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * the summing node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._sum = this.input[0] = this.input[1] = this.output = new Tone.Gain();\n\t /**\n\t\t\t * @private\n\t\t\t * @type {Tone.Signal}\n\t\t\t */\n\t this._param = this.input[1] = new Tone.Signal(value);\n\t this._param.connect(this._sum);\n\t };\n\t Tone.extend(Tone.Add, Tone.Signal);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Add} this\n\t\t */\n\t Tone.Add.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._sum.dispose();\n\t this._sum = null;\n\t return this;\n\t };\n\t return Tone.Add;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Multiply two incoming signals. Or, if a number is given in the constructor,\n\t\t * multiplies the incoming signal by that value.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Signal}\n\t\t * @param {number=} value Constant value to multiple. If no value is provided,\n\t\t * it will return the product of the first and second inputs\n\t\t * @example\n\t\t * var mult = new Tone.Multiply();\n\t\t * var sigA = new Tone.Signal(3);\n\t\t * var sigB = new Tone.Signal(4);\n\t\t * sigA.connect(mult, 0, 0);\n\t\t * sigB.connect(mult, 0, 1);\n\t\t * //output of mult is 12.\n\t\t * @example\n\t\t * var mult = new Tone.Multiply(10);\n\t\t * var sig = new Tone.Signal(2).connect(mult);\n\t\t * //the output of mult is 20.\n\t\t */\n\t Tone.Multiply = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * the input node is the same as the output node\n\t\t\t * it is also the GainNode which handles the scaling of incoming signal\n\t\t\t *\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._mult = this.input[0] = this.output = new Tone.Gain();\n\t /**\n\t\t\t * the scaling parameter\n\t\t\t * @type {AudioParam}\n\t\t\t * @private\n\t\t\t */\n\t this._param = this.input[1] = this.output.gain;\n\t this.value = Tone.defaultArg(value, 0);\n\t };\n\t Tone.extend(Tone.Multiply, Tone.Signal);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Multiply} this\n\t\t */\n\t Tone.Multiply.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._mult.dispose();\n\t this._mult = null;\n\t this._param = null;\n\t return this;\n\t };\n\t return Tone.Multiply;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Negate the incoming signal. i.e. an input signal of 10 will output -10\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @example\n\t\t * var neg = new Tone.Negate();\n\t\t * var sig = new Tone.Signal(-2).connect(neg);\n\t\t * //output of neg is positive 2. \n\t\t */\n\t Tone.Negate = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * negation is done by multiplying by -1\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._multiply = this.input = this.output = new Tone.Multiply(-1);\n\t };\n\t Tone.extend(Tone.Negate, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Negate} this\n\t\t */\n\t Tone.Negate.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._multiply.dispose();\n\t this._multiply = null;\n\t return this;\n\t };\n\t return Tone.Negate;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Subtract the signal connected to <code>input[1]</code> from the signal connected \n\t\t * to <code>input[0]</code>. If an argument is provided in the constructor, the \n\t\t * signals <code>.value</code> will be subtracted from the incoming signal.\n\t\t *\n\t\t * @extends {Tone.Signal}\n\t\t * @constructor\n\t\t * @param {number=} value The value to subtract from the incoming signal. If the value\n\t\t * is omitted, it will subtract the second signal from the first.\n\t\t * @example\n\t\t * var sub = new Tone.Subtract(1);\n\t\t * var sig = new Tone.Signal(4).connect(sub);\n\t\t * //the output of sub is 3. \n\t\t * @example\n\t\t * var sub = new Tone.Subtract();\n\t\t * var sigA = new Tone.Signal(10);\n\t\t * var sigB = new Tone.Signal(2.5);\n\t\t * sigA.connect(sub, 0, 0);\n\t\t * sigB.connect(sub, 0, 1);\n\t\t * //output of sub is 7.5\n\t\t */\n\t Tone.Subtract = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * the summing node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._sum = this.input[0] = this.output = new Tone.Gain();\n\t /**\n\t\t\t * negate the input of the second input before connecting it\n\t\t\t * to the summing node.\n\t\t\t * @type {Tone.Negate}\n\t\t\t * @private\n\t\t\t */\n\t this._neg = new Tone.Negate();\n\t /**\n\t\t\t * the node where the value is set\n\t\t\t * @private\n\t\t\t * @type {Tone.Signal}\n\t\t\t */\n\t this._param = this.input[1] = new Tone.Signal(value);\n\t this._param.chain(this._neg, this._sum);\n\t };\n\t Tone.extend(Tone.Subtract, Tone.Signal);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.SignalBase} this\n\t\t */\n\t Tone.Subtract.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._neg.dispose();\n\t this._neg = null;\n\t this._sum.disconnect();\n\t this._sum = null;\n\t return this;\n\t };\n\t return Tone.Subtract;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Convert an incoming signal between 0, 1 to an equal power gain scale.\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @example\n\t\t * var eqPowGain = new Tone.EqualPowerGain();\n\t\t */\n\t Tone.EqualPowerGain = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._eqPower = this.input = this.output = new Tone.WaveShaper(function (val) {\n\t if (Math.abs(val) < 0.001) {\n\t //should output 0 when input is 0\n\t return 0;\n\t } else {\n\t return Tone.equalPowerScale(val);\n\t }\n\t }.bind(this), 4096);\n\t };\n\t Tone.extend(Tone.EqualPowerGain, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.EqualPowerGain} this\n\t\t */\n\t Tone.EqualPowerGain.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._eqPower.dispose();\n\t this._eqPower = null;\n\t return this;\n\t };\n\t return Tone.EqualPowerGain;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Crossfade provides equal power fading between two inputs.\n\t\t * More on crossfading technique [here](https://en.wikipedia.org/wiki/Fade_(audio_engineering)#Crossfading).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {NormalRange} [initialFade=0.5]\n\t\t * @example\n\t\t * var crossFade = new Tone.CrossFade(0.5);\n\t\t * //connect effect A to crossfade from\n\t\t * //effect output 0 to crossfade input 0\n\t\t * effectA.connect(crossFade, 0, 0);\n\t\t * //connect effect B to crossfade from\n\t\t * //effect output 0 to crossfade input 1\n\t\t * effectB.connect(crossFade, 0, 1);\n\t\t * crossFade.fade.value = 0;\n\t\t * // ^ only effectA is output\n\t\t * crossFade.fade.value = 1;\n\t\t * // ^ only effectB is output\n\t\t * crossFade.fade.value = 0.5;\n\t\t * // ^ the two signals are mixed equally.\n\t\t */\n\t Tone.CrossFade = function (initialFade) {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(2, 1);\n\t /**\n\t\t\t * Alias for <code>input[0]</code>.\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.a = this.input[0] = new Tone.Gain();\n\t /**\n\t\t\t * Alias for <code>input[1]</code>.\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.b = this.input[1] = new Tone.Gain();\n\t /**\n\t\t\t * \tThe mix between the two inputs. A fade value of 0\n\t\t\t * \twill output 100% <code>input[0]</code> and\n\t\t\t * \ta value of 1 will output 100% <code>input[1]</code>.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.fade = new Tone.Signal(Tone.defaultArg(initialFade, 0.5), Tone.Type.NormalRange);\n\t /**\n\t\t\t * equal power gain cross fade\n\t\t\t * @private\n\t\t\t * @type {Tone.EqualPowerGain}\n\t\t\t */\n\t this._equalPowerA = new Tone.EqualPowerGain();\n\t /**\n\t\t\t * equal power gain cross fade\n\t\t\t * @private\n\t\t\t * @type {Tone.EqualPowerGain}\n\t\t\t */\n\t this._equalPowerB = new Tone.EqualPowerGain();\n\t /**\n\t\t\t * invert the incoming signal\n\t\t\t * @private\n\t\t\t * @type {Tone}\n\t\t\t */\n\t this._one = this.context.getConstant(1);\n\t /**\n\t\t\t * invert the incoming signal\n\t\t\t * @private\n\t\t\t * @type {Tone.Subtract}\n\t\t\t */\n\t this._invert = new Tone.Subtract();\n\t //connections\n\t this.a.connect(this.output);\n\t this.b.connect(this.output);\n\t this.fade.chain(this._equalPowerB, this.b.gain);\n\t this._one.connect(this._invert, 0, 0);\n\t this.fade.connect(this._invert, 0, 1);\n\t this._invert.chain(this._equalPowerA, this.a.gain);\n\t this._readOnly('fade');\n\t };\n\t Tone.extend(Tone.CrossFade, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.CrossFade} this\n\t\t */\n\t Tone.CrossFade.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('fade');\n\t this._equalPowerA.dispose();\n\t this._equalPowerA = null;\n\t this._equalPowerB.dispose();\n\t this._equalPowerB = null;\n\t this.fade.dispose();\n\t this.fade = null;\n\t this._invert.dispose();\n\t this._invert = null;\n\t this._one = null;\n\t this.a.dispose();\n\t this.a = null;\n\t this.b.dispose();\n\t this.b = null;\n\t return this;\n\t };\n\t return Tone.CrossFade;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Filter is a filter which allows for all of the same native methods\n\t\t * as the [BiquadFilterNode](http://webaudio.github.io/web-audio-api/#the-biquadfilternode-interface).\n\t\t * Tone.Filter has the added ability to set the filter rolloff at -12\n\t\t * (default), -24 and -48.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Frequency|Object} [frequency] The cutoff frequency of the filter.\n\t\t * @param {string=} type The type of filter.\n\t\t * @param {number=} rolloff The drop in decibels per octave after the cutoff frequency.\n\t\t * 3 choices: -12, -24, and -48\n\t\t * @example\n\t\t * var filter = new Tone.Filter(200, \"highpass\");\n\t\t */\n\t Tone.Filter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'rolloff'\n\t ], Tone.Filter);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the filter(s)\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._filters = [];\n\t /**\n\t\t\t * The cutoff frequency of the filter.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune parameter\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(0, Tone.Type.Cents);\n\t /**\n\t\t\t * The gain of the filter, only used in certain filter types\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.gain = new Tone.Signal({\n\t 'value': options.gain,\n\t 'convert': false\n\t });\n\t /**\n\t\t\t * The Q or Quality of the filter\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = new Tone.Signal(options.Q);\n\t /**\n\t\t\t * the type of the filter\n\t\t\t * @type {string}\n\t\t\t * @private\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * the rolloff value of the filter\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._rolloff = options.rolloff;\n\t //set the rolloff;\n\t this.rolloff = options.rolloff;\n\t this._readOnly([\n\t 'detune',\n\t 'frequency',\n\t 'gain',\n\t 'Q'\n\t ]);\n\t };\n\t Tone.extend(Tone.Filter, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t *\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Filter.defaults = {\n\t 'type': 'lowpass',\n\t 'frequency': 350,\n\t 'rolloff': -12,\n\t 'Q': 1,\n\t 'gain': 0\n\t };\n\t /**\n\t\t * The type of the filter. Types: \"lowpass\", \"highpass\",\n\t\t * \"bandpass\", \"lowshelf\", \"highshelf\", \"notch\", \"allpass\", or \"peaking\".\n\t\t * @memberOf Tone.Filter#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Filter.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t var types = [\n\t 'lowpass',\n\t 'highpass',\n\t 'bandpass',\n\t 'lowshelf',\n\t 'highshelf',\n\t 'notch',\n\t 'allpass',\n\t 'peaking'\n\t ];\n\t if (types.indexOf(type) === -1) {\n\t throw new TypeError('Tone.Filter: invalid type ' + type);\n\t }\n\t this._type = type;\n\t for (var i = 0; i < this._filters.length; i++) {\n\t this._filters[i].type = type;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The rolloff of the filter which is the drop in db\n\t\t * per octave. Implemented internally by cascading filters.\n\t\t * Only accepts the values -12, -24, -48 and -96.\n\t\t * @memberOf Tone.Filter#\n\t\t * @type {number}\n\t\t * @name rolloff\n\t\t */\n\t Object.defineProperty(Tone.Filter.prototype, 'rolloff', {\n\t get: function () {\n\t return this._rolloff;\n\t },\n\t set: function (rolloff) {\n\t rolloff = parseInt(rolloff, 10);\n\t var possibilities = [\n\t -12,\n\t -24,\n\t -48,\n\t -96\n\t ];\n\t var cascadingCount = possibilities.indexOf(rolloff);\n\t //check the rolloff is valid\n\t if (cascadingCount === -1) {\n\t throw new RangeError('Tone.Filter: rolloff can only be -12, -24, -48 or -96');\n\t }\n\t cascadingCount += 1;\n\t this._rolloff = rolloff;\n\t //first disconnect the filters and throw them away\n\t this.input.disconnect();\n\t for (var i = 0; i < this._filters.length; i++) {\n\t this._filters[i].disconnect();\n\t this._filters[i] = null;\n\t }\n\t this._filters = new Array(cascadingCount);\n\t for (var count = 0; count < cascadingCount; count++) {\n\t var filter = this.context.createBiquadFilter();\n\t filter.type = this._type;\n\t this.frequency.connect(filter.frequency);\n\t this.detune.connect(filter.detune);\n\t this.Q.connect(filter.Q);\n\t this.gain.connect(filter.gain);\n\t this._filters[count] = filter;\n\t }\n\t //connect them up\n\t var connectionChain = [this.input].concat(this._filters).concat([this.output]);\n\t Tone.connectSeries.apply(Tone, connectionChain);\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Filter} this\n\t\t */\n\t Tone.Filter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t for (var i = 0; i < this._filters.length; i++) {\n\t this._filters[i].disconnect();\n\t this._filters[i] = null;\n\t }\n\t this._filters = null;\n\t this._writable([\n\t 'detune',\n\t 'frequency',\n\t 'gain',\n\t 'Q'\n\t ]);\n\t this.frequency.dispose();\n\t this.Q.dispose();\n\t this.frequency = null;\n\t this.Q = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.gain.dispose();\n\t this.gain = null;\n\t return this;\n\t };\n\t return Tone.Filter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Split the incoming signal into three bands (low, mid, high)\n\t\t * with two crossover frequency controls.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Frequency|Object} [lowFrequency] the low/mid crossover frequency\n\t\t * @param {Frequency} [highFrequency] the mid/high crossover frequency\n\t\t */\n\t Tone.MultibandSplit = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'lowFrequency',\n\t 'highFrequency'\n\t ], Tone.MultibandSplit);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the input\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.input = new Tone.Gain();\n\t /**\n\t\t\t * the outputs\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this.output = new Array(3);\n\t /**\n\t\t\t * The low band. Alias for <code>output[0]</code>\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.low = this.output[0] = new Tone.Filter(0, 'lowpass');\n\t /**\n\t\t\t * the lower filter of the mid band\n\t\t\t * @type {Tone.Filter}\n\t\t\t * @private\n\t\t\t */\n\t this._lowMidFilter = new Tone.Filter(0, 'highpass');\n\t /**\n\t\t\t * The mid band output. Alias for <code>output[1]</code>\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.mid = this.output[1] = new Tone.Filter(0, 'lowpass');\n\t /**\n\t\t\t * The high band output. Alias for <code>output[2]</code>\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.high = this.output[2] = new Tone.Filter(0, 'highpass');\n\t /**\n\t\t\t * The low/mid crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.lowFrequency = new Tone.Signal(options.lowFrequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The mid/high crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.highFrequency = new Tone.Signal(options.highFrequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The quality of all the filters\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = new Tone.Signal(options.Q);\n\t this.input.fan(this.low, this.high);\n\t this.input.chain(this._lowMidFilter, this.mid);\n\t //the frequency control signal\n\t this.lowFrequency.connect(this.low.frequency);\n\t this.lowFrequency.connect(this._lowMidFilter.frequency);\n\t this.highFrequency.connect(this.mid.frequency);\n\t this.highFrequency.connect(this.high.frequency);\n\t //the Q value\n\t this.Q.connect(this.low.Q);\n\t this.Q.connect(this._lowMidFilter.Q);\n\t this.Q.connect(this.mid.Q);\n\t this.Q.connect(this.high.Q);\n\t this._readOnly([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t };\n\t Tone.extend(Tone.MultibandSplit, Tone.AudioNode);\n\t /**\n\t\t * @private\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MultibandSplit.defaults = {\n\t 'lowFrequency': 400,\n\t 'highFrequency': 2500,\n\t 'Q': 1\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MultibandSplit} this\n\t\t */\n\t Tone.MultibandSplit.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t this.low.dispose();\n\t this.low = null;\n\t this._lowMidFilter.dispose();\n\t this._lowMidFilter = null;\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.high.dispose();\n\t this.high = null;\n\t this.lowFrequency.dispose();\n\t this.lowFrequency = null;\n\t this.highFrequency.dispose();\n\t this.highFrequency = null;\n\t this.Q.dispose();\n\t this.Q = null;\n\t return this;\n\t };\n\t return Tone.MultibandSplit;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.EQ3 is a three band EQ with control over low, mid, and high gain as\n\t\t * well as the low and high crossover frequencies.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t *\n\t\t * @param {Decibels|Object} [lowLevel] The gain applied to the lows.\n\t\t * @param {Decibels} [midLevel] The gain applied to the mid.\n\t\t * @param {Decibels} [highLevel] The gain applied to the high.\n\t\t * @example\n\t\t * var eq = new Tone.EQ3(-10, 3, -20);\n\t\t */\n\t Tone.EQ3 = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'low',\n\t 'mid',\n\t 'high'\n\t ], Tone.EQ3);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the output node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.output = new Tone.Gain();\n\t /**\n\t\t\t * the multiband split\n\t\t\t * @type {Tone.MultibandSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._multibandSplit = this.input = new Tone.MultibandSplit({\n\t 'lowFrequency': options.lowFrequency,\n\t 'highFrequency': options.highFrequency\n\t });\n\t /**\n\t\t\t * The gain for the lower signals\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._lowGain = new Tone.Gain(options.low, Tone.Type.Decibels);\n\t /**\n\t\t\t * The gain for the mid signals\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._midGain = new Tone.Gain(options.mid, Tone.Type.Decibels);\n\t /**\n\t\t\t * The gain in decibels of the high part\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._highGain = new Tone.Gain(options.high, Tone.Type.Decibels);\n\t /**\n\t\t\t * The gain in decibels of the low part\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.low = this._lowGain.gain;\n\t /**\n\t\t\t * The gain in decibels of the mid part\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.mid = this._midGain.gain;\n\t /**\n\t\t\t * The gain in decibels of the high part\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.high = this._highGain.gain;\n\t /**\n\t\t\t * The Q value for all of the filters.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = this._multibandSplit.Q;\n\t /**\n\t\t\t * The low/mid crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.lowFrequency = this._multibandSplit.lowFrequency;\n\t /**\n\t\t\t * The mid/high crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.highFrequency = this._multibandSplit.highFrequency;\n\t //the frequency bands\n\t this._multibandSplit.low.chain(this._lowGain, this.output);\n\t this._multibandSplit.mid.chain(this._midGain, this.output);\n\t this._multibandSplit.high.chain(this._highGain, this.output);\n\t this._readOnly([\n\t 'low',\n\t 'mid',\n\t 'high',\n\t 'lowFrequency',\n\t 'highFrequency'\n\t ]);\n\t };\n\t Tone.extend(Tone.EQ3, Tone.AudioNode);\n\t /**\n\t\t * the default values\n\t\t */\n\t Tone.EQ3.defaults = {\n\t 'low': 0,\n\t 'mid': 0,\n\t 'high': 0,\n\t 'lowFrequency': 400,\n\t 'highFrequency': 2500\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.EQ3} this\n\t\t */\n\t Tone.EQ3.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'low',\n\t 'mid',\n\t 'high',\n\t 'lowFrequency',\n\t 'highFrequency'\n\t ]);\n\t this._multibandSplit.dispose();\n\t this._multibandSplit = null;\n\t this.lowFrequency = null;\n\t this.highFrequency = null;\n\t this._lowGain.dispose();\n\t this._lowGain = null;\n\t this._midGain.dispose();\n\t this._midGain = null;\n\t this._highGain.dispose();\n\t this._highGain = null;\n\t this.low = null;\n\t this.mid = null;\n\t this.high = null;\n\t this.Q = null;\n\t return this;\n\t };\n\t return Tone.EQ3;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Performs a linear scaling on an input signal.\n\t\t * Scales a NormalRange input to between\n\t\t * outputMin and outputMax.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @param {number} [outputMin=0] The output value when the input is 0. \n\t\t * @param {number} [outputMax=1]\tThe output value when the input is 1. \n\t\t * @example\n\t\t * var scale = new Tone.Scale(50, 100);\n\t\t * var signal = new Tone.Signal(0.5).connect(scale);\n\t\t * //the output of scale equals 75\n\t\t */\n\t Tone.Scale = function (outputMin, outputMax) {\n\t Tone.SignalBase.call(this);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._outputMin = Tone.defaultArg(outputMin, 0);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._outputMax = Tone.defaultArg(outputMax, 1);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.input = new Tone.Multiply(1);\n\t /** \n\t\t\t * @private\n\t\t\t * @type {Tone.Add}\n\t\t\t * @private\n\t\t\t */\n\t this._add = this.output = new Tone.Add(0);\n\t this._scale.connect(this._add);\n\t this._setRange();\n\t };\n\t Tone.extend(Tone.Scale, Tone.SignalBase);\n\t /**\n\t\t * The minimum output value. This number is output when \n\t\t * the value input value is 0. \n\t\t * @memberOf Tone.Scale#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.Scale.prototype, 'min', {\n\t get: function () {\n\t return this._outputMin;\n\t },\n\t set: function (min) {\n\t this._outputMin = min;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * The maximum output value. This number is output when \n\t\t * the value input value is 1. \n\t\t * @memberOf Tone.Scale#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.Scale.prototype, 'max', {\n\t get: function () {\n\t return this._outputMax;\n\t },\n\t set: function (max) {\n\t this._outputMax = max;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * set the values\n\t\t * @private\n\t\t */\n\t Tone.Scale.prototype._setRange = function () {\n\t this._add.value = this._outputMin;\n\t this._scale.value = this._outputMax - this._outputMin;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Scale} this\n\t\t */\n\t Tone.Scale.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._add.dispose();\n\t this._add = null;\n\t this._scale.dispose();\n\t this._scale = null;\n\t return this;\n\t };\n\t return Tone.Scale;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Performs an exponential scaling on an input signal.\n\t\t * Scales a NormalRange value [0,1] exponentially\n\t\t * to the output range of outputMin to outputMax.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @param {number} [outputMin=0] The output value when the input is 0.\n\t\t * @param {number} [outputMax=1]\tThe output value when the input is 1.\n\t\t * @param {number} [exponent=2] The exponent which scales the incoming signal.\n\t\t * @example\n\t\t * var scaleExp = new Tone.ScaleExp(0, 100, 2);\n\t\t * var signal = new Tone.Signal(0.5).connect(scaleExp);\n\t\t */\n\t Tone.ScaleExp = function (outputMin, outputMax, exponent) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * scale the input to the output range\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.output = new Tone.Scale(outputMin, outputMax);\n\t /**\n\t\t\t * @private\n\t\t\t * @type {Tone.Pow}\n\t\t\t * @private\n\t\t\t */\n\t this._exp = this.input = new Tone.Pow(Tone.defaultArg(exponent, 2));\n\t this._exp.connect(this._scale);\n\t };\n\t Tone.extend(Tone.ScaleExp, Tone.SignalBase);\n\t /**\n\t\t * Instead of interpolating linearly between the <code>min</code> and\n\t\t * <code>max</code> values, setting the exponent will interpolate between\n\t\t * the two values with an exponential curve.\n\t\t * @memberOf Tone.ScaleExp#\n\t\t * @type {number}\n\t\t * @name exponent\n\t\t */\n\t Object.defineProperty(Tone.ScaleExp.prototype, 'exponent', {\n\t get: function () {\n\t return this._exp.value;\n\t },\n\t set: function (exp) {\n\t this._exp.value = exp;\n\t }\n\t });\n\t /**\n\t\t * The minimum output value. This number is output when\n\t\t * the value input value is 0.\n\t\t * @memberOf Tone.ScaleExp#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.ScaleExp.prototype, 'min', {\n\t get: function () {\n\t return this._scale.min;\n\t },\n\t set: function (min) {\n\t this._scale.min = min;\n\t }\n\t });\n\t /**\n\t\t * The maximum output value. This number is output when\n\t\t * the value input value is 1.\n\t\t * @memberOf Tone.ScaleExp#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.ScaleExp.prototype, 'max', {\n\t get: function () {\n\t return this._scale.max;\n\t },\n\t set: function (max) {\n\t this._scale.max = max;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.ScaleExp} this\n\t\t */\n\t Tone.ScaleExp.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._exp.dispose();\n\t this._exp = null;\n\t return this;\n\t };\n\t return Tone.ScaleExp;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Wrapper around Web Audio's native [DelayNode](http://webaudio.github.io/web-audio-api/#the-delaynode-interface).\n\t\t * @extends {Tone}\n\t\t * @param {Time=} delayTime The delay applied to the incoming signal.\n\t\t * @param {Time=} maxDelay The maximum delay time.\n\t\t */\n\t Tone.Delay = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'maxDelay'\n\t ], Tone.Delay);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The maximum delay time initialized with the node\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._maxDelay = Math.max(this.toSeconds(options.maxDelay), this.toSeconds(options.delayTime));\n\t /**\n\t\t\t * The native delay node\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNode = this.input = this.output = this.context.createDelay(this._maxDelay);\n\t /**\n\t\t\t * The amount of time the incoming signal is\n\t\t\t * delayed.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = new Tone.Param({\n\t 'param': this._delayNode.delayTime,\n\t 'units': Tone.Type.Time,\n\t 'value': options.delayTime\n\t });\n\t this._readOnly('delayTime');\n\t };\n\t Tone.extend(Tone.Delay, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Delay.defaults = {\n\t 'maxDelay': 1,\n\t 'delayTime': 0\n\t };\n\t /**\n\t\t * The maximum delay time. This cannot be changed. The value is passed into the constructor.\n\t\t * @memberof Tone.Delay#\n\t\t * @type {Time}\n\t\t * @name maxDelay\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Delay.prototype, 'maxDelay', {\n\t get: function () {\n\t return this._maxDelay;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Delay} this\n\t\t */\n\t Tone.Delay.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._delayNode.disconnect();\n\t this._delayNode = null;\n\t this._writable('delayTime');\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.Delay;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Comb filters are basic building blocks for physical modeling. Read more\n\t\t * about comb filters on [CCRMA's website](https://ccrma.stanford.edu/~jos/pasp/Feedback_Comb_Filters.html).\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Time|Object} [delayTime] The delay time of the filter.\n\t\t * @param {NormalRange=} resonance The amount of feedback the filter has.\n\t\t */\n\t Tone.FeedbackCombFilter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'resonance'\n\t ], Tone.FeedbackCombFilter);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the delay node\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delay = this.input = this.output = new Tone.Delay(options.delayTime);\n\t /**\n\t\t\t * The amount of delay of the comb filter.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._delay.delayTime;\n\t /**\n\t\t\t * the feedback node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._feedback = new Tone.Gain(options.resonance, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of feedback of the delayed signal.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.resonance = this._feedback.gain;\n\t this._delay.chain(this._feedback, this._delay);\n\t this._readOnly([\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t };\n\t Tone.extend(Tone.FeedbackCombFilter, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.FeedbackCombFilter.defaults = {\n\t 'delayTime': 0.1,\n\t 'resonance': 0.5\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FeedbackCombFilter} this\n\t\t */\n\t Tone.FeedbackCombFilter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t this._delay.dispose();\n\t this._delay = null;\n\t this.delayTime = null;\n\t this._feedback.dispose();\n\t this._feedback = null;\n\t this.resonance = null;\n\t return this;\n\t };\n\t return Tone.FeedbackCombFilter;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Get the current waveform data of the connected audio source.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number=} size The size of the FFT. Value must be a power of\n\t\t * two in the range 32 to 32768.\n\t\t */\n\t Tone.FFT = function () {\n\t var options = Tone.defaults(arguments, ['size'], Tone.FFT);\n\t options.type = Tone.Analyser.Type.FFT;\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node.\n\t\t\t * @private\n\t\t\t * @type {Tone.Analyser}\n\t\t\t */\n\t this._analyser = this.input = this.output = new Tone.Analyser(options);\n\t };\n\t Tone.extend(Tone.FFT, Tone.AudioNode);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.FFT.defaults = { 'size': 1024 };\n\t /**\n\t\t * Gets the waveform of the audio source. Returns the waveform data\n\t\t * of length [size](#size) as a Float32Array with values between -1 and 1.\n\t\t * @returns {TypedArray}\n\t\t */\n\t Tone.FFT.prototype.getValue = function () {\n\t return this._analyser.getValue();\n\t };\n\t /**\n\t\t * The size of analysis. This must be a power of two in the range 32 to 32768.\n\t\t * @memberOf Tone.FFT#\n\t\t * @type {Number}\n\t\t * @name size\n\t\t */\n\t Object.defineProperty(Tone.FFT.prototype, 'size', {\n\t get: function () {\n\t return this._analyser.size;\n\t },\n\t set: function (size) {\n\t this._analyser.size = size;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.FFT} this\n\t\t */\n\t Tone.FFT.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.dispose();\n\t this._analyser = null;\n\t };\n\t return Tone.FFT;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Return the absolute value of an incoming signal.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @example\n\t\t * var signal = new Tone.Signal(-1);\n\t\t * var abs = new Tone.Abs();\n\t\t * signal.connect(abs);\n\t\t * //the output of abs is 1.\n\t\t */\n\t Tone.Abs = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {Tone.LessThan}\n\t\t\t * @private\n\t\t\t */\n\t this._abs = this.input = this.output = new Tone.WaveShaper(function (val) {\n\t if (Math.abs(val) < 0.001) {\n\t return 0;\n\t } else {\n\t return Math.abs(val);\n\t }\n\t }, 1024);\n\t };\n\t Tone.extend(Tone.Abs, Tone.SignalBase);\n\t /**\n\t\t * dispose method\n\t\t * @returns {Tone.Abs} this\n\t\t */\n\t Tone.Abs.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._abs.dispose();\n\t this._abs = null;\n\t return this;\n\t };\n\t return Tone.Abs;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Follower is a crude envelope follower which will follow\n\t\t * the amplitude of an incoming signal.\n\t\t * Take care with small (< 0.02) attack or decay values\n\t\t * as follower has some ripple which is exaggerated\n\t\t * at these values. Read more about envelope followers (also known\n\t\t * as envelope detectors) on [Wikipedia](https://en.wikipedia.org/wiki/Envelope_detector).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Time|Object} [attack] The rate at which the follower rises.\n\t\t * @param {Time=} release The rate at which the folower falls.\n\t\t * @example\n\t\t * var follower = new Tone.Follower(0.2, 0.4);\n\t\t */\n\t Tone.Follower = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'release'\n\t ], Tone.Follower);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * @type {Tone.Abs}\n\t\t\t * @private\n\t\t\t */\n\t this._abs = new Tone.Abs();\n\t /**\n\t\t\t * the lowpass filter which smooths the input\n\t\t\t * @type {BiquadFilterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._filter = this.context.createBiquadFilter();\n\t this._filter.type = 'lowpass';\n\t this._filter.frequency.value = 0;\n\t this._filter.Q.value = -100;\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._frequencyValues = new Tone.WaveShaper();\n\t /**\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._sub = new Tone.Subtract();\n\t /**\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delay = new Tone.Delay(this.blockTime);\n\t /**\n\t\t\t * this keeps it far from 0, even for very small differences\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._mult = new Tone.Multiply(10000);\n\t /**\n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._attack = options.attack;\n\t /**\n\t\t\t * @private\n\t\t\t * @type {number}\n\t\t\t */\n\t this._release = options.release;\n\t //the smoothed signal to get the values\n\t this.input.chain(this._abs, this._filter, this.output);\n\t //the difference path\n\t this._abs.connect(this._sub, 0, 1);\n\t this._filter.chain(this._delay, this._sub);\n\t //threshold the difference and use the thresh to set the frequency\n\t this._sub.chain(this._mult, this._frequencyValues, this._filter.frequency);\n\t //set the attack and release values in the table\n\t this._setAttackRelease(this._attack, this._release);\n\t };\n\t Tone.extend(Tone.Follower, Tone.AudioNode);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Follower.defaults = {\n\t 'attack': 0.05,\n\t 'release': 0.5\n\t };\n\t /**\n\t\t * sets the attack and release times in the wave shaper\n\t\t * @param {Time} attack\n\t\t * @param {Time} release\n\t\t * @private\n\t\t */\n\t Tone.Follower.prototype._setAttackRelease = function (attack, release) {\n\t var minTime = this.blockTime;\n\t attack = Tone.Time(attack).toFrequency();\n\t release = Tone.Time(release).toFrequency();\n\t attack = Math.max(attack, minTime);\n\t release = Math.max(release, minTime);\n\t this._frequencyValues.setMap(function (val) {\n\t if (val <= 0) {\n\t return attack;\n\t } else {\n\t return release;\n\t }\n\t });\n\t };\n\t /**\n\t\t * The attack time.\n\t\t * @memberOf Tone.Follower#\n\t\t * @type {Time}\n\t\t * @name attack\n\t\t */\n\t Object.defineProperty(Tone.Follower.prototype, 'attack', {\n\t get: function () {\n\t return this._attack;\n\t },\n\t set: function (attack) {\n\t this._attack = attack;\n\t this._setAttackRelease(this._attack, this._release);\n\t }\n\t });\n\t /**\n\t\t * The release time.\n\t\t * @memberOf Tone.Follower#\n\t\t * @type {Time}\n\t\t * @name release\n\t\t */\n\t Object.defineProperty(Tone.Follower.prototype, 'release', {\n\t get: function () {\n\t return this._release;\n\t },\n\t set: function (release) {\n\t this._release = release;\n\t this._setAttackRelease(this._attack, this._release);\n\t }\n\t });\n\t /**\n\t\t * Borrows the connect method from Signal so that the output can be used\n\t\t * as a Tone.Signal control signal.\n\t\t * @function\n\t\t */\n\t Tone.Follower.prototype.connect = Tone.SignalBase.prototype.connect;\n\t /**\n\t\t * dispose\n\t\t * @returns {Tone.Follower} this\n\t\t */\n\t Tone.Follower.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._filter.disconnect();\n\t this._filter = null;\n\t this._frequencyValues.disconnect();\n\t this._frequencyValues = null;\n\t this._delay.dispose();\n\t this._delay = null;\n\t this._sub.disconnect();\n\t this._sub = null;\n\t this._abs.dispose();\n\t this._abs = null;\n\t this._mult.dispose();\n\t this._mult = null;\n\t this._curve = null;\n\t return this;\n\t };\n\t return Tone.Follower;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.ScaledEnvelop is an envelope which can be scaled\n\t\t * to any range. It's useful for applying an envelope\n\t\t * to a frequency or any other non-NormalRange signal\n\t\t * parameter.\n\t\t *\n\t\t * @extends {Tone.Envelope}\n\t\t * @constructor\n\t\t * @param {Time|Object} [attack]\tthe attack time in seconds\n\t\t * @param {Time} [decay]\tthe decay time in seconds\n\t\t * @param {number} [sustain] \ta percentage (0-1) of the full amplitude\n\t\t * @param {Time} [release]\tthe release time in seconds\n\t\t * @example\n\t\t * var scaledEnv = new Tone.ScaledEnvelope({\n\t\t * \t\"attack\" : 0.2,\n\t\t * \t\"min\" : 200,\n\t\t * \t\"max\" : 2000\n\t\t * });\n\t\t * scaledEnv.connect(oscillator.frequency);\n\t\t */\n\t Tone.ScaledEnvelope = function () {\n\t //get all of the defaults\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'decay',\n\t 'sustain',\n\t 'release'\n\t ], Tone.Envelope);\n\t Tone.Envelope.call(this, options);\n\t options = Tone.defaultArg(options, Tone.ScaledEnvelope.defaults);\n\t /**\n\t\t\t * scale the incoming signal by an exponent\n\t\t\t * @type {Tone.Pow}\n\t\t\t * @private\n\t\t\t */\n\t this._exp = this.output = new Tone.Pow(options.exponent);\n\t /**\n\t\t\t * scale the signal to the desired range\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.output = new Tone.Scale(options.min, options.max);\n\t this._sig.chain(this._exp, this._scale);\n\t };\n\t Tone.extend(Tone.ScaledEnvelope, Tone.Envelope);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t */\n\t Tone.ScaledEnvelope.defaults = {\n\t 'min': 0,\n\t 'max': 1,\n\t 'exponent': 1\n\t };\n\t /**\n\t\t * The envelope's min output value. This is the value which it\n\t\t * starts at.\n\t\t * @memberOf Tone.ScaledEnvelope#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.ScaledEnvelope.prototype, 'min', {\n\t get: function () {\n\t return this._scale.min;\n\t },\n\t set: function (min) {\n\t this._scale.min = min;\n\t }\n\t });\n\t /**\n\t\t * The envelope's max output value. In other words, the value\n\t\t * at the peak of the attack portion of the envelope.\n\t\t * @memberOf Tone.ScaledEnvelope#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.ScaledEnvelope.prototype, 'max', {\n\t get: function () {\n\t return this._scale.max;\n\t },\n\t set: function (max) {\n\t this._scale.max = max;\n\t }\n\t });\n\t /**\n\t\t * The envelope's exponent value.\n\t\t * @memberOf Tone.ScaledEnvelope#\n\t\t * @type {number}\n\t\t * @name exponent\n\t\t */\n\t Object.defineProperty(Tone.ScaledEnvelope.prototype, 'exponent', {\n\t get: function () {\n\t return this._exp.value;\n\t },\n\t set: function (exp) {\n\t this._exp.value = exp;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.ScaledEnvelope} this\n\t\t */\n\t Tone.ScaledEnvelope.prototype.dispose = function () {\n\t Tone.Envelope.prototype.dispose.call(this);\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._exp.dispose();\n\t this._exp = null;\n\t return this;\n\t };\n\t return Tone.ScaledEnvelope;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FrequencyEnvelope is a Tone.ScaledEnvelope, but instead of `min` and `max`\n\t\t * it's got a `baseFrequency` and `octaves` parameter.\n\t\t *\n\t\t * @extends {Tone.Envelope}\n\t\t * @constructor\n\t\t * @param {Time|Object} [attack]\tthe attack time in seconds\n\t\t * @param {Time} [decay]\tthe decay time in seconds\n\t\t * @param {number} [sustain] \ta percentage (0-1) of the full amplitude\n\t\t * @param {Time} [release]\tthe release time in seconds\n\t\t * @example\n\t\t * var freqEnv = new Tone.FrequencyEnvelope({\n\t\t * \t\"attack\" : 0.2,\n\t\t * \t\"baseFrequency\" : \"C2\",\n\t\t * \t\"octaves\" : 4\n\t\t * });\n\t\t * freqEnv.connect(oscillator.frequency);\n\t\t */\n\t Tone.FrequencyEnvelope = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'attack',\n\t 'decay',\n\t 'sustain',\n\t 'release'\n\t ], Tone.Envelope);\n\t Tone.ScaledEnvelope.call(this, options);\n\t //merge it with the frequency envelope defaults\n\t options = Tone.defaultArg(options, Tone.FrequencyEnvelope.defaults);\n\t /**\n\t\t\t * Stores the octave value\n\t\t\t * @type {Positive}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t //setup\n\t this.baseFrequency = options.baseFrequency;\n\t this.octaves = options.octaves;\n\t };\n\t Tone.extend(Tone.FrequencyEnvelope, Tone.Envelope);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t */\n\t Tone.FrequencyEnvelope.defaults = {\n\t 'baseFrequency': 200,\n\t 'octaves': 4,\n\t 'exponent': 2\n\t };\n\t /**\n\t\t * The envelope's mininum output value. This is the value which it\n\t\t * starts at.\n\t\t * @memberOf Tone.FrequencyEnvelope#\n\t\t * @type {Frequency}\n\t\t * @name baseFrequency\n\t\t */\n\t Object.defineProperty(Tone.FrequencyEnvelope.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._scale.min;\n\t },\n\t set: function (min) {\n\t this._scale.min = this.toFrequency(min);\n\t //also update the octaves\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * The number of octaves above the baseFrequency that the\n\t\t * envelope will scale to.\n\t\t * @memberOf Tone.FrequencyEnvelope#\n\t\t * @type {Positive}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.FrequencyEnvelope.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octaves) {\n\t this._octaves = octaves;\n\t this._scale.max = this.baseFrequency * Math.pow(2, octaves);\n\t }\n\t });\n\t /**\n\t\t * The envelope's exponent value.\n\t\t * @memberOf Tone.FrequencyEnvelope#\n\t\t * @type {number}\n\t\t * @name exponent\n\t\t */\n\t Object.defineProperty(Tone.FrequencyEnvelope.prototype, 'exponent', {\n\t get: function () {\n\t return this._exp.value;\n\t },\n\t set: function (exp) {\n\t this._exp.value = exp;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FrequencyEnvelope} this\n\t\t */\n\t Tone.FrequencyEnvelope.prototype.dispose = function () {\n\t Tone.ScaledEnvelope.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.FrequencyEnvelope;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class GreaterThanZero outputs 1 when the input is strictly greater than zero\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @example\n\t\t * var gt0 = new Tone.GreaterThanZero();\n\t\t * var sig = new Tone.Signal(0.01).connect(gt0);\n\t\t * //the output of gt0 is 1.\n\t\t * sig.value = 0;\n\t\t * //the output of gt0 is 0.\n\t\t */\n\t Tone.GreaterThanZero = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._thresh = this.output = new Tone.WaveShaper(function (val) {\n\t if (val <= 0) {\n\t return 0;\n\t } else {\n\t return 1;\n\t }\n\t }, 127);\n\t /**\n\t\t\t * scale the first thresholded signal by a large value.\n\t\t\t * this will help with values which are very close to 0\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = this.input = new Tone.Multiply(10000);\n\t //connections\n\t this._scale.connect(this._thresh);\n\t };\n\t Tone.extend(Tone.GreaterThanZero, Tone.SignalBase);\n\t /**\n\t\t * dispose method\n\t\t * @returns {Tone.GreaterThanZero} this\n\t\t */\n\t Tone.GreaterThanZero.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._thresh.dispose();\n\t this._thresh = null;\n\t return this;\n\t };\n\t return Tone.GreaterThanZero;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Output 1 if the signal is greater than the value, otherwise outputs 0.\n\t\t * can compare two signals or a signal and a number.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Signal}\n\t\t * @param {number} [value=0] the value to compare to the incoming signal\n\t\t * @example\n\t\t * var gt = new Tone.GreaterThan(2);\n\t\t * var sig = new Tone.Signal(4).connect(gt);\n\t\t * //output of gt is equal 1.\n\t\t */\n\t Tone.GreaterThan = function (value) {\n\t Tone.Signal.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * subtract the amount from the incoming signal\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._param = this.input[0] = new Tone.Subtract(value);\n\t this.input[1] = this._param.input[1];\n\t /**\n\t\t\t * compare that amount to zero\n\t\t\t * @type {Tone.GreaterThanZero}\n\t\t\t * @private\n\t\t\t */\n\t this._gtz = this.output = new Tone.GreaterThanZero();\n\t //connect\n\t this._param.connect(this._gtz);\n\t };\n\t Tone.extend(Tone.GreaterThan, Tone.Signal);\n\t /**\n\t\t * dispose method\n\t\t * @returns {Tone.GreaterThan} this\n\t\t */\n\t Tone.GreaterThan.prototype.dispose = function () {\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._gtz.dispose();\n\t this._gtz = null;\n\t return this;\n\t };\n\t return Tone.GreaterThan;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Gate only passes a signal through when the incoming\n\t\t * signal exceeds a specified threshold. To do this, Gate uses\n\t\t * a Tone.Follower to follow the amplitude of the incoming signal.\n\t\t * A common implementation of this class is a [Noise Gate](https://en.wikipedia.org/wiki/Noise_gate).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Decibels|Object} [threshold] The threshold above which the gate will open.\n\t\t * @param {Time=} attack The follower's attack time\n\t\t * @param {Time=} release The follower's release time\n\t\t * @example\n\t\t * var gate = new Tone.Gate(-30, 0.2, 0.3).toMaster();\n\t\t * var mic = new Tone.UserMedia().connect(gate);\n\t\t * //the gate will only pass through the incoming\n\t\t * //signal when it's louder than -30db\n\t\t */\n\t Tone.Gate = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'threshold',\n\t 'attack',\n\t 'release'\n\t ], Tone.Gate);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * @type {Tone.Follower}\n\t\t\t * @private\n\t\t\t */\n\t this._follower = new Tone.Follower(options.attack, options.release);\n\t /**\n\t\t\t * @type {Tone.GreaterThan}\n\t\t\t * @private\n\t\t\t */\n\t this._gt = new Tone.GreaterThan(Tone.dbToGain(options.threshold));\n\t //the connections\n\t this.input.connect(this.output);\n\t //the control signal\n\t this.input.chain(this._gt, this._follower, this.output.gain);\n\t };\n\t Tone.extend(Tone.Gate, Tone.AudioNode);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Gate.defaults = {\n\t 'attack': 0.1,\n\t 'release': 0.1,\n\t 'threshold': -40\n\t };\n\t /**\n\t\t * The threshold of the gate in decibels\n\t\t * @memberOf Tone.Gate#\n\t\t * @type {Decibels}\n\t\t * @name threshold\n\t\t */\n\t Object.defineProperty(Tone.Gate.prototype, 'threshold', {\n\t get: function () {\n\t return Tone.gainToDb(this._gt.value);\n\t },\n\t set: function (thresh) {\n\t this._gt.value = Tone.dbToGain(thresh);\n\t }\n\t });\n\t /**\n\t\t * The attack speed of the gate\n\t\t * @memberOf Tone.Gate#\n\t\t * @type {Time}\n\t\t * @name attack\n\t\t */\n\t Object.defineProperty(Tone.Gate.prototype, 'attack', {\n\t get: function () {\n\t return this._follower.attack;\n\t },\n\t set: function (attackTime) {\n\t this._follower.attack = attackTime;\n\t }\n\t });\n\t /**\n\t\t * The release speed of the gate\n\t\t * @memberOf Tone.Gate#\n\t\t * @type {Time}\n\t\t * @name release\n\t\t */\n\t Object.defineProperty(Tone.Gate.prototype, 'release', {\n\t get: function () {\n\t return this._follower.release;\n\t },\n\t set: function (releaseTime) {\n\t this._follower.release = releaseTime;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Gate} this\n\t\t */\n\t Tone.Gate.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._follower.dispose();\n\t this._gt.dispose();\n\t this._follower = null;\n\t this._gt = null;\n\t return this;\n\t };\n\t return Tone.Gate;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TickSignal extends Tone.Signal, but adds the capability\n\t\t * to calculate the number of elapsed ticks. exponential and target curves\n\t\t * are approximated with multiple linear ramps.\n\t\t *\n\t\t * Thank you Bruno Dias, H. Sofia Pinto, and David M. Matos, for your [WAC paper](https://smartech.gatech.edu/bitstream/handle/1853/54588/WAC2016-49.pdf)\n\t\t * describing integrating timing functions for tempo calculations.\n\t\t *\n\t\t * @param {Number} value The initial value of the signal\n\t\t * @extends {Tone.Signal}\n\t\t */\n\t Tone.TickSignal = function (value) {\n\t value = Tone.defaultArg(value, 1);\n\t Tone.Signal.call(this, {\n\t 'units': Tone.Type.Ticks,\n\t 'value': value\n\t });\n\t //extend the memory\n\t this._events.memory = Infinity;\n\t //clear the clock from the beginning\n\t this.cancelScheduledValues(0);\n\t //set an initial event\n\t this._events.add({\n\t 'type': Tone.Param.AutomationType.SetValue,\n\t 'time': 0,\n\t 'value': value\n\t });\n\t };\n\t Tone.extend(Tone.TickSignal, Tone.Signal);\n\t /**\n\t\t * Wraps Tone.Signal methods so that they also\n\t\t * record the ticks.\n\t\t * @param {Function} method\n\t\t * @return {Function}\n\t\t * @private\n\t\t */\n\t function _wrapScheduleMethods(method) {\n\t return function (value, time) {\n\t time = this.toSeconds(time);\n\t method.apply(this, arguments);\n\t var event = this._events.get(time);\n\t var previousEvent = this._events.previousEvent(event);\n\t var ticksUntilTime = this._getTicksUntilEvent(previousEvent, time);\n\t event.ticks = Math.max(ticksUntilTime, 0);\n\t return this;\n\t };\n\t }\n\t Tone.TickSignal.prototype.setValueAtTime = _wrapScheduleMethods(Tone.Signal.prototype.setValueAtTime);\n\t Tone.TickSignal.prototype.linearRampToValueAtTime = _wrapScheduleMethods(Tone.Signal.prototype.linearRampToValueAtTime);\n\t /**\n\t\t * Start exponentially approaching the target value at the given time with\n\t\t * a rate having the given time constant.\n\t\t * @param {number} value\n\t\t * @param {Time} startTime\n\t\t * @param {number} timeConstant\n\t\t * @returns {Tone.TickSignal} this\n\t\t */\n\t Tone.TickSignal.prototype.setTargetAtTime = function (value, time, constant) {\n\t //aproximate it with multiple linear ramps\n\t time = this.toSeconds(time);\n\t this.setRampPoint(time);\n\t value = this._fromUnits(value);\n\t //start from previously scheduled value\n\t var prevEvent = this._events.get(time);\n\t var segments = Math.round(Math.max(1 / constant, 1));\n\t for (var i = 0; i <= segments; i++) {\n\t var segTime = constant * i + time;\n\t var rampVal = this._exponentialApproach(prevEvent.time, prevEvent.value, value, constant, segTime);\n\t this.linearRampToValueAtTime(this._toUnits(rampVal), segTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Schedules an exponential continuous change in parameter value from\n\t\t * the previous scheduled parameter value to the given value.\n\t\t * @param {number} value\n\t\t * @param {Time} endTime\n\t\t * @returns {Tone.TickSignal} this\n\t\t */\n\t Tone.TickSignal.prototype.exponentialRampToValueAtTime = function (value, time) {\n\t //aproximate it with multiple linear ramps\n\t time = this.toSeconds(time);\n\t value = this._fromUnits(value);\n\t //start from previously scheduled value\n\t var prevEvent = this._events.get(time);\n\t if (prevEvent === null) {\n\t prevEvent = {\n\t 'value': this._initialValue,\n\t 'time': 0\n\t };\n\t }\n\t //approx 10 segments per second\n\t var segments = Math.round(Math.max((time - prevEvent.time) * 10, 1));\n\t var segmentDur = (time - prevEvent.time) / segments;\n\t for (var i = 0; i <= segments; i++) {\n\t var segTime = segmentDur * i + prevEvent.time;\n\t var rampVal = this._exponentialInterpolate(prevEvent.time, prevEvent.value, time, value, segTime);\n\t this.linearRampToValueAtTime(this._toUnits(rampVal), segTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Returns the tick value at the time. Takes into account\n\t\t * any automation curves scheduled on the signal.\n\t\t * @private\n\t\t * @param {Time} time The time to get the tick count at\n\t\t * @return {Ticks} The number of ticks which have elapsed at the time\n\t\t * given any automations.\n\t\t */\n\t Tone.TickSignal.prototype._getTicksUntilEvent = function (event, time) {\n\t if (event === null) {\n\t event = {\n\t 'ticks': 0,\n\t 'time': 0\n\t };\n\t } else if (Tone.isUndef(event.ticks)) {\n\t var previousEvent = this._events.previousEvent(event);\n\t event.ticks = this._getTicksUntilEvent(previousEvent, event.time);\n\t }\n\t var val0 = this.getValueAtTime(event.time);\n\t var val1 = this.getValueAtTime(time);\n\t //if it's right on the line, take the previous value\n\t if (this._events.get(time).time === time && this._events.get(time).type === Tone.Param.AutomationType.SetValue) {\n\t val1 = this.getValueAtTime(time - this.sampleTime);\n\t }\n\t return 0.5 * (time - event.time) * (val0 + val1) + event.ticks;\n\t };\n\t /**\n\t\t * Returns the tick value at the time. Takes into account\n\t\t * any automation curves scheduled on the signal.\n\t\t * @param {Time} time The time to get the tick count at\n\t\t * @return {Ticks} The number of ticks which have elapsed at the time\n\t\t * given any automations.\n\t\t */\n\t Tone.TickSignal.prototype.getTicksAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var event = this._events.get(time);\n\t return Math.max(this._getTicksUntilEvent(event, time), 0);\n\t };\n\t /**\n\t\t * Return the elapsed time of the number of ticks from the given time\n\t\t * @param {Ticks} ticks The number of ticks to calculate\n\t\t * @param {Time} time The time to get the next tick from\n\t\t * @return {Seconds} The duration of the number of ticks from the given time in seconds\n\t\t */\n\t Tone.TickSignal.prototype.getDurationOfTicks = function (ticks, time) {\n\t time = this.toSeconds(time);\n\t var currentTick = this.getTicksAtTime(time);\n\t return this.getTimeOfTick(currentTick + ticks) - time;\n\t };\n\t /**\n\t\t * Given a tick, returns the time that tick occurs at.\n\t\t * @param {Ticks} tick\n\t\t * @return {Time} The time that the tick occurs.\n\t\t */\n\t Tone.TickSignal.prototype.getTimeOfTick = function (tick) {\n\t var before = this._events.get(tick, 'ticks');\n\t var after = this._events.getAfter(tick, 'ticks');\n\t if (before && before.ticks === tick) {\n\t return before.time;\n\t } else if (before && after && after.type === Tone.Param.AutomationType.Linear && before.value !== after.value) {\n\t var val0 = this.getValueAtTime(before.time);\n\t var val1 = this.getValueAtTime(after.time);\n\t var delta = (val1 - val0) / (after.time - before.time);\n\t var k = Math.sqrt(Math.pow(val0, 2) - 2 * delta * (before.ticks - tick));\n\t var sol1 = (-val0 + k) / delta;\n\t var sol2 = (-val0 - k) / delta;\n\t return (sol1 > 0 ? sol1 : sol2) + before.time;\n\t } else if (before) {\n\t if (before.value === 0) {\n\t return Infinity;\n\t } else {\n\t return before.time + (tick - before.ticks) / before.value;\n\t }\n\t } else {\n\t return tick / this._initialValue;\n\t }\n\t };\n\t /**\n\t\t * Convert some number of ticks their the duration in seconds accounting\n\t\t * for any automation curves starting at the given time.\n\t\t * @param {Ticks} ticks The number of ticks to convert to seconds.\n\t\t * @param {Time} [when=now] When along the automation timeline to convert the ticks.\n\t\t * @return {Tone.Time} The duration in seconds of the ticks.\n\t\t */\n\t Tone.TickSignal.prototype.ticksToTime = function (ticks, when) {\n\t when = this.toSeconds(when);\n\t return new Tone.Time(this.getDurationOfTicks(ticks, when));\n\t };\n\t /**\n\t\t * The inverse of [ticksToTime](#tickstotime). Convert a duration in\n\t\t * seconds to the corresponding number of ticks accounting for any\n\t\t * automation curves starting at the given time.\n\t\t * @param {Time} duration The time interval to convert to ticks.\n\t\t * @param {Time} [when=now] When along the automation timeline to convert the ticks.\n\t\t * @return {Tone.Ticks} The duration in ticks.\n\t\t */\n\t Tone.TickSignal.prototype.timeToTicks = function (duration, when) {\n\t when = this.toSeconds(when);\n\t duration = this.toSeconds(duration);\n\t var startTicks = this.getTicksAtTime(when);\n\t var endTicks = this.getTicksAtTime(when + duration);\n\t return new Tone.Ticks(endTicks - startTicks);\n\t };\n\t return Tone.TickSignal;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A Timeline State. Provides the methods: <code>setStateAtTime(\"state\", time)</code>\n\t\t * and <code>getValueAtTime(time)</code>.\n\t\t *\n\t\t * @extends {Tone.Timeline}\n\t\t * @param {String} initial The initial state of the TimelineState. \n\t\t * Defaults to <code>undefined</code>\n\t\t */\n\t Tone.TimelineState = function (initial) {\n\t Tone.Timeline.call(this);\n\t /**\n\t\t\t * The initial state\n\t\t\t * @private\n\t\t\t * @type {String}\n\t\t\t */\n\t this._initial = initial;\n\t };\n\t Tone.extend(Tone.TimelineState, Tone.Timeline);\n\t /**\n\t\t * Returns the scheduled state scheduled before or at\n\t\t * the given time.\n\t\t * @param {Number} time The time to query.\n\t\t * @return {String} The name of the state input in setStateAtTime.\n\t\t */\n\t Tone.TimelineState.prototype.getValueAtTime = function (time) {\n\t var event = this.get(time);\n\t if (event !== null) {\n\t return event.state;\n\t } else {\n\t return this._initial;\n\t }\n\t };\n\t /**\n\t\t * Add a state to the timeline.\n\t\t * @param {String} state The name of the state to set.\n\t\t * @param {Number} time The time to query.\n\t\t * @returns {Tone.TimelineState} this\n\t\t */\n\t Tone.TimelineState.prototype.setStateAtTime = function (state, time) {\n\t //all state changes need to be >= the previous state time\n\t //TODO throw error if time < the previous event time\n\t this.add({\n\t 'state': state,\n\t 'time': time\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Return the event before the time with the given state\n\t\t * @param {Tone.State} state The state to look for\n\t\t * @param {Time} time When to check before\t\t\t\n\t\t * @return {Object} The event with the given state before the time\n\t\t */\n\t Tone.TimelineState.prototype.getLastState = function (state, time) {\n\t time = this.toSeconds(time);\n\t var index = this._search(time);\n\t for (var i = index; i >= 0; i--) {\n\t var event = this._timeline[i];\n\t if (event.state === state) {\n\t return event;\n\t }\n\t }\n\t };\n\t /**\n\t\t * Return the event after the time with the given state\n\t\t * @param {Tone.State} state The state to look for\n\t\t * @param {Time} time When to check from\n\t\t * @return {Object} The event with the given state after the time\n\t\t */\n\t Tone.TimelineState.prototype.getNextState = function (state, time) {\n\t time = this.toSeconds(time);\n\t var index = this._search(time);\n\t if (index !== -1) {\n\t for (var i = index; i < this._timeline.length; i++) {\n\t var event = this._timeline[i];\n\t if (event.state === state) {\n\t return event;\n\t }\n\t }\n\t }\n\t };\n\t return Tone.TimelineState;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Uses [Tone.TickSignal](TickSignal) to track elapsed ticks with\n\t\t * \t\tcomplex automation curves.\n\t\t *\n\t\t * \t@constructor\n\t * @param {Frequency} frequency The initial frequency that the signal ticks at\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.TickSource = function () {\n\t var options = Tone.defaults(arguments, ['frequency'], Tone.TickSource);\n\t /**\n\t\t\t * The frequency the callback function should be invoked.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.TickSignal(options.frequency, Tone.Type.Frequency);\n\t this._readOnly('frequency');\n\t /**\n\t\t\t * The state timeline\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t this._state.setStateAtTime(Tone.State.Stopped, 0);\n\t /**\n\t\t\t * The offset values of the ticks\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._tickOffset = new Tone.Timeline();\n\t //add the first event\n\t this.setTicksAtTime(0, 0);\n\t };\n\t Tone.extend(Tone.TickSource);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.TickSource.defaults = { 'frequency': 1 };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\", \"stopped\" or \"paused\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.TickSource#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.TickSource.prototype, 'state', {\n\t get: function () {\n\t return this._state.getValueAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Start the clock at the given time. Optionally pass in an offset\n\t\t * of where to start the tick counter from.\n\t\t * @param {Time=} time The time the clock should start\n\t\t * @param {Ticks=0} offset The number of ticks to start the source at\n\t\t * @return {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.start = function (time, offset) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) !== Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t if (Tone.isDefined(offset)) {\n\t this.setTicksAtTime(offset, time);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the clock. Stopping the clock resets the tick counter to 0.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.TickSource} this\n\t\t * @example\n\t\t * clock.stop();\n\t\t */\n\t Tone.TickSource.prototype.stop = function (time) {\n\t time = this.toSeconds(time);\n\t //cancel the previous stop\n\t if (this._state.getValueAtTime(time) === Tone.State.Stopped) {\n\t var event = this._state.get(time);\n\t if (event.time > 0) {\n\t this._tickOffset.cancel(event.time);\n\t this._state.cancel(event.time);\n\t }\n\t }\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t this.setTicksAtTime(0, time);\n\t return this;\n\t };\n\t /**\n\t\t * Pause the clock. Pausing does not reset the tick counter.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.pause = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Paused, time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel start/stop/pause and setTickAtTime events scheduled after the given time.\n\t\t * @param {Time} [time=now] When to clear the events after\n\t\t * @returns {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.cancel = function (time) {\n\t time = this.toSeconds(time);\n\t this._state.cancel(time);\n\t this._tickOffset.cancel(time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the elapsed ticks at the given time\n\t\t * @param {Time} time When to get the tick value\n\t\t * @return {Ticks} The number of ticks\n\t\t */\n\t Tone.TickSource.prototype.getTicksAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var stopEvent = this._state.getLastState(Tone.State.Stopped, time);\n\t //this event allows forEachBetween to iterate until the current time\n\t var tmpEvent = {\n\t state: Tone.State.Paused,\n\t time: time\n\t };\n\t this._state.add(tmpEvent);\n\t //keep track of the previous offset event\n\t var lastState = stopEvent;\n\t var elapsedTicks = 0;\n\t //iterate through all the events since the last stop\n\t this._state.forEachBetween(stopEvent.time, time + this.sampleTime, function (e) {\n\t var periodStartTime = lastState.time;\n\t //if there is an offset event in this period use that\n\t var offsetEvent = this._tickOffset.get(e.time);\n\t if (offsetEvent.time >= lastState.time) {\n\t elapsedTicks = offsetEvent.ticks;\n\t periodStartTime = offsetEvent.time;\n\t }\n\t if (lastState.state === Tone.State.Started && e.state !== Tone.State.Started) {\n\t elapsedTicks += this.frequency.getTicksAtTime(e.time) - this.frequency.getTicksAtTime(periodStartTime);\n\t }\n\t lastState = e;\n\t }.bind(this));\n\t //remove the temporary event\n\t this._state.remove(tmpEvent);\n\t //return the ticks\n\t return elapsedTicks;\n\t };\n\t /**\n\t\t * The number of times the callback was invoked. Starts counting at 0\n\t\t * and increments after the callback was invoked. Returns -1 when stopped.\n\t\t * @memberOf Tone.TickSource#\n\t\t * @name ticks\n\t\t * @type {Ticks}\n\t\t */\n\t Object.defineProperty(Tone.TickSource.prototype, 'ticks', {\n\t get: function () {\n\t return this.getTicksAtTime(this.now());\n\t },\n\t set: function (t) {\n\t this.setTicksAtTime(t, this.now());\n\t }\n\t });\n\t /**\n\t\t * The time since ticks=0 that the TickSource has been running. Accounts\n\t\t * for tempo curves\n\t\t * @memberOf Tone.TickSource#\n\t\t * @name seconds\n\t\t * @type {Seconds}\n\t\t */\n\t Object.defineProperty(Tone.TickSource.prototype, 'seconds', {\n\t get: function () {\n\t return this.getSecondsAtTime(this.now());\n\t },\n\t set: function (s) {\n\t var now = this.now();\n\t var ticks = this.frequency.timeToTicks(s, now);\n\t this.setTicksAtTime(ticks, now);\n\t }\n\t });\n\t /**\n\t\t * Return the elapsed seconds at the given time.\n\t\t * @param {Time} time When to get the elapsed seconds\n\t\t * @return {Seconds} The number of elapsed seconds\n\t\t */\n\t Tone.TickSource.prototype.getSecondsAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t var stopEvent = this._state.getLastState(Tone.State.Stopped, time);\n\t //this event allows forEachBetween to iterate until the current time\n\t var tmpEvent = {\n\t state: Tone.State.Paused,\n\t time: time\n\t };\n\t this._state.add(tmpEvent);\n\t //keep track of the previous offset event\n\t var lastState = stopEvent;\n\t var elapsedSeconds = 0;\n\t //iterate through all the events since the last stop\n\t this._state.forEachBetween(stopEvent.time, time + this.sampleTime, function (e) {\n\t var periodStartTime = lastState.time;\n\t //if there is an offset event in this period use that\n\t var offsetEvent = this._tickOffset.get(e.time);\n\t if (offsetEvent.time >= lastState.time) {\n\t elapsedSeconds = offsetEvent.seconds;\n\t periodStartTime = offsetEvent.time;\n\t }\n\t if (lastState.state === Tone.State.Started && e.state !== Tone.State.Started) {\n\t elapsedSeconds += e.time - periodStartTime;\n\t }\n\t lastState = e;\n\t }.bind(this));\n\t //remove the temporary event\n\t this._state.remove(tmpEvent);\n\t //return the ticks\n\t return elapsedSeconds;\n\t };\n\t /**\n\t\t * Set the clock's ticks at the given time.\n\t\t * @param {Ticks} ticks The tick value to set\n\t\t * @param {Time} time When to set the tick value\n\t\t * @return {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.setTicksAtTime = function (ticks, time) {\n\t time = this.toSeconds(time);\n\t this._tickOffset.cancel(time);\n\t this._tickOffset.add({\n\t 'time': time,\n\t 'ticks': ticks,\n\t 'seconds': this.frequency.getDurationOfTicks(ticks, time)\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Returns the scheduled state at the given time.\n\t\t * @param {Time} time The time to query.\n\t\t * @return {String} The name of the state input in setStateAtTime.\n\t\t * @example\n\t\t * source.start(\"+0.1\");\n\t\t * source.getStateAtTime(\"+0.1\"); //returns \"started\"\n\t\t */\n\t Tone.TickSource.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t return this._state.getValueAtTime(time);\n\t };\n\t /**\n\t\t * Get the time of the given tick. The second argument\n\t\t * is when to test before. Since ticks can be set (with setTicksAtTime)\n\t\t * there may be multiple times for a given tick value. \n\t\t * @param {Ticks} ticks The tick number.\n\t\t * @param {Time=} before When to measure the tick value from. \n\t\t * @return {Time} The time of the tick\n\t\t */\n\t Tone.TickSource.prototype.getTimeOfTick = function (tick, before) {\n\t before = Tone.defaultArg(before, this.now());\n\t var offset = this._tickOffset.get(before);\n\t var event = this._state.get(before);\n\t var startTime = Math.max(offset.time, event.time);\n\t var absoluteTicks = this.frequency.getTicksAtTime(startTime) + tick - offset.ticks;\n\t return this.frequency.getTimeOfTick(absoluteTicks);\n\t };\n\t /**\n\t\t * Invoke the callback event at all scheduled ticks between the \n\t\t * start time and the end time\n\t\t * @param {Time} startTime The beginning of the search range\n\t\t * @param {Time} endTime The end of the search range\n\t\t * @param {Function<Time,Ticks>} callback The callback to invoke with each tick\n\t\t * @return {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.forEachTickBetween = function (startTime, endTime, callback) {\n\t //only iterate through the sections where it is \"started\"\n\t var lastStateEvent = this._state.get(startTime);\n\t this._state.forEachBetween(startTime, endTime, function (event) {\n\t if (lastStateEvent.state === Tone.State.Started && event.state !== Tone.State.Started) {\n\t this.forEachTickBetween(Math.max(lastStateEvent.time, startTime), event.time - this.sampleTime, callback);\n\t }\n\t lastStateEvent = event;\n\t }.bind(this));\n\t startTime = Math.max(lastStateEvent.time, startTime);\n\t if (lastStateEvent.state === Tone.State.Started && this._state) {\n\t //figure out the difference between the frequency ticks and the \n\t var startTicks = this.frequency.getTicksAtTime(startTime);\n\t var ticksAtStart = this.frequency.getTicksAtTime(lastStateEvent.time);\n\t var diff = startTicks - ticksAtStart;\n\t var offset = diff % 1;\n\t if (offset !== 0) {\n\t offset = 1 - offset;\n\t }\n\t var nextTickTime = this.frequency.getTimeOfTick(startTicks + offset);\n\t var error = null;\n\t while (nextTickTime < endTime && this._state) {\n\t try {\n\t callback(nextTickTime, Math.round(this.getTicksAtTime(nextTickTime)));\n\t } catch (e) {\n\t error = e;\n\t break;\n\t }\n\t if (this._state) {\n\t nextTickTime += this.frequency.getDurationOfTicks(1, nextTickTime);\n\t }\n\t }\n\t }\n\t if (error) {\n\t throw error;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.TickSource} this\n\t\t */\n\t Tone.TickSource.prototype.dispose = function () {\n\t Tone.Param.prototype.dispose.call(this);\n\t this._state.dispose();\n\t this._state = null;\n\t this._tickOffset.dispose();\n\t this._tickOffset = null;\n\t this._writable('frequency');\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t return this;\n\t };\n\t return Tone.TickSource;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A sample accurate clock which provides a callback at the given rate.\n\t\t * While the callback is not sample-accurate (it is still susceptible to\n\t\t * loose JS timing), the time passed in as the argument to the callback\n\t\t * is precise. For most applications, it is better to use Tone.Transport\n\t\t * instead of the Clock by itself since you can synchronize multiple callbacks.\n\t\t *\n\t\t * \t@constructor\n\t\t * @extends {Tone.Emitter}\n\t\t * \t@param {function} callback The callback to be invoked with the time of the audio event\n\t\t * \t@param {Frequency} frequency The rate of the callback\n\t\t * \t@example\n\t\t * //the callback will be invoked approximately once a second\n\t\t * //and will print the time exactly once a second apart.\n\t\t * var clock = new Tone.Clock(function(time){\n\t\t * \tconsole.log(time);\n\t\t * }, 1);\n\t\t */\n\t Tone.Clock = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'frequency'\n\t ], Tone.Clock);\n\t Tone.Emitter.call(this);\n\t /**\n\t\t\t * The callback function to invoke at the scheduled tick.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t /**\n\t\t\t * The next time the callback is scheduled.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._nextTick = 0;\n\t /**\n\t\t\t * The tick counter\n\t\t\t * @type {Tone.TickSource}\n\t\t\t * @private\n\t\t\t */\n\t this._tickSource = new Tone.TickSource(options.frequency);\n\t /**\n\t\t\t * The last time the loop callback was invoked\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._lastUpdate = 0;\n\t /**\n\t\t\t * The rate the callback function should be invoked.\n\t\t\t * @type {BPM}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._tickSource.frequency;\n\t this._readOnly('frequency');\n\t /**\n\t\t\t * The state timeline\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t //add an initial state\n\t this._state.setStateAtTime(Tone.State.Stopped, 0);\n\t /**\n\t\t\t * The loop function bound to its context.\n\t\t\t * This is necessary to remove the event in the end.\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._boundLoop = this._loop.bind(this);\n\t //bind a callback to the worker thread\n\t this.context.on('tick', this._boundLoop);\n\t };\n\t Tone.extend(Tone.Clock, Tone.Emitter);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Clock.defaults = {\n\t 'callback': Tone.noOp,\n\t 'frequency': 1\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\", \"stopped\" or \"paused\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Clock#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Clock.prototype, 'state', {\n\t get: function () {\n\t return this._state.getValueAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Start the clock at the given time. Optionally pass in an offset\n\t\t * of where to start the tick counter from.\n\t\t * @param {Time=} time The time the clock should start\n\t\t * @param {Ticks=} offset Where the tick counter starts counting from.\n\t\t * @return {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.start = function (time, offset) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) !== Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t this._tickSource.start(time, offset);\n\t if (time < this._lastUpdate) {\n\t this.emit('start', time, offset);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the clock. Stopping the clock resets the tick counter to 0.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.Clock} this\n\t\t * @example\n\t\t * clock.stop();\n\t\t */\n\t Tone.Clock.prototype.stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t this._tickSource.stop(time);\n\t if (time < this._lastUpdate) {\n\t this.emit('stop', time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Pause the clock. Pausing does not reset the tick counter.\n\t\t * @param {Time} [time=now] The time when the clock should stop.\n\t\t * @returns {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.pause = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Paused, time);\n\t this._tickSource.pause(time);\n\t if (time < this._lastUpdate) {\n\t this.emit('pause', time);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * The number of times the callback was invoked. Starts counting at 0\n\t\t * and increments after the callback was invoked.\n\t\t * @type {Ticks}\n\t\t */\n\t Object.defineProperty(Tone.Clock.prototype, 'ticks', {\n\t get: function () {\n\t return Math.ceil(this.getTicksAtTime(this.now()));\n\t },\n\t set: function (t) {\n\t this._tickSource.ticks = t;\n\t }\n\t });\n\t /**\n\t\t * The time since ticks=0 that the Clock has been running. Accounts\n\t\t * for tempo curves\n\t\t * @type {Seconds}\n\t\t */\n\t Object.defineProperty(Tone.Clock.prototype, 'seconds', {\n\t get: function () {\n\t return this._tickSource.seconds;\n\t },\n\t set: function (s) {\n\t this._tickSource.seconds = s;\n\t }\n\t });\n\t /**\n\t\t * Return the elapsed seconds at the given time.\n\t\t * @param {Time} time When to get the elapsed seconds\n\t\t * @return {Seconds} The number of elapsed seconds\n\t\t */\n\t Tone.Clock.prototype.getSecondsAtTime = function (time) {\n\t return this._tickSource.getSecondsAtTime(time);\n\t };\n\t /**\n\t\t * Set the clock's ticks at the given time.\n\t\t * @param {Ticks} ticks The tick value to set\n\t\t * @param {Time} time When to set the tick value\n\t\t * @return {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.setTicksAtTime = function (ticks, time) {\n\t this._tickSource.setTicksAtTime(ticks, time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the clock's ticks at the given time.\n\t\t * @param {Time} time When to get the tick value\n\t\t * @return {Ticks} The tick value at the given time.\n\t\t */\n\t Tone.Clock.prototype.getTicksAtTime = function (time) {\n\t return this._tickSource.getTicksAtTime(time);\n\t };\n\t /**\n\t\t * Get the time of the next tick\n\t\t * @param {Ticks} ticks The tick number.\n\t\t * @param {Time} before \n\t\t * @return {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.nextTickTime = function (offset, when) {\n\t when = this.toSeconds(when);\n\t var currentTick = this.getTicksAtTime(when);\n\t return this._tickSource.getTimeOfTick(currentTick + offset, when);\n\t };\n\t /**\n\t\t * The scheduling loop.\n\t\t * @private\n\t\t */\n\t Tone.Clock.prototype._loop = function () {\n\t var startTime = this._lastUpdate;\n\t var endTime = this.now();\n\t this._lastUpdate = endTime;\n\t if (startTime !== endTime) {\n\t //the state change events\n\t this._state.forEachBetween(startTime, endTime, function (e) {\n\t switch (e.state) {\n\t case Tone.State.Started:\n\t var offset = this._tickSource.getTicksAtTime(e.time);\n\t this.emit('start', e.time, offset);\n\t break;\n\t case Tone.State.Stopped:\n\t if (e.time !== 0) {\n\t this.emit('stop', e.time);\n\t }\n\t break;\n\t case Tone.State.Paused:\n\t this.emit('pause', e.time);\n\t break;\n\t }\n\t }.bind(this));\n\t //the tick callbacks\n\t this._tickSource.forEachTickBetween(startTime, endTime, function (time, ticks) {\n\t this.callback(time, ticks);\n\t }.bind(this));\n\t }\n\t };\n\t /**\n\t\t * Returns the scheduled state at the given time.\n\t\t * @param {Time} time The time to query.\n\t\t * @return {String} The name of the state input in setStateAtTime.\n\t\t * @example\n\t\t * clock.start(\"+0.1\");\n\t\t * clock.getStateAtTime(\"+0.1\"); //returns \"started\"\n\t\t */\n\t Tone.Clock.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t return this._state.getValueAtTime(time);\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.Clock} this\n\t\t */\n\t Tone.Clock.prototype.dispose = function () {\n\t Tone.Emitter.prototype.dispose.call(this);\n\t this.context.off('tick', this._boundLoop);\n\t this._writable('frequency');\n\t this._tickSource.dispose();\n\t this._tickSource = null;\n\t this.frequency = null;\n\t this._boundLoop = null;\n\t this._nextTick = Infinity;\n\t this.callback = null;\n\t this._state.dispose();\n\t this._state = null;\n\t };\n\t return Tone.Clock;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Similar to Tone.Timeline, but all events represent\n\t\t * intervals with both \"time\" and \"duration\" times. The\n\t\t * events are placed in a tree structure optimized\n\t\t * for querying an intersection point with the timeline\n\t\t * events. Internally uses an [Interval Tree](https://en.wikipedia.org/wiki/Interval_tree)\n\t\t * to represent the data.\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.IntervalTimeline = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * The root node of the inteval tree\n\t\t\t * @type {IntervalNode}\n\t\t\t * @private\n\t\t\t */\n\t this._root = null;\n\t /**\n\t\t\t * Keep track of the length of the timeline.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._length = 0;\n\t };\n\t Tone.extend(Tone.IntervalTimeline);\n\t /**\n\t\t * The event to add to the timeline. All events must\n\t\t * have a time and duration value\n\t\t * @param {Object} event The event to add to the timeline\n\t\t * @return {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.add = function (event) {\n\t if (Tone.isUndef(event.time) || Tone.isUndef(event.duration)) {\n\t throw new Error('Tone.IntervalTimeline: events must have time and duration parameters');\n\t }\n\t event.time = event.time.valueOf();\n\t var node = new IntervalNode(event.time, event.time + event.duration, event);\n\t if (this._root === null) {\n\t this._root = node;\n\t } else {\n\t this._root.insert(node);\n\t }\n\t this._length++;\n\t // Restructure tree to be balanced\n\t while (node !== null) {\n\t node.updateHeight();\n\t node.updateMax();\n\t this._rebalance(node);\n\t node = node.parent;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Remove an event from the timeline.\n\t\t * @param {Object} event The event to remove from the timeline\n\t\t * @return {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.remove = function (event) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.search(event.time, results);\n\t for (var i = 0; i < results.length; i++) {\n\t var node = results[i];\n\t if (node.event === event) {\n\t this._removeNode(node);\n\t this._length--;\n\t break;\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * The number of items in the timeline.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.IntervalTimeline#\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.IntervalTimeline.prototype, 'length', {\n\t get: function () {\n\t return this._length;\n\t }\n\t });\n\t /**\n\t\t * Remove events whose time time is after the given time\n\t\t * @param {Number} time The time to query.\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.cancel = function (after) {\n\t this.forEachFrom(after, function (event) {\n\t this.remove(event);\n\t }.bind(this));\n\t return this;\n\t };\n\t /**\n\t\t * Set the root node as the given node\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._setRoot = function (node) {\n\t this._root = node;\n\t if (this._root !== null) {\n\t this._root.parent = null;\n\t }\n\t };\n\t /**\n\t\t * Replace the references to the node in the node's parent\n\t\t * with the replacement node.\n\t\t * @param {IntervalNode} node\n\t\t * @param {IntervalNode} replacement\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._replaceNodeInParent = function (node, replacement) {\n\t if (node.parent !== null) {\n\t if (node.isLeftChild()) {\n\t node.parent.left = replacement;\n\t } else {\n\t node.parent.right = replacement;\n\t }\n\t this._rebalance(node.parent);\n\t } else {\n\t this._setRoot(replacement);\n\t }\n\t };\n\t /**\n\t\t * Remove the node from the tree and replace it with\n\t\t * a successor which follows the schema.\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._removeNode = function (node) {\n\t if (node.left === null && node.right === null) {\n\t this._replaceNodeInParent(node, null);\n\t } else if (node.right === null) {\n\t this._replaceNodeInParent(node, node.left);\n\t } else if (node.left === null) {\n\t this._replaceNodeInParent(node, node.right);\n\t } else {\n\t var balance = node.getBalance();\n\t var replacement, temp;\n\t if (balance > 0) {\n\t if (node.left.right === null) {\n\t replacement = node.left;\n\t replacement.right = node.right;\n\t temp = replacement;\n\t } else {\n\t replacement = node.left.right;\n\t while (replacement.right !== null) {\n\t replacement = replacement.right;\n\t }\n\t replacement.parent.right = replacement.left;\n\t temp = replacement.parent;\n\t replacement.left = node.left;\n\t replacement.right = node.right;\n\t }\n\t } else if (node.right.left === null) {\n\t replacement = node.right;\n\t replacement.left = node.left;\n\t temp = replacement;\n\t } else {\n\t replacement = node.right.left;\n\t while (replacement.left !== null) {\n\t replacement = replacement.left;\n\t }\n\t replacement.parent = replacement.parent;\n\t replacement.parent.left = replacement.right;\n\t temp = replacement.parent;\n\t replacement.left = node.left;\n\t replacement.right = node.right;\n\t }\n\t if (node.parent !== null) {\n\t if (node.isLeftChild()) {\n\t node.parent.left = replacement;\n\t } else {\n\t node.parent.right = replacement;\n\t }\n\t } else {\n\t this._setRoot(replacement);\n\t }\n\t // this._replaceNodeInParent(node, replacement);\n\t this._rebalance(temp);\n\t }\n\t node.dispose();\n\t };\n\t /**\n\t\t * Rotate the tree to the left\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._rotateLeft = function (node) {\n\t var parent = node.parent;\n\t var isLeftChild = node.isLeftChild();\n\t // Make node.right the new root of this sub tree (instead of node)\n\t var pivotNode = node.right;\n\t node.right = pivotNode.left;\n\t pivotNode.left = node;\n\t if (parent !== null) {\n\t if (isLeftChild) {\n\t parent.left = pivotNode;\n\t } else {\n\t parent.right = pivotNode;\n\t }\n\t } else {\n\t this._setRoot(pivotNode);\n\t }\n\t };\n\t /**\n\t\t * Rotate the tree to the right\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._rotateRight = function (node) {\n\t var parent = node.parent;\n\t var isLeftChild = node.isLeftChild();\n\t // Make node.left the new root of this sub tree (instead of node)\n\t var pivotNode = node.left;\n\t node.left = pivotNode.right;\n\t pivotNode.right = node;\n\t if (parent !== null) {\n\t if (isLeftChild) {\n\t parent.left = pivotNode;\n\t } else {\n\t parent.right = pivotNode;\n\t }\n\t } else {\n\t this._setRoot(pivotNode);\n\t }\n\t };\n\t /**\n\t\t * Balance the BST\n\t\t * @param {IntervalNode} node\n\t\t * @private\n\t\t */\n\t Tone.IntervalTimeline.prototype._rebalance = function (node) {\n\t var balance = node.getBalance();\n\t if (balance > 1) {\n\t if (node.left.getBalance() < 0) {\n\t this._rotateLeft(node.left);\n\t } else {\n\t this._rotateRight(node);\n\t }\n\t } else if (balance < -1) {\n\t if (node.right.getBalance() > 0) {\n\t this._rotateRight(node.right);\n\t } else {\n\t this._rotateLeft(node);\n\t }\n\t }\n\t };\n\t /**\n\t\t * Get an event whose time and duration span the give time. Will\n\t\t * return the match whose \"time\" value is closest to the given time.\n\t\t * @param {Object} event The event to add to the timeline\n\t\t * @return {Object} The event which spans the desired time\n\t\t */\n\t Tone.IntervalTimeline.prototype.get = function (time) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.search(time, results);\n\t if (results.length > 0) {\n\t var max = results[0];\n\t for (var i = 1; i < results.length; i++) {\n\t if (results[i].low > max.low) {\n\t max = results[i];\n\t }\n\t }\n\t return max.event;\n\t }\n\t }\n\t return null;\n\t };\n\t /**\n\t\t * Iterate over everything in the timeline.\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.forEach = function (callback) {\n\t if (this._root !== null) {\n\t var allNodes = [];\n\t this._root.traverse(function (node) {\n\t allNodes.push(node);\n\t });\n\t for (var i = 0; i < allNodes.length; i++) {\n\t var ev = allNodes[i].event;\n\t if (ev) {\n\t callback(ev);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array in which the given time\n\t\t * overlaps with the time and duration time of the event.\n\t\t * @param {Number} time The time to check if items are overlapping\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.forEachAtTime = function (time, callback) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.search(time, results);\n\t for (var i = results.length - 1; i >= 0; i--) {\n\t var ev = results[i].event;\n\t if (ev) {\n\t callback(ev);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over everything in the array in which the time is greater\n\t\t * than or equal to the given time.\n\t\t * @param {Number} time The time to check if items are before\n\t\t * @param {Function} callback The callback to invoke with every item\n\t\t * @returns {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.forEachFrom = function (time, callback) {\n\t if (this._root !== null) {\n\t var results = [];\n\t this._root.searchAfter(time, results);\n\t for (var i = results.length - 1; i >= 0; i--) {\n\t var ev = results[i].event;\n\t callback(ev);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.IntervalTimeline} this\n\t\t */\n\t Tone.IntervalTimeline.prototype.dispose = function () {\n\t var allNodes = [];\n\t if (this._root !== null) {\n\t this._root.traverse(function (node) {\n\t allNodes.push(node);\n\t });\n\t }\n\t for (var i = 0; i < allNodes.length; i++) {\n\t allNodes[i].dispose();\n\t }\n\t allNodes = null;\n\t this._root = null;\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tINTERVAL NODE HELPER\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Represents a node in the binary search tree, with the addition\n\t\t * of a \"high\" value which keeps track of the highest value of\n\t\t * its children.\n\t\t * References:\n\t\t * https://brooknovak.wordpress.com/2013/12/07/augmented-interval-tree-in-c/\n\t\t * http://www.mif.vu.lt/~valdas/ALGORITMAI/LITERATURA/Cormen/Cormen.pdf\n\t\t * @param {Number} low\n\t\t * @param {Number} high\n\t\t * @private\n\t\t */\n\t var IntervalNode = function (low, high, event) {\n\t //the event container\n\t this.event = event;\n\t //the low value\n\t this.low = low;\n\t //the high value\n\t this.high = high;\n\t //the high value for this and all child nodes\n\t this.max = this.high;\n\t //the nodes to the left\n\t this._left = null;\n\t //the nodes to the right\n\t this._right = null;\n\t //the parent node\n\t this.parent = null;\n\t //the number of child nodes\n\t this.height = 0;\n\t };\n\t /**\n\t\t * Insert a node into the correct spot in the tree\n\t\t * @param {IntervalNode} node\n\t\t */\n\t IntervalNode.prototype.insert = function (node) {\n\t if (node.low <= this.low) {\n\t if (this.left === null) {\n\t this.left = node;\n\t } else {\n\t this.left.insert(node);\n\t }\n\t } else if (this.right === null) {\n\t this.right = node;\n\t } else {\n\t this.right.insert(node);\n\t }\n\t };\n\t /**\n\t\t * Search the tree for nodes which overlap\n\t\t * with the given point\n\t\t * @param {Number} point The point to query\n\t\t * @param {Array} results The array to put the results\n\t\t */\n\t IntervalNode.prototype.search = function (point, results) {\n\t // If p is to the right of the rightmost point of any interval\n\t // in this node and all children, there won't be any matches.\n\t if (point > this.max) {\n\t return;\n\t }\n\t // Search left children\n\t if (this.left !== null) {\n\t this.left.search(point, results);\n\t }\n\t // Check this node\n\t if (this.low <= point && this.high > point) {\n\t results.push(this);\n\t }\n\t // If p is to the left of the time of this interval,\n\t // then it can't be in any child to the right.\n\t if (this.low > point) {\n\t return;\n\t }\n\t // Search right children\n\t if (this.right !== null) {\n\t this.right.search(point, results);\n\t }\n\t };\n\t /**\n\t\t * Search the tree for nodes which are less\n\t\t * than the given point\n\t\t * @param {Number} point The point to query\n\t\t * @param {Array} results The array to put the results\n\t\t */\n\t IntervalNode.prototype.searchAfter = function (point, results) {\n\t // Check this node\n\t if (this.low >= point) {\n\t results.push(this);\n\t if (this.left !== null) {\n\t this.left.searchAfter(point, results);\n\t }\n\t }\n\t // search the right side\n\t if (this.right !== null) {\n\t this.right.searchAfter(point, results);\n\t }\n\t };\n\t /**\n\t\t * Invoke the callback on this element and both it's branches\n\t\t * @param {Function} callback\n\t\t */\n\t IntervalNode.prototype.traverse = function (callback) {\n\t callback(this);\n\t if (this.left !== null) {\n\t this.left.traverse(callback);\n\t }\n\t if (this.right !== null) {\n\t this.right.traverse(callback);\n\t }\n\t };\n\t /**\n\t\t * Update the height of the node\n\t\t */\n\t IntervalNode.prototype.updateHeight = function () {\n\t if (this.left !== null && this.right !== null) {\n\t this.height = Math.max(this.left.height, this.right.height) + 1;\n\t } else if (this.right !== null) {\n\t this.height = this.right.height + 1;\n\t } else if (this.left !== null) {\n\t this.height = this.left.height + 1;\n\t } else {\n\t this.height = 0;\n\t }\n\t };\n\t /**\n\t\t * Update the height of the node\n\t\t */\n\t IntervalNode.prototype.updateMax = function () {\n\t this.max = this.high;\n\t if (this.left !== null) {\n\t this.max = Math.max(this.max, this.left.max);\n\t }\n\t if (this.right !== null) {\n\t this.max = Math.max(this.max, this.right.max);\n\t }\n\t };\n\t /**\n\t\t * The balance is how the leafs are distributed on the node\n\t\t * @return {Number} Negative numbers are balanced to the right\n\t\t */\n\t IntervalNode.prototype.getBalance = function () {\n\t var balance = 0;\n\t if (this.left !== null && this.right !== null) {\n\t balance = this.left.height - this.right.height;\n\t } else if (this.left !== null) {\n\t balance = this.left.height + 1;\n\t } else if (this.right !== null) {\n\t balance = -(this.right.height + 1);\n\t }\n\t return balance;\n\t };\n\t /**\n\t\t * @returns {Boolean} true if this node is the left child\n\t\t * of its parent\n\t\t */\n\t IntervalNode.prototype.isLeftChild = function () {\n\t return this.parent !== null && this.parent.left === this;\n\t };\n\t /**\n\t\t * get/set the left node\n\t\t * @type {IntervalNode}\n\t\t */\n\t Object.defineProperty(IntervalNode.prototype, 'left', {\n\t get: function () {\n\t return this._left;\n\t },\n\t set: function (node) {\n\t this._left = node;\n\t if (node !== null) {\n\t node.parent = this;\n\t }\n\t this.updateHeight();\n\t this.updateMax();\n\t }\n\t });\n\t /**\n\t\t * get/set the right node\n\t\t * @type {IntervalNode}\n\t\t */\n\t Object.defineProperty(IntervalNode.prototype, 'right', {\n\t get: function () {\n\t return this._right;\n\t },\n\t set: function (node) {\n\t this._right = node;\n\t if (node !== null) {\n\t node.parent = this;\n\t }\n\t this.updateHeight();\n\t this.updateMax();\n\t }\n\t });\n\t /**\n\t\t * null out references.\n\t\t */\n\t IntervalNode.prototype.dispose = function () {\n\t this.parent = null;\n\t this._left = null;\n\t this._right = null;\n\t this.event = null;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tEND INTERVAL NODE HELPER\n\t ///////////////////////////////////////////////////////////////////////////\n\t return Tone.IntervalTimeline;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Ticks is a primitive type for encoding Time values.\n\t\t * Tone.Ticks can be constructed with or without the `new` keyword. Tone.Ticks can be passed\n\t\t * into the parameter of any method which takes time as an argument.\n\t\t * @constructor\n\t\t * @extends {Tone.TransportTime}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * var t = Tone.Ticks(\"4n\");//a quarter note\n\t\t */\n\t Tone.Ticks = function (val, units) {\n\t if (this instanceof Tone.Ticks) {\n\t Tone.TransportTime.call(this, val, units);\n\t } else {\n\t return new Tone.Ticks(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Ticks, Tone.TransportTime);\n\t /**\n\t\t * The default units if none are given.\n\t\t * @type {String}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._defaultUnits = 'i';\n\t /**\n\t\t * Get the current time in the given units\n\t\t * @return {Ticks}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._now = function () {\n\t return Tone.Transport.ticks;\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._beatsToUnits = function (beats) {\n\t return this._getPPQ() * beats;\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._secondsToUnits = function (seconds) {\n\t return seconds / (60 / this._getBpm()) * this._getPPQ();\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Ticks.prototype._ticksToUnits = function (ticks) {\n\t return ticks;\n\t };\n\t /**\n\t\t * Return the time in ticks\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Ticks.prototype.toTicks = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the time in ticks\n\t\t * @return {Ticks}\n\t\t */\n\t Tone.Ticks.prototype.toSeconds = function () {\n\t return this.valueOf() / this._getPPQ() * (60 / this._getBpm());\n\t };\n\t return Tone.Ticks;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportEvent is an internal class used by (Tone.Transport)[Transport]\n\t\t * to schedule events. Do no invoke this class directly, it is\n\t\t * handled from within Tone.Transport.\n\t\t * @extends {Tone}\n\t\t * @param {Object} options\n\t\t */\n\t Tone.TransportEvent = function (Transport, options) {\n\t options = Tone.defaultArg(options, Tone.TransportEvent.defaults);\n\t Tone.call(this);\n\t /**\n\t\t\t * Reference to the Transport that created it\n\t\t\t * @type {Tone.Transport}\n\t\t\t */\n\t this.Transport = Transport;\n\t /**\n\t\t\t * The unique id of the event\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.id = Tone.TransportEvent._eventId++;\n\t /**\n\t\t\t * The time the event starts\n\t\t\t * @type {Ticks}\n\t\t\t */\n\t this.time = Tone.Ticks(options.time);\n\t /**\n\t\t\t * The callback to invoke\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t /**\n\t\t\t * If the event should be removed after being created.\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._once = options.once;\n\t };\n\t Tone.extend(Tone.TransportEvent);\n\t /**\n\t\t * The defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.TransportEvent.defaults = {\n\t 'once': false,\n\t 'callback': Tone.noOp\n\t };\n\t /**\n\t\t * Current ID counter\n\t\t * @private\n\t\t * @static\n\t\t * @type {Number}\n\t\t */\n\t Tone.TransportEvent._eventId = 0;\n\t /**\n\t\t * Invoke the event callback.\n\t\t * @param {Time} time The AudioContext time in seconds of the event\n\t\t */\n\t Tone.TransportEvent.prototype.invoke = function (time) {\n\t if (this.callback) {\n\t this.callback(time);\n\t if (this._once && this.Transport) {\n\t this.Transport.clear(this.id);\n\t }\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.TransportEvent} this\n\t\t */\n\t Tone.TransportEvent.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this.Transport = null;\n\t this.callback = null;\n\t this.time = null;\n\t return this;\n\t };\n\t return Tone.TransportEvent;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportRepeatEvent is an internal class used by Tone.Transport\n\t\t * to schedule repeat events. This class should not be instantiated directly.\n\t\t * @extends {Tone.TransportEvent}\n\t\t * @param {Object} options\n\t\t */\n\t Tone.TransportRepeatEvent = function (Transport, options) {\n\t Tone.TransportEvent.call(this, Transport, options);\n\t options = Tone.defaultArg(options, Tone.TransportRepeatEvent.defaults);\n\t /**\n\t\t\t * When the event should stop repeating\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this.duration = Tone.Ticks(options.duration);\n\t /**\n\t\t\t * The interval of the repeated event\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._interval = Tone.Ticks(options.interval);\n\t /**\n\t\t\t * The ID of the current timeline event\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._currentId = -1;\n\t /**\n\t\t\t * The ID of the next timeline event\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._nextId = -1;\n\t /**\n\t\t\t * The time of the next event\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._nextTick = this.time;\n\t /**\n\t\t\t * a reference to the bound start method\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._boundRestart = this._restart.bind(this);\n\t this.Transport.on('start loopStart', this._boundRestart);\n\t this._restart();\n\t };\n\t Tone.extend(Tone.TransportRepeatEvent, Tone.TransportEvent);\n\t /**\n\t\t * The defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.TransportRepeatEvent.defaults = {\n\t 'duration': Infinity,\n\t 'interval': 1\n\t };\n\t /**\n\t\t * Invoke the callback. Returns the tick time which\n\t\t * the next event should be scheduled at.\n\t\t * @param {Number} time The AudioContext time in seconds of the event\n\t\t */\n\t Tone.TransportRepeatEvent.prototype.invoke = function (time) {\n\t //create more events if necessary\n\t this._createEvents(time);\n\t //call the super class\n\t Tone.TransportEvent.prototype.invoke.call(this, time);\n\t };\n\t /**\n\t\t * Push more events onto the timeline to keep up with the position of the timeline\n\t\t * @private\n\t\t */\n\t Tone.TransportRepeatEvent.prototype._createEvents = function (time) {\n\t // schedule the next event\n\t var ticks = this.Transport.getTicksAtTime(time);\n\t if (ticks >= this.time && ticks >= this._nextTick && this._nextTick + this._interval < this.time + this.duration) {\n\t this._nextTick += this._interval;\n\t this._currentId = this._nextId;\n\t this._nextId = this.Transport.scheduleOnce(this.invoke.bind(this), Tone.Ticks(this._nextTick));\n\t }\n\t };\n\t /**\n\t\t * Push more events onto the timeline to keep up with the position of the timeline\n\t\t * @private\n\t\t */\n\t Tone.TransportRepeatEvent.prototype._restart = function (time) {\n\t this.Transport.clear(this._currentId);\n\t this.Transport.clear(this._nextId);\n\t this._nextTick = this.time;\n\t var ticks = this.Transport.getTicksAtTime(time);\n\t if (ticks > this.time) {\n\t this._nextTick = this.time + Math.ceil((ticks - this.time) / this._interval) * this._interval;\n\t }\n\t this._currentId = this.Transport.scheduleOnce(this.invoke.bind(this), Tone.Ticks(this._nextTick));\n\t this._nextTick += this._interval;\n\t this._nextId = this.Transport.scheduleOnce(this.invoke.bind(this), Tone.Ticks(this._nextTick));\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.TransportRepeatEvent} this\n\t\t */\n\t Tone.TransportRepeatEvent.prototype.dispose = function () {\n\t this.Transport.clear(this._currentId);\n\t this.Transport.clear(this._nextId);\n\t this.Transport.off('start loopStart', this._boundRestart);\n\t this._boundCreateEvents = null;\n\t Tone.TransportEvent.prototype.dispose.call(this);\n\t this.duration = null;\n\t this._interval = null;\n\t return this;\n\t };\n\t return Tone.TransportRepeatEvent;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Transport for timing musical events.\n\t\t * Supports tempo curves and time changes. Unlike browser-based timing (setInterval, requestAnimationFrame)\n\t\t * Tone.Transport timing events pass in the exact time of the scheduled event\n\t\t * in the argument of the callback function. Pass that time value to the object\n\t\t * you're scheduling. <br><br>\n\t\t * A single transport is created for you when the library is initialized.\n\t\t * <br><br>\n\t\t * The transport emits the events: \"start\", \"stop\", \"pause\", and \"loop\" which are\n\t\t * called with the time of that event as the argument.\n\t\t *\n\t\t * @extends {Tone.Emitter}\n\t\t * @singleton\n\t\t * @example\n\t\t * //repeated event every 8th note\n\t\t * Tone.Transport.scheduleRepeat(function(time){\n\t\t * \t//do something with the time\n\t\t * }, \"8n\");\n\t\t * @example\n\t\t * //schedule an event on the 16th measure\n\t\t * Tone.Transport.schedule(function(time){\n\t\t * \t//do something with the time\n\t\t * }, \"16:0:0\");\n\t\t */\n\t Tone.Transport = function () {\n\t Tone.Emitter.call(this);\n\t Tone.getContext(function () {\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tLOOPING\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * \tIf the transport loops or not.\n\t\t\t\t * @type {boolean}\n\t\t\t\t */\n\t this.loop = false;\n\t /**\n\t\t\t\t * \tThe loop start position in ticks\n\t\t\t\t * @type {Ticks}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._loopStart = 0;\n\t /**\n\t\t\t\t * \tThe loop end position in ticks\n\t\t\t\t * @type {Ticks}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._loopEnd = 0;\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tCLOCK/TEMPO\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * Pulses per quarter is the number of ticks per quarter note.\n\t\t\t\t * @private\n\t\t\t\t * @type {Number}\n\t\t\t\t */\n\t this._ppq = TransportConstructor.defaults.PPQ;\n\t /**\n\t\t\t\t * watches the main oscillator for timing ticks\n\t\t\t\t * initially starts at 120bpm\n\t\t\t\t * @private\n\t\t\t\t * @type {Tone.Clock}\n\t\t\t\t */\n\t this._clock = new Tone.Clock({\n\t 'callback': this._processTick.bind(this),\n\t 'frequency': 0\n\t });\n\t this._bindClockEvents();\n\t /**\n\t\t\t\t * The Beats Per Minute of the Transport.\n\t\t\t\t * @type {BPM}\n\t\t\t\t * @signal\n\t\t\t\t * @example\n\t\t\t\t * Tone.Transport.bpm.value = 80;\n\t\t\t\t * //ramp the bpm to 120 over 10 seconds\n\t\t\t\t * Tone.Transport.bpm.rampTo(120, 10);\n\t\t\t\t */\n\t this.bpm = this._clock.frequency;\n\t this.bpm._toUnits = this._toUnits.bind(this);\n\t this.bpm._fromUnits = this._fromUnits.bind(this);\n\t this.bpm.units = Tone.Type.BPM;\n\t this.bpm.value = TransportConstructor.defaults.bpm;\n\t this._readOnly('bpm');\n\t /**\n\t\t\t\t * The time signature, or more accurately the numerator\n\t\t\t\t * of the time signature over a denominator of 4.\n\t\t\t\t * @type {Number}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._timeSignature = TransportConstructor.defaults.timeSignature;\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tTIMELINE EVENTS\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * All the events in an object to keep track by ID\n\t\t\t\t * @type {Object}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._scheduledEvents = {};\n\t /**\n\t\t\t\t * \tThe scheduled events.\n\t\t\t\t * @type {Tone.Timeline}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._timeline = new Tone.Timeline();\n\t /**\n\t\t\t\t * Repeated events\n\t\t\t\t * @type {Array}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._repeatedEvents = new Tone.IntervalTimeline();\n\t /**\n\t\t\t\t * All of the synced Signals\n\t\t\t\t * @private\n\t\t\t\t * @type {Array}\n\t\t\t\t */\n\t this._syncedSignals = [];\n\t ///////////////////////////////////////////////////////////////////////\n\t //\tSWING\n\t //////////////////////////////////////////////////////////////////////\n\t /**\n\t\t\t\t * The subdivision of the swing\n\t\t\t\t * @type {Ticks}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._swingTicks = TransportConstructor.defaults.PPQ / 2;\n\t //8n\n\t /**\n\t\t\t\t * The swing amount\n\t\t\t\t * @type {NormalRange}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._swingAmount = 0;\n\t }.bind(this));\n\t };\n\t Tone.extend(Tone.Transport, Tone.Emitter);\n\t /**\n\t\t * the defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.Transport.defaults = {\n\t 'bpm': 120,\n\t 'swing': 0,\n\t 'swingSubdivision': '8n',\n\t 'timeSignature': 4,\n\t 'loopStart': 0,\n\t 'loopEnd': '4m',\n\t 'PPQ': 192\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tTICKS\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * called on every tick\n\t\t * @param {number} tickTime clock relative tick time\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._processTick = function (tickTime, ticks) {\n\t //handle swing\n\t if (this._swingAmount > 0 && ticks % this._ppq !== 0 && //not on a downbeat\n\t ticks % (this._swingTicks * 2) !== 0) {\n\t //add some swing\n\t var progress = ticks % (this._swingTicks * 2) / (this._swingTicks * 2);\n\t var amount = Math.sin(progress * Math.PI) * this._swingAmount;\n\t tickTime += Tone.Ticks(this._swingTicks * 2 / 3).toSeconds() * amount;\n\t }\n\t //do the loop test\n\t if (this.loop) {\n\t if (ticks >= this._loopEnd) {\n\t this.emit('loopEnd', tickTime);\n\t this._clock.setTicksAtTime(this._loopStart, tickTime);\n\t ticks = this._loopStart;\n\t this.emit('loopStart', tickTime, this._clock.getSecondsAtTime(tickTime));\n\t this.emit('loop', tickTime);\n\t }\n\t }\n\t //invoke the timeline events scheduled on this tick\n\t this._timeline.forEachAtTime(ticks, function (event) {\n\t event.invoke(tickTime);\n\t });\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSCHEDULABLE EVENTS\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Schedule an event along the timeline.\n\t\t * @param {Function} callback The callback to be invoked at the time.\n\t\t * @param {TransportTime} time The time to invoke the callback at.\n\t\t * @return {Number} The id of the event which can be used for canceling the event.\n\t\t * @example\n\t\t * //trigger the callback when the Transport reaches the desired time\n\t\t * Tone.Transport.schedule(function(time){\n\t\t * \tenvelope.triggerAttack(time);\n\t\t * }, \"128i\");\n\t\t */\n\t Tone.Transport.prototype.schedule = function (callback, time) {\n\t var event = new Tone.TransportEvent(this, {\n\t 'time': Tone.TransportTime(time),\n\t 'callback': callback\n\t });\n\t return this._addEvent(event, this._timeline);\n\t };\n\t /**\n\t\t * Schedule a repeated event along the timeline. The event will fire\n\t\t * at the `interval` starting at the `startTime` and for the specified\n\t\t * `duration`.\n\t\t * @param {Function} callback The callback to invoke.\n\t\t * @param {Time} interval The duration between successive\n\t\t * callbacks. Must be a positive number.\n\t\t * @param {TransportTime=} startTime When along the timeline the events should\n\t\t * start being invoked.\n\t\t * @param {Time} [duration=Infinity] How long the event should repeat.\n\t\t * @return {Number} The ID of the scheduled event. Use this to cancel\n\t\t * the event.\n\t\t * @example\n\t\t * //a callback invoked every eighth note after the first measure\n\t\t * Tone.Transport.scheduleRepeat(callback, \"8n\", \"1m\");\n\t\t */\n\t Tone.Transport.prototype.scheduleRepeat = function (callback, interval, startTime, duration) {\n\t var event = new Tone.TransportRepeatEvent(this, {\n\t 'callback': callback,\n\t 'interval': Tone.Time(interval),\n\t 'time': Tone.TransportTime(startTime),\n\t 'duration': Tone.Time(Tone.defaultArg(duration, Infinity))\n\t });\n\t //kick it off if the Transport is started\n\t return this._addEvent(event, this._repeatedEvents);\n\t };\n\t /**\n\t\t * Schedule an event that will be removed after it is invoked.\n\t\t * Note that if the given time is less than the current transport time,\n\t\t * the event will be invoked immediately.\n\t\t * @param {Function} callback The callback to invoke once.\n\t\t * @param {TransportTime} time The time the callback should be invoked.\n\t\t * @returns {Number} The ID of the scheduled event.\n\t\t */\n\t Tone.Transport.prototype.scheduleOnce = function (callback, time) {\n\t var event = new Tone.TransportEvent(this, {\n\t 'time': Tone.TransportTime(time),\n\t 'callback': callback,\n\t 'once': true\n\t });\n\t return this._addEvent(event, this._timeline);\n\t };\n\t /**\n\t\t * Clear the passed in event id from the timeline\n\t\t * @param {Number} eventId The id of the event.\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.clear = function (eventId) {\n\t if (this._scheduledEvents.hasOwnProperty(eventId)) {\n\t var item = this._scheduledEvents[eventId.toString()];\n\t item.timeline.remove(item.event);\n\t item.event.dispose();\n\t delete this._scheduledEvents[eventId.toString()];\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Add an event to the correct timeline. Keep track of the\n\t\t * timeline it was added to.\n\t\t * @param {Tone.TransportEvent}\tevent\n\t\t * @param {Tone.Timeline} timeline\n\t\t * @returns {Number} the event id which was just added\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._addEvent = function (event, timeline) {\n\t this._scheduledEvents[event.id.toString()] = {\n\t 'event': event,\n\t 'timeline': timeline\n\t };\n\t timeline.add(event);\n\t return event.id;\n\t };\n\t /**\n\t\t * Remove scheduled events from the timeline after\n\t\t * the given time. Repeated events will be removed\n\t\t * if their startTime is after the given time\n\t\t * @param {TransportTime} [after=0] Clear all events after\n\t\t * this time.\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.cancel = function (after) {\n\t after = Tone.defaultArg(after, 0);\n\t after = this.toTicks(after);\n\t this._timeline.forEachFrom(after, function (event) {\n\t this.clear(event.id);\n\t }.bind(this));\n\t this._repeatedEvents.forEachFrom(after, function (event) {\n\t this.clear(event.id);\n\t }.bind(this));\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSTART/STOP/PAUSE\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Bind start/stop/pause events from the clock and emit them.\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._bindClockEvents = function () {\n\t this._clock.on('start', function (time, offset) {\n\t offset = Tone.Ticks(offset).toSeconds();\n\t this.emit('start', time, offset);\n\t }.bind(this));\n\t this._clock.on('stop', function (time) {\n\t this.emit('stop', time);\n\t }.bind(this));\n\t this._clock.on('pause', function (time) {\n\t this.emit('pause', time);\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\", \"stopped\", or \"paused\"\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Transport#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'state', {\n\t get: function () {\n\t return this._clock.getStateAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Start the transport and all sources synced to the transport.\n\t\t * @param {Time} [time=now] The time when the transport should start.\n\t\t * @param {TransportTime=} offset The timeline offset to start the transport.\n\t\t * @returns {Tone.Transport} this\n\t\t * @example\n\t\t * //start the transport in one second starting at beginning of the 5th measure.\n\t\t * Tone.Transport.start(\"+1\", \"4:0:0\");\n\t\t */\n\t Tone.Transport.prototype.start = function (time, offset) {\n\t //start the clock\n\t if (Tone.isDefined(offset)) {\n\t offset = this.toTicks(offset);\n\t }\n\t this._clock.start(time, offset);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the transport and all sources synced to the transport.\n\t\t * @param {Time} [time=now] The time when the transport should stop.\n\t\t * @returns {Tone.Transport} this\n\t\t * @example\n\t\t * Tone.Transport.stop();\n\t\t */\n\t Tone.Transport.prototype.stop = function (time) {\n\t this._clock.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Pause the transport and all sources synced to the transport.\n\t\t * @param {Time} [time=now]\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.pause = function (time) {\n\t this._clock.pause(time);\n\t return this;\n\t };\n\t /**\n\t\t * Toggle the current state of the transport. If it is\n\t\t * started, it will stop it, otherwise it will start the Transport.\n\t\t * @param {Time=} time The time of the event\n\t\t * @return {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.toggle = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._clock.getStateAtTime(time) !== Tone.State.Started) {\n\t this.start(time);\n\t } else {\n\t this.stop(time);\n\t }\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSETTERS/GETTERS\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * The time signature as just the numerator over 4.\n\t\t * For example 4/4 would be just 4 and 6/8 would be 3.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Number|Array}\n\t\t * @name timeSignature\n\t\t * @example\n\t\t * //common time\n\t\t * Tone.Transport.timeSignature = 4;\n\t\t * // 7/8\n\t\t * Tone.Transport.timeSignature = [7, 8];\n\t\t * //this will be reduced to a single number\n\t\t * Tone.Transport.timeSignature; //returns 3.5\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'timeSignature', {\n\t get: function () {\n\t return this._timeSignature;\n\t },\n\t set: function (timeSig) {\n\t if (Tone.isArray(timeSig)) {\n\t timeSig = timeSig[0] / timeSig[1] * 4;\n\t }\n\t this._timeSignature = timeSig;\n\t }\n\t });\n\t /**\n\t\t * When the Tone.Transport.loop = true, this is the starting position of the loop.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'loopStart', {\n\t get: function () {\n\t return Tone.Ticks(this._loopStart).toSeconds();\n\t },\n\t set: function (startPosition) {\n\t this._loopStart = this.toTicks(startPosition);\n\t }\n\t });\n\t /**\n\t\t * When the Tone.Transport.loop = true, this is the ending position of the loop.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'loopEnd', {\n\t get: function () {\n\t return Tone.Ticks(this._loopEnd).toSeconds();\n\t },\n\t set: function (endPosition) {\n\t this._loopEnd = this.toTicks(endPosition);\n\t }\n\t });\n\t /**\n\t\t * Set the loop start and stop at the same time.\n\t\t * @param {TransportTime} startPosition\n\t\t * @param {TransportTime} endPosition\n\t\t * @returns {Tone.Transport} this\n\t\t * @example\n\t\t * //loop over the first measure\n\t\t * Tone.Transport.setLoopPoints(0, \"1m\");\n\t\t * Tone.Transport.loop = true;\n\t\t */\n\t Tone.Transport.prototype.setLoopPoints = function (startPosition, endPosition) {\n\t this.loopStart = startPosition;\n\t this.loopEnd = endPosition;\n\t return this;\n\t };\n\t /**\n\t\t * The swing value. Between 0-1 where 1 equal to\n\t\t * the note + half the subdivision.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {NormalRange}\n\t\t * @name swing\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'swing', {\n\t get: function () {\n\t return this._swingAmount;\n\t },\n\t set: function (amount) {\n\t //scale the values to a normal range\n\t this._swingAmount = amount;\n\t }\n\t });\n\t /**\n\t\t * Set the subdivision which the swing will be applied to.\n\t\t * The default value is an 8th note. Value must be less\n\t\t * than a quarter note.\n\t\t *\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Time}\n\t\t * @name swingSubdivision\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'swingSubdivision', {\n\t get: function () {\n\t return Tone.Ticks(this._swingTicks).toNotation();\n\t },\n\t set: function (subdivision) {\n\t this._swingTicks = this.toTicks(subdivision);\n\t }\n\t });\n\t /**\n\t\t * The Transport's position in Bars:Beats:Sixteenths.\n\t\t * Setting the value will jump to that position right away.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {BarsBeatsSixteenths}\n\t\t * @name position\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'position', {\n\t get: function () {\n\t var now = this.now();\n\t var ticks = this._clock.getTicksAtTime(now);\n\t return Tone.Ticks(ticks).toBarsBeatsSixteenths();\n\t },\n\t set: function (progress) {\n\t var ticks = this.toTicks(progress);\n\t this.ticks = ticks;\n\t }\n\t });\n\t /**\n\t\t * The Transport's position in seconds\n\t\t * Setting the value will jump to that position right away.\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Seconds}\n\t\t * @name seconds\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'seconds', {\n\t get: function () {\n\t return this._clock.seconds;\n\t },\n\t set: function (s) {\n\t var now = this.now();\n\t var ticks = this.bpm.timeToTicks(s, now);\n\t this.ticks = ticks;\n\t }\n\t });\n\t /**\n\t\t * The Transport's loop position as a normalized value. Always\n\t\t * returns 0 if the transport if loop is not true.\n\t\t * @memberOf Tone.Transport#\n\t\t * @name progress\n\t\t * @type {NormalRange}\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'progress', {\n\t get: function () {\n\t if (this.loop) {\n\t var now = this.now();\n\t var ticks = this._clock.getTicksAtTime(now);\n\t return (ticks - this._loopStart) / (this._loopEnd - this._loopStart);\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The transports current tick position.\n\t\t *\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Ticks}\n\t\t * @name ticks\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'ticks', {\n\t get: function () {\n\t return this._clock.ticks;\n\t },\n\t set: function (t) {\n\t if (this._clock.ticks !== t) {\n\t var now = this.now();\n\t //stop everything synced to the transport\n\t if (this.state === Tone.State.Started) {\n\t this.emit('stop', now);\n\t this._clock.setTicksAtTime(t, now);\n\t //restart it with the new time\n\t this.emit('start', now, this.seconds);\n\t } else {\n\t this._clock.setTicksAtTime(t, now);\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * Get the clock's ticks at the given time.\n\t\t * @param {Time} time When to get the tick value\n\t\t * @return {Ticks} The tick value at the given time.\n\t\t */\n\t Tone.Transport.prototype.getTicksAtTime = function (time) {\n\t return Math.round(this._clock.getTicksAtTime(time));\n\t };\n\t /**\n\t\t * Return the elapsed seconds at the given time.\n\t\t * @param {Time} time When to get the elapsed seconds\n\t\t * @return {Seconds} The number of elapsed seconds\n\t\t */\n\t Tone.Transport.prototype.getSecondsAtTime = function (time) {\n\t return this._clock.getSecondsAtTime(time);\n\t };\n\t /**\n\t\t * Pulses Per Quarter note. This is the smallest resolution\n\t\t * the Transport timing supports. This should be set once\n\t\t * on initialization and not set again. Changing this value\n\t\t * after other objects have been created can cause problems.\n\t\t *\n\t\t * @memberOf Tone.Transport#\n\t\t * @type {Number}\n\t\t * @name PPQ\n\t\t */\n\t Object.defineProperty(Tone.Transport.prototype, 'PPQ', {\n\t get: function () {\n\t return this._ppq;\n\t },\n\t set: function (ppq) {\n\t var bpm = this.bpm.value;\n\t this._ppq = ppq;\n\t this.bpm.value = bpm;\n\t }\n\t });\n\t /**\n\t\t * Convert from BPM to frequency (factoring in PPQ)\n\t\t * @param {BPM} bpm The BPM value to convert to frequency\n\t\t * @return {Frequency} The BPM as a frequency with PPQ factored in.\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._fromUnits = function (bpm) {\n\t return 1 / (60 / bpm / this.PPQ);\n\t };\n\t /**\n\t\t * Convert from frequency (with PPQ) into BPM\n\t\t * @param {Frequency} freq The clocks frequency to convert to BPM\n\t\t * @return {BPM} The frequency value as BPM.\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype._toUnits = function (freq) {\n\t return freq / this.PPQ * 60;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tSYNCING\n\t ///////////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Returns the time aligned to the next subdivision\n\t\t * of the Transport. If the Transport is not started,\n\t\t * it will return 0.\n\t\t * Note: this will not work precisely during tempo ramps.\n\t\t * @param {Time} subdivision The subdivision to quantize to\n\t\t * @return {Number} The context time of the next subdivision.\n\t\t * @example\n\t\t * Tone.Transport.start(); //the transport must be started\n\t\t * Tone.Transport.nextSubdivision(\"4n\");\n\t\t */\n\t Tone.Transport.prototype.nextSubdivision = function (subdivision) {\n\t subdivision = this.toTicks(subdivision);\n\t if (this.state !== Tone.State.Started) {\n\t //if the transport's not started, return 0\n\t return 0;\n\t } else {\n\t var now = this.now();\n\t //the remainder of the current ticks and the subdivision\n\t var transportPos = this.getTicksAtTime(now);\n\t var remainingTicks = subdivision - transportPos % subdivision;\n\t return this._clock.nextTickTime(remainingTicks, now);\n\t }\n\t };\n\t /**\n\t\t * Attaches the signal to the tempo control signal so that\n\t\t * any changes in the tempo will change the signal in the same\n\t\t * ratio.\n\t\t *\n\t\t * @param {Tone.Signal} signal\n\t\t * @param {number=} ratio Optionally pass in the ratio between\n\t\t * the two signals. Otherwise it will be computed\n\t\t * based on their current values.\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.syncSignal = function (signal, ratio) {\n\t if (!ratio) {\n\t //get the sync ratio\n\t var now = this.now();\n\t if (signal.getValueAtTime(now) !== 0) {\n\t ratio = signal.getValueAtTime(now) / this.bpm.getValueAtTime(now);\n\t } else {\n\t ratio = 0;\n\t }\n\t }\n\t var ratioSignal = new Tone.Gain(ratio);\n\t this.bpm.chain(ratioSignal, signal._param);\n\t this._syncedSignals.push({\n\t 'ratio': ratioSignal,\n\t 'signal': signal,\n\t 'initial': signal.value\n\t });\n\t signal.value = 0;\n\t return this;\n\t };\n\t /**\n\t\t * Unsyncs a previously synced signal from the transport's control.\n\t\t * See Tone.Transport.syncSignal.\n\t\t * @param {Tone.Signal} signal\n\t\t * @returns {Tone.Transport} this\n\t\t */\n\t Tone.Transport.prototype.unsyncSignal = function (signal) {\n\t for (var i = this._syncedSignals.length - 1; i >= 0; i--) {\n\t var syncedSignal = this._syncedSignals[i];\n\t if (syncedSignal.signal === signal) {\n\t syncedSignal.ratio.dispose();\n\t syncedSignal.signal.value = syncedSignal.initial;\n\t this._syncedSignals.splice(i, 1);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Transport} this\n\t\t * @private\n\t\t */\n\t Tone.Transport.prototype.dispose = function () {\n\t Tone.Emitter.prototype.dispose.call(this);\n\t this._clock.dispose();\n\t this._clock = null;\n\t this._writable('bpm');\n\t this.bpm = null;\n\t this._timeline.dispose();\n\t this._timeline = null;\n\t this._repeatedEvents.dispose();\n\t this._repeatedEvents = null;\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////////\n\t //\tINITIALIZATION\n\t ///////////////////////////////////////////////////////////////////////////////\n\t var TransportConstructor = Tone.Transport;\n\t Tone.Transport = new TransportConstructor();\n\t Tone.Context.on('init', function (context) {\n\t if (context.Transport instanceof TransportConstructor) {\n\t Tone.Transport = context.Transport;\n\t } else {\n\t Tone.Transport = new TransportConstructor();\n\t }\n\t //store the Transport on the context so it can be retrieved later\n\t context.Transport = Tone.Transport;\n\t });\n\t Tone.Context.on('close', function (context) {\n\t if (context.Transport instanceof TransportConstructor) {\n\t context.Transport.dispose();\n\t }\n\t });\n\t return Tone.Transport;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Volume is a simple volume node, useful for creating a volume fader.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Decibels} [volume=0] the initial volume\n\t\t * @example\n\t\t * var vol = new Tone.Volume(-12);\n\t\t * instrument.chain(vol, Tone.Master);\n\t\t */\n\t Tone.Volume = function () {\n\t var options = Tone.defaults(arguments, ['volume'], Tone.Volume);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the output node\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.output = this.input = new Tone.Gain(options.volume, Tone.Type.Decibels);\n\t /**\n\t\t\t * The unmuted volume\n\t\t\t * @type {Decibels}\n\t\t\t * @private\n\t\t\t */\n\t this._unmutedVolume = options.volume;\n\t /**\n\t\t\t * The volume control in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.volume = this.output.gain;\n\t this._readOnly('volume');\n\t //set the mute initially\n\t this.mute = options.mute;\n\t };\n\t Tone.extend(Tone.Volume, Tone.AudioNode);\n\t /**\n\t\t * Defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.Volume.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Volume#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * volume.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Volume.prototype, 'mute', {\n\t get: function () {\n\t return this.volume.value === -Infinity;\n\t },\n\t set: function (mute) {\n\t if (!this.mute && mute) {\n\t this._unmutedVolume = this.volume.value;\n\t //maybe it should ramp here?\n\t this.volume.value = -Infinity;\n\t } else if (this.mute && !mute) {\n\t this.volume.value = this._unmutedVolume;\n\t }\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Volume} this\n\t\t */\n\t Tone.Volume.prototype.dispose = function () {\n\t this.input.dispose();\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('volume');\n\t this.volume.dispose();\n\t this.volume = null;\n\t return this;\n\t };\n\t return Tone.Volume;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A single master output which is connected to the\n\t\t * AudioDestinationNode (aka your speakers).\n\t\t * It provides useful conveniences such as the ability\n\t\t * to set the volume and mute the entire application.\n\t\t * It also gives you the ability to apply master effects to your application.\n\t\t * <br><br>\n\t\t * Like Tone.Transport, A single Tone.Master is created\n\t\t * on initialization and you do not need to explicitly construct one.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t * @singleton\n\t\t * @example\n\t\t * //the audio will go from the oscillator to the speakers\n\t\t * oscillator.connect(Tone.Master);\n\t\t * //a convenience for connecting to the master output is also provided:\n\t\t * oscillator.toMaster();\n\t\t * //the above two examples are equivalent.\n\t\t */\n\t Tone.Master = function () {\n\t Tone.AudioNode.call(this);\n\t Tone.getContext(function () {\n\t this.createInsOuts(1, 0);\n\t /**\n\t\t\t\t * The private volume node\n\t\t\t\t * @type {Tone.Volume}\n\t\t\t\t * @private\n\t\t\t\t */\n\t this._volume = this.output = new Tone.Volume();\n\t /**\n\t\t\t\t * The volume of the master output.\n\t\t\t\t * @type {Decibels}\n\t\t\t\t * @signal\n\t\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t //connections\n\t this.input.chain(this.output, this.context.destination);\n\t }.bind(this));\n\t };\n\t Tone.extend(Tone.Master, Tone.AudioNode);\n\t /**\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Master.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Master#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * Tone.Master.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Master.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * Add a master effects chain. NOTE: this will disconnect any nodes which were previously\n\t\t * chained in the master effects chain.\n\t\t * @param {AudioNode|Tone} args... All arguments will be connected in a row\n\t\t * and the Master will be routed through it.\n\t\t * @return {Tone.Master} this\n\t\t * @example\n\t\t * //some overall compression to keep the levels in check\n\t\t * var masterCompressor = new Tone.Compressor({\n\t\t * \t\"threshold\" : -6,\n\t\t * \t\"ratio\" : 3,\n\t\t * \t\"attack\" : 0.5,\n\t\t * \t\"release\" : 0.1\n\t\t * });\n\t\t * //give a little boost to the lows\n\t\t * var lowBump = new Tone.Filter(200, \"lowshelf\");\n\t\t * //route everything through the filter\n\t\t * //and compressor before going to the speakers\n\t\t * Tone.Master.chain(lowBump, masterCompressor);\n\t\t */\n\t Tone.Master.prototype.chain = function () {\n\t this.input.disconnect();\n\t this.input.chain.apply(this.input, arguments);\n\t arguments[arguments.length - 1].connect(this.output);\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Master} this\n\t\t */\n\t Tone.Master.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('volume');\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t //\tAUGMENT TONE's PROTOTYPE\n\t ///////////////////////////////////////////////////////////////////////////\n\t /**\n\t\t * Connect 'this' to the master output. Shorthand for this.connect(Tone.Master)\n\t\t * @returns {Tone.AudioNode} this\n\t\t * @example\n\t\t * //connect an oscillator to the master output\n\t\t * var osc = new Tone.Oscillator().toMaster();\n\t\t */\n\t Tone.AudioNode.prototype.toMaster = function () {\n\t this.connect(Tone.Master);\n\t return this;\n\t };\n\t if (window.AudioNode) {\n\t // Also augment AudioNode's prototype to include toMaster as a convenience\n\t AudioNode.prototype.toMaster = function () {\n\t this.connect(Tone.Master);\n\t return this;\n\t };\n\t }\n\t /**\n\t\t * initialize the module and listen for new audio contexts\n\t\t */\n\t var MasterConstructor = Tone.Master;\n\t Tone.Master = new MasterConstructor();\n\t Tone.Context.on('init', function (context) {\n\t // if it already exists, just restore it\n\t if (context.Master instanceof MasterConstructor) {\n\t Tone.Master = context.Master;\n\t } else {\n\t Tone.Master = new MasterConstructor();\n\t }\n\t context.Master = Tone.Master;\n\t });\n\t Tone.Context.on('close', function (context) {\n\t if (context.Master instanceof MasterConstructor) {\n\t context.Master.dispose();\n\t }\n\t });\n\t return Tone.Master;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for sources. Sources have start/stop methods\n\t\t * and the ability to be synced to the\n\t\t * start/stop of Tone.Transport.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * //Multiple state change events can be chained together,\n\t\t * //but must be set in the correct order and with ascending times\n\t\t *\n\t\t * // OK\n\t\t * state.start().stop(\"+0.2\");\n\t\t * // AND\n\t\t * state.start().stop(\"+0.2\").start(\"+0.4\").stop(\"+0.7\")\n\t\t *\n\t\t * // BAD\n\t\t * state.stop(\"+0.2\").start();\n\t\t * // OR\n\t\t * state.start(\"+0.3\").stop(\"+0.2\");\n\t\t *\n\t\t */\n\t Tone.Source = function (options) {\n\t options = Tone.defaultArg(options, Tone.Source.defaults);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The output volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * source.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t /**\n\t\t\t * \tKeep track of the scheduled state.\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t this._state.memory = 100;\n\t /**\n\t\t\t * The synced `start` callback function from the transport\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._synced = false;\n\t /**\n\t\t\t * Keep track of all of the scheduled event ids\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._scheduled = [];\n\t //make the output explicitly stereo\n\t this._volume.output.output.channelCount = 2;\n\t this._volume.output.output.channelCountMode = 'explicit';\n\t //mute initially\n\t this.mute = options.mute;\n\t };\n\t Tone.extend(Tone.Source, Tone.AudioNode);\n\t /**\n\t\t * The default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Source.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Source#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Source.prototype, 'state', {\n\t get: function () {\n\t if (this._synced) {\n\t if (Tone.Transport.state === Tone.State.Started) {\n\t return this._state.getValueAtTime(Tone.Transport.seconds);\n\t } else {\n\t return Tone.State.Stopped;\n\t }\n\t } else {\n\t return this._state.getValueAtTime(this.now());\n\t }\n\t }\n\t });\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * source.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Source.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t //overwrite these functions\n\t Tone.Source.prototype._start = Tone.noOp;\n\t Tone.Source.prototype.restart = Tone.noOp;\n\t Tone.Source.prototype._stop = Tone.noOp;\n\t /**\n\t\t * Start the source at the specified time. If no time is given,\n\t\t * start the source now.\n\t\t * @param {Time} [time=now] When the source should be started.\n\t\t * @returns {Tone.Source} this\n\t\t * @example\n\t\t * source.start(\"+0.5\"); //starts the source 0.5 seconds from now\n\t\t */\n\t Tone.Source.prototype.start = function (time, offset, duration) {\n\t if (Tone.isUndef(time) && this._synced) {\n\t time = Tone.Transport.seconds;\n\t } else {\n\t time = this.toSeconds(time);\n\t }\n\t //if it's started, stop it and restart it\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t this.restart(time, offset, duration);\n\t } else {\n\t this._state.setStateAtTime(Tone.State.Started, time);\n\t if (this._synced) {\n\t // add the offset time to the event\n\t var event = this._state.get(time);\n\t event.offset = Tone.defaultArg(offset, 0);\n\t event.duration = duration;\n\t var sched = Tone.Transport.schedule(function (t) {\n\t this._start(t, offset, duration);\n\t }.bind(this), time);\n\t this._scheduled.push(sched);\n\t //if it's already started\n\t if (Tone.Transport.state === Tone.State.Started) {\n\t this._syncedStart(this.now(), Tone.Transport.seconds);\n\t }\n\t } else {\n\t this._start.apply(this, arguments);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the source at the specified time. If no time is given,\n\t\t * stop the source now.\n\t\t * @param {Time} [time=now] When the source should be stopped.\n\t\t * @returns {Tone.Source} this\n\t\t * @example\n\t\t * source.stop(); // stops the source immediately\n\t\t */\n\t Tone.Source.prototype.stop = function (time) {\n\t if (Tone.isUndef(time) && this._synced) {\n\t time = Tone.Transport.seconds;\n\t } else {\n\t time = this.toSeconds(time);\n\t }\n\t if (!this._synced) {\n\t this._stop.apply(this, arguments);\n\t } else {\n\t var sched = Tone.Transport.schedule(this._stop.bind(this), time);\n\t this._scheduled.push(sched);\n\t }\n\t this._state.cancel(time);\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the source to the Transport so that all subsequent\n\t\t * calls to `start` and `stop` are synced to the TransportTime\n\t\t * instead of the AudioContext time.\n\t\t *\n\t\t * @returns {Tone.Source} this\n\t\t * @example\n\t\t * //sync the source so that it plays between 0 and 0.3 on the Transport's timeline\n\t\t * source.sync().start(0).stop(0.3);\n\t\t * //start the transport.\n\t\t * Tone.Transport.start();\n\t\t *\n\t\t * @example\n\t\t * //start the transport with an offset and the sync'ed sources\n\t\t * //will start in the correct position\n\t\t * source.sync().start(0.1);\n\t\t * //the source will be invoked with an offset of 0.4\n\t\t * Tone.Transport.start(\"+0.5\", 0.5);\n\t\t */\n\t Tone.Source.prototype.sync = function () {\n\t this._synced = true;\n\t this._syncedStart = function (time, offset) {\n\t if (offset > 0) {\n\t // get the playback state at that time\n\t var stateEvent = this._state.get(offset);\n\t // listen for start events which may occur in the middle of the sync'ed time\n\t if (stateEvent && stateEvent.state === Tone.State.Started && stateEvent.time !== offset) {\n\t // get the offset\n\t var startOffset = offset - this.toSeconds(stateEvent.time);\n\t var duration;\n\t if (stateEvent.duration) {\n\t duration = this.toSeconds(stateEvent.duration) - startOffset;\n\t }\n\t this._start(time, this.toSeconds(stateEvent.offset) + startOffset, duration);\n\t }\n\t }\n\t }.bind(this);\n\t this._syncedStop = function (time) {\n\t var seconds = Tone.Transport.getSecondsAtTime(Math.max(time - this.sampleTime, 0));\n\t if (this._state.getValueAtTime(seconds) === Tone.State.Started) {\n\t this._stop(time);\n\t }\n\t }.bind(this);\n\t Tone.Transport.on('start loopStart', this._syncedStart);\n\t Tone.Transport.on('stop pause loopEnd', this._syncedStop);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the source to the Transport. See Tone.Source.sync\n\t\t * @returns {Tone.Source} this\n\t\t */\n\t Tone.Source.prototype.unsync = function () {\n\t if (this._synced) {\n\t Tone.Transport.off('stop pause loopEnd', this._syncedStop);\n\t Tone.Transport.off('start loopStart', this._syncedStart);\n\t }\n\t this._synced = false;\n\t // clear all of the scheduled ids\n\t for (var i = 0; i < this._scheduled.length; i++) {\n\t var id = this._scheduled[i];\n\t Tone.Transport.clear(id);\n\t }\n\t this._scheduled = [];\n\t this._state.cancel(0);\n\t return this;\n\t };\n\t /**\n\t\t *\tClean up.\n\t\t * @return {Tone.Source} this\n\t\t */\n\t Tone.Source.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.unsync();\n\t this._scheduled = null;\n\t this._writable('volume');\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t this._state.dispose();\n\t this._state = null;\n\t };\n\t return Tone.Source;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * AudioBuffer.copyTo/FromChannel polyfill\n\t\t * @private\n\t\t */\n\t if (Tone.supported) {\n\t if (!AudioBuffer.prototype.copyToChannel) {\n\t AudioBuffer.prototype.copyToChannel = function (src, chanNum, start) {\n\t var channel = this.getChannelData(chanNum);\n\t start = start || 0;\n\t for (var i = 0; i < channel.length; i++) {\n\t channel[i + start] = src[i];\n\t }\n\t };\n\t AudioBuffer.prototype.copyFromChannel = function (dest, chanNum, start) {\n\t var channel = this.getChannelData(chanNum);\n\t start = start || 0;\n\t for (var i = 0; i < dest.length; i++) {\n\t dest[i] = channel[i + start];\n\t }\n\t };\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Buffer loading and storage. Tone.Buffer is used internally by all\n\t\t * classes that make requests for audio files such as Tone.Player,\n\t\t * Tone.Sampler and Tone.Convolver.\n\t\t *\n\t\t * Aside from load callbacks from individual buffers, Tone.Buffer\n\t\t * \t\tprovides events which keep track of the loading progress\n\t\t * \t\tof _all_ of the buffers. These are Tone.Buffer.on(\"load\" / \"progress\" / \"error\")\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t * @param {AudioBuffer|String} url The url to load, or the audio buffer to set.\n\t\t * @param {Function=} onload A callback which is invoked after the buffer is loaded.\n\t\t * It's recommended to use `Tone.Buffer.on('load', callback)` instead\n\t\t * since it will give you a callback when _all_ buffers are loaded.\n\t\t * @param {Function=} onerror The callback to invoke if there is an error\n\t\t * @example\n\t\t * var buffer = new Tone.Buffer(\"path/to/sound.mp3\", function(){\n\t\t * \t//the buffer is now available.\n\t\t * \tvar buff = buffer.get();\n\t\t * });\n\t\t * @example\n\t\t * //can load provide fallback extension types if the first type is not supported.\n\t\t * var buffer = new Tone.Buffer(\"path/to/sound.[mp3|ogg|wav]\");\n\t\t */\n\t Tone.Buffer = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload',\n\t 'onerror'\n\t ], Tone.Buffer);\n\t Tone.call(this);\n\t /**\n\t\t\t * stores the loaded AudioBuffer\n\t\t\t * @type {AudioBuffer}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = null;\n\t /**\n\t\t\t * indicates if the buffer should be reversed or not\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._reversed = options.reverse;\n\t /**\n\t\t\t * The XHR\n\t\t\t * @type {XMLHttpRequest}\n\t\t\t * @private\n\t\t\t */\n\t this._xhr = null;\n\t /**\n\t\t\t * Private callback when the buffer is loaded.\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._onload = Tone.noOp;\n\t if (options.url instanceof AudioBuffer || options.url instanceof Tone.Buffer) {\n\t this.set(options.url);\n\t // invoke the onload callback\n\t if (options.onload) {\n\t if (this.loaded) {\n\t options.onload(this);\n\t } else {\n\t this._onload = options.onload;\n\t }\n\t }\n\t } else if (Tone.isString(options.url)) {\n\t this.load(options.url).then(options.onload).catch(options.onerror);\n\t }\n\t };\n\t Tone.extend(Tone.Buffer);\n\t /**\n\t\t * the default parameters\n\t\t * @type {Object}\n\t\t */\n\t Tone.Buffer.defaults = {\n\t 'url': undefined,\n\t 'reverse': false,\n\t 'onload': Tone.noOp,\n\t 'onerror': Tone.noOp\n\t };\n\t /**\n\t\t * Pass in an AudioBuffer or Tone.Buffer to set the value\n\t\t * of this buffer.\n\t\t * @param {AudioBuffer|Tone.Buffer} buffer the buffer\n\t\t * @returns {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.set = function (buffer) {\n\t if (buffer instanceof Tone.Buffer) {\n\t if (buffer.loaded) {\n\t this._buffer = buffer.get();\n\t } else {\n\t buffer._onload = function () {\n\t this.set(buffer);\n\t this._onload(this);\n\t }.bind(this);\n\t }\n\t } else {\n\t this._buffer = buffer;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * @return {AudioBuffer} The audio buffer stored in the object.\n\t\t */\n\t Tone.Buffer.prototype.get = function () {\n\t return this._buffer;\n\t };\n\t /**\n\t\t * Makes an xhr reqest for the selected url then decodes\n\t\t * the file as an audio buffer. Invokes\n\t\t * the callback once the audio buffer loads.\n\t\t * @param {String} url The url of the buffer to load.\n\t\t * filetype support depends on the\n\t\t * browser.\n\t\t * @returns {Promise} returns a Promise which resolves with the Tone.Buffer\n\t\t */\n\t Tone.Buffer.prototype.load = function (url, onload, onerror) {\n\t var promise = new Promise(function (load, error) {\n\t this._xhr = Tone.Buffer.load(url, //success\n\t function (buff) {\n\t this._xhr = null;\n\t this.set(buff);\n\t load(this);\n\t this._onload(this);\n\t if (onload) {\n\t onload(this);\n\t }\n\t }.bind(this), //error\n\t function (err) {\n\t this._xhr = null;\n\t error(err);\n\t if (onerror) {\n\t onerror(err);\n\t }\n\t }.bind(this));\n\t }.bind(this));\n\t return promise;\n\t };\n\t /**\n\t\t * dispose and disconnect\n\t\t * @returns {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t this._buffer = null;\n\t if (this._xhr) {\n\t Tone.Buffer._removeFromDownloadQueue(this._xhr);\n\t this._xhr.abort();\n\t this._xhr = null;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * If the buffer is loaded or not\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'loaded', {\n\t get: function () {\n\t return this.length > 0;\n\t }\n\t });\n\t /**\n\t\t * The duration of the buffer.\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Number}\n\t\t * @name duration\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'duration', {\n\t get: function () {\n\t if (this._buffer) {\n\t return this._buffer.duration;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The length of the buffer in samples\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Number}\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'length', {\n\t get: function () {\n\t if (this._buffer) {\n\t return this._buffer.length;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of discrete audio channels. Returns 0 if no buffer\n\t\t * is loaded.\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Number}\n\t\t * @name numberOfChannels\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'numberOfChannels', {\n\t get: function () {\n\t if (this._buffer) {\n\t return this._buffer.numberOfChannels;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Set the audio buffer from the array. To create a multichannel AudioBuffer,\n\t\t * pass in a multidimensional array.\n\t\t * @param {Float32Array} array The array to fill the audio buffer\n\t\t * @return {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.fromArray = function (array) {\n\t var isMultidimensional = array[0].length > 0;\n\t var channels = isMultidimensional ? array.length : 1;\n\t var len = isMultidimensional ? array[0].length : array.length;\n\t var buffer = this.context.createBuffer(channels, len, this.context.sampleRate);\n\t if (!isMultidimensional && channels === 1) {\n\t array = [array];\n\t }\n\t for (var c = 0; c < channels; c++) {\n\t buffer.copyToChannel(array[c], c);\n\t }\n\t this._buffer = buffer;\n\t return this;\n\t };\n\t /**\n\t\t * \tSums muliple channels into 1 channel\n\t\t * @param {Number=} channel Optionally only copy a single channel from the array.\n\t\t * @return {Array}\n\t\t */\n\t Tone.Buffer.prototype.toMono = function (chanNum) {\n\t if (Tone.isNumber(chanNum)) {\n\t this.fromArray(this.toArray(chanNum));\n\t } else {\n\t var outputArray = new Float32Array(this.length);\n\t var numChannels = this.numberOfChannels;\n\t for (var channel = 0; channel < numChannels; channel++) {\n\t var channelArray = this.toArray(channel);\n\t for (var i = 0; i < channelArray.length; i++) {\n\t outputArray[i] += channelArray[i];\n\t }\n\t }\n\t //divide by the number of channels\n\t outputArray = outputArray.map(function (sample) {\n\t return sample / numChannels;\n\t });\n\t this.fromArray(outputArray);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * \tGet the buffer as an array. Single channel buffers will return a 1-dimensional\n\t\t * \tFloat32Array, and multichannel buffers will return multidimensional arrays.\n\t\t * @param {Number=} channel Optionally only copy a single channel from the array.\n\t\t * @return {Array}\n\t\t */\n\t Tone.Buffer.prototype.toArray = function (channel) {\n\t if (Tone.isNumber(channel)) {\n\t return this.getChannelData(channel);\n\t } else if (this.numberOfChannels === 1) {\n\t return this.toArray(0);\n\t } else {\n\t var ret = [];\n\t for (var c = 0; c < this.numberOfChannels; c++) {\n\t ret[c] = this.getChannelData(c);\n\t }\n\t return ret;\n\t }\n\t };\n\t /**\n\t\t * Returns the Float32Array representing the PCM audio data for the specific channel.\n\t\t * @param {Number} channel The channel number to return\n\t\t * @return {Float32Array} The audio as a TypedArray\n\t\t */\n\t Tone.Buffer.prototype.getChannelData = function (channel) {\n\t return this._buffer.getChannelData(channel);\n\t };\n\t /**\n\t\t * Cut a subsection of the array and return a buffer of the\n\t\t * subsection. Does not modify the original buffer\n\t\t * @param {Time} start The time to start the slice\n\t\t * @param {Time=} end The end time to slice. If none is given\n\t\t * will default to the end of the buffer\n\t\t * @return {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype.slice = function (start, end) {\n\t end = Tone.defaultArg(end, this.duration);\n\t var startSamples = Math.floor(this.context.sampleRate * this.toSeconds(start));\n\t var endSamples = Math.floor(this.context.sampleRate * this.toSeconds(end));\n\t var replacement = [];\n\t for (var i = 0; i < this.numberOfChannels; i++) {\n\t replacement[i] = this.toArray(i).slice(startSamples, endSamples);\n\t }\n\t var retBuffer = new Tone.Buffer().fromArray(replacement);\n\t return retBuffer;\n\t };\n\t /**\n\t\t * Reverse the buffer.\n\t\t * @private\n\t\t * @return {Tone.Buffer} this\n\t\t */\n\t Tone.Buffer.prototype._reverse = function () {\n\t if (this.loaded) {\n\t for (var i = 0; i < this.numberOfChannels; i++) {\n\t Array.prototype.reverse.call(this.getChannelData(i));\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Reverse the buffer.\n\t\t * @memberOf Tone.Buffer#\n\t\t * @type {Boolean}\n\t\t * @name reverse\n\t\t */\n\t Object.defineProperty(Tone.Buffer.prototype, 'reverse', {\n\t get: function () {\n\t return this._reversed;\n\t },\n\t set: function (rev) {\n\t if (this._reversed !== rev) {\n\t this._reversed = rev;\n\t this._reverse();\n\t }\n\t }\n\t });\n\t ///////////////////////////////////////////////////////////////////////////\n\t // STATIC METHODS\n\t ///////////////////////////////////////////////////////////////////////////\n\t //statically inherits Emitter methods\n\t Tone.Emitter.mixin(Tone.Buffer);\n\t /**\n\t\t * the static queue for all of the xhr requests\n\t\t * @type {Array}\n\t\t * @private\n\t\t */\n\t Tone.Buffer._downloadQueue = [];\n\t /**\n\t\t * A path which is prefixed before every url.\n\t\t * @type {String}\n\t\t * @static\n\t\t */\n\t Tone.Buffer.baseUrl = '';\n\t /**\n\t\t * Create a Tone.Buffer from the array. To create a multichannel AudioBuffer,\n\t\t * pass in a multidimensional array.\n\t\t * @param {Float32Array} array The array to fill the audio buffer\n\t\t * @return {Tone.Buffer} A Tone.Buffer created from the array\n\t\t */\n\t Tone.Buffer.fromArray = function (array) {\n\t return new Tone.Buffer().fromArray(array);\n\t };\n\t /**\n\t\t * Creates a Tone.Buffer from a URL, returns a promise\n\t\t * which resolves to a Tone.Buffer\n\t\t * @param {String} url The url to load.\n\t\t * @return {Promise<Tone.Buffer>} A promise which resolves to a Tone.Buffer\n\t\t */\n\t Tone.Buffer.fromUrl = function (url) {\n\t var buffer = new Tone.Buffer();\n\t return buffer.load(url).then(function () {\n\t return buffer;\n\t });\n\t };\n\t /**\n\t\t * Remove an xhr request from the download queue\n\t\t * @private\n\t\t */\n\t Tone.Buffer._removeFromDownloadQueue = function (request) {\n\t var index = Tone.Buffer._downloadQueue.indexOf(request);\n\t if (index !== -1) {\n\t Tone.Buffer._downloadQueue.splice(index, 1);\n\t }\n\t };\n\t /**\n\t\t * Loads a url using XMLHttpRequest.\n\t\t * @param {String} url\n\t\t * @param {Function} onload\n\t\t * @param {Function} onerror\n\t\t * @param {Function} onprogress\n\t\t * @return {XMLHttpRequest}\n\t\t */\n\t Tone.Buffer.load = function (url, onload, onerror) {\n\t //default\n\t onload = Tone.defaultArg(onload, Tone.noOp);\n\t // test if the url contains multiple extensions\n\t var matches = url.match(/\\[(.+\\|?)+\\]$/);\n\t if (matches) {\n\t var extensions = matches[1].split('|');\n\t var extension = extensions[0];\n\t for (var i = 0; i < extensions.length; i++) {\n\t if (Tone.Buffer.supportsType(extensions[i])) {\n\t extension = extensions[i];\n\t break;\n\t }\n\t }\n\t url = url.replace(matches[0], extension);\n\t }\n\t function onError(e) {\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t Tone.Buffer.emit('error', e);\n\t if (onerror) {\n\t onerror(e);\n\t } else {\n\t throw e;\n\t }\n\t }\n\t function onProgress() {\n\t //calculate the progress\n\t var totalProgress = 0;\n\t for (var i = 0; i < Tone.Buffer._downloadQueue.length; i++) {\n\t totalProgress += Tone.Buffer._downloadQueue[i].progress;\n\t }\n\t Tone.Buffer.emit('progress', totalProgress / Tone.Buffer._downloadQueue.length);\n\t }\n\t var request = new XMLHttpRequest();\n\t request.open('GET', Tone.Buffer.baseUrl + url, true);\n\t request.responseType = 'arraybuffer';\n\t //start out as 0\n\t request.progress = 0;\n\t Tone.Buffer._downloadQueue.push(request);\n\t request.addEventListener('load', function () {\n\t if (request.status === 200) {\n\t Tone.context.decodeAudioData(request.response).then(function (buff) {\n\t request.progress = 1;\n\t onProgress();\n\t onload(buff);\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t if (Tone.Buffer._downloadQueue.length === 0) {\n\t //emit the event at the end\n\t Tone.Buffer.emit('load');\n\t }\n\t }).catch(function () {\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t onError('Tone.Buffer: could not decode audio data: ' + url);\n\t });\n\t } else {\n\t onError('Tone.Buffer: could not locate file: ' + url);\n\t }\n\t });\n\t request.addEventListener('error', onError);\n\t request.addEventListener('progress', function (event) {\n\t if (event.lengthComputable) {\n\t //only go to 95%, the last 5% is when the audio is decoded\n\t request.progress = event.loaded / event.total * 0.95;\n\t onProgress();\n\t }\n\t });\n\t request.send();\n\t return request;\n\t };\n\t /**\n\t\t * Stop all of the downloads in progress\n\t\t * @return {Tone.Buffer}\n\t\t * @static\n\t\t */\n\t Tone.Buffer.cancelDownloads = function () {\n\t Tone.Buffer._downloadQueue.slice().forEach(function (request) {\n\t Tone.Buffer._removeFromDownloadQueue(request);\n\t request.abort();\n\t });\n\t return Tone.Buffer;\n\t };\n\t /**\n\t\t * Checks a url's extension to see if the current browser can play that file type.\n\t\t * @param {String} url The url/extension to test\n\t\t * @return {Boolean} If the file extension can be played\n\t\t * @static\n\t\t * @example\n\t\t * Tone.Buffer.supportsType(\"wav\"); //returns true\n\t\t * Tone.Buffer.supportsType(\"path/to/file.wav\"); //returns true\n\t\t */\n\t Tone.Buffer.supportsType = function (url) {\n\t var extension = url.split('.');\n\t extension = extension[extension.length - 1];\n\t var response = document.createElement('audio').canPlayType('audio/' + extension);\n\t return response !== '';\n\t };\n\t /**\n\t\t * Returns a Promise which resolves when all of the buffers have loaded\n\t\t * @return {Promise}\n\t\t */\n\t Tone.loaded = function () {\n\t var onload, onerror;\n\t function removeEvents() {\n\t //remove the events when it's resolved\n\t Tone.Buffer.off('load', onload);\n\t Tone.Buffer.off('error', onerror);\n\t }\n\t return new Promise(function (success, fail) {\n\t onload = function () {\n\t success();\n\t };\n\t onerror = function () {\n\t fail();\n\t };\n\t //add the event listeners\n\t Tone.Buffer.on('load', onload);\n\t Tone.Buffer.on('error', onerror);\n\t }).then(removeEvents).catch(function (e) {\n\t removeEvents();\n\t throw new Error(e);\n\t });\n\t };\n\t return Tone.Buffer;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the native fire-and-forget OscillatorNode. Adds the\n\t\t * ability to reschedule the stop method.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {AudioBuffer|Tone.Buffer} buffer The buffer to play\n\t\t * @param {Function} onload The callback to invoke when the\n\t\t * buffer is done playing.\n\t\t */\n\t Tone.OscillatorNode = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type'\n\t ], Tone.OscillatorNode);\n\t Tone.AudioNode.call(this, options);\n\t /**\n\t\t\t * The callback to invoke after the\n\t\t\t * buffer source is done playing.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.onended = options.onended;\n\t /**\n\t\t\t * The oscillator start time\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._startTime = -1;\n\t /**\n\t\t\t * The oscillator stop time\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._stopTime = -1;\n\t /**\n\t\t\t * The gain node which envelopes the OscillatorNode\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gainNode = this.output = new Tone.Gain();\n\t this._gainNode.gain.setValueAtTime(0, this.context.currentTime);\n\t /**\n\t\t\t * The oscillator\n\t\t\t * @type {OscillatorNode}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = this.context.createOscillator();\n\t this._oscillator.connect(this._gainNode);\n\t this.type = options.type;\n\t /**\n\t\t\t * The frequency of the oscillator\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Param(this._oscillator.frequency, Tone.Type.Frequency);\n\t this.frequency.value = options.frequency;\n\t /**\n\t\t\t * The detune of the oscillator\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Param(this._oscillator.detune, Tone.Type.Cents);\n\t this.detune.value = options.detune;\n\t /**\n\t\t\t * The value that the buffer ramps to\n\t\t\t * @type {Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gain = 1;\n\t };\n\t Tone.extend(Tone.OscillatorNode, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.OscillatorNode.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'type': 'sine',\n\t 'onended': Tone.noOp\n\t };\n\t /**\n\t\t * Returns the playback state of the oscillator, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.OscillatorNode#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.OscillatorNode.prototype, 'state', {\n\t get: function () {\n\t return this.getStateAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Get the playback state at the given time\n\t\t * @param {Time} time The time to test the state at\n\t\t * @return {Tone.State} The playback state. \n\t\t */\n\t Tone.OscillatorNode.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._startTime !== -1 && time >= this._startTime && (this._stopTime === -1 || time <= this._stopTime)) {\n\t return Tone.State.Started;\n\t } else {\n\t return Tone.State.Stopped;\n\t }\n\t };\n\t /**\n\t * Start the oscillator node at the given time\n\t * @param {Time=} time When to start the oscillator\n\t * @return {OscillatorNode} this\n\t */\n\t Tone.OscillatorNode.prototype.start = function (time) {\n\t if (this._startTime === -1) {\n\t this._startTime = this.toSeconds(time);\n\t this._oscillator.start(this._startTime);\n\t var now = this.context.currentTime;\n\t this._gainNode.gain.cancelScheduledValues(now);\n\t this._gainNode.gain.setValueAtTime(0, now);\n\t this._gainNode.gain.setValueAtTime(1, this._startTime);\n\t } else {\n\t throw new Error('cannot call OscillatorNode.start more than once');\n\t }\n\t return this;\n\t };\n\t /**\n\t * Sets an arbitrary custom periodic waveform given a PeriodicWave.\n\t * @param {PeriodicWave} periodicWave PeriodicWave should be created with context.createPeriodicWave\n\t * @return {OscillatorNode} this\n\t */\n\t Tone.OscillatorNode.prototype.setPeriodicWave = function (periodicWave) {\n\t this._oscillator.setPeriodicWave(periodicWave);\n\t return this;\n\t };\n\t /**\n\t * Stop the oscillator node at the given time\n\t * @param {Time=} time When to stop the oscillator\n\t * @return {OscillatorNode} this\n\t */\n\t Tone.OscillatorNode.prototype.stop = function (time) {\n\t //cancel the previous stop\n\t this.cancelStop();\n\t //reschedule it\n\t this._stopTime = this.toSeconds(time);\n\t this._gainNode.gain.setValueAtTime(0, this._stopTime);\n\t this.context.clearTimeout(this._timeout);\n\t this._timeout = this.context.setTimeout(function () {\n\t this._oscillator.stop(this.now());\n\t this.onended();\n\t }.bind(this), this._stopTime - this.now());\n\t return this;\n\t };\n\t /**\n\t\t * Cancel a scheduled stop event\n\t\t * @return {Tone.OscillatorNode} this\n\t\t */\n\t Tone.OscillatorNode.prototype.cancelStop = function () {\n\t if (this._startTime !== -1) {\n\t //cancel the stop envelope\n\t this._gainNode.gain.cancelScheduledValues(this._startTime + this.sampleTime);\n\t this._gainNode.gain.setValueAtTime(1, Math.max(this.now(), this._startTime));\n\t this.context.clearTimeout(this._timeout);\n\t this._stopTime = -1;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * The oscillator type. Either 'sine', 'sawtooth', 'square', or 'triangle'\n\t\t * @memberOf Tone.OscillatorNode#\n\t\t * @type {Time}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.OscillatorNode.prototype, 'type', {\n\t get: function () {\n\t return this._oscillator.type;\n\t },\n\t set: function (type) {\n\t this._oscillator.type = type;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.OscillatorNode} this\n\t\t */\n\t Tone.OscillatorNode.prototype.dispose = function () {\n\t this.context.clearTimeout(this._timeout);\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.onended = null;\n\t this._oscillator.disconnect();\n\t this._oscillator = null;\n\t this._gainNode.dispose();\n\t this._gainNode = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.OscillatorNode;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Oscillator supports a number of features including\n\t\t * phase rotation, multiple oscillator types (see Tone.Oscillator.type),\n\t\t * and Transport syncing (see Tone.Oscillator.syncFrequency).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {Frequency} [frequency] Starting frequency\n\t\t * @param {string} [type] The oscillator type. Read more about type below.\n\t\t * @example\n\t\t * //make and start a 440hz sine tone\n\t\t * var osc = new Tone.Oscillator(440, \"sine\").toMaster().start();\n\t\t */\n\t Tone.Oscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type'\n\t ], Tone.Oscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * the main oscillator\n\t\t\t * @type {OscillatorNode}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = null;\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * the periodic wave\n\t\t\t * @type {PeriodicWave}\n\t\t\t * @private\n\t\t\t */\n\t this._wave = null;\n\t /**\n\t\t\t * The partials of the oscillator\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._partials = Tone.defaultArg(options.partials, [1]);\n\t /**\n\t\t\t * the phase of the oscillator\n\t\t\t * between 0 - 360\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._phase = options.phase;\n\t /**\n\t\t\t * the type of the oscillator\n\t\t\t * @type {string}\n\t\t\t * @private\n\t\t\t */\n\t this._type = null;\n\t //setup\n\t this.type = options.type;\n\t this.phase = this._phase;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.Oscillator, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t * @type {Object}\n\t\t */\n\t Tone.Oscillator.defaults = {\n\t 'type': 'sine',\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'partials': []\n\t };\n\t /**\n\t\t * The Oscillator types\n\t\t * @enum {String}\n\t\t */\n\t Tone.Oscillator.Type = {\n\t Sine: 'sine',\n\t Triangle: 'triangle',\n\t Sawtooth: 'sawtooth',\n\t Square: 'square',\n\t Custom: 'custom'\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._start = function (time) {\n\t //new oscillator with previous values\n\t this._oscillator = new Tone.OscillatorNode();\n\t if (this._wave) {\n\t this._oscillator.setPeriodicWave(this._wave);\n\t } else {\n\t this._oscillator.type = this._type;\n\t }\n\t //connect the control signal to the oscillator frequency & detune\n\t this._oscillator.connect(this.output);\n\t this.frequency.connect(this._oscillator.frequency);\n\t this.detune.connect(this._oscillator.detune);\n\t //start the oscillator\n\t time = this.toSeconds(time);\n\t this._oscillator.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @private\n\t\t * @param {Time} [time=now] (optional) timing parameter\n\t\t * @returns {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype._stop = function (time) {\n\t if (this._oscillator) {\n\t time = this.toSeconds(time);\n\t this._oscillator.stop(time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Restart the oscillator. Does not stop the oscillator, but instead\n\t\t * just cancels any scheduled 'stop' from being invoked.\n\t\t * @param {Time=} time\n\t\t * @return {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype.restart = function (time) {\n\t this._oscillator.cancelStop();\n\t this._state.cancel(this.toSeconds(time));\n\t return this;\n\t };\n\t /**\n\t\t * Sync the signal to the Transport's bpm. Any changes to the transports bpm,\n\t\t * will also affect the oscillators frequency.\n\t\t * @returns {Tone.Oscillator} this\n\t\t * @example\n\t\t * Tone.Transport.bpm.value = 120;\n\t\t * osc.frequency.value = 440;\n\t\t * //the ration between the bpm and the frequency will be maintained\n\t\t * osc.syncFrequency();\n\t\t * Tone.Transport.bpm.value = 240;\n\t\t * // the frequency of the oscillator is doubled to 880\n\t\t */\n\t Tone.Oscillator.prototype.syncFrequency = function () {\n\t Tone.Transport.syncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the oscillator's frequency from the Transport.\n\t\t * See Tone.Oscillator.syncFrequency\n\t\t * @returns {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype.unsyncFrequency = function () {\n\t Tone.Transport.unsyncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * The type of the oscillator: either sine, square, triangle, or sawtooth. Also capable of\n\t\t * setting the first x number of partials of the oscillator. For example: \"sine4\" would\n\t\t * set be the first 4 partials of the sine wave and \"triangle8\" would set the first\n\t\t * 8 partials of the triangle wave.\n\t\t * <br><br>\n\t\t * Uses PeriodicWave internally even for native types so that it can set the phase.\n\t\t * PeriodicWave equations are from the\n\t\t * [Webkit Web Audio implementation](https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp&sq=package:chromium).\n\t\t *\n\t\t * @memberOf Tone.Oscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t * @example\n\t\t * //set it to a square wave\n\t\t * osc.type = \"square\";\n\t\t * @example\n\t\t * //set the first 6 partials of a sawtooth wave\n\t\t * osc.type = \"sawtooth6\";\n\t\t */\n\t Object.defineProperty(Tone.Oscillator.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t var isBasicType = [\n\t Tone.Oscillator.Type.Sine,\n\t Tone.Oscillator.Type.Square,\n\t Tone.Oscillator.Type.Triangle,\n\t Tone.Oscillator.Type.Sawtooth\n\t ].includes(type);\n\t if (this._phase === 0 && isBasicType) {\n\t this._wave = null;\n\t //just go with the basic approach\n\t if (this._oscillator !== null) {\n\t this._oscillator.type === type;\n\t }\n\t } else {\n\t var coefs = this._getRealImaginary(type, this._phase);\n\t var periodicWave = this.context.createPeriodicWave(coefs[0], coefs[1]);\n\t this._wave = periodicWave;\n\t if (this._oscillator !== null) {\n\t this._oscillator.setPeriodicWave(this._wave);\n\t }\n\t }\n\t this._type = type;\n\t }\n\t });\n\t /**\n\t\t * Returns the real and imaginary components based\n\t\t * on the oscillator type.\n\t\t * @returns {Array} [real, imaginary]\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._getRealImaginary = function (type, phase) {\n\t var fftSize = 4096;\n\t var periodicWaveSize = fftSize / 2;\n\t var real = new Float32Array(periodicWaveSize);\n\t var imag = new Float32Array(periodicWaveSize);\n\t var partialCount = 1;\n\t if (type === Tone.Oscillator.Type.Custom) {\n\t partialCount = this._partials.length + 1;\n\t periodicWaveSize = partialCount;\n\t } else {\n\t var partial = /^(sine|triangle|square|sawtooth)(\\d+)$/.exec(type);\n\t if (partial) {\n\t partialCount = parseInt(partial[2]) + 1;\n\t type = partial[1];\n\t partialCount = Math.max(partialCount, 2);\n\t periodicWaveSize = partialCount;\n\t }\n\t }\n\t for (var n = 1; n < periodicWaveSize; ++n) {\n\t var piFactor = 2 / (n * Math.PI);\n\t var b;\n\t switch (type) {\n\t case Tone.Oscillator.Type.Sine:\n\t b = n <= partialCount ? 1 : 0;\n\t break;\n\t case Tone.Oscillator.Type.Square:\n\t b = n & 1 ? 2 * piFactor : 0;\n\t break;\n\t case Tone.Oscillator.Type.Sawtooth:\n\t b = piFactor * (n & 1 ? 1 : -1);\n\t break;\n\t case Tone.Oscillator.Type.Triangle:\n\t if (n & 1) {\n\t b = 2 * (piFactor * piFactor) * (n - 1 >> 1 & 1 ? -1 : 1);\n\t } else {\n\t b = 0;\n\t }\n\t break;\n\t case Tone.Oscillator.Type.Custom:\n\t b = this._partials[n - 1];\n\t break;\n\t default:\n\t throw new TypeError('Tone.Oscillator: invalid type: ' + type);\n\t }\n\t if (b !== 0) {\n\t real[n] = -b * Math.sin(phase * n);\n\t imag[n] = b * Math.cos(phase * n);\n\t } else {\n\t real[n] = 0;\n\t imag[n] = 0;\n\t }\n\t }\n\t return [\n\t real,\n\t imag\n\t ];\n\t };\n\t /**\n\t\t * Compute the inverse FFT for a given phase.\n\t\t * @param {Float32Array} real\n\t\t * @param {Float32Array} imag\n\t\t * @param {NormalRange} phase\n\t\t * @return {AudioRange}\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._inverseFFT = function (real, imag, phase) {\n\t var sum = 0;\n\t var len = real.length;\n\t for (var i = 0; i < len; i++) {\n\t sum += real[i] * Math.cos(i * phase) + imag[i] * Math.sin(i * phase);\n\t }\n\t return sum;\n\t };\n\t /**\n\t\t * Returns the initial value of the oscillator.\n\t\t * @return {AudioRange}\n\t\t * @private\n\t\t */\n\t Tone.Oscillator.prototype._getInitialValue = function () {\n\t var coefs = this._getRealImaginary(this._type, 0);\n\t var real = coefs[0];\n\t var imag = coefs[1];\n\t var maxValue = 0;\n\t var twoPi = Math.PI * 2;\n\t //check for peaks in 8 places\n\t for (var i = 0; i < 8; i++) {\n\t maxValue = Math.max(this._inverseFFT(real, imag, i / 8 * twoPi), maxValue);\n\t }\n\t return -this._inverseFFT(real, imag, this._phase) / maxValue;\n\t };\n\t /**\n\t\t * The partials of the waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.Oscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.Oscillator.prototype, 'partials', {\n\t get: function () {\n\t if (this._type !== Tone.Oscillator.Type.Custom) {\n\t return [];\n\t } else {\n\t return this._partials;\n\t }\n\t },\n\t set: function (partials) {\n\t this._partials = partials;\n\t this.type = Tone.Oscillator.Type.Custom;\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.Oscillator#\n\t\t * @type {Degrees}\n\t\t * @name phase\n\t\t * @example\n\t\t * osc.phase = 180; //flips the phase of the oscillator\n\t\t */\n\t Object.defineProperty(Tone.Oscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._phase * (180 / Math.PI);\n\t },\n\t set: function (phase) {\n\t this._phase = phase * Math.PI / 180;\n\t //reset the type\n\t this.type = this._type;\n\t }\n\t });\n\t /**\n\t\t * Dispose and disconnect.\n\t\t * @return {Tone.Oscillator} this\n\t\t */\n\t Tone.Oscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t if (this._oscillator !== null) {\n\t this._oscillator.dispose();\n\t this._oscillator = null;\n\t }\n\t this._wave = null;\n\t this._writable([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this._partials = null;\n\t return this;\n\t };\n\t return Tone.Oscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class AudioToGain converts an input in AudioRange [-1,1] to NormalRange [0,1]. \n\t\t * See Tone.GainToAudio.\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @example\n\t\t * var a2g = new Tone.AudioToGain();\n\t\t */\n\t Tone.AudioToGain = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._norm = this.input = this.output = new Tone.WaveShaper(function (x) {\n\t return (x + 1) / 2;\n\t });\n\t };\n\t Tone.extend(Tone.AudioToGain, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.AudioToGain} this\n\t\t */\n\t Tone.AudioToGain.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._norm.dispose();\n\t this._norm = null;\n\t return this;\n\t };\n\t return Tone.AudioToGain;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Zero outputs 0's at audio-rate. The reason this has to be\n\t\t * it's own class is that many browsers optimize out Tone.Signal\n\t\t * with a value of 0 and will not process nodes further down the graph.\n\t\t * @extends {Tone.SignalBase}\n\t\t */\n\t Tone.Zero = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * The gain node\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gain = this.input = this.output = new Tone.Gain();\n\t this.context.getConstant(0).connect(this._gain);\n\t };\n\t Tone.extend(Tone.Zero, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @return {Tone.Zero} this\n\t\t */\n\t Tone.Zero.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._gain.dispose();\n\t this._gain = null;\n\t return this;\n\t };\n\t return Tone.Zero;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class LFO stands for low frequency oscillator. Tone.LFO produces an output signal\n\t\t * which can be attached to an AudioParam or Tone.Signal\n\t\t * in order to modulate that parameter with an oscillator. The LFO can\n\t\t * also be synced to the transport to start/stop and change when the tempo changes.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Frequency|Object} [frequency] The frequency of the oscillation. Typically, LFOs will be\n\t\t * in the frequency range of 0.1 to 10 hertz.\n\t\t * @param {number=} min The minimum output value of the LFO.\n\t\t * @param {number=} max The maximum value of the LFO.\n\t\t * @example\n\t\t * var lfo = new Tone.LFO(\"4n\", 400, 4000);\n\t\t * lfo.connect(filter.frequency);\n\t\t */\n\t Tone.LFO = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'min',\n\t 'max'\n\t ], Tone.LFO);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = new Tone.Oscillator({\n\t 'frequency': options.frequency,\n\t 'type': options.type\n\t });\n\t /**\n\t\t\t * the lfo's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._oscillator.frequency;\n\t /**\n\t\t\t * The amplitude of the LFO, which controls the output range between\n\t\t\t * the min and max output. For example if the min is -10 and the max\n\t\t\t * is 10, setting the amplitude to 0.5 would make the LFO modulate\n\t\t\t * between -5 and 5.\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.amplitude = this._oscillator.volume;\n\t this.amplitude.units = Tone.Type.NormalRange;\n\t this.amplitude.value = options.amplitude;\n\t /**\n\t\t\t * The signal which is output when the LFO is stopped\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._stoppedSignal = new Tone.Signal(0, Tone.Type.AudioRange);\n\t /**\n\t\t\t * Just outputs zeros.\n\t\t\t * @type {Tone.Zero}\n\t\t\t * @private\n\t\t\t */\n\t this._zeros = new Tone.Zero();\n\t /**\n\t\t\t * The value that the LFO outputs when it's stopped\n\t\t\t * @type {AudioRange}\n\t\t\t * @private\n\t\t\t */\n\t this._stoppedValue = 0;\n\t /**\n\t\t\t * @type {Tone.AudioToGain}\n\t\t\t * @private\n\t\t\t */\n\t this._a2g = new Tone.AudioToGain();\n\t /**\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._scaler = this.output = new Tone.Scale(options.min, options.max);\n\t /**\n\t\t\t * the units of the LFO (used for converting)\n\t\t\t * @type {Tone.Type}\n\t\t\t * @private\n\t\t\t */\n\t this._units = Tone.Type.Default;\n\t this.units = options.units;\n\t //connect it up\n\t this._oscillator.chain(this._a2g, this._scaler);\n\t this._zeros.connect(this._a2g);\n\t this._stoppedSignal.connect(this._a2g);\n\t this._readOnly([\n\t 'amplitude',\n\t 'frequency'\n\t ]);\n\t this.phase = options.phase;\n\t };\n\t Tone.extend(Tone.LFO, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t *\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.LFO.defaults = {\n\t 'type': 'sine',\n\t 'min': 0,\n\t 'max': 1,\n\t 'phase': 0,\n\t 'frequency': '4n',\n\t 'amplitude': 1,\n\t 'units': Tone.Type.Default\n\t };\n\t /**\n\t\t * Start the LFO.\n\t\t * @param {Time} [time=now] the time the LFO will start\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.start = function (time) {\n\t time = this.toSeconds(time);\n\t this._stoppedSignal.setValueAtTime(0, time);\n\t this._oscillator.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the LFO.\n\t\t * @param {Time} [time=now] the time the LFO will stop\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._stoppedSignal.setValueAtTime(this._stoppedValue, time);\n\t this._oscillator.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the start/stop/pause to the transport\n\t\t * and the frequency to the bpm of the transport\n\t\t * @returns {Tone.LFO} this\n\t\t * @example\n\t\t * lfo.frequency.value = \"8n\";\n\t\t * lfo.sync().start(0)\n\t\t * //the rate of the LFO will always be an eighth note,\n\t\t * //even as the tempo changes\n\t\t */\n\t Tone.LFO.prototype.sync = function () {\n\t this._oscillator.sync();\n\t this._oscillator.syncFrequency();\n\t return this;\n\t };\n\t /**\n\t\t * unsync the LFO from transport control\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.unsync = function () {\n\t this._oscillator.unsync();\n\t this._oscillator.unsyncFrequency();\n\t return this;\n\t };\n\t /**\n\t\t * The miniumum output of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'min', {\n\t get: function () {\n\t return this._toUnits(this._scaler.min);\n\t },\n\t set: function (min) {\n\t min = this._fromUnits(min);\n\t this._scaler.min = min;\n\t }\n\t });\n\t /**\n\t\t * The maximum output of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'max', {\n\t get: function () {\n\t return this._toUnits(this._scaler.max);\n\t },\n\t set: function (max) {\n\t max = this._fromUnits(max);\n\t this._scaler.max = max;\n\t }\n\t });\n\t /**\n\t\t * The type of the oscillator: sine, square, sawtooth, triangle.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'type', {\n\t get: function () {\n\t return this._oscillator.type;\n\t },\n\t set: function (type) {\n\t this._oscillator.type = type;\n\t this._stoppedValue = this._oscillator._getInitialValue();\n\t this._stoppedSignal.value = this._stoppedValue;\n\t }\n\t });\n\t /**\n\t\t * The phase of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'phase', {\n\t get: function () {\n\t return this._oscillator.phase;\n\t },\n\t set: function (phase) {\n\t this._oscillator.phase = phase;\n\t this._stoppedValue = this._oscillator._getInitialValue();\n\t this._stoppedSignal.value = this._stoppedValue;\n\t }\n\t });\n\t /**\n\t\t * The output units of the LFO.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {Tone.Type}\n\t\t * @name units\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'units', {\n\t get: function () {\n\t return this._units;\n\t },\n\t set: function (val) {\n\t var currentMin = this.min;\n\t var currentMax = this.max;\n\t //convert the min and the max\n\t this._units = val;\n\t this.min = currentMin;\n\t this.max = currentMax;\n\t }\n\t });\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.LFO#\n\t\t * @type {Boolean}\n\t\t * @name mute\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'mute', {\n\t get: function () {\n\t return this._oscillator.mute;\n\t },\n\t set: function (mute) {\n\t this._oscillator.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * Returns the playback state of the source, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.LFO#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.LFO.prototype, 'state', {\n\t get: function () {\n\t return this._oscillator.state;\n\t }\n\t });\n\t /**\n\t\t * Connect the output of the LFO to an AudioParam, AudioNode, or Tone Node.\n\t\t * Tone.LFO will automatically convert to the destination units of the\n\t\t * will get the units from the connected node.\n\t\t * @param {Tone | AudioParam | AudioNode} node\n\t\t * @param {number} [outputNum=0] optionally which output to connect from\n\t\t * @param {number} [inputNum=0] optionally which input to connect to\n\t\t * @returns {Tone.LFO} this\n\t\t * @private\n\t\t */\n\t Tone.LFO.prototype.connect = function (node) {\n\t if (node.constructor === Tone.Signal || node.constructor === Tone.Param) {\n\t this.convert = node.convert;\n\t this.units = node.units;\n\t }\n\t Tone.SignalBase.prototype.connect.apply(this, arguments);\n\t return this;\n\t };\n\t /**\n\t\t * private method borrowed from Param converts\n\t\t * units from their destination value\n\t\t * @function\n\t\t * @private\n\t\t */\n\t Tone.LFO.prototype._fromUnits = Tone.Param.prototype._fromUnits;\n\t /**\n\t\t * private method borrowed from Param converts\n\t\t * units to their destination value\n\t\t * @function\n\t\t * @private\n\t\t */\n\t Tone.LFO.prototype._toUnits = Tone.Param.prototype._toUnits;\n\t /**\n\t\t * disconnect and dispose\n\t\t * @returns {Tone.LFO} this\n\t\t */\n\t Tone.LFO.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'amplitude',\n\t 'frequency'\n\t ]);\n\t this._oscillator.dispose();\n\t this._oscillator = null;\n\t this._stoppedSignal.dispose();\n\t this._stoppedSignal = null;\n\t this._zeros.dispose();\n\t this._zeros = null;\n\t this._scaler.dispose();\n\t this._scaler = null;\n\t this._a2g.dispose();\n\t this._a2g = null;\n\t this.frequency = null;\n\t this.amplitude = null;\n\t return this;\n\t };\n\t return Tone.LFO;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Limiter will limit the loudness of an incoming signal.\n\t\t * It is composed of a Tone.Compressor with a fast attack\n\t\t * and release. Limiters are commonly used to safeguard against\n\t\t * signal clipping. Unlike a compressor, limiters do not provide\n\t\t * smooth gain reduction and almost completely prevent\n\t\t * additional gain above the threshold.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {number} threshold The theshold above which the limiting is applied.\n\t\t * @example\n\t\t * var limiter = new Tone.Limiter(-6);\n\t\t */\n\t Tone.Limiter = function () {\n\t var options = Tone.defaults(arguments, ['threshold'], Tone.Limiter);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * the compressor\n\t\t\t * @private\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this._compressor = this.input = this.output = new Tone.Compressor({\n\t 'attack': 0.001,\n\t 'decay': 0.001,\n\t 'threshold': options.threshold\n\t });\n\t /**\n\t\t\t * The threshold of of the limiter\n\t\t\t * @type {Decibel}\n\t\t\t * @signal\n\t\t\t */\n\t this.threshold = this._compressor.threshold;\n\t this._readOnly('threshold');\n\t };\n\t Tone.extend(Tone.Limiter, Tone.AudioNode);\n\t /**\n\t\t * The default value\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.Limiter.defaults = { 'threshold': -12 };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Limiter} this\n\t\t */\n\t Tone.Limiter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._compressor.dispose();\n\t this._compressor = null;\n\t this._writable('threshold');\n\t this.threshold = null;\n\t return this;\n\t };\n\t return Tone.Limiter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Lowpass is a lowpass feedback comb filter. It is similar to\n\t\t * Tone.FeedbackCombFilter, but includes a lowpass filter.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Time|Object} [delayTime] The delay time of the comb filter\n\t\t * @param {NormalRange=} resonance The resonance (feedback) of the comb filter\n\t\t * @param {Frequency=} dampening The cutoff of the lowpass filter dampens the\n\t\t * signal as it is fedback.\n\t\t */\n\t Tone.LowpassCombFilter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'resonance',\n\t 'dampening'\n\t ], Tone.LowpassCombFilter);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the delay node\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delay = this.input = new Tone.Delay(options.delayTime);\n\t /**\n\t\t\t * The delayTime of the comb filter.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._delay.delayTime;\n\t /**\n\t\t\t * the lowpass filter\n\t\t\t * @type {BiquadFilterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._lowpass = this.output = this.context.createBiquadFilter();\n\t this._lowpass.Q.value = -3.0102999566398125;\n\t this._lowpass.type = 'lowpass';\n\t /**\n\t\t\t * The dampening control of the feedback\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.dampening = new Tone.Param({\n\t 'param': this._lowpass.frequency,\n\t 'units': Tone.Type.Frequency,\n\t 'value': options.dampening\n\t });\n\t /**\n\t\t\t * the feedback gain\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedback = new Tone.Gain(options.resonance, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of feedback of the delayed signal.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.resonance = this._feedback.gain;\n\t //connections\n\t this._delay.chain(this._lowpass, this._feedback, this._delay);\n\t this._readOnly([\n\t 'dampening',\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t };\n\t Tone.extend(Tone.LowpassCombFilter, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.LowpassCombFilter.defaults = {\n\t 'delayTime': 0.1,\n\t 'resonance': 0.5,\n\t 'dampening': 3000\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.LowpassCombFilter} this\n\t\t */\n\t Tone.LowpassCombFilter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'dampening',\n\t 'resonance',\n\t 'delayTime'\n\t ]);\n\t this.dampening.dispose();\n\t this.dampening = null;\n\t this.resonance.dispose();\n\t this.resonance = null;\n\t this._delay.dispose();\n\t this._delay = null;\n\t this.delayTime = null;\n\t this._lowpass.disconnect();\n\t this._lowpass = null;\n\t this._feedback.disconnect();\n\t this._feedback = null;\n\t return this;\n\t };\n\t return Tone.LowpassCombFilter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Merge brings two signals into the left and right\n\t\t * channels of a single stereo channel.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * var merge = new Tone.Merge().toMaster();\n\t\t * //routing a sine tone in the left channel\n\t\t * //and noise in the right channel\n\t\t * var osc = new Tone.Oscillator().connect(merge.left);\n\t\t * var noise = new Tone.Noise().connect(merge.right);\n\t\t * //starting our oscillators\n\t\t * noise.start();\n\t\t * osc.start();\n\t\t */\n\t Tone.Merge = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * The left input channel.\n\t\t\t * Alias for <code>input[0]</code>\n\t\t\t * @type {GainNode}\n\t\t\t */\n\t this.left = this.input[0] = new Tone.Gain();\n\t /**\n\t\t\t * The right input channel.\n\t\t\t * Alias for <code>input[1]</code>.\n\t\t\t * @type {GainNode}\n\t\t\t */\n\t this.right = this.input[1] = new Tone.Gain();\n\t /**\n\t\t\t * the merger node for the two channels\n\t\t\t * @type {ChannelMergerNode}\n\t\t\t * @private\n\t\t\t */\n\t this._merger = this.output = this.context.createChannelMerger(2);\n\t //connections\n\t this.left.connect(this._merger, 0, 0);\n\t this.right.connect(this._merger, 0, 1);\n\t this.left.channelCount = 1;\n\t this.right.channelCount = 1;\n\t this.left.channelCountMode = 'explicit';\n\t this.right.channelCountMode = 'explicit';\n\t };\n\t Tone.extend(Tone.Merge, Tone.AudioNode);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Merge} this\n\t\t */\n\t Tone.Merge.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.left.dispose();\n\t this.left = null;\n\t this.right.dispose();\n\t this.right = null;\n\t this._merger.disconnect();\n\t this._merger = null;\n\t return this;\n\t };\n\t return Tone.Merge;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Meter gets the [RMS](https://en.wikipedia.org/wiki/Root_mean_square)\n\t\t * of an input signal with some averaging applied. It can also get the raw\n\t\t * value of the input signal.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number} smoothing The amount of smoothing applied between frames.\n\t\t * @example\n\t\t * var meter = new Tone.Meter();\n\t\t * var mic = new Tone.UserMedia().open();\n\t\t * //connect mic to the meter\n\t\t * mic.connect(meter);\n\t\t * //the current level of the mic input in decibels\n\t\t * var level = meter.getValue();\n\t\t */\n\t Tone.Meter = function () {\n\t var options = Tone.defaults(arguments, ['smoothing'], Tone.Meter);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node which computes the levels.\n\t\t\t * @private\n\t\t\t * @type {Tone.Analyser}\n\t\t\t */\n\t this.input = this.output = this._analyser = new Tone.Analyser('waveform', 1024);\n\t /**\n\t\t\t * The amount of carryover between the current and last frame.\n\t\t\t * Only applied meter for \"level\" type.\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.smoothing = options.smoothing;\n\t };\n\t Tone.extend(Tone.Meter, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @static\n\t\t * @const\n\t\t */\n\t Tone.Meter.defaults = { 'smoothing': 0.8 };\n\t /**\n\t\t * Get the current decibel value of the incoming signal\n\t\t * @returns {Decibels}\n\t\t */\n\t Tone.Meter.prototype.getLevel = function () {\n\t this._analyser.type = 'fft';\n\t var values = this._analyser.getValue();\n\t var offset = 28;\n\t // normalizes most signal levels\n\t // TODO: compute loudness from FFT\n\t return Math.max.apply(this, values) + offset;\n\t };\n\t /**\n\t\t * Get the signal value of the incoming signal\n\t\t * @returns {Number}\n\t\t */\n\t Tone.Meter.prototype.getValue = function () {\n\t this._analyser.type = 'waveform';\n\t var value = this._analyser.getValue();\n\t return value[0];\n\t };\n\t /**\n\t\t * A value from 0 -> 1 where 0 represents no time averaging with the last analysis frame.\n\t\t * @memberOf Tone.Meter#\n\t\t * @type {Number}\n\t\t * @name smoothing\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Meter.prototype, 'smoothing', {\n\t get: function () {\n\t return this._analyser.smoothing;\n\t },\n\t set: function (val) {\n\t this._analyser.smoothing = val;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Meter} this\n\t\t */\n\t Tone.Meter.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.dispose();\n\t this._analyser = null;\n\t return this;\n\t };\n\t return Tone.Meter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t *\t@class Tone.Split splits an incoming signal into left and right channels.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * var split = new Tone.Split();\n\t\t * stereoSignal.connect(split);\n\t\t */\n\t Tone.Split = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(0, 2);\n\t /**\n\t\t\t * @type {ChannelSplitterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._splitter = this.input = this.context.createChannelSplitter(2);\n\t this._splitter.channelCount = 2;\n\t this._splitter.channelCountMode = 'explicit';\n\t /**\n\t\t\t * Left channel output.\n\t\t\t * Alias for <code>output[0]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.left = this.output[0] = new Tone.Gain();\n\t /**\n\t\t\t * Right channel output.\n\t\t\t * Alias for <code>output[1]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.right = this.output[1] = new Tone.Gain();\n\t //connections\n\t this._splitter.connect(this.left, 0, 0);\n\t this._splitter.connect(this.right, 1, 0);\n\t };\n\t Tone.extend(Tone.Split, Tone.AudioNode);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Split} this\n\t\t */\n\t Tone.Split.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._splitter.disconnect();\n\t this.left.dispose();\n\t this.left = null;\n\t this.right.dispose();\n\t this.right = null;\n\t this._splitter = null;\n\t return this;\n\t };\n\t return Tone.Split;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Mid/Side processing separates the the 'mid' signal\n\t\t * (which comes out of both the left and the right channel)\n\t\t * and the 'side' (which only comes out of the the side channels). <br><br>\n\t\t * <code>\n\t\t * Mid = (Left+Right)/sqrt(2); // obtain mid-signal from left and right<br>\n\t\t * Side = (Left-Right)/sqrt(2); // obtain side-signal from left and righ<br>\n\t\t * </code>\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideSplit = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(0, 2);\n\t /**\n\t\t\t * split the incoming signal into left and right channels\n\t\t\t * @type {Tone.Split}\n\t\t\t * @private\n\t\t\t */\n\t this._split = this.input = new Tone.Split();\n\t /**\n\t\t\t * The mid send. Connect to mid processing. Alias for\n\t\t\t * <code>output[0]</code>\n\t\t\t * @type {Tone.Add}\n\t\t\t */\n\t this._midAdd = new Tone.Add();\n\t /**\n\t\t\t * Multiply the _midAdd by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this.mid = this.output[0] = new Tone.Multiply(Math.SQRT1_2);\n\t /**\n\t\t\t * The side output. Connect to side processing. Also Output 1\n\t\t\t * @type {Tone.Subtract}\n\t\t\t */\n\t this._sideSubtract = new Tone.Subtract();\n\t /**\n\t\t\t * Multiply the _midAdd by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this.side = this.output[1] = new Tone.Multiply(Math.SQRT1_2);\n\t this._split.connect(this._midAdd, 0, 0);\n\t this._split.connect(this._midAdd, 1, 1);\n\t this._split.connect(this._sideSubtract, 0, 0);\n\t this._split.connect(this._sideSubtract, 1, 1);\n\t this._midAdd.connect(this.mid);\n\t this._sideSubtract.connect(this.side);\n\t };\n\t Tone.extend(Tone.MidSideSplit, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MidSideSplit} this\n\t\t */\n\t Tone.MidSideSplit.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.side.dispose();\n\t this.side = null;\n\t this._midAdd.dispose();\n\t this._midAdd = null;\n\t this._sideSubtract.dispose();\n\t this._sideSubtract = null;\n\t this._split.dispose();\n\t this._split = null;\n\t return this;\n\t };\n\t return Tone.MidSideSplit;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Mid/Side processing separates the the 'mid' signal\n\t\t * (which comes out of both the left and the right channel)\n\t\t * and the 'side' (which only comes out of the the side channels).\n\t\t * MidSideMerge merges the mid and side signal after they've been seperated\n\t\t * by Tone.MidSideSplit.<br><br>\n\t\t * <code>\n\t\t * Left = (Mid+Side)/sqrt(2); // obtain left signal from mid and side<br>\n\t\t * Right = (Mid-Side)/sqrt(2); // obtain right signal from mid and side<br>\n\t\t * </code>\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideMerge = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(2, 0);\n\t /**\n\t\t\t * The mid signal input. Alias for\n\t\t\t * <code>input[0]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.mid = this.input[0] = new Tone.Gain();\n\t /**\n\t\t\t * recombine the mid/side into Left\n\t\t\t * @type {Tone.Add}\n\t\t\t * @private\n\t\t\t */\n\t this._left = new Tone.Add();\n\t /**\n\t\t\t * Multiply the left by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this._timesTwoLeft = new Tone.Multiply(Math.SQRT1_2);\n\t /**\n\t\t\t * The side signal input. Alias for\n\t\t\t * <code>input[1]</code>\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.side = this.input[1] = new Tone.Gain();\n\t /**\n\t\t\t * recombine the mid/side into Right\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._right = new Tone.Subtract();\n\t /**\n\t\t\t * Multiply the right by sqrt(1/2)\n\t\t\t * @type {Tone.Multiply}\n\t\t\t */\n\t this._timesTwoRight = new Tone.Multiply(Math.SQRT1_2);\n\t /**\n\t\t\t * Merge the left/right signal back into a stereo signal.\n\t\t\t * @type {Tone.Merge}\n\t\t\t * @private\n\t\t\t */\n\t this._merge = this.output = new Tone.Merge();\n\t this.mid.connect(this._left, 0, 0);\n\t this.side.connect(this._left, 0, 1);\n\t this.mid.connect(this._right, 0, 0);\n\t this.side.connect(this._right, 0, 1);\n\t this._left.connect(this._timesTwoLeft);\n\t this._right.connect(this._timesTwoRight);\n\t this._timesTwoLeft.connect(this._merge, 0, 0);\n\t this._timesTwoRight.connect(this._merge, 0, 1);\n\t };\n\t Tone.extend(Tone.MidSideMerge, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MidSideMerge} this\n\t\t */\n\t Tone.MidSideMerge.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.side.dispose();\n\t this.side = null;\n\t this._left.dispose();\n\t this._left = null;\n\t this._timesTwoLeft.dispose();\n\t this._timesTwoLeft = null;\n\t this._right.dispose();\n\t this._right = null;\n\t this._timesTwoRight.dispose();\n\t this._timesTwoRight = null;\n\t this._merge.dispose();\n\t this._merge = null;\n\t return this;\n\t };\n\t return Tone.MidSideMerge;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.MidSideCompressor applies two different compressors to the mid\n\t\t * and side signal components. See Tone.MidSideSplit.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Object} options The options that are passed to the mid and side\n\t\t * compressors.\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideCompressor = function (options) {\n\t Tone.AudioNode.call(this);\n\t options = Tone.defaultArg(options, Tone.MidSideCompressor.defaults);\n\t /**\n\t\t\t * the mid/side split\n\t\t\t * @type {Tone.MidSideSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideSplit = this.input = new Tone.MidSideSplit();\n\t /**\n\t\t\t * the mid/side recombination\n\t\t\t * @type {Tone.MidSideMerge}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideMerge = this.output = new Tone.MidSideMerge();\n\t /**\n\t\t\t * The compressor applied to the mid signal\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.mid = new Tone.Compressor(options.mid);\n\t /**\n\t\t\t * The compressor applied to the side signal\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.side = new Tone.Compressor(options.side);\n\t this._midSideSplit.mid.chain(this.mid, this._midSideMerge.mid);\n\t this._midSideSplit.side.chain(this.side, this._midSideMerge.side);\n\t this._readOnly([\n\t 'mid',\n\t 'side'\n\t ]);\n\t };\n\t Tone.extend(Tone.MidSideCompressor, Tone.AudioNode);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MidSideCompressor.defaults = {\n\t 'mid': {\n\t 'ratio': 3,\n\t 'threshold': -24,\n\t 'release': 0.03,\n\t 'attack': 0.02,\n\t 'knee': 16\n\t },\n\t 'side': {\n\t 'ratio': 6,\n\t 'threshold': -30,\n\t 'release': 0.25,\n\t 'attack': 0.03,\n\t 'knee': 10\n\t }\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MidSideCompressor} this\n\t\t */\n\t Tone.MidSideCompressor.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'mid',\n\t 'side'\n\t ]);\n\t this.mid.dispose();\n\t this.mid = null;\n\t this.side.dispose();\n\t this.side = null;\n\t this._midSideSplit.dispose();\n\t this._midSideSplit = null;\n\t this._midSideMerge.dispose();\n\t this._midSideMerge = null;\n\t return this;\n\t };\n\t return Tone.MidSideCompressor;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Mono coerces the incoming mono or stereo signal into a mono signal\n\t\t * where both left and right channels have the same value. This can be useful\n\t\t * for [stereo imaging](https://en.wikipedia.org/wiki/Stereo_imaging).\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t */\n\t Tone.Mono = function () {\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 0);\n\t /**\n\t\t\t * merge the signal\n\t\t\t * @type {Tone.Merge}\n\t\t\t * @private\n\t\t\t */\n\t this._merge = this.output = new Tone.Merge();\n\t this.input.connect(this._merge, 0, 0);\n\t this.input.connect(this._merge, 0, 1);\n\t };\n\t Tone.extend(Tone.Mono, Tone.AudioNode);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Mono} this\n\t\t */\n\t Tone.Mono.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._merge.dispose();\n\t this._merge = null;\n\t return this;\n\t };\n\t return Tone.Mono;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A compressor with seperate controls over low/mid/high dynamics\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {Object} options The low/mid/high compressor settings.\n\t\t * @example\n\t\t * var multiband = new Tone.MultibandCompressor({\n\t\t * \t\"lowFrequency\" : 200,\n\t\t * \t\"highFrequency\" : 1300\n\t\t * \t\"low\" : {\n\t\t * \t\t\"threshold\" : -12\n\t\t * \t}\n\t\t * })\n\t\t */\n\t Tone.MultibandCompressor = function (options) {\n\t Tone.AudioNode.call(this);\n\t options = Tone.defaultArg(arguments, Tone.MultibandCompressor.defaults);\n\t /**\n\t\t\t * split the incoming signal into high/mid/low\n\t\t\t * @type {Tone.MultibandSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._splitter = this.input = new Tone.MultibandSplit({\n\t 'lowFrequency': options.lowFrequency,\n\t 'highFrequency': options.highFrequency\n\t });\n\t /**\n\t\t\t * low/mid crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.lowFrequency = this._splitter.lowFrequency;\n\t /**\n\t\t\t * mid/high crossover frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.highFrequency = this._splitter.highFrequency;\n\t /**\n\t\t\t * the output\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.output = new Tone.Gain();\n\t /**\n\t\t\t * The compressor applied to the low frequencies.\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.low = new Tone.Compressor(options.low);\n\t /**\n\t\t\t * The compressor applied to the mid frequencies.\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.mid = new Tone.Compressor(options.mid);\n\t /**\n\t\t\t * The compressor applied to the high frequencies.\n\t\t\t * @type {Tone.Compressor}\n\t\t\t */\n\t this.high = new Tone.Compressor(options.high);\n\t //connect the compressor\n\t this._splitter.low.chain(this.low, this.output);\n\t this._splitter.mid.chain(this.mid, this.output);\n\t this._splitter.high.chain(this.high, this.output);\n\t this._readOnly([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t };\n\t Tone.extend(Tone.MultibandCompressor, Tone.AudioNode);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MultibandCompressor.defaults = {\n\t 'low': Tone.Compressor.defaults,\n\t 'mid': Tone.Compressor.defaults,\n\t 'high': Tone.Compressor.defaults,\n\t 'lowFrequency': 250,\n\t 'highFrequency': 2000\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MultibandCompressor} this\n\t\t */\n\t Tone.MultibandCompressor.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._splitter.dispose();\n\t this._writable([\n\t 'high',\n\t 'mid',\n\t 'low',\n\t 'highFrequency',\n\t 'lowFrequency'\n\t ]);\n\t this.low.dispose();\n\t this.mid.dispose();\n\t this.high.dispose();\n\t this._splitter = null;\n\t this.low = null;\n\t this.mid = null;\n\t this.high = null;\n\t this.lowFrequency = null;\n\t this.highFrequency = null;\n\t return this;\n\t };\n\t return Tone.MultibandCompressor;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported && !window.StereoPannerNode) {\n\t /**\n\t\t\t * @class Shimmed StereoPannerNode\n\t\t\t * @param {AudioContext} context\n\t\t\t * @private\n\t\t\t */\n\t var StereoPannerNode = function (context) {\n\t /**\n\t\t\t\t * The audio context\n\t\t\t\t * @type {AudioContext}\n\t\t\t\t */\n\t this.context = context;\n\t /**\n\t\t\t\t * The left/right panning. [-1, 1]\n\t\t\t\t * @type {AudioRange}\n\t\t\t\t * @signal\n\t\t\t\t */\n\t this.pan = new Tone.Signal(0, Tone.Type.AudioRange);\n\t /**\n\t\t\t\t * Equal power scaling of the right gain\n\t\t\t\t * @type {Tone.WaveShaper}\n\t\t\t\t */\n\t var rightWaveShaper = new Tone.WaveShaper(function (val) {\n\t return Tone.equalPowerScale((val + 1) / 2);\n\t }, 4096);\n\t /**\n\t\t\t\t * Equal power scaling of the left gain\n\t\t\t\t * @type {Tone.WaveShaper}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var leftWaveShaper = new Tone.WaveShaper(function (val) {\n\t return Tone.equalPowerScale(1 - (val + 1) / 2);\n\t }, 4096);\n\t /**\n\t\t\t\t * The left gain value\n\t\t\t\t * @type {Tone.Gain}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var leftGain = new Tone.Gain();\n\t /**\n\t\t\t\t * The right gain value\n\t\t\t\t * @type {Tone.Gain}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var rightGain = new Tone.Gain();\n\t /**\n\t\t\t\t * Split the incoming signal\n\t\t\t\t * @type {Tone.Split}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var split = this.input = new Tone.Split();\n\t /**\n\t\t\t\t * Keeps the waveshapers from optimizing 0s\n\t\t\t\t * @type {Tone.Zero}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var zero = new Tone.Zero();\n\t zero.fan(rightWaveShaper, leftWaveShaper);\n\t /**\n\t\t\t\t * Merge the outgoing signal\n\t\t\t\t * @type {Tone.Merge}\n\t\t\t\t * @private\n\t\t\t\t */\n\t var merge = this.output = new Tone.Merge();\n\t //connections\n\t split.left.chain(leftGain, merge.left);\n\t split.right.chain(rightGain, merge.right);\n\t this.pan.chain(leftWaveShaper, leftGain.gain);\n\t this.pan.chain(rightWaveShaper, rightGain.gain);\n\t };\n\t StereoPannerNode.prototype.disconnect = function () {\n\t this.output.disconnect.apply(this.output, arguments);\n\t };\n\t StereoPannerNode.prototype.connect = function () {\n\t this.output.connect.apply(this.output, arguments);\n\t };\n\t //add it to the AudioContext\n\t AudioContext.prototype.createStereoPanner = function () {\n\t return new StereoPannerNode(this);\n\t };\n\t Tone.Context.prototype.createStereoPanner = function () {\n\t return new StereoPannerNode(this);\n\t };\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Panner is an equal power Left/Right Panner and does not\n\t\t * support 3D. Panner uses the StereoPannerNode when available.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {NormalRange} [initialPan=0] The initail panner value (center).\n\t\t * @example\n\t\t * //pan the input signal hard right.\n\t\t * var panner = new Tone.Panner(1);\n\t\t */\n\t Tone.Panner = function (initialPan) {\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t* the panner node\n\t\t\t* @type {StereoPannerNode}\n\t\t\t* @private\n\t\t\t*/\n\t this._panner = this.input = this.output = this.context.createStereoPanner();\n\t /**\n\t\t\t* The pan control. -1 = hard left, 1 = hard right.\n\t\t\t* @type {AudioRange}\n\t\t\t* @signal\n\t\t\t*/\n\t this.pan = this._panner.pan;\n\t //initial value\n\t this.pan.value = Tone.defaultArg(initialPan, 0);\n\t this._readOnly('pan');\n\t };\n\t Tone.extend(Tone.Panner, Tone.AudioNode);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Panner} this\n\t\t */\n\t Tone.Panner.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable('pan');\n\t this._panner.disconnect();\n\t this._panner = null;\n\t this.pan = null;\n\t return this;\n\t };\n\t return Tone.Panner;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A spatialized panner node which supports equalpower or HRTF panning.\n\t\t * Tries to normalize the API across various browsers. See Tone.Listener\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number} positionX The initial x position.\n\t\t * @param {Number} positionY The initial y position.\n\t\t * @param {Number} positionZ The initial z position.\n\t\t */\n\t Tone.Panner3D = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'positionX',\n\t 'positionY',\n\t 'positionZ'\n\t ], Tone.Panner3D);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The panner node\n\t\t\t * @type {PannerNode}\n\t\t\t * @private\n\t\t\t */\n\t this._panner = this.input = this.output = this.context.createPanner();\n\t //set some values\n\t this._panner.panningModel = options.panningModel;\n\t this._panner.maxDistance = options.maxDistance;\n\t this._panner.distanceModel = options.distanceModel;\n\t this._panner.coneOuterGain = options.coneOuterGain;\n\t this._panner.coneOuterAngle = options.coneOuterAngle;\n\t this._panner.coneInnerAngle = options.coneInnerAngle;\n\t this._panner.refDistance = options.refDistance;\n\t this._panner.rolloffFactor = options.rolloffFactor;\n\t /**\n\t\t\t * Holds the current orientation\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._orientation = [\n\t options.orientationX,\n\t options.orientationY,\n\t options.orientationZ\n\t ];\n\t /**\n\t\t\t * Holds the current position\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._position = [\n\t options.positionX,\n\t options.positionY,\n\t options.positionZ\n\t ];\n\t // set the default position/orientation\n\t this.orientationX = options.orientationX;\n\t this.orientationY = options.orientationY;\n\t this.orientationZ = options.orientationZ;\n\t this.positionX = options.positionX;\n\t this.positionY = options.positionY;\n\t this.positionZ = options.positionZ;\n\t };\n\t Tone.extend(Tone.Panner3D, Tone.AudioNode);\n\t /**\n\t\t * Defaults according to the specification\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Panner3D.defaults = {\n\t 'positionX': 0,\n\t 'positionY': 0,\n\t 'positionZ': 0,\n\t 'orientationX': 0,\n\t 'orientationY': 0,\n\t 'orientationZ': 0,\n\t 'panningModel': 'equalpower',\n\t 'maxDistance': 10000,\n\t 'distanceModel': 'inverse',\n\t 'coneOuterGain': 0,\n\t 'coneOuterAngle': 360,\n\t 'coneInnerAngle': 360,\n\t 'refDistance': 1,\n\t 'rolloffFactor': 1\n\t };\n\t /**\n\t\t * The ramp time which is applied to the setTargetAtTime\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.Panner3D.prototype._rampTimeConstant = 0.01;\n\t /**\n\t\t * Sets the position of the source in 3d space.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @return {Tone.Panner3D} this\n\t\t */\n\t Tone.Panner3D.prototype.setPosition = function (x, y, z) {\n\t if (this._panner.positionX) {\n\t var now = this.now();\n\t this._panner.positionX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this._panner.positionY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this._panner.positionZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t } else {\n\t this._panner.setPosition(x, y, z);\n\t }\n\t this._position = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * Sets the orientation of the source in 3d space.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @return {Tone.Panner3D} this\n\t\t */\n\t Tone.Panner3D.prototype.setOrientation = function (x, y, z) {\n\t if (this._panner.orientationX) {\n\t var now = this.now();\n\t this._panner.orientationX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this._panner.orientationY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this._panner.orientationZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t } else {\n\t this._panner.setOrientation(x, y, z);\n\t }\n\t this._orientation = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * The x position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name positionX\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'positionX', {\n\t set: function (pos) {\n\t this._position[0] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[0];\n\t }\n\t });\n\t /**\n\t\t * The y position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name positionY\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'positionY', {\n\t set: function (pos) {\n\t this._position[1] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[1];\n\t }\n\t });\n\t /**\n\t\t * The z position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name positionZ\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'positionZ', {\n\t set: function (pos) {\n\t this._position[2] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[2];\n\t }\n\t });\n\t /**\n\t\t * The x orientation of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name orientationX\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'orientationX', {\n\t set: function (pos) {\n\t this._orientation[0] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[0];\n\t }\n\t });\n\t /**\n\t\t * The y orientation of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name orientationY\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'orientationY', {\n\t set: function (pos) {\n\t this._orientation[1] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[1];\n\t }\n\t });\n\t /**\n\t\t * The z orientation of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name orientationZ\n\t\t */\n\t Object.defineProperty(Tone.Panner3D.prototype, 'orientationZ', {\n\t set: function (pos) {\n\t this._orientation[2] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[2];\n\t }\n\t });\n\t /**\n\t\t * Proxy a property on the panner to an exposed public propery\n\t\t * @param {String} prop\n\t\t * @private\n\t\t */\n\t Tone.Panner3D._aliasProperty = function (prop) {\n\t Object.defineProperty(Tone.Panner3D.prototype, prop, {\n\t set: function (val) {\n\t this._panner[prop] = val;\n\t },\n\t get: function () {\n\t return this._panner[prop];\n\t }\n\t });\n\t };\n\t /**\n\t\t * The panning model. Either \"equalpower\" or \"HRTF\".\n\t\t * @type {String}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name panningModel\n\t\t */\n\t Tone.Panner3D._aliasProperty('panningModel');\n\t /**\n\t\t * A reference distance for reducing volume as source move further from the listener\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name refDistance\n\t\t */\n\t Tone.Panner3D._aliasProperty('refDistance');\n\t /**\n\t\t * Describes how quickly the volume is reduced as source moves away from listener.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name rolloffFactor\n\t\t */\n\t Tone.Panner3D._aliasProperty('rolloffFactor');\n\t /**\n\t\t * The distance model used by, \"linear\", \"inverse\", or \"exponential\".\n\t\t * @type {String}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name distanceModel\n\t\t */\n\t Tone.Panner3D._aliasProperty('distanceModel');\n\t /**\n\t\t * The angle, in degrees, inside of which there will be no volume reduction\n\t\t * @type {Degrees}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name coneInnerAngle\n\t\t */\n\t Tone.Panner3D._aliasProperty('coneInnerAngle');\n\t /**\n\t\t * The angle, in degrees, outside of which the volume will be reduced\n\t\t * to a constant value of coneOuterGain\n\t\t * @type {Degrees}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name coneOuterAngle\n\t\t */\n\t Tone.Panner3D._aliasProperty('coneOuterAngle');\n\t /**\n\t\t * The gain outside of the coneOuterAngle\n\t\t * @type {Gain}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name coneOuterGain\n\t\t */\n\t Tone.Panner3D._aliasProperty('coneOuterGain');\n\t /**\n\t\t * The maximum distance between source and listener,\n\t\t * after which the volume will not be reduced any further.\n\t\t * @type {Positive}\n\t\t * @memberOf Tone.Panner3D#\n\t\t * @name maxDistance\n\t\t */\n\t Tone.Panner3D._aliasProperty('maxDistance');\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Panner3D} this\n\t\t */\n\t Tone.Panner3D.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._panner.disconnect();\n\t this._panner = null;\n\t this._orientation = null;\n\t this._position = null;\n\t return this;\n\t };\n\t return Tone.Panner3D;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PanVol is a Tone.Panner and Tone.Volume in one.\n\t\t *\n\t\t * @extends {Tone.AudioNode}\n\t\t * @constructor\n\t\t * @param {AudioRange} pan the initial pan\n\t\t * @param {number} volume The output volume.\n\t\t * @example\n\t\t * //pan the incoming signal left and drop the volume\n\t\t * var panVol = new Tone.PanVol(-0.25, -12);\n\t\t */\n\t Tone.PanVol = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'pan',\n\t 'volume'\n\t ], Tone.PanVol);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The panning node\n\t\t\t * @type {Tone.Panner}\n\t\t\t * @private\n\t\t\t */\n\t this._panner = this.input = new Tone.Panner(options.pan);\n\t /**\n\t\t\t * The L/R panning control.\n\t\t\t * @type {AudioRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.pan = this._panner.pan;\n\t /**\n\t\t\t * The volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume control in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t //connections\n\t this._panner.connect(this._volume);\n\t this.mute = options.mute;\n\t this._readOnly([\n\t 'pan',\n\t 'volume'\n\t ]);\n\t };\n\t Tone.extend(Tone.PanVol, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t * @static\n\t\t */\n\t Tone.PanVol.defaults = {\n\t 'pan': 0,\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Mute/unmute the volume\n\t\t * @memberOf Tone.PanVol#\n\t\t * @name mute\n\t\t * @type {Boolean}\n\t\t */\n\t Object.defineProperty(Tone.PanVol.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.PanVol} this\n\t\t */\n\t Tone.PanVol.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._writable([\n\t 'pan',\n\t 'volume'\n\t ]);\n\t this._panner.dispose();\n\t this._panner = null;\n\t this.pan = null;\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t return this;\n\t };\n\t return Tone.PanVol;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Solo lets you isolate a specific audio stream. When\n\t\t * an instance is set to `solo=true`, it will mute all other instances.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @example\n\t\t * var soloA = new Tone.Solo()\n\t\t * var soloB = new Tone.Solo()\n\t\t * soloA.solo = true\n\t\t * //no audio will pass through soloB\n\t\t */\n\t Tone.Solo = function () {\n\t var options = Tone.defaults(arguments, ['solo'], Tone.Solo);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The input and output node\n\t\t\t * @type {Tone.Gain}\n\t\t\t */\n\t this.input = this.output = new Tone.Gain();\n\t /**\n\t\t\t * A bound _soloed method\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._soloBind = this._soloed.bind(this);\n\t //listen for solo events class-wide.\n\t this.context.on('solo', this._soloBind);\n\t //set initially\n\t this.solo = options.solo;\n\t };\n\t Tone.extend(Tone.Solo, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @static\n\t\t */\n\t Tone.Solo.defaults = { solo: false };\n\t /**\n\t\t * Isolates this instance and mutes all other instances of Tone.Solo.\n\t\t * Only one instance can be soloed at a time. A soloed\n\t\t * instance will report `solo=false` when another instance is soloed.\n\t\t * @memberOf Tone.Solo#\n\t\t * @type {Boolean}\n\t\t * @name solo\n\t\t */\n\t Object.defineProperty(Tone.Solo.prototype, 'solo', {\n\t get: function () {\n\t return this._isSoloed();\n\t },\n\t set: function (solo) {\n\t if (solo) {\n\t this._addSolo();\n\t } else {\n\t this._removeSolo();\n\t }\n\t this.context.emit('solo', this);\n\t }\n\t });\n\t /**\n\t\t * If the current instance is muted, i.e. another instance is soloed\n\t\t * @memberOf Tone.Solo#\n\t\t * @type {Boolean}\n\t\t * @name muted\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Solo.prototype, 'muted', {\n\t get: function () {\n\t return this.input.gain.value === 0;\n\t }\n\t });\n\t /**\n\t\t * Add this to the soloed array\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._addSolo = function () {\n\t if (!Tone.isArray(this.context._currentSolo)) {\n\t this.context._currentSolo = [];\n\t }\n\t if (!this._isSoloed()) {\n\t this.context._currentSolo.push(this);\n\t }\n\t };\n\t /**\n\t\t * Remove this from the soloed array\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._removeSolo = function () {\n\t if (this._isSoloed()) {\n\t var index = this.context._currentSolo.indexOf(this);\n\t this.context._currentSolo.splice(index, 1);\n\t }\n\t };\n\t /**\n\t\t * @return {Boolean} Is this on the soloed array\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._isSoloed = function () {\n\t if (Tone.isArray(this.context._currentSolo)) {\n\t return this.context._currentSolo.length !== 0 && this.context._currentSolo.indexOf(this) !== -1;\n\t } else {\n\t return false;\n\t }\n\t };\n\t /**\n\t\t * @return {Boolean} Returns true if no one is soloed\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._noSolos = function () {\n\t return !Tone.isArray(this.context._currentSolo) || this.context._currentSolo.length === 0;\n\t };\n\t /**\n\t\t * Solo the current instance and unsolo all other instances.\n\t\t * @param {Tone.Solo} instance The instance which is being soloed/unsoloed.\n\t\t * @private\n\t\t */\n\t Tone.Solo.prototype._soloed = function () {\n\t if (this._isSoloed()) {\n\t this.input.gain.value = 1;\n\t } else if (this._noSolos()) {\n\t //no one is soloed\n\t this.input.gain.value = 1;\n\t } else {\n\t this.input.gain.value = 0;\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Solo} this\n\t\t */\n\t Tone.Solo.prototype.dispose = function () {\n\t this.context.off('solo', this._soloBind);\n\t this._removeSolo();\n\t this._soloBind = null;\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.Solo;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Get the current waveform data of the connected audio source.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Number=} size The size of the FFT. Value must be a power of\n\t\t * two in the range 32 to 32768.\n\t\t */\n\t Tone.Waveform = function () {\n\t var options = Tone.defaults(arguments, ['size'], Tone.Waveform);\n\t options.type = Tone.Analyser.Type.Waveform;\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The analyser node.\n\t\t\t * @private\n\t\t\t * @type {Tone.Analyser}\n\t\t\t */\n\t this._analyser = this.input = this.output = new Tone.Analyser(options);\n\t };\n\t Tone.extend(Tone.Waveform, Tone.AudioNode);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Waveform.defaults = { 'size': 1024 };\n\t /**\n\t\t * Gets the waveform of the audio source. Returns the waveform data\n\t\t * of length [size](#size) as a Float32Array with values between -1 and 1.\n\t\t * @returns {TypedArray}\n\t\t */\n\t Tone.Waveform.prototype.getValue = function () {\n\t return this._analyser.getValue();\n\t };\n\t /**\n\t\t * The size of analysis. This must be a power of two in the range 32 to 32768.\n\t\t * @memberOf Tone.Waveform#\n\t\t * @type {Number}\n\t\t * @name size\n\t\t */\n\t Object.defineProperty(Tone.Waveform.prototype, 'size', {\n\t get: function () {\n\t return this._analyser.size;\n\t },\n\t set: function (size) {\n\t this._analyser.size = size;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Waveform} this\n\t\t */\n\t Tone.Waveform.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._analyser.dispose();\n\t this._analyser = null;\n\t };\n\t return Tone.Waveform;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.CtrlInterpolate will interpolate between given values based\n\t\t * on the \"index\" property. Passing in an array or object literal\n\t\t * will interpolate each of the parameters. Note (i.e. \"C3\")\n\t\t * and Time (i.e. \"4n + 2\") can be interpolated. All other values are\n\t\t * assumed to be numbers. \n\t\t * @example\n\t\t * var interp = new Tone.CtrlInterpolate([0, 2, 9, 4]);\n\t\t * interp.index = 0.75;\n\t\t * interp.value; //returns 1.5\n\t\t *\n\t\t * @example\n\t\t * var interp = new Tone.CtrlInterpolate([\n\t\t * \t[2, 4, 5],\n\t\t * \t[9, 3, 2],\n\t\t * ]);\n\t\t * @param {Array} values The array of values to interpolate over\n\t\t * @param {Positive} index The initial interpolation index.\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.CtrlInterpolate = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'values',\n\t 'index'\n\t ], Tone.CtrlInterpolate);\n\t Tone.call(this);\n\t /**\n\t\t\t * The values to interpolate between\n\t\t\t * @type {Array}\n\t\t\t */\n\t this.values = options.values;\n\t /**\n\t\t\t * The interpolated index between values. For example: a value of 1.5\n\t\t\t * would interpolate equally between the value at index 1\n\t\t\t * and the value at index 2. \n\t\t\t * @example\n\t\t\t * interp.index = 0; \n\t\t\t * interp.value; //returns the value at 0\n\t\t\t * interp.index = 0.5;\n\t\t\t * interp.value; //returns the value between indices 0 and 1. \n\t\t\t * @type {Positive}\n\t\t\t */\n\t this.index = options.index;\n\t };\n\t Tone.extend(Tone.CtrlInterpolate);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.CtrlInterpolate.defaults = {\n\t 'index': 0,\n\t 'values': []\n\t };\n\t /**\n\t\t * The current interpolated value based on the index\n\t\t * @readOnly\n\t\t * @memberOf Tone.CtrlInterpolate#\n\t\t * @type {*}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.CtrlInterpolate.prototype, 'value', {\n\t get: function () {\n\t var index = this.index;\n\t index = Math.min(index, this.values.length - 1);\n\t var lowerPosition = Math.floor(index);\n\t var lower = this.values[lowerPosition];\n\t var upper = this.values[Math.ceil(index)];\n\t return this._interpolate(index - lowerPosition, lower, upper);\n\t }\n\t });\n\t /**\n\t\t * Internal interpolation routine\n\t\t * @param {NormalRange} index The index between the lower and upper\n\t\t * @param {*} lower \n\t\t * @param {*} upper \n\t\t * @return {*} The interpolated value\n\t\t * @private\n\t\t */\n\t Tone.CtrlInterpolate.prototype._interpolate = function (index, lower, upper) {\n\t if (Tone.isArray(lower)) {\n\t var retArray = [];\n\t for (var i = 0; i < lower.length; i++) {\n\t retArray[i] = this._interpolate(index, lower[i], upper[i]);\n\t }\n\t return retArray;\n\t } else if (Tone.isObject(lower)) {\n\t var retObj = {};\n\t for (var attr in lower) {\n\t retObj[attr] = this._interpolate(index, lower[attr], upper[attr]);\n\t }\n\t return retObj;\n\t } else {\n\t lower = this._toNumber(lower);\n\t upper = this._toNumber(upper);\n\t return (1 - index) * lower + index * upper;\n\t }\n\t };\n\t /**\n\t\t * Convert from the given type into a number\n\t\t * @param {Number|String} value\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.CtrlInterpolate.prototype._toNumber = function (val) {\n\t if (Tone.isNumber(val)) {\n\t return val;\n\t } else {\n\t //otherwise assume that it's Time...\n\t return this.toSeconds(val);\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.CtrlInterpolate} this\n\t\t */\n\t Tone.CtrlInterpolate.prototype.dispose = function () {\n\t this.values = null;\n\t };\n\t return Tone.CtrlInterpolate;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.CtrlMarkov represents a Markov Chain where each call\n\t\t * to Tone.CtrlMarkov.next will move to the next state. If the next\n\t\t * state choice is an array, the next state is chosen randomly with\n\t\t * even probability for all of the choices. For a weighted probability\n\t\t * of the next choices, pass in an object with \"state\" and \"probability\" attributes. \n\t\t * The probabilities will be normalized and then chosen. If no next options\n\t\t * are given for the current state, the state will stay there. \n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * var chain = new Tone.CtrlMarkov({\n\t\t * \t\"beginning\" : [\"end\", \"middle\"],\n\t\t * \t\"middle\" : \"end\"\n\t\t * });\n\t\t * chain.value = \"beginning\";\n\t\t * chain.next(); //returns \"end\" or \"middle\" with 50% probability\n\t\t *\n\t\t * @example\n\t\t * var chain = new Tone.CtrlMarkov({\n\t\t * \t\"beginning\" : [{\"value\" : \"end\", \"probability\" : 0.8}, \n\t\t * \t\t\t\t\t{\"value\" : \"middle\", \"probability\" : 0.2}],\n\t\t * \t\"middle\" : \"end\"\n\t\t * });\n\t\t * chain.value = \"beginning\";\n\t\t * chain.next(); //returns \"end\" with 80% probability or \"middle\" with 20%.\n\t\t * @param {Object} values An object with the state names as the keys\n\t\t * and the next state(s) as the values. \n\t\t */\n\t Tone.CtrlMarkov = function (values, initial) {\n\t Tone.call(this);\n\t /**\n\t\t\t * The Markov values with states as the keys\n\t\t\t * and next state(s) as the values. \n\t\t\t * @type {Object}\n\t\t\t */\n\t this.values = Tone.defaultArg(values, {});\n\t /**\n\t\t\t * The current state of the Markov values. The next\n\t\t\t * state will be evaluated and returned when Tone.CtrlMarkov.next\n\t\t\t * is invoked.\n\t\t\t * @type {String}\n\t\t\t */\n\t this.value = Tone.defaultArg(initial, Object.keys(this.values)[0]);\n\t };\n\t Tone.extend(Tone.CtrlMarkov);\n\t /**\n\t\t * Returns the next state of the Markov values. \n\t\t * @return {String}\n\t\t */\n\t Tone.CtrlMarkov.prototype.next = function () {\n\t if (this.values.hasOwnProperty(this.value)) {\n\t var next = this.values[this.value];\n\t if (Tone.isArray(next)) {\n\t var distribution = this._getProbDistribution(next);\n\t var rand = Math.random();\n\t var total = 0;\n\t for (var i = 0; i < distribution.length; i++) {\n\t var dist = distribution[i];\n\t if (rand > total && rand < total + dist) {\n\t var chosen = next[i];\n\t if (Tone.isObject(chosen)) {\n\t this.value = chosen.value;\n\t } else {\n\t this.value = chosen;\n\t }\n\t }\n\t total += dist;\n\t }\n\t } else {\n\t this.value = next;\n\t }\n\t }\n\t return this.value;\n\t };\n\t /**\n\t\t * Choose randomly from an array weighted options in the form \n\t\t * {\"state\" : string, \"probability\" : number} or an array of values\n\t\t * @param {Array} options \n\t\t * @return {Array} The randomly selected choice\n\t\t * @private\n\t\t */\n\t Tone.CtrlMarkov.prototype._getProbDistribution = function (options) {\n\t var distribution = [];\n\t var total = 0;\n\t var needsNormalizing = false;\n\t for (var i = 0; i < options.length; i++) {\n\t var option = options[i];\n\t if (Tone.isObject(option)) {\n\t needsNormalizing = true;\n\t distribution[i] = option.probability;\n\t } else {\n\t distribution[i] = 1 / options.length;\n\t }\n\t total += distribution[i];\n\t }\n\t if (needsNormalizing) {\n\t //normalize the values\n\t for (var j = 0; j < distribution.length; j++) {\n\t distribution[j] = distribution[j] / total;\n\t }\n\t }\n\t return distribution;\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.CtrlMarkov} this\n\t\t */\n\t Tone.CtrlMarkov.prototype.dispose = function () {\n\t this.values = null;\n\t };\n\t return Tone.CtrlMarkov;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Generate patterns from an array of values.\n\t\t * Has a number of arpeggiation and randomized\n\t\t * selection patterns. \n\t\t * <ul>\n\t\t * \t <li>\"up\" - cycles upward</li>\n\t\t * \t\t\t<li>\"down\" - cycles downward</li>\n\t\t * \t\t\t<li>\"upDown\" - up then and down</li>\n\t\t * \t\t\t<li>\"downUp\" - cycles down then and up</li>\n\t\t * \t\t\t<li>\"alternateUp\" - jump up two and down one</li>\n\t\t * \t\t\t<li>\"alternateDown\" - jump down two and up one</li>\n\t\t * \t\t\t<li>\"random\" - randomly select an index</li>\n\t\t * \t\t\t<li>\"randomWalk\" - randomly moves one index away from the current position</li>\n\t\t * \t\t\t<li>\"randomOnce\" - randomly select an index without repeating until all values have been chosen.</li>\n\t\t * \t\t</ul>\n\t\t * @param {Array} values An array of options to choose from.\n\t\t * @param {Tone.CtrlPattern.Type=} type The name of the pattern.\n\t\t * @extends {Tone}\n\t\t */\n\t Tone.CtrlPattern = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'values',\n\t 'type'\n\t ], Tone.CtrlPattern);\n\t Tone.call(this);\n\t /**\n\t\t\t * The array of values to arpeggiate over\n\t\t\t * @type {Array}\n\t\t\t */\n\t this.values = options.values;\n\t /**\n\t\t\t * The current position in the values array\n\t\t\t * @type {Number}\n\t\t\t */\n\t this.index = 0;\n\t /**\n\t\t\t * The type placeholder\n\t\t\t * @type {Tone.CtrlPattern.Type}\n\t\t\t * @private\n\t\t\t */\n\t this._type = null;\n\t /**\n\t\t\t * Shuffled values for the RandomOnce type\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._shuffled = null;\n\t /**\n\t\t\t * The direction of the movement\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._direction = null;\n\t this.type = options.type;\n\t };\n\t Tone.extend(Tone.CtrlPattern);\n\t /**\n\t\t * The Control Patterns\n\t\t * @type {Object}\n\t\t * @static\n\t\t */\n\t Tone.CtrlPattern.Type = {\n\t Up: 'up',\n\t Down: 'down',\n\t UpDown: 'upDown',\n\t DownUp: 'downUp',\n\t AlternateUp: 'alternateUp',\n\t AlternateDown: 'alternateDown',\n\t Random: 'random',\n\t RandomWalk: 'randomWalk',\n\t RandomOnce: 'randomOnce'\n\t };\n\t /**\n\t\t * The default values. \n\t\t * @type {Object}\n\t\t */\n\t Tone.CtrlPattern.defaults = {\n\t 'type': Tone.CtrlPattern.Type.Up,\n\t 'values': []\n\t };\n\t /**\n\t\t * The value at the current index of the pattern.\n\t\t * @readOnly\n\t\t * @memberOf Tone.CtrlPattern#\n\t\t * @type {*}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.CtrlPattern.prototype, 'value', {\n\t get: function () {\n\t //some safeguards\n\t if (this.values.length === 0) {\n\t return;\n\t } else if (this.values.length === 1) {\n\t return this.values[0];\n\t }\n\t this.index = Math.min(this.index, this.values.length - 1);\n\t var val = this.values[this.index];\n\t if (this.type === Tone.CtrlPattern.Type.RandomOnce) {\n\t if (this.values.length !== this._shuffled.length) {\n\t this._shuffleValues();\n\t }\n\t val = this.values[this._shuffled[this.index]];\n\t }\n\t return val;\n\t }\n\t });\n\t /**\n\t\t * The pattern used to select the next\n\t\t * item from the values array\n\t\t * @memberOf Tone.CtrlPattern#\n\t\t * @type {Tone.CtrlPattern.Type}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.CtrlPattern.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t this._type = type;\n\t this._shuffled = null;\n\t //the first index\n\t if (this._type === Tone.CtrlPattern.Type.Up || this._type === Tone.CtrlPattern.Type.UpDown || this._type === Tone.CtrlPattern.Type.RandomOnce || this._type === Tone.CtrlPattern.Type.AlternateUp) {\n\t this.index = 0;\n\t } else if (this._type === Tone.CtrlPattern.Type.Down || this._type === Tone.CtrlPattern.Type.DownUp || this._type === Tone.CtrlPattern.Type.AlternateDown) {\n\t this.index = this.values.length - 1;\n\t }\n\t //the direction\n\t if (this._type === Tone.CtrlPattern.Type.UpDown || this._type === Tone.CtrlPattern.Type.AlternateUp) {\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t } else if (this._type === Tone.CtrlPattern.Type.DownUp || this._type === Tone.CtrlPattern.Type.AlternateDown) {\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t }\n\t //randoms\n\t if (this._type === Tone.CtrlPattern.Type.RandomOnce) {\n\t this._shuffleValues();\n\t } else if (this._type === Tone.CtrlPattern.Random) {\n\t this.index = Math.floor(Math.random() * this.values.length);\n\t }\n\t }\n\t });\n\t /**\n\t\t * Return the next value given the current position\n\t\t * and pattern.\n\t\t * @return {*} The next value\n\t\t */\n\t Tone.CtrlPattern.prototype.next = function () {\n\t var type = this.type;\n\t //choose the next index\n\t if (type === Tone.CtrlPattern.Type.Up) {\n\t this.index++;\n\t if (this.index >= this.values.length) {\n\t this.index = 0;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.Down) {\n\t this.index--;\n\t if (this.index < 0) {\n\t this.index = this.values.length - 1;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.UpDown || type === Tone.CtrlPattern.Type.DownUp) {\n\t if (this._direction === Tone.CtrlPattern.Type.Up) {\n\t this.index++;\n\t } else {\n\t this.index--;\n\t }\n\t if (this.index < 0) {\n\t this.index = 1;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t } else if (this.index >= this.values.length) {\n\t this.index = this.values.length - 2;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.Random) {\n\t this.index = Math.floor(Math.random() * this.values.length);\n\t } else if (type === Tone.CtrlPattern.Type.RandomWalk) {\n\t if (Math.random() < 0.5) {\n\t this.index--;\n\t this.index = Math.max(this.index, 0);\n\t } else {\n\t this.index++;\n\t this.index = Math.min(this.index, this.values.length - 1);\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.RandomOnce) {\n\t this.index++;\n\t if (this.index >= this.values.length) {\n\t this.index = 0;\n\t //reshuffle the values for next time\n\t this._shuffleValues();\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.AlternateUp) {\n\t if (this._direction === Tone.CtrlPattern.Type.Up) {\n\t this.index += 2;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t } else {\n\t this.index -= 1;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t }\n\t if (this.index >= this.values.length) {\n\t this.index = 0;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t }\n\t } else if (type === Tone.CtrlPattern.Type.AlternateDown) {\n\t if (this._direction === Tone.CtrlPattern.Type.Up) {\n\t this.index += 1;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t } else {\n\t this.index -= 2;\n\t this._direction = Tone.CtrlPattern.Type.Up;\n\t }\n\t if (this.index < 0) {\n\t this.index = this.values.length - 1;\n\t this._direction = Tone.CtrlPattern.Type.Down;\n\t }\n\t }\n\t return this.value;\n\t };\n\t /**\n\t\t * Shuffles the values and places the results into the _shuffled\n\t\t * @private\n\t\t */\n\t Tone.CtrlPattern.prototype._shuffleValues = function () {\n\t var copy = [];\n\t this._shuffled = [];\n\t for (var i = 0; i < this.values.length; i++) {\n\t copy[i] = i;\n\t }\n\t while (copy.length > 0) {\n\t var randVal = copy.splice(Math.floor(copy.length * Math.random()), 1);\n\t this._shuffled.push(randVal[0]);\n\t }\n\t };\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.CtrlPattern} this\n\t\t */\n\t Tone.CtrlPattern.prototype.dispose = function () {\n\t this._shuffled = null;\n\t this.values = null;\n\t };\n\t return Tone.CtrlPattern;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Choose a random value.\n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * var randomWalk = new Tone.CtrlRandom({\n\t\t * \t\"min\" : 0,\n\t\t * \t\"max\" : 10,\n\t\t * \t\"integer\" : true\n\t\t * });\n\t\t * randomWalk.eval();\n\t\t *\n\t\t * @param {Number|Time=} min The minimum return value.\n\t\t * @param {Number|Time=} max The maximum return value.\n\t\t */\n\t Tone.CtrlRandom = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'min',\n\t 'max'\n\t ], Tone.CtrlRandom);\n\t Tone.call(this);\n\t /**\n\t\t\t * The minimum return value\n\t\t\t * @type {Number|Time}\n\t\t\t */\n\t this.min = options.min;\n\t /**\n\t\t\t * The maximum return value\n\t\t\t * @type {Number|Time}\n\t\t\t */\n\t this.max = options.max;\n\t /**\n\t\t\t * If the return value should be an integer\n\t\t\t * @type {Boolean}\n\t\t\t */\n\t this.integer = options.integer;\n\t };\n\t Tone.extend(Tone.CtrlRandom);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.CtrlRandom.defaults = {\n\t 'min': 0,\n\t 'max': 1,\n\t 'integer': false\n\t };\n\t /**\n\t\t * Return a random value between min and max. \n\t\t * @readOnly\n\t\t * @memberOf Tone.CtrlRandom#\n\t\t * @type {*}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.CtrlRandom.prototype, 'value', {\n\t get: function () {\n\t var min = this.toSeconds(this.min);\n\t var max = this.toSeconds(this.max);\n\t var rand = Math.random();\n\t var val = rand * min + (1 - rand) * max;\n\t if (this.integer) {\n\t val = Math.floor(val);\n\t }\n\t return val;\n\t }\n\t });\n\t return Tone.CtrlRandom;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class A data structure for holding multiple buffers.\n\t\t * \n\t\t * @param {Object|Array} urls An object literal or array\n\t\t * of urls to load.\n\t\t * @param {Function=} callback The callback to invoke when\n\t\t * the buffers are loaded. \n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * //load a whole bank of piano samples\n\t\t * var pianoSamples = new Tone.Buffers({\n\t\t * \t\"C4\" : \"path/to/C4.mp3\"\n\t\t * \t\"C#4\" : \"path/to/C#4.mp3\"\n\t\t * \t\"D4\" : \"path/to/D4.mp3\"\n\t\t * \t\"D#4\" : \"path/to/D#4.mp3\"\n\t\t * \t...\n\t\t * }, function(){\n\t\t * \t//play one of the samples when they all load\n\t\t * \tplayer.buffer = pianoSamples.get(\"C4\");\n\t\t * \tplayer.start();\n\t\t * });\n\t\t * \t@example\n\t\t * //To pass in additional parameters in the second parameter\n\t\t * var buffers = new Tone.Buffers(urls, {\n\t\t * \t\"onload\" : callback,\n\t\t * \t\"baseUrl\" : \"../path/to/audio/\"\n\t\t * })\n\t\t */\n\t Tone.Buffers = function (urls) {\n\t //remove the urls from the options\n\t var args = Array.prototype.slice.call(arguments);\n\t args.shift();\n\t var options = Tone.defaults(args, [\n\t 'onload',\n\t 'baseUrl'\n\t ], Tone.Buffers);\n\t Tone.call(this);\n\t /**\n\t\t\t * All of the buffers\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._buffers = {};\n\t /**\n\t\t\t * A path which is prefixed before every url.\n\t\t\t * @type {String}\n\t\t\t */\n\t this.baseUrl = options.baseUrl;\n\t this._loadingCount = 0;\n\t //add each one\n\t for (var key in urls) {\n\t this._loadingCount++;\n\t this.add(key, urls[key], this._bufferLoaded.bind(this, options.onload));\n\t }\n\t };\n\t Tone.extend(Tone.Buffers);\n\t /**\n\t\t * Defaults\n\t\t * @type {Object}\n\t\t */\n\t Tone.Buffers.defaults = {\n\t 'onload': Tone.noOp,\n\t 'baseUrl': ''\n\t };\n\t /**\n\t\t * True if the buffers object has a buffer by that name.\n\t\t * @param {String|Number} name The key or index of the \n\t\t * buffer.\n\t\t * @return {Boolean}\n\t\t */\n\t Tone.Buffers.prototype.has = function (name) {\n\t return this._buffers.hasOwnProperty(name);\n\t };\n\t /**\n\t\t * Get a buffer by name. If an array was loaded, \n\t\t * then use the array index.\n\t\t * @param {String|Number} name The key or index of the \n\t\t * buffer.\n\t\t * @return {Tone.Buffer}\n\t\t */\n\t Tone.Buffers.prototype.get = function (name) {\n\t if (this.has(name)) {\n\t return this._buffers[name];\n\t } else {\n\t throw new Error('Tone.Buffers: no buffer named ' + name);\n\t }\n\t };\n\t /**\n\t\t * A buffer was loaded. decrement the counter.\n\t\t * @param {Function} callback \n\t\t * @private\n\t\t */\n\t Tone.Buffers.prototype._bufferLoaded = function (callback) {\n\t this._loadingCount--;\n\t if (this._loadingCount === 0 && callback) {\n\t callback(this);\n\t }\n\t };\n\t /**\n\t\t * If the buffers are loaded or not\n\t\t * @memberOf Tone.Buffers#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Buffers.prototype, 'loaded', {\n\t get: function () {\n\t var isLoaded = true;\n\t for (var buffName in this._buffers) {\n\t var buff = this.get(buffName);\n\t isLoaded = isLoaded && buff.loaded;\n\t }\n\t return isLoaded;\n\t }\n\t });\n\t /**\n\t\t * Add a buffer by name and url to the Buffers\n\t\t * @param {String} name A unique name to give\n\t\t * the buffer\n\t\t * @param {String|Tone.Buffer|Audiobuffer} url Either the url of the bufer, \n\t\t * or a buffer which will be added\n\t\t * with the given name.\n\t\t * @param {Function=} callback The callback to invoke \n\t\t * when the url is loaded.\n\t\t */\n\t Tone.Buffers.prototype.add = function (name, url, callback) {\n\t callback = Tone.defaultArg(callback, Tone.noOp);\n\t if (url instanceof Tone.Buffer) {\n\t this._buffers[name] = url;\n\t callback(this);\n\t } else if (url instanceof AudioBuffer) {\n\t this._buffers[name] = new Tone.Buffer(url);\n\t callback(this);\n\t } else if (Tone.isString(url)) {\n\t this._buffers[name] = new Tone.Buffer(this.baseUrl + url, callback);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Buffers} this\n\t\t */\n\t Tone.Buffers.prototype.dispose = function () {\n\t Tone.prototype.dispose.call(this);\n\t for (var name in this._buffers) {\n\t this._buffers[name].dispose();\n\t }\n\t this._buffers = null;\n\t return this;\n\t };\n\t return Tone.Buffers;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * buses are another way of routing audio\n\t\t *\n\t\t * augments Tone.prototype to include send and recieve\n\t\t */\n\t /**\n\t\t * All of the routes\n\t\t *\n\t\t * @type {Object}\n\t\t * @static\n\t\t * @private\n\t\t */\n\t var Buses = {};\n\t /**\n\t\t * Send this signal to the channel name.\n\t\t * @param {String} channelName A named channel to send the signal to.\n\t\t * @param {Decibels} amount The amount of the source to send to the bus.\n\t\t * @return {GainNode} The gain node which connects this node to the desired channel.\n\t\t * Can be used to adjust the levels of the send.\n\t\t * @example\n\t\t * source.send(\"reverb\", -12);\n\t\t */\n\t Tone.prototype.send = function (channelName, amount) {\n\t if (!Buses.hasOwnProperty(channelName)) {\n\t Buses[channelName] = this.context.createGain();\n\t }\n\t amount = Tone.defaultArg(amount, 0);\n\t var sendKnob = new Tone.Gain(amount, Tone.Type.Decibels);\n\t this.connect(sendKnob);\n\t sendKnob.connect(Buses[channelName]);\n\t return sendKnob;\n\t };\n\t /**\n\t\t * Recieve the input from the desired channelName to the input\n\t\t *\n\t\t * @param {String} channelName A named channel to send the signal to.\n\t\t * @param {Number=} channelNumber The channel to connect to\n\t\t * @returns {Tone} this\n\t\t * @example\n\t\t * reverbEffect.receive(\"reverb\");\n\t\t */\n\t Tone.prototype.receive = function (channelName, inputNum) {\n\t if (!Buses.hasOwnProperty(channelName)) {\n\t Buses[channelName] = this.context.createGain();\n\t }\n\t Buses[channelName].connect(this, 0, inputNum);\n\t return this;\n\t };\n\t //remove all the send/receives when a new audio context is passed in\n\t Tone.Context.on('init', function (context) {\n\t if (context.Buses) {\n\t Buses = context.Buses;\n\t } else {\n\t Buses = {};\n\t context.Buses = Buses;\n\t }\n\t });\n\t return Tone;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Draw is useful for synchronizing visuals and audio events.\n\t\t * Callbacks from Tone.Transport or any of the Tone.Event classes\n\t\t * always happen _before_ the scheduled time and are not synchronized\n\t\t * to the animation frame so they are not good for triggering tightly\n\t\t * synchronized visuals and sound. Tone.Draw makes it easy to schedule\n\t\t * callbacks using the AudioContext time and uses requestAnimationFrame.\n\t\t * \n\t\t * @singleton\n\t\t * @extends {Tone}\n\t\t * @example\n\t\t * Tone.Transport.schedule(function(time){\n\t\t * \t//use the time argument to schedule a callback with Tone.Draw\n\t\t * \tTone.Draw.schedule(function(){\n\t\t * \t\t//do drawing or DOM manipulation here\n\t\t * \t}, time)\n\t\t * }, \"+0.5\")\n\t\t */\n\t Tone.Draw = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * All of the events.\n\t\t\t * @type {Tone.Timeline}\n\t\t\t * @private\n\t\t\t */\n\t this._events = new Tone.Timeline();\n\t /**\n\t\t\t * The duration after which events are not invoked.\n\t\t\t * @type {Number}\n\t\t\t * @default 0.25\n\t\t\t */\n\t this.expiration = 0.25;\n\t /**\n\t\t\t * The amount of time before the scheduled time \n\t\t\t * that the callback can be invoked. Default is\n\t\t\t * half the time of an animation frame (0.008 seconds).\n\t\t\t * @type {Number}\n\t\t\t * @default 0.008\n\t\t\t */\n\t this.anticipation = 0.008;\n\t /**\n\t\t\t * The draw loop\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._boundDrawLoop = this._drawLoop.bind(this);\n\t };\n\t Tone.extend(Tone.Draw);\n\t /**\n\t\t * Schedule a function at the given time to be invoked\n\t\t * on the nearest animation frame.\n\t\t * @param {Function} callback Callback is invoked at the given time.\n\t\t * @param {Time} time The time relative to the AudioContext time\n\t\t * to invoke the callback.\n\t\t * @return {Tone.Draw} this\n\t\t */\n\t Tone.Draw.prototype.schedule = function (callback, time) {\n\t this._events.add({\n\t callback: callback,\n\t time: this.toSeconds(time)\n\t });\n\t //start the draw loop on the first event\n\t if (this._events.length === 1) {\n\t requestAnimationFrame(this._boundDrawLoop);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel events scheduled after the given time\n\t\t * @param {Time=} after Time after which scheduled events will \n\t\t * be removed from the scheduling timeline.\n\t\t * @return {Tone.Draw} this\n\t\t */\n\t Tone.Draw.prototype.cancel = function (after) {\n\t this._events.cancel(this.toSeconds(after));\n\t return this;\n\t };\n\t /**\n\t\t * The draw loop\n\t\t * @private\n\t\t */\n\t Tone.Draw.prototype._drawLoop = function () {\n\t var now = Tone.now();\n\t while (this._events.length && this._events.peek().time - this.anticipation <= now) {\n\t var event = this._events.shift();\n\t if (now - event.time <= this.expiration) {\n\t event.callback();\n\t }\n\t }\n\t if (this._events.length > 0) {\n\t requestAnimationFrame(this._boundDrawLoop);\n\t }\n\t };\n\t //make a singleton\n\t Tone.Draw = new Tone.Draw();\n\t return Tone.Draw;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Both Tone.Panner3D and Tone.Listener have a position in 3D space\n\t\t * using a right-handed cartesian coordinate system.\n\t\t * The units used in the coordinate system are not defined;\n\t\t * these coordinates are independent/invariant of any particular\n\t\t * units such as meters or feet. Tone.Panner3D objects have an forward\n\t\t * vector representing the direction the sound is projecting. Additionally,\n\t\t * they have a sound cone representing how directional the sound is.\n\t\t * For example, the sound could be omnidirectional, in which case it would\n\t\t * be heard anywhere regardless of its forward, or it can be more directional\n\t\t * and heard only if it is facing the listener. Tone.Listener objects\n\t\t * (representing a person's ears) have an forward and up vector\n\t\t * representing in which direction the person is facing. Because both the\n\t\t * source stream and the listener can be moving, they both have a velocity\n\t\t * vector representing both the speed and direction of movement. Taken together,\n\t\t * these two velocities can be used to generate a doppler shift effect which changes the pitch.\n\t\t * <br><br>\n\t\t * Note: the position of the Listener will have no effect on nodes not connected to a Tone.Panner3D\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone}\n\t\t * @singleton\n\t\t */\n\t Tone.Listener = function () {\n\t Tone.call(this);\n\t /**\n\t\t\t * Holds the current forward orientation\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._orientation = [\n\t 0,\n\t 0,\n\t 0,\n\t 0,\n\t 0,\n\t 0\n\t ];\n\t /**\n\t\t\t * Holds the current position\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._position = [\n\t 0,\n\t 0,\n\t 0\n\t ];\n\t Tone.getContext(function () {\n\t // set the default position/forward\n\t this.set(ListenerConstructor.defaults);\n\t }.bind(this));\n\t };\n\t Tone.extend(Tone.Listener);\n\t /**\n\t\t * Defaults according to the specification\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Listener.defaults = {\n\t 'positionX': 0,\n\t 'positionY': 0,\n\t 'positionZ': 0,\n\t 'forwardX': 0,\n\t 'forwardY': 0,\n\t 'forwardZ': 1,\n\t 'upX': 0,\n\t 'upY': 1,\n\t 'upZ': 0\n\t };\n\t /**\n\t\t * The ramp time which is applied to the setTargetAtTime\n\t\t * @type {Number}\n\t\t * @private\n\t\t */\n\t Tone.Listener.prototype._rampTimeConstant = 0.01;\n\t /**\n\t\t * Sets the position of the listener in 3d space.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @return {Tone.Listener} this\n\t\t */\n\t Tone.Listener.prototype.setPosition = function (x, y, z) {\n\t if (this.context.listener.positionX) {\n\t var now = this.now();\n\t this.context.listener.positionX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this.context.listener.positionY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this.context.listener.positionZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t } else {\n\t this.context.listener.setPosition(x, y, z);\n\t }\n\t this._position = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * Sets the orientation of the listener using two vectors, the forward\n\t\t * vector (which direction the listener is facing) and the up vector\n\t\t * (which the up direction of the listener). An up vector\n\t\t * of 0, 0, 1 is equivalent to the listener standing up in the Z direction.\n\t\t * @param {Number} x\n\t\t * @param {Number} y\n\t\t * @param {Number} z\n\t\t * @param {Number} upX\n\t\t * @param {Number} upY\n\t\t * @param {Number} upZ\n\t\t * @return {Tone.Listener} this\n\t\t */\n\t Tone.Listener.prototype.setOrientation = function (x, y, z, upX, upY, upZ) {\n\t if (this.context.listener.forwardX) {\n\t var now = this.now();\n\t this.context.listener.forwardX.setTargetAtTime(x, now, this._rampTimeConstant);\n\t this.context.listener.forwardY.setTargetAtTime(y, now, this._rampTimeConstant);\n\t this.context.listener.forwardZ.setTargetAtTime(z, now, this._rampTimeConstant);\n\t this.context.listener.upX.setTargetAtTime(upX, now, this._rampTimeConstant);\n\t this.context.listener.upY.setTargetAtTime(upY, now, this._rampTimeConstant);\n\t this.context.listener.upZ.setTargetAtTime(upZ, now, this._rampTimeConstant);\n\t } else {\n\t this.context.listener.setOrientation(x, y, z, upX, upY, upZ);\n\t }\n\t this._orientation = Array.prototype.slice.call(arguments);\n\t return this;\n\t };\n\t /**\n\t\t * The x position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name positionX\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'positionX', {\n\t set: function (pos) {\n\t this._position[0] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[0];\n\t }\n\t });\n\t /**\n\t\t * The y position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name positionY\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'positionY', {\n\t set: function (pos) {\n\t this._position[1] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[1];\n\t }\n\t });\n\t /**\n\t\t * The z position of the panner object.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name positionZ\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'positionZ', {\n\t set: function (pos) {\n\t this._position[2] = pos;\n\t this.setPosition.apply(this, this._position);\n\t },\n\t get: function () {\n\t return this._position[2];\n\t }\n\t });\n\t /**\n\t\t * The x coordinate of the listeners front direction. i.e.\n\t\t * which way they are facing.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name forwardX\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'forwardX', {\n\t set: function (pos) {\n\t this._orientation[0] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[0];\n\t }\n\t });\n\t /**\n\t\t * The y coordinate of the listeners front direction. i.e.\n\t\t * which way they are facing.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name forwardY\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'forwardY', {\n\t set: function (pos) {\n\t this._orientation[1] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[1];\n\t }\n\t });\n\t /**\n\t\t * The z coordinate of the listeners front direction. i.e.\n\t\t * which way they are facing.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name forwardZ\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'forwardZ', {\n\t set: function (pos) {\n\t this._orientation[2] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[2];\n\t }\n\t });\n\t /**\n\t\t * The x coordinate of the listener's up direction. i.e.\n\t\t * the direction the listener is standing in.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name upX\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'upX', {\n\t set: function (pos) {\n\t this._orientation[3] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[3];\n\t }\n\t });\n\t /**\n\t\t * The y coordinate of the listener's up direction. i.e.\n\t\t * the direction the listener is standing in.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name upY\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'upY', {\n\t set: function (pos) {\n\t this._orientation[4] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[4];\n\t }\n\t });\n\t /**\n\t\t * The z coordinate of the listener's up direction. i.e.\n\t\t * the direction the listener is standing in.\n\t\t * @type {Number}\n\t\t * @memberOf Tone.Listener#\n\t\t * @name upZ\n\t\t */\n\t Object.defineProperty(Tone.Listener.prototype, 'upZ', {\n\t set: function (pos) {\n\t this._orientation[5] = pos;\n\t this.setOrientation.apply(this, this._orientation);\n\t },\n\t get: function () {\n\t return this._orientation[5];\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Listener} this\n\t\t */\n\t Tone.Listener.prototype.dispose = function () {\n\t this._orientation = null;\n\t this._position = null;\n\t return this;\n\t };\n\t //SINGLETON SETUP\n\t var ListenerConstructor = Tone.Listener;\n\t Tone.Listener = new ListenerConstructor();\n\t Tone.Context.on('init', function (context) {\n\t if (context.Listener instanceof ListenerConstructor) {\n\t //a single listener object\n\t Tone.Listener = context.Listener;\n\t } else {\n\t //make new Listener insides\n\t Tone.Listener = new ListenerConstructor();\n\t }\n\t context.Listener = Tone.Listener;\n\t });\n\t //END SINGLETON SETUP\n\t return Tone.Listener;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * Because of a bug in iOS causing the currentTime to increment\n\t\t * before the rendering is started, sometimes it takes multiple\n\t\t * attempts to render the audio correctly.\n\t\t * @private\n\t\t */\n\t function attemptRender(callback, duration, sampleRate, tries) {\n\t tries = Tone.defaultArg(tries, 0);\n\t var context = new Tone.OfflineContext(2, duration, sampleRate);\n\t Tone.context = context;\n\t //invoke the callback/scheduling\n\t var response = callback(Tone.Transport);\n\t if (context.currentTime > 0 && tries < 1000) {\n\t return attemptRender(callback, duration, sampleRate, ++tries);\n\t } else {\n\t return {\n\t 'response': response,\n\t 'context': context\n\t };\n\t }\n\t }\n\t /**\n\t\t * Generate a buffer by rendering all of the Tone.js code within the callback using the OfflineAudioContext.\n\t\t * The OfflineAudioContext is capable of rendering much faster than real time in many cases.\n\t\t * The callback function also passes in an offline instance of Tone.Transport which can be used\n\t\t * to schedule events along the Transport. **NOTE** OfflineAudioContext has the same restrictions\n\t\t * as the AudioContext in that on certain platforms (like iOS) it must be invoked by an explicit\n\t\t * user action like a click or tap. \n\t\t * @param {Function} callback All Tone.js nodes which are created and scheduled within this callback are recorded into the output Buffer.\n\t\t * @param {Time} duration the amount of time to record for.\n\t\t * @return {Promise} The promise which is invoked with the Tone.Buffer of the recorded output.\n\t\t * @example\n\t\t * //render 2 seconds of the oscillator\n\t\t * Tone.Offline(function(){\n\t\t * \t//only nodes created in this callback will be recorded\n\t\t * \tvar oscillator = new Tone.Oscillator().toMaster().start(0)\n\t\t * \t//schedule their events\n\t\t * }, 2).then(function(buffer){\n\t\t * \t//do something with the output buffer\n\t\t * })\n\t\t * @example\n\t\t * //can also schedule events along the Transport\n\t\t * //using the passed in Offline Transport\n\t\t * Tone.Offline(function(Transport){\n\t\t * \tvar osc = new Tone.Oscillator().toMaster()\n\t\t * \tTransport.schedule(function(time){\n\t\t * \t\tosc.start(time).stop(time + 0.1)\n\t\t * \t}, 1)\n\t\t * \tTransport.start(0.2)\n\t\t * }, 4).then(function(buffer){\n\t\t * \t//do something with the output buffer\n\t\t * })\n\t\t */\n\t Tone.Offline = function (callback, duration) {\n\t //set the OfflineAudioContext\n\t var sampleRate = Tone.context.sampleRate;\n\t var originalContext = Tone.context;\n\t var renderRet = attemptRender(callback, duration, sampleRate);\n\t var response = renderRet.response;\n\t var context = renderRet.context;\n\t var ret;\n\t if (response instanceof Promise) {\n\t //wait for the promise to resolve\n\t ret = response.then(function () {\n\t //then render the audio\n\t return context.render();\n\t });\n\t } else {\n\t //process the audio\n\t ret = context.render();\n\t }\n\t //return the original AudioContext\n\t Tone.context = originalContext;\n\t //return the audio\n\t return ret.then(function (buffer) {\n\t //wrap it in a Tone.Buffer\n\t return new Tone.Buffer(buffer);\n\t });\n\t };\n\t return Tone.Offline;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * \t@class Tone.Effect is the base class for effects. Connect the effect between\n\t\t * \t the effectSend and effectReturn GainNodes, then control the amount of\n\t\t * \t effect which goes to the output using the wet control.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {NormalRange|Object} [wet] The starting wet value.\n\t\t */\n\t Tone.Effect = function () {\n\t var options = Tone.defaults(arguments, ['wet'], Tone.Effect);\n\t Tone.AudioNode.call(this);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the drywet knob to control the amount of effect\n\t\t\t * @type {Tone.CrossFade}\n\t\t\t * @private\n\t\t\t */\n\t this._dryWet = new Tone.CrossFade(options.wet);\n\t /**\n\t\t\t * The wet control is how much of the effected\n\t\t\t * will pass through to the output. 1 = 100% effected\n\t\t\t * signal, 0 = 100% dry signal.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.wet = this._dryWet.fade;\n\t /**\n\t\t\t * connect the effectSend to the input of hte effect\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.effectSend = new Tone.Gain();\n\t /**\n\t\t\t * connect the output of the effect to the effectReturn\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this.effectReturn = new Tone.Gain();\n\t //connections\n\t this.input.connect(this._dryWet.a);\n\t this.input.connect(this.effectSend);\n\t this.effectReturn.connect(this._dryWet.b);\n\t this._dryWet.connect(this.output);\n\t this._readOnly(['wet']);\n\t };\n\t Tone.extend(Tone.Effect, Tone.AudioNode);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Effect.defaults = { 'wet': 1 };\n\t /**\n\t\t * chains the effect in between the effectSend and effectReturn\n\t\t * @param {Tone} effect\n\t\t * @private\n\t\t * @returns {Tone.Effect} this\n\t\t */\n\t Tone.Effect.prototype.connectEffect = function (effect) {\n\t this.effectSend.chain(effect, this.effectReturn);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Effect} this\n\t\t */\n\t Tone.Effect.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._dryWet.dispose();\n\t this._dryWet = null;\n\t this.effectSend.dispose();\n\t this.effectSend = null;\n\t this.effectReturn.dispose();\n\t this.effectReturn = null;\n\t this._writable(['wet']);\n\t this.wet = null;\n\t return this;\n\t };\n\t return Tone.Effect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AutoFilter is a Tone.Filter with a Tone.LFO connected to the filter cutoff frequency.\n\t\t * Setting the LFO rate and depth allows for control over the filter modulation rate \n\t\t * and depth.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Time|Object} [frequency] The rate of the LFO.\n\t\t * @param {Frequency=} baseFrequency The lower value of the LFOs oscillation\n\t \t * @param {Frequency=} octaves The number of octaves above the baseFrequency\n\t\t * @example\n\t\t * //create an autofilter and start it's LFO\n\t\t * var autoFilter = new Tone.AutoFilter(\"4n\").toMaster().start();\n\t\t * //route an oscillator through the filter and start it\n\t\t * var oscillator = new Tone.Oscillator().connect(autoFilter).start();\n\t\t */\n\t Tone.AutoFilter = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'baseFrequency',\n\t 'octaves'\n\t ], Tone.AutoFilter);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * the lfo which drives the filter cutoff\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfo = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'amplitude': options.depth\n\t });\n\t /**\n\t\t\t * The range of the filter modulating between the min and max frequency. \n\t\t\t * 0 = no modulation. 1 = full modulation.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = this._lfo.amplitude;\n\t /**\n\t\t\t * How fast the filter modulates between min and max. \n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfo.frequency;\n\t /**\n\t\t\t * The filter node\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.filter = new Tone.Filter(options.filter);\n\t /**\n\t\t\t * The octaves placeholder\n\t\t\t * @type {Positive}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = 0;\n\t //connections\n\t this.connectEffect(this.filter);\n\t this._lfo.connect(this.filter.frequency);\n\t this.type = options.type;\n\t this._readOnly([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.octaves = options.octaves;\n\t this.baseFrequency = options.baseFrequency;\n\t };\n\t //extend Effect\n\t Tone.extend(Tone.AutoFilter, Tone.Effect);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AutoFilter.defaults = {\n\t 'frequency': 1,\n\t 'type': 'sine',\n\t 'depth': 1,\n\t 'baseFrequency': 200,\n\t 'octaves': 2.6,\n\t 'filter': {\n\t 'type': 'lowpass',\n\t 'rolloff': -12,\n\t 'Q': 1\n\t }\n\t };\n\t /**\n\t\t * Start the effect.\n\t\t * @param {Time} [time=now] When the LFO will start. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.start = function (time) {\n\t this._lfo.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the effect.\n\t\t * @param {Time} [time=now] When the LFO will stop. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.stop = function (time) {\n\t this._lfo.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the filter to the transport.\n\t\t * @param {Time} [delay=0] Delay time before starting the effect after the\n\t\t * Transport has started. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.sync = function (delay) {\n\t this._lfo.sync(delay);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the filter from the transport.\n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.unsync = function () {\n\t this._lfo.unsync();\n\t return this;\n\t };\n\t /**\n\t\t * Type of oscillator attached to the AutoFilter. \n\t\t * Possible values: \"sine\", \"square\", \"triangle\", \"sawtooth\".\n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.AutoFilter.prototype, 'type', {\n\t get: function () {\n\t return this._lfo.type;\n\t },\n\t set: function (type) {\n\t this._lfo.type = type;\n\t }\n\t });\n\t /**\n\t\t * The minimum value of the filter's cutoff frequency.\n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {Frequency}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.AutoFilter.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._lfo.min;\n\t },\n\t set: function (freq) {\n\t this._lfo.min = this.toFrequency(freq);\n\t //and set the max\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * The maximum value of the filter's cutoff frequency. \n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {Positive}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.AutoFilter.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (oct) {\n\t this._octaves = oct;\n\t this._lfo.max = this.baseFrequency * Math.pow(2, oct);\n\t }\n\t });\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.AutoFilter.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._lfo.dispose();\n\t this._lfo = null;\n\t this.filter.dispose();\n\t this.filter = null;\n\t this._writable([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.frequency = null;\n\t this.depth = null;\n\t return this;\n\t };\n\t return Tone.AutoFilter;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AutoPanner is a Tone.Panner with an LFO connected to the pan amount. \n\t\t * More on using autopanners [here](https://www.ableton.com/en/blog/autopan-chopper-effect-and-more-liveschool/).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Frequency|Object} [frequency] Rate of left-right oscillation. \n\t\t * @example\n\t\t * //create an autopanner and start it's LFO\n\t\t * var autoPanner = new Tone.AutoPanner(\"4n\").toMaster().start();\n\t\t * //route an oscillator through the panner and start it\n\t\t * var oscillator = new Tone.Oscillator().connect(autoPanner).start();\n\t\t */\n\t Tone.AutoPanner = function () {\n\t var options = Tone.defaults(arguments, ['frequency'], Tone.AutoPanner);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * the lfo which drives the panning\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfo = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'amplitude': options.depth,\n\t 'min': -1,\n\t 'max': 1\n\t });\n\t /**\n\t\t\t * The amount of panning between left and right. \n\t\t\t * 0 = always center. 1 = full range between left and right. \n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = this._lfo.amplitude;\n\t /**\n\t\t\t * the panner node which does the panning\n\t\t\t * @type {Tone.Panner}\n\t\t\t * @private\n\t\t\t */\n\t this._panner = new Tone.Panner();\n\t /**\n\t\t\t * How fast the panner modulates between left and right. \n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfo.frequency;\n\t //connections\n\t this.connectEffect(this._panner);\n\t this._lfo.connect(this._panner.pan);\n\t this.type = options.type;\n\t this._readOnly([\n\t 'depth',\n\t 'frequency'\n\t ]);\n\t };\n\t //extend Effect\n\t Tone.extend(Tone.AutoPanner, Tone.Effect);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AutoPanner.defaults = {\n\t 'frequency': 1,\n\t 'type': 'sine',\n\t 'depth': 1\n\t };\n\t /**\n\t\t * Start the effect.\n\t\t * @param {Time} [time=now] When the LFO will start. \n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.start = function (time) {\n\t this._lfo.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the effect.\n\t\t * @param {Time} [time=now] When the LFO will stop. \n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.stop = function (time) {\n\t this._lfo.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the panner to the transport.\n\t\t * @param {Time} [delay=0] Delay time before starting the effect after the\n\t\t * Transport has started. \n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.sync = function (delay) {\n\t this._lfo.sync(delay);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the panner from the transport\n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.unsync = function () {\n\t this._lfo.unsync();\n\t return this;\n\t };\n\t /**\n\t\t * Type of oscillator attached to the AutoFilter. \n\t\t * Possible values: \"sine\", \"square\", \"triangle\", \"sawtooth\".\n\t\t * @memberOf Tone.AutoFilter#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.AutoPanner.prototype, 'type', {\n\t get: function () {\n\t return this._lfo.type;\n\t },\n\t set: function (type) {\n\t this._lfo.type = type;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.AutoPanner} this\n\t\t */\n\t Tone.AutoPanner.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._lfo.dispose();\n\t this._lfo = null;\n\t this._panner.dispose();\n\t this._panner = null;\n\t this._writable([\n\t 'depth',\n\t 'frequency'\n\t ]);\n\t this.frequency = null;\n\t this.depth = null;\n\t return this;\n\t };\n\t return Tone.AutoPanner;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AutoWah connects a Tone.Follower to a bandpass filter (Tone.Filter).\n\t\t * The frequency of the filter is adjusted proportionally to the\n\t\t * incoming signal's amplitude. Inspiration from [Tuna.js](https://github.com/Dinahmoe/tuna).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Frequency|Object} [baseFrequency] The frequency the filter is set\n\t\t * to at the low point of the wah\n\t\t * @param {Positive} [octaves] The number of octaves above the baseFrequency\n\t\t * the filter will sweep to when fully open\n\t\t * @param {Decibels} [sensitivity] The decibel threshold sensitivity for\n\t\t * the incoming signal. Normal range of -40 to 0.\n\t\t * @example\n\t\t * var autoWah = new Tone.AutoWah(50, 6, -30).toMaster();\n\t\t * //initialize the synth and connect to autowah\n\t\t * var synth = new Synth.connect(autoWah);\n\t\t * //Q value influences the effect of the wah - default is 2\n\t\t * autoWah.Q.value = 6;\n\t\t * //more audible on higher notes\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\")\n\t\t */\n\t Tone.AutoWah = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'baseFrequency',\n\t 'octaves',\n\t 'sensitivity'\n\t ], Tone.AutoWah);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * The envelope follower. Set the attack/release\n\t\t\t * timing to adjust how the envelope is followed.\n\t\t\t * @type {Tone.Follower}\n\t\t\t * @private\n\t\t\t */\n\t this.follower = new Tone.Follower(options.follower);\n\t /**\n\t\t\t * scales the follower value to the frequency domain\n\t\t\t * @type {Tone}\n\t\t\t * @private\n\t\t\t */\n\t this._sweepRange = new Tone.ScaleExp(0, 1, 0.5);\n\t /**\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._baseFrequency = options.baseFrequency;\n\t /**\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t /**\n\t\t\t * the input gain to adjust the sensitivity\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._inputBoost = new Tone.Gain();\n\t /**\n\t\t\t * @type {BiquadFilterNode}\n\t\t\t * @private\n\t\t\t */\n\t this._bandpass = new Tone.Filter({\n\t 'rolloff': -48,\n\t 'frequency': 0,\n\t 'Q': options.Q\n\t });\n\t /**\n\t\t\t * @type {Tone.Filter}\n\t\t\t * @private\n\t\t\t */\n\t this._peaking = new Tone.Filter(0, 'peaking');\n\t this._peaking.gain.value = options.gain;\n\t /**\n\t\t\t * The gain of the filter.\n\t\t\t * @type {Number}\n\t\t\t * @signal\n\t\t\t */\n\t this.gain = this._peaking.gain;\n\t /**\n\t\t\t * The quality of the filter.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = this._bandpass.Q;\n\t //the control signal path\n\t this.effectSend.chain(this._inputBoost, this.follower, this._sweepRange);\n\t this._sweepRange.connect(this._bandpass.frequency);\n\t this._sweepRange.connect(this._peaking.frequency);\n\t //the filtered path\n\t this.effectSend.chain(this._bandpass, this._peaking, this.effectReturn);\n\t //set the initial value\n\t this._setSweepRange();\n\t this.sensitivity = options.sensitivity;\n\t this._readOnly([\n\t 'gain',\n\t 'Q'\n\t ]);\n\t };\n\t Tone.extend(Tone.AutoWah, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AutoWah.defaults = {\n\t 'baseFrequency': 100,\n\t 'octaves': 6,\n\t 'sensitivity': 0,\n\t 'Q': 2,\n\t 'gain': 2,\n\t 'follower': {\n\t 'attack': 0.3,\n\t 'release': 0.5\n\t }\n\t };\n\t /**\n\t\t * The number of octaves that the filter will sweep above the\n\t\t * baseFrequency.\n\t\t * @memberOf Tone.AutoWah#\n\t\t * @type {Number}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.AutoWah.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octaves) {\n\t this._octaves = octaves;\n\t this._setSweepRange();\n\t }\n\t });\n\t /**\n\t\t * The base frequency from which the sweep will start from.\n\t\t * @memberOf Tone.AutoWah#\n\t\t * @type {Frequency}\n\t\t * @name baseFrequency\n\t\t */\n\t Object.defineProperty(Tone.AutoWah.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._baseFrequency;\n\t },\n\t set: function (baseFreq) {\n\t this._baseFrequency = baseFreq;\n\t this._setSweepRange();\n\t }\n\t });\n\t /**\n\t\t * The sensitivity to control how responsive to the input signal the filter is.\n\t\t * @memberOf Tone.AutoWah#\n\t\t * @type {Decibels}\n\t\t * @name sensitivity\n\t\t */\n\t Object.defineProperty(Tone.AutoWah.prototype, 'sensitivity', {\n\t get: function () {\n\t return Tone.gainToDb(1 / this._inputBoost.gain.value);\n\t },\n\t set: function (sensitivy) {\n\t this._inputBoost.gain.value = 1 / Tone.dbToGain(sensitivy);\n\t }\n\t });\n\t /**\n\t\t * sets the sweep range of the scaler\n\t\t * @private\n\t\t */\n\t Tone.AutoWah.prototype._setSweepRange = function () {\n\t this._sweepRange.min = this._baseFrequency;\n\t this._sweepRange.max = Math.min(this._baseFrequency * Math.pow(2, this._octaves), this.context.sampleRate / 2);\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.AutoWah} this\n\t\t */\n\t Tone.AutoWah.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this.follower.dispose();\n\t this.follower = null;\n\t this._sweepRange.dispose();\n\t this._sweepRange = null;\n\t this._bandpass.dispose();\n\t this._bandpass = null;\n\t this._peaking.dispose();\n\t this._peaking = null;\n\t this._inputBoost.dispose();\n\t this._inputBoost = null;\n\t this._writable([\n\t 'gain',\n\t 'Q'\n\t ]);\n\t this.gain = null;\n\t this.Q = null;\n\t return this;\n\t };\n\t return Tone.AutoWah;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Signal-rate modulo operator. Only works in AudioRange [-1, 1] and for modulus\n\t\t * values in the NormalRange.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.SignalBase}\n\t\t * @param {NormalRange} modulus The modulus to apply.\n\t\t * @example\n\t\t * var mod = new Tone.Modulo(0.2)\n\t\t * var sig = new Tone.Signal(0.5).connect(mod);\n\t\t * //mod outputs 0.1\n\t\t */\n\t Tone.Modulo = function (modulus) {\n\t Tone.SignalBase.call(this);\n\t this.createInsOuts(1, 0);\n\t /**\n\t\t\t * A waveshaper gets the integer multiple of\n\t\t\t * the input signal and the modulus.\n\t\t\t * @private\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t */\n\t this._shaper = new Tone.WaveShaper(Math.pow(2, 16));\n\t /**\n\t\t\t * the integer multiple is multiplied by the modulus\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._multiply = new Tone.Multiply();\n\t /**\n\t\t\t * and subtracted from the input signal\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._subtract = this.output = new Tone.Subtract();\n\t /**\n\t\t\t * the modulus signal\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._modSignal = new Tone.Signal(modulus);\n\t //connections\n\t this.input.fan(this._shaper, this._subtract);\n\t this._modSignal.connect(this._multiply, 0, 0);\n\t this._shaper.connect(this._multiply, 0, 1);\n\t this._multiply.connect(this._subtract, 0, 1);\n\t this._setWaveShaper(modulus);\n\t };\n\t Tone.extend(Tone.Modulo, Tone.SignalBase);\n\t /**\n\t\t * @param {number} mod the modulus to apply\n\t\t * @private\n\t\t */\n\t Tone.Modulo.prototype._setWaveShaper = function (mod) {\n\t this._shaper.setMap(function (val) {\n\t var multiple = Math.floor((val + 0.0001) / mod);\n\t return multiple;\n\t });\n\t };\n\t /**\n\t\t * The modulus value.\n\t\t * @memberOf Tone.Modulo#\n\t\t * @type {NormalRange}\n\t\t * @name value\n\t\t */\n\t Object.defineProperty(Tone.Modulo.prototype, 'value', {\n\t get: function () {\n\t return this._modSignal.value;\n\t },\n\t set: function (mod) {\n\t this._modSignal.value = mod;\n\t this._setWaveShaper(mod);\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Modulo} this\n\t\t */\n\t Tone.Modulo.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._shaper.dispose();\n\t this._shaper = null;\n\t this._multiply.dispose();\n\t this._multiply = null;\n\t this._subtract.dispose();\n\t this._subtract = null;\n\t this._modSignal.dispose();\n\t this._modSignal = null;\n\t return this;\n\t };\n\t return Tone.Modulo;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Bitcrusher downsamples the incoming signal to a different bitdepth.\n\t\t * Lowering the bitdepth of the signal creates distortion. Read more about Bitcrushing\n\t\t * on [Wikipedia](https://en.wikipedia.org/wiki/Bitcrusher).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {Number} bits The number of bits to downsample the signal. Nominal range\n\t\t * of 1 to 8.\n\t\t * @example\n\t\t * //initialize crusher and route a synth through it\n\t\t * var crusher = new Tone.BitCrusher(4).toMaster();\n\t\t * var synth = new Tone.MonoSynth().connect(crusher);\n\t\t */\n\t Tone.BitCrusher = function () {\n\t var options = Tone.defaults(arguments, ['bits'], Tone.BitCrusher);\n\t Tone.Effect.call(this, options);\n\t var invStepSize = 1 / Math.pow(2, options.bits - 1);\n\t /**\n\t\t\t * Subtract the input signal and the modulus of the input signal\n\t\t\t * @type {Tone.Subtract}\n\t\t\t * @private\n\t\t\t */\n\t this._subtract = new Tone.Subtract();\n\t /**\n\t\t\t * The mod function\n\t\t\t * @type {Tone.Modulo}\n\t\t\t * @private\n\t\t\t */\n\t this._modulo = new Tone.Modulo(invStepSize);\n\t /**\n\t\t\t * keeps track of the bits\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._bits = options.bits;\n\t //connect it up\n\t this.effectSend.fan(this._subtract, this._modulo);\n\t this._modulo.connect(this._subtract, 0, 1);\n\t this._subtract.connect(this.effectReturn);\n\t };\n\t Tone.extend(Tone.BitCrusher, Tone.Effect);\n\t /**\n\t\t * the default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.BitCrusher.defaults = { 'bits': 4 };\n\t /**\n\t\t * The bit depth of the effect. Nominal range of 1-8.\n\t\t * @memberOf Tone.BitCrusher#\n\t\t * @type {number}\n\t\t * @name bits\n\t\t */\n\t Object.defineProperty(Tone.BitCrusher.prototype, 'bits', {\n\t get: function () {\n\t return this._bits;\n\t },\n\t set: function (bits) {\n\t this._bits = bits;\n\t var invStepSize = 1 / Math.pow(2, bits - 1);\n\t this._modulo.value = invStepSize;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.BitCrusher} this\n\t\t */\n\t Tone.BitCrusher.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._subtract.dispose();\n\t this._subtract = null;\n\t this._modulo.dispose();\n\t this._modulo = null;\n\t return this;\n\t };\n\t return Tone.BitCrusher;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.ChebyShev is a Chebyshev waveshaper, an effect which is good \n\t\t * for making different types of distortion sounds.\n\t\t * Note that odd orders sound very different from even ones, \n\t\t * and order = 1 is no change. \n\t\t * Read more at [music.columbia.edu](http://music.columbia.edu/cmc/musicandcomputers/chapter4/04_06.php).\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {Positive|Object} [order] The order of the chebyshev polynomial. Normal range between 1-100. \n\t\t * @example\n\t\t * //create a new cheby\n\t\t * var cheby = new Tone.Chebyshev(50);\n\t\t * //create a monosynth connected to our cheby\n\t\t * synth = new Tone.MonoSynth().connect(cheby);\n\t\t */\n\t Tone.Chebyshev = function () {\n\t var options = Tone.defaults(arguments, ['order'], Tone.Chebyshev);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._shaper = new Tone.WaveShaper(4096);\n\t /**\n\t\t\t * holds onto the order of the filter\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._order = options.order;\n\t this.connectEffect(this._shaper);\n\t this.order = options.order;\n\t this.oversample = options.oversample;\n\t };\n\t Tone.extend(Tone.Chebyshev, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Chebyshev.defaults = {\n\t 'order': 1,\n\t 'oversample': 'none'\n\t };\n\t /**\n\t\t * get the coefficient for that degree\n\t\t * @param {number} x the x value\n\t\t * @param {number} degree \n\t\t * @param {Object} memo memoize the computed value. \n\t\t * this speeds up computation greatly. \n\t\t * @return {number} the coefficient \n\t\t * @private\n\t\t */\n\t Tone.Chebyshev.prototype._getCoefficient = function (x, degree, memo) {\n\t if (memo.hasOwnProperty(degree)) {\n\t return memo[degree];\n\t } else if (degree === 0) {\n\t memo[degree] = 0;\n\t } else if (degree === 1) {\n\t memo[degree] = x;\n\t } else {\n\t memo[degree] = 2 * x * this._getCoefficient(x, degree - 1, memo) - this._getCoefficient(x, degree - 2, memo);\n\t }\n\t return memo[degree];\n\t };\n\t /**\n\t\t * The order of the Chebyshev polynomial which creates\n\t\t * the equation which is applied to the incoming \n\t\t * signal through a Tone.WaveShaper. The equations\n\t\t * are in the form:<br>\n\t\t * order 2: 2x^2 + 1<br>\n\t\t * order 3: 4x^3 + 3x <br>\n\t\t * @memberOf Tone.Chebyshev#\n\t\t * @type {Positive}\n\t\t * @name order\n\t\t */\n\t Object.defineProperty(Tone.Chebyshev.prototype, 'order', {\n\t get: function () {\n\t return this._order;\n\t },\n\t set: function (order) {\n\t this._order = order;\n\t var curve = new Array(4096);\n\t var len = curve.length;\n\t for (var i = 0; i < len; ++i) {\n\t var x = i * 2 / len - 1;\n\t if (x === 0) {\n\t //should output 0 when input is 0\n\t curve[i] = 0;\n\t } else {\n\t curve[i] = this._getCoefficient(x, order, {});\n\t }\n\t }\n\t this._shaper.curve = curve;\n\t }\n\t });\n\t /**\n\t\t * The oversampling of the effect. Can either be \"none\", \"2x\" or \"4x\".\n\t\t * @memberOf Tone.Chebyshev#\n\t\t * @type {string}\n\t\t * @name oversample\n\t\t */\n\t Object.defineProperty(Tone.Chebyshev.prototype, 'oversample', {\n\t get: function () {\n\t return this._shaper.oversample;\n\t },\n\t set: function (oversampling) {\n\t this._shaper.oversample = oversampling;\n\t }\n\t });\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.Chebyshev} this\n\t\t */\n\t Tone.Chebyshev.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._shaper.dispose();\n\t this._shaper = null;\n\t return this;\n\t };\n\t return Tone.Chebyshev;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for Stereo effects. Provides effectSendL/R and effectReturnL/R.\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.Effect}\n\t\t */\n\t Tone.StereoEffect = function () {\n\t //get the defaults\n\t Tone.AudioNode.call(this);\n\t var options = Tone.defaults(arguments, ['wet'], Tone.Effect);\n\t this.createInsOuts(1, 1);\n\t /**\n\t\t\t * the drywet knob to control the amount of effect\n\t\t\t * @type {Tone.CrossFade}\n\t\t\t * @private\n\t\t\t */\n\t this._dryWet = new Tone.CrossFade(options.wet);\n\t /**\n\t\t\t * The wet control, i.e. how much of the effected\n\t\t\t * will pass through to the output.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.wet = this._dryWet.fade;\n\t /**\n\t\t\t * then split it\n\t\t\t * @type {Tone.Split}\n\t\t\t * @private\n\t\t\t */\n\t this._split = new Tone.Split();\n\t /**\n\t\t\t * the effects send LEFT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectSendL = this._split.left;\n\t /**\n\t\t\t * the effects send RIGHT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectSendR = this._split.right;\n\t /**\n\t\t\t * the stereo effect merger\n\t\t\t * @type {Tone.Merge}\n\t\t\t * @private\n\t\t\t */\n\t this._merge = new Tone.Merge();\n\t /**\n\t\t\t * the effect return LEFT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectReturnL = this._merge.left;\n\t /**\n\t\t\t * the effect return RIGHT\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.effectReturnR = this._merge.right;\n\t //connections\n\t this.input.connect(this._split);\n\t //dry wet connections\n\t this.input.connect(this._dryWet, 0, 0);\n\t this._merge.connect(this._dryWet, 0, 1);\n\t this._dryWet.connect(this.output);\n\t this._readOnly(['wet']);\n\t };\n\t Tone.extend(Tone.StereoEffect, Tone.Effect);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.StereoEffect} this\n\t\t */\n\t Tone.StereoEffect.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._dryWet.dispose();\n\t this._dryWet = null;\n\t this._split.dispose();\n\t this._split = null;\n\t this._merge.dispose();\n\t this._merge = null;\n\t this.effectSendL = null;\n\t this.effectSendR = null;\n\t this.effectReturnL = null;\n\t this.effectReturnR = null;\n\t this._writable(['wet']);\n\t this.wet = null;\n\t return this;\n\t };\n\t return Tone.StereoEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Chorus is a stereo chorus effect composed of\n\t\t * a left and right delay with a Tone.LFO applied to the delayTime of each channel.\n\t\t * Inspiration from [Tuna.js](https://github.com/Dinahmoe/tuna/blob/master/tuna.js).\n\t\t * Read more on the chorus effect on [SoundOnSound](http://www.soundonsound.com/sos/jun04/articles/synthsecrets.htm).\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t *\t@param {Frequency|Object} [frequency] The frequency of the LFO.\n\t\t *\t@param {Milliseconds} [delayTime] The delay of the chorus effect in ms.\n\t\t *\t@param {NormalRange} [depth] The depth of the chorus.\n\t\t *\t@example\n\t\t * var chorus = new Tone.Chorus(4, 2.5, 0.5);\n\t\t * var synth = new Tone.PolySynth(4, Tone.MonoSynth).connect(chorus);\n\t\t * synth.triggerAttackRelease([\"C3\",\"E3\",\"G3\"], \"8n\");\n\t\t */\n\t Tone.Chorus = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'delayTime',\n\t 'depth'\n\t ], Tone.Chorus);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * the depth of the chorus\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._depth = options.depth;\n\t /**\n\t\t\t * the delayTime\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._delayTime = options.delayTime / 1000;\n\t /**\n\t\t\t * the lfo which controls the delayTime\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoL = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'min': 0,\n\t 'max': 1\n\t });\n\t /**\n\t\t\t * another LFO for the right side with a 180 degree phase diff\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoR = new Tone.LFO({\n\t 'frequency': options.frequency,\n\t 'min': 0,\n\t 'max': 1,\n\t 'phase': 180\n\t });\n\t /**\n\t\t\t * delay for left\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNodeL = new Tone.Delay();\n\t /**\n\t\t\t * delay for right\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNodeR = new Tone.Delay();\n\t /**\n\t\t\t * The frequency of the LFO which modulates the delayTime.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfoL.frequency;\n\t //connections\n\t this.effectSendL.chain(this._delayNodeL, this.effectReturnL);\n\t this.effectSendR.chain(this._delayNodeR, this.effectReturnR);\n\t //and pass through to make the detune apparent\n\t this.effectSendL.connect(this.effectReturnL);\n\t this.effectSendR.connect(this.effectReturnR);\n\t //lfo setup\n\t this._lfoL.connect(this._delayNodeL.delayTime);\n\t this._lfoR.connect(this._delayNodeR.delayTime);\n\t //start the lfo\n\t this._lfoL.start();\n\t this._lfoR.start();\n\t //have one LFO frequency control the other\n\t this._lfoL.frequency.connect(this._lfoR.frequency);\n\t //set the initial values\n\t this.depth = this._depth;\n\t this.frequency.value = options.frequency;\n\t this.type = options.type;\n\t this._readOnly(['frequency']);\n\t this.spread = options.spread;\n\t };\n\t Tone.extend(Tone.Chorus, Tone.StereoEffect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Chorus.defaults = {\n\t 'frequency': 1.5,\n\t 'delayTime': 3.5,\n\t 'depth': 0.7,\n\t 'type': 'sine',\n\t 'spread': 180\n\t };\n\t /**\n\t\t * The depth of the effect. A depth of 1 makes the delayTime\n\t\t * modulate between 0 and 2*delayTime (centered around the delayTime).\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {NormalRange}\n\t\t * @name depth\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'depth', {\n\t get: function () {\n\t return this._depth;\n\t },\n\t set: function (depth) {\n\t this._depth = depth;\n\t var deviation = this._delayTime * depth;\n\t this._lfoL.min = Math.max(this._delayTime - deviation, 0);\n\t this._lfoL.max = this._delayTime + deviation;\n\t this._lfoR.min = Math.max(this._delayTime - deviation, 0);\n\t this._lfoR.max = this._delayTime + deviation;\n\t }\n\t });\n\t /**\n\t\t * The delayTime in milliseconds of the chorus. A larger delayTime\n\t\t * will give a more pronounced effect. Nominal range a delayTime\n\t\t * is between 2 and 20ms.\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {Milliseconds}\n\t\t * @name delayTime\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'delayTime', {\n\t get: function () {\n\t return this._delayTime * 1000;\n\t },\n\t set: function (delayTime) {\n\t this._delayTime = delayTime / 1000;\n\t this.depth = this._depth;\n\t }\n\t });\n\t /**\n\t\t * The oscillator type of the LFO.\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'type', {\n\t get: function () {\n\t return this._lfoL.type;\n\t },\n\t set: function (type) {\n\t this._lfoL.type = type;\n\t this._lfoR.type = type;\n\t }\n\t });\n\t /**\n\t\t * Amount of stereo spread. When set to 0, both LFO's will be panned centrally.\n\t\t * When set to 180, LFO's will be panned hard left and right respectively.\n\t\t * @memberOf Tone.Chorus#\n\t\t * @type {Degrees}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.Chorus.prototype, 'spread', {\n\t get: function () {\n\t return this._lfoR.phase - this._lfoL.phase;\n\t },\n\t set: function (spread) {\n\t this._lfoL.phase = 90 - spread / 2;\n\t this._lfoR.phase = spread / 2 + 90;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Chorus} this\n\t\t */\n\t Tone.Chorus.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._lfoL.dispose();\n\t this._lfoL = null;\n\t this._lfoR.dispose();\n\t this._lfoR = null;\n\t this._delayNodeL.dispose();\n\t this._delayNodeL = null;\n\t this._delayNodeR.dispose();\n\t this._delayNodeR = null;\n\t this._writable('frequency');\n\t this.frequency = null;\n\t return this;\n\t };\n\t return Tone.Chorus;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Convolver is a wrapper around the Native Web Audio\n\t\t * [ConvolverNode](http://webaudio.github.io/web-audio-api/#the-convolvernode-interface).\n\t\t * Convolution is useful for reverb and filter emulation. Read more about convolution reverb on\n\t\t * [Wikipedia](https://en.wikipedia.org/wiki/Convolution_reverb).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {string|Tone.Buffer|Object} [url] The URL of the impulse response or the Tone.Buffer\n\t\t * contianing the impulse response.\n\t\t * @param {Function=} onload The callback to invoke when the url is loaded.\n\t\t * @example\n\t\t * //initializing the convolver with an impulse response\n\t\t * var convolver = new Tone.Convolver(\"./path/to/ir.wav\").toMaster();\n\t\t */\n\t Tone.Convolver = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload'\n\t ], Tone.Convolver);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * convolver node\n\t\t\t * @type {ConvolverNode}\n\t\t\t * @private\n\t\t\t */\n\t this._convolver = this.context.createConvolver();\n\t /**\n\t\t\t * the convolution buffer\n\t\t\t * @type {Tone.Buffer}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = new Tone.Buffer(options.url, function (buffer) {\n\t this._convolver.buffer = buffer.get();\n\t options.onload();\n\t }.bind(this));\n\t this.connectEffect(this._convolver);\n\t };\n\t Tone.extend(Tone.Convolver, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Convolver.defaults = { 'onload': Tone.noOp };\n\t /**\n\t\t * The convolver's buffer\n\t\t * @memberOf Tone.Convolver#\n\t\t * @type {AudioBuffer}\n\t\t * @name buffer\n\t\t */\n\t Object.defineProperty(Tone.Convolver.prototype, 'buffer', {\n\t get: function () {\n\t return this._buffer.get();\n\t },\n\t set: function (buffer) {\n\t this._buffer.set(buffer);\n\t this._convolver.buffer = this._buffer.get();\n\t }\n\t });\n\t /**\n\t\t * Load an impulse response url as an audio buffer.\n\t\t * Decodes the audio asynchronously and invokes\n\t\t * the callback once the audio buffer loads.\n\t\t * @param {string} url The url of the buffer to load.\n\t\t * filetype support depends on the\n\t\t * browser.\n\t\t * @param {function=} callback\n\t\t * @returns {Promise}\n\t\t */\n\t Tone.Convolver.prototype.load = function (url, callback) {\n\t return this._buffer.load(url, function (buff) {\n\t this.buffer = buff;\n\t if (callback) {\n\t callback();\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Convolver} this\n\t\t */\n\t Tone.Convolver.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._convolver.disconnect();\n\t this._convolver = null;\n\t this._buffer.dispose();\n\t this._buffer = null;\n\t return this;\n\t };\n\t return Tone.Convolver;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Distortion is a simple distortion effect using Tone.WaveShaper.\n\t\t * Algorithm from [a stackoverflow answer](http://stackoverflow.com/a/22313408).\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {Number|Object} [distortion] The amount of distortion (nominal range of 0-1)\n\t\t * @example\n\t\t * var dist = new Tone.Distortion(0.8).toMaster();\n\t\t * var fm = new Tone.SimpleFM().connect(dist);\n\t\t * //this sounds good on bass notes\n\t\t * fm.triggerAttackRelease(\"A1\", \"8n\");\n\t\t */\n\t Tone.Distortion = function () {\n\t var options = Tone.defaults(arguments, ['distortion'], Tone.Distortion);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._shaper = new Tone.WaveShaper(4096);\n\t /**\n\t\t\t * holds the distortion amount\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._distortion = options.distortion;\n\t this.connectEffect(this._shaper);\n\t this.distortion = options.distortion;\n\t this.oversample = options.oversample;\n\t };\n\t Tone.extend(Tone.Distortion, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Distortion.defaults = {\n\t 'distortion': 0.4,\n\t 'oversample': 'none'\n\t };\n\t /**\n\t\t * The amount of distortion.\n\t\t * @memberOf Tone.Distortion#\n\t\t * @type {NormalRange}\n\t\t * @name distortion\n\t\t */\n\t Object.defineProperty(Tone.Distortion.prototype, 'distortion', {\n\t get: function () {\n\t return this._distortion;\n\t },\n\t set: function (amount) {\n\t this._distortion = amount;\n\t var k = amount * 100;\n\t var deg = Math.PI / 180;\n\t this._shaper.setMap(function (x) {\n\t if (Math.abs(x) < 0.001) {\n\t //should output 0 when input is 0\n\t return 0;\n\t } else {\n\t return (3 + k) * x * 20 * deg / (Math.PI + k * Math.abs(x));\n\t }\n\t });\n\t }\n\t });\n\t /**\n\t\t * The oversampling of the effect. Can either be \"none\", \"2x\" or \"4x\".\n\t\t * @memberOf Tone.Distortion#\n\t\t * @type {string}\n\t\t * @name oversample\n\t\t */\n\t Object.defineProperty(Tone.Distortion.prototype, 'oversample', {\n\t get: function () {\n\t return this._shaper.oversample;\n\t },\n\t set: function (oversampling) {\n\t this._shaper.oversample = oversampling;\n\t }\n\t });\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.Distortion} this\n\t\t */\n\t Tone.Distortion.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._shaper.dispose();\n\t this._shaper = null;\n\t return this;\n\t };\n\t return Tone.Distortion;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * \t@class Tone.FeedbackEffect provides a loop between an \n\t\t * \t audio source and its own output. This is a base-class\n\t\t * \t for feedback effects. \n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Effect}\n\t\t * @param {NormalRange|Object} [feedback] The initial feedback value.\n\t\t */\n\t Tone.FeedbackEffect = function () {\n\t var options = Tone.defaults(arguments, ['feedback'], Tone.FeedbackEffect);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * the gain which controls the feedback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackGain = new Tone.Gain(options.feedback, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of signal which is fed back into the effect input. \n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.feedback = this._feedbackGain.gain;\n\t //the feedback loop\n\t this.effectReturn.chain(this._feedbackGain, this.effectSend);\n\t this._readOnly(['feedback']);\n\t };\n\t Tone.extend(Tone.FeedbackEffect, Tone.Effect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.FeedbackEffect.defaults = { 'feedback': 0.125 };\n\t /**\n\t\t * Clean up. \n\t\t * @returns {Tone.FeedbackEffect} this\n\t\t */\n\t Tone.FeedbackEffect.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._writable(['feedback']);\n\t this._feedbackGain.dispose();\n\t this._feedbackGain = null;\n\t this.feedback = null;\n\t return this;\n\t };\n\t return Tone.FeedbackEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FeedbackDelay is a DelayNode in which part of output\n\t\t * signal is fed back into the delay.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.FeedbackEffect}\n\t\t * @param {Time|Object} [delayTime] The delay applied to the incoming signal.\n\t\t * @param {NormalRange=} feedback The amount of the effected signal which\n\t\t * is fed back through the delay.\n\t\t * @example\n\t\t * var feedbackDelay = new Tone.FeedbackDelay(\"8n\", 0.5).toMaster();\n\t\t * var tom = new Tone.DrumSynth({\n\t\t * \t\"octaves\" : 4,\n\t\t * \t\"pitchDecay\" : 0.1\n\t\t * }).connect(feedbackDelay);\n\t\t * tom.triggerAttackRelease(\"A2\",\"32n\");\n\t\t */\n\t Tone.FeedbackDelay = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'feedback'\n\t ], Tone.FeedbackDelay);\n\t Tone.FeedbackEffect.call(this, options);\n\t /**\n\t\t\t * the delay node\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNode = new Tone.Delay(options.delayTime, options.maxDelay);\n\t /**\n\t\t\t * The delayTime of the DelayNode.\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._delayNode.delayTime;\n\t // connect it up\n\t this.connectEffect(this._delayNode);\n\t this._readOnly(['delayTime']);\n\t };\n\t Tone.extend(Tone.FeedbackDelay, Tone.FeedbackEffect);\n\t /**\n\t\t * The default values.\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.FeedbackDelay.defaults = {\n\t 'delayTime': 0.25,\n\t 'maxDelay': 1\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FeedbackDelay} this\n\t\t */\n\t Tone.FeedbackDelay.prototype.dispose = function () {\n\t Tone.FeedbackEffect.prototype.dispose.call(this);\n\t this._delayNode.dispose();\n\t this._delayNode = null;\n\t this._writable(['delayTime']);\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.FeedbackDelay;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * an array of comb filter delay values from Freeverb implementation\n\t\t * @static\n\t\t * @private\n\t\t * @type {Array}\n\t\t */\n\t var combFilterTunings = [\n\t 1557 / 44100,\n\t 1617 / 44100,\n\t 1491 / 44100,\n\t 1422 / 44100,\n\t 1277 / 44100,\n\t 1356 / 44100,\n\t 1188 / 44100,\n\t 1116 / 44100\n\t ];\n\t /**\n\t\t * an array of allpass filter frequency values from Freeverb implementation\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var allpassFilterFrequencies = [\n\t 225,\n\t 556,\n\t 441,\n\t 341\n\t ];\n\t /**\n\t\t * @class Tone.Freeverb is a reverb based on [Freeverb](https://ccrma.stanford.edu/~jos/pasp/Freeverb.html).\n\t\t * Read more on reverb on [Sound On Sound](https://web.archive.org/web/20160404083902/http://www.soundonsound.com:80/sos/feb01/articles/synthsecrets.asp).\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {NormalRange|Object} [roomSize] Correlated to the decay time.\n\t\t * @param {Frequency} [dampening] The cutoff frequency of a lowpass filter as part\n\t\t * of the reverb.\n\t\t * @example\n\t\t * var freeverb = new Tone.Freeverb().toMaster();\n\t\t * freeverb.dampening.value = 1000;\n\t\t * //routing synth through the reverb\n\t\t * var synth = new Tone.AMSynth().connect(freeverb);\n\t\t */\n\t Tone.Freeverb = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'roomSize',\n\t 'dampening'\n\t ], Tone.Freeverb);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * The roomSize value between. A larger roomSize\n\t\t\t * will result in a longer decay.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.roomSize = new Tone.Signal(options.roomSize, Tone.Type.NormalRange);\n\t /**\n\t\t\t * The amount of dampening of the reverberant signal.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.dampening = new Tone.Signal(options.dampening, Tone.Type.Frequency);\n\t /**\n\t\t\t * the comb filters\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._combFilters = [];\n\t /**\n\t\t\t * the allpass filters on the left\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._allpassFiltersL = [];\n\t /**\n\t\t\t * the allpass filters on the right\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._allpassFiltersR = [];\n\t //make the allpass filters on the right\n\t for (var l = 0; l < allpassFilterFrequencies.length; l++) {\n\t var allpassL = this.context.createBiquadFilter();\n\t allpassL.type = 'allpass';\n\t allpassL.frequency.value = allpassFilterFrequencies[l];\n\t this._allpassFiltersL.push(allpassL);\n\t }\n\t //make the allpass filters on the left\n\t for (var r = 0; r < allpassFilterFrequencies.length; r++) {\n\t var allpassR = this.context.createBiquadFilter();\n\t allpassR.type = 'allpass';\n\t allpassR.frequency.value = allpassFilterFrequencies[r];\n\t this._allpassFiltersR.push(allpassR);\n\t }\n\t //make the comb filters\n\t for (var c = 0; c < combFilterTunings.length; c++) {\n\t var lfpf = new Tone.LowpassCombFilter(combFilterTunings[c]);\n\t if (c < combFilterTunings.length / 2) {\n\t this.effectSendL.chain(lfpf, this._allpassFiltersL[0]);\n\t } else {\n\t this.effectSendR.chain(lfpf, this._allpassFiltersR[0]);\n\t }\n\t this.roomSize.connect(lfpf.resonance);\n\t this.dampening.connect(lfpf.dampening);\n\t this._combFilters.push(lfpf);\n\t }\n\t //chain the allpass filters togetehr\n\t Tone.connectSeries.apply(Tone, this._allpassFiltersL);\n\t Tone.connectSeries.apply(Tone, this._allpassFiltersR);\n\t this._allpassFiltersL[this._allpassFiltersL.length - 1].connect(this.effectReturnL);\n\t this._allpassFiltersR[this._allpassFiltersR.length - 1].connect(this.effectReturnR);\n\t this._readOnly([\n\t 'roomSize',\n\t 'dampening'\n\t ]);\n\t };\n\t Tone.extend(Tone.Freeverb, Tone.StereoEffect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Freeverb.defaults = {\n\t 'roomSize': 0.7,\n\t 'dampening': 3000\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Freeverb} this\n\t\t */\n\t Tone.Freeverb.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t for (var al = 0; al < this._allpassFiltersL.length; al++) {\n\t this._allpassFiltersL[al].disconnect();\n\t this._allpassFiltersL[al] = null;\n\t }\n\t this._allpassFiltersL = null;\n\t for (var ar = 0; ar < this._allpassFiltersR.length; ar++) {\n\t this._allpassFiltersR[ar].disconnect();\n\t this._allpassFiltersR[ar] = null;\n\t }\n\t this._allpassFiltersR = null;\n\t for (var cf = 0; cf < this._combFilters.length; cf++) {\n\t this._combFilters[cf].dispose();\n\t this._combFilters[cf] = null;\n\t }\n\t this._combFilters = null;\n\t this._writable([\n\t 'roomSize',\n\t 'dampening'\n\t ]);\n\t this.roomSize.dispose();\n\t this.roomSize = null;\n\t this.dampening.dispose();\n\t this.dampening = null;\n\t return this;\n\t };\n\t return Tone.Freeverb;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * an array of the comb filter delay time values\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var combFilterDelayTimes = [\n\t 1687 / 25000,\n\t 1601 / 25000,\n\t 2053 / 25000,\n\t 2251 / 25000\n\t ];\n\t /**\n\t\t * the resonances of each of the comb filters\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var combFilterResonances = [\n\t 0.773,\n\t 0.802,\n\t 0.753,\n\t 0.733\n\t ];\n\t /**\n\t\t * the allpass filter frequencies\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var allpassFilterFreqs = [\n\t 347,\n\t 113,\n\t 37\n\t ];\n\t /**\n\t\t * @class Tone.JCReverb is a simple [Schroeder Reverberator](https://ccrma.stanford.edu/~jos/pasp/Schroeder_Reverberators.html)\n\t\t * tuned by John Chowning in 1970.\n\t\t * It is made up of three allpass filters and four Tone.FeedbackCombFilter.\n\t\t *\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t * @param {NormalRange|Object} [roomSize] Coorelates to the decay time.\n\t\t * @example\n\t\t * var reverb = new Tone.JCReverb(0.4).connect(Tone.Master);\n\t\t * var delay = new Tone.FeedbackDelay(0.5);\n\t\t * //connecting the synth to reverb through delay\n\t\t * var synth = new Tone.DuoSynth().chain(delay, reverb);\n\t\t * synth.triggerAttackRelease(\"A4\",\"8n\");\n\t\t */\n\t Tone.JCReverb = function () {\n\t var options = Tone.defaults(arguments, ['roomSize'], Tone.JCReverb);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * room size control values between [0,1]\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.roomSize = new Tone.Signal(options.roomSize, Tone.Type.NormalRange);\n\t /**\n\t\t\t * scale the room size\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._scaleRoomSize = new Tone.Scale(-0.733, 0.197);\n\t /**\n\t\t\t * a series of allpass filters\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._allpassFilters = [];\n\t /**\n\t\t\t * parallel feedback comb filters\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackCombFilters = [];\n\t //make the allpass filters\n\t for (var af = 0; af < allpassFilterFreqs.length; af++) {\n\t var allpass = this.context.createBiquadFilter();\n\t allpass.type = 'allpass';\n\t allpass.frequency.value = allpassFilterFreqs[af];\n\t this._allpassFilters.push(allpass);\n\t }\n\t //and the comb filters\n\t for (var cf = 0; cf < combFilterDelayTimes.length; cf++) {\n\t var fbcf = new Tone.FeedbackCombFilter(combFilterDelayTimes[cf], 0.1);\n\t this._scaleRoomSize.connect(fbcf.resonance);\n\t fbcf.resonance.value = combFilterResonances[cf];\n\t this._allpassFilters[this._allpassFilters.length - 1].connect(fbcf);\n\t if (cf < combFilterDelayTimes.length / 2) {\n\t fbcf.connect(this.effectReturnL);\n\t } else {\n\t fbcf.connect(this.effectReturnR);\n\t }\n\t this._feedbackCombFilters.push(fbcf);\n\t }\n\t //chain the allpass filters together\n\t this.roomSize.connect(this._scaleRoomSize);\n\t Tone.connectSeries.apply(Tone, this._allpassFilters);\n\t this.effectSendL.connect(this._allpassFilters[0]);\n\t this.effectSendR.connect(this._allpassFilters[0]);\n\t this._readOnly(['roomSize']);\n\t };\n\t Tone.extend(Tone.JCReverb, Tone.StereoEffect);\n\t /**\n\t\t * the default values\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.JCReverb.defaults = { 'roomSize': 0.5 };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.JCReverb} this\n\t\t */\n\t Tone.JCReverb.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t for (var apf = 0; apf < this._allpassFilters.length; apf++) {\n\t this._allpassFilters[apf].disconnect();\n\t this._allpassFilters[apf] = null;\n\t }\n\t this._allpassFilters = null;\n\t for (var fbcf = 0; fbcf < this._feedbackCombFilters.length; fbcf++) {\n\t this._feedbackCombFilters[fbcf].dispose();\n\t this._feedbackCombFilters[fbcf] = null;\n\t }\n\t this._feedbackCombFilters = null;\n\t this._writable(['roomSize']);\n\t this.roomSize.dispose();\n\t this.roomSize = null;\n\t this._scaleRoomSize.dispose();\n\t this._scaleRoomSize = null;\n\t return this;\n\t };\n\t return Tone.JCReverb;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Mid/Side processing separates the the 'mid' signal\n\t\t * (which comes out of both the left and the right channel)\n\t\t * and the 'side' (which only comes out of the the side channels)\n\t\t * and effects them separately before being recombined.\n\t\t * Applies a Mid/Side seperation and recombination.\n\t\t * Algorithm found in [kvraudio forums](http://www.kvraudio.com/forum/viewtopic.php?t=212587).\n\t\t * <br><br>\n\t\t * This is a base-class for Mid/Side Effects.\n\t\t *\n\t\t * @extends {Tone.Effect}\n\t\t * @constructor\n\t\t */\n\t Tone.MidSideEffect = function () {\n\t Tone.Effect.apply(this, arguments);\n\t /**\n\t\t\t * The mid/side split\n\t\t\t * @type {Tone.MidSideSplit}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideSplit = new Tone.MidSideSplit();\n\t /**\n\t\t\t * The mid/side merge\n\t\t\t * @type {Tone.MidSideMerge}\n\t\t\t * @private\n\t\t\t */\n\t this._midSideMerge = new Tone.MidSideMerge();\n\t /**\n\t\t\t * The mid send. Connect to mid processing\n\t\t\t * @type {Tone}\n\t\t\t * @private\n\t\t\t */\n\t this.midSend = this._midSideSplit.mid;\n\t /**\n\t\t\t * The side send. Connect to side processing\n\t\t\t * @type {Tone}\n\t\t\t * @private\n\t\t\t */\n\t this.sideSend = this._midSideSplit.side;\n\t /**\n\t\t\t * The mid return connection\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.midReturn = this._midSideMerge.mid;\n\t /**\n\t\t\t * The side return connection\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this.sideReturn = this._midSideMerge.side;\n\t //the connections\n\t this.effectSend.connect(this._midSideSplit);\n\t this._midSideMerge.connect(this.effectReturn);\n\t };\n\t Tone.extend(Tone.MidSideEffect, Tone.Effect);\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MidSideEffect} this\n\t\t */\n\t Tone.MidSideEffect.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._midSideSplit.dispose();\n\t this._midSideSplit = null;\n\t this._midSideMerge.dispose();\n\t this._midSideMerge = null;\n\t this.midSend = null;\n\t this.sideSend = null;\n\t this.midReturn = null;\n\t this.sideReturn = null;\n\t return this;\n\t };\n\t return Tone.MidSideEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Phaser is a phaser effect. Phasers work by changing the phase\n\t\t * of different frequency components of an incoming signal. Read more on\n\t\t * [Wikipedia](https://en.wikipedia.org/wiki/Phaser_(effect)).\n\t\t * Inspiration for this phaser comes from [Tuna.js](https://github.com/Dinahmoe/tuna/).\n\t\t *\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t *\t@constructor\n\t\t *\t@param {Frequency|Object} [frequency] The speed of the phasing.\n\t\t *\t@param {number} [octaves] The octaves of the effect.\n\t\t *\t@param {Frequency} [baseFrequency] The base frequency of the filters.\n\t\t *\t@example\n\t\t * var phaser = new Tone.Phaser({\n\t\t * \t\"frequency\" : 15,\n\t\t * \t\"octaves\" : 5,\n\t\t * \t\"baseFrequency\" : 1000\n\t\t * }).toMaster();\n\t\t * var synth = new Tone.FMSynth().connect(phaser);\n\t\t * synth.triggerAttackRelease(\"E3\", \"2n\");\n\t\t */\n\t Tone.Phaser = function () {\n\t //set the defaults\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'octaves',\n\t 'baseFrequency'\n\t ], Tone.Phaser);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * the lfo which controls the frequency on the left side\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoL = new Tone.LFO(options.frequency, 0, 1);\n\t /**\n\t\t\t * the lfo which controls the frequency on the right side\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoR = new Tone.LFO(options.frequency, 0, 1);\n\t this._lfoR.phase = 180;\n\t /**\n\t\t\t * the base modulation frequency\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._baseFrequency = options.baseFrequency;\n\t /**\n\t\t\t * the octaves of the phasing\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t /**\n\t\t\t * The quality factor of the filters\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.Q = new Tone.Signal(options.Q, Tone.Type.Positive);\n\t /**\n\t\t\t * the array of filters for the left side\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._filtersL = this._makeFilters(options.stages, this._lfoL, this.Q);\n\t /**\n\t\t\t * the array of filters for the left side\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._filtersR = this._makeFilters(options.stages, this._lfoR, this.Q);\n\t /**\n\t\t\t * the frequency of the effect\n\t\t\t * @type {Tone.Signal}\n\t\t\t */\n\t this.frequency = this._lfoL.frequency;\n\t this.frequency.value = options.frequency;\n\t //connect them up\n\t this.effectSendL.connect(this._filtersL[0]);\n\t this.effectSendR.connect(this._filtersR[0]);\n\t this._filtersL[options.stages - 1].connect(this.effectReturnL);\n\t this._filtersR[options.stages - 1].connect(this.effectReturnR);\n\t //control the frequency with one LFO\n\t this._lfoL.frequency.connect(this._lfoR.frequency);\n\t //set the options\n\t this.baseFrequency = options.baseFrequency;\n\t this.octaves = options.octaves;\n\t //start the lfo\n\t this._lfoL.start();\n\t this._lfoR.start();\n\t this._readOnly([\n\t 'frequency',\n\t 'Q'\n\t ]);\n\t };\n\t Tone.extend(Tone.Phaser, Tone.StereoEffect);\n\t /**\n\t\t * defaults\n\t\t * @static\n\t\t * @type {object}\n\t\t */\n\t Tone.Phaser.defaults = {\n\t 'frequency': 0.5,\n\t 'octaves': 3,\n\t 'stages': 10,\n\t 'Q': 10,\n\t 'baseFrequency': 350\n\t };\n\t /**\n\t\t * @param {number} stages\n\t\t * @returns {Array} the number of filters all connected together\n\t\t * @private\n\t\t */\n\t Tone.Phaser.prototype._makeFilters = function (stages, connectToFreq, Q) {\n\t var filters = new Array(stages);\n\t //make all the filters\n\t for (var i = 0; i < stages; i++) {\n\t var filter = this.context.createBiquadFilter();\n\t filter.type = 'allpass';\n\t Q.connect(filter.Q);\n\t connectToFreq.connect(filter.frequency);\n\t filters[i] = filter;\n\t }\n\t Tone.connectSeries.apply(Tone, filters);\n\t return filters;\n\t };\n\t /**\n\t\t * The number of octaves the phase goes above\n\t\t * the baseFrequency\n\t\t * @memberOf Tone.Phaser#\n\t\t * @type {Positive}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.Phaser.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octaves) {\n\t this._octaves = octaves;\n\t var max = this._baseFrequency * Math.pow(2, octaves);\n\t this._lfoL.max = max;\n\t this._lfoR.max = max;\n\t }\n\t });\n\t /**\n\t\t * The the base frequency of the filters.\n\t\t * @memberOf Tone.Phaser#\n\t\t * @type {number}\n\t\t * @name baseFrequency\n\t\t */\n\t Object.defineProperty(Tone.Phaser.prototype, 'baseFrequency', {\n\t get: function () {\n\t return this._baseFrequency;\n\t },\n\t set: function (freq) {\n\t this._baseFrequency = freq;\n\t this._lfoL.min = freq;\n\t this._lfoR.min = freq;\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Phaser} this\n\t\t */\n\t Tone.Phaser.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'Q'\n\t ]);\n\t this.Q.dispose();\n\t this.Q = null;\n\t this._lfoL.dispose();\n\t this._lfoL = null;\n\t this._lfoR.dispose();\n\t this._lfoR = null;\n\t for (var i = 0; i < this._filtersL.length; i++) {\n\t this._filtersL[i].disconnect();\n\t this._filtersL[i] = null;\n\t }\n\t this._filtersL = null;\n\t for (var j = 0; j < this._filtersR.length; j++) {\n\t this._filtersR[j].disconnect();\n\t this._filtersR[j] = null;\n\t }\n\t this._filtersR = null;\n\t this.frequency = null;\n\t return this;\n\t };\n\t return Tone.Phaser;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Just like a stereo feedback effect, but the feedback is routed from left to right\n\t\t * and right to left instead of on the same channel.\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t */\n\t Tone.StereoXFeedbackEffect = function () {\n\t var options = Tone.defaults(arguments, ['feedback'], Tone.FeedbackEffect);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * The amount of feedback from the output\n\t\t\t * back into the input of the effect (routed\n\t\t\t * across left and right channels).\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.feedback = new Tone.Signal(options.feedback, Tone.Type.NormalRange);\n\t /**\n\t\t\t * the left side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackLR = new Tone.Gain();\n\t /**\n\t\t\t * the right side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackRL = new Tone.Gain();\n\t //connect it up\n\t this.effectReturnL.chain(this._feedbackLR, this.effectSendR);\n\t this.effectReturnR.chain(this._feedbackRL, this.effectSendL);\n\t this.feedback.fan(this._feedbackLR.gain, this._feedbackRL.gain);\n\t this._readOnly(['feedback']);\n\t };\n\t Tone.extend(Tone.StereoXFeedbackEffect, Tone.StereoEffect);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.StereoXFeedbackEffect} this\n\t\t */\n\t Tone.StereoXFeedbackEffect.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable(['feedback']);\n\t this.feedback.dispose();\n\t this.feedback = null;\n\t this._feedbackLR.dispose();\n\t this._feedbackLR = null;\n\t this._feedbackRL.dispose();\n\t this._feedbackRL = null;\n\t return this;\n\t };\n\t return Tone.StereoXFeedbackEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PingPongDelay is a feedback delay effect where the echo is heard\n\t\t * first in one channel and next in the opposite channel. In a stereo\n\t\t * system these are the right and left channels.\n\t\t * PingPongDelay in more simplified terms is two Tone.FeedbackDelays\n\t\t * with independent delay values. Each delay is routed to one channel\n\t\t * (left or right), and the channel triggered second will always\n\t\t * trigger at the same interval after the first.\n\t\t *\n\t\t * \t@constructor\n\t\t * \t@extends {Tone.StereoXFeedbackEffect}\n\t\t * @param {Time|Object} [delayTime] The delayTime between consecutive echos.\n\t\t * @param {NormalRange=} feedback The amount of the effected signal which\n\t\t * is fed back through the delay.\n\t\t * @example\n\t\t * var pingPong = new Tone.PingPongDelay(\"4n\", 0.2).toMaster();\n\t\t * var drum = new Tone.DrumSynth().connect(pingPong);\n\t\t * drum.triggerAttackRelease(\"C4\", \"32n\");\n\t\t */\n\t Tone.PingPongDelay = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'delayTime',\n\t 'feedback'\n\t ], Tone.PingPongDelay);\n\t Tone.StereoXFeedbackEffect.call(this, options);\n\t /**\n\t\t\t * the delay node on the left side\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._leftDelay = new Tone.Delay(0, options.maxDelayTime);\n\t /**\n\t\t\t * the delay node on the right side\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._rightDelay = new Tone.Delay(0, options.maxDelayTime);\n\t /**\n\t\t\t * the predelay on the right side\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._rightPreDelay = new Tone.Delay(0, options.maxDelayTime);\n\t /**\n\t\t\t * the delay time signal\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = new Tone.Signal(options.delayTime, Tone.Type.Time);\n\t //connect it up\n\t this.effectSendL.chain(this._leftDelay, this.effectReturnL);\n\t this.effectSendR.chain(this._rightPreDelay, this._rightDelay, this.effectReturnR);\n\t this.delayTime.fan(this._leftDelay.delayTime, this._rightDelay.delayTime, this._rightPreDelay.delayTime);\n\t //rearranged the feedback to be after the rightPreDelay\n\t this._feedbackLR.disconnect();\n\t this._feedbackLR.connect(this._rightDelay);\n\t this._readOnly(['delayTime']);\n\t };\n\t Tone.extend(Tone.PingPongDelay, Tone.StereoXFeedbackEffect);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.PingPongDelay.defaults = {\n\t 'delayTime': 0.25,\n\t 'maxDelayTime': 1\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.PingPongDelay} this\n\t\t */\n\t Tone.PingPongDelay.prototype.dispose = function () {\n\t Tone.StereoXFeedbackEffect.prototype.dispose.call(this);\n\t this._leftDelay.dispose();\n\t this._leftDelay = null;\n\t this._rightDelay.dispose();\n\t this._rightDelay = null;\n\t this._rightPreDelay.dispose();\n\t this._rightPreDelay = null;\n\t this._writable(['delayTime']);\n\t this.delayTime.dispose();\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.PingPongDelay;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PitchShift does near-realtime pitch shifting to the incoming signal.\n\t\t * The effect is achieved by speeding up or slowing down the delayTime\n\t\t * of a DelayNode using a sawtooth wave.\n\t\t * Algorithm found in [this pdf](http://dsp-book.narod.ru/soundproc.pdf).\n\t\t * Additional reference by [Miller Pucket](http://msp.ucsd.edu/techniques/v0.11/book-html/node115.html).\n\t\t *\n\t\t * @extends {Tone.FeedbackEffect}\n\t\t * @param {Interval=} pitch The interval to transpose the incoming signal by.\n\t\t */\n\t Tone.PitchShift = function () {\n\t var options = Tone.defaults(arguments, ['pitch'], Tone.PitchShift);\n\t Tone.FeedbackEffect.call(this, options);\n\t /**\n\t\t\t * The pitch signal\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this._frequency = new Tone.Signal(0);\n\t /**\n\t\t\t * Uses two DelayNodes to cover up the jump in\n\t\t\t * the sawtooth wave.\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delayA = new Tone.Delay(0, 1);\n\t /**\n\t\t\t * The first LFO.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoA = new Tone.LFO({\n\t 'min': 0,\n\t 'max': 0.1,\n\t 'type': 'sawtooth'\n\t }).connect(this._delayA.delayTime);\n\t /**\n\t\t\t * The second DelayNode\n\t\t\t * @type {DelayNode}\n\t\t\t * @private\n\t\t\t */\n\t this._delayB = new Tone.Delay(0, 1);\n\t /**\n\t\t\t * The first LFO.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoB = new Tone.LFO({\n\t 'min': 0,\n\t 'max': 0.1,\n\t 'type': 'sawtooth',\n\t 'phase': 180\n\t }).connect(this._delayB.delayTime);\n\t /**\n\t\t\t * Crossfade quickly between the two delay lines\n\t\t\t * to cover up the jump in the sawtooth wave\n\t\t\t * @type {Tone.CrossFade}\n\t\t\t * @private\n\t\t\t */\n\t this._crossFade = new Tone.CrossFade();\n\t /**\n\t\t\t * LFO which alternates between the two\n\t\t\t * delay lines to cover up the disparity in the\n\t\t\t * sawtooth wave.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._crossFadeLFO = new Tone.LFO({\n\t 'min': 0,\n\t 'max': 1,\n\t 'type': 'triangle',\n\t 'phase': 90\n\t }).connect(this._crossFade.fade);\n\t /**\n\t\t\t * The delay node\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackDelay = new Tone.Delay(options.delayTime);\n\t /**\n\t\t\t * The amount of delay on the input signal\n\t\t\t * @type {Time}\n\t\t\t * @signal\n\t\t\t */\n\t this.delayTime = this._feedbackDelay.delayTime;\n\t this._readOnly('delayTime');\n\t /**\n\t\t\t * Hold the current pitch\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._pitch = options.pitch;\n\t /**\n\t\t\t * Hold the current windowSize\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._windowSize = options.windowSize;\n\t //connect the two delay lines up\n\t this._delayA.connect(this._crossFade.a);\n\t this._delayB.connect(this._crossFade.b);\n\t //connect the frequency\n\t this._frequency.fan(this._lfoA.frequency, this._lfoB.frequency, this._crossFadeLFO.frequency);\n\t //route the input\n\t this.effectSend.fan(this._delayA, this._delayB);\n\t this._crossFade.chain(this._feedbackDelay, this.effectReturn);\n\t //start the LFOs at the same time\n\t var now = this.now();\n\t this._lfoA.start(now);\n\t this._lfoB.start(now);\n\t this._crossFadeLFO.start(now);\n\t //set the initial value\n\t this.windowSize = this._windowSize;\n\t };\n\t Tone.extend(Tone.PitchShift, Tone.FeedbackEffect);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.PitchShift.defaults = {\n\t 'pitch': 0,\n\t 'windowSize': 0.1,\n\t 'delayTime': 0,\n\t 'feedback': 0\n\t };\n\t /**\n\t\t * Repitch the incoming signal by some interval (measured\n\t\t * in semi-tones).\n\t\t * @memberOf Tone.PitchShift#\n\t\t * @type {Interval}\n\t\t * @name pitch\n\t\t * @example\n\t\t * pitchShift.pitch = -12; //down one octave\n\t\t * pitchShift.pitch = 7; //up a fifth\n\t\t */\n\t Object.defineProperty(Tone.PitchShift.prototype, 'pitch', {\n\t get: function () {\n\t return this._pitch;\n\t },\n\t set: function (interval) {\n\t this._pitch = interval;\n\t var factor = 0;\n\t if (interval < 0) {\n\t this._lfoA.min = 0;\n\t this._lfoA.max = this._windowSize;\n\t this._lfoB.min = 0;\n\t this._lfoB.max = this._windowSize;\n\t factor = Tone.intervalToFrequencyRatio(interval - 1) + 1;\n\t } else {\n\t this._lfoA.min = this._windowSize;\n\t this._lfoA.max = 0;\n\t this._lfoB.min = this._windowSize;\n\t this._lfoB.max = 0;\n\t factor = Tone.intervalToFrequencyRatio(interval) - 1;\n\t }\n\t this._frequency.value = factor * (1.2 / this._windowSize);\n\t }\n\t });\n\t /**\n\t\t * The window size corresponds roughly to the sample length in a looping sampler.\n\t\t * Smaller values are desirable for a less noticeable delay time of the pitch shifted\n\t\t * signal, but larger values will result in smoother pitch shifting for larger intervals.\n\t\t * A nominal range of 0.03 to 0.1 is recommended.\n\t\t * @memberOf Tone.PitchShift#\n\t\t * @type {Time}\n\t\t * @name windowSize\n\t\t * @example\n\t\t * pitchShift.windowSize = 0.1;\n\t\t */\n\t Object.defineProperty(Tone.PitchShift.prototype, 'windowSize', {\n\t get: function () {\n\t return this._windowSize;\n\t },\n\t set: function (size) {\n\t this._windowSize = this.toSeconds(size);\n\t this.pitch = this._pitch;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.PitchShift} this\n\t\t */\n\t Tone.PitchShift.prototype.dispose = function () {\n\t Tone.FeedbackEffect.prototype.dispose.call(this);\n\t this._frequency.dispose();\n\t this._frequency = null;\n\t this._delayA.disconnect();\n\t this._delayA = null;\n\t this._delayB.disconnect();\n\t this._delayB = null;\n\t this._lfoA.dispose();\n\t this._lfoA = null;\n\t this._lfoB.dispose();\n\t this._lfoB = null;\n\t this._crossFade.dispose();\n\t this._crossFade = null;\n\t this._crossFadeLFO.dispose();\n\t this._crossFadeLFO = null;\n\t this._writable('delayTime');\n\t this._feedbackDelay.dispose();\n\t this._feedbackDelay = null;\n\t this.delayTime = null;\n\t return this;\n\t };\n\t return Tone.PitchShift;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Wrapper around the native BufferSourceNode.\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {AudioBuffer|Tone.Buffer} buffer The buffer to play\n\t\t * @param {Function} onload The callback to invoke when the\n\t\t * buffer is done playing.\n\t\t */\n\t Tone.BufferSource = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'buffer',\n\t 'onload'\n\t ], Tone.BufferSource);\n\t Tone.AudioNode.call(this, options);\n\t /**\n\t\t\t * The callback to invoke after the\n\t\t\t * buffer source is done playing.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.onended = options.onended;\n\t /**\n\t\t\t * The time that the buffer was started.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._startTime = -1;\n\t /**\n\t\t\t * An additional flag if the actual BufferSourceNode\n\t\t\t * has been started. b/c stopping an unstarted buffer\n\t\t\t * will throw it into an invalid state\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._sourceStarted = false;\n\t /**\n\t\t\t * Flag if the source has already been stopped\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._sourceStopped = false;\n\t /**\n\t\t\t * The time that the buffer is scheduled to stop.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._stopTime = -1;\n\t /**\n\t\t\t * The gain node which envelopes the BufferSource\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gainNode = this.output = new Tone.Gain();\n\t /**\n\t\t\t * The buffer source\n\t\t\t * @type {AudioBufferSourceNode}\n\t\t\t * @private\n\t\t\t */\n\t this._source = this.context.createBufferSource();\n\t this._source.connect(this._gainNode);\n\t this._source.onended = this._onended.bind(this);\n\t /**\n\t\t\t * The private buffer instance\n\t\t\t * @type {Tone.Buffer}\n\t\t\t * @private\n\t\t\t */\n\t this._buffer = new Tone.Buffer(options.buffer, options.onload);\n\t /**\n\t\t\t * The playbackRate of the buffer\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.playbackRate = new Tone.Param(this._source.playbackRate, Tone.Type.Positive);\n\t /**\n\t\t\t * The fadeIn time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeIn = options.fadeIn;\n\t /**\n\t\t\t * The fadeOut time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeOut = options.fadeOut;\n\t /**\n\t\t\t * The curve applied to the fades, either \"linear\" or \"exponential\"\n\t\t\t * @type {String}\n\t\t\t */\n\t this.curve = options.curve;\n\t /**\n\t\t\t * The value that the buffer ramps to\n\t\t\t * @type {Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._gain = 1;\n\t /**\n\t\t\t * The onended timeout\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._onendedTimeout = -1;\n\t //set some values initially\n\t this.loop = options.loop;\n\t this.loopStart = options.loopStart;\n\t this.loopEnd = options.loopEnd;\n\t this.playbackRate.value = options.playbackRate;\n\t };\n\t Tone.extend(Tone.BufferSource, Tone.AudioNode);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.BufferSource.defaults = {\n\t 'onended': Tone.noOp,\n\t 'onload': Tone.noOp,\n\t 'loop': false,\n\t 'loopStart': 0,\n\t 'loopEnd': 0,\n\t 'fadeIn': 0,\n\t 'fadeOut': 0,\n\t 'curve': 'linear',\n\t 'playbackRate': 1\n\t };\n\t /**\n\t\t * Returns the playback state of the source, either \"started\" or \"stopped\".\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'state', {\n\t get: function () {\n\t return this.getStateAtTime(this.now());\n\t }\n\t });\n\t /**\n\t\t * Get the playback state at the given time\n\t\t * @param {Time} time The time to test the state at\n\t\t * @return {Tone.State} The playback state. \n\t\t */\n\t Tone.BufferSource.prototype.getStateAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t if (this._startTime !== -1 && time >= this._startTime && !this._sourceStopped) {\n\t return Tone.State.Started;\n\t } else {\n\t return Tone.State.Stopped;\n\t }\n\t };\n\t /**\n\t\t * Start the buffer\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @param {Gain} [gain=1] The gain to play the buffer back at.\n\t\t * @param {Time=} fadeInTime The optional fadeIn ramp time.\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.start = function (time, offset, duration, gain, fadeInTime) {\n\t if (this._startTime !== -1) {\n\t throw new Error('Tone.BufferSource can only be started once.');\n\t }\n\t if (!this.buffer.loaded) {\n\t throw new Error('Tone.BufferSource: buffer is either not set or not loaded.');\n\t }\n\t time = this.toSeconds(time);\n\t //if it's a loop the default offset is the loopstart point\n\t if (this.loop) {\n\t offset = Tone.defaultArg(offset, this.loopStart);\n\t } else {\n\t //otherwise the default offset is 0\n\t offset = Tone.defaultArg(offset, 0);\n\t }\n\t offset = this.toSeconds(offset);\n\t gain = Tone.defaultArg(gain, 1);\n\t this._gain = gain;\n\t fadeInTime = this.toSeconds(Tone.defaultArg(fadeInTime, this.fadeIn));\n\t this.fadeIn = fadeInTime;\n\t if (fadeInTime > 0) {\n\t this._gainNode.gain.setValueAtTime(0, time);\n\t if (this.curve === 'linear') {\n\t this._gainNode.gain.linearRampToValueAtTime(this._gain, time + fadeInTime);\n\t } else {\n\t this._gainNode.gain.exponentialApproachValueAtTime(this._gain, time, fadeInTime);\n\t }\n\t } else {\n\t this._gainNode.gain.setValueAtTime(gain, time);\n\t }\n\t this._startTime = time;\n\t var computedDur = this.toSeconds(Tone.defaultArg(duration, this.buffer.duration - offset % this.buffer.duration));\n\t computedDur = Math.max(computedDur, 0);\n\t if (Tone.isDefined(duration)) {\n\t //clip the duration when not looping\n\t if (!this.loop) {\n\t computedDur = Math.min(computedDur, this.buffer.duration - offset % this.buffer.duration);\n\t }\n\t this.stop(time + computedDur, this.fadeOut);\n\t }\n\t //start the buffer source\n\t if (this.loop) {\n\t //modify the offset if it's greater than the loop time\n\t var loopEnd = this.loopEnd || this.buffer.duration;\n\t var loopStart = this.loopStart;\n\t var loopDuration = loopEnd - loopStart;\n\t //move the offset back\n\t if (offset >= loopEnd) {\n\t offset = (offset - loopStart) % loopDuration + loopStart;\n\t }\n\t }\n\t this._source.buffer = this.buffer.get();\n\t this._source.loopEnd = this.loopEnd || this.buffer.duration;\n\t if (offset < this.buffer.duration) {\n\t this._sourceStarted = true;\n\t this._source.start(time, offset);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the buffer. Optionally add a ramp time to fade the\n\t\t * buffer out.\n\t\t * @param {Time=} time The time the buffer should stop.\n\t\t * @param {Time=} fadeOutTime How long the gain should fade out for\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.stop = function (time, fadeOutTime) {\n\t if (!this.buffer.loaded) {\n\t throw new Error('Tone.BufferSource: buffer is either not set or not loaded.');\n\t }\n\t if (this._sourceStopped) {\n\t return;\n\t }\n\t time = this.toSeconds(time);\n\t //if the event has already been scheduled, clear it\n\t if (this._stopTime !== -1) {\n\t this.cancelStop();\n\t }\n\t //stop if it's schedule before the start time\n\t if (time <= this._startTime) {\n\t this._gainNode.gain.cancelScheduledValues(time);\n\t this._gainNode.gain.value = 0;\n\t return this;\n\t }\n\t time = Math.max(this._startTime + this.fadeIn + this.sampleTime, time);\n\t //cancel the previous curve\n\t this._gainNode.gain.cancelScheduledValues(time);\n\t this._stopTime = time;\n\t //the fadeOut time\n\t fadeOutTime = this.toSeconds(Tone.defaultArg(fadeOutTime, this.fadeOut));\n\t var heldDuration = time - this._startTime - this.fadeIn - this.sampleTime;\n\t if (!this.loop) {\n\t //make sure the fade does not go beyond the length of the buffer\n\t heldDuration = Math.min(heldDuration, this.buffer.duration);\n\t }\n\t fadeOutTime = Math.min(heldDuration, fadeOutTime);\n\t var startFade = time - fadeOutTime;\n\t if (fadeOutTime > this.sampleTime) {\n\t this._gainNode.gain.setValueAtTime(this._gain, startFade);\n\t if (this.curve === 'linear') {\n\t this._gainNode.gain.linearRampToValueAtTime(0, time);\n\t } else {\n\t this._gainNode.gain.exponentialApproachValueAtTime(0, startFade, fadeOutTime);\n\t }\n\t } else {\n\t this._gainNode.gain.setValueAtTime(0, time);\n\t }\n\t Tone.context.clearTimeout(this._onendedTimeout);\n\t this._onendedTimeout = Tone.context.setTimeout(this._onended.bind(this), this._stopTime - this.now());\n\t return this;\n\t };\n\t /**\n\t\t * Cancel a scheduled stop event\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.cancelStop = function () {\n\t if (this._startTime !== -1 && !this._sourceStopped) {\n\t //cancel the stop envelope\n\t var fadeInTime = this.toSeconds(this.fadeIn);\n\t this._gainNode.gain.cancelScheduledValues(this._startTime + fadeInTime + this.sampleTime);\n\t this._gainNode.gain.setValueAtTime(1, Math.max(this.now(), this._startTime + fadeInTime + this.sampleTime));\n\t this.context.clearTimeout(this._onendedTimeout);\n\t this._stopTime = -1;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Internal callback when the buffer is ended.\n\t\t * Invokes `onended` and disposes the node.\n\t\t * @private\n\t\t */\n\t Tone.BufferSource.prototype._onended = function () {\n\t if (!this._sourceStopped) {\n\t this._sourceStopped = true;\n\t //allow additional time for the exponential curve to fully decay\n\t var additionalTail = this.curve === 'exponential' ? this.fadeOut * 2 : 0;\n\t if (this._sourceStarted && this._stopTime !== -1) {\n\t this._source.stop(this._stopTime + additionalTail);\n\t }\n\t this.onended(this);\n\t }\n\t };\n\t /**\n\t\t * If loop is true, the loop will start at this position.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'loopStart', {\n\t get: function () {\n\t return this._source.loopStart;\n\t },\n\t set: function (loopStart) {\n\t this._source.loopStart = this.toSeconds(loopStart);\n\t }\n\t });\n\t /**\n\t\t * If loop is true, the loop will end at this position.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'loopEnd', {\n\t get: function () {\n\t return this._source.loopEnd;\n\t },\n\t set: function (loopEnd) {\n\t this._source.loopEnd = this.toSeconds(loopEnd);\n\t }\n\t });\n\t /**\n\t\t * The audio buffer belonging to the player.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Tone.Buffer}\n\t\t * @name buffer\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'buffer', {\n\t get: function () {\n\t return this._buffer;\n\t },\n\t set: function (buffer) {\n\t this._buffer.set(buffer);\n\t }\n\t });\n\t /**\n\t\t * If the buffer should loop once it's over.\n\t\t * @memberOf Tone.BufferSource#\n\t\t * @type {Boolean}\n\t\t * @name loop\n\t\t */\n\t Object.defineProperty(Tone.BufferSource.prototype, 'loop', {\n\t get: function () {\n\t return this._source.loop;\n\t },\n\t set: function (loop) {\n\t this._source.loop = loop;\n\t this.cancelStop();\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.BufferSource} this\n\t\t */\n\t Tone.BufferSource.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.onended = null;\n\t this._source.onended = null;\n\t this._source.disconnect();\n\t this._source = null;\n\t this._gainNode.dispose();\n\t this._gainNode = null;\n\t this._buffer.dispose();\n\t this._buffer = null;\n\t this._startTime = -1;\n\t this.playbackRate = null;\n\t Tone.context.clearTimeout(this._onendedTimeout);\n\t return this;\n\t };\n\t return Tone.BufferSource;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Noise is a noise generator. It uses looped noise buffers to save on performance.\n\t\t * Tone.Noise supports the noise types: \"pink\", \"white\", and \"brown\". Read more about\n\t\t * colors of noise on [Wikipedia](https://en.wikipedia.org/wiki/Colors_of_noise).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {string} type the noise type (white|pink|brown)\n\t\t * @example\n\t\t * //initialize the noise and start\n\t\t * var noise = new Tone.Noise(\"pink\").start();\n\t\t *\n\t\t * //make an autofilter to shape the noise\n\t\t * var autoFilter = new Tone.AutoFilter({\n\t\t * \t\"frequency\" : \"8m\",\n\t\t * \t\"min\" : 800,\n\t\t * \t\"max\" : 15000\n\t\t * }).connect(Tone.Master);\n\t\t *\n\t\t * //connect the noise\n\t\t * noise.connect(autoFilter);\n\t\t * //start the autofilter LFO\n\t\t * autoFilter.start()\n\t\t */\n\t Tone.Noise = function () {\n\t var options = Tone.defaults(arguments, ['type'], Tone.Noise);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * @private\n\t\t\t * @type {AudioBufferSourceNode}\n\t\t\t */\n\t this._source = null;\n\t /**\n\t\t\t * the buffer\n\t\t\t * @private\n\t\t\t * @type {AudioBuffer}\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * The playback rate of the noise. Affects\n\t\t\t * the \"frequency\" of the noise.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this._playbackRate = options.playbackRate;\n\t };\n\t Tone.extend(Tone.Noise, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t *\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Noise.defaults = {\n\t 'type': 'white',\n\t 'playbackRate': 1\n\t };\n\t /**\n\t\t * The type of the noise. Can be \"white\", \"brown\", or \"pink\".\n\t\t * @memberOf Tone.Noise#\n\t\t * @type {string}\n\t\t * @name type\n\t\t * @example\n\t\t * noise.type = \"white\";\n\t\t */\n\t Object.defineProperty(Tone.Noise.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t if (this._type !== type) {\n\t if (type in _noiseBuffers) {\n\t this._type = type;\n\t //if it's playing, stop and restart it\n\t if (this.state === Tone.State.Started) {\n\t var now = this.now();\n\t this._stop(now);\n\t this._start(now);\n\t }\n\t } else {\n\t throw new TypeError('Tone.Noise: invalid type: ' + type);\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * The playback rate of the noise. Affects\n\t\t * the \"frequency\" of the noise.\n\t\t * @type {Positive}\n\t\t * @signal\n\t\t */\n\t Object.defineProperty(Tone.Noise.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t if (this._source) {\n\t this._source.playbackRate.value = rate;\n\t }\n\t }\n\t });\n\t /**\n\t\t * internal start method\n\t\t *\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.Noise.prototype._start = function (time) {\n\t var buffer = _noiseBuffers[this._type];\n\t this._source = new Tone.BufferSource(buffer).connect(this.output);\n\t this._source.loop = true;\n\t this._source.playbackRate.value = this._playbackRate;\n\t this._source.start(this.toSeconds(time), Math.random() * (buffer.duration - 0.001));\n\t };\n\t /**\n\t\t * internal stop method\n\t\t *\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.Noise.prototype._stop = function (time) {\n\t if (this._source) {\n\t this._source.stop(this.toSeconds(time));\n\t this._source = null;\n\t }\n\t };\n\t /**\n\t\t * Restarts the noise.\n\t\t * @param {[type]} time [description]\n\t\t * @return {[type]} [description]\n\t\t */\n\t Tone.Noise.prototype.restart = function (time) {\n\t //TODO could be optimized by cancelling the buffer source 'stop'\n\t //stop and restart\n\t this._stop(time);\n\t this._start(time);\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Noise} this\n\t\t */\n\t Tone.Noise.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t if (this._source !== null) {\n\t this._source.disconnect();\n\t this._source = null;\n\t }\n\t this._buffer = null;\n\t return this;\n\t };\n\t ///////////////////////////////////////////////////////////////////////////\n\t // THE BUFFERS\n\t ///////////////////////////////////////////////////////////////////////////\n\t //Noise buffer stats\n\t var bufferLength = 44100 * 5;\n\t var channels = 2;\n\t /**\n\t\t *\tThe noise arrays. Generated on initialization.\n\t\t * borrowed heavily from https://github.com/zacharydenton/noise.js\n\t\t * (c) 2013 Zach Denton (MIT)\n\t\t * @static\n\t\t * @private\n\t\t * @type {Array}\n\t\t */\n\t var _noiseArrays = {\n\t 'pink': function () {\n\t var buffer = [];\n\t for (var channelNum = 0; channelNum < channels; channelNum++) {\n\t var channel = new Float32Array(bufferLength);\n\t buffer[channelNum] = channel;\n\t var b0, b1, b2, b3, b4, b5, b6;\n\t b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0;\n\t for (var i = 0; i < bufferLength; i++) {\n\t var white = Math.random() * 2 - 1;\n\t b0 = 0.99886 * b0 + white * 0.0555179;\n\t b1 = 0.99332 * b1 + white * 0.0750759;\n\t b2 = 0.969 * b2 + white * 0.153852;\n\t b3 = 0.8665 * b3 + white * 0.3104856;\n\t b4 = 0.55 * b4 + white * 0.5329522;\n\t b5 = -0.7616 * b5 - white * 0.016898;\n\t channel[i] = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362;\n\t channel[i] *= 0.11;\n\t // (roughly) compensate for gain\n\t b6 = white * 0.115926;\n\t }\n\t }\n\t return buffer;\n\t }(),\n\t 'brown': function () {\n\t var buffer = [];\n\t for (var channelNum = 0; channelNum < channels; channelNum++) {\n\t var channel = new Float32Array(bufferLength);\n\t buffer[channelNum] = channel;\n\t var lastOut = 0;\n\t for (var i = 0; i < bufferLength; i++) {\n\t var white = Math.random() * 2 - 1;\n\t channel[i] = (lastOut + 0.02 * white) / 1.02;\n\t lastOut = channel[i];\n\t channel[i] *= 3.5; // (roughly) compensate for gain\n\t }\n\t }\n\t return buffer;\n\t }(),\n\t 'white': function () {\n\t var buffer = [];\n\t for (var channelNum = 0; channelNum < channels; channelNum++) {\n\t var channel = new Float32Array(bufferLength);\n\t buffer[channelNum] = channel;\n\t for (var i = 0; i < bufferLength; i++) {\n\t channel[i] = Math.random() * 2 - 1;\n\t }\n\t }\n\t return buffer;\n\t }()\n\t };\n\t /**\n\t\t *\tstatic noise buffers\n\t\t * @static\n\t\t * @private\n\t\t * @type {Tone.Buffer}\n\t\t */\n\t var _noiseBuffers = {};\n\t //create the Tone.Buffers\n\t function createBuffers() {\n\t for (var type in _noiseArrays) {\n\t _noiseBuffers[type] = new Tone.Buffer().fromArray(_noiseArrays[type]);\n\t }\n\t }\n\t //create the noise buffers\n\t Tone.getContext(createBuffers);\n\t Tone.Context.on('init', createBuffers);\n\t return Tone.Noise;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Simple convolution created with decaying noise.\n\t\t * \t\tGenerates an Impulse Response Buffer\n\t\t * \t\t\twith Tone.Offline then feeds the IR into ConvolverNode.\n\t\t * \t\t\tNote: the Reverb will not make any sound until [generate](#generate)\n\t\t * \t\t\thas been invoked and resolved.\n\t\t *\n\t\t * \t\t\tInspiration from [ReverbGen](https://github.com/adelespinasse/reverbGen).\n\t\t * \t\t\tCopyright (c) 2014 Alan deLespinasse Apache 2.0 License.\n\t\t *\n\t\t * @extends {Tone.Convolver}\n\t\t * @param {Time=} decay The amount of time it will reverberate for.\n\t\t */\n\t Tone.Reverb = function () {\n\t var options = Tone.defaults(arguments, ['decay'], Tone.Reverb);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * Convolver node\n\t\t\t * @type {ConvolverNode}\n\t\t\t * @private\n\t\t\t */\n\t this._convolver = this.context.createConvolver();\n\t /**\n\t\t\t * The duration of the reverb\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.decay = options.decay;\n\t /**\n\t\t\t * The amount of time before the reverb is fully\n\t\t\t * ramped in.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.preDelay = options.preDelay;\n\t this.connectEffect(this._convolver);\n\t };\n\t Tone.extend(Tone.Reverb, Tone.Effect);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @static\n\t\t */\n\t Tone.Reverb.defaults = {\n\t 'decay': 1.5,\n\t 'preDelay': 0.01\n\t };\n\t /**\n\t\t * Generate the Impulse Response. Returns a promise while the IR is being\n\t\t * generated.\n\t\t * @return {Promise<Tone.Reverb>} Promise which returns this object.\n\t\t */\n\t Tone.Reverb.prototype.generate = function () {\n\t return Tone.Offline(function () {\n\t //create a noise burst which decays over the duration\n\t var noiseL = new Tone.Noise();\n\t var noiseR = new Tone.Noise();\n\t var merge = new Tone.Merge();\n\t noiseL.connect(merge.left);\n\t noiseR.connect(merge.right);\n\t var gainNode = new Tone.Gain().toMaster();\n\t merge.connect(gainNode);\n\t noiseL.start(0);\n\t noiseR.start(0);\n\t //short fade in\n\t gainNode.gain.setValueAtTime(0, 0);\n\t gainNode.gain.linearRampToValueAtTime(1, this.preDelay);\n\t //decay\n\t gainNode.gain.exponentialApproachValueAtTime(0, this.preDelay, this.decay - this.preDelay);\n\t }.bind(this), this.decay).then(function (buffer) {\n\t this._convolver.buffer = buffer.get();\n\t return this;\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Reverb} this\n\t\t */\n\t Tone.Reverb.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._convolver.disconnect();\n\t this._convolver = null;\n\t return this;\n\t };\n\t return Tone.Reverb;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base class for stereo feedback effects where the effectReturn\n\t\t * is fed back into the same channel.\n\t\t *\n\t\t *\t@constructor\n\t\t *\t@extends {Tone.StereoEffect}\n\t\t */\n\t Tone.StereoFeedbackEffect = function () {\n\t var options = Tone.defaults(arguments, ['feedback'], Tone.FeedbackEffect);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * controls the amount of feedback\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.feedback = new Tone.Signal(options.feedback, Tone.Type.NormalRange);\n\t /**\n\t\t\t * the left side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackL = new Tone.Gain();\n\t /**\n\t\t\t * the right side feeback\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._feedbackR = new Tone.Gain();\n\t //connect it up\n\t this.effectReturnL.chain(this._feedbackL, this.effectSendL);\n\t this.effectReturnR.chain(this._feedbackR, this.effectSendR);\n\t this.feedback.fan(this._feedbackL.gain, this._feedbackR.gain);\n\t this._readOnly(['feedback']);\n\t };\n\t Tone.extend(Tone.StereoFeedbackEffect, Tone.StereoEffect);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.StereoFeedbackEffect} this\n\t\t */\n\t Tone.StereoFeedbackEffect.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable(['feedback']);\n\t this.feedback.dispose();\n\t this.feedback = null;\n\t this._feedbackL.dispose();\n\t this._feedbackL = null;\n\t this._feedbackR.dispose();\n\t this._feedbackR = null;\n\t return this;\n\t };\n\t return Tone.StereoFeedbackEffect;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Applies a width factor to the mid/side seperation.\n\t\t * 0 is all mid and 1 is all side.\n\t\t * Algorithm found in [kvraudio forums](http://www.kvraudio.com/forum/viewtopic.php?t=212587).\n\t\t * <br><br>\n\t\t * <code>\n\t\t * Mid *= 2*(1-width)<br>\n\t\t * Side *= 2*width\n\t\t * </code>\n\t\t *\n\t\t * @extends {Tone.MidSideEffect}\n\t\t * @constructor\n\t\t * @param {NormalRange|Object} [width] The stereo width. A width of 0 is mono and 1 is stereo. 0.5 is no change.\n\t\t */\n\t Tone.StereoWidener = function () {\n\t var options = Tone.defaults(arguments, ['width'], Tone.StereoWidener);\n\t Tone.MidSideEffect.call(this, options);\n\t /**\n\t\t\t * The width control. 0 = 100% mid. 1 = 100% side. 0.5 = no change.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.width = new Tone.Signal(options.width, Tone.Type.NormalRange);\n\t this._readOnly(['width']);\n\t /**\n\t\t\t * Two times the (1-width) for the mid channel\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._twoTimesWidthMid = new Tone.Multiply(2);\n\t /**\n\t\t\t * Two times the width for the side channel\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._twoTimesWidthSide = new Tone.Multiply(2);\n\t /**\n\t\t\t * Mid multiplier\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._midMult = new Tone.Multiply();\n\t this._twoTimesWidthMid.connect(this._midMult, 0, 1);\n\t this.midSend.chain(this._midMult, this.midReturn);\n\t /**\n\t\t\t * 1 - width\n\t\t\t * @type {Tone}\n\t\t\t */\n\t this._oneMinusWidth = new Tone.Subtract();\n\t this._oneMinusWidth.connect(this._twoTimesWidthMid);\n\t this.context.getConstant(1).connect(this._oneMinusWidth, 0, 0);\n\t this.width.connect(this._oneMinusWidth, 0, 1);\n\t /**\n\t\t\t * Side multiplier\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._sideMult = new Tone.Multiply();\n\t this.width.connect(this._twoTimesWidthSide);\n\t this._twoTimesWidthSide.connect(this._sideMult, 0, 1);\n\t this.sideSend.chain(this._sideMult, this.sideReturn);\n\t };\n\t Tone.extend(Tone.StereoWidener, Tone.MidSideEffect);\n\t /**\n\t\t * the default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.StereoWidener.defaults = { 'width': 0.5 };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.StereoWidener} this\n\t\t */\n\t Tone.StereoWidener.prototype.dispose = function () {\n\t Tone.MidSideEffect.prototype.dispose.call(this);\n\t this._writable(['width']);\n\t this.width.dispose();\n\t this.width = null;\n\t this._midMult.dispose();\n\t this._midMult = null;\n\t this._sideMult.dispose();\n\t this._sideMult = null;\n\t this._twoTimesWidthMid.dispose();\n\t this._twoTimesWidthMid = null;\n\t this._twoTimesWidthSide.dispose();\n\t this._twoTimesWidthSide = null;\n\t this._oneMinusWidth.dispose();\n\t this._oneMinusWidth = null;\n\t return this;\n\t };\n\t return Tone.StereoWidener;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Tremolo modulates the amplitude of an incoming signal using a Tone.LFO.\n\t\t * The type, frequency, and depth of the LFO is controllable.\n\t\t *\n\t\t * @extends {Tone.StereoEffect}\n\t\t * @constructor\n\t\t * @param {Frequency} [frequency] The rate of the effect.\n\t\t * @param {NormalRange} [depth] The depth of the effect.\n\t\t * @example\n\t\t * //create a tremolo and start it's LFO\n\t\t * var tremolo = new Tone.Tremolo(9, 0.75).toMaster().start();\n\t\t * //route an oscillator through the tremolo and start it\n\t\t * var oscillator = new Tone.Oscillator().connect(tremolo).start();\n\t\t */\n\t Tone.Tremolo = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'depth'\n\t ], Tone.Tremolo);\n\t Tone.StereoEffect.call(this, options);\n\t /**\n\t\t\t * The tremelo LFO in the left channel\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoL = new Tone.LFO({\n\t 'phase': options.spread,\n\t 'min': 1,\n\t 'max': 0\n\t });\n\t /**\n\t\t\t * The tremelo LFO in the left channel\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfoR = new Tone.LFO({\n\t 'phase': options.spread,\n\t 'min': 1,\n\t 'max': 0\n\t });\n\t /**\n\t\t\t * Where the gain is multiplied\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._amplitudeL = new Tone.Gain();\n\t /**\n\t\t\t * Where the gain is multiplied\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._amplitudeR = new Tone.Gain();\n\t /**\n\t\t\t * The frequency of the tremolo.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The depth of the effect. A depth of 0, has no effect\n\t\t\t * on the amplitude, and a depth of 1 makes the amplitude\n\t\t\t * modulate fully between 0 and 1.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = new Tone.Signal(options.depth, Tone.Type.NormalRange);\n\t this._readOnly([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.effectSendL.chain(this._amplitudeL, this.effectReturnL);\n\t this.effectSendR.chain(this._amplitudeR, this.effectReturnR);\n\t this._lfoL.connect(this._amplitudeL.gain);\n\t this._lfoR.connect(this._amplitudeR.gain);\n\t this.frequency.fan(this._lfoL.frequency, this._lfoR.frequency);\n\t this.depth.fan(this._lfoR.amplitude, this._lfoL.amplitude);\n\t this.type = options.type;\n\t this.spread = options.spread;\n\t };\n\t Tone.extend(Tone.Tremolo, Tone.StereoEffect);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Tremolo.defaults = {\n\t 'frequency': 10,\n\t 'type': 'sine',\n\t 'depth': 0.5,\n\t 'spread': 180\n\t };\n\t /**\n\t\t * Start the tremolo.\n\t\t * @param {Time} [time=now] When the tremolo begins.\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.start = function (time) {\n\t this._lfoL.start(time);\n\t this._lfoR.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the tremolo.\n\t\t * @param {Time} [time=now] When the tremolo stops.\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.stop = function (time) {\n\t this._lfoL.stop(time);\n\t this._lfoR.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the effect to the transport.\n\t\t * @param {Time} [delay=0] Delay time before starting the effect after the\n\t\t * Transport has started.\n\t\t * @returns {Tone.AutoFilter} this\n\t\t */\n\t Tone.Tremolo.prototype.sync = function (delay) {\n\t this._lfoL.sync(delay);\n\t this._lfoR.sync(delay);\n\t Tone.Transport.syncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * Unsync the filter from the transport\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.unsync = function () {\n\t this._lfoL.unsync();\n\t this._lfoR.unsync();\n\t Tone.Transport.unsyncSignal(this.frequency);\n\t return this;\n\t };\n\t /**\n\t\t * The Tremolo's oscillator type.\n\t\t * @memberOf Tone.Tremolo#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Tremolo.prototype, 'type', {\n\t get: function () {\n\t return this._lfoL.type;\n\t },\n\t set: function (type) {\n\t this._lfoL.type = type;\n\t this._lfoR.type = type;\n\t }\n\t });\n\t /**\n\t\t * Amount of stereo spread. When set to 0, both LFO's will be panned centrally.\n\t\t * When set to 180, LFO's will be panned hard left and right respectively.\n\t\t * @memberOf Tone.Tremolo#\n\t\t * @type {Degrees}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.Tremolo.prototype, 'spread', {\n\t get: function () {\n\t return this._lfoR.phase - this._lfoL.phase; //180\n\t },\n\t set: function (spread) {\n\t this._lfoL.phase = 90 - spread / 2;\n\t this._lfoR.phase = spread / 2 + 90;\n\t }\n\t });\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Tremolo} this\n\t\t */\n\t Tone.Tremolo.prototype.dispose = function () {\n\t Tone.StereoEffect.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this._lfoL.dispose();\n\t this._lfoL = null;\n\t this._lfoR.dispose();\n\t this._lfoR = null;\n\t this._amplitudeL.dispose();\n\t this._amplitudeL = null;\n\t this._amplitudeR.dispose();\n\t this._amplitudeR = null;\n\t this.frequency = null;\n\t this.depth = null;\n\t return this;\n\t };\n\t return Tone.Tremolo;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A Vibrato effect composed of a Tone.Delay and a Tone.LFO. The LFO\n\t\t * modulates the delayTime of the delay, causing the pitch to rise\n\t\t * and fall. \n\t\t * @extends {Tone.Effect}\n\t\t * @param {Frequency} frequency The frequency of the vibrato.\n\t\t * @param {NormalRange} depth The amount the pitch is modulated.\n\t\t */\n\t Tone.Vibrato = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'depth'\n\t ], Tone.Vibrato);\n\t Tone.Effect.call(this, options);\n\t /**\n\t\t\t * The delay node used for the vibrato effect\n\t\t\t * @type {Tone.Delay}\n\t\t\t * @private\n\t\t\t */\n\t this._delayNode = new Tone.Delay(0, options.maxDelay);\n\t /**\n\t\t\t * The LFO used to control the vibrato\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._lfo = new Tone.LFO({\n\t 'type': options.type,\n\t 'min': 0,\n\t 'max': options.maxDelay,\n\t 'frequency': options.frequency,\n\t 'phase': -90 //offse the phase so the resting position is in the center\n\t }).start().connect(this._delayNode.delayTime);\n\t /**\n\t\t\t * The frequency of the vibrato\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._lfo.frequency;\n\t /**\n\t\t\t * The depth of the vibrato. \n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.depth = this._lfo.amplitude;\n\t this.depth.value = options.depth;\n\t this._readOnly([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.effectSend.chain(this._delayNode, this.effectReturn);\n\t };\n\t Tone.extend(Tone.Vibrato, Tone.Effect);\n\t /**\n\t\t * The defaults\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Vibrato.defaults = {\n\t 'maxDelay': 0.005,\n\t 'frequency': 5,\n\t 'depth': 0.1,\n\t 'type': 'sine'\n\t };\n\t /**\n\t\t * Type of oscillator attached to the Vibrato.\n\t\t * @memberOf Tone.Vibrato#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.Vibrato.prototype, 'type', {\n\t get: function () {\n\t return this._lfo.type;\n\t },\n\t set: function (type) {\n\t this._lfo.type = type;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.Vibrato} this\n\t\t */\n\t Tone.Vibrato.prototype.dispose = function () {\n\t Tone.Effect.prototype.dispose.call(this);\n\t this._delayNode.dispose();\n\t this._delayNode = null;\n\t this._lfo.dispose();\n\t this._lfo = null;\n\t this._writable([\n\t 'frequency',\n\t 'depth'\n\t ]);\n\t this.frequency = null;\n\t this.depth = null;\n\t };\n\t return Tone.Vibrato;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Event abstracts away Tone.Transport.schedule and provides a schedulable\n\t\t * callback for a single or repeatable events along the timeline.\n\t\t *\n\t\t * @extends {Tone}\n\t\t * @param {function} callback The callback to invoke at the time.\n\t\t * @param {*} value The value or values which should be passed to\n\t\t * the callback function on invocation.\n\t\t * @example\n\t\t * var chord = new Tone.Event(function(time, chord){\n\t\t * \t//the chord as well as the exact time of the event\n\t\t * \t//are passed in as arguments to the callback function\n\t\t * }, [\"D4\", \"E4\", \"F4\"]);\n\t\t * //start the chord at the beginning of the transport timeline\n\t\t * chord.start();\n\t\t * //loop it every measure for 8 measures\n\t\t * chord.loop = 8;\n\t\t * chord.loopEnd = \"1m\";\n\t\t */\n\t Tone.Event = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'value'\n\t ], Tone.Event);\n\t Tone.call(this);\n\t /**\n\t\t\t * Loop value\n\t\t\t * @type {Boolean|Positive}\n\t\t\t * @private\n\t\t\t */\n\t this._loop = options.loop;\n\t /**\n\t\t\t * The callback to invoke.\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t /**\n\t\t\t * The value which is passed to the\n\t\t\t * callback function.\n\t\t\t * @type {*}\n\t\t\t * @private\n\t\t\t */\n\t this.value = options.value;\n\t /**\n\t\t\t * When the note is scheduled to start.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopStart = this.toTicks(options.loopStart);\n\t /**\n\t\t\t * When the note is scheduled to start.\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopEnd = this.toTicks(options.loopEnd);\n\t /**\n\t\t\t * Tracks the scheduled events\n\t\t\t * @type {Tone.TimelineState}\n\t\t\t * @private\n\t\t\t */\n\t this._state = new Tone.TimelineState(Tone.State.Stopped);\n\t /**\n\t\t\t * The playback speed of the note. A speed of 1\n\t\t\t * is no change.\n\t\t\t * @private\n\t\t\t * @type {Positive}\n\t\t\t */\n\t this._playbackRate = 1;\n\t /**\n\t\t\t * A delay time from when the event is scheduled to start\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._startOffset = 0;\n\t /**\n\t\t\t * private holder of probability value\n\t\t\t * @type {NormalRange}\n\t\t\t * @private\n\t\t\t */\n\t this._probability = options.probability;\n\t /**\n\t\t\t * the amount of variation from the\n\t\t\t * given time.\n\t\t\t * @type {Boolean|Time}\n\t\t\t * @private\n\t\t\t */\n\t this._humanize = options.humanize;\n\t /**\n\t\t\t * If mute is true, the callback won't be\n\t\t\t * invoked.\n\t\t\t * @type {Boolean}\n\t\t\t */\n\t this.mute = options.mute;\n\t //set the initial values\n\t this.playbackRate = options.playbackRate;\n\t };\n\t Tone.extend(Tone.Event);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Event.defaults = {\n\t 'callback': Tone.noOp,\n\t 'loop': false,\n\t 'loopEnd': '1m',\n\t 'loopStart': 0,\n\t 'playbackRate': 1,\n\t 'value': null,\n\t 'probability': 1,\n\t 'mute': false,\n\t 'humanize': false\n\t };\n\t /**\n\t\t * Reschedule all of the events along the timeline\n\t\t * with the updated values.\n\t\t * @param {Time} after Only reschedules events after the given time.\n\t\t * @return {Tone.Event} this\n\t\t * @private\n\t\t */\n\t Tone.Event.prototype._rescheduleEvents = function (after) {\n\t //if no argument is given, schedules all of the events\n\t after = Tone.defaultArg(after, -1);\n\t this._state.forEachFrom(after, function (event) {\n\t var duration;\n\t if (event.state === Tone.State.Started) {\n\t if (Tone.isDefined(event.id)) {\n\t Tone.Transport.clear(event.id);\n\t }\n\t var startTick = event.time + Math.round(this.startOffset / this._playbackRate);\n\t if (this._loop) {\n\t duration = Infinity;\n\t if (Tone.isNumber(this._loop)) {\n\t duration = this._loop * this._getLoopDuration();\n\t }\n\t var nextEvent = this._state.getAfter(startTick);\n\t if (nextEvent !== null) {\n\t duration = Math.min(duration, nextEvent.time - startTick);\n\t }\n\t if (duration !== Infinity) {\n\t //schedule a stop since it's finite duration\n\t this._state.setStateAtTime(Tone.State.Stopped, startTick + duration + 1);\n\t duration = Tone.Ticks(duration);\n\t }\n\t var interval = Tone.Ticks(this._getLoopDuration());\n\t event.id = Tone.Transport.scheduleRepeat(this._tick.bind(this), interval, Tone.Ticks(startTick), duration);\n\t } else {\n\t event.id = Tone.Transport.schedule(this._tick.bind(this), Tone.Ticks(startTick));\n\t }\n\t }\n\t }.bind(this));\n\t return this;\n\t };\n\t /**\n\t\t * Returns the playback state of the note, either \"started\" or \"stopped\".\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.Event#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'state', {\n\t get: function () {\n\t return this._state.getValueAtTime(Tone.Transport.ticks);\n\t }\n\t });\n\t /**\n\t\t * The start from the scheduled start time\n\t\t * @type {Ticks}\n\t\t * @memberOf Tone.Event#\n\t\t * @name startOffset\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'startOffset', {\n\t get: function () {\n\t return this._startOffset;\n\t },\n\t set: function (offset) {\n\t this._startOffset = offset;\n\t }\n\t });\n\t /**\n\t\t * The probability of the notes being triggered.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {NormalRange}\n\t\t * @name probability\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'probability', {\n\t get: function () {\n\t return this._probability;\n\t },\n\t set: function (prob) {\n\t this._probability = prob;\n\t }\n\t });\n\t /**\n\t\t * If set to true, will apply small random variation\n\t\t * to the callback time. If the value is given as a time, it will randomize\n\t\t * by that amount.\n\t\t * @example\n\t\t * event.humanize = true;\n\t\t * @type {Boolean|Time}\n\t\t * @name humanize\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'humanize', {\n\t get: function () {\n\t return this._humanize;\n\t },\n\t set: function (variation) {\n\t this._humanize = variation;\n\t }\n\t });\n\t /**\n\t\t * Start the note at the given time.\n\t\t * @param {TimelinePosition} time When the note should start.\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.start = function (time) {\n\t time = this.toTicks(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Stopped) {\n\t this._state.add({\n\t 'state': Tone.State.Started,\n\t 'time': time,\n\t 'id': undefined\n\t });\n\t this._rescheduleEvents(time);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop the Event at the given time.\n\t\t * @param {TimelinePosition} time When the note should stop.\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.stop = function (time) {\n\t this.cancel(time);\n\t time = this.toTicks(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t this._state.setStateAtTime(Tone.State.Stopped, time);\n\t var previousEvent = this._state.getBefore(time);\n\t var reschedulTime = time;\n\t if (previousEvent !== null) {\n\t reschedulTime = previousEvent.time;\n\t }\n\t this._rescheduleEvents(reschedulTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Cancel all scheduled events greater than or equal to the given time\n\t\t * @param {TimelinePosition} [time=0] The time after which events will be cancel.\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.cancel = function (time) {\n\t time = Tone.defaultArg(time, -Infinity);\n\t time = this.toTicks(time);\n\t this._state.forEachFrom(time, function (event) {\n\t Tone.Transport.clear(event.id);\n\t });\n\t this._state.cancel(time);\n\t return this;\n\t };\n\t /**\n\t\t * The callback function invoker. Also\n\t\t * checks if the Event is done playing\n\t\t * @param {Number} time The time of the event in seconds\n\t\t * @private\n\t\t */\n\t Tone.Event.prototype._tick = function (time) {\n\t var ticks = Tone.Transport.getTicksAtTime(time);\n\t if (!this.mute && this._state.getValueAtTime(ticks) === Tone.State.Started) {\n\t if (this.probability < 1 && Math.random() > this.probability) {\n\t return;\n\t }\n\t if (this.humanize) {\n\t var variation = 0.02;\n\t if (!Tone.isBoolean(this.humanize)) {\n\t variation = this.toSeconds(this.humanize);\n\t }\n\t time += (Math.random() * 2 - 1) * variation;\n\t }\n\t this.callback(time, this.value);\n\t }\n\t };\n\t /**\n\t\t * Get the duration of the loop.\n\t\t * @return {Ticks}\n\t\t * @private\n\t\t */\n\t Tone.Event.prototype._getLoopDuration = function () {\n\t return Math.round((this._loopEnd - this._loopStart) / this._playbackRate);\n\t };\n\t /**\n\t\t * If the note should loop or not\n\t\t * between Tone.Event.loopStart and\n\t\t * Tone.Event.loopEnd. An integer\n\t\t * value corresponds to the number of\n\t\t * loops the Event does after it starts.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Boolean|Positive}\n\t\t * @name loop\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'loop', {\n\t get: function () {\n\t return this._loop;\n\t },\n\t set: function (loop) {\n\t this._loop = loop;\n\t this._rescheduleEvents();\n\t }\n\t });\n\t /**\n\t\t * \tThe playback rate of the note. Defaults to 1.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Positive}\n\t\t * @name playbackRate\n\t\t * @example\n\t\t * note.loop = true;\n\t\t * //repeat the note twice as fast\n\t\t * note.playbackRate = 2;\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t this._rescheduleEvents();\n\t }\n\t });\n\t /**\n\t\t * The loopEnd point is the time the event will loop\n\t\t * if Tone.Event.loop is true.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'loopEnd', {\n\t get: function () {\n\t return Tone.Ticks(this._loopEnd).toSeconds();\n\t },\n\t set: function (loopEnd) {\n\t this._loopEnd = this.toTicks(loopEnd);\n\t if (this._loop) {\n\t this._rescheduleEvents();\n\t }\n\t }\n\t });\n\t /**\n\t\t * The time when the loop should start.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'loopStart', {\n\t get: function () {\n\t return Tone.Ticks(this._loopStart).toSeconds();\n\t },\n\t set: function (loopStart) {\n\t this._loopStart = this.toTicks(loopStart);\n\t if (this._loop) {\n\t this._rescheduleEvents();\n\t }\n\t }\n\t });\n\t /**\n\t\t * The current progress of the loop interval.\n\t\t * Returns 0 if the event is not started yet or\n\t\t * it is not set to loop.\n\t\t * @memberOf Tone.Event#\n\t\t * @type {NormalRange}\n\t\t * @name progress\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Event.prototype, 'progress', {\n\t get: function () {\n\t if (this._loop) {\n\t var ticks = Tone.Transport.ticks;\n\t var lastEvent = this._state.get(ticks);\n\t if (lastEvent !== null && lastEvent.state === Tone.State.Started) {\n\t var loopDuration = this._getLoopDuration();\n\t var progress = (ticks - lastEvent.time) % loopDuration;\n\t return progress / loopDuration;\n\t } else {\n\t return 0;\n\t }\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Event} this\n\t\t */\n\t Tone.Event.prototype.dispose = function () {\n\t this.cancel();\n\t this._state.dispose();\n\t this._state = null;\n\t this.callback = null;\n\t this.value = null;\n\t };\n\t return Tone.Event;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Loop creates a looped callback at the \n\t\t * specified interval. The callback can be \n\t\t * started, stopped and scheduled along\n\t\t * the Transport's timeline. \n\t\t * @example\n\t\t * var loop = new Tone.Loop(function(time){\n\t\t * \t//triggered every eighth note. \n\t\t * \tconsole.log(time);\n\t\t * }, \"8n\").start(0);\n\t\t * Tone.Transport.start();\n\t\t * @extends {Tone}\n\t\t * @param {Function} callback The callback to invoke with the event.\n\t\t * @param {Time} interval The time between successive callback calls. \n\t\t */\n\t Tone.Loop = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'interval'\n\t ], Tone.Loop);\n\t Tone.call(this);\n\t /**\n\t\t\t * The event which produces the callbacks\n\t\t\t */\n\t this._event = new Tone.Event({\n\t 'callback': this._tick.bind(this),\n\t 'loop': true,\n\t 'loopEnd': options.interval,\n\t 'playbackRate': options.playbackRate,\n\t 'probability': options.probability\n\t });\n\t /**\n\t\t\t * The callback to invoke with the next event in the pattern\n\t\t\t * @type {Function}\n\t\t\t */\n\t this.callback = options.callback;\n\t //set the iterations\n\t this.iterations = options.iterations;\n\t };\n\t Tone.extend(Tone.Loop);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Loop.defaults = {\n\t 'interval': '4n',\n\t 'callback': Tone.noOp,\n\t 'playbackRate': 1,\n\t 'iterations': Infinity,\n\t 'probability': true,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Start the loop at the specified time along the Transport's\n\t\t * timeline.\n\t\t * @param {TimelinePosition=} time When to start the Loop.\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.start = function (time) {\n\t this._event.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Stop the loop at the given time.\n\t\t * @param {TimelinePosition=} time When to stop the Arpeggio\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.stop = function (time) {\n\t this._event.stop(time);\n\t return this;\n\t };\n\t /**\n\t\t * Cancel all scheduled events greater than or equal to the given time\n\t\t * @param {TimelinePosition} [time=0] The time after which events will be cancel.\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.cancel = function (time) {\n\t this._event.cancel(time);\n\t return this;\n\t };\n\t /**\n\t\t * Internal function called when the notes should be called\n\t\t * @param {Number} time The time the event occurs\n\t\t * @private\n\t\t */\n\t Tone.Loop.prototype._tick = function (time) {\n\t this.callback(time);\n\t };\n\t /**\n\t\t * The state of the Loop, either started or stopped.\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {String}\n\t\t * @name state\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'state', {\n\t get: function () {\n\t return this._event.state;\n\t }\n\t });\n\t /**\n\t\t * The progress of the loop as a value between 0-1. 0, when\n\t\t * the loop is stopped or done iterating. \n\t\t * @memberOf Tone.Loop#\n\t\t * @type {NormalRange}\n\t\t * @name progress\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'progress', {\n\t get: function () {\n\t return this._event.progress;\n\t }\n\t });\n\t /**\n\t\t * The time between successive callbacks. \n\t\t * @example\n\t\t * loop.interval = \"8n\"; //loop every 8n\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Time}\n\t\t * @name interval\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'interval', {\n\t get: function () {\n\t return this._event.loopEnd;\n\t },\n\t set: function (interval) {\n\t this._event.loopEnd = interval;\n\t }\n\t });\n\t /**\n\t\t * The playback rate of the loop. The normal playback rate is 1 (no change). \n\t\t * A `playbackRate` of 2 would be twice as fast. \n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Time}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._event.playbackRate;\n\t },\n\t set: function (rate) {\n\t this._event.playbackRate = rate;\n\t }\n\t });\n\t /**\n\t\t * Random variation +/-0.01s to the scheduled time. \n\t\t * Or give it a time value which it will randomize by.\n\t\t * @type {Boolean|Time}\n\t\t * @memberOf Tone.Loop#\n\t\t * @name humanize\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'humanize', {\n\t get: function () {\n\t return this._event.humanize;\n\t },\n\t set: function (variation) {\n\t this._event.humanize = variation;\n\t }\n\t });\n\t /**\n\t\t * The probably of the callback being invoked.\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {NormalRange}\n\t\t * @name probability\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'probability', {\n\t get: function () {\n\t return this._event.probability;\n\t },\n\t set: function (prob) {\n\t this._event.probability = prob;\n\t }\n\t });\n\t /**\n\t\t * Muting the Loop means that no callbacks are invoked.\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Boolean}\n\t\t * @name mute\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'mute', {\n\t get: function () {\n\t return this._event.mute;\n\t },\n\t set: function (mute) {\n\t this._event.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * The number of iterations of the loop. The default\n\t\t * value is Infinity (loop forever).\n\t\t * @memberOf Tone.Loop#\n\t\t * @type {Positive}\n\t\t * @name iterations\n\t\t */\n\t Object.defineProperty(Tone.Loop.prototype, 'iterations', {\n\t get: function () {\n\t if (this._event.loop === true) {\n\t return Infinity;\n\t } else {\n\t return this._event.loop;\n\t }\n\t },\n\t set: function (iters) {\n\t if (iters === Infinity) {\n\t this._event.loop = true;\n\t } else {\n\t this._event.loop = iters;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Loop} this\n\t\t */\n\t Tone.Loop.prototype.dispose = function () {\n\t this._event.dispose();\n\t this._event = null;\n\t this.callback = null;\n\t };\n\t return Tone.Loop;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Part is a collection Tone.Events which can be\n\t\t * started/stopped and looped as a single unit.\n\t\t *\n\t\t * @extends {Tone.Event}\n\t\t * @param {Function} callback The callback to invoke on each event\n\t\t * @param {Array} events the array of events\n\t\t * @example\n\t\t * var part = new Tone.Part(function(time, note){\n\t\t * \t//the notes given as the second element in the array\n\t\t * \t//will be passed in as the second argument\n\t\t * \tsynth.triggerAttackRelease(note, \"8n\", time);\n\t\t * }, [[0, \"C2\"], [\"0:2\", \"C3\"], [\"0:3:2\", \"G2\"]]);\n\t\t * @example\n\t\t * //use an array of objects as long as the object has a \"time\" attribute\n\t\t * var part = new Tone.Part(function(time, value){\n\t\t * \t//the value is an object which contains both the note and the velocity\n\t\t * \tsynth.triggerAttackRelease(value.note, \"8n\", time, value.velocity);\n\t\t * }, [{\"time\" : 0, \"note\" : \"C3\", \"velocity\": 0.9},\n\t\t * \t {\"time\" : \"0:2\", \"note\" : \"C4\", \"velocity\": 0.5}\n\t\t * ]).start(0);\n\t\t */\n\t Tone.Part = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'events'\n\t ], Tone.Part);\n\t Tone.Event.call(this, options);\n\t /**\n\t\t\t * An array of Objects.\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._events = [];\n\t //add the events\n\t for (var i = 0; i < options.events.length; i++) {\n\t if (Array.isArray(options.events[i])) {\n\t this.add(options.events[i][0], options.events[i][1]);\n\t } else {\n\t this.add(options.events[i]);\n\t }\n\t }\n\t };\n\t Tone.extend(Tone.Part, Tone.Event);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.Part.defaults = {\n\t 'callback': Tone.noOp,\n\t 'loop': false,\n\t 'loopEnd': '1m',\n\t 'loopStart': 0,\n\t 'playbackRate': 1,\n\t 'probability': 1,\n\t 'humanize': false,\n\t 'mute': false,\n\t 'events': []\n\t };\n\t /**\n\t\t * Start the part at the given time.\n\t\t * @param {TransportTime} time When to start the part.\n\t\t * @param {Time=} offset The offset from the start of the part\n\t\t * to begin playing at.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.start = function (time, offset) {\n\t var ticks = this.toTicks(time);\n\t if (this._state.getValueAtTime(ticks) !== Tone.State.Started) {\n\t if (this._loop) {\n\t offset = Tone.defaultArg(offset, this._loopStart);\n\t } else {\n\t offset = Tone.defaultArg(offset, 0);\n\t }\n\t offset = this.toTicks(offset);\n\t this._state.add({\n\t 'state': Tone.State.Started,\n\t 'time': ticks,\n\t 'offset': offset\n\t });\n\t this._forEach(function (event) {\n\t this._startNote(event, ticks, offset);\n\t });\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Start the event in the given event at the correct time given\n\t\t * the ticks and offset and looping.\n\t\t * @param {Tone.Event} event\n\t\t * @param {Ticks} ticks\n\t\t * @param {Ticks} offset\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._startNote = function (event, ticks, offset) {\n\t ticks -= offset;\n\t if (this._loop) {\n\t if (event.startOffset >= this._loopStart && event.startOffset < this._loopEnd) {\n\t if (event.startOffset < offset) {\n\t //start it on the next loop\n\t ticks += this._getLoopDuration();\n\t }\n\t event.start(Tone.Ticks(ticks));\n\t } else if (event.startOffset < this._loopStart && event.startOffset >= offset) {\n\t event.loop = false;\n\t event.start(Tone.Ticks(ticks));\n\t }\n\t } else if (event.startOffset >= offset) {\n\t event.start(Tone.Ticks(ticks));\n\t }\n\t };\n\t /**\n\t\t * The start from the scheduled start time\n\t\t * @type {Ticks}\n\t\t * @memberOf Tone.Part#\n\t\t * @name startOffset\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'startOffset', {\n\t get: function () {\n\t return this._startOffset;\n\t },\n\t set: function (offset) {\n\t this._startOffset = offset;\n\t this._forEach(function (event) {\n\t event.startOffset += this._startOffset;\n\t });\n\t }\n\t });\n\t /**\n\t\t * Stop the part at the given time.\n\t\t * @param {TimelinePosition} time When to stop the part.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.stop = function (time) {\n\t var ticks = this.toTicks(time);\n\t this._state.cancel(ticks);\n\t this._state.setStateAtTime(Tone.State.Stopped, ticks);\n\t this._forEach(function (event) {\n\t event.stop(time);\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Get/Set an Event's value at the given time.\n\t\t * If a value is passed in and no event exists at\n\t\t * the given time, one will be created with that value.\n\t\t * If two events are at the same time, the first one will\n\t\t * be returned.\n\t\t * @example\n\t\t * part.at(\"1m\"); //returns the part at the first measure\n\t\t *\n\t\t * part.at(\"2m\", \"C2\"); //set the value at \"2m\" to C2.\n\t\t * //if an event didn't exist at that time, it will be created.\n\t\t * @param {TransportTime} time The time of the event to get or set.\n\t\t * @param {*=} value If a value is passed in, the value of the\n\t\t * event at the given time will be set to it.\n\t\t * @return {Tone.Event} the event at the time\n\t\t */\n\t Tone.Part.prototype.at = function (time, value) {\n\t time = Tone.TransportTime(time);\n\t var tickTime = Tone.Ticks(1).toSeconds();\n\t for (var i = 0; i < this._events.length; i++) {\n\t var event = this._events[i];\n\t if (Math.abs(time.toTicks() - event.startOffset) < tickTime) {\n\t if (Tone.isDefined(value)) {\n\t event.value = value;\n\t }\n\t return event;\n\t }\n\t }\n\t //if there was no event at that time, create one\n\t if (Tone.isDefined(value)) {\n\t this.add(time, value);\n\t //return the new event\n\t return this._events[this._events.length - 1];\n\t } else {\n\t return null;\n\t }\n\t };\n\t /**\n\t\t * Add a an event to the part.\n\t\t * @param {Time} time The time the note should start.\n\t\t * If an object is passed in, it should\n\t\t * have a 'time' attribute and the rest\n\t\t * of the object will be used as the 'value'.\n\t\t * @param {Tone.Event|*} value\n\t\t * @returns {Tone.Part} this\n\t\t * @example\n\t\t * part.add(\"1m\", \"C#+11\");\n\t\t */\n\t Tone.Part.prototype.add = function (time, value) {\n\t //extract the parameters\n\t if (time.hasOwnProperty('time')) {\n\t value = time;\n\t time = value.time;\n\t }\n\t time = this.toTicks(time);\n\t var event;\n\t if (value instanceof Tone.Event) {\n\t event = value;\n\t event.callback = this._tick.bind(this);\n\t } else {\n\t event = new Tone.Event({\n\t 'callback': this._tick.bind(this),\n\t 'value': value\n\t });\n\t }\n\t //the start offset\n\t event.startOffset = time;\n\t //initialize the values\n\t event.set({\n\t 'loopEnd': this.loopEnd,\n\t 'loopStart': this.loopStart,\n\t 'loop': this.loop,\n\t 'humanize': this.humanize,\n\t 'playbackRate': this.playbackRate,\n\t 'probability': this.probability\n\t });\n\t this._events.push(event);\n\t //start the note if it should be played right now\n\t this._restartEvent(event);\n\t return this;\n\t };\n\t /**\n\t\t * Restart the given event\n\t\t * @param {Tone.Event} event\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._restartEvent = function (event) {\n\t this._state.forEach(function (stateEvent) {\n\t if (stateEvent.state === Tone.State.Started) {\n\t this._startNote(event, stateEvent.time, stateEvent.offset);\n\t } else {\n\t //stop the note\n\t event.stop(Tone.Ticks(stateEvent.time));\n\t }\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Remove an event from the part. Will recursively iterate\n\t\t * into nested parts to find the event.\n\t\t * @param {Time} time The time of the event\n\t\t * @param {*} value Optionally select only a specific event value\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.remove = function (time, value) {\n\t //extract the parameters\n\t if (time.hasOwnProperty('time')) {\n\t value = time;\n\t time = value.time;\n\t }\n\t time = this.toTicks(time);\n\t for (var i = this._events.length - 1; i >= 0; i--) {\n\t var event = this._events[i];\n\t if (event instanceof Tone.Part) {\n\t event.remove(time, value);\n\t } else if (event.startOffset === time) {\n\t if (Tone.isUndef(value) || Tone.isDefined(value) && event.value === value) {\n\t this._events.splice(i, 1);\n\t event.dispose();\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Remove all of the notes from the group.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.removeAll = function () {\n\t this._forEach(function (event) {\n\t event.dispose();\n\t });\n\t this._events = [];\n\t return this;\n\t };\n\t /**\n\t\t * Cancel scheduled state change events: i.e. \"start\" and \"stop\".\n\t\t * @param {TimelinePosition} after The time after which to cancel the scheduled events.\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.cancel = function (after) {\n\t this._forEach(function (event) {\n\t event.cancel(after);\n\t });\n\t this._state.cancel(this.toTicks(after));\n\t return this;\n\t };\n\t /**\n\t\t * Iterate over all of the events\n\t\t * @param {Function} callback\n\t\t * @param {Object} ctx The context\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._forEach = function (callback, ctx) {\n\t if (this._events) {\n\t ctx = Tone.defaultArg(ctx, this);\n\t for (var i = this._events.length - 1; i >= 0; i--) {\n\t var e = this._events[i];\n\t if (e instanceof Tone.Part) {\n\t e._forEach(callback, ctx);\n\t } else {\n\t callback.call(ctx, e);\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Set the attribute of all of the events\n\t\t * @param {String} attr the attribute to set\n\t\t * @param {*} value The value to set it to\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._setAll = function (attr, value) {\n\t this._forEach(function (event) {\n\t event[attr] = value;\n\t });\n\t };\n\t /**\n\t\t * Internal tick method\n\t\t * @param {Number} time The time of the event in seconds\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._tick = function (time, value) {\n\t if (!this.mute) {\n\t this.callback(time, value);\n\t }\n\t };\n\t /**\n\t\t * Determine if the event should be currently looping\n\t\t * given the loop boundries of this Part.\n\t\t * @param {Tone.Event} event The event to test\n\t\t * @private\n\t\t */\n\t Tone.Part.prototype._testLoopBoundries = function (event) {\n\t if (event.startOffset < this._loopStart || event.startOffset >= this._loopEnd) {\n\t event.cancel(0);\n\t } else if (event.state === Tone.State.Stopped) {\n\t //reschedule it if it's stopped\n\t this._restartEvent(event);\n\t }\n\t };\n\t /**\n\t\t * The probability of the notes being triggered.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {NormalRange}\n\t\t * @name probability\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'probability', {\n\t get: function () {\n\t return this._probability;\n\t },\n\t set: function (prob) {\n\t this._probability = prob;\n\t this._setAll('probability', prob);\n\t }\n\t });\n\t /**\n\t\t * If set to true, will apply small random variation\n\t\t * to the callback time. If the value is given as a time, it will randomize\n\t\t * by that amount.\n\t\t * @example\n\t\t * event.humanize = true;\n\t\t * @type {Boolean|Time}\n\t\t * @name humanize\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'humanize', {\n\t get: function () {\n\t return this._humanize;\n\t },\n\t set: function (variation) {\n\t this._humanize = variation;\n\t this._setAll('humanize', variation);\n\t }\n\t });\n\t /**\n\t\t * If the part should loop or not\n\t\t * between Tone.Part.loopStart and\n\t\t * Tone.Part.loopEnd. An integer\n\t\t * value corresponds to the number of\n\t\t * loops the Part does after it starts.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Boolean|Positive}\n\t\t * @name loop\n\t\t * @example\n\t\t * //loop the part 8 times\n\t\t * part.loop = 8;\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'loop', {\n\t get: function () {\n\t return this._loop;\n\t },\n\t set: function (loop) {\n\t this._loop = loop;\n\t this._forEach(function (event) {\n\t event._loopStart = this._loopStart;\n\t event._loopEnd = this._loopEnd;\n\t event.loop = loop;\n\t this._testLoopBoundries(event);\n\t });\n\t }\n\t });\n\t /**\n\t\t * The loopEnd point determines when it will\n\t\t * loop if Tone.Part.loop is true.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'loopEnd', {\n\t get: function () {\n\t return Tone.Ticks(this._loopEnd).toSeconds();\n\t },\n\t set: function (loopEnd) {\n\t this._loopEnd = this.toTicks(loopEnd);\n\t if (this._loop) {\n\t this._forEach(function (event) {\n\t event.loopEnd = loopEnd;\n\t this._testLoopBoundries(event);\n\t });\n\t }\n\t }\n\t });\n\t /**\n\t\t * The loopStart point determines when it will\n\t\t * loop if Tone.Part.loop is true.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'loopStart', {\n\t get: function () {\n\t return Tone.Ticks(this._loopStart).toSeconds();\n\t },\n\t set: function (loopStart) {\n\t this._loopStart = this.toTicks(loopStart);\n\t if (this._loop) {\n\t this._forEach(function (event) {\n\t event.loopStart = this.loopStart;\n\t this._testLoopBoundries(event);\n\t });\n\t }\n\t }\n\t });\n\t /**\n\t\t * \tThe playback rate of the part\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Positive}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t this._setAll('playbackRate', rate);\n\t }\n\t });\n\t /**\n\t\t * \tThe number of scheduled notes in the part.\n\t\t * @memberOf Tone.Part#\n\t\t * @type {Positive}\n\t\t * @name length\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Part.prototype, 'length', {\n\t get: function () {\n\t return this._events.length;\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Part} this\n\t\t */\n\t Tone.Part.prototype.dispose = function () {\n\t this.removeAll();\n\t this._state.dispose();\n\t this._state = null;\n\t this.callback = null;\n\t this._events = null;\n\t return this;\n\t };\n\t return Tone.Part;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Pattern arpeggiates between the given notes\n\t\t * in a number of patterns. See Tone.CtrlPattern for\n\t\t * a full list of patterns.\n\t\t * @example\n\t\t * var pattern = new Tone.Pattern(function(time, note){\n\t\t * //the order of the notes passed in depends on the pattern\n\t\t * }, [\"C2\", \"D4\", \"E5\", \"A6\"], \"upDown\");\n\t\t * @extends {Tone.Loop}\n\t\t * @param {Function} callback The callback to invoke with the\n\t\t * event.\n\t\t * @param {Array} values The values to arpeggiate over.\n\t\t */\n\t Tone.Pattern = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'values',\n\t 'pattern'\n\t ], Tone.Pattern);\n\t Tone.Loop.call(this, options);\n\t /**\n\t\t\t * The pattern manager\n\t\t\t * @type {Tone.CtrlPattern}\n\t\t\t * @private\n\t\t\t */\n\t this._pattern = new Tone.CtrlPattern({\n\t 'values': options.values,\n\t 'type': options.pattern,\n\t 'index': options.index\n\t });\n\t };\n\t Tone.extend(Tone.Pattern, Tone.Loop);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Pattern.defaults = {\n\t 'pattern': Tone.CtrlPattern.Type.Up,\n\t 'callback': Tone.noOp,\n\t 'values': []\n\t };\n\t /**\n\t\t * Internal function called when the notes should be called\n\t\t * @param {Number} time The time the event occurs\n\t\t * @private\n\t\t */\n\t Tone.Pattern.prototype._tick = function (time) {\n\t this.callback(time, this._pattern.value);\n\t this._pattern.next();\n\t };\n\t /**\n\t\t * The current index in the values array.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {Positive}\n\t\t * @name index\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'index', {\n\t get: function () {\n\t return this._pattern.index;\n\t },\n\t set: function (i) {\n\t this._pattern.index = i;\n\t }\n\t });\n\t /**\n\t\t * The array of events.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {Array}\n\t\t * @name values\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'values', {\n\t get: function () {\n\t return this._pattern.values;\n\t },\n\t set: function (vals) {\n\t this._pattern.values = vals;\n\t }\n\t });\n\t /**\n\t\t * The current value of the pattern.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {*}\n\t\t * @name value\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'value', {\n\t get: function () {\n\t return this._pattern.value;\n\t }\n\t });\n\t /**\n\t\t * The pattern type. See Tone.CtrlPattern for the full list of patterns.\n\t\t * @memberOf Tone.Pattern#\n\t\t * @type {String}\n\t\t * @name pattern\n\t\t */\n\t Object.defineProperty(Tone.Pattern.prototype, 'pattern', {\n\t get: function () {\n\t return this._pattern.type;\n\t },\n\t set: function (pattern) {\n\t this._pattern.type = pattern;\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Pattern} this\n\t\t */\n\t Tone.Pattern.prototype.dispose = function () {\n\t Tone.Loop.prototype.dispose.call(this);\n\t this._pattern.dispose();\n\t this._pattern = null;\n\t };\n\t return Tone.Pattern;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class A sequence is an alternate notation of a part. Instead\n\t\t * of passing in an array of [time, event] pairs, pass\n\t\t * in an array of events which will be spaced at the\n\t\t * given subdivision. Sub-arrays will subdivide that beat\n\t\t * by the number of items are in the array.\n\t\t * Sequence notation inspiration from [Tidal](http://yaxu.org/tidal/)\n\t\t * @param {Function} callback The callback to invoke with every note\n\t\t * @param {Array} events The sequence\n\t\t * @param {Time} subdivision The subdivision between which events are placed.\n\t\t * @extends {Tone.Part}\n\t\t * @example\n\t\t * var seq = new Tone.Sequence(function(time, note){\n\t\t * \tconsole.log(note);\n\t\t * //straight quater notes\n\t\t * }, [\"C4\", \"E4\", \"G4\", \"A4\"], \"4n\");\n\t\t * @example\n\t\t * var seq = new Tone.Sequence(function(time, note){\n\t\t * \tconsole.log(note);\n\t\t * //subdivisions are given as subarrays\n\t\t * }, [\"C4\", [\"E4\", \"D4\", \"E4\"], \"G4\", [\"A4\", \"G4\"]]);\n\t\t */\n\t Tone.Sequence = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'callback',\n\t 'events',\n\t 'subdivision'\n\t ], Tone.Sequence);\n\t //remove the events\n\t var events = options.events;\n\t delete options.events;\n\t Tone.Part.call(this, options);\n\t /**\n\t\t\t * The subdivison of each note\n\t\t\t * @type {Ticks}\n\t\t\t * @private\n\t\t\t */\n\t this._subdivision = this.toTicks(options.subdivision);\n\t //if no time was passed in, the loop end is the end of the cycle\n\t if (Tone.isUndef(options.loopEnd) && Tone.isDefined(events)) {\n\t this._loopEnd = events.length * this._subdivision;\n\t }\n\t //defaults to looping\n\t this._loop = true;\n\t //add all of the events\n\t if (Tone.isDefined(events)) {\n\t for (var i = 0; i < events.length; i++) {\n\t this.add(i, events[i]);\n\t }\n\t }\n\t };\n\t Tone.extend(Tone.Sequence, Tone.Part);\n\t /**\n\t\t * The default values.\n\t\t * @type {Object}\n\t\t */\n\t Tone.Sequence.defaults = { 'subdivision': '4n' };\n\t /**\n\t\t * The subdivision of the sequence. This can only be\n\t\t * set in the constructor. The subdivision is the\n\t\t * interval between successive steps.\n\t\t * @type {Time}\n\t\t * @memberOf Tone.Sequence#\n\t\t * @name subdivision\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Sequence.prototype, 'subdivision', {\n\t get: function () {\n\t return Tone.Ticks(this._subdivision).toSeconds();\n\t }\n\t });\n\t /**\n\t\t * Get/Set an index of the sequence. If the index contains a subarray,\n\t\t * a Tone.Sequence representing that sub-array will be returned.\n\t\t * @example\n\t\t * var sequence = new Tone.Sequence(playNote, [\"E4\", \"C4\", \"F#4\", [\"A4\", \"Bb3\"]])\n\t\t * sequence.at(0)// => returns \"E4\"\n\t\t * //set a value\n\t\t * sequence.at(0, \"G3\");\n\t\t * //get a nested sequence\n\t\t * sequence.at(3).at(1)// => returns \"Bb3\"\n\t\t * @param {Positive} index The index to get or set\n\t\t * @param {*} value Optionally pass in the value to set at the given index.\n\t\t */\n\t Tone.Sequence.prototype.at = function (index, value) {\n\t //if the value is an array,\n\t if (Tone.isArray(value)) {\n\t //remove the current event at that index\n\t this.remove(index);\n\t }\n\t //call the parent's method\n\t return Tone.Part.prototype.at.call(this, this._indexTime(index), value);\n\t };\n\t /**\n\t\t * Add an event at an index, if there's already something\n\t\t * at that index, overwrite it. If `value` is an array,\n\t\t * it will be parsed as a subsequence.\n\t\t * @param {Number} index The index to add the event to\n\t\t * @param {*} value The value to add at that index\n\t\t * @returns {Tone.Sequence} this\n\t\t */\n\t Tone.Sequence.prototype.add = function (index, value) {\n\t if (value === null) {\n\t return this;\n\t }\n\t if (Tone.isArray(value)) {\n\t //make a subsequence and add that to the sequence\n\t var subSubdivision = Math.round(this._subdivision / value.length);\n\t value = new Tone.Sequence(this._tick.bind(this), value, Tone.Ticks(subSubdivision));\n\t }\n\t Tone.Part.prototype.add.call(this, this._indexTime(index), value);\n\t return this;\n\t };\n\t /**\n\t\t * Remove a value from the sequence by index\n\t\t * @param {Number} index The index of the event to remove\n\t\t * @returns {Tone.Sequence} this\n\t\t */\n\t Tone.Sequence.prototype.remove = function (index, value) {\n\t Tone.Part.prototype.remove.call(this, this._indexTime(index), value);\n\t return this;\n\t };\n\t /**\n\t\t * Get the time of the index given the Sequence's subdivision\n\t\t * @param {Number} index\n\t\t * @return {Time} The time of that index\n\t\t * @private\n\t\t */\n\t Tone.Sequence.prototype._indexTime = function (index) {\n\t if (index instanceof Tone.TransportTime) {\n\t return index;\n\t } else {\n\t return Tone.Ticks(index * this._subdivision + this.startOffset).toSeconds();\n\t }\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.Sequence} this\n\t\t */\n\t Tone.Sequence.prototype.dispose = function () {\n\t Tone.Part.prototype.dispose.call(this);\n\t return this;\n\t };\n\t return Tone.Sequence;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PulseOscillator is a pulse oscillator with control over pulse width,\n\t\t * also known as the duty cycle. At 50% duty cycle (width = 0.5) the wave is\n\t\t * a square and only odd-numbered harmonics are present. At all other widths\n\t\t * even-numbered harmonics are present. Read more\n\t\t * [here](https://wigglewave.wordpress.com/2014/08/16/pulse-waveforms-and-harmonics/).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {Frequency} [frequency] The frequency of the oscillator\n\t\t * @param {NormalRange} [width] The width of the pulse\n\t\t * @example\n\t\t * var pulse = new Tone.PulseOscillator(\"E5\", 0.4).toMaster().start();\n\t\t */\n\t Tone.PulseOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'width'\n\t ], Tone.Oscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The width of the pulse.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.width = new Tone.Signal(options.width, Tone.Type.NormalRange);\n\t /**\n\t\t\t * gate the width amount\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._widthGate = new Tone.Gain();\n\t /**\n\t\t\t * the sawtooth oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._sawtooth = new Tone.Oscillator({\n\t frequency: options.frequency,\n\t detune: options.detune,\n\t type: 'sawtooth',\n\t phase: options.phase\n\t });\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._sawtooth.frequency;\n\t /**\n\t\t\t * The detune in cents.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._sawtooth.detune;\n\t /**\n\t\t\t * Threshold the signal to turn it into a square\n\t\t\t * @type {Tone.WaveShaper}\n\t\t\t * @private\n\t\t\t */\n\t this._thresh = new Tone.WaveShaper(function (val) {\n\t if (val < 0) {\n\t return -1;\n\t } else {\n\t return 1;\n\t }\n\t });\n\t //connections\n\t this._sawtooth.chain(this._thresh, this.output);\n\t this.width.chain(this._widthGate, this._thresh);\n\t this._readOnly([\n\t 'width',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.PulseOscillator, Tone.Source);\n\t /**\n\t\t * The default parameters.\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.PulseOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'width': 0.2\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.PulseOscillator.prototype._start = function (time) {\n\t time = this.toSeconds(time);\n\t this._sawtooth.start(time);\n\t this._widthGate.gain.setValueAtTime(1, time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.PulseOscillator.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._sawtooth.stop(time);\n\t //the width is still connected to the output.\n\t //that needs to be stopped also\n\t this._widthGate.gain.setValueAtTime(0, time);\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.PulseOscillator.prototype.restart = function (time) {\n\t this._sawtooth.restart(time);\n\t };\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.PulseOscillator#\n\t\t * @type {Degrees}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.PulseOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._sawtooth.phase;\n\t },\n\t set: function (phase) {\n\t this._sawtooth.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The type of the oscillator. Always returns \"pulse\".\n\t\t * @readOnly\n\t\t * @memberOf Tone.PulseOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.PulseOscillator.prototype, 'type', {\n\t get: function () {\n\t return 'pulse';\n\t }\n\t });\n\t /**\n\t\t * The partials of the waveform. Cannot set partials for this waveform type\n\t\t * @memberOf Tone.PulseOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.PulseOscillator.prototype, 'partials', {\n\t get: function () {\n\t return [];\n\t }\n\t });\n\t /**\n\t\t * Clean up method.\n\t\t * @return {Tone.PulseOscillator} this\n\t\t */\n\t Tone.PulseOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._sawtooth.dispose();\n\t this._sawtooth = null;\n\t this._writable([\n\t 'width',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.width.dispose();\n\t this.width = null;\n\t this._widthGate.dispose();\n\t this._widthGate = null;\n\t this._thresh.dispose();\n\t this._thresh = null;\n\t this.frequency = null;\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.PulseOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PWMOscillator modulates the width of a Tone.PulseOscillator\n\t\t * at the modulationFrequency. This has the effect of continuously\n\t\t * changing the timbre of the oscillator by altering the harmonics\n\t\t * generated.\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {Frequency} modulationFrequency The modulation frequency of the width of the pulse.\n\t\t * @example\n\t\t * var pwm = new Tone.PWMOscillator(\"Ab3\", 0.3).toMaster().start();\n\t\t */\n\t Tone.PWMOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'modulationFrequency'\n\t ], Tone.PWMOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * the pulse oscillator\n\t\t\t * @type {Tone.PulseOscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._pulse = new Tone.PulseOscillator(options.modulationFrequency);\n\t //change the pulse oscillator type\n\t this._pulse._sawtooth.type = 'sine';\n\t /**\n\t\t\t * the modulator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Oscillator({\n\t 'frequency': options.frequency,\n\t 'detune': options.detune,\n\t 'phase': options.phase\n\t });\n\t /**\n\t\t\t * Scale the oscillator so it doesn't go silent\n\t\t\t * at the extreme values.\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._scale = new Tone.Multiply(2);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._modulator.frequency;\n\t /**\n\t\t\t * The detune of the oscillator.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._modulator.detune;\n\t /**\n\t\t\t * The modulation rate of the oscillator.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.modulationFrequency = this._pulse.frequency;\n\t //connections\n\t this._modulator.chain(this._scale, this._pulse.width);\n\t this._pulse.connect(this.output);\n\t this._readOnly([\n\t 'modulationFrequency',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.PWMOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.PWMOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'modulationFrequency': 0.4\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.PWMOscillator.prototype._start = function (time) {\n\t time = this.toSeconds(time);\n\t this._modulator.start(time);\n\t this._pulse.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.PWMOscillator.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._modulator.stop(time);\n\t this._pulse.stop(time);\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.PWMOscillator.prototype.restart = function (time) {\n\t this._modulator.restart(time);\n\t this._pulse.restart(time);\n\t };\n\t /**\n\t\t * The type of the oscillator. Always returns \"pwm\".\n\t\t * @readOnly\n\t\t * @memberOf Tone.PWMOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.PWMOscillator.prototype, 'type', {\n\t get: function () {\n\t return 'pwm';\n\t }\n\t });\n\t /**\n\t\t * The partials of the waveform. Cannot set partials for this waveform type\n\t\t * @memberOf Tone.PWMOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @private\n\t\t */\n\t Object.defineProperty(Tone.PWMOscillator.prototype, 'partials', {\n\t get: function () {\n\t return [];\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.PWMOscillator#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.PWMOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._modulator.phase;\n\t },\n\t set: function (phase) {\n\t this._modulator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.PWMOscillator} this\n\t\t */\n\t Tone.PWMOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._pulse.dispose();\n\t this._pulse = null;\n\t this._scale.dispose();\n\t this._scale = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this._writable([\n\t 'modulationFrequency',\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.frequency = null;\n\t this.detune = null;\n\t this.modulationFrequency = null;\n\t return this;\n\t };\n\t return Tone.PWMOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FMOscillator\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {String} type The type of the carrier oscillator.\n\t\t * @param {String} modulationType The type of the modulator oscillator.\n\t\t * @example\n\t\t * //a sine oscillator frequency-modulated by a square wave\n\t\t * var fmOsc = new Tone.FMOscillator(\"Ab3\", \"sine\", \"square\").toMaster().start();\n\t\t */\n\t Tone.FMOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'modulationType'\n\t ], Tone.FMOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The carrier oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Oscillator(options.frequency, options.type);\n\t /**\n\t\t\t * The oscillator's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._carrier.detune;\n\t this.detune.value = options.detune;\n\t /**\n\t\t\t * The modulation index which is in essence the depth or amount of the modulation. In other terms it is the\n\t\t\t * ratio of the frequency of the modulating signal (mf) to the amplitude of the\n\t\t\t * modulating signal (ma) -- as in ma/mf.\n\t\t\t *\t@type {Positive}\n\t\t\t *\t@signal\n\t\t\t */\n\t this.modulationIndex = new Tone.Multiply(options.modulationIndex);\n\t this.modulationIndex.units = Tone.Type.Positive;\n\t /**\n\t\t\t * The modulating oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Oscillator(options.frequency, options.modulationType);\n\t /**\n\t\t\t * Harmonicity is the frequency ratio between the carrier and the modulator oscillators.\n\t\t\t * A harmonicity of 1 gives both oscillators the same frequency.\n\t\t\t * Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch the modulator an octave below carrier\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain(0);\n\t //connections\n\t this.frequency.connect(this._carrier.frequency);\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.frequency.chain(this.modulationIndex, this._modulationNode);\n\t this._modulator.connect(this._modulationNode.gain);\n\t this._modulationNode.connect(this._carrier.frequency);\n\t this._carrier.connect(this.output);\n\t this.detune.connect(this._modulator.detune);\n\t this.phase = options.phase;\n\t this._readOnly([\n\t 'modulationIndex',\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t };\n\t Tone.extend(Tone.FMOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.FMOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'modulationIndex': 2,\n\t 'modulationType': 'square',\n\t 'harmonicity': 1\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.FMOscillator.prototype._start = function (time) {\n\t this._modulator.start(time);\n\t this._carrier.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.FMOscillator.prototype._stop = function (time) {\n\t this._modulator.stop(time);\n\t this._carrier.stop(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.FMOscillator.prototype.restart = function (time) {\n\t this._modulator.restart(time);\n\t this._carrier.restart(time);\n\t };\n\t /**\n\t\t * The type of the carrier oscillator\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'type', {\n\t get: function () {\n\t return this._carrier.type;\n\t },\n\t set: function (type) {\n\t this._carrier.type = type;\n\t }\n\t });\n\t /**\n\t\t * The type of the modulator oscillator\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {String}\n\t\t * @name modulationType\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'modulationType', {\n\t get: function () {\n\t return this._modulator.type;\n\t },\n\t set: function (type) {\n\t this._modulator.type = type;\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._carrier.phase;\n\t },\n\t set: function (phase) {\n\t this._carrier.phase = phase;\n\t this._modulator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The partials of the carrier waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.FMOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.FMOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._carrier.partials;\n\t },\n\t set: function (partials) {\n\t this._carrier.partials = partials;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.FMOscillator} this\n\t\t */\n\t Tone.FMOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'modulationIndex',\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this.modulationIndex.dispose();\n\t this.modulationIndex = null;\n\t return this;\n\t };\n\t return Tone.FMOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.AMOscillator\n\t\t *\n\t\t * @extends {Tone.Oscillator}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {String} type The type of the carrier oscillator.\n\t\t * @param {String} modulationType The type of the modulator oscillator.\n\t\t * @example\n\t\t * //a sine oscillator frequency-modulated by a square wave\n\t\t * var fmOsc = new Tone.AMOscillator(\"Ab3\", \"sine\", \"square\").toMaster().start();\n\t\t */\n\t Tone.AMOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'modulationType'\n\t ], Tone.AMOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The carrier oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Oscillator(options.frequency, options.type);\n\t /**\n\t\t\t * The oscillator's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this._carrier.frequency;\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this._carrier.detune;\n\t this.detune.value = options.detune;\n\t /**\n\t\t\t * The modulating oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Oscillator(options.frequency, options.modulationType);\n\t /**\n\t\t\t * convert the -1,1 output to 0,1\n\t\t\t * @type {Tone.AudioToGain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationScale = new Tone.AudioToGain();\n\t /**\n\t\t\t * Harmonicity is the frequency ratio between the carrier and the modulator oscillators.\n\t\t\t * A harmonicity of 1 gives both oscillators the same frequency.\n\t\t\t * Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch the modulator an octave below carrier\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain(0);\n\t //connections\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.detune.connect(this._modulator.detune);\n\t this._modulator.chain(this._modulationScale, this._modulationNode.gain);\n\t this._carrier.chain(this._modulationNode, this.output);\n\t this.phase = options.phase;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t };\n\t Tone.extend(Tone.AMOscillator, Tone.Oscillator);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.AMOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'modulationType': 'square',\n\t 'harmonicity': 1\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.AMOscillator.prototype._start = function (time) {\n\t this._modulator.start(time);\n\t this._carrier.start(time);\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.AMOscillator.prototype._stop = function (time) {\n\t this._modulator.stop(time);\n\t this._carrier.stop(time);\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.AMOscillator.prototype.restart = function (time) {\n\t this._modulator.restart(time);\n\t this._carrier.restart(time);\n\t };\n\t /**\n\t\t * The type of the carrier oscillator\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'type', {\n\t get: function () {\n\t return this._carrier.type;\n\t },\n\t set: function (type) {\n\t this._carrier.type = type;\n\t }\n\t });\n\t /**\n\t\t * The type of the modulator oscillator\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {string}\n\t\t * @name modulationType\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'modulationType', {\n\t get: function () {\n\t return this._modulator.type;\n\t },\n\t set: function (type) {\n\t this._modulator.type = type;\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._carrier.phase;\n\t },\n\t set: function (phase) {\n\t this._carrier.phase = phase;\n\t this._modulator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The partials of the carrier waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.AMOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.AMOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._carrier.partials;\n\t },\n\t set: function (partials) {\n\t this._carrier.partials = partials;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.AMOscillator} this\n\t\t */\n\t Tone.AMOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'detune',\n\t 'harmonicity'\n\t ]);\n\t this.frequency = null;\n\t this.detune = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this._modulationScale.dispose();\n\t this._modulationScale = null;\n\t return this;\n\t };\n\t return Tone.AMOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.FatOscillator\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The starting frequency of the oscillator.\n\t\t * @param {String} type The type of the carrier oscillator.\n\t\t * @param {String} modulationType The type of the modulator oscillator.\n\t\t * @example\n\t\t * //a sine oscillator frequency-modulated by a square wave\n\t\t * var fmOsc = new Tone.FatOscillator(\"Ab3\", \"sine\", \"square\").toMaster().start();\n\t\t */\n\t Tone.FatOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type',\n\t 'spread'\n\t ], Tone.FatOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The oscillator's frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control signal.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * The array of oscillators\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillators = [];\n\t /**\n\t\t\t * The total spread of the oscillators\n\t\t\t * @type {Cents}\n\t\t\t * @private\n\t\t\t */\n\t this._spread = options.spread;\n\t /**\n\t\t\t * The type of the oscillator\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._type = options.type;\n\t /**\n\t\t\t * The phase of the oscillators\n\t\t\t * @type {Degrees}\n\t\t\t * @private\n\t\t\t */\n\t this._phase = options.phase;\n\t /**\n\t\t\t * The partials array\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._partials = Tone.defaultArg(options.partials, []);\n\t //set the count initially\n\t this.count = options.count;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.FatOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.FatOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'phase': 0,\n\t 'spread': 20,\n\t 'count': 3,\n\t 'type': 'sawtooth'\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype._start = function (time) {\n\t time = this.toSeconds(time);\n\t this._forEach(function (osc) {\n\t osc.start(time);\n\t });\n\t };\n\t /**\n\t\t * stop the oscillator\n\t\t * @param {Time} [time=now]\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._forEach(function (osc) {\n\t osc.stop(time);\n\t });\n\t };\n\t /**\n\t\t * restart the oscillator\n\t\t * @param {Time} time (optional) timing parameter\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype.restart = function (time) {\n\t time = this.toSeconds(time);\n\t this._forEach(function (osc) {\n\t osc.restart(time);\n\t });\n\t };\n\t /**\n\t\t * Iterate over all of the oscillators\n\t\t * @param {Function} iterator The iterator function\n\t\t * @private\n\t\t */\n\t Tone.FatOscillator.prototype._forEach = function (iterator) {\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t iterator.call(this, this._oscillators[i], i);\n\t }\n\t };\n\t /**\n\t\t * The type of the carrier oscillator\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {string}\n\t\t * @name type\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'type', {\n\t get: function () {\n\t return this._type;\n\t },\n\t set: function (type) {\n\t this._type = type;\n\t this._forEach(function (osc) {\n\t osc.type = type;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The detune spread between the oscillators. If \"count\" is\n\t\t * set to 3 oscillators and the \"spread\" is set to 40,\n\t\t * the three oscillators would be detuned like this: [-20, 0, 20]\n\t\t * for a total detune spread of 40 cents.\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Cents}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'spread', {\n\t get: function () {\n\t return this._spread;\n\t },\n\t set: function (spread) {\n\t this._spread = spread;\n\t if (this._oscillators.length > 1) {\n\t var start = -spread / 2;\n\t var step = spread / (this._oscillators.length - 1);\n\t this._forEach(function (osc, i) {\n\t osc.detune.value = start + step * i;\n\t });\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of detuned oscillators\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Number}\n\t\t * @name count\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'count', {\n\t get: function () {\n\t return this._oscillators.length;\n\t },\n\t set: function (count) {\n\t count = Math.max(count, 1);\n\t if (this._oscillators.length !== count) {\n\t // var partials = this.partials;\n\t // var type = this.type;\n\t //dispose the previous oscillators\n\t this._forEach(function (osc) {\n\t osc.dispose();\n\t });\n\t this._oscillators = [];\n\t for (var i = 0; i < count; i++) {\n\t var osc = new Tone.Oscillator();\n\t if (this.type === Tone.Oscillator.Type.Custom) {\n\t osc.partials = this._partials;\n\t } else {\n\t osc.type = this._type;\n\t }\n\t osc.phase = this._phase;\n\t osc.volume.value = -6 - count * 1.1;\n\t this.frequency.connect(osc.frequency);\n\t this.detune.connect(osc.detune);\n\t osc.connect(this.output);\n\t this._oscillators[i] = osc;\n\t }\n\t //set the spread\n\t this.spread = this._spread;\n\t if (this.state === Tone.State.Started) {\n\t this._forEach(function (osc) {\n\t osc.start();\n\t });\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Number}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._phase;\n\t },\n\t set: function (phase) {\n\t this._phase = phase;\n\t this._forEach(function (osc) {\n\t osc.phase = phase;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The partials of the carrier waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * @memberOf Tone.FatOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.FatOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._partials;\n\t },\n\t set: function (partials) {\n\t this._partials = partials;\n\t this._type = Tone.Oscillator.Type.Custom;\n\t this._forEach(function (osc) {\n\t osc.partials = partials;\n\t });\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.FatOscillator} this\n\t\t */\n\t Tone.FatOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this._forEach(function (osc) {\n\t osc.dispose();\n\t });\n\t this._oscillators = null;\n\t this._partials = null;\n\t return this;\n\t };\n\t return Tone.FatOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.OmniOscillator aggregates Tone.Oscillator, Tone.PulseOscillator,\n\t\t * Tone.PWMOscillator, Tone.FMOscillator, Tone.AMOscillator, and Tone.FatOscillator\n\t\t * into one class. The oscillator class can be changed by setting the `type`.\n\t\t * `omniOsc.type = \"pwm\"` will set it to the Tone.PWMOscillator. Prefixing\n\t\t * any of the basic types (\"sine\", \"square4\", etc.) with \"fm\", \"am\", or \"fat\"\n\t\t * will use the FMOscillator, AMOscillator or FatOscillator respectively.\n\t\t * For example: `omniOsc.type = \"fatsawtooth\"` will create set the oscillator\n\t\t * to a FatOscillator of type \"sawtooth\".\n\t\t *\n\t\t * @extends {Tone.Source}\n\t\t * @constructor\n\t\t * @param {Frequency} frequency The initial frequency of the oscillator.\n\t\t * @param {String} type The type of the oscillator.\n\t\t * @example\n\t\t * var omniOsc = new Tone.OmniOscillator(\"C#4\", \"pwm\");\n\t\t */\n\t Tone.OmniOscillator = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'frequency',\n\t 'type'\n\t ], Tone.OmniOscillator);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune control\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * the type of the oscillator source\n\t\t\t * @type {String}\n\t\t\t * @private\n\t\t\t */\n\t this._sourceType = undefined;\n\t /**\n\t\t\t * the oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillator = null;\n\t //set the oscillator\n\t this.type = options.type;\n\t this._readOnly([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t //set the options\n\t this.set(options);\n\t };\n\t Tone.extend(Tone.OmniOscillator, Tone.Source);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @type {Object}\n\t\t * @const\n\t\t */\n\t Tone.OmniOscillator.defaults = {\n\t 'frequency': 440,\n\t 'detune': 0,\n\t 'type': 'sine',\n\t 'phase': 0\n\t };\n\t /**\n\t\t * @enum {String}\n\t\t * @private\n\t\t */\n\t var OmniOscType = {\n\t Pulse: 'PulseOscillator',\n\t PWM: 'PWMOscillator',\n\t Osc: 'Oscillator',\n\t FM: 'FMOscillator',\n\t AM: 'AMOscillator',\n\t Fat: 'FatOscillator'\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now] the time to start the oscillator\n\t\t * @private\n\t\t */\n\t Tone.OmniOscillator.prototype._start = function (time) {\n\t this._oscillator.start(time);\n\t };\n\t /**\n\t\t * start the oscillator\n\t\t * @param {Time} [time=now] the time to start the oscillator\n\t\t * @private\n\t\t */\n\t Tone.OmniOscillator.prototype._stop = function (time) {\n\t this._oscillator.stop(time);\n\t };\n\t Tone.OmniOscillator.prototype.restart = function (time) {\n\t this._oscillator.restart(time);\n\t };\n\t /**\n\t\t * The type of the oscillator. Can be any of the basic types: sine, square, triangle, sawtooth. Or\n\t\t * prefix the basic types with \"fm\", \"am\", or \"fat\" to use the FMOscillator, AMOscillator or FatOscillator\n\t\t * types. The oscillator could also be set to \"pwm\" or \"pulse\". All of the parameters of the\n\t\t * oscillator's class are accessible when the oscillator is set to that type, but throws an error\n\t\t * when it's not.\n\t\t *\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {String}\n\t\t * @name type\n\t\t * @example\n\t\t * omniOsc.type = \"pwm\";\n\t\t * //modulationFrequency is parameter which is available\n\t\t * //only when the type is \"pwm\".\n\t\t * omniOsc.modulationFrequency.value = 0.5;\n\t\t * @example\n\t\t * //an square wave frequency modulated by a sawtooth\n\t\t * omniOsc.type = \"fmsquare\";\n\t\t * omniOsc.modulationType = \"sawtooth\";\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'type', {\n\t get: function () {\n\t var prefix = '';\n\t if (this._sourceType === OmniOscType.FM) {\n\t prefix = 'fm';\n\t } else if (this._sourceType === OmniOscType.AM) {\n\t prefix = 'am';\n\t } else if (this._sourceType === OmniOscType.Fat) {\n\t prefix = 'fat';\n\t }\n\t return prefix + this._oscillator.type;\n\t },\n\t set: function (type) {\n\t if (type.substr(0, 2) === 'fm') {\n\t this._createNewOscillator(OmniOscType.FM);\n\t this._oscillator.type = type.substr(2);\n\t } else if (type.substr(0, 2) === 'am') {\n\t this._createNewOscillator(OmniOscType.AM);\n\t this._oscillator.type = type.substr(2);\n\t } else if (type.substr(0, 3) === 'fat') {\n\t this._createNewOscillator(OmniOscType.Fat);\n\t this._oscillator.type = type.substr(3);\n\t } else if (type === 'pwm') {\n\t this._createNewOscillator(OmniOscType.PWM);\n\t } else if (type === 'pulse') {\n\t this._createNewOscillator(OmniOscType.Pulse);\n\t } else {\n\t this._createNewOscillator(OmniOscType.Osc);\n\t this._oscillator.type = type;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The partials of the waveform. A partial represents\n\t\t * the amplitude at a harmonic. The first harmonic is the\n\t\t * fundamental frequency, the second is the octave and so on\n\t\t * following the harmonic series.\n\t\t * Setting this value will automatically set the type to \"custom\".\n\t\t * The value is an empty array when the type is not \"custom\".\n\t\t * This is not available on \"pwm\" and \"pulse\" oscillator types.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Array}\n\t\t * @name partials\n\t\t * @example\n\t\t * osc.partials = [1, 0.2, 0.01];\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'partials', {\n\t get: function () {\n\t return this._oscillator.partials;\n\t },\n\t set: function (partials) {\n\t this._oscillator.partials = partials;\n\t }\n\t });\n\t /**\n\t\t * Set a member/attribute of the oscillator.\n\t\t * @param {Object|String} params\n\t\t * @param {number=} value\n\t\t * @param {Time=} rampTime\n\t\t * @returns {Tone.OmniOscillator} this\n\t\t */\n\t Tone.OmniOscillator.prototype.set = function (params, value) {\n\t //make sure the type is set first\n\t if (params === 'type') {\n\t this.type = value;\n\t } else if (Tone.isObject(params) && params.hasOwnProperty('type')) {\n\t this.type = params.type;\n\t }\n\t //then set the rest\n\t Tone.prototype.set.apply(this, arguments);\n\t return this;\n\t };\n\t /**\n\t\t * connect the oscillator to the frequency and detune signals\n\t\t * @private\n\t\t */\n\t Tone.OmniOscillator.prototype._createNewOscillator = function (oscType) {\n\t if (oscType !== this._sourceType) {\n\t this._sourceType = oscType;\n\t var OscillatorConstructor = Tone[oscType];\n\t //short delay to avoid clicks on the change\n\t var now = this.now();\n\t if (this._oscillator !== null) {\n\t var oldOsc = this._oscillator;\n\t oldOsc.stop(now);\n\t //dispose the old one\n\t this.context.setTimeout(function () {\n\t oldOsc.dispose();\n\t oldOsc = null;\n\t }, this.blockTime);\n\t }\n\t this._oscillator = new OscillatorConstructor();\n\t this.frequency.connect(this._oscillator.frequency);\n\t this.detune.connect(this._oscillator.detune);\n\t this._oscillator.connect(this.output);\n\t if (this.state === Tone.State.Started) {\n\t this._oscillator.start(now);\n\t }\n\t }\n\t };\n\t /**\n\t\t * The phase of the oscillator in degrees.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Degrees}\n\t\t * @name phase\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'phase', {\n\t get: function () {\n\t return this._oscillator.phase;\n\t },\n\t set: function (phase) {\n\t this._oscillator.phase = phase;\n\t }\n\t });\n\t /**\n\t\t * The width of the oscillator (only if the oscillator is set to \"pulse\")\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {NormalRange}\n\t\t * @signal\n\t\t * @name width\n\t\t * @example\n\t\t * var omniOsc = new Tone.OmniOscillator(440, \"pulse\");\n\t\t * //can access the width attribute only if type === \"pulse\"\n\t\t * omniOsc.width.value = 0.2;\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'width', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.Pulse) {\n\t return this._oscillator.width;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The number of detuned oscillators\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Number}\n\t\t * @name count\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'count', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t return this._oscillator.count;\n\t }\n\t },\n\t set: function (count) {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t this._oscillator.count = count;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The detune spread between the oscillators. If \"count\" is\n\t\t * set to 3 oscillators and the \"spread\" is set to 40,\n\t\t * the three oscillators would be detuned like this: [-20, 0, 20]\n\t\t * for a total detune spread of 40 cents. See Tone.FatOscillator\n\t\t * for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Cents}\n\t\t * @name spread\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'spread', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t return this._oscillator.spread;\n\t }\n\t },\n\t set: function (spread) {\n\t if (this._sourceType === OmniOscType.Fat) {\n\t this._oscillator.spread = spread;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The type of the modulator oscillator. Only if the oscillator\n\t\t * is set to \"am\" or \"fm\" types. see. Tone.AMOscillator or Tone.FMOscillator\n\t\t * for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {String}\n\t\t * @name modulationType\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'modulationType', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.FM || this._sourceType === OmniOscType.AM) {\n\t return this._oscillator.modulationType;\n\t }\n\t },\n\t set: function (mType) {\n\t if (this._sourceType === OmniOscType.FM || this._sourceType === OmniOscType.AM) {\n\t this._oscillator.modulationType = mType;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The modulation index which is in essence the depth or amount of the modulation. In other terms it is the\n\t\t * ratio of the frequency of the modulating signal (mf) to the amplitude of the\n\t\t * modulating signal (ma) -- as in ma/mf.\n\t\t * See Tone.FMOscillator for more info.\n\t\t * @type {Positive}\n\t\t * @signal\n\t\t * @name modulationIndex\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'modulationIndex', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.FM) {\n\t return this._oscillator.modulationIndex;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Harmonicity is the frequency ratio between the carrier and the modulator oscillators.\n\t\t * A harmonicity of 1 gives both oscillators the same frequency.\n\t\t * Harmonicity = 2 means a change of an octave. See Tone.AMOscillator or Tone.FMOscillator\n\t\t * for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @signal\n\t\t * @type {Positive}\n\t\t * @name harmonicity\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'harmonicity', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.FM || this._sourceType === OmniOscType.AM) {\n\t return this._oscillator.harmonicity;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The modulationFrequency Signal of the oscillator\n\t\t * (only if the oscillator type is set to pwm). See\n\t\t * Tone.PWMOscillator for more info.\n\t\t * @memberOf Tone.OmniOscillator#\n\t\t * @type {Frequency}\n\t\t * @signal\n\t\t * @name modulationFrequency\n\t\t * @example\n\t\t * var omniOsc = new Tone.OmniOscillator(440, \"pwm\");\n\t\t * //can access the modulationFrequency attribute only if type === \"pwm\"\n\t\t * omniOsc.modulationFrequency.value = 0.2;\n\t\t */\n\t Object.defineProperty(Tone.OmniOscillator.prototype, 'modulationFrequency', {\n\t get: function () {\n\t if (this._sourceType === OmniOscType.PWM) {\n\t return this._oscillator.modulationFrequency;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.OmniOscillator} this\n\t\t */\n\t Tone.OmniOscillator.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'detune'\n\t ]);\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this._oscillator.dispose();\n\t this._oscillator = null;\n\t this._sourceType = null;\n\t return this;\n\t };\n\t return Tone.OmniOscillator;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Base-class for all instruments\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t */\n\t Tone.Instrument = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.Instrument.defaults);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The output and volume triming node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * source.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t /**\n\t\t\t * Keep track of all events scheduled to the transport\n\t\t\t * when the instrument is 'synced'\n\t\t\t * @type {Array<Number>}\n\t\t\t * @private\n\t\t\t */\n\t this._scheduledEvents = [];\n\t };\n\t Tone.extend(Tone.Instrument, Tone.AudioNode);\n\t /**\n\t\t * the default attributes\n\t\t * @type {object}\n\t\t */\n\t Tone.Instrument.defaults = {\n\t /** the volume of the output in decibels */\n\t 'volume': 0\n\t };\n\t /**\n\t\t * @abstract\n\t\t * @param {string|number} note the note to trigger\n\t\t * @param {Time} [time=now] the time to trigger the ntoe\n\t\t * @param {number} [velocity=1] the velocity to trigger the note\n\t\t */\n\t Tone.Instrument.prototype.triggerAttack = Tone.noOp;\n\t /**\n\t\t * @abstract\n\t\t * @param {Time} [time=now] when to trigger the release\n\t\t */\n\t Tone.Instrument.prototype.triggerRelease = Tone.noOp;\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * instrument.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * instrument.triggerAttackRelease('C4', '8n', 0)\n\t\t * instrument.triggerAttackRelease('E4', '8n', '8n')\n\t\t * instrument.triggerAttackRelease('G4', '8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Instrument.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 1);\n\t this._syncMethod('triggerRelease', 0);\n\t return this;\n\t };\n\t /**\n\t\t * Wrap the given method so that it can be synchronized\n\t\t * @param {String} method Which method to wrap and sync\n\t\t * @param {Number} timePosition What position the time argument appears in\n\t\t * @private\n\t\t */\n\t Tone.Instrument.prototype._syncMethod = function (method, timePosition) {\n\t var originalMethod = this['_original_' + method] = this[method];\n\t this[method] = function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t var time = args[timePosition];\n\t var id = Tone.Transport.schedule(function (t) {\n\t args[timePosition] = t;\n\t originalMethod.apply(this, args);\n\t }.bind(this), time);\n\t this._scheduledEvents.push(id);\n\t }.bind(this);\n\t };\n\t /**\n\t\t * Unsync the instrument from the Transport\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Instrument.prototype.unsync = function () {\n\t this._scheduledEvents.forEach(function (id) {\n\t Tone.Transport.clear(id);\n\t });\n\t this._scheduledEvents = [];\n\t if (this._original_triggerAttack) {\n\t this.triggerAttack = this._original_triggerAttack;\n\t this.triggerRelease = this._original_triggerRelease;\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and then the release after the duration.\n\t\t * @param {Frequency} note The note to trigger.\n\t\t * @param {Time} duration How long the note should be held for before\n\t\t * triggering the release. This value must be greater than 0.\n\t\t * @param {Time} [time=now] When the note should be triggered.\n\t\t * @param {NormalRange} [velocity=1] The velocity the note should be triggered at.\n\t\t * @returns {Tone.Instrument} this\n\t\t * @example\n\t\t * //trigger \"C4\" for the duration of an 8th note\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\");\n\t\t */\n\t Tone.Instrument.prototype.triggerAttackRelease = function (note, duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(note, time, velocity);\n\t this.triggerRelease(time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Instrument.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._volume.dispose();\n\t this._volume = null;\n\t this._writable(['volume']);\n\t this.volume = null;\n\t this.unsync();\n\t this._scheduledEvents = null;\n\t return this;\n\t };\n\t return Tone.Instrument;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class This is an abstract base class for other monophonic instruments to \n\t\t * extend. IMPORTANT: It does not make any sound on its own and\n\t\t * shouldn't be directly instantiated.\n\t\t *\n\t\t * @constructor\n\t\t * @abstract\n\t\t * @extends {Tone.Instrument}\n\t\t */\n\t Tone.Monophonic = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.Monophonic.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The glide time between notes. \n\t\t\t * @type {Time}\n\t\t\t */\n\t this.portamento = options.portamento;\n\t };\n\t Tone.extend(Tone.Monophonic, Tone.Instrument);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Monophonic.defaults = { 'portamento': 0 };\n\t /**\n\t\t * Trigger the attack of the note optionally with a given velocity. \n\t\t * \n\t\t * \n\t\t * @param {Frequency} note The note to trigger.\n\t\t * @param {Time} [time=now] When the note should start.\n\t\t * @param {number} [velocity=1] velocity The velocity scaler \n\t\t * determines how \"loud\" the note \n\t\t * will be triggered.\n\t\t * @returns {Tone.Monophonic} this\n\t\t * @example\n\t\t * synth.triggerAttack(\"C4\");\n\t\t * @example\n\t\t * //trigger the note a half second from now at half velocity\n\t\t * synth.triggerAttack(\"C4\", \"+0.5\", 0.5);\n\t\t */\n\t Tone.Monophonic.prototype.triggerAttack = function (note, time, velocity) {\n\t time = this.toSeconds(time);\n\t this._triggerEnvelopeAttack(time, velocity);\n\t this.setNote(note, time);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release portion of the envelope\n\t\t * @param {Time} [time=now] If no time is given, the release happens immediatly\n\t\t * @returns {Tone.Monophonic} this\n\t\t * @example\n\t\t * synth.triggerRelease();\n\t\t */\n\t Tone.Monophonic.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * override this method with the actual method\n\t\t * @abstract\n\t\t * @private\n\t\t */\n\t Tone.Monophonic.prototype._triggerEnvelopeAttack = function () {\n\t };\n\t /**\n\t\t * override this method with the actual method\n\t\t * @abstract\n\t\t * @private\n\t\t */\n\t Tone.Monophonic.prototype._triggerEnvelopeRelease = function () {\n\t };\n\t /**\n\t\t * Get the level of the output at the given time. Measures\n\t\t * the envelope(s) value at the time. \n\t\t * @param {Time} time The time to query the envelope value\n\t\t * @return {NormalRange} The output level between 0-1\n\t\t */\n\t Tone.Monophonic.prototype.getLevelAtTime = function (time) {\n\t time = this.toSeconds(time);\n\t return this.envelope.getValueAtTime(time);\n\t };\n\t /**\n\t\t * Set the note at the given time. If no time is given, the note\n\t\t * will set immediately. \n\t\t * @param {Frequency} note The note to change to.\n\t\t * @param {Time} [time=now] The time when the note should be set. \n\t\t * @returns {Tone.Monophonic} this\n\t\t * @example\n\t\t * //change to F#6 in one quarter note from now.\n\t\t * synth.setNote(\"F#6\", \"+4n\");\n\t\t * @example\n\t\t * //change to Bb4 right now\n\t\t * synth.setNote(\"Bb4\");\n\t\t */\n\t Tone.Monophonic.prototype.setNote = function (note, time) {\n\t time = this.toSeconds(time);\n\t if (this.portamento > 0 && this.getLevelAtTime(time) > 0.05) {\n\t var portTime = this.toSeconds(this.portamento);\n\t this.frequency.exponentialRampTo(note, portTime, time);\n\t } else {\n\t this.frequency.setValueAtTime(note, time);\n\t }\n\t return this;\n\t };\n\t return Tone.Monophonic;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Synth is composed simply of a Tone.OmniOscillator\n\t\t * routed through a Tone.AmplitudeEnvelope.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1-1_0YW2Z1J2EPI36P8fNCMcZG7N1w1GZluPs4og4evo/pub?w=1163&h=231\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.Synth().toMaster();\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\");\n\t\t */\n\t Tone.Synth = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.Synth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.OmniOscillator}\n\t\t\t */\n\t this.oscillator = new Tone.OmniOscillator(options.oscillator);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this.oscillator.frequency;\n\t /**\n\t\t\t * The detune control.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this.oscillator.detune;\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t //connect the oscillators to the output\n\t this.oscillator.chain(this.envelope, this.output);\n\t this._readOnly([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.Synth, Tone.Monophonic);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.Synth.defaults = {\n\t 'oscillator': { 'type': 'triangle' },\n\t 'envelope': {\n\t 'attack': 0.005,\n\t 'decay': 0.1,\n\t 'sustain': 0.3,\n\t 'release': 1\n\t }\n\t };\n\t /**\n\t\t * start the attack portion of the envelope\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {number} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.Synth} this\n\t\t * @private\n\t\t */\n\t Tone.Synth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t //the envelopes\n\t this.envelope.triggerAttack(time, velocity);\n\t this.oscillator.start(time);\n\t //if there is no release portion, stop the oscillator\n\t if (this.envelope.sustain === 0) {\n\t this.oscillator.stop(time + this.envelope.attack + this.envelope.decay);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * start the release portion of the envelope\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.Synth} this\n\t\t * @private\n\t\t */\n\t Tone.Synth.prototype._triggerEnvelopeRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this.envelope.triggerRelease(time);\n\t this.oscillator.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Synth} this\n\t\t */\n\t Tone.Synth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'envelope'\n\t ]);\n\t this.oscillator.dispose();\n\t this.oscillator = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t this.frequency = null;\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.Synth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class AMSynth uses the output of one Tone.Synth to modulate the\n\t\t * amplitude of another Tone.Synth. The harmonicity (the ratio between\n\t\t * the two signals) affects the timbre of the output signal greatly.\n\t\t * Read more about Amplitude Modulation Synthesis on\n\t\t * [SoundOnSound](https://web.archive.org/web/20160404103653/http://www.soundonsound.com:80/sos/mar00/articles/synthsecrets.htm).\n\t\t * <img src=\"https://docs.google.com/drawings/d/1TQu8Ed4iFr1YTLKpB3U1_hur-UwBrh5gdBXc8BxfGKw/pub?w=1009&h=457\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.AMSynth().toMaster();\n\t\t * synth.triggerAttackRelease(\"C4\", \"4n\");\n\t\t */\n\t Tone.AMSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.AMSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The carrier voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Synth();\n\t this._carrier.volume.value = -10;\n\t /**\n\t\t\t * The carrier's oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.oscillator = this._carrier.oscillator;\n\t /**\n\t\t\t * The carrier's envelope\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = this._carrier.envelope.set(options.envelope);\n\t /**\n\t\t\t * The modulator voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Synth();\n\t this._modulator.volume.value = -10;\n\t /**\n\t\t\t * The modulator's oscillator which is applied\n\t\t\t * to the amplitude of the oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.modulation = this._modulator.oscillator.set(options.modulation);\n\t /**\n\t\t\t * The modulator's envelope\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.modulationEnvelope = this._modulator.envelope.set(options.modulationEnvelope);\n\t /**\n\t\t\t * The frequency.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(440, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune in cents\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * Harmonicity is the ratio between the two voices. A harmonicity of\n\t\t\t * 1 is no change. Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch voice1 an octave below voice0\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * convert the -1,1 output to 0,1\n\t\t\t * @type {Tone.AudioToGain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationScale = new Tone.AudioToGain();\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain();\n\t //control the two voices frequency\n\t this.frequency.connect(this._carrier.frequency);\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.detune.fan(this._carrier.detune, this._modulator.detune);\n\t this._modulator.chain(this._modulationScale, this._modulationNode.gain);\n\t this._carrier.chain(this._modulationNode, this.output);\n\t this._readOnly([\n\t 'frequency',\n\t 'harmonicity',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.AMSynth, Tone.Monophonic);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.AMSynth.defaults = {\n\t 'harmonicity': 3,\n\t 'detune': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0.01,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'modulation': { 'type': 'square' },\n\t 'modulationEnvelope': {\n\t 'attack': 0.5,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t };\n\t /**\n\t\t * trigger the attack portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will occur\n\t\t * @param {NormalRange} [velocity=1] the velocity of the note\n\t\t * @private\n\t\t * @returns {Tone.AMSynth} this\n\t\t */\n\t Tone.AMSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t //the port glide\n\t time = this.toSeconds(time);\n\t //the envelopes\n\t this._carrier._triggerEnvelopeAttack(time, velocity);\n\t this._modulator._triggerEnvelopeAttack(time);\n\t return this;\n\t };\n\t /**\n\t\t * trigger the release portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will release\n\t\t * @private\n\t\t * @returns {Tone.AMSynth} this\n\t\t */\n\t Tone.AMSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t this._carrier._triggerEnvelopeRelease(time);\n\t this._modulator._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.AMSynth} this\n\t\t */\n\t Tone.AMSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'harmonicity',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._modulationScale.dispose();\n\t this._modulationScale = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this.oscillator = null;\n\t this.envelope = null;\n\t this.modulationEnvelope = null;\n\t this.modulation = null;\n\t return this;\n\t };\n\t return Tone.AMSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.MonoSynth is composed of one oscillator, one filter, and two envelopes.\n\t\t * The amplitude of the Tone.Oscillator and the cutoff frequency of the\n\t\t * Tone.Filter are controlled by Tone.Envelopes.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1gaY1DF9_Hzkodqf8JI1Cg2VZfwSElpFQfI94IQwad38/pub?w=924&h=240\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.MonoSynth({\n\t\t * \t\"oscillator\" : {\n\t\t * \t\t\"type\" : \"square\"\n\t\t * },\n\t\t * \"envelope\" : {\n\t\t * \t\"attack\" : 0.1\n\t\t * }\n\t\t * }).toMaster();\n\t\t * synth.triggerAttackRelease(\"C4\", \"8n\");\n\t\t */\n\t Tone.MonoSynth = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.MonoSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.OmniOscillator}\n\t\t\t */\n\t this.oscillator = new Tone.OmniOscillator(options.oscillator);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = this.oscillator.frequency;\n\t /**\n\t\t\t * The detune control.\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = this.oscillator.detune;\n\t /**\n\t\t\t * The filter.\n\t\t\t * @type {Tone.Filter}\n\t\t\t */\n\t this.filter = new Tone.Filter(options.filter);\n\t /**\n\t\t\t * The filter envelope.\n\t\t\t * @type {Tone.FrequencyEnvelope}\n\t\t\t */\n\t this.filterEnvelope = new Tone.FrequencyEnvelope(options.filterEnvelope);\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t //connect the oscillators to the output\n\t this.oscillator.chain(this.filter, this.envelope, this.output);\n\t //connect the filter envelope\n\t this.filterEnvelope.connect(this.filter.frequency);\n\t this._readOnly([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'filter',\n\t 'filterEnvelope',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.MonoSynth, Tone.Monophonic);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MonoSynth.defaults = {\n\t 'frequency': 'C4',\n\t 'detune': 0,\n\t 'oscillator': { 'type': 'square' },\n\t 'filter': {\n\t 'Q': 6,\n\t 'type': 'lowpass',\n\t 'rolloff': -24\n\t },\n\t 'envelope': {\n\t 'attack': 0.005,\n\t 'decay': 0.1,\n\t 'sustain': 0.9,\n\t 'release': 1\n\t },\n\t 'filterEnvelope': {\n\t 'attack': 0.06,\n\t 'decay': 0.2,\n\t 'sustain': 0.5,\n\t 'release': 2,\n\t 'baseFrequency': 200,\n\t 'octaves': 7,\n\t 'exponent': 2\n\t }\n\t };\n\t /**\n\t\t * start the attack portion of the envelope\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {NormalRange} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.MonoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.MonoSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t //the envelopes\n\t this.envelope.triggerAttack(time, velocity);\n\t this.filterEnvelope.triggerAttack(time);\n\t this.oscillator.start(time);\n\t if (this.envelope.sustain === 0) {\n\t this.oscillator.stop(time + this.envelope.attack + this.envelope.decay);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * start the release portion of the envelope\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.MonoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.MonoSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t this.envelope.triggerRelease(time);\n\t this.filterEnvelope.triggerRelease(time);\n\t this.oscillator.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.MonoSynth} this\n\t\t */\n\t Tone.MonoSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'oscillator',\n\t 'frequency',\n\t 'detune',\n\t 'filter',\n\t 'filterEnvelope',\n\t 'envelope'\n\t ]);\n\t this.oscillator.dispose();\n\t this.oscillator = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t this.filterEnvelope.dispose();\n\t this.filterEnvelope = null;\n\t this.filter.dispose();\n\t this.filter = null;\n\t this.frequency = null;\n\t this.detune = null;\n\t return this;\n\t };\n\t return Tone.MonoSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.DuoSynth is a monophonic synth composed of two\n\t\t * MonoSynths run in parallel with control over the\n\t\t * frequency ratio between the two voices and vibrato effect.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1bL4GXvfRMMlqS7XyBm9CjL9KJPSUKbcdBNpqOlkFLxk/pub?w=1012&h=448\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var duoSynth = new Tone.DuoSynth().toMaster();\n\t\t * duoSynth.triggerAttackRelease(\"C4\", \"2n\");\n\t\t */\n\t Tone.DuoSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.DuoSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * the first voice\n\t\t\t * @type {Tone.MonoSynth}\n\t\t\t */\n\t this.voice0 = new Tone.MonoSynth(options.voice0);\n\t this.voice0.volume.value = -10;\n\t /**\n\t\t\t * the second voice\n\t\t\t * @type {Tone.MonoSynth}\n\t\t\t */\n\t this.voice1 = new Tone.MonoSynth(options.voice1);\n\t this.voice1.volume.value = -10;\n\t /**\n\t\t\t * The vibrato LFO.\n\t\t\t * @type {Tone.LFO}\n\t\t\t * @private\n\t\t\t */\n\t this._vibrato = new Tone.LFO(options.vibratoRate, -50, 50);\n\t this._vibrato.start();\n\t /**\n\t\t\t * the vibrato frequency\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.vibratoRate = this._vibrato.frequency;\n\t /**\n\t\t\t * the vibrato gain\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._vibratoGain = new Tone.Gain(options.vibratoAmount, Tone.Type.Positive);\n\t /**\n\t\t\t * The amount of vibrato\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t */\n\t this.vibratoAmount = this._vibratoGain.gain;\n\t /**\n\t\t\t * the frequency control\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(440, Tone.Type.Frequency);\n\t /**\n\t\t\t * Harmonicity is the ratio between the two voices. A harmonicity of\n\t\t\t * 1 is no change. Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch voice1 an octave below voice0\n\t\t\t * duoSynth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t //control the two voices frequency\n\t this.frequency.connect(this.voice0.frequency);\n\t this.frequency.chain(this.harmonicity, this.voice1.frequency);\n\t this._vibrato.connect(this._vibratoGain);\n\t this._vibratoGain.fan(this.voice0.detune, this.voice1.detune);\n\t this.voice0.connect(this.output);\n\t this.voice1.connect(this.output);\n\t this._readOnly([\n\t 'voice0',\n\t 'voice1',\n\t 'frequency',\n\t 'vibratoAmount',\n\t 'vibratoRate'\n\t ]);\n\t };\n\t Tone.extend(Tone.DuoSynth, Tone.Monophonic);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.DuoSynth.defaults = {\n\t 'vibratoAmount': 0.5,\n\t 'vibratoRate': 5,\n\t 'harmonicity': 1.5,\n\t 'voice0': {\n\t 'volume': -10,\n\t 'portamento': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'filterEnvelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t },\n\t 'voice1': {\n\t 'volume': -10,\n\t 'portamento': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'filterEnvelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t }\n\t };\n\t /**\n\t\t * start the attack portion of the envelopes\n\t\t *\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {NormalRange} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.DuoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.DuoSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t this.voice0._triggerEnvelopeAttack(time, velocity);\n\t this.voice1._triggerEnvelopeAttack(time, velocity);\n\t return this;\n\t };\n\t /**\n\t\t * start the release portion of the envelopes\n\t\t *\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.DuoSynth} this\n\t\t * @private\n\t\t */\n\t Tone.DuoSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t this.voice0._triggerEnvelopeRelease(time);\n\t this.voice1._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the level of the output at the given time. Measures\n\t\t * the envelope(s) value at the time. \n\t\t * @param {Time} time The time to query the envelope value\n\t\t * @return {NormalRange} The output level between 0-1\n\t\t */\n\t Tone.DuoSynth.prototype.getLevelAtTime = function (time) {\n\t return (this.voice0.getLevelAtTime(time) + this.voice1.getLevelAtTime(time)) / 2;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.DuoSynth} this\n\t\t */\n\t Tone.DuoSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'voice0',\n\t 'voice1',\n\t 'frequency',\n\t 'vibratoAmount',\n\t 'vibratoRate'\n\t ]);\n\t this.voice0.dispose();\n\t this.voice0 = null;\n\t this.voice1.dispose();\n\t this.voice1 = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this._vibratoGain.dispose();\n\t this._vibratoGain = null;\n\t this._vibrato = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this.vibratoAmount.dispose();\n\t this.vibratoAmount = null;\n\t this.vibratoRate = null;\n\t return this;\n\t };\n\t return Tone.DuoSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class FMSynth is composed of two Tone.Synths where one Tone.Synth modulates\n\t\t * the frequency of a second Tone.Synth. A lot of spectral content\n\t\t * can be explored using the modulationIndex parameter. Read more about\n\t\t * frequency modulation synthesis on Sound On Sound: [Part 1](https://web.archive.org/web/20160403123704/http://www.soundonsound.com/sos/apr00/articles/synthsecrets.htm), [Part 2](https://web.archive.org/web/20160403115835/http://www.soundonsound.com/sos/may00/articles/synth.htm).\n\t\t * <img src=\"https://docs.google.com/drawings/d/1h0PUDZXPgi4Ikx6bVT6oncrYPLluFKy7lj53puxj-DM/pub?w=902&h=462\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Monophonic}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var fmSynth = new Tone.FMSynth().toMaster();\n\t\t * fmSynth.triggerAttackRelease(\"C5\", \"4n\");\n\t\t */\n\t Tone.FMSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.FMSynth.defaults);\n\t Tone.Monophonic.call(this, options);\n\t /**\n\t\t\t * The carrier voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._carrier = new Tone.Synth(options.carrier);\n\t this._carrier.volume.value = -10;\n\t /**\n\t\t\t * The carrier's oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.oscillator = this._carrier.oscillator;\n\t /**\n\t\t\t * The carrier's envelope\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.envelope = this._carrier.envelope.set(options.envelope);\n\t /**\n\t\t\t * The modulator voice.\n\t\t\t * @type {Tone.Synth}\n\t\t\t * @private\n\t\t\t */\n\t this._modulator = new Tone.Synth(options.modulator);\n\t this._modulator.volume.value = -10;\n\t /**\n\t\t\t * The modulator's oscillator which is applied\n\t\t\t * to the amplitude of the oscillator\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.modulation = this._modulator.oscillator.set(options.modulation);\n\t /**\n\t\t\t * The modulator's envelope\n\t\t\t * @type {Tone.Oscillator}\n\t\t\t */\n\t this.modulationEnvelope = this._modulator.envelope.set(options.modulationEnvelope);\n\t /**\n\t\t\t * The frequency control.\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(440, Tone.Type.Frequency);\n\t /**\n\t\t\t * The detune in cents\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t /**\n\t\t\t * Harmonicity is the ratio between the two voices. A harmonicity of\n\t\t\t * 1 is no change. Harmonicity = 2 means a change of an octave.\n\t\t\t * @type {Positive}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * //pitch voice1 an octave below voice0\n\t\t\t * synth.harmonicity.value = 0.5;\n\t\t\t */\n\t this.harmonicity = new Tone.Multiply(options.harmonicity);\n\t this.harmonicity.units = Tone.Type.Positive;\n\t /**\n\t\t\t * The modulation index which essentially the depth or amount of the modulation. It is the\n\t\t\t * ratio of the frequency of the modulating signal (mf) to the amplitude of the\n\t\t\t * modulating signal (ma) -- as in ma/mf.\n\t\t\t *\t@type {Positive}\n\t\t\t *\t@signal\n\t\t\t */\n\t this.modulationIndex = new Tone.Multiply(options.modulationIndex);\n\t this.modulationIndex.units = Tone.Type.Positive;\n\t /**\n\t\t\t * the node where the modulation happens\n\t\t\t * @type {GainNode}\n\t\t\t * @private\n\t\t\t */\n\t this._modulationNode = new Tone.Gain(0);\n\t //control the two voices frequency\n\t this.frequency.connect(this._carrier.frequency);\n\t this.frequency.chain(this.harmonicity, this._modulator.frequency);\n\t this.frequency.chain(this.modulationIndex, this._modulationNode);\n\t this.detune.fan(this._carrier.detune, this._modulator.detune);\n\t this._modulator.connect(this._modulationNode.gain);\n\t this._modulationNode.connect(this._carrier.frequency);\n\t this._carrier.connect(this.output);\n\t this._readOnly([\n\t 'frequency',\n\t 'harmonicity',\n\t 'modulationIndex',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t };\n\t Tone.extend(Tone.FMSynth, Tone.Monophonic);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.FMSynth.defaults = {\n\t 'harmonicity': 3,\n\t 'modulationIndex': 10,\n\t 'detune': 0,\n\t 'oscillator': { 'type': 'sine' },\n\t 'envelope': {\n\t 'attack': 0.01,\n\t 'decay': 0.01,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t },\n\t 'modulation': { 'type': 'square' },\n\t 'modulationEnvelope': {\n\t 'attack': 0.5,\n\t 'decay': 0,\n\t 'sustain': 1,\n\t 'release': 0.5\n\t }\n\t };\n\t /**\n\t\t * \ttrigger the attack portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will occur\n\t\t * @param {number} [velocity=1] the velocity of the note\n\t\t * @returns {Tone.FMSynth} this\n\t\t * @private\n\t\t */\n\t Tone.FMSynth.prototype._triggerEnvelopeAttack = function (time, velocity) {\n\t time = this.toSeconds(time);\n\t //the envelopes\n\t this._carrier._triggerEnvelopeAttack(time, velocity);\n\t this._modulator._triggerEnvelopeAttack(time);\n\t return this;\n\t };\n\t /**\n\t\t * trigger the release portion of the note\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will release\n\t\t * @returns {Tone.FMSynth} this\n\t\t * @private\n\t\t */\n\t Tone.FMSynth.prototype._triggerEnvelopeRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this._carrier._triggerEnvelopeRelease(time);\n\t this._modulator._triggerEnvelopeRelease(time);\n\t return this;\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.FMSynth} this\n\t\t */\n\t Tone.FMSynth.prototype.dispose = function () {\n\t Tone.Monophonic.prototype.dispose.call(this);\n\t this._writable([\n\t 'frequency',\n\t 'harmonicity',\n\t 'modulationIndex',\n\t 'oscillator',\n\t 'envelope',\n\t 'modulation',\n\t 'modulationEnvelope',\n\t 'detune'\n\t ]);\n\t this._carrier.dispose();\n\t this._carrier = null;\n\t this._modulator.dispose();\n\t this._modulator = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.modulationIndex.dispose();\n\t this.modulationIndex = null;\n\t this.harmonicity.dispose();\n\t this.harmonicity = null;\n\t this._modulationNode.dispose();\n\t this._modulationNode = null;\n\t this.oscillator = null;\n\t this.envelope = null;\n\t this.modulationEnvelope = null;\n\t this.modulation = null;\n\t return this;\n\t };\n\t return Tone.FMSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.MembraneSynth makes kick and tom sounds using a single oscillator\n\t\t * with an amplitude envelope and frequency ramp. A Tone.OmniOscillator\n\t\t * is routed through a Tone.AmplitudeEnvelope to the output. The drum\n\t\t * quality of the sound comes from the frequency envelope applied\n\t\t * during Tone.MembraneSynth.triggerAttack(note). The frequency envelope\n\t\t * starts at <code>note * .octaves</code> and ramps to <code>note</code>\n\t\t * over the duration of <code>.pitchDecay</code>.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var synth = new Tone.MembraneSynth().toMaster();\n\t\t * synth.triggerAttackRelease(\"C2\", \"8n\");\n\t\t */\n\t Tone.MembraneSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.MembraneSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The oscillator.\n\t\t\t * @type {Tone.OmniOscillator}\n\t\t\t */\n\t this.oscillator = new Tone.OmniOscillator(options.oscillator);\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t /**\n\t\t\t * The number of octaves the pitch envelope ramps.\n\t\t\t * @type {Positive}\n\t\t\t */\n\t this.octaves = options.octaves;\n\t /**\n\t\t\t * The amount of time the frequency envelope takes.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.pitchDecay = options.pitchDecay;\n\t this.oscillator.chain(this.envelope, this.output);\n\t this._readOnly([\n\t 'oscillator',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.MembraneSynth, Tone.Instrument);\n\t /**\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.MembraneSynth.defaults = {\n\t 'pitchDecay': 0.05,\n\t 'octaves': 10,\n\t 'oscillator': { 'type': 'sine' },\n\t 'envelope': {\n\t 'attack': 0.001,\n\t 'decay': 0.4,\n\t 'sustain': 0.01,\n\t 'release': 1.4,\n\t 'attackCurve': 'exponential'\n\t }\n\t };\n\t /**\n\t\t * Trigger the note at the given time with the given velocity.\n\t\t *\n\t\t * @param {Frequency} note the note\n\t\t * @param {Time} [time=now] the time, if not given is now\n\t\t * @param {number} [velocity=1] velocity defaults to 1\n\t\t * @returns {Tone.MembraneSynth} this\n\t\t * @example\n\t\t * kick.triggerAttack(60);\n\t\t */\n\t Tone.MembraneSynth.prototype.triggerAttack = function (note, time, velocity) {\n\t time = this.toSeconds(time);\n\t note = this.toFrequency(note);\n\t var maxNote = note * this.octaves;\n\t this.oscillator.frequency.setValueAtTime(maxNote, time);\n\t this.oscillator.frequency.exponentialRampToValueAtTime(note, time + this.toSeconds(this.pitchDecay));\n\t this.envelope.triggerAttack(time, velocity);\n\t this.oscillator.start(time);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release portion of the note.\n\t\t *\n\t\t * @param {Time} [time=now] the time the note will release\n\t\t * @returns {Tone.MembraneSynth} this\n\t\t */\n\t Tone.MembraneSynth.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this.envelope.triggerRelease(time);\n\t this.oscillator.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.MembraneSynth} this\n\t\t */\n\t Tone.MembraneSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._writable([\n\t 'oscillator',\n\t 'envelope'\n\t ]);\n\t this.oscillator.dispose();\n\t this.oscillator = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t return this;\n\t };\n\t return Tone.MembraneSynth;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * Inharmonic ratio of frequencies based on the Roland TR-808\n\t\t * Taken from https://ccrma.stanford.edu/papers/tr-808-cymbal-physically-informed-circuit-bendable-digital-model\n\t\t * @private\n\t\t * @static\n\t\t * @type {Array}\n\t\t */\n\t var inharmRatios = [\n\t 1,\n\t 1.483,\n\t 1.932,\n\t 2.546,\n\t 2.63,\n\t 3.897\n\t ];\n\t /**\n\t\t * @class A highly inharmonic and spectrally complex source with a highpass filter\n\t\t * and amplitude envelope which is good for making metalophone sounds. Based\n\t\t * on CymbalSynth by [@polyrhythmatic](https://github.com/polyrhythmatic).\n\t\t * Inspiration from [Sound on Sound](https://web.archive.org/web/20160610143924/https://www.soundonsound.com/sos/jul02/articles/synthsecrets0702.asp).\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] The options availble for the synth\n\t\t * see defaults below\n\t\t */\n\t Tone.MetalSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.MetalSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The frequency of the cymbal\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);\n\t /**\n\t\t\t * The array of FMOscillators\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._oscillators = [];\n\t /**\n\t\t\t * The frequency multipliers\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._freqMultipliers = [];\n\t /**\n\t\t\t * The amplitude for the body\n\t\t\t * @type {Tone.Gain}\n\t\t\t * @private\n\t\t\t */\n\t this._amplitue = new Tone.Gain(0).connect(this.output);\n\t /**\n\t\t\t * highpass the output\n\t\t\t * @type {Tone.Filter}\n\t\t\t * @private\n\t\t\t */\n\t this._highpass = new Tone.Filter({\n\t 'type': 'highpass',\n\t 'Q': -3.0102999566398125\n\t }).connect(this._amplitue);\n\t /**\n\t\t\t * The number of octaves the highpass\n\t\t\t * filter frequency ramps\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._octaves = options.octaves;\n\t /**\n\t\t\t * Scale the body envelope\n\t\t\t * for the bandpass\n\t\t\t * @type {Tone.Scale}\n\t\t\t * @private\n\t\t\t */\n\t this._filterFreqScaler = new Tone.Scale(options.resonance, 7000);\n\t /**\n\t\t\t * The envelope which is connected both to the\n\t\t\t * amplitude and highpass filter's cutoff frequency\n\t\t\t * @type {Tone.Envelope}\n\t\t\t */\n\t this.envelope = new Tone.Envelope({\n\t 'attack': options.envelope.attack,\n\t 'attackCurve': 'linear',\n\t 'decay': options.envelope.decay,\n\t 'sustain': 0,\n\t 'release': options.envelope.release\n\t }).chain(this._filterFreqScaler, this._highpass.frequency);\n\t this.envelope.connect(this._amplitue.gain);\n\t for (var i = 0; i < inharmRatios.length; i++) {\n\t var osc = new Tone.FMOscillator({\n\t 'type': 'square',\n\t 'modulationType': 'square',\n\t 'harmonicity': options.harmonicity,\n\t 'modulationIndex': options.modulationIndex\n\t });\n\t osc.connect(this._highpass);\n\t this._oscillators[i] = osc;\n\t var mult = new Tone.Multiply(inharmRatios[i]);\n\t this._freqMultipliers[i] = mult;\n\t this.frequency.chain(mult, osc.frequency);\n\t }\n\t //set the octaves\n\t this.octaves = options.octaves;\n\t };\n\t Tone.extend(Tone.MetalSynth, Tone.Instrument);\n\t /**\n\t\t * default values\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.MetalSynth.defaults = {\n\t 'frequency': 200,\n\t 'envelope': {\n\t 'attack': 0.001,\n\t 'decay': 1.4,\n\t 'release': 0.2\n\t },\n\t 'harmonicity': 5.1,\n\t 'modulationIndex': 32,\n\t 'resonance': 4000,\n\t 'octaves': 1.5\n\t };\n\t /**\n\t\t * Trigger the attack.\n\t\t * @param {Time} time When the attack should be triggered.\n\t\t * @param {NormalRange} [velocity=1] The velocity that the envelope should be triggered at.\n\t\t * @return {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.triggerAttack = function (time, vel) {\n\t time = this.toSeconds(time);\n\t vel = Tone.defaultArg(vel, 1);\n\t this.envelope.triggerAttack(time, vel);\n\t this._oscillators.forEach(function (osc) {\n\t osc.start(time);\n\t });\n\t //if the sustain is 0, stop the oscillator as well\n\t if (this.envelope.sustain === 0) {\n\t this._oscillators.forEach(function (osc) {\n\t osc.stop(time + this.envelope.attack + this.envelope.decay);\n\t }.bind(this));\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release of the envelope.\n\t\t * @param {Time} time When the release should be triggered.\n\t\t * @return {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.triggerRelease = function (time) {\n\t time = this.toSeconds(time);\n\t this.envelope.triggerRelease(time);\n\t this._oscillators.forEach(function (osc) {\n\t osc.stop(time + this.envelope.release);\n\t }.bind(this));\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.MetalSynth.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 0);\n\t this._syncMethod('triggerRelease', 0);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and release of the envelope after the given\n\t\t * duration.\n\t\t * @param {Time} duration The duration before triggering the release\n\t\t * @param {Time} time When the attack should be triggered.\n\t\t * @param {NormalRange} [velocity=1] The velocity that the envelope should be triggered at.\n\t\t * @return {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.triggerAttackRelease = function (duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(time, velocity);\n\t this.triggerRelease(time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * The modulationIndex of the oscillators which make up the source.\n\t\t * see Tone.FMOscillator.modulationIndex\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Positive}\n\t\t * @name modulationIndex\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'modulationIndex', {\n\t get: function () {\n\t return this._oscillators[0].modulationIndex.value;\n\t },\n\t set: function (val) {\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t this._oscillators[i].modulationIndex.value = val;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The harmonicity of the oscillators which make up the source.\n\t\t * see Tone.FMOscillator.harmonicity\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Positive}\n\t\t * @name harmonicity\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'harmonicity', {\n\t get: function () {\n\t return this._oscillators[0].harmonicity.value;\n\t },\n\t set: function (val) {\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t this._oscillators[i].harmonicity.value = val;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The frequency of the highpass filter attached to the envelope\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Frequency}\n\t\t * @name resonance\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'resonance', {\n\t get: function () {\n\t return this._filterFreqScaler.min;\n\t },\n\t set: function (val) {\n\t this._filterFreqScaler.min = val;\n\t this.octaves = this._octaves;\n\t }\n\t });\n\t /**\n\t\t * The number of octaves above the \"resonance\" frequency\n\t\t * that the filter ramps during the attack/decay envelope\n\t\t * @memberOf Tone.MetalSynth#\n\t\t * @type {Number}\n\t\t * @name octaves\n\t\t */\n\t Object.defineProperty(Tone.MetalSynth.prototype, 'octaves', {\n\t get: function () {\n\t return this._octaves;\n\t },\n\t set: function (octs) {\n\t this._octaves = octs;\n\t this._filterFreqScaler.max = this._filterFreqScaler.min * Math.pow(2, octs);\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @returns {Tone.MetalSynth} this\n\t\t */\n\t Tone.MetalSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t for (var i = 0; i < this._oscillators.length; i++) {\n\t this._oscillators[i].dispose();\n\t this._freqMultipliers[i].dispose();\n\t }\n\t this._oscillators = null;\n\t this._freqMultipliers = null;\n\t this.frequency.dispose();\n\t this.frequency = null;\n\t this._filterFreqScaler.dispose();\n\t this._filterFreqScaler = null;\n\t this._amplitue.dispose();\n\t this._amplitue = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t this._highpass.dispose();\n\t this._highpass = null;\n\t };\n\t return Tone.MetalSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.NoiseSynth is composed of a noise generator (Tone.Noise), one filter (Tone.Filter),\n\t\t * and two envelopes (Tone.Envelop). One envelope controls the amplitude\n\t\t * of the noise and the other is controls the cutoff frequency of the filter.\n\t\t * <img src=\"https://docs.google.com/drawings/d/1rqzuX9rBlhT50MRvD2TKml9bnZhcZmzXF1rf_o7vdnE/pub?w=918&h=242\">\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] the options available for the synth\n\t\t * see defaults below\n\t\t * @example\n\t\t * var noiseSynth = new Tone.NoiseSynth().toMaster();\n\t\t * noiseSynth.triggerAttackRelease(\"8n\");\n\t\t */\n\t Tone.NoiseSynth = function (options) {\n\t //get the defaults\n\t options = Tone.defaultArg(options, Tone.NoiseSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * The noise source.\n\t\t\t * @type {Tone.Noise}\n\t\t\t * @example\n\t\t\t * noiseSynth.set(\"noise.type\", \"brown\");\n\t\t\t */\n\t this.noise = new Tone.Noise();\n\t /**\n\t\t\t * The amplitude envelope.\n\t\t\t * @type {Tone.AmplitudeEnvelope}\n\t\t\t */\n\t this.envelope = new Tone.AmplitudeEnvelope(options.envelope);\n\t //connect the noise to the output\n\t this.noise.chain(this.envelope, this.output);\n\t this._readOnly([\n\t 'noise',\n\t 'envelope'\n\t ]);\n\t };\n\t Tone.extend(Tone.NoiseSynth, Tone.Instrument);\n\t /**\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.NoiseSynth.defaults = {\n\t 'noise': { 'type': 'white' },\n\t 'envelope': {\n\t 'attack': 0.005,\n\t 'decay': 0.1,\n\t 'sustain': 0\n\t }\n\t };\n\t /**\n\t\t * Start the attack portion of the envelopes. Unlike other\n\t\t * instruments, Tone.NoiseSynth doesn't have a note.\n\t\t * @param {Time} [time=now] the time the attack should start\n\t\t * @param {number} [velocity=1] the velocity of the note (0-1)\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t * @example\n\t\t * noiseSynth.triggerAttack();\n\t\t */\n\t Tone.NoiseSynth.prototype.triggerAttack = function (time, velocity) {\n\t //the envelopes\n\t this.envelope.triggerAttack(time, velocity);\n\t //start the noise\n\t this.noise.start(time);\n\t if (this.envelope.sustain === 0) {\n\t this.noise.stop(time = this.envelope.attack + this.envelope.decay);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Start the release portion of the envelopes.\n\t\t * @param {Time} [time=now] the time the release should start\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t */\n\t Tone.NoiseSynth.prototype.triggerRelease = function (time) {\n\t this.envelope.triggerRelease(time);\n\t this.noise.stop(time + this.envelope.release);\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.NoiseSynth.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 0);\n\t this._syncMethod('triggerRelease', 0);\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and then the release.\n\t\t * @param {Time} duration the duration of the note\n\t\t * @param {Time} [time=now] the time of the attack\n\t\t * @param {number} [velocity=1] the velocity\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t */\n\t Tone.NoiseSynth.prototype.triggerAttackRelease = function (duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(time, velocity);\n\t this.triggerRelease(time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.NoiseSynth} this\n\t\t */\n\t Tone.NoiseSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._writable([\n\t 'noise',\n\t 'envelope'\n\t ]);\n\t this.noise.dispose();\n\t this.noise = null;\n\t this.envelope.dispose();\n\t this.envelope = null;\n\t return this;\n\t };\n\t return Tone.NoiseSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Karplus-String string synthesis. Often out of tune.\n\t\t * Will change when the AudioWorkerNode is available across\n\t\t * browsers.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {Object} [options] see the defaults\n\t\t * @example\n\t\t * var plucky = new Tone.PluckSynth().toMaster();\n\t\t * plucky.triggerAttack(\"C4\");\n\t\t */\n\t Tone.PluckSynth = function (options) {\n\t options = Tone.defaultArg(options, Tone.PluckSynth.defaults);\n\t Tone.Instrument.call(this, options);\n\t /**\n\t\t\t * @type {Tone.Noise}\n\t\t\t * @private\n\t\t\t */\n\t this._noise = new Tone.Noise('pink');\n\t /**\n\t\t\t * The amount of noise at the attack.\n\t\t\t * Nominal range of [0.1, 20]\n\t\t\t * @type {number}\n\t\t\t */\n\t this.attackNoise = options.attackNoise;\n\t /**\n\t\t\t * the LFCF\n\t\t\t * @type {Tone.LowpassCombFilter}\n\t\t\t * @private\n\t\t\t */\n\t this._lfcf = new Tone.LowpassCombFilter({\n\t 'resonance': options.resonance,\n\t 'dampening': options.dampening\n\t });\n\t /**\n\t\t\t * The resonance control.\n\t\t\t * @type {NormalRange}\n\t\t\t * @signal\n\t\t\t */\n\t this.resonance = this._lfcf.resonance;\n\t /**\n\t\t\t * The dampening control. i.e. the lowpass filter frequency of the comb filter\n\t\t\t * @type {Frequency}\n\t\t\t * @signal\n\t\t\t */\n\t this.dampening = this._lfcf.dampening;\n\t //connections\n\t this._noise.connect(this._lfcf);\n\t this._lfcf.connect(this.output);\n\t this._readOnly([\n\t 'resonance',\n\t 'dampening'\n\t ]);\n\t };\n\t Tone.extend(Tone.PluckSynth, Tone.Instrument);\n\t /**\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.PluckSynth.defaults = {\n\t 'attackNoise': 1,\n\t 'dampening': 4000,\n\t 'resonance': 0.7\n\t };\n\t /**\n\t\t * Trigger the note.\n\t\t * @param {Frequency} note The note to trigger.\n\t\t * @param {Time} [time=now] When the note should be triggered.\n\t\t * @returns {Tone.PluckSynth} this\n\t\t */\n\t Tone.PluckSynth.prototype.triggerAttack = function (note, time) {\n\t note = this.toFrequency(note);\n\t time = this.toSeconds(time);\n\t var delayAmount = 1 / note;\n\t this._lfcf.delayTime.setValueAtTime(delayAmount, time);\n\t this._noise.start(time);\n\t this._noise.stop(time + delayAmount * this.attackNoise);\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.PluckSynth} this\n\t\t */\n\t Tone.PluckSynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._noise.dispose();\n\t this._lfcf.dispose();\n\t this._noise = null;\n\t this._lfcf = null;\n\t this._writable([\n\t 'resonance',\n\t 'dampening'\n\t ]);\n\t this.dampening = null;\n\t this.resonance = null;\n\t return this;\n\t };\n\t return Tone.PluckSynth;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.PolySynth handles voice creation and allocation for any\n\t\t * instruments passed in as the second paramter. PolySynth is\n\t\t * not a synthesizer by itself, it merely manages voices of\n\t\t * one of the other types of synths, allowing any of the\n\t\t * monophonic synthesizers to be polyphonic.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Instrument}\n\t\t * @param {number|Object} [polyphony=4] The number of voices to create\n\t\t * @param {function} [voice=Tone.Synth] The constructor of the voices\n\t\t * uses Tone.Synth by default.\n\t\t * @example\n\t\t * //a polysynth composed of 6 Voices of Synth\n\t\t * var synth = new Tone.PolySynth(6, Tone.Synth).toMaster();\n\t\t * //set the attributes using the set interface\n\t\t * synth.set(\"detune\", -1200);\n\t\t * //play a chord\n\t\t * synth.triggerAttackRelease([\"C4\", \"E4\", \"A4\"], \"4n\");\n\t\t */\n\t Tone.PolySynth = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'polyphony',\n\t 'voice'\n\t ], Tone.PolySynth);\n\t Tone.Instrument.call(this, options);\n\t options = Tone.defaultArg(options, Tone.Instrument.defaults);\n\t //max polyphony\n\t options.polyphony = Math.min(Tone.PolySynth.MAX_POLYPHONY, options.polyphony);\n\t /**\n\t\t\t * the array of voices\n\t\t\t * @type {Array}\n\t\t\t */\n\t this.voices = new Array(options.polyphony);\n\t /**\n\t\t\t * The queue of voices with data about last trigger\n\t\t\t * and the triggered note\n\t\t\t * @private\n\t\t\t * @type {Array}\n\t\t\t */\n\t this._triggers = new Array(options.polyphony);\n\t /**\n\t\t\t * The detune in cents\n\t\t\t * @type {Cents}\n\t\t\t * @signal\n\t\t\t */\n\t this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);\n\t this._readOnly('detune');\n\t //create the voices\n\t for (var i = 0; i < options.polyphony; i++) {\n\t var v = new options.voice(arguments[2], arguments[3]);\n\t if (!(v instanceof Tone.Monophonic)) {\n\t throw new Error('Synth constructor must be instance of Tone.Monophonic');\n\t }\n\t this.voices[i] = v;\n\t v.connect(this.output);\n\t if (v.hasOwnProperty('detune')) {\n\t this.detune.connect(v.detune);\n\t }\n\t this._triggers[i] = {\n\t release: -1,\n\t note: null,\n\t voice: v\n\t };\n\t }\n\t };\n\t Tone.extend(Tone.PolySynth, Tone.Instrument);\n\t /**\n\t\t * the defaults\n\t\t * @const\n\t\t * @static\n\t\t * @type {Object}\n\t\t */\n\t Tone.PolySynth.defaults = {\n\t 'polyphony': 4,\n\t 'volume': 0,\n\t 'detune': 0,\n\t 'voice': Tone.Synth\n\t };\n\t /**\n\t\t * Trigger the attack portion of the note\n\t\t * @param {Frequency|Array} notes The notes to play. Accepts a single\n\t\t * Frequency or an array of frequencies.\n\t\t * @param {Time} [time=now] The start time of the note.\n\t\t * @param {number} [velocity=1] The velocity of the note.\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * //trigger a chord immediately with a velocity of 0.2\n\t\t * poly.triggerAttack([\"Ab3\", \"C4\", \"F5\"], undefined, 0.2);\n\t\t */\n\t Tone.PolySynth.prototype.triggerAttack = function (notes, time, velocity) {\n\t if (!Array.isArray(notes)) {\n\t notes = [notes];\n\t }\n\t time = this.toSeconds(time);\n\t for (var i = 0; i < notes.length; i++) {\n\t var val = notes[i];\n\t //trigger the oldest voice\n\t var oldest = this._triggers[0];\n\t for (var j = 1; j < this._triggers.length; j++) {\n\t if (this._triggers[j].release < oldest.release) {\n\t oldest = this._triggers[j];\n\t }\n\t }\n\t oldest.release = Infinity;\n\t oldest.note = JSON.stringify(val);\n\t oldest.voice.triggerAttack(val, time, velocity);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the attack and release after the specified duration\n\t\t *\n\t\t * @param {Frequency|Array} notes The notes to play. Accepts a single\n\t\t * Frequency or an array of frequencies.\n\t\t * @param {Time} duration the duration of the note\n\t\t * @param {Time} [time=now] if no time is given, defaults to now\n\t\t * @param {number} [velocity=1] the velocity of the attack (0-1)\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * //trigger a chord for a duration of a half note\n\t\t * poly.triggerAttackRelease([\"Eb3\", \"G4\", \"C5\"], \"2n\");\n\t\t * @example\n\t\t * //can pass in an array of durations as well\n\t\t * poly.triggerAttackRelease([\"Eb3\", \"G4\", \"C5\"], [\"2n\", \"4n\", \"4n\"]);\n\t\t */\n\t Tone.PolySynth.prototype.triggerAttackRelease = function (notes, duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t this.triggerAttack(notes, time, velocity);\n\t if (Tone.isArray(duration) && Tone.isArray(notes)) {\n\t for (var i = 0; i < notes.length; i++) {\n\t var d = duration[Math.min(i, duration.length - 1)];\n\t this.triggerRelease(notes[i], time + this.toSeconds(d));\n\t }\n\t } else {\n\t this.triggerRelease(notes, time + this.toSeconds(duration));\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Trigger the release of the note. Unlike monophonic instruments,\n\t\t * a note (or array of notes) needs to be passed in as the first argument.\n\t\t * @param {Frequency|Array} notes The notes to play. Accepts a single\n\t\t * Frequency or an array of frequencies.\n\t\t * @param {Time} [time=now] When the release will be triggered.\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * poly.triggerRelease([\"Ab3\", \"C4\", \"F5\"], \"+2n\");\n\t\t */\n\t Tone.PolySynth.prototype.triggerRelease = function (notes, time) {\n\t if (!Array.isArray(notes)) {\n\t notes = [notes];\n\t }\n\t time = this.toSeconds(time);\n\t for (var i = 0; i < notes.length; i++) {\n\t //get the voice\n\t var stringified = JSON.stringify(notes[i]);\n\t for (var v = 0; v < this._triggers.length; v++) {\n\t var desc = this._triggers[v];\n\t if (desc.note === stringified && desc.release > time) {\n\t desc.voice.triggerRelease(time);\n\t desc.release = time;\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.PolySynth.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 1);\n\t this._syncMethod('triggerRelease', 1);\n\t return this;\n\t };\n\t /**\n\t\t * Set a member/attribute of the voices.\n\t\t * @param {Object|string} params\n\t\t * @param {number=} value\n\t\t * @param {Time=} rampTime\n\t\t * @returns {Tone.PolySynth} this\n\t\t * @example\n\t\t * poly.set({\n\t\t * \t\"filter\" : {\n\t\t * \t\t\"type\" : \"highpass\"\n\t\t * \t},\n\t\t * \t\"envelope\" : {\n\t\t * \t\t\"attack\" : 0.25\n\t\t * \t}\n\t\t * });\n\t\t */\n\t Tone.PolySynth.prototype.set = function (params, value, rampTime) {\n\t for (var i = 0; i < this.voices.length; i++) {\n\t this.voices[i].set(params, value, rampTime);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Get the synth's attributes. Given no arguments get\n\t\t * will return all available object properties and their corresponding\n\t\t * values. Pass in a single attribute to retrieve or an array\n\t\t * of attributes. The attribute strings can also include a \".\"\n\t\t * to access deeper properties.\n\t\t * @param {Array=} params the parameters to get, otherwise will return\n\t\t * \t\t\t\t\t all available.\n\t\t */\n\t Tone.PolySynth.prototype.get = function (params) {\n\t return this.voices[0].get(params);\n\t };\n\t /**\n\t\t * Trigger the release portion of all the currently active voices.\n\t\t * @param {Time} [time=now] When the notes should be released.\n\t\t * @return {Tone.PolySynth} this\n\t\t */\n\t Tone.PolySynth.prototype.releaseAll = function (time) {\n\t time = this.toSeconds(time);\n\t for (var i = 0; i < this._triggers.length; i++) {\n\t var desc = this._triggers[i];\n\t if (desc.release > time) {\n\t desc.release = time;\n\t desc.voice.triggerRelease(time);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Clean up.\n\t\t * @returns {Tone.PolySynth} this\n\t\t */\n\t Tone.PolySynth.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t for (var i = 0; i < this.voices.length; i++) {\n\t this.voices[i].dispose();\n\t this.voices[i] = null;\n\t }\n\t this._writable('detune');\n\t this.detune.dispose();\n\t this.detune = null;\n\t this.voices = null;\n\t this._triggers = null;\n\t return this;\n\t };\n\t /**\n\t\t * The maximum number of notes that can be allocated\n\t\t * to a polysynth.\n\t\t * @type {Number}\n\t\t * @static\n\t\t */\n\t Tone.PolySynth.MAX_POLYPHONY = 20;\n\t return Tone.PolySynth;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Automatically interpolates between a set of pitched samples. Pass in an object which maps the note's pitch or midi value to the url, then you can trigger the attack and release of that note like other instruments. By automatically repitching the samples, it is possible to play pitches which were not explicitly included which can save loading time.\n\t\t * For sample or buffer playback where repitching is not necessary, use [Tone.Player](https://tonejs.github.io/docs/Player).\n\t\t * @param {Object} samples An object of samples mapping either Midi\n\t\t * Note Numbers or Scientific Pitch Notation\n\t\t * to the url of that sample.\n\t\t * @param {Function=} onload The callback to invoke when all of the samples are loaded.\n\t\t * @param {String=} baseUrl The root URL of all of the samples, which is prepended to all the URLs.\n\t\t * @example\n\t\t * var sampler = new Tone.Sampler({\n\t\t * \t\"C3\" : \"path/to/C3.mp3\",\n\t\t * \t\"D#3\" : \"path/to/Dsharp3.mp3\",\n\t\t * \t\"F#3\" : \"path/to/Fsharp3.mp3\",\n\t\t * \t\"A3\" : \"path/to/A3.mp3\",\n\t\t * }, function(){\n\t\t * \t//sampler will repitch the closest sample\n\t\t * \tsampler.triggerAttack(\"D3\")\n\t\t * })\n\t\t * @extends {Tone.Instrument}\n\t\t */\n\t Tone.Sampler = function (urls) {\n\t // shift arguments over one. Those are the remainder of the options\n\t var args = Array.prototype.slice.call(arguments);\n\t args.shift();\n\t var options = Tone.defaults(args, [\n\t 'onload',\n\t 'baseUrl'\n\t ], Tone.Sampler);\n\t Tone.Instrument.call(this, options);\n\t var urlMap = {};\n\t for (var note in urls) {\n\t if (Tone.isNote(note)) {\n\t //convert the note name to MIDI\n\t var mid = Tone.Frequency(note).toMidi();\n\t urlMap[mid] = urls[note];\n\t } else if (!isNaN(parseFloat(note))) {\n\t //otherwise if it's numbers assume it's midi\n\t urlMap[note] = urls[note];\n\t } else {\n\t throw new Error('Tone.Sampler: url keys must be the note\\'s pitch');\n\t }\n\t }\n\t /**\n\t\t\t * The stored and loaded buffers\n\t\t\t * @type {Tone.Buffers}\n\t\t\t * @private\n\t\t\t */\n\t this._buffers = new Tone.Buffers(urlMap, options.onload, options.baseUrl);\n\t /**\n\t\t\t * The object of all currently playing BufferSources\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._activeSources = {};\n\t /**\n\t\t\t * The envelope applied to the beginning of the sample.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.attack = options.attack;\n\t /**\n\t\t\t * The envelope applied to the end of the envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.release = options.release;\n\t };\n\t Tone.extend(Tone.Sampler, Tone.Instrument);\n\t /**\n\t\t * The defaults\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Sampler.defaults = {\n\t attack: 0,\n\t release: 0.1,\n\t onload: Tone.noOp,\n\t baseUrl: ''\n\t };\n\t /**\n\t\t * Returns the difference in steps between the given midi note at the closets sample.\n\t\t * @param {Midi} midi\n\t\t * @return {Interval}\n\t\t * @private\n\t\t */\n\t Tone.Sampler.prototype._findClosest = function (midi) {\n\t //searches within 8 octaves of the given midi note\n\t var MAX_INTERVAL = 96;\n\t var interval = 0;\n\t while (interval < MAX_INTERVAL) {\n\t // check above and below\n\t if (this._buffers.has(midi + interval)) {\n\t return -interval;\n\t } else if (this._buffers.has(midi - interval)) {\n\t return interval;\n\t }\n\t interval++;\n\t }\n\t return null;\n\t };\n\t /**\n\t\t * @param {Frequency} note The note to play\n\t\t * @param {Time=} time When to play the note\n\t\t * @param {NormalRange=} velocity The velocity to play the sample back.\n\t\t * @return {Tone.Sampler} this\n\t\t */\n\t Tone.Sampler.prototype.triggerAttack = function (note, time, velocity) {\n\t var midi = Tone.Frequency(note).toMidi();\n\t // find the closest note pitch\n\t var difference = this._findClosest(midi);\n\t if (difference !== null) {\n\t var closestNote = midi - difference;\n\t var buffer = this._buffers.get(closestNote);\n\t // play that note\n\t var source = new Tone.BufferSource({\n\t 'buffer': buffer,\n\t 'playbackRate': Tone.intervalToFrequencyRatio(difference),\n\t 'fadeIn': this.attack,\n\t 'fadeOut': this.release,\n\t 'curve': 'exponential'\n\t }).connect(this.output);\n\t source.start(time, 0, buffer.duration, velocity);\n\t // add it to the active sources\n\t if (!Tone.isArray(this._activeSources[midi])) {\n\t this._activeSources[midi] = [];\n\t }\n\t this._activeSources[midi].push({\n\t note: midi,\n\t source: source\n\t });\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * @param {Frequency} note The note to release.\n\t\t * @param {Time=} time \tWhen to release the note.\n\t\t * @return {Tone.Sampler}\tthis\n\t\t */\n\t Tone.Sampler.prototype.triggerRelease = function (note, time) {\n\t var midi = Tone.Frequency(note).toMidi();\n\t // find the note\n\t if (this._activeSources[midi] && this._activeSources[midi].length) {\n\t var source = this._activeSources[midi].shift().source;\n\t time = this.toSeconds(time);\n\t source.stop(time + this.release, this.release);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Release all currently active notes.\n\t\t * @param {Time=} time \tWhen to release the notes.\n\t\t * @return {Tone.Sampler}\tthis\n\t\t */\n\t Tone.Sampler.prototype.releaseAll = function (time) {\n\t time = this.toSeconds(time);\n\t for (var note in this._activeSources) {\n\t var sources = this._activeSources[note];\n\t while (sources.length) {\n\t var source = sources.shift().source;\n\t source.stop(time + this.release, this.release);\n\t }\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Sync the instrument to the Transport. All subsequent calls of\n\t\t * [triggerAttack](#triggerattack) and [triggerRelease](#triggerrelease)\n\t\t * will be scheduled along the transport.\n\t\t * @example\n\t\t * synth.sync()\n\t\t * //schedule 3 notes when the transport first starts\n\t\t * synth.triggerAttackRelease('8n', 0)\n\t\t * synth.triggerAttackRelease('8n', '8n')\n\t\t * synth.triggerAttackRelease('8n', '4n')\n\t\t * //start the transport to hear the notes\n\t\t * Transport.start()\n\t\t * @returns {Tone.Instrument} this\n\t\t */\n\t Tone.Sampler.prototype.sync = function () {\n\t this._syncMethod('triggerAttack', 1);\n\t this._syncMethod('triggerRelease', 1);\n\t return this;\n\t };\n\t /**\n\t\t * Invoke the attack phase, then after the duration, invoke the release.\n\t\t * @param {Frequency} note The note to play\n\t\t * @param {Time} duration The time the note should be held\n\t\t * @param {Time=} time When to start the attack\n\t\t * @param {NormalRange} [velocity=1] The velocity of the attack\n\t\t * @return {Tone.Sampler} this\n\t\t */\n\t Tone.Sampler.prototype.triggerAttackRelease = function (note, duration, time, velocity) {\n\t time = this.toSeconds(time);\n\t duration = this.toSeconds(duration);\n\t this.triggerAttack(note, time, velocity);\n\t this.triggerRelease(note, time + duration);\n\t return this;\n\t };\n\t /**\n\t\t * Add a note to the sampler.\n\t\t * @param {Note|Midi} note The buffer's pitch.\n\t\t * @param {String|Tone.Buffer|Audiobuffer} url Either the url of the bufer,\n\t\t * or a buffer which will be added\n\t\t * with the given name.\n\t\t * @param {Function=} callback The callback to invoke\n\t\t * when the url is loaded.\n\t\t */\n\t Tone.Sampler.prototype.add = function (note, url, callback) {\n\t if (Tone.isNote(note)) {\n\t //convert the note name to MIDI\n\t var mid = Tone.Frequency(note).toMidi();\n\t this._buffers.add(mid, url, callback);\n\t } else if (!isNaN(parseFloat(note))) {\n\t //otherwise if it's numbers assume it's midi\n\t this._buffers.add(note, url, callback);\n\t } else {\n\t throw new Error('Tone.Sampler: note must be the note\\'s pitch. Instead got ' + note);\n\t }\n\t };\n\t /**\n\t\t * If the buffers are loaded or not\n\t\t * @memberOf Tone.Sampler#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Sampler.prototype, 'loaded', {\n\t get: function () {\n\t return this._buffers.loaded;\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.Sampler} this\n\t\t */\n\t Tone.Sampler.prototype.dispose = function () {\n\t Tone.Instrument.prototype.dispose.call(this);\n\t this._buffers.dispose();\n\t this._buffers = null;\n\t for (var midi in this._activeSources) {\n\t this._activeSources[midi].forEach(function (event) {\n\t event.source.dispose();\n\t });\n\t }\n\t this._activeSources = null;\n\t return this;\n\t };\n\t return Tone.Sampler;\n\t});\n\tModule(function (Tone) {\n\t if (Tone.supported) {\n\t if (!OscillatorNode.prototype.setPeriodicWave) {\n\t OscillatorNode.prototype.setPeriodicWave = OscillatorNode.prototype.setWaveTable;\n\t }\n\t if (!AudioContext.prototype.createPeriodicWave) {\n\t AudioContext.prototype.createPeriodicWave = AudioContext.prototype.createWaveTable;\n\t }\n\t }\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Maps a NormalRange [0, 1] to an AudioRange [-1, 1]. \n\t\t * See also Tone.AudioToGain. \n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @example\n\t\t * var g2a = new Tone.GainToAudio();\n\t\t */\n\t Tone.GainToAudio = function () {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * @type {WaveShaperNode}\n\t\t\t * @private\n\t\t\t */\n\t this._norm = this.input = this.output = new Tone.WaveShaper(function (x) {\n\t return Math.abs(x) * 2 - 1;\n\t });\n\t };\n\t Tone.extend(Tone.GainToAudio, Tone.SignalBase);\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.GainToAudio} this\n\t\t */\n\t Tone.GainToAudio.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._norm.dispose();\n\t this._norm = null;\n\t return this;\n\t };\n\t return Tone.GainToAudio;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Normalize takes an input min and max and maps it linearly to NormalRange [0,1]\n\t\t *\n\t\t * @extends {Tone.SignalBase}\n\t\t * @constructor\n\t\t * @param {number} inputMin the min input value\n\t\t * @param {number} inputMax the max input value\n\t\t * @example\n\t\t * var norm = new Tone.Normalize(2, 4);\n\t\t * var sig = new Tone.Signal(3).connect(norm);\n\t\t * //output of norm is 0.5. \n\t\t */\n\t Tone.Normalize = function (inputMin, inputMax) {\n\t Tone.SignalBase.call(this);\n\t /**\n\t\t\t * the min input value\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._inputMin = Tone.defaultArg(inputMin, 0);\n\t /**\n\t\t\t * the max input value\n\t\t\t * @type {number}\n\t\t\t * @private\n\t\t\t */\n\t this._inputMax = Tone.defaultArg(inputMax, 1);\n\t /**\n\t\t\t * subtract the min from the input\n\t\t\t * @type {Tone.Add}\n\t\t\t * @private\n\t\t\t */\n\t this._sub = this.input = new Tone.Add(0);\n\t /**\n\t\t\t * divide by the difference between the input and output\n\t\t\t * @type {Tone.Multiply}\n\t\t\t * @private\n\t\t\t */\n\t this._div = this.output = new Tone.Multiply(1);\n\t this._sub.connect(this._div);\n\t this._setRange();\n\t };\n\t Tone.extend(Tone.Normalize, Tone.SignalBase);\n\t /**\n\t\t * The minimum value the input signal will reach.\n\t\t * @memberOf Tone.Normalize#\n\t\t * @type {number}\n\t\t * @name min\n\t\t */\n\t Object.defineProperty(Tone.Normalize.prototype, 'min', {\n\t get: function () {\n\t return this._inputMin;\n\t },\n\t set: function (min) {\n\t this._inputMin = min;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * The maximum value the input signal will reach.\n\t\t * @memberOf Tone.Normalize#\n\t\t * @type {number}\n\t\t * @name max\n\t\t */\n\t Object.defineProperty(Tone.Normalize.prototype, 'max', {\n\t get: function () {\n\t return this._inputMax;\n\t },\n\t set: function (max) {\n\t this._inputMax = max;\n\t this._setRange();\n\t }\n\t });\n\t /**\n\t\t * set the values\n\t\t * @private\n\t\t */\n\t Tone.Normalize.prototype._setRange = function () {\n\t this._sub.value = -this._inputMin;\n\t this._div.value = 1 / (this._inputMax - this._inputMin);\n\t };\n\t /**\n\t\t * clean up\n\t\t * @returns {Tone.Normalize} this\n\t\t */\n\t Tone.Normalize.prototype.dispose = function () {\n\t Tone.SignalBase.prototype.dispose.call(this);\n\t this._sub.dispose();\n\t this._sub = null;\n\t this._div.dispose();\n\t this._div = null;\n\t return this;\n\t };\n\t return Tone.Normalize;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.TransportTimelineSignal extends Tone.Signal, but adds the ability to synchronize the signal to the signal to the Tone.Transport\n\t\t * @extends {Tone.Signal}\n\t\t */\n\t Tone.TransportTimelineSignal = function () {\n\t Tone.Signal.apply(this, arguments);\n\t /**\n\t\t\t * The real signal output\n\t\t\t * @type {Tone.Signal}\n\t\t\t * @private\n\t\t\t */\n\t this.output = this._outputSig = new Tone.Signal(this._initialValue);\n\t /**\n\t\t\t * Keep track of the last value. (small optimization)\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._lastVal = this.value;\n\t /**\n\t\t\t * The event id of the tick update loop\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._synced = Tone.Transport.scheduleRepeat(this._onTick.bind(this), '1i');\n\t /**\n\t\t\t * A bound version of the anchor value methods\n\t\t\t * @type {Function}\n\t\t\t * @private\n\t\t\t */\n\t this._bindAnchorValue = this._anchorValue.bind(this);\n\t Tone.Transport.on('start stop pause', this._bindAnchorValue);\n\t this._events.memory = Infinity;\n\t };\n\t Tone.extend(Tone.TransportTimelineSignal, Tone.Signal);\n\t /**\n\t\t * Callback which is invoked every tick.\n\t\t * @private\n\t\t * @param {Number} time\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype._onTick = function (time) {\n\t var val = this.getValueAtTime(Tone.Transport.seconds);\n\t if (this._lastVal !== val) {\n\t this._lastVal = val;\n\t //approximate ramp curves with linear ramps\n\t this._outputSig.linearRampToValueAtTime(val, time);\n\t }\n\t };\n\t /**\n\t\t * Anchor the value at the start and stop of the Transport\n\t\t * @param {Number} time The time of the event\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t * @private\n\t\t */\n\t Tone.TransportTimelineSignal.prototype._anchorValue = function (time) {\n\t var val = this.getValueAtTime(Tone.Transport.seconds);\n\t this._lastVal = val;\n\t this._outputSig.cancelScheduledValues(time);\n\t this._outputSig.setValueAtTime(val, time);\n\t return this;\n\t };\n\t /**\n\t\t * Get the scheduled value at the given time. This will\n\t\t * return the unconverted (raw) value.\n\t\t * @param {TransportTime} time The time in seconds.\n\t\t * @return {Number} The scheduled value at the given time.\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.getValueAtTime = function (time) {\n\t time = Tone.TransportTime(time);\n\t return Tone.Signal.prototype.getValueAtTime.call(this, time);\n\t };\n\t /**\n\t\t * Set the output of the signal at the given time\n\t\t * @param {Number} value The value to change to at the given time\n\t\t * @param {TransportTime} time The time to change the signal\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.setValueAtTime = function (value, time) {\n\t time = Tone.TransportTime(time);\n\t Tone.Signal.prototype.setValueAtTime.call(this, value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Linear ramp to the given value from the previous scheduled point to the given value\n\t\t * @param {Number} value The value to change to at the given time\n\t\t * @param {TransportTime} time The time to change the signal\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.linearRampToValueAtTime = function (value, time) {\n\t time = Tone.TransportTime(time);\n\t Tone.Signal.prototype.linearRampToValueAtTime.call(this, value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Exponential ramp to the given value from the previous scheduled point to the given value\n\t\t * @param {Number} value The value to change to at the given time\n\t\t * @param {TransportTime} time The time to change the signal\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.exponentialRampToValueAtTime = function (value, time) {\n\t time = Tone.TransportTime(time);\n\t Tone.Signal.prototype.exponentialRampToValueAtTime.call(this, value, time);\n\t return this;\n\t };\n\t /**\n\t\t * Start exponentially approaching the target value at the given time with\n\t\t * a rate having the given time constant.\n\t\t * @param {number} value\n\t\t * @param {TransportTime} startTime\n\t\t * @param {number} timeConstant\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.setTargetAtTime = function (value, startTime, timeConstant) {\n\t startTime = Tone.TransportTime(startTime);\n\t Tone.Signal.prototype.setTargetAtTime.call(this, value, startTime, timeConstant);\n\t return this;\n\t };\n\t /**\n\t\t * Cancels all scheduled parameter changes with times greater than or\n\t\t * equal to startTime.\n\t\t * @param {TransportTime} startTime\n\t\t * @returns {Tone.Param} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.cancelScheduledValues = function (startTime) {\n\t startTime = Tone.TransportTime(startTime);\n\t Tone.Signal.prototype.cancelScheduledValues.call(this, startTime);\n\t return this;\n\t };\n\t /**\n\t\t * Set an array of arbitrary values starting at the given time for the given duration.\n\t\t * @param {Float32Array} values\n\t\t * @param {Time} startTime\n\t\t * @param {Time} duration\n\t\t * @param {NormalRange} [scaling=1] If the values in the curve should be scaled by some value\n\t\t * @returns {Tone.Signal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.setValueCurveAtTime = function (values, startTime, duration, scaling) {\n\t startTime = Tone.TransportTime(startTime);\n\t duration = Tone.TransportTime(duration);\n\t Tone.Signal.prototype.setValueCurveAtTime.call(this, values, startTime, duration, scaling);\n\t return this;\n\t };\n\t /**\n\t\t * This is similar to [cancelScheduledValues](#cancelScheduledValues) except\n\t\t * it holds the automated value at time until the next automated event.\n\t\t * @param {Time} time\n\t\t * @returns {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.cancelAndHoldAtTime = function (time) {\n\t return Tone.Signal.prototype.cancelAndHoldAtTime.call(this, Tone.TransportTime(time));\n\t };\n\t /**\n\t\t * Dispose and disconnect\n\t\t * @return {Tone.TransportTimelineSignal} this\n\t\t */\n\t Tone.TransportTimelineSignal.prototype.dispose = function () {\n\t Tone.Transport.clear(this._synced);\n\t Tone.Transport.off('start stop pause', this._syncedCallback);\n\t this._events.cancel(0);\n\t Tone.Signal.prototype.dispose.call(this);\n\t this._outputSig.dispose();\n\t this._outputSig = null;\n\t };\n\t return Tone.TransportTimelineSignal;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.GrainPlayer implements [granular synthesis](https://en.wikipedia.org/wiki/Granular_synthesis).\n\t\t * Granular Synthesis enables you to adjust pitch and playback rate independently. The grainSize is the\n\t\t * amount of time each small chunk of audio is played for and the overlap is the\n\t\t * amount of crossfading transition time between successive grains.\n\t\t * @extends {Tone.Source}\n\t\t * @param {String|Tone.Buffer} url\tThe url to load, or the Tone.Buffer to play.\n\t\t * @param {Function=} callback The callback to invoke after the url is loaded.\n\t\t */\n\t Tone.GrainPlayer = function () {\n\t var options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload'\n\t ], Tone.GrainPlayer);\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * The audio buffer belonging to the player.\n\t\t\t * @type {Tone.Buffer}\n\t\t\t */\n\t this.buffer = new Tone.Buffer(options.url, options.onload);\n\t /**\n\t\t\t * Create a repeating tick to schedule\n\t\t\t * the grains.\n\t\t\t * @type {Tone.Clock}\n\t\t\t * @private\n\t\t\t */\n\t this._clock = new Tone.Clock(this._tick.bind(this), options.grainSize);\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopStart = 0;\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loopEnd = 0;\n\t /**\n\t\t\t * All of the currently playing BufferSources\n\t\t\t * @type {Array}\n\t\t\t * @private\n\t\t\t */\n\t this._activeSources = [];\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._playbackRate = options.playbackRate;\n\t /**\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._grainSize = options.grainSize;\n\t /**\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._overlap = options.overlap;\n\t /**\n\t\t\t * Adjust the pitch independently of the playbackRate.\n\t\t\t * @type {Cents}\n\t\t\t */\n\t this.detune = options.detune;\n\t //setup\n\t this.overlap = options.overlap;\n\t this.loop = options.loop;\n\t this.playbackRate = options.playbackRate;\n\t this.grainSize = options.grainSize;\n\t this.loopStart = options.loopStart;\n\t this.loopEnd = options.loopEnd;\n\t this.reverse = options.reverse;\n\t this._clock.on('stop', this._onstop.bind(this));\n\t };\n\t Tone.extend(Tone.GrainPlayer, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.GrainPlayer.defaults = {\n\t 'onload': Tone.noOp,\n\t 'overlap': 0.1,\n\t 'grainSize': 0.2,\n\t 'playbackRate': 1,\n\t 'detune': 0,\n\t 'loop': false,\n\t 'loopStart': 0,\n\t 'loopEnd': 0,\n\t 'reverse': false\n\t };\n\t /**\n\t\t * Play the buffer at the given startTime. Optionally add an offset\n\t\t * and/or duration which will play the buffer from a position\n\t\t * within the buffer for the given duration.\n\t\t *\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @returns {Tone.GrainPlayer} this\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @method start\n\t\t * @name start\n\t\t */\n\t /**\n\t\t * Internal start method\n\t\t * @param {Time} time\n\t\t * @param {Time} offset\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._start = function (time, offset, duration) {\n\t offset = Tone.defaultArg(offset, 0);\n\t offset = this.toSeconds(offset);\n\t time = this.toSeconds(time);\n\t this._offset = offset;\n\t this._clock.start(time);\n\t if (duration) {\n\t this.stop(time + this.toSeconds(duration));\n\t }\n\t };\n\t /**\n\t\t * Internal start method\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._stop = function (time) {\n\t this._clock.stop(time);\n\t };\n\t /**\n\t\t * Invoked when the clock is stopped\n\t\t * @param {Number} time\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._onstop = function (time) {\n\t //stop the players\n\t this._activeSources.forEach(function (source) {\n\t source.stop(time, 0);\n\t });\n\t };\n\t /**\n\t\t * Invoked on each clock tick. scheduled a new\n\t\t * grain at this time.\n\t\t * @param {Time} time\n\t\t * @private\n\t\t */\n\t Tone.GrainPlayer.prototype._tick = function (time) {\n\t var fadeIn = this._offset < this._overlap ? 0 : this._overlap;\n\t var source = new Tone.BufferSource({\n\t 'buffer': this.buffer,\n\t 'fadeIn': fadeIn,\n\t 'fadeOut': this._overlap,\n\t 'loop': this.loop,\n\t 'loopStart': this._loopStart,\n\t 'loopEnd': this._loopEnd,\n\t 'playbackRate': Tone.intervalToFrequencyRatio(this.detune / 100)\n\t }).connect(this.output);\n\t source.start(time, this._offset);\n\t this._offset += this.grainSize;\n\t source.stop(time + this.grainSize);\n\t //add it to the active sources\n\t this._activeSources.push(source);\n\t //remove it when it's done\n\t source.onended = function () {\n\t var index = this._activeSources.indexOf(source);\n\t if (index !== -1) {\n\t this._activeSources.splice(index, 1);\n\t }\n\t }.bind(this);\n\t };\n\t /**\n\t\t * Jump to a specific time and play it.\n\t\t * @param {Time} offset The offset to jump to.\n\t\t * @param {Time=} time When to make the jump.\n\t\t * @return {Tone.GrainPlayer} this\n\t\t */\n\t Tone.GrainPlayer.prototype.seek = function (offset, time) {\n\t this._offset = this.toSeconds(offset);\n\t this._tick(this.toSeconds(time));\n\t return this;\n\t };\n\t /**\n\t\t * The playback rate of the sample\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Positive}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t this.grainSize = this._grainSize;\n\t }\n\t });\n\t /**\n\t\t * The loop start time.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'loopStart', {\n\t get: function () {\n\t return this._loopStart;\n\t },\n\t set: function (time) {\n\t this._loopStart = this.toSeconds(time);\n\t }\n\t });\n\t /**\n\t\t * The loop end time.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'loopEnd', {\n\t get: function () {\n\t return this._loopEnd;\n\t },\n\t set: function (time) {\n\t this._loopEnd = this.toSeconds(time);\n\t }\n\t });\n\t /**\n\t\t * The direction the buffer should play in\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {boolean}\n\t\t * @name reverse\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'reverse', {\n\t get: function () {\n\t return this.buffer.reverse;\n\t },\n\t set: function (rev) {\n\t this.buffer.reverse = rev;\n\t }\n\t });\n\t /**\n\t\t * The size of each chunk of audio that the\n\t\t * buffer is chopped into and played back at.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name grainSize\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'grainSize', {\n\t get: function () {\n\t return this._grainSize;\n\t },\n\t set: function (size) {\n\t this._grainSize = this.toSeconds(size);\n\t this._clock.frequency.value = this._playbackRate / this._grainSize;\n\t }\n\t });\n\t /**\n\t\t * This is the duration of the cross-fade between\n\t\t * sucessive grains.\n\t\t * @memberOf Tone.GrainPlayer#\n\t\t * @type {Time}\n\t\t * @name overlap\n\t\t */\n\t Object.defineProperty(Tone.GrainPlayer.prototype, 'overlap', {\n\t get: function () {\n\t return this._overlap;\n\t },\n\t set: function (time) {\n\t this._overlap = this.toSeconds(time);\n\t }\n\t });\n\t /**\n\t\t * Clean up\n\t\t * @return {Tone.GrainPlayer} this\n\t\t */\n\t Tone.GrainPlayer.prototype.dispose = function () {\n\t Tone.Source.prototype.dispose.call(this);\n\t this.buffer.dispose();\n\t this.buffer = null;\n\t this._clock.dispose();\n\t this._clock = null;\n\t this._activeSources.forEach(function (source) {\n\t source.dispose();\n\t });\n\t this._activeSources = null;\n\t return this;\n\t };\n\t return Tone.GrainPlayer;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Player is an audio file player with start, loop, and stop functions.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.Source}\n\t\t * @param {string|AudioBuffer} url Either the AudioBuffer or the url from\n\t\t * which to load the AudioBuffer\n\t\t * @param {Function=} onload The function to invoke when the buffer is loaded.\n\t\t * Recommended to use Tone.Buffer.on('load') instead.\n\t\t * @example\n\t\t * var player = new Tone.Player(\"./path/to/sample.mp3\").toMaster();\n\t\t * //play as soon as the buffer is loaded\n\t\t * player.autostart = true;\n\t\t */\n\t Tone.Player = function (url) {\n\t var options;\n\t if (url instanceof Tone.Buffer && url.loaded) {\n\t url = url.get();\n\t options = Tone.Player.defaults;\n\t } else {\n\t options = Tone.defaults(arguments, [\n\t 'url',\n\t 'onload'\n\t ], Tone.Player);\n\t }\n\t Tone.Source.call(this, options);\n\t /**\n\t\t\t * If the file should play as soon\n\t\t\t * as the buffer is loaded.\n\t\t\t * @type {Boolean}\n\t\t\t * @example\n\t\t\t * //will play as soon as it's loaded\n\t\t\t * var player = new Tone.Player({\n\t\t\t * \t\"url\" : \"./path/to/sample.mp3\",\n\t\t\t * \t\"autostart\" : true,\n\t\t\t * }).toMaster();\n\t\t\t */\n\t this.autostart = options.autostart;\n\t /**\n\t\t\t * the buffer\n\t\t\t * @private\n\t\t\t * @type {Tone.Buffer}\n\t\t\t */\n\t this._buffer = new Tone.Buffer({\n\t 'url': options.url,\n\t 'onload': this._onload.bind(this, options.onload),\n\t 'reverse': options.reverse\n\t });\n\t if (url instanceof AudioBuffer) {\n\t this._buffer.set(url);\n\t }\n\t /**\n\t\t\t * if the buffer should loop once it's over\n\t\t\t * @type {Boolean}\n\t\t\t * @private\n\t\t\t */\n\t this._loop = options.loop;\n\t /**\n\t\t\t * if 'loop' is true, the loop will start at this position\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._loopStart = options.loopStart;\n\t /**\n\t\t\t * if 'loop' is true, the loop will end at this position\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._loopEnd = options.loopEnd;\n\t /**\n\t\t\t * the playback rate\n\t\t\t * @private\n\t\t\t * @type {Number}\n\t\t\t */\n\t this._playbackRate = options.playbackRate;\n\t /**\n\t\t\t * All of the active buffer source nodes\n\t\t\t * @type {Array<Tone.BufferSource>}\n\t\t\t * @private\n\t\t\t */\n\t this._activeSources = [];\n\t /**\n\t\t\t * The elapsed time counter.\n\t\t\t * @type {Tone.TickSource}\n\t\t\t * @private\n\t\t\t */\n\t this._elapsedTime = new Tone.TickSource(options.playbackRate);\n\t /**\n\t\t\t * The fadeIn time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeIn = options.fadeIn;\n\t /**\n\t\t\t * The fadeOut time of the amplitude envelope.\n\t\t\t * @type {Time}\n\t\t\t */\n\t this.fadeOut = options.fadeOut;\n\t };\n\t Tone.extend(Tone.Player, Tone.Source);\n\t /**\n\t\t * the default parameters\n\t\t * @static\n\t\t * @const\n\t\t * @type {Object}\n\t\t */\n\t Tone.Player.defaults = {\n\t 'onload': Tone.noOp,\n\t 'playbackRate': 1,\n\t 'loop': false,\n\t 'autostart': false,\n\t 'loopStart': 0,\n\t 'loopEnd': 0,\n\t 'retrigger': false,\n\t 'reverse': false,\n\t 'fadeIn': 0,\n\t 'fadeOut': 0\n\t };\n\t /**\n\t\t * Load the audio file as an audio buffer.\n\t\t * Decodes the audio asynchronously and invokes\n\t\t * the callback once the audio buffer loads.\n\t\t * Note: this does not need to be called if a url\n\t\t * was passed in to the constructor. Only use this\n\t\t * if you want to manually load a new url.\n\t\t * @param {string} url The url of the buffer to load.\n\t\t * Filetype support depends on the\n\t\t * browser.\n\t\t * @param {Function=} callback The function to invoke once\n\t\t * the sample is loaded.\n\t\t * @returns {Promise}\n\t\t */\n\t Tone.Player.prototype.load = function (url, callback) {\n\t return this._buffer.load(url, this._onload.bind(this, callback));\n\t };\n\t /**\n\t\t * Internal callback when the buffer is loaded.\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._onload = function (callback) {\n\t callback = Tone.defaultArg(callback, Tone.noOp);\n\t callback(this);\n\t if (this.autostart) {\n\t this.start();\n\t }\n\t };\n\t /**\n\t\t * Internal callback when the buffer is done playing.\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._onSourceEnd = function (source) {\n\t var index = this._activeSources.indexOf(source);\n\t this._activeSources.splice(index, 1);\n\t };\n\t /**\n\t\t * Play the buffer at the given startTime. Optionally add an offset\n\t\t * and/or duration which will play the buffer from a position\n\t\t * within the buffer for the given duration.\n\t\t *\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @returns {Tone.Player} this\n\t\t * @memberOf Tone.Player#\n\t\t * @method start\n\t\t * @name start\n\t\t */\n\t /**\n\t\t * Internal start method\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._start = function (startTime, offset, duration) {\n\t //if it's a loop the default offset is the loopstart point\n\t if (this._loop) {\n\t offset = Tone.defaultArg(offset, this._loopStart);\n\t } else {\n\t //otherwise the default offset is 0\n\t offset = Tone.defaultArg(offset, 0);\n\t }\n\t //compute the values in seconds\n\t offset = this.toSeconds(offset);\n\t var computedDuration = Tone.defaultArg(duration, Math.max(this._buffer.duration - offset, 0));\n\t computedDuration = this.toSeconds(computedDuration);\n\t startTime = this.toSeconds(startTime);\n\t //start the elapsed time counter\n\t this._elapsedTime.start(startTime, offset);\n\t //make the source\n\t var source = new Tone.BufferSource({\n\t 'buffer': this._buffer,\n\t 'loop': this._loop,\n\t 'loopStart': this._loopStart,\n\t 'loopEnd': this._loopEnd,\n\t 'onended': this._onSourceEnd.bind(this),\n\t 'playbackRate': this._playbackRate,\n\t 'fadeIn': this.fadeIn,\n\t 'fadeOut': this.fadeOut\n\t }).connect(this.output);\n\t //set the looping properties\n\t if (!this._loop && !this._synced) {\n\t //if it's not looping, set the state change at the end of the sample\n\t this._state.setStateAtTime(Tone.State.Stopped, startTime + computedDuration / this._playbackRate);\n\t }\n\t //add it to the array of active sources\n\t this._activeSources.push(source);\n\t //start it\n\t if (this._loop && Tone.isUndef(duration)) {\n\t source.start(startTime, offset);\n\t } else {\n\t source.start(startTime, offset, computedDuration);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Stop playback.\n\t\t * @private\n\t\t * @param {Time} [time=now]\n\t\t * @returns {Tone.Player} this\n\t\t */\n\t Tone.Player.prototype._stop = function (time) {\n\t time = this.toSeconds(time);\n\t this._elapsedTime.stop(time);\n\t this._activeSources.forEach(function (source) {\n\t source.stop(time);\n\t });\n\t return this;\n\t };\n\t /**\n\t\t * Stop and then restart the player from the beginning (or offset)\n\t\t * @param {Time} [startTime=now] When the player should start.\n\t\t * @param {Time} [offset=0] The offset from the beginning of the sample\n\t\t * to start at.\n\t\t * @param {Time=} duration How long the sample should play. If no duration\n\t\t * is given, it will default to the full length\n\t\t * of the sample (minus any offset)\n\t\t * @returns {Tone.Player} this\n\t\t */\n\t Tone.Player.prototype.restart = function (time, offset, duration) {\n\t this._stop(time);\n\t this._start(time, offset, duration);\n\t return this;\n\t };\n\t /**\n\t\t * Seek to a specific time in the player's buffer. If the\n\t\t * source is no longer playing at that time, it will stop.\n\t\t * If you seek to a time that\n\t\t * @param {Time} offset The time to seek to.\n\t\t * @param {Time=} time The time for the seek event to occur.\n\t\t * @return {Tone.Player} this\n\t\t * @example\n\t\t * source.start(0.2);\n\t\t * source.stop(0.4);\n\t\t */\n\t Tone.Player.prototype.seek = function (offset, time) {\n\t time = this.toSeconds(time);\n\t if (this._state.getValueAtTime(time) === Tone.State.Started) {\n\t offset = this.toSeconds(offset);\n\t // if it's currently playing, stop it\n\t this._stop(time);\n\t //restart it at the given time\n\t this._start(time, offset);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * Set the loop start and end. Will only loop if loop is\n\t\t * set to true.\n\t\t * @param {Time} loopStart The loop end time\n\t\t * @param {Time} loopEnd The loop end time\n\t\t * @returns {Tone.Player} this\n\t\t * @example\n\t\t * //loop 0.1 seconds of the file.\n\t\t * player.setLoopPoints(0.2, 0.3);\n\t\t * player.loop = true;\n\t\t */\n\t Tone.Player.prototype.setLoopPoints = function (loopStart, loopEnd) {\n\t this.loopStart = loopStart;\n\t this.loopEnd = loopEnd;\n\t return this;\n\t };\n\t /**\n\t\t * If loop is true, the loop will start at this position.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Time}\n\t\t * @name loopStart\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loopStart', {\n\t get: function () {\n\t return this._loopStart;\n\t },\n\t set: function (loopStart) {\n\t this._loopStart = loopStart;\n\t //get the current source\n\t this._activeSources.forEach(function (source) {\n\t source.loopStart = loopStart;\n\t });\n\t }\n\t });\n\t /**\n\t\t * If loop is true, the loop will end at this position.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Time}\n\t\t * @name loopEnd\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loopEnd', {\n\t get: function () {\n\t return this._loopEnd;\n\t },\n\t set: function (loopEnd) {\n\t this._loopEnd = loopEnd;\n\t //get the current source\n\t this._activeSources.forEach(function (source) {\n\t source.loopEnd = loopEnd;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The audio buffer belonging to the player.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Tone.Buffer}\n\t\t * @name buffer\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'buffer', {\n\t get: function () {\n\t return this._buffer;\n\t },\n\t set: function (buffer) {\n\t this._buffer.set(buffer);\n\t }\n\t });\n\t /**\n\t\t * If the buffer should loop once it's over.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Boolean}\n\t\t * @name loop\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loop', {\n\t get: function () {\n\t return this._loop;\n\t },\n\t set: function (loop) {\n\t //if no change, do nothing\n\t if (this._loop === loop) {\n\t return;\n\t }\n\t this._loop = loop;\n\t var now = this.now();\n\t if (!loop) {\n\t //stop the playback on the next cycle\n\t this._stopAtNextIteration(now);\n\t } else {\n\t //remove the next stopEvent\n\t var stopEvent = this._state.getNextState(Tone.State.Stopped, now);\n\t if (stopEvent) {\n\t this._activeSources.forEach(function (source) {\n\t source.loop = loop;\n\t });\n\t this._state.cancel(stopEvent.time);\n\t this._elapsedTime.cancel(stopEvent.time);\n\t }\n\t }\n\t }\n\t });\n\t /**\n\t\t * Schedules a stop event at the next full iteration. Used\n\t\t * for scheduling stop when the loop state or playbackRate changes\n\t\t * @param {Number} now The current time\n\t\t * @private\n\t\t */\n\t Tone.Player.prototype._stopAtNextIteration = function (now) {\n\t if (this._state.getValueAtTime(now) === Tone.State.Started) {\n\t var nextStop = this._state.getNextState(Tone.State.Stopped, now);\n\t var position = this._elapsedTime.getTicksAtTime(now);\n\t var iterations = Math.max(Math.ceil(position / this.buffer.duration), 1);\n\t var stopTime = this._elapsedTime.getTimeOfTick(iterations * this.buffer.duration, nextStop ? nextStop.time - this.sampleTime : Infinity);\n\t this.stop(stopTime);\n\t }\n\t };\n\t /**\n\t\t * The playback speed. 1 is normal speed. This is not a signal because\n\t\t * Safari and iOS currently don't support playbackRate as a signal.\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Number}\n\t\t * @name playbackRate\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'playbackRate', {\n\t get: function () {\n\t return this._playbackRate;\n\t },\n\t set: function (rate) {\n\t this._playbackRate = rate;\n\t var now = this.now();\n\t this._elapsedTime.frequency.setValueAtTime(rate, now);\n\t //if it's not looping\n\t if (!this._loop) {\n\t this._stopAtNextIteration(now);\n\t }\n\t //set all the sources\n\t this._activeSources.forEach(function (source) {\n\t source.playbackRate.setValueAtTime(rate, now);\n\t });\n\t }\n\t });\n\t /**\n\t\t * The current playback position of the buffer. \n\t\t * @memberOf Tone.Player#\n\t\t * @type {Number}\n\t\t * @name position\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'position', {\n\t get: function () {\n\t var now = this.now();\n\t if (this._state.getValueAtTime(now) === Tone.State.Started && this.loaded) {\n\t var duration = this.buffer.duration;\n\t var position = this._elapsedTime.getTicksAtTime(now);\n\t return position % duration;\n\t } else {\n\t return 0;\n\t }\n\t }\n\t });\n\t /**\n\t\t * The direction the buffer should play in\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Boolean}\n\t\t * @name reverse\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'reverse', {\n\t get: function () {\n\t return this._buffer.reverse;\n\t },\n\t set: function (rev) {\n\t this._buffer.reverse = rev;\n\t }\n\t });\n\t /**\n\t\t * If all the buffer is loaded\n\t\t * @memberOf Tone.Player#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Player.prototype, 'loaded', {\n\t get: function () {\n\t return this._buffer.loaded;\n\t }\n\t });\n\t /**\n\t\t * Dispose and disconnect.\n\t\t * @return {Tone.Player} this\n\t\t */\n\t Tone.Player.prototype.dispose = function () {\n\t //disconnect all of the players\n\t this._activeSources.forEach(function (source) {\n\t source.dispose();\n\t });\n\t this._activeSources = null;\n\t Tone.Source.prototype.dispose.call(this);\n\t this._buffer.dispose();\n\t this._buffer = null;\n\t this._elapsedTime.dispose();\n\t this._elapsedTime = null;\n\t return this;\n\t };\n\t return Tone.Player;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.Players combines multiple [Tone.Player](Player) objects.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Object} urls An object mapping a name to a url.\n\t\t * @param {function=} onload The function to invoke when all buffers are loaded.\n\t\t */\n\t Tone.Players = function (urls) {\n\t var args = Array.prototype.slice.call(arguments);\n\t args.shift();\n\t var options = Tone.defaults(args, ['onload'], Tone.Players);\n\t Tone.call(this);\n\t /**\n\t\t\t * The output volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * source.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t //make the output explicitly stereo\n\t this._volume.output.output.channelCount = 2;\n\t this._volume.output.output.channelCountMode = 'explicit';\n\t //mute initially\n\t this.mute = options.mute;\n\t /**\n\t\t\t * The container of all of the players\n\t\t\t * @type {Object}\n\t\t\t * @private\n\t\t\t */\n\t this._players = {};\n\t /**\n\t\t\t * The loading count\n\t\t\t * @type {Number}\n\t\t\t * @private\n\t\t\t */\n\t this._loadingCount = 0;\n\t /**\n\t\t\t * private holder of the fadeIn time\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._fadeIn = options.fadeIn;\n\t /**\n\t\t\t * private holder of the fadeOut time\n\t\t\t * @type {Time}\n\t\t\t * @private\n\t\t\t */\n\t this._fadeOut = options.fadeOut;\n\t //add all of the players\n\t for (var name in urls) {\n\t this._loadingCount++;\n\t this.add(name, urls[name], this._bufferLoaded.bind(this, options.onload));\n\t }\n\t };\n\t Tone.extend(Tone.Players, Tone.AudioNode);\n\t /**\n\t\t * The default values\n\t\t * @type {Object}\n\t\t */\n\t Tone.Players.defaults = {\n\t 'volume': 0,\n\t 'mute': false,\n\t 'onload': Tone.noOp,\n\t 'fadeIn': 0,\n\t 'fadeOut': 0\n\t };\n\t /**\n\t\t * A buffer was loaded. decrement the counter.\n\t\t * @param {Function} callback\n\t\t * @private\n\t\t */\n\t Tone.Players.prototype._bufferLoaded = function (callback) {\n\t this._loadingCount--;\n\t if (this._loadingCount === 0 && callback) {\n\t callback(this);\n\t }\n\t };\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * source.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * The fadeIn time of the amplitude envelope.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {Time}\n\t\t * @name fadeIn\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'fadeIn', {\n\t get: function () {\n\t return this._fadeIn;\n\t },\n\t set: function (fadeIn) {\n\t this._fadeIn = fadeIn;\n\t this._forEach(function (player) {\n\t player.fadeIn = fadeIn;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The fadeOut time of the amplitude envelope.\n\t\t * @memberOf Tone.Source#\n\t\t * @type {Time}\n\t\t * @name fadeOut\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'fadeOut', {\n\t get: function () {\n\t return this._fadeOut;\n\t },\n\t set: function (fadeOut) {\n\t this._fadeOut = fadeOut;\n\t this._forEach(function (player) {\n\t player.fadeOut = fadeOut;\n\t });\n\t }\n\t });\n\t /**\n\t\t * The state of the players object. Returns \"started\" if any of the players are playing.\n\t\t * @memberOf Tone.Players#\n\t\t * @type {String}\n\t\t * @name state\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'state', {\n\t get: function () {\n\t var playing = false;\n\t this._forEach(function (player) {\n\t playing = playing || player.state === Tone.State.Started;\n\t });\n\t return playing ? Tone.State.Started : Tone.State.Stopped;\n\t }\n\t });\n\t /**\n\t\t * True if the buffers object has a buffer by that name.\n\t\t * @param {String|Number} name The key or index of the\n\t\t * buffer.\n\t\t * @return {Boolean}\n\t\t */\n\t Tone.Players.prototype.has = function (name) {\n\t return this._players.hasOwnProperty(name);\n\t };\n\t /**\n\t\t * Get a player by name.\n\t\t * @param {String} name The players name as defined in\n\t\t * the constructor object or `add` method.\n\t\t * @return {Tone.Player}\n\t\t */\n\t Tone.Players.prototype.get = function (name) {\n\t if (this.has(name)) {\n\t return this._players[name];\n\t } else {\n\t throw new Error('Tone.Players: no player named ' + name);\n\t }\n\t };\n\t /**\n\t\t * Iterate over all of the players\n\t\t * @param {Function} callback\n\t\t * @return {Tone.Players} this\n\t\t * @private\n\t\t */\n\t Tone.Players.prototype._forEach = function (callback) {\n\t for (var playerName in this._players) {\n\t callback(this._players[playerName], playerName);\n\t }\n\t return this;\n\t };\n\t /**\n\t\t * If all the buffers are loaded or not\n\t\t * @memberOf Tone.Players#\n\t\t * @type {Boolean}\n\t\t * @name loaded\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.Players.prototype, 'loaded', {\n\t get: function () {\n\t var isLoaded = true;\n\t this._forEach(function (player) {\n\t isLoaded = isLoaded && player.loaded;\n\t });\n\t return isLoaded;\n\t }\n\t });\n\t /**\n\t\t * Add a player by name and url to the Players\n\t\t * @param {String} name A unique name to give the player\n\t\t * @param {String|Tone.Buffer|Audiobuffer} url Either the url of the bufer,\n\t\t * or a buffer which will be added\n\t\t * with the given name.\n\t\t * @param {Function=} callback The callback to invoke\n\t\t * when the url is loaded.\n\t\t */\n\t Tone.Players.prototype.add = function (name, url, callback) {\n\t this._players[name] = new Tone.Player(url, callback).connect(this.output);\n\t this._players[name].fadeIn = this._fadeIn;\n\t this._players[name].fadeOut = this._fadeOut;\n\t return this;\n\t };\n\t /**\n\t\t * Stop all of the players at the given time\n\t\t * @param {Time} time The time to stop all of the players.\n\t\t * @return {Tone.Players} this\n\t\t */\n\t Tone.Players.prototype.stopAll = function (time) {\n\t this._forEach(function (player) {\n\t player.stop(time);\n\t });\n\t };\n\t /**\n\t\t * Dispose and disconnect.\n\t\t * @return {Tone.Players} this\n\t\t */\n\t Tone.Players.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this._volume.dispose();\n\t this._volume = null;\n\t this._writable('volume');\n\t this.volume = null;\n\t this.output = null;\n\t this._forEach(function (player) {\n\t player.dispose();\n\t });\n\t this._players = null;\n\t return this;\n\t };\n\t return Tone.Players;\n\t});\n\tModule(function (Tone) {\n\t \n\t /**\n\t\t * @class Tone.UserMedia uses MediaDevices.getUserMedia to open up\n\t\t * and external microphone or audio input. Check\n\t\t * [MediaDevices API Support](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia)\n\t\t * to see which browsers are supported. Access to an external input\n\t\t * is limited to secure (HTTPS) connections.\n\t\t *\n\t\t * @constructor\n\t\t * @extends {Tone.AudioNode}\n\t\t * @param {Decibels=} volume The level of the input\n\t\t * @example\n\t\t * //list the inputs and open the third one\n\t\t * var motu = new Tone.UserMedia();\n\t\t *\n\t\t * //opening the input asks the user to activate their mic\n\t\t * motu.open().then(function(){\n\t\t * \t//promise resolves when input is available\n\t\t * });\n\t\t */\n\t Tone.UserMedia = function () {\n\t var options = Tone.defaults(arguments, ['volume'], Tone.UserMedia);\n\t Tone.AudioNode.call(this);\n\t /**\n\t\t\t * The MediaStreamNode\n\t\t\t * @type {MediaStreamAudioSourceNode}\n\t\t\t * @private\n\t\t\t */\n\t this._mediaStream = null;\n\t /**\n\t\t\t * The media stream created by getUserMedia.\n\t\t\t * @type {LocalMediaStream}\n\t\t\t * @private\n\t\t\t */\n\t this._stream = null;\n\t /**\n\t\t\t * The open device\n\t\t\t * @type {MediaDeviceInfo}\n\t\t\t * @private\n\t\t\t */\n\t this._device = null;\n\t /**\n\t\t\t * The output volume node\n\t\t\t * @type {Tone.Volume}\n\t\t\t * @private\n\t\t\t */\n\t this._volume = this.output = new Tone.Volume(options.volume);\n\t /**\n\t\t\t * The volume of the output in decibels.\n\t\t\t * @type {Decibels}\n\t\t\t * @signal\n\t\t\t * @example\n\t\t\t * input.volume.value = -6;\n\t\t\t */\n\t this.volume = this._volume.volume;\n\t this._readOnly('volume');\n\t this.mute = options.mute;\n\t };\n\t Tone.extend(Tone.UserMedia, Tone.AudioNode);\n\t /**\n\t\t * the default parameters\n\t\t * @type {Object}\n\t\t */\n\t Tone.UserMedia.defaults = {\n\t 'volume': 0,\n\t 'mute': false\n\t };\n\t /**\n\t\t * Open the media stream. If a string is passed in, it is assumed\n\t\t * to be the label or id of the stream, if a number is passed in,\n\t\t * it is the input number of the stream.\n\t\t * @param {String|Number} [labelOrId=\"default\"] The label or id of the audio input media device.\n\t\t * With no argument, the default stream is opened.\n\t\t * @return {Promise} The promise is resolved when the stream is open.\n\t\t */\n\t Tone.UserMedia.prototype.open = function (labelOrId) {\n\t return Tone.UserMedia.enumerateDevices().then(function (devices) {\n\t var device;\n\t if (Tone.isNumber(labelOrId)) {\n\t device = devices[labelOrId];\n\t } else {\n\t device = devices.find(function (device) {\n\t return device.label === labelOrId || device.deviceId === labelOrId;\n\t });\n\t //didn't find a matching device\n\t if (!device && devices.length > 0) {\n\t device = devices[0];\n\t } else if (!device && Tone.isDefined(labelOrId)) {\n\t throw new Error('Tone.UserMedia: no matching device: ' + labelOrId);\n\t }\n\t }\n\t this._device = device;\n\t //do getUserMedia\n\t var constraints = {\n\t audio: {\n\t 'echoCancellation': false,\n\t 'sampleRate': this.context.sampleRate\n\t }\n\t };\n\t if (device) {\n\t constraints.audio.deviceId = device.deviceId;\n\t }\n\t return navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {\n\t //start a new source only if the previous one is closed\n\t if (!this._stream) {\n\t this._stream = stream;\n\t //Wrap a MediaStreamSourceNode around the live input stream.\n\t this._mediaStream = this.context.createMediaStreamSource(stream);\n\t //Connect the MediaStreamSourceNode to a gate gain node\n\t this._mediaStream.connect(this.output);\n\t }\n\t return this;\n\t }.bind(this));\n\t }.bind(this));\n\t };\n\t /**\n\t\t * Close the media stream\n\t\t * @return {Tone.UserMedia} this\n\t\t */\n\t Tone.UserMedia.prototype.close = function () {\n\t if (this._stream) {\n\t this._stream.getAudioTracks().forEach(function (track) {\n\t track.stop();\n\t });\n\t this._stream = null;\n\t //remove the old media stream\n\t this._mediaStream.disconnect();\n\t this._mediaStream = null;\n\t }\n\t this._device = null;\n\t return this;\n\t };\n\t /**\n\t\t * Returns a promise which resolves with the list of audio input devices available.\n\t\t * @return {Promise} The promise that is resolved with the devices\n\t\t * @static\n\t\t * @example\n\t\t * Tone.UserMedia.enumerateDevices().then(function(devices){\n\t\t * \tconsole.log(devices)\n\t\t * })\n\t\t */\n\t Tone.UserMedia.enumerateDevices = function () {\n\t return navigator.mediaDevices.enumerateDevices().then(function (devices) {\n\t return devices.filter(function (device) {\n\t return device.kind === 'audioinput';\n\t });\n\t });\n\t };\n\t /**\n\t\t * Returns the playback state of the source, \"started\" when the microphone is open\n\t\t * and \"stopped\" when the mic is closed.\n\t\t * @type {Tone.State}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name state\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'state', {\n\t get: function () {\n\t return this._stream && this._stream.active ? Tone.State.Started : Tone.State.Stopped;\n\t }\n\t });\n\t /**\n\t\t * \tReturns an identifier for the represented device that is\n\t\t * \tpersisted across sessions. It is un-guessable by other applications and\n\t\t * \tunique to the origin of the calling application. It is reset when the\n\t\t * \tuser clears cookies (for Private Browsing, a different identifier is\n\t\t * \tused that is not persisted across sessions). Returns undefined when the\n\t\t * \tdevice is not open.\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name deviceId\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'deviceId', {\n\t get: function () {\n\t if (this._device) {\n\t return this._device.deviceId;\n\t }\n\t }\n\t });\n\t /**\n\t\t * \tReturns a group identifier. Two devices have the\n\t\t * \tsame group identifier if they belong to the same physical device.\n\t\t * \tReturns undefined when the device is not open.\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name groupId\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'groupId', {\n\t get: function () {\n\t if (this._device) {\n\t return this._device.groupId;\n\t }\n\t }\n\t });\n\t /**\n\t\t * \tReturns a label describing this device (for example \"Built-in Microphone\").\n\t\t * \tReturns undefined when the device is not open or label is not available\n\t\t * \tbecause of permissions.\n\t\t * @type {String}\n\t\t * @readOnly\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name groupId\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'label', {\n\t get: function () {\n\t if (this._device) {\n\t return this._device.label;\n\t }\n\t }\n\t });\n\t /**\n\t\t * Mute the output.\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @type {boolean}\n\t\t * @name mute\n\t\t * @example\n\t\t * //mute the output\n\t\t * userMedia.mute = true;\n\t\t */\n\t Object.defineProperty(Tone.UserMedia.prototype, 'mute', {\n\t get: function () {\n\t return this._volume.mute;\n\t },\n\t set: function (mute) {\n\t this._volume.mute = mute;\n\t }\n\t });\n\t /**\n\t\t * Clean up.\n\t\t * @return {Tone.UserMedia} this\n\t\t */\n\t Tone.UserMedia.prototype.dispose = function () {\n\t Tone.AudioNode.prototype.dispose.call(this);\n\t this.close();\n\t this._writable('volume');\n\t this._volume.dispose();\n\t this._volume = null;\n\t this.volume = null;\n\t return this;\n\t };\n\t /**\n\t\t * If getUserMedia is supported by the browser.\n\t\t * @type {Boolean}\n\t\t * @memberOf Tone.UserMedia#\n\t\t * @name supported\n\t\t * @static\n\t\t * @readOnly\n\t\t */\n\t Object.defineProperty(Tone.UserMedia, 'supported', {\n\t get: function () {\n\t return Tone.isDefined(navigator.mediaDevices) && Tone.isFunction(navigator.mediaDevices.getUserMedia);\n\t }\n\t });\n\t return Tone.UserMedia;\n\t});\n\tModule(function (Tone) {\n\t /**\n\t\t * @class Tone.Midi is a primitive type for encoding Time values.\n\t\t * Tone.Midi can be constructed with or without the `new` keyword. Tone.Midi can be passed\n\t\t * into the parameter of any method which takes time as an argument.\n\t\t * @constructor\n\t\t * @extends {Tone.Frequency}\n\t\t * @param {String|Number} val The time value.\n\t\t * @param {String=} units The units of the value.\n\t\t * @example\n\t\t * var t = Tone.Midi(\"4n\");//a quarter note\n\t\t */\n\t Tone.Midi = function (val, units) {\n\t if (this instanceof Tone.Midi) {\n\t Tone.Frequency.call(this, val, units);\n\t } else {\n\t return new Tone.Midi(val, units);\n\t }\n\t };\n\t Tone.extend(Tone.Midi, Tone.Frequency);\n\t /**\n\t\t * The default units if none are given.\n\t\t * @type {String}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._defaultUnits = 'midi';\n\t /**\n\t\t * Returns the value of a frequency in the current units\n\t\t * @param {Frequency} freq\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._frequencyToUnits = function (freq) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._frequencyToUnits.call(this, freq));\n\t };\n\t /**\n\t\t * Returns the value of a tick in the current time units\n\t\t * @param {Ticks} ticks\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._ticksToUnits = function (ticks) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._ticksToUnits.call(this, ticks));\n\t };\n\t /**\n\t\t * Return the value of the beats in the current units\n\t\t * @param {Number} beats\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._beatsToUnits = function (beats) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._beatsToUnits.call(this, beats));\n\t };\n\t /**\n\t\t * Returns the value of a second in the current units\n\t\t * @param {Seconds} seconds\n\t\t * @return {Number}\n\t\t * @private\n\t\t */\n\t Tone.Midi.prototype._secondsToUnits = function (seconds) {\n\t return Tone.Frequency.ftom(Tone.Frequency.prototype._secondsToUnits.call(this, seconds));\n\t };\n\t /**\n\t\t * Return the value of the frequency as a MIDI note\n\t\t * @return {MIDI}\n\t\t * @example\n\t\t * Tone.Midi(60).toMidi(); //60\n\t\t */\n\t Tone.Midi.prototype.toMidi = function () {\n\t return this.valueOf();\n\t };\n\t /**\n\t\t * Return the value of the frequency as a MIDI note\n\t\t * @return {MIDI}\n\t\t * @example\n\t\t * Tone.Midi(60).toMidi(); //60\n\t\t */\n\t Tone.Midi.prototype.toFrequency = function () {\n\t return Tone.Frequency.mtof(this.toMidi());\n\t };\n\t /**\n\t\t * Transposes the frequency by the given number of semitones.\n\t\t * @param {Interval} interval\n\t\t * @return {Tone.Frequency} A new transposed frequency\n\t\t * @example\n\t\t * Tone.Frequency(\"A4\").transpose(3); //\"C5\"\n\t\t */\n\t Tone.Midi.prototype.transpose = function (interval) {\n\t return new this.constructor(this.toMidi() + interval);\n\t };\n\t return Tone.Midi;\n\t});\n\t\n\treturn Tone;\n}));","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction valueEqual(a, b) {\n if (a === b) return true;\n\n if (a == null || b == null) return false;\n\n if (Array.isArray(a)) {\n return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {\n return valueEqual(item, b[index]);\n });\n }\n\n var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a);\n var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b);\n\n if (aType !== bType) return false;\n\n if (aType === 'object') {\n var aValue = a.valueOf();\n var bValue = b.valueOf();\n\n if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);\n\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n return aKeys.every(function (key) {\n return valueEqual(a[key], b[key]);\n });\n }\n\n return false;\n}\n\nexport default valueEqual;","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n\n if (format.length < 10 || (/^[s\\W]*$/).test(format)) {\n throw new Error(\n 'The warning format should be able to uniquely identify this ' +\n 'warning. Please, use a more descriptive format than: ' + format\n );\n }\n\n if (!condition) {\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch(x) {}\n }\n };\n}\n\nmodule.exports = warning;\n","module.exports = function() {\r\n\tthrow new Error(\"define cannot be used indirect\");\r\n};\r\n","/* globals __webpack_amd_options__ */\r\nmodule.exports = __webpack_amd_options__;\r\n","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n","module.exports = function(originalModule) {\r\n\tif (!originalModule.webpackPolyfill) {\r\n\t\tvar module = Object.create(originalModule);\r\n\t\t// module.parent = undefined by default\r\n\t\tif (!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"exports\", {\r\n\t\t\tenumerable: true\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n","module.exports = function(module) {\r\n\tif (!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif (!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA,WAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5vDA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7DA;AACA;AACA;AAAA;AAAA;AAAA;AACA,qBAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1fA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;;;;;;;;;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjSA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClTA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5JA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5EA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA,aACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3hBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpIA;AACA;;;;;;;;;;;ACDA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACJA;AACA;;;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACnBA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACNA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA;;;;;;;;;;;ACAA;AACA;AACA;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACfA;AACA;AACA;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5PA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3BA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACLA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7CA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACdA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACRA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5BA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7DA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACj1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnhDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnsCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACrnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7hBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAIA;;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACXA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChSA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5CA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACbA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1FA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjGA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpEA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1JA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5FA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC/BA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzaA;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACzEA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;;;;;;;;;;;;ACAA;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3kBA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzLA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvSA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAEA;AACA;AACA;AACA;;;;;;;;;;;;;;AClBA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA,UAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7zvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5GA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3DA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;;;;;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;A","sourceRoot":""}
\ No newline at end of file |
