System.register(["__unresolved_0", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9", "__unresolved_10", "__unresolved_11", "__unresolved_12"], function (_export, _context) {
  "use strict";

  var _req, _req2, _req3, _req4, _req5, _req6, _req7, _req8, _req9, _req10, _req11, _req12, _loader, _cjsExports, __cjsMetaURL;

  _export("default", void 0);

  return {
    setters: [function (_unresolved_) {
      _req = _unresolved_.__cjsMetaURL;
    }, function (_unresolved_2) {
      _req2 = _unresolved_2.__cjsMetaURL;
    }, function (_unresolved_3) {
      _req3 = _unresolved_3.__cjsMetaURL;
    }, function (_unresolved_4) {
      _req4 = _unresolved_4.__cjsMetaURL;
    }, function (_unresolved_5) {
      _req5 = _unresolved_5.__cjsMetaURL;
    }, function (_unresolved_6) {
      _req6 = _unresolved_6.__cjsMetaURL;
    }, function (_unresolved_7) {
      _req7 = _unresolved_7.__cjsMetaURL;
    }, function (_unresolved_8) {
      _req8 = _unresolved_8.__cjsMetaURL;
    }, function (_unresolved_9) {
      _req9 = _unresolved_9.__cjsMetaURL;
    }, function (_unresolved_10) {
      _req10 = _unresolved_10.__cjsMetaURL;
    }, function (_unresolved_11) {
      _req11 = _unresolved_11.__cjsMetaURL;
    }, function (_unresolved_12) {
      _req12 = _unresolved_12.__cjsMetaURL;
    }, function (_unresolved_13) {
      _loader = _unresolved_13.default;
    }],
    execute: function () {
      _loader.define(_context.meta.url, function (exports, _require, module, __filename, __dirname) {
        let require = _loader.createRequireWithReqMap({
          "../internals/global": _req,
          "../internals/function-apply": _req2,
          "../internals/function-bind-context": _req3,
          "../internals/is-callable": _req4,
          "../internals/has-own-property": _req5,
          "../internals/fails": _req6,
          "../internals/html": _req7,
          "../internals/array-slice": _req8,
          "../internals/document-create-element": _req9,
          "../internals/validate-arguments-length": _req10,
          "../internals/engine-is-ios": _req11,
          "../internals/engine-is-node": _req12
        }, _require);

        (function () {
          var global = require('../internals/global');

          var apply = require('../internals/function-apply');

          var bind = require('../internals/function-bind-context');

          var isCallable = require('../internals/is-callable');

          var hasOwn = require('../internals/has-own-property');

          var fails = require('../internals/fails');

          var html = require('../internals/html');

          var arraySlice = require('../internals/array-slice');

          var createElement = require('../internals/document-create-element');

          var validateArgumentsLength = require('../internals/validate-arguments-length');

          var IS_IOS = require('../internals/engine-is-ios');

          var IS_NODE = require('../internals/engine-is-node');

          var set = global.setImmediate;
          var clear = global.clearImmediate;
          var process = global.process;
          var Dispatch = global.Dispatch;
          var Function = global.Function;
          var MessageChannel = global.MessageChannel;
          var String = global.String;
          var counter = 0;
          var queue = {};
          var ONREADYSTATECHANGE = 'onreadystatechange';
          var location, defer, channel, port;

          try {
            // Deno throws a ReferenceError on `location` access without `--location` flag
            location = global.location;
          } catch (error) {
            /* empty */
          }

          var run = function (id) {
            if (hasOwn(queue, id)) {
              var fn = queue[id];
              delete queue[id];
              fn();
            }
          };

          var runner = function (id) {
            return function () {
              run(id);
            };
          };

          var listener = function (event) {
            run(event.data);
          };

          var post = function (id) {
            // old engines have not location.origin
            global.postMessage(String(id), location.protocol + '//' + location.host);
          }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise:


          if (!set || !clear) {
            set = function setImmediate(handler) {
              validateArgumentsLength(arguments.length, 1);
              var fn = isCallable(handler) ? handler : Function(handler);
              var args = arraySlice(arguments, 1);

              queue[++counter] = function () {
                apply(fn, undefined, args);
              };

              defer(counter);
              return counter;
            };

            clear = function clearImmediate(id) {
              delete queue[id];
            }; // Node.js 0.8-


            if (IS_NODE) {
              defer = function (id) {
                process.nextTick(runner(id));
              }; // Sphere (JS game engine) Dispatch API

            } else if (Dispatch && Dispatch.now) {
              defer = function (id) {
                Dispatch.now(runner(id));
              }; // Browsers with MessageChannel, includes WebWorkers
              // except iOS - https://github.com/zloirock/core-js/issues/624

            } else if (MessageChannel && !IS_IOS) {
              channel = new MessageChannel();
              port = channel.port2;
              channel.port1.onmessage = listener;
              defer = bind(port.postMessage, port); // Browsers with postMessage, skip WebWorkers
              // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
            } else if (global.addEventListener && isCallable(global.postMessage) && !global.importScripts && location && location.protocol !== 'file:' && !fails(post)) {
              defer = post;
              global.addEventListener('message', listener, false); // IE8-
            } else if (ONREADYSTATECHANGE in createElement('script')) {
              defer = function (id) {
                html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
                  html.removeChild(this);
                  run(id);
                };
              }; // Rest old browsers

            } else {
              defer = function (id) {
                setTimeout(runner(id), 0);
              };
            }
          }

          module.exports = {
            set: set,
            clear: clear
          };
        })();

        _export("default", _cjsExports = module.exports);
      });

      _export("__cjsMetaURL", __cjsMetaURL = _context.meta.url);
    }
  };
});
//# sourceMappingURL=task.js.map