text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).rexawaitloaderplugin=e()}(this,function(){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function t(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(r){return function(){var t,e=i(r);if(function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(t){return}}}()){var n=i(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return c(this,t)}}function a(t,e){var n;return(n=t)&&"function"==typeof n?e={config:{callback:t,scope:e}}:l(t)?(e=t).hasOwnProperty("config")||(e={config:e}):e={key:t,config:e},this.addFile(new s(this,e)),this}var f=Phaser.Loader.FILE_POPULATED,s=function(){e(r,Phaser.Loader.File);var n=u(r);function r(t,e){return o(this,r),e.hasOwnProperty("type")||(e.type="await"),e.hasOwnProperty("url")||(e.url=""),e.hasOwnProperty("key")||(e.key=(new Date).getTime().toString()),n.call(this,t,e)}return t(r,[{key:"load",value:function(){if(this.state===f)this.loader.nextFile(this,!0);else{var t=this.config,e=t.callback,n=t.scope,r=this.onLoad.bind(this),o=this.onError.bind(this);e?n?e.call(n,r,o):e(r,o):this.onLoad()}}},{key:"onLoad",value:function(){this.loader.nextFile(this,!0)}},{key:"onError",value:function(){this.loader.nextFile(this,!1)}}]),r}(),l=Phaser.Utils.Objects.IsPlainObject;return function(){e(r,Phaser.Plugins.BasePlugin);var n=u(r);function r(t){var e;return o(this,r),e=n.call(this,t),t.registerFileType("rexAwait",a),e}return t(r,[{key:"addToScene",value:function(t){t.sys.load.rexAwait=a}}]),r}()});
  