{"version":3,"sources":["webpack:///./node_modules/aurelia-testing/dist/native-modules/wait.js","webpack:///./node_modules/aurelia-testing/dist/native-modules/component-tester.js","webpack:///./node_modules/aurelia-testing/dist/native-modules/aurelia-testing.js","webpack:///./node_modules/aurelia-testing/dist/native-modules/compile-spy.js","webpack:///./node_modules/aurelia-testing/dist/native-modules/view-spy.js"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","waitFor","getter","options","present","interval","timeout","timedOut","Promise","race","_","rj","setTimeout","Error","wait","element","found","NodeList","jquery","resolve","rs","then","waitForDocumentElement","selector","document","querySelector","waitForDocumentElements","querySelectorAll","StageComponent","withResources","resources","ComponentTester","this","configure","aurelia","use","standardConfiguration","bootstrap","inView","html","boundTo","bindingContext","manuallyHandleLifecycle","_prepareLifecycle","create","_this","globalResources","start","host","createElement","innerHTML","body","appendChild","enhance","rootView","root","firstElementChild","controllers","viewModel","dispose","undefined","detached","unbind","parentNode","removeChild","bindPrototype","bind","attachedPrototype","attached","waitForElement","waitForElements","config","__decorate","decorators","target","key","desc","d","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","CompileSpy","instruction","info","toString","Element","ViewSpy","logger","_log","lifecycleName","context","value","indexOf","view","created"],"mappings":"ykBAAIA,EAAsCC,OAAOC,QAAU,SAASC,GAChE,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,GAUJ,SAASU,EAAQC,EAAQC,QACZ,IAAZA,IAAsBA,EAAU,CAAEC,SAAS,EAAMC,SAAU,GAAIC,QAAS,MAE5E,IAAIC,GAAW,EAYf,OAXAJ,EAAUf,EAAS,CAAEgB,SAAS,EAAMC,SAAU,GAAIC,QAAS,KAAQH,GAW5DK,QAAQC,KAAK,C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AAUsE,SAAW,WACzBpC,KAAK2D,KAAK,aAKdF,EAAQ3F,UAAU+D,SAAW,WACzB7B,KAAK2D,KAAK,aAKdF,EAAQ3F,UAAUgE,OAAS,WACvB9B,KAAK2D,KAAK,WAEdF,EAAUjB,EAAW,CACjB,YAAgB,aACjBiB,GAlDqB","file":"vendor.aurelia-testing~4eb3b4b8.587e3c4738b54cab5c4d.chunk.js","sourcesContent":["var __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\n/**\n * Generic function to wait for something to happen. Uses polling\n * @param getter: a getter function that returns anything else than `null` or an\n * empty array or an empty jQuery object when the\n * condition is met\n * @param options: lookup options, defaults to\n * `{present: true, interval: 50, timeout: 5000}`\n */\nexport function waitFor(getter, options) {\n if (options === void 0) { options = { present: true, interval: 50, timeout: 5000 }; }\n // prevents infinite recursion if the request times out\n var timedOut = false;\n options = __assign({ present: true, interval: 50, timeout: 5000 }, options);\n function wait() {\n var element = getter();\n // boolean is needed here, hence the length > 0\n var found = element !== null && (!(element instanceof NodeList) &&\n !element.jquery || element.length > 0);\n if (!options.present === !found || timedOut) {\n return Promise.resolve(element);\n }\n return new Promise(function (rs) { return setTimeout(rs, options.interval); }).then(wait);\n }\n return Promise.race([\n new Promise(function (_, rj) { return setTimeout(function () {\n timedOut = true;\n rj(new Error(options.present ? 'Element not found' : 'Element not removed'));\n }, options.timeout); }),\n wait()\n ]);\n}\nexport function waitForDocumentElement(selector, options) {\n return waitFor(function () { return document.querySelector(selector); }, options);\n}\nexport function waitForDocumentElements(selector, options) {\n return waitFor(function () { return document.querySelectorAll(selector); }, options);\n}\n","import { View } from 'aurelia-templating';\nimport { waitFor } from './wait';\nvar StageComponent = /** @class */ (function () {\n function StageComponent() {\n }\n StageComponent.withResources = function (resources) {\n if (resources === void 0) { resources = []; }\n return new ComponentTester().withResources(resources);\n };\n return StageComponent;\n}());\nexport { StageComponent };\nvar ComponentTester = /** @class */ (function () {\n function ComponentTester() {\n this.resources = [];\n }\n ComponentTester.prototype.configure = function (aurelia) {\n return aurelia.use.standardConfiguration();\n };\n ComponentTester.prototype.bootstrap = function (configure) {\n this.configure = configure;\n };\n ComponentTester.prototype.withResources = function (resources) {\n this.resources = resources;\n return this;\n };\n ComponentTester.prototype.inView = function (html) {\n this.html = html;\n return this;\n };\n ComponentTester.prototype.boundTo = function (bindingContext) {\n this.bindingContext = bindingContext;\n return this;\n };\n ComponentTester.prototype.manuallyHandleLifecycle = function () {\n this._prepareLifecycle();\n return this;\n };\n ComponentTester.prototype.create = function (bootstrap) {\n var _this = this;\n return bootstrap(function (aurelia) {\n return Promise.resolve(_this.configure(aurelia)).then(function () {\n if (_this.resources) {\n aurelia.use.globalResources(_this.resources);\n }\n return aurelia.start().then(function () {\n _this.host = document.createElement('div');\n _this.host.innerHTML = _this.html;\n document.body.appendChild(_this.host);\n return aurelia.enhance(_this.bindingContext, _this.host).then(function () {\n _this.rootView = aurelia.root;\n _this.element = _this.host.firstElementChild;\n if (aurelia.root.controllers.length) {\n _this.viewModel = aurelia.root.controllers[0].viewModel;\n }\n return new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 0); });\n });\n });\n });\n });\n };\n ComponentTester.prototype.dispose = function () {\n if (this.host === undefined || this.rootView === undefined) {\n throw new Error('Cannot call ComponentTester.dispose() before ComponentTester.create()');\n }\n this.rootView.detached();\n this.rootView.unbind();\n return this.host.parentNode.removeChild(this.host);\n };\n ComponentTester.prototype._prepareLifecycle = function () {\n var _this = this;\n // bind\n var bindPrototype = View.prototype.bind;\n // tslint:disable-next-line:no-empty\n View.prototype.bind = function () { };\n this.bind = function (bindingContext) { return new Promise(function (resolve) {\n View.prototype.bind = bindPrototype;\n if (bindingContext !== undefined) {\n _this.bindingContext = bindingContext;\n }\n _this.rootView.bind(_this.bindingContext);\n setTimeout(function () { return resolve(); }, 0);\n }); };\n // attached\n var attachedPrototype = View.prototype.attached;\n // tslint:disable-next-line:no-empty\n View.prototype.attached = function () { };\n this.attached = function () { return new Promise(function (resolve) {\n View.prototype.attached = attachedPrototype;\n _this.rootView.attached();\n setTimeout(function () { return resolve(); }, 0);\n }); };\n // detached\n this.detached = function () { return new Promise(function (resolve) {\n _this.rootView.detached();\n setTimeout(function () { return resolve(); }, 0);\n }); };\n // unbind\n this.unbind = function () { return new Promise(function (resolve) {\n _this.rootView.unbind();\n setTimeout(function () { return resolve(); }, 0);\n }); };\n };\n ComponentTester.prototype.waitForElement = function (selector, options) {\n var _this = this;\n return waitFor(function () { return _this.element.querySelector(selector); }, options);\n };\n ComponentTester.prototype.waitForElements = function (selector, options) {\n var _this = this;\n return waitFor(function () { return _this.element.querySelectorAll(selector); }, options);\n };\n return ComponentTester;\n}());\nexport { ComponentTester };\n","export * from './compile-spy';\nexport * from './view-spy';\nexport * from './component-tester';\nexport * from './wait';\nexport function configure(config) {\n config.globalResources([\n './compile-spy',\n './view-spy'\n ]);\n}\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { customAttribute, TargetInstruction } from 'aurelia-templating';\nimport { inject } from 'aurelia-dependency-injection';\nimport { getLogger } from 'aurelia-logging';\nimport { DOM } from 'aurelia-pal';\n/**\n * Attribute to be placed on any element to have it emit the View Compiler's\n * TargetInstruction into the debug console, giving you insight into all the\n * parsed bindings, behaviors and event handers for the targeted element.\n */\nvar CompileSpy = /** @class */ (function () {\n /**\n * Creates and instanse of CompileSpy.\n * @param element target element on where attribute is placed on.\n * @param instruction instructions for how the target element should be enhanced.\n */\n function CompileSpy(element, instruction) {\n getLogger('compile-spy').info(element.toString(), instruction);\n }\n CompileSpy = __decorate([\n customAttribute('compile-spy'),\n inject(DOM.Element, TargetInstruction)\n ], CompileSpy);\n return CompileSpy;\n}());\nexport { CompileSpy };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { customAttribute } from 'aurelia-templating';\nimport { getLogger } from 'aurelia-logging';\n/**\n * Attribute to be placed on any HTML element in a view to emit the View instance\n * to the debug console, giving you insight into the live View instance, including\n * all child views, live bindings, behaviors and more.\n */\nvar ViewSpy = /** @class */ (function () {\n /**\n * Creates a new instance of ViewSpy.\n */\n function ViewSpy() {\n this.logger = getLogger('view-spy');\n }\n ViewSpy.prototype._log = function (lifecycleName, context) {\n if (!this.value && lifecycleName === 'created') {\n this.logger.info(lifecycleName, this.view);\n }\n else if (this.value && this.value.indexOf(lifecycleName) !== -1) {\n this.logger.info(lifecycleName, this.view, context);\n }\n };\n /**\n * Invoked when the target view is created.\n * @param view The target view.\n */\n ViewSpy.prototype.created = function (view) {\n this.view = view;\n this._log('created');\n };\n /**\n * Invoked when the target view is bound.\n * @param bindingContext The target view's binding context.\n */\n ViewSpy.prototype.bind = function (bindingContext) {\n this._log('bind', bindingContext);\n };\n /**\n * Invoked when the target element is attached to the DOM.\n */\n ViewSpy.prototype.attached = function () {\n this._log('attached');\n };\n /**\n * Invoked when the target element is detached from the DOM.\n */\n ViewSpy.prototype.detached = function () {\n this._log('detached');\n };\n /**\n * Invoked when the target element is unbound.\n */\n ViewSpy.prototype.unbind = function () {\n this._log('unbind');\n };\n ViewSpy = __decorate([\n customAttribute('view-spy')\n ], ViewSpy);\n return ViewSpy;\n}());\nexport { ViewSpy };\n"],"sourceRoot":""}