{"version":3,"file":"vendors-da7e83e9.47e839c4edc29ae0ca22.bundle.js","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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://client-app/./node_modules/aurelia-testing/dist/native-modules/aurelia-testing.js","webpack://client-app/./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js","webpack://client-app/./node_modules/aurelia-webpack-plugin/runtime/pal-loader-entry.js"],"sourcesContent":["import { TargetInstruction, View } from 'aurelia-templating';\nimport { getLogger } from 'aurelia-logging';\nimport { DOM } from 'aurelia-pal';\n\nvar CompileSpy = (function () {\r\n function CompileSpy(element, instruction) {\r\n getLogger('compile-spy').info(element.toString(), instruction);\r\n }\r\n Object.defineProperty(CompileSpy, \"inject\", {\r\n get: function () { return [DOM.Element, TargetInstruction]; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n CompileSpy.$resource = {\r\n type: 'attribute',\r\n name: 'compile-spy'\r\n };\r\n return CompileSpy;\r\n}());\n\nvar ViewSpy = (function () {\r\n function ViewSpy() {\r\n this.logger = getLogger('view-spy');\r\n }\r\n ViewSpy.prototype._log = function (lifecycleName, context) {\r\n if (!this.value && lifecycleName === 'created') {\r\n this.logger.info(lifecycleName, this.view);\r\n }\r\n else if (this.value && this.value.indexOf(lifecycleName) !== -1) {\r\n this.logger.info(lifecycleName, this.view, context);\r\n }\r\n };\r\n ViewSpy.prototype.created = function (view) {\r\n this.view = view;\r\n this._log('created');\r\n };\r\n ViewSpy.prototype.bind = function (bindingContext) {\r\n this._log('bind', bindingContext);\r\n };\r\n ViewSpy.prototype.attached = function () {\r\n this._log('attached');\r\n };\r\n ViewSpy.prototype.detached = function () {\r\n this._log('detached');\r\n };\r\n ViewSpy.prototype.unbind = function () {\r\n this._log('unbind');\r\n };\r\n ViewSpy.$resource = {\r\n type: 'attribute',\r\n name: 'view-spy'\r\n };\r\n return ViewSpy;\r\n}());\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nfunction waitFor(getter, options) {\r\n if (options === void 0) { options = { present: true, interval: 50, timeout: 5000 }; }\r\n var timedOut = false;\r\n options = __assign({ present: true, interval: 50, timeout: 5000 }, options);\r\n function wait() {\r\n var element = getter();\r\n var found = element !== null && (!(element instanceof NodeList) &&\r\n !element.jquery || element.length > 0);\r\n if (!options.present === !found || timedOut) {\r\n return Promise.resolve(element);\r\n }\r\n return new Promise(function (rs) { return setTimeout(rs, options.interval); }).then(wait);\r\n }\r\n return Promise.race([\r\n new Promise(function (_, rj) { return setTimeout(function () {\r\n timedOut = true;\r\n rj(new Error(options.present ? 'Element not found' : 'Element not removed'));\r\n }, options.timeout); }),\r\n wait()\r\n ]);\r\n}\r\nfunction waitForDocumentElement(selector, options) {\r\n return waitFor(function () { return document.querySelector(selector); }, options);\r\n}\r\nfunction waitForDocumentElements(selector, options) {\r\n return waitFor(function () { return document.querySelectorAll(selector); }, options);\r\n}\n\nvar StageComponent = (function () {\r\n function StageComponent() {\r\n }\r\n StageComponent.withResources = function (resources) {\r\n if (resources === void 0) { resources = []; }\r\n return new ComponentTester().withResources(resources);\r\n };\r\n return StageComponent;\r\n}());\r\nvar ComponentTester = (function () {\r\n function ComponentTester() {\r\n this.resources = [];\r\n }\r\n ComponentTester.prototype.configure = function (aurelia) {\r\n return aurelia.use.standardConfiguration();\r\n };\r\n ComponentTester.prototype.bootstrap = function (configure) {\r\n this.configure = configure;\r\n };\r\n ComponentTester.prototype.withResources = function (resources) {\r\n this.resources = resources;\r\n return this;\r\n };\r\n ComponentTester.prototype.inView = function (html) {\r\n this.html = html;\r\n return this;\r\n };\r\n ComponentTester.prototype.boundTo = function (bindingContext) {\r\n this.bindingContext = bindingContext;\r\n return this;\r\n };\r\n ComponentTester.prototype.manuallyHandleLifecycle = function () {\r\n this._prepareLifecycle();\r\n return this;\r\n };\r\n ComponentTester.prototype.create = function (bootstrap) {\r\n var _this = this;\r\n return bootstrap(function (aurelia) {\r\n return Promise.resolve(_this.configure(aurelia)).then(function () {\r\n if (_this.resources) {\r\n aurelia.use.globalResources(_this.resources);\r\n }\r\n return aurelia.start().then(function () {\r\n _this.host = document.createElement('div');\r\n _this.host.innerHTML = _this.html;\r\n document.body.appendChild(_this.host);\r\n return aurelia.enhance(_this.bindingContext, _this.host).then(function () {\r\n _this.rootView = aurelia.root;\r\n _this.element = _this.host.firstElementChild;\r\n if (aurelia.root.controllers.length) {\r\n _this.viewModel = aurelia.root.controllers[0].viewModel;\r\n }\r\n return new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 0); });\r\n });\r\n });\r\n });\r\n });\r\n };\r\n ComponentTester.prototype.dispose = function () {\r\n if (this.host === undefined || this.rootView === undefined) {\r\n throw new Error('Cannot call ComponentTester.dispose() before ComponentTester.create()');\r\n }\r\n this.rootView.detached();\r\n this.rootView.unbind();\r\n return this.host.parentNode.removeChild(this.host);\r\n };\r\n ComponentTester.prototype._prepareLifecycle = function () {\r\n var _this = this;\r\n var bindPrototype = View.prototype.bind;\r\n View.prototype.bind = function () { };\r\n this.bind = function (bindingContext) { return new Promise(function (resolve) {\r\n View.prototype.bind = bindPrototype;\r\n if (bindingContext !== undefined) {\r\n _this.bindingContext = bindingContext;\r\n }\r\n _this.rootView.bind(_this.bindingContext);\r\n setTimeout(function () { return resolve(); }, 0);\r\n }); };\r\n var attachedPrototype = View.prototype.attached;\r\n View.prototype.attached = function () { };\r\n this.attached = function () { return new Promise(function (resolve) {\r\n View.prototype.attached = attachedPrototype;\r\n _this.rootView.attached();\r\n setTimeout(function () { return resolve(); }, 0);\r\n }); };\r\n this.detached = function () { return new Promise(function (resolve) {\r\n _this.rootView.detached();\r\n setTimeout(function () { return resolve(); }, 0);\r\n }); };\r\n this.unbind = function () { return new Promise(function (resolve) {\r\n _this.rootView.unbind();\r\n setTimeout(function () { return resolve(); }, 0);\r\n }); };\r\n };\r\n ComponentTester.prototype.waitForElement = function (selector, options) {\r\n var _this = this;\r\n return waitFor(function () { return _this.element.querySelector(selector); }, options);\r\n };\r\n ComponentTester.prototype.waitForElements = function (selector, options) {\r\n var _this = this;\r\n return waitFor(function () { return _this.element.querySelectorAll(selector); }, options);\r\n };\r\n return ComponentTester;\r\n}());\n\nfunction configure(config) {\r\n config.globalResources([CompileSpy, ViewSpy]);\r\n}\n\nexport { CompileSpy, ComponentTester, StageComponent, ViewSpy, configure, waitFor, waitForDocumentElement, waitForDocumentElements };\n//# sourceMappingURL=aurelia-testing.js.map\n","// This file contains an empty module that does nothing.\r\n// It's meant to be added as an entry point to the main bundle\r\n// and helps reliably adding some Aurelia dependencies that are attached \r\n// to no module in particular, such as `includeAll` results or `aureliaApp`.\r\n//\r\n// Trying to attach those dependencies to, for example, 'aurelia-bootstrapper' \r\n// is unreliable if 'aurelia-bootstrapper' is in a DLL outside the bundle.\r\n//\r\n// Trying to attach to 'aurelia-loader-webpack' works well, unless a user\r\n// configures a customized loader instead (unlikely, but in theory supported).\r\n","// With default aurelia-loader-webpack config, this module is added as an extra entry\r\n// before any other code executes so that PAL.Loader is properly configured.\r\n// There are several tricky points worth noticing.\r\n// \r\n// We don't add aurelia-loader-webpack itself as an entry point (used to until 2.0 RC2)\r\n// because it (transitively) brings too much bagage with itself, most notably polyfills.\r\n// This made it super-hard to add other polyfills before Aurelia's and led to various bugs.\r\n//\r\n// We don't add custom code in aurelia-pal or aurelia-loader or aurelia-bootstrapper to detect\r\n// the Webpack environment and configure the loader because they might live in a DLL.\r\n// If they do, they would bring aurelia-loader-webpack along in the DLL and this is a special \r\n// library that *has to be in the main chunk.*\r\n//\r\n// The over-complicated design I've settled upon in the end is to use this special module\r\n// as an entry point that configures aurelia-loader-webpack. It has minimal static imports:\r\n// just aurelia-pal, which itself has no other dependencies and doesn't run much code.\r\n// It hacks the loader field into a getter so that it can synchronously load aurelia-loader-webpack\r\n// just in time when it is demanded by aurelia-bootstrapper.\r\n// This enables users to load polyfills before aurelia-loader-webpack is actually loaded.\r\n\r\nimport { PLATFORM } from \"aurelia-pal\";\r\n\r\nvar Loader;\r\n\r\nObject.defineProperty(PLATFORM, \"Loader\", {\r\n get: function() {\r\n return Loader || (Loader = require(\"aurelia-loader-webpack\").WebpackLoader);\r\n },\r\n set: function(value) {\r\n Loader = value;\r\n }\r\n});\r\n"],"names":[],"sourceRoot":""}