From d212d457b81710b57335a4a69e94c86e10d769a4 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum <nex342@gmail.com> Date: Tue, 4 Oct 2016 17:24:45 -0700 Subject: [PATCH] Use modern JS interop in the host page. (#481) --- lib/src/runner/browser/static/host.dart | 15 +- lib/src/runner/browser/static/host.dart.js | 16946 +++++++++---------- pubspec.yaml | 1 + 3 files changed, 8407 insertions(+), 8555 deletions(-) diff --git a/lib/src/runner/browser/static/host.dart b/lib/src/runner/browser/static/host.dart index 10cae7af..74015a26 100644 --- a/lib/src/runner/browser/static/host.dart +++ b/lib/src/runner/browser/static/host.dart @@ -5,10 +5,20 @@ import 'dart:async'; import 'dart:convert'; import 'dart:html'; -import 'dart:js' as js; import 'package:stack_trace/stack_trace.dart'; import 'package:stream_channel/stream_channel.dart'; +import 'package:js/js.dart'; + +/// A class defined in content shell, used to control its behavior. +@JS() +class _TestRunner { + external void waitUntilDone(); +} + +/// Returns the current content shell runner, or `null` if none exists. +@JS() +external _TestRunner get testRunner; /// The iframes created for each loaded test suite, indexed by the suite id. final _iframes = new Map<int, IFrameElement>(); @@ -67,8 +77,7 @@ final _iframes = new Map<int, IFrameElement>(); void main() { // This tells content_shell not to close immediately after the page has // rendered. - var testRunner = js.context['testRunner']; - if (testRunner != null) testRunner.callMethod('waitUntilDone', []); + testRunner?.waitUntilDone(); runZoned(() { var serverChannel = _connectToServer(); diff --git a/lib/src/runner/browser/static/host.dart.js b/lib/src/runner/browser/static/host.dart.js index 44b14011..274769fa 100644 --- a/lib/src/runner/browser/static/host.dart.js +++ b/lib/src/runner/browser/static/host.dart.js @@ -1,4 +1,4 @@ -// Generated by dart2js, the Dart to JavaScript compiler version: 1.18.1. +// Generated by dart2js, the Dart to JavaScript compiler version: 1.19.1. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] @@ -461,30 +461,28 @@ f.$stubName = getterStubName; f.$callName = null; } - var isReflectable = array.length > unmangledNameIndex; - if (isReflectable) { - funcs[0].$reflectable = 1; - funcs[0].$reflectionInfo = array; - for (var i = 1; i < funcs.length; i++) { - funcs[i].$reflectable = 2; - funcs[i].$reflectionInfo = array; - } - var mangledNames = isStatic ? init.mangledGlobalNames : init.mangledNames; - var unmangledName = array[unmangledNameIndex]; - var reflectionName = unmangledName; - if (getterStubName) - mangledNames[getterStubName] = reflectionName; - if (isSetter) - reflectionName += "="; - else if (!isGetter) - reflectionName += ":" + (requiredParameterCount + optionalParameterCount); - mangledNames[name] = reflectionName; - funcs[0].$reflectionName = reflectionName; - funcs[0].$metadataIndex = unmangledNameIndex + 1; - if (optionalParameterCount) - prototype[unmangledName + "*"] = funcs[0]; - } } + Function.prototype.call$0 = function() { + return this(); + }; + Function.prototype.call$1 = function(a) { + return this(a); + }; + Function.prototype.call$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$5 = function(a, b, c, d, e) { + return this(a, b, c, d, e); + }; + Function.prototype.call$6 = function(a, b, c, d, e, f) { + return this(a, b, c, d, e, f); + }; function tearOffGetter(funcs, reflectionInfo, name, isIntercepted) { return isIntercepted ? new Function("funcs", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "(x) {" + "if (c === null) c = " + "H.closureFromTearOff" + "(" + "this, funcs, reflectionInfo, false, [x], name);" + "return new c(this, funcs[0], x, name);" + "}")(funcs, reflectionInfo, name, H, null) : new Function("funcs", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "() {" + "if (c === null) c = " + "H.closureFromTearOff" + "(" + "this, funcs, reflectionInfo, false, [], name);" + "return new c(this, funcs[0], null, name);" + "}")(funcs, reflectionInfo, name, H, null); } @@ -595,9 +593,6 @@ toString$0: ["super$Interceptor$toString", function(receiver) { return H.Primitives_objectToHumanReadableString(receiver); }], - noSuchMethod$1: ["super$Interceptor$noSuchMethod", function(receiver, invocation) { - throw H.wrapException(P.NoSuchMethodError$(receiver, invocation.get$memberName(), invocation.get$positionalArguments(), invocation.get$namedArguments(), null)); - }], "%": "MediaError|MediaKeyError|PushMessageData|SVGAnimatedLength|SVGAnimatedLengthList|SVGAnimatedNumber|SVGAnimatedNumberList|SVGAnimatedString|SVGAnimatedTransformList" }, JSBool: { @@ -620,9 +615,6 @@ }, get$hashCode: function(receiver) { return 0; - }, - noSuchMethod$1: function(receiver, invocation) { - return this.super$Interceptor$noSuchMethod(receiver, invocation); } }, JavaScriptObject: { @@ -633,6 +625,9 @@ toString$0: ["super$JavaScriptObject$toString", function(receiver) { return String(receiver); }], + waitUntilDone$0: function(receiver) { + return receiver.waitUntilDone(); + }, $isJSObject: 1 }, PlainJavaScriptObject: { @@ -647,7 +642,6 @@ var dartClosure = receiver[$.$get$DART_CLOSURE_PROPERTY_NAME()]; return dartClosure == null ? this.super$JavaScriptObject$toString(receiver) : J.toString$0$(dartClosure); }, - $isFunction: 1, $signature: function() { return {func: 1, opt: [,,,,,,,,,,,,,,,,]}; } @@ -695,10 +689,10 @@ return receiver.pop(); }, addAll$1: function(receiver, collection) { - var t1; + var _i; this.checkGrowable$1(receiver, "addAll"); - for (t1 = J.get$iterator$ax(collection); t1.moveNext$0();) - receiver.push(t1.get$current()); + for (_i = 0; _i < 2; ++_i) + receiver.push(collection[_i]); }, clear$0: function(receiver) { this.set$length(receiver, 0); @@ -784,45 +778,65 @@ throw H.wrapException(H.IterableElementError_tooMany()); }, setRange$4: function(receiver, start, end, iterable, skipCount) { - var $length, i, t1; + var $length, t1, t2, i, t3, t4, element; this.checkMutable$1(receiver, "set range"); P.RangeError_checkValidRange(start, end, receiver.length, null, null, null); - $length = end - start; - if ($length === 0) + $length = J.$sub$n(end, start); + t1 = J.getInterceptor($length); + if (t1.$eq($length, 0)) return; - if (skipCount < 0) + t2 = J.getInterceptor$n(skipCount); + if (t2.$lt(skipCount, 0)) H.throwExpression(P.RangeError$range(skipCount, 0, null, "skipCount", null)); - if (skipCount + $length > iterable.length) + if (J.$gt$n(t2.$add(skipCount, $length), iterable.length)) throw H.wrapException(H.IterableElementError_tooFew()); - if (skipCount < start) - for (i = $length - 1; i >= 0; --i) { - t1 = skipCount + i; - if (t1 < 0 || t1 >= iterable.length) - return H.ioore(iterable, t1); - receiver[start + i] = iterable[t1]; + if (t2.$lt(skipCount, start)) + for (i = t1.$sub($length, 1), t1 = J.getInterceptor$ns(start); t3 = J.getInterceptor$n(i), t3.$ge(i, 0); i = t3.$sub(i, 1)) { + t4 = t2.$add(skipCount, i); + if (t4 >>> 0 !== t4 || t4 >= iterable.length) + return H.ioore(iterable, t4); + element = iterable[t4]; + receiver[t1.$add(start, i)] = element; } - else - for (i = 0; i < $length; ++i) { - t1 = skipCount + i; - if (t1 < 0 || t1 >= iterable.length) - return H.ioore(iterable, t1); - receiver[start + i] = iterable[t1]; + else { + if (typeof $length !== "number") + return H.iae($length); + t1 = J.getInterceptor$ns(start); + i = 0; + for (; i < $length; ++i) { + t3 = t2.$add(skipCount, i); + if (t3 >>> 0 !== t3 || t3 >= iterable.length) + return H.ioore(iterable, t3); + element = iterable[t3]; + receiver[t1.$add(start, i)] = element; } + } }, setRange$3: function($receiver, start, end, iterable) { return this.setRange$4($receiver, start, end, iterable, 0); }, + fillRange$3: function(receiver, start, end, fillValue) { + var i; + this.checkMutable$1(receiver, "fill range"); + P.RangeError_checkValidRange(start, end, receiver.length, null, null, null); + for (i = start; i < end; ++i) + receiver[i] = fillValue; + }, replaceRange$3: function(receiver, start, end, replacement) { - var removeLength, insertLength, t1, insertEnd, delta, newLength; + var removeLength, insertLength, t1, t2, delta, insertEnd, newLength; this.checkGrowable$1(receiver, "replace range"); P.RangeError_checkValidRange(start, end, receiver.length, null, null, null); replacement = C.JSString_methods.toList$0(replacement); - removeLength = end - start; + removeLength = J.$sub$n(end, start); insertLength = replacement.length; - t1 = receiver.length; - insertEnd = start + insertLength; - if (removeLength >= insertLength) { - delta = removeLength - insertLength; + t1 = J.getInterceptor$n(removeLength); + t2 = J.getInterceptor$ns(start); + if (t1.$ge(removeLength, insertLength)) { + delta = t1.$sub(removeLength, insertLength); + insertEnd = t2.$add(start, insertLength); + t1 = receiver.length; + if (typeof delta !== "number") + return H.iae(delta); newLength = t1 - delta; this.setRange$3(receiver, start, insertEnd, replacement); if (delta !== 0) { @@ -830,7 +844,10 @@ this.set$length(receiver, newLength); } } else { - newLength = t1 + (insertLength - removeLength); + if (typeof removeLength !== "number") + return H.iae(removeLength); + newLength = receiver.length + (insertLength - removeLength); + insertEnd = t2.$add(start, insertLength); this.set$length(receiver, newLength); this.setRange$4(receiver, insertEnd, newLength, receiver, end); this.setRange$3(receiver, start, insertEnd, replacement); @@ -843,7 +860,7 @@ if (start < 0) start = 0; for (i = start; t1 = receiver.length, i < t1; ++i) { - if (i >>> 0 !== i || i >= t1) + if (i < 0) return H.ioore(receiver, i); if (J.$eq$(receiver[i], element)) return i; @@ -917,11 +934,6 @@ t1 = H.setRuntimeTypeInfo(new Array($length), [$E]); t1.fixed$length = Array; return t1; - }, - JSArray_markUnmodifiableList: function(list) { - list.fixed$length = Array; - list.immutable$list = Array; - return list; } } }, @@ -929,7 +941,7 @@ "^": "JSArray;" }, ArrayIterator: { - "^": "Object;__interceptors$_iterable,__interceptors$_length,_index,__interceptors$_current", + "^": "Object;__interceptors$_iterable,__interceptors$_length,__interceptors$_index,__interceptors$_current", get$current: function() { return this.__interceptors$_current; }, @@ -939,33 +951,28 @@ $length = t1.length; if (this.__interceptors$_length !== $length) throw H.wrapException(H.throwConcurrentModificationError(t1)); - t2 = this._index; + t2 = this.__interceptors$_index; if (t2 >= $length) { this.__interceptors$_current = null; return false; } this.__interceptors$_current = t1[t2]; - this._index = t2 + 1; + this.__interceptors$_index = t2 + 1; return true; } }, JSNumber: { "^": "Interceptor;", - get$isNegative: function(receiver) { - return receiver === 0 ? 1 / receiver < 0 : receiver < 0; - }, remainder$1: function(receiver, b) { return receiver % b; }, - toInt$0: function(receiver) { - var t1; - if (receiver >= -2147483648 && receiver <= 2147483647) - return receiver | 0; - if (isFinite(receiver)) { - t1 = receiver < 0 ? Math.ceil(receiver) : Math.floor(receiver); - return t1 + 0; - } - throw H.wrapException(new P.UnsupportedError("" + receiver)); + round$0: function(receiver) { + if (receiver > 0) { + if (receiver !== 1 / 0) + return Math.round(receiver); + } else if (receiver > -1 / 0) + return 0 - Math.round(0 - receiver); + throw H.wrapException(new P.UnsupportedError("" + receiver + ".round()")); }, toRadixString$1: function(receiver, radix) { var result, match, t1, exponent; @@ -1010,39 +1017,25 @@ return receiver - other; }, $mul: function(receiver, other) { - if (typeof other !== "number") - throw H.wrapException(H.argumentErrorValue(other)); return receiver * other; }, - $tdiv: function(receiver, other) { - if ((receiver | 0) === receiver && (other | 0) === other && 0 !== other && -1 !== other) - return receiver / other | 0; - else - return this.toInt$0(receiver / other); - }, _tdivFast$1: function(receiver, other) { - return (receiver | 0) === receiver ? receiver / other | 0 : this.toInt$0(receiver / other); - }, - $shl: function(receiver, other) { - if (other < 0) - throw H.wrapException(H.argumentErrorValue(other)); - return other > 31 ? 0 : receiver << other >>> 0; + return (receiver | 0) === receiver ? receiver / other | 0 : this._tdivSlow$1(receiver, other); + }, + _tdivSlow$1: function(receiver, other) { + var quotient = receiver / other; + if (quotient >= -2147483648 && quotient <= 2147483647) + return quotient | 0; + if (quotient > 0) { + if (quotient !== 1 / 0) + return Math.floor(quotient); + } else if (quotient > -1 / 0) + return Math.ceil(quotient); + throw H.wrapException(new P.UnsupportedError("Result of truncating division is " + H.S(quotient) + ": " + H.S(receiver) + " ~/ " + other)); }, _shlPositive$1: function(receiver, other) { return other > 31 ? 0 : receiver << other >>> 0; }, - $shr: function(receiver, other) { - var t1; - if (other < 0) - throw H.wrapException(H.argumentErrorValue(other)); - if (receiver > 0) - t1 = other > 31 ? 0 : receiver >>> other; - else { - t1 = other > 31 ? 31 : other; - t1 = receiver >> t1 >>> 0; - } - return t1; - }, _shrOtherPositive$1: function(receiver, other) { var t1; if (receiver > 0) @@ -1058,14 +1051,6 @@ throw H.wrapException(H.argumentErrorValue(other)); return other > 31 ? 0 : receiver >>> other; }, - $and: function(receiver, other) { - return (receiver & other) >>> 0; - }, - $xor: function(receiver, other) { - if (typeof other !== "number") - throw H.wrapException(H.argumentErrorValue(other)); - return (receiver ^ other) >>> 0; - }, $lt: function(receiver, other) { if (typeof other !== "number") throw H.wrapException(H.argumentErrorValue(other)); @@ -1126,14 +1111,15 @@ return this.allMatches$2($receiver, string, 0); }, matchAsPrefix$2: function(receiver, string, start) { - var t1, i; - if (start < 0 || start > string.length) + var t1, t2, i; + t1 = J.getInterceptor$n(start); + if (t1.$lt(start, 0) || t1.$gt(start, string.length)) throw H.wrapException(P.RangeError$range(start, 0, string.length, null, null)); - t1 = receiver.length; - if (start + t1 > string.length) + t2 = receiver.length; + if (J.$gt$n(t1.$add(start, t2), string.length)) return; - for (i = 0; i < t1; ++i) - if (this.codeUnitAt$1(string, start + i) !== this.codeUnitAt$1(receiver, i)) + for (i = 0; i < t2; ++i) + if (this.codeUnitAt$1(string, t1.$add(start, i)) !== this.codeUnitAt$1(receiver, i)) return; return new H.StringMatch(start, string, receiver); }, @@ -1175,13 +1161,14 @@ return H.stringReplaceRangeUnchecked(receiver, start, end, replacement); }, startsWith$2: function(receiver, pattern, index) { - var endIndex; + var t1, endIndex; H.checkInt(index); - if (index < 0 || index > receiver.length) + t1 = J.getInterceptor$n(index); + if (t1.$lt(index, 0) || t1.$gt(index, receiver.length)) throw H.wrapException(P.RangeError$range(index, 0, receiver.length, null, null)); if (typeof pattern === "string") { - endIndex = index + pattern.length; - if (endIndex > receiver.length) + endIndex = t1.$add(index, pattern.length); + if (J.$gt$n(endIndex, receiver.length)) return false; return pattern === receiver.substring(index, endIndex); } @@ -1251,9 +1238,10 @@ } return result; }, + get$codeUnits: function(receiver) { + return new H.CodeUnits(receiver); + }, indexOf$2: function(receiver, pattern, start) { - if (typeof start !== "number" || Math.floor(start) !== start) - throw H.wrapException(H.argumentErrorValue(start)); if (start < 0 || start > receiver.length) throw H.wrapException(P.RangeError$range(start, 0, receiver.length, null, null)); return receiver.indexOf(pattern, start); @@ -1384,3878 +1372,3589 @@ } } } - }], ["_isolate_helper", "dart:_isolate_helper",, H, { + }], ["dart._internal", "dart:_internal",, H, { "^": "", - _callInIsolate: function(isolate, $function) { - var result = isolate.eval$1($function); - if (!init.globalState.currentContext._isExecutingEvent) - init.globalState.topEventLoop.run$0(); - return result; - }, - startRootIsolate: function(entry, args) { - var t1, t2, t3, t4, t5, rootContext; - t1 = {}; - t1.args = args; - if (args == null) { - args = []; - t1.args = args; - t2 = args; - } else - t2 = args; - if (!J.getInterceptor(t2).$isList) - throw H.wrapException(P.ArgumentError$("Arguments to main must be a List: " + H.S(t2))); - init.globalState = new H._Manager(0, 0, 1, null, null, null, null, null, null, null, null, null, entry); - t2 = init.globalState; - t3 = self.window == null; - t4 = self.Worker; - t5 = t3 && !!self.postMessage; - t2.isWorker = t5; - t5 = !t5; - if (t5) - t4 = t4 != null && $.$get$IsolateNatives_thisScript() != null; - else - t4 = true; - t2.supportsWorkers = t4; - t2.fromCommandLine = t3 && t5; - t2.topEventLoop = new H._EventLoop(P.ListQueue$(null, H._IsolateEvent), 0); - t2.isolates = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, H._IsolateContext]); - t2.managers = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, null]); - if (t2.isWorker === true) { - t3 = new H._MainManagerStub(); - t2.mainManager = t3; - self.onmessage = function(f, a) { - return function(e) { - f(a, e); - }; - }(H.IsolateNatives__processWorkerMessage, t3); - self.dartPrint = self.dartPrint || function(serialize) { - return function(object) { - if (self.console && self.console.log) - self.console.log(object); - else - self.postMessage(serialize(object)); - }; - }(H._Manager__serializePrintMessage); - } - if (init.globalState.isWorker === true) - return; - t2 = init.globalState.nextIsolateId++; - t3 = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, H.RawReceivePortImpl]); - t4 = P.LinkedHashSet_LinkedHashSet(null, null, null, P.$int); - t5 = new H.RawReceivePortImpl(0, null, false); - rootContext = new H._IsolateContext(t2, t3, t4, init.createNewIsolate(), t5, new H.CapabilityImpl(H.random64()), new H.CapabilityImpl(H.random64()), false, false, [], P.LinkedHashSet_LinkedHashSet(null, null, null, null), null, null, false, true, P.LinkedHashSet_LinkedHashSet(null, null, null, null)); - t4.add$1(0, 0); - rootContext._addRegistration$2(0, t5); - init.globalState.rootContext = rootContext; - init.globalState.currentContext = rootContext; - t2 = H.getDynamicRuntimeType(); - t3 = H.buildFunctionType(t2, [t2])._isTest$1(entry); - if (t3) - rootContext.eval$1(new H.startRootIsolate_closure(t1, entry)); - else { - t2 = H.buildFunctionType(t2, [t2, t2])._isTest$1(entry); - if (t2) - rootContext.eval$1(new H.startRootIsolate_closure0(t1, entry)); - else - rootContext.eval$1(entry); - } - init.globalState.topEventLoop.run$0(); + IterableElementError_noElement: function() { + return new P.StateError("No element"); }, - IsolateNatives_computeThisScript: function() { - var currentScript = init.currentScript; - if (currentScript != null) - return String(currentScript.src); - if (init.globalState.isWorker === true) - return H.IsolateNatives_computeThisScriptFromTrace(); - return; + IterableElementError_tooMany: function() { + return new P.StateError("Too many elements"); }, - IsolateNatives_computeThisScriptFromTrace: function() { - var stack, matches; - stack = new Error().stack; - if (stack == null) { - stack = function() { - try { - throw new Error(); - } catch (e) { - return e.stack; - } - }(); - if (stack == null) - throw H.wrapException(new P.UnsupportedError("No stack trace")); - } - matches = stack.match(new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")); - if (matches != null) - return matches[1]; - matches = stack.match(new RegExp("^[^@]*@(.*):[0-9]*$", "m")); - if (matches != null) - return matches[1]; - throw H.wrapException(new P.UnsupportedError('Cannot extract URI from "' + H.S(stack) + '"')); + IterableElementError_tooFew: function() { + return new P.StateError("Too few elements"); }, - IsolateNatives__processWorkerMessage: [function(sender, e) { - var msg, t1, functionName, entryPoint, args, message, isSpawnUri, startPaused, replyTo, t2, t3, t4, context; - msg = new H._Deserializer(true, []).deserialize$1(e.data); - t1 = J.getInterceptor$asx(msg); - switch (t1.$index(msg, "command")) { - case "start": - init.globalState.currentManagerId = t1.$index(msg, "id"); - functionName = t1.$index(msg, "functionName"); - entryPoint = functionName == null ? init.globalState.entry : init.globalFunctions[functionName](); - args = t1.$index(msg, "args"); - message = new H._Deserializer(true, []).deserialize$1(t1.$index(msg, "msg")); - isSpawnUri = t1.$index(msg, "isSpawnUri"); - startPaused = t1.$index(msg, "startPaused"); - replyTo = new H._Deserializer(true, []).deserialize$1(t1.$index(msg, "replyTo")); - t1 = init.globalState.nextIsolateId++; - t2 = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, H.RawReceivePortImpl]); - t3 = P.LinkedHashSet_LinkedHashSet(null, null, null, P.$int); - t4 = new H.RawReceivePortImpl(0, null, false); - context = new H._IsolateContext(t1, t2, t3, init.createNewIsolate(), t4, new H.CapabilityImpl(H.random64()), new H.CapabilityImpl(H.random64()), false, false, [], P.LinkedHashSet_LinkedHashSet(null, null, null, null), null, null, false, true, P.LinkedHashSet_LinkedHashSet(null, null, null, null)); - t3.add$1(0, 0); - context._addRegistration$2(0, t4); - init.globalState.topEventLoop.events._add$1(new H._IsolateEvent(context, new H.IsolateNatives__processWorkerMessage_closure(entryPoint, args, message, isSpawnUri, startPaused, replyTo), "worker-start")); - init.globalState.currentContext = context; - init.globalState.topEventLoop.run$0(); - break; - case "spawn-worker": - break; - case "message": - if (t1.$index(msg, "port") != null) - J.send$1$x(t1.$index(msg, "port"), t1.$index(msg, "msg")); - init.globalState.topEventLoop.run$0(); - break; - case "close": - init.globalState.managers.remove$1(0, $.$get$IsolateNatives_workerIds().$index(0, sender)); - sender.terminate(); - init.globalState.topEventLoop.run$0(); - break; - case "log": - H.IsolateNatives__log(t1.$index(msg, "msg")); - break; - case "print": - if (init.globalState.isWorker === true) { - t1 = init.globalState.mainManager; - t2 = P.LinkedHashMap__makeLiteral(["command", "print", "msg", msg]); - t2 = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t2); - t1.toString; - self.postMessage(t2); - } else - P.print(t1.$index(msg, "msg")); - break; - case "error": - throw H.wrapException(t1.$index(msg, "msg")); + CodeUnits: { + "^": "UnmodifiableListBase;__internal$_string", + get$length: function(_) { + return this.__internal$_string.length; + }, + $index: function(_, i) { + return C.JSString_methods.codeUnitAt$1(this.__internal$_string, i); + }, + $asUnmodifiableListBase: function() { + return [P.$int]; + }, + $asListBase: function() { + return [P.$int]; + }, + $asList: function() { + return [P.$int]; } - }, null, null, 4, 0, null, 35, 33], - IsolateNatives__log: function(msg) { - var trace, t1, t2, exception; - if (init.globalState.isWorker === true) { - t1 = init.globalState.mainManager; - t2 = P.LinkedHashMap__makeLiteral(["command", "log", "msg", msg]); - t2 = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t2); - t1.toString; - self.postMessage(t2); - } else - try { - self.console.log(msg); - } catch (exception) { - H.unwrapException(exception); - trace = H.getTraceFromException(exception); - throw H.wrapException(P.Exception_Exception(trace)); - } }, - IsolateNatives__startIsolate: function(topLevel, args, message, isSpawnUri, startPaused, replyTo) { - var context, t1, t2, t3; - context = init.globalState.currentContext; - t1 = context.id; - $.Primitives_mirrorFunctionCacheName = $.Primitives_mirrorFunctionCacheName + ("_" + t1); - $.Primitives_mirrorInvokeCacheName = $.Primitives_mirrorInvokeCacheName + ("_" + t1); - t1 = context.controlPort; - t2 = init.globalState.currentContext.id; - t3 = context.pauseCapability; - J.send$1$x(replyTo, ["spawned", new H._NativeJsSendPort(t1, t2), t3, context.terminateCapability]); - t2 = new H.IsolateNatives__startIsolate_runStartFunction(topLevel, args, message, isSpawnUri, context); - if (startPaused === true) { - context.addPause$2(t3, t3); - init.globalState.topEventLoop.events._add$1(new H._IsolateEvent(context, t2, "start isolate")); - } else - t2.call$0(); - }, - _clone: function(message) { - return new H._Deserializer(true, []).deserialize$1(new H._Serializer(false, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(message)); - }, - startRootIsolate_closure: { - "^": "Closure:1;_box_0,entry", - call$0: function() { - this.entry.call$1(this._box_0.args); - } - }, - startRootIsolate_closure0: { - "^": "Closure:1;_box_0,entry", - call$0: function() { - this.entry.call$2(this._box_0.args, null); - } - }, - _Manager: { - "^": "Object;nextIsolateId,currentManagerId,nextManagerId,currentContext,rootContext,topEventLoop,fromCommandLine,isWorker,supportsWorkers,isolates,mainManager,managers,entry", - static: { - _Manager__serializePrintMessage: [function(object) { - var t1 = P.LinkedHashMap__makeLiteral(["command", "print", "msg", object]); - return new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t1); - }, null, null, 2, 0, null, 25] - } - }, - _IsolateContext: { - "^": "Object;id,ports,weakPorts,isolateStatics<,controlPort<,pauseCapability,terminateCapability,initialized?,isPaused<,delayedEvents<,pauseTokens,doneHandlers,_scheduledControlEvents,_isExecutingEvent,errorsAreFatal,errorPorts", - addPause$2: function(authentification, resume) { - if (!this.pauseCapability.$eq(0, authentification)) - return; - if (this.pauseTokens.add$1(0, resume) && !this.isPaused) - this.isPaused = true; - this._updateGlobalState$0(); + ListIterable: { + "^": "Iterable;", + get$iterator: function(_) { + return new H.ListIterator(this, this.get$length(this), 0, null); }, - removePause$1: function(resume) { - var t1, t2, $event, t3, t4, t5; - if (!this.isPaused) - return; - t1 = this.pauseTokens; - t1.remove$1(0, resume); - if (t1._collection$_length === 0) { - for (t1 = this.delayedEvents; t2 = t1.length, t2 !== 0;) { - if (0 >= t2) - return H.ioore(t1, -1); - $event = t1.pop(); - t2 = init.globalState.topEventLoop.events; - t3 = t2._head; - t4 = t2._table; - t5 = t4.length; - t3 = (t3 - 1 & t5 - 1) >>> 0; - t2._head = t3; - if (t3 < 0 || t3 >= t5) - return H.ioore(t4, t3); - t4[t3] = $event; - if (t3 === t2._tail) - t2._grow$0(); - ++t2._modificationCount; - } - this.isPaused = false; + forEach$1: function(_, action) { + var $length, i; + $length = this.get$length(this); + if (typeof $length !== "number") + return H.iae($length); + i = 0; + for (; i < $length; ++i) { + action.call$1(this.elementAt$1(0, i)); + if ($length !== this.get$length(this)) + throw H.wrapException(new P.ConcurrentModificationError(this)); } - this._updateGlobalState$0(); - }, - addDoneListener$2: function(responsePort, response) { - var t1, i, t2; - if (this.doneHandlers == null) - this.doneHandlers = []; - for (t1 = J.getInterceptor(responsePort), i = 0; t2 = this.doneHandlers, i < t2.length; i += 2) - if (t1.$eq(responsePort, t2[i])) { - t1 = this.doneHandlers; - t2 = i + 1; - if (t2 >= t1.length) - return H.ioore(t1, t2); - t1[t2] = response; - return; - } - t2.push(responsePort); - this.doneHandlers.push(response); - }, - removeDoneListener$1: function(responsePort) { - var t1, i, t2; - if (this.doneHandlers == null) - return; - for (t1 = J.getInterceptor(responsePort), i = 0; t2 = this.doneHandlers, i < t2.length; i += 2) - if (t1.$eq(responsePort, t2[i])) { - t1 = this.doneHandlers; - t2 = i + 2; - t1.toString; - if (typeof t1 !== "object" || t1 === null || !!t1.fixed$length) - H.throwExpression(new P.UnsupportedError("removeRange")); - P.RangeError_checkValidRange(i, t2, t1.length, null, null, null); - t1.splice(i, t2 - i); - return; - } }, - setErrorsFatal$2: function(authentification, errorsAreFatal) { - if (!this.terminateCapability.$eq(0, authentification)) - return; - this.errorsAreFatal = errorsAreFatal; + get$isEmpty: function(_) { + return J.$eq$(this.get$length(this), 0); }, - handlePing$3: function(responsePort, pingType, response) { - var t1 = J.getInterceptor(pingType); - if (!t1.$eq(pingType, 0)) - t1 = t1.$eq(pingType, 1) && !this._isExecutingEvent; - else - t1 = true; - if (t1) { - J.send$1$x(responsePort, response); - return; - } - t1 = this._scheduledControlEvents; - if (t1 == null) { - t1 = P.ListQueue$(null, null); - this._scheduledControlEvents = t1; - } - t1._add$1(new H._IsolateContext_handlePing_respond(responsePort, response)); + get$last: function(_) { + if (J.$eq$(this.get$length(this), 0)) + throw H.wrapException(H.IterableElementError_noElement()); + return this.elementAt$1(0, J.$sub$n(this.get$length(this), 1)); }, - handleKill$2: function(authentification, priority) { - var t1; - if (!this.terminateCapability.$eq(0, authentification)) - return; - t1 = J.getInterceptor(priority); - if (!t1.$eq(priority, 0)) - t1 = t1.$eq(priority, 1) && !this._isExecutingEvent; - else - t1 = true; - if (t1) { - this.kill$0(); - return; - } - t1 = this._scheduledControlEvents; - if (t1 == null) { - t1 = P.ListQueue$(null, null); - this._scheduledControlEvents = t1; + contains$1: function(_, element) { + var $length, i; + $length = this.get$length(this); + if (typeof $length !== "number") + return H.iae($length); + i = 0; + for (; i < $length; ++i) { + if (J.$eq$(this.elementAt$1(0, i), element)) + return true; + if ($length !== this.get$length(this)) + throw H.wrapException(new P.ConcurrentModificationError(this)); } - t1._add$1(this.get$kill()); + return false; }, - handleUncaughtError$2: [function(error, stackTrace) { - var t1, message, t2; - t1 = this.errorPorts; - if (t1._collection$_length === 0) { - if (this.errorsAreFatal === true && this === init.globalState.rootContext) - return; - if (self.console && self.console.error) - self.console.error(error, stackTrace); - else { - P.print(error); - if (stackTrace != null) - P.print(stackTrace); + join$1: function(_, separator) { + var $length, t1, first, buffer, i; + $length = this.get$length(this); + if (separator.length !== 0) { + t1 = J.getInterceptor($length); + if (t1.$eq($length, 0)) + return ""; + first = H.S(this.elementAt$1(0, 0)); + if (!t1.$eq($length, this.get$length(this))) + throw H.wrapException(new P.ConcurrentModificationError(this)); + buffer = new P.StringBuffer(first); + if (typeof $length !== "number") + return H.iae($length); + i = 1; + for (; i < $length; ++i) { + buffer._contents += separator; + buffer._contents += H.S(this.elementAt$1(0, i)); + if ($length !== this.get$length(this)) + throw H.wrapException(new P.ConcurrentModificationError(this)); } - return; - } - message = new Array(2); - message.fixed$length = Array; - message[0] = J.toString$0$(error); - message[1] = stackTrace == null ? null : J.toString$0$(stackTrace); - for (t2 = new P._LinkedHashSetIterator(t1, t1._collection$_modifications, null, null), t2._collection$_cell = t1._collection$_first; t2.moveNext$0();) - J.send$1$x(t2._collection$_current, message); - }, "call$2", "get$handleUncaughtError", 4, 0, 10], - eval$1: function(code) { - var old, result, oldIsExecutingEvent, e, s, exception, t1; - old = init.globalState.currentContext; - init.globalState.currentContext = this; - $ = this.isolateStatics; - result = null; - oldIsExecutingEvent = this._isExecutingEvent; - this._isExecutingEvent = true; - try { - result = code.call$0(); - } catch (exception) { - t1 = H.unwrapException(exception); - e = t1; - s = H.getTraceFromException(exception); - this.handleUncaughtError$2(e, s); - if (this.errorsAreFatal === true) { - this.kill$0(); - if (this === init.globalState.rootContext) - throw exception; + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else { + buffer = new P.StringBuffer(""); + if (typeof $length !== "number") + return H.iae($length); + i = 0; + for (; i < $length; ++i) { + buffer._contents += H.S(this.elementAt$1(0, i)); + if ($length !== this.get$length(this)) + throw H.wrapException(new P.ConcurrentModificationError(this)); } - } finally { - this._isExecutingEvent = oldIsExecutingEvent; - init.globalState.currentContext = old; - if (old != null) - $ = old.get$isolateStatics(); - if (this._scheduledControlEvents != null) - for (; t1 = this._scheduledControlEvents, !t1.get$isEmpty(t1);) - this._scheduledControlEvents.removeFirst$0().call$0(); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; } - return result; }, - handleControlMessage$1: function(message) { - var t1 = J.getInterceptor$asx(message); - switch (t1.$index(message, 0)) { - case "pause": - this.addPause$2(t1.$index(message, 1), t1.$index(message, 2)); - break; - case "resume": - this.removePause$1(t1.$index(message, 1)); - break; - case "add-ondone": - this.addDoneListener$2(t1.$index(message, 1), t1.$index(message, 2)); - break; - case "remove-ondone": - this.removeDoneListener$1(t1.$index(message, 1)); - break; - case "set-errors-fatal": - this.setErrorsFatal$2(t1.$index(message, 1), t1.$index(message, 2)); - break; - case "ping": - this.handlePing$3(t1.$index(message, 1), t1.$index(message, 2), t1.$index(message, 3)); - break; - case "kill": - this.handleKill$2(t1.$index(message, 1), t1.$index(message, 2)); - break; - case "getErrors": - this.errorPorts.add$1(0, t1.$index(message, 1)); - break; - case "stopErrors": - this.errorPorts.remove$1(0, t1.$index(message, 1)); - break; - } + join$0: function($receiver) { + return this.join$1($receiver, ""); }, - lookup$1: function(portId) { - return this.ports.$index(0, portId); + map$1: function(_, f) { + return H.setRuntimeTypeInfo(new H.MappedListIterable(this, f), [H.getRuntimeTypeArgument(this, "ListIterable", 0), null]); }, - _addRegistration$2: function(portId, port) { - var t1 = this.ports; - if (t1.containsKey$1(portId)) - throw H.wrapException(P.Exception_Exception("Registry: ports must be registered only once.")); - t1.$indexSet(0, portId, port); - }, - _updateGlobalState$0: function() { - var t1 = this.ports; - if (t1.get$length(t1) - this.weakPorts._collection$_length > 0 || this.isPaused || !this.initialized) - init.globalState.isolates.$indexSet(0, this.id, this); - else - this.kill$0(); + fold$2: function(_, initialValue, combine) { + var $length, value, i; + $length = this.get$length(this); + if (typeof $length !== "number") + return H.iae($length); + value = initialValue; + i = 0; + for (; i < $length; ++i) { + value = combine.call$2(value, this.elementAt$1(0, i)); + if ($length !== this.get$length(this)) + throw H.wrapException(new P.ConcurrentModificationError(this)); + } + return value; }, - kill$0: [function() { - var t1, t2, i, responsePort, t3; - t1 = this._scheduledControlEvents; - if (t1 != null) - t1.clear$0(0); - for (t1 = this.ports, t2 = t1.get$values(t1), t2 = t2.get$iterator(t2); t2.moveNext$0();) - t2.get$current().__isolate_helper$_close$0(); - t1.clear$0(0); - this.weakPorts.clear$0(0); - init.globalState.isolates.remove$1(0, this.id); - this.errorPorts.clear$0(0); - if (this.doneHandlers != null) { - for (i = 0; t1 = this.doneHandlers, t2 = t1.length, i < t2; i += 2) { - responsePort = t1[i]; - t3 = i + 1; - if (t3 >= t2) - return H.ioore(t1, t3); - J.send$1$x(responsePort, t1[t3]); - } - this.doneHandlers = null; + toList$1$growable: function(_, growable) { + var result, i, t1; + result = H.setRuntimeTypeInfo([], [H.getRuntimeTypeArgument(this, "ListIterable", 0)]); + C.JSArray_methods.set$length(result, this.get$length(this)); + i = 0; + while (true) { + t1 = this.get$length(this); + if (typeof t1 !== "number") + return H.iae(t1); + if (!(i < t1)) + break; + t1 = this.elementAt$1(0, i); + if (i >= result.length) + return H.ioore(result, i); + result[i] = t1; + ++i; } - }, "call$0", "get$kill", 0, 0, 2] + return result; + }, + toList$0: function($receiver) { + return this.toList$1$growable($receiver, true); + }, + $isEfficientLength: 1 }, - _IsolateContext_handlePing_respond: { - "^": "Closure:2;responsePort,response", - call$0: [function() { - J.send$1$x(this.responsePort, this.response); - }, null, null, 0, 0, null, "call"] + SubListIterable: { + "^": "ListIterable;_iterable,__internal$_start,_endOrLength", + get$_endIndex: function() { + var $length, t1; + $length = J.get$length$asx(this._iterable); + t1 = this._endOrLength; + if (t1 == null || J.$gt$n(t1, $length)) + return $length; + return t1; + }, + get$_startIndex: function() { + var $length, t1; + $length = J.get$length$asx(this._iterable); + t1 = this.__internal$_start; + if (J.$gt$n(t1, $length)) + return $length; + return t1; + }, + get$length: function(_) { + var $length, t1, t2; + $length = J.get$length$asx(this._iterable); + t1 = this.__internal$_start; + if (J.$ge$n(t1, $length)) + return 0; + t2 = this._endOrLength; + if (t2 == null || J.$ge$n(t2, $length)) + return J.$sub$n($length, t1); + return J.$sub$n(t2, t1); + }, + elementAt$1: function(_, index) { + var realIndex = J.$add$ns(this.get$_startIndex(), index); + if (J.$lt$n(index, 0) || J.$ge$n(realIndex, this.get$_endIndex())) + throw H.wrapException(P.IndexError$(index, this, "index", null, null)); + return J.elementAt$1$ax(this._iterable, realIndex); + }, + toList$1$growable: function(_, growable) { + var start, t1, t2, end, end0, $length, result, t3, i, t4; + start = this.__internal$_start; + t1 = this._iterable; + t2 = J.getInterceptor$asx(t1); + end = t2.get$length(t1); + end0 = this._endOrLength; + if (end0 != null && J.$lt$n(end0, end)) + end = end0; + $length = J.$sub$n(end, start); + if (J.$lt$n($length, 0)) + $length = 0; + if (typeof $length !== "number") + return H.iae($length); + result = H.setRuntimeTypeInfo(new Array($length), [H.getTypeArgumentByIndex(this, 0)]); + if (typeof $length !== "number") + return H.iae($length); + t3 = J.getInterceptor$ns(start); + i = 0; + for (; i < $length; ++i) { + t4 = t2.elementAt$1(t1, t3.$add(start, i)); + if (i >= result.length) + return H.ioore(result, i); + result[i] = t4; + if (J.$lt$n(t2.get$length(t1), end)) + throw H.wrapException(new P.ConcurrentModificationError(this)); + } + return result; + }, + SubListIterable$3: function(_iterable, _start, _endOrLength, $E) { + var t1, t2, t3; + t1 = this.__internal$_start; + t2 = J.getInterceptor$n(t1); + if (t2.$lt(t1, 0)) + H.throwExpression(P.RangeError$range(t1, 0, null, "start", null)); + t3 = this._endOrLength; + if (t3 != null) { + if (J.$lt$n(t3, 0)) + H.throwExpression(P.RangeError$range(t3, 0, null, "end", null)); + if (t2.$gt(t1, t3)) + throw H.wrapException(P.RangeError$range(t1, 0, t3, "start", null)); + } + }, + static: { + SubListIterable$: function(_iterable, _start, _endOrLength, $E) { + var t1 = H.setRuntimeTypeInfo(new H.SubListIterable(_iterable, _start, _endOrLength), [$E]); + t1.SubListIterable$3(_iterable, _start, _endOrLength, $E); + return t1; + } + } }, - _EventLoop: { - "^": "Object;events,_activeJsAsyncCount", - dequeue$0: function() { - var t1 = this.events; - if (t1._head === t1._tail) - return; - return t1.removeFirst$0(); + ListIterator: { + "^": "Object;_iterable,_length,_index,_current", + get$current: function() { + return this._current; }, - runIteration$0: function() { - var $event, t1, t2; - $event = this.dequeue$0(); - if ($event == null) { - if (init.globalState.rootContext != null) - if (init.globalState.isolates.containsKey$1(init.globalState.rootContext.id)) - if (init.globalState.fromCommandLine === true) { - t1 = init.globalState.rootContext.ports; - t1 = t1.get$isEmpty(t1); - } else - t1 = false; - else - t1 = false; - else - t1 = false; - if (t1) - H.throwExpression(P.Exception_Exception("Program exited with open ReceivePorts.")); - t1 = init.globalState; - if (t1.isWorker === true) { - t2 = t1.isolates; - t2 = t2.get$isEmpty(t2) && t1.topEventLoop._activeJsAsyncCount === 0; - } else - t2 = false; - if (t2) { - t1 = t1.mainManager; - t2 = P.LinkedHashMap__makeLiteral(["command", "close"]); - t2 = new H._Serializer(true, H.setRuntimeTypeInfo(new P._LinkedIdentityHashMap(0, null, null, null, null, null, 0), [null, P.$int])).serialize$1(t2); - t1.toString; - self.postMessage(t2); - } + moveNext$0: function() { + var t1, t2, $length, t3; + t1 = this._iterable; + t2 = J.getInterceptor$asx(t1); + $length = t2.get$length(t1); + if (!J.$eq$(this._length, $length)) + throw H.wrapException(new P.ConcurrentModificationError(t1)); + t3 = this._index; + if (typeof $length !== "number") + return H.iae($length); + if (t3 >= $length) { + this._current = null; return false; } - $event.process$0(); + this._current = t2.elementAt$1(t1, t3); + ++this._index; return true; + } + }, + MappedIterable: { + "^": "Iterable;_iterable,_f", + get$iterator: function(_) { + var t1 = new H.MappedIterator(null, J.get$iterator$ax(this._iterable), this._f); + t1.$builtinTypeInfo = this.$builtinTypeInfo; + return t1; }, - _runHelper$0: function() { - if (self.window != null) - new H._EventLoop__runHelper_next(this).call$0(); - else - for (; this.runIteration$0();) - ; + get$length: function(_) { + return J.get$length$asx(this._iterable); }, - run$0: [function() { - var e, trace, exception, t1, t2; - if (init.globalState.isWorker !== true) - this._runHelper$0(); - else - try { - this._runHelper$0(); - } catch (exception) { - t1 = H.unwrapException(exception); - e = t1; - trace = H.getTraceFromException(exception); - t1 = init.globalState.mainManager; - t2 = P.LinkedHashMap__makeLiteral(["command", "error", "msg", H.S(e) + "\n" + H.S(trace)]); - t2 = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t2); - t1.toString; - self.postMessage(t2); - } - }, "call$0", "get$run", 0, 0, 2] + get$isEmpty: function(_) { + return J.get$isEmpty$asx(this._iterable); + }, + $asIterable: function($S, $T) { + return [$T]; + }, + static: { + MappedIterable_MappedIterable: function(iterable, $function, $S, $T) { + if (!!J.getInterceptor(iterable).$isEfficientLength) + return H.setRuntimeTypeInfo(new H.EfficientLengthMappedIterable(iterable, $function), [$S, $T]); + return H.setRuntimeTypeInfo(new H.MappedIterable(iterable, $function), [$S, $T]); + } + } }, - _EventLoop__runHelper_next: { - "^": "Closure:2;$this", - call$0: [function() { - if (!this.$this.runIteration$0()) - return; - P.Timer_Timer(C.Duration_0, this); - }, null, null, 0, 0, null, "call"] + EfficientLengthMappedIterable: { + "^": "MappedIterable;_iterable,_f", + $isEfficientLength: 1 }, - _IsolateEvent: { - "^": "Object;isolate,fn,message>", - process$0: function() { - var t1 = this.isolate; - if (t1.get$isPaused()) { - t1.get$delayedEvents().push(this); - return; + MappedIterator: { + "^": "Iterator;_current,_iterator,_f", + moveNext$0: function() { + var t1 = this._iterator; + if (t1.moveNext$0()) { + this._current = this._f.call$1(t1.get$current()); + return true; } - t1.eval$1(this.fn); + this._current = null; + return false; + }, + get$current: function() { + return this._current; } }, - _MainManagerStub: { - "^": "Object;" - }, - IsolateNatives__processWorkerMessage_closure: { - "^": "Closure:1;entryPoint,args,message,isSpawnUri,startPaused,replyTo", - call$0: function() { - H.IsolateNatives__startIsolate(this.entryPoint, this.args, this.message, this.isSpawnUri, this.startPaused, this.replyTo); + MappedListIterable: { + "^": "ListIterable;_source,_f", + get$length: function(_) { + return J.get$length$asx(this._source); + }, + elementAt$1: function(_, index) { + return this._f.call$1(J.elementAt$1$ax(this._source, index)); + }, + $asListIterable: function($S, $T) { + return [$T]; + }, + $asIterable: function($S, $T) { + return [$T]; + }, + $isEfficientLength: 1 + }, + WhereIterable: { + "^": "Iterable;_iterable,_f", + get$iterator: function(_) { + var t1 = new H.WhereIterator(J.get$iterator$ax(this._iterable), this._f); + t1.$builtinTypeInfo = this.$builtinTypeInfo; + return t1; } }, - IsolateNatives__startIsolate_runStartFunction: { - "^": "Closure:2;topLevel,args,message,isSpawnUri,context", - call$0: function() { - var t1, t2, t3, t4; - t1 = this.context; - t1.set$initialized(true); - if (this.isSpawnUri !== true) - this.topLevel.call$1(this.message); - else { - t2 = this.topLevel; - t3 = H.getDynamicRuntimeType(); - t4 = H.buildFunctionType(t3, [t3, t3])._isTest$1(t2); - if (t4) - t2.call$2(this.args, this.message); - else { - t3 = H.buildFunctionType(t3, [t3])._isTest$1(t2); - if (t3) - t2.call$1(this.args); - else - t2.call$0(); - } - } - t1._updateGlobalState$0(); + WhereIterator: { + "^": "Iterator;_iterator,_f", + moveNext$0: function() { + var t1, t2; + for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();) + if (t2.call$1(t1.get$current()) === true) + return true; + return false; + }, + get$current: function() { + return this._iterator.get$current(); } }, - _BaseSendPort: { - "^": "Object;" + ExpandIterable: { + "^": "Iterable;_iterable,_f", + get$iterator: function(_) { + return new H.ExpandIterator(J.get$iterator$ax(this._iterable), this._f, C.C_EmptyIterator, null); + }, + $asIterable: function($S, $T) { + return [$T]; + } }, - _NativeJsSendPort: { - "^": "_BaseSendPort;_receivePort,_isolateId", - send$1: function(_, message) { - var isolate, t1, msg; - isolate = init.globalState.isolates.$index(0, this._isolateId); - if (isolate == null) - return; - t1 = this._receivePort; - if (t1.get$_isClosed()) - return; - msg = H._clone(message); - if (isolate.get$controlPort() === t1) { - isolate.handleControlMessage$1(msg); - return; - } - init.globalState.topEventLoop.events._add$1(new H._IsolateEvent(isolate, new H._NativeJsSendPort_send_closure(this, msg), "receive")); + ExpandIterator: { + "^": "Object;_iterator,_f,_currentExpansion,_current", + get$current: function() { + return this._current; }, - $eq: function(_, other) { - if (other == null) + moveNext$0: function() { + var t1, t2, t3; + t1 = this._currentExpansion; + if (t1 == null) return false; - return other instanceof H._NativeJsSendPort && J.$eq$(this._receivePort, other._receivePort); - }, - get$hashCode: function(_) { - return this._receivePort.get$_id(); + for (t2 = this._iterator, t3 = this._f; !t1.moveNext$0();) { + this._current = null; + if (t2.moveNext$0()) { + this._currentExpansion = null; + t1 = J.get$iterator$ax(t3.call$1(t2.get$current())); + this._currentExpansion = t1; + } else + return false; + } + this._current = this._currentExpansion.get$current(); + return true; } }, - _NativeJsSendPort_send_closure: { - "^": "Closure:1;$this,msg", - call$0: function() { - var t1 = this.$this._receivePort; - if (!t1.get$_isClosed()) - t1.__isolate_helper$_add$1(this.msg); + SkipWhileIterable: { + "^": "Iterable;_iterable,_f", + get$iterator: function(_) { + var t1 = new H.SkipWhileIterator(J.get$iterator$ax(this._iterable), this._f, false); + t1.$builtinTypeInfo = this.$builtinTypeInfo; + return t1; } }, - _WorkerSendPort: { - "^": "_BaseSendPort;_workerId,_receivePortId,_isolateId", - send$1: function(_, message) { - var t1, workerMessage, manager; - t1 = P.LinkedHashMap__makeLiteral(["command", "message", "port", this, "msg", message]); - workerMessage = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t1); - if (init.globalState.isWorker === true) { - init.globalState.mainManager.toString; - self.postMessage(workerMessage); - } else { - manager = init.globalState.managers.$index(0, this._workerId); - if (manager != null) - manager.postMessage(workerMessage); + SkipWhileIterator: { + "^": "Iterator;_iterator,_f,_hasSkipped", + moveNext$0: function() { + var t1, t2; + if (!this._hasSkipped) { + this._hasSkipped = true; + for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();) + if (t2.call$1(t1.get$current()) !== true) + return true; } + return this._iterator.moveNext$0(); }, - $eq: function(_, other) { - if (other == null) - return false; - return other instanceof H._WorkerSendPort && J.$eq$(this._workerId, other._workerId) && J.$eq$(this._isolateId, other._isolateId) && J.$eq$(this._receivePortId, other._receivePortId); + get$current: function() { + return this._iterator.get$current(); + } + }, + EmptyIterator: { + "^": "Object;", + moveNext$0: function() { + return false; }, - get$hashCode: function(_) { - var t1, t2, t3; - t1 = J.$shl$n(this._workerId, 16); - t2 = J.$shl$n(this._isolateId, 8); - t3 = this._receivePortId; - if (typeof t3 !== "number") - return H.iae(t3); - return (t1 ^ t2 ^ t3) >>> 0; + get$current: function() { + return; } }, - RawReceivePortImpl: { - "^": "Object;_id<,_handler,_isClosed<", - __isolate_helper$_close$0: function() { - this._isClosed = true; - this._handler = null; + FixedLengthListMixin: { + "^": "Object;", + set$length: function(receiver, newLength) { + throw H.wrapException(new P.UnsupportedError("Cannot change the length of a fixed-length list")); }, - __isolate_helper$_add$1: function(dataEvent) { - if (this._isClosed) - return; - this._handler$1(dataEvent); + replaceRange$3: function(receiver, start, end, iterable) { + throw H.wrapException(new P.UnsupportedError("Cannot remove from a fixed-length list")); + } + }, + UnmodifiableListMixin: { + "^": "Object;", + $indexSet: function(_, index, value) { + throw H.wrapException(new P.UnsupportedError("Cannot modify an unmodifiable list")); }, - _handler$1: function(arg0) { - return this._handler.call$1(arg0); + set$length: function(_, newLength) { + throw H.wrapException(new P.UnsupportedError("Cannot change the length of an unmodifiable list")); }, - $isRawReceivePort: 1 - }, - TimerImpl: { - "^": "Object;_once,_inEventLoop,_handle", - TimerImpl$periodic$2: function(milliseconds, callback) { - if (self.setTimeout != null) { - ++init.globalState.topEventLoop._activeJsAsyncCount; - this._handle = self.setInterval(H.convertDartClosureToJS(new H.TimerImpl$periodic_closure(this, callback), 0), milliseconds); - } else - throw H.wrapException(new P.UnsupportedError("Periodic timer.")); + setRange$4: function(_, start, end, iterable, skipCount) { + throw H.wrapException(new P.UnsupportedError("Cannot modify an unmodifiable list")); }, - TimerImpl$2: function(milliseconds, callback) { - var t1, t2; - if (milliseconds === 0) - t1 = self.setTimeout == null || init.globalState.isWorker === true; - else - t1 = false; - if (t1) { - this._handle = 1; - t1 = init.globalState.topEventLoop; - t2 = init.globalState.currentContext; - t1.events._add$1(new H._IsolateEvent(t2, new H.TimerImpl_internalCallback(this, callback), "timer")); - this._inEventLoop = true; - } else if (self.setTimeout != null) { - ++init.globalState.topEventLoop._activeJsAsyncCount; - this._handle = self.setTimeout(H.convertDartClosureToJS(new H.TimerImpl_internalCallback0(this, callback), 0), milliseconds); - } else - throw H.wrapException(new P.UnsupportedError("Timer greater than 0.")); + setRange$3: function($receiver, start, end, iterable) { + return this.setRange$4($receiver, start, end, iterable, 0); }, - static: { - TimerImpl$: function(milliseconds, callback) { - var t1 = new H.TimerImpl(true, false, null); - t1.TimerImpl$2(milliseconds, callback); - return t1; - }, - TimerImpl$periodic: function(milliseconds, callback) { - var t1 = new H.TimerImpl(false, false, null); - t1.TimerImpl$periodic$2(milliseconds, callback); - return t1; - } - } + replaceRange$3: function(_, start, end, iterable) { + throw H.wrapException(new P.UnsupportedError("Cannot remove from an unmodifiable list")); + }, + fillRange$3: function(_, start, end, fillValue) { + throw H.wrapException(new P.UnsupportedError("Cannot modify an unmodifiable list")); + }, + $isList: 1, + $asList: null, + $isEfficientLength: 1 }, - TimerImpl_internalCallback: { - "^": "Closure:2;$this,callback", - call$0: function() { - this.$this._handle = null; - this.callback.call$0(); + UnmodifiableListBase: { + "^": "ListBase+UnmodifiableListMixin;", + $isList: 1, + $asList: null, + $isEfficientLength: 1 + }, + ReversedListIterable: { + "^": "ListIterable;_source", + get$length: function(_) { + return J.get$length$asx(this._source); + }, + elementAt$1: function(_, index) { + var t1, t2; + t1 = this._source; + t2 = J.getInterceptor$asx(t1); + return t2.elementAt$1(t1, J.$sub$n(J.$sub$n(t2.get$length(t1), 1), index)); } + } + }], ["_isolate_helper", "dart:_isolate_helper",, H, { + "^": "", + _callInIsolate: function(isolate, $function) { + var result = isolate.eval$1($function); + if (!init.globalState.currentContext._isExecutingEvent) + init.globalState.topEventLoop.run$0(); + return result; }, - TimerImpl_internalCallback0: { - "^": "Closure:2;$this,callback", - call$0: [function() { - this.$this._handle = null; - --init.globalState.topEventLoop._activeJsAsyncCount; - this.callback.call$0(); - }, null, null, 0, 0, null, "call"] + startRootIsolate: function(entry, args) { + var t1, t2, t3, t4, t5, rootContext; + t1 = {}; + t1.args = args; + if (args == null) { + args = []; + t1.args = args; + t2 = args; + } else + t2 = args; + if (!J.getInterceptor(t2).$isList) + throw H.wrapException(P.ArgumentError$("Arguments to main must be a List: " + H.S(t2))); + init.globalState = new H._Manager(0, 0, 1, null, null, null, null, null, null, null, null, null, entry); + t2 = init.globalState; + t3 = self.window == null; + t4 = self.Worker; + t5 = t3 && !!self.postMessage; + t2.isWorker = t5; + t5 = !t5; + if (t5) + t4 = t4 != null && $.$get$IsolateNatives_thisScript() != null; + else + t4 = true; + t2.supportsWorkers = t4; + t2.fromCommandLine = t3 && t5; + t2.topEventLoop = new H._EventLoop(P.ListQueue$(null, H._IsolateEvent), 0); + t2.isolates = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, H._IsolateContext]); + t2.managers = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, null]); + if (t2.isWorker === true) { + t3 = new H._MainManagerStub(); + t2.mainManager = t3; + self.onmessage = function(f, a) { + return function(e) { + f(a, e); + }; + }(H.IsolateNatives__processWorkerMessage, t3); + self.dartPrint = self.dartPrint || function(serialize) { + return function(object) { + if (self.console && self.console.log) + self.console.log(object); + else + self.postMessage(serialize(object)); + }; + }(H._Manager__serializePrintMessage); + } + if (init.globalState.isWorker === true) + return; + t2 = init.globalState.nextIsolateId++; + t3 = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, H.RawReceivePortImpl]); + t4 = P.LinkedHashSet_LinkedHashSet(null, null, null, P.$int); + t5 = new H.RawReceivePortImpl(0, null, false); + rootContext = new H._IsolateContext(t2, t3, t4, init.createNewIsolate(), t5, new H.CapabilityImpl(H.random64()), new H.CapabilityImpl(H.random64()), false, false, [], P.LinkedHashSet_LinkedHashSet(null, null, null, null), null, null, false, true, P.LinkedHashSet_LinkedHashSet(null, null, null, null)); + t4.add$1(0, 0); + rootContext._addRegistration$2(0, t5); + init.globalState.rootContext = rootContext; + init.globalState.currentContext = rootContext; + t2 = H.getDynamicRuntimeType(); + t3 = H.buildFunctionType(t2, [t2])._isTest$1(entry); + if (t3) + rootContext.eval$1(new H.startRootIsolate_closure(t1, entry)); + else { + t2 = H.buildFunctionType(t2, [t2, t2])._isTest$1(entry); + if (t2) + rootContext.eval$1(new H.startRootIsolate_closure0(t1, entry)); + else + rootContext.eval$1(entry); + } + init.globalState.topEventLoop.run$0(); }, - TimerImpl$periodic_closure: { - "^": "Closure:1;$this,callback", - call$0: [function() { - this.callback.call$1(this.$this); - }, null, null, 0, 0, null, "call"] + IsolateNatives_computeThisScript: function() { + var currentScript = init.currentScript; + if (currentScript != null) + return String(currentScript.src); + if (init.globalState.isWorker === true) + return H.IsolateNatives_computeThisScriptFromTrace(); + return; }, - CapabilityImpl: { - "^": "Object;_id<", - get$hashCode: function(_) { - var hash, t1, t2; - hash = this._id; - t1 = J.getInterceptor$n(hash); - t2 = t1.$shr(hash, 0); - t1 = t1.$tdiv(hash, 4294967296); - if (typeof t1 !== "number") - return H.iae(t1); - hash = t2 ^ t1; - hash = (~hash >>> 0) + (hash << 15 >>> 0) & 4294967295; - hash = ((hash ^ hash >>> 12) >>> 0) * 5 & 4294967295; - hash = ((hash ^ hash >>> 4) >>> 0) * 2057 & 4294967295; - return (hash ^ hash >>> 16) >>> 0; - }, - $eq: function(_, other) { - var t1, t2; - if (other == null) - return false; - if (other === this) - return true; - if (other instanceof H.CapabilityImpl) { - t1 = this._id; - t2 = other._id; - return t1 == null ? t2 == null : t1 === t2; + IsolateNatives_computeThisScriptFromTrace: function() { + var stack, matches; + stack = new Error().stack; + if (stack == null) { + stack = function() { + try { + throw new Error(); + } catch (e) { + return e.stack; + } + }(); + if (stack == null) + throw H.wrapException(new P.UnsupportedError("No stack trace")); + } + matches = stack.match(new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")); + if (matches != null) + return matches[1]; + matches = stack.match(new RegExp("^[^@]*@(.*):[0-9]*$", "m")); + if (matches != null) + return matches[1]; + throw H.wrapException(new P.UnsupportedError('Cannot extract URI from "' + H.S(stack) + '"')); + }, + IsolateNatives__processWorkerMessage: function(sender, e) { + var msg, t1, functionName, entryPoint, args, message, isSpawnUri, startPaused, replyTo, t2, t3, t4, context; + msg = new H._Deserializer(true, []).deserialize$1(e.data); + t1 = J.getInterceptor$asx(msg); + switch (t1.$index(msg, "command")) { + case "start": + init.globalState.currentManagerId = t1.$index(msg, "id"); + functionName = t1.$index(msg, "functionName"); + entryPoint = functionName == null ? init.globalState.entry : init.globalFunctions[functionName](); + args = t1.$index(msg, "args"); + message = new H._Deserializer(true, []).deserialize$1(t1.$index(msg, "msg")); + isSpawnUri = t1.$index(msg, "isSpawnUri"); + startPaused = t1.$index(msg, "startPaused"); + replyTo = new H._Deserializer(true, []).deserialize$1(t1.$index(msg, "replyTo")); + t1 = init.globalState.nextIsolateId++; + t2 = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.$int, H.RawReceivePortImpl]); + t3 = P.LinkedHashSet_LinkedHashSet(null, null, null, P.$int); + t4 = new H.RawReceivePortImpl(0, null, false); + context = new H._IsolateContext(t1, t2, t3, init.createNewIsolate(), t4, new H.CapabilityImpl(H.random64()), new H.CapabilityImpl(H.random64()), false, false, [], P.LinkedHashSet_LinkedHashSet(null, null, null, null), null, null, false, true, P.LinkedHashSet_LinkedHashSet(null, null, null, null)); + t3.add$1(0, 0); + context._addRegistration$2(0, t4); + init.globalState.topEventLoop.events._add$1(new H._IsolateEvent(context, new H.IsolateNatives__processWorkerMessage_closure(entryPoint, args, message, isSpawnUri, startPaused, replyTo), "worker-start")); + init.globalState.currentContext = context; + init.globalState.topEventLoop.run$0(); + break; + case "spawn-worker": + break; + case "message": + if (t1.$index(msg, "port") != null) + J.send$1$x(t1.$index(msg, "port"), t1.$index(msg, "msg")); + init.globalState.topEventLoop.run$0(); + break; + case "close": + init.globalState.managers.remove$1(0, $.$get$IsolateNatives_workerIds().$index(0, sender)); + sender.terminate(); + init.globalState.topEventLoop.run$0(); + break; + case "log": + H.IsolateNatives__log(t1.$index(msg, "msg")); + break; + case "print": + if (init.globalState.isWorker === true) { + t1 = init.globalState.mainManager; + t2 = P.LinkedHashMap__makeLiteral(["command", "print", "msg", msg]); + t2 = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t2); + t1.toString; + self.postMessage(t2); + } else + P.print(t1.$index(msg, "msg")); + break; + case "error": + throw H.wrapException(t1.$index(msg, "msg")); + } + }, + IsolateNatives__log: function(msg) { + var trace, t1, t2, exception; + if (init.globalState.isWorker === true) { + t1 = init.globalState.mainManager; + t2 = P.LinkedHashMap__makeLiteral(["command", "log", "msg", msg]); + t2 = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t2); + t1.toString; + self.postMessage(t2); + } else + try { + self.console.log(msg); + } catch (exception) { + H.unwrapException(exception); + trace = H.getTraceFromException(exception); + throw H.wrapException(P.Exception_Exception(trace)); } - return false; + }, + IsolateNatives__startIsolate: function(topLevel, args, message, isSpawnUri, startPaused, replyTo) { + var context, t1, t2, t3; + context = init.globalState.currentContext; + t1 = context.id; + $.Primitives_mirrorFunctionCacheName = $.Primitives_mirrorFunctionCacheName + ("_" + t1); + $.Primitives_mirrorInvokeCacheName = $.Primitives_mirrorInvokeCacheName + ("_" + t1); + t1 = context.controlPort; + t2 = init.globalState.currentContext.id; + t3 = context.pauseCapability; + J.send$1$x(replyTo, ["spawned", new H._NativeJsSendPort(t1, t2), t3, context.terminateCapability]); + t2 = new H.IsolateNatives__startIsolate_runStartFunction(topLevel, args, message, isSpawnUri, context); + if (startPaused === true) { + context.addPause$2(t3, t3); + init.globalState.topEventLoop.events._add$1(new H._IsolateEvent(context, t2, "start isolate")); + } else + t2.call$0(); + }, + _clone: function(message) { + return new H._Deserializer(true, []).deserialize$1(new H._Serializer(false, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(message)); + }, + startRootIsolate_closure: { + "^": "Closure:1;_box_0,entry", + call$0: function() { + this.entry.call$1(this._box_0.args); } }, - _Serializer: { - "^": "Object;_serializeSendPorts,serializedObjectIds", - serialize$1: [function(x) { - var t1, serializationId, serializeTearOff, t2, $name; - if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean") - return x; - t1 = this.serializedObjectIds; - serializationId = t1.$index(0, x); - if (serializationId != null) - return ["ref", serializationId]; - t1.$indexSet(0, x, t1.get$length(t1)); - t1 = J.getInterceptor(x); - if (!!t1.$isNativeByteBuffer) - return ["buffer", x]; - if (!!t1.$isNativeTypedData) - return ["typed", x]; - if (!!t1.$isJSIndexable) - return this.serializeJSIndexable$1(x); - if (!!t1.$isInternalMap) { - serializeTearOff = this.get$serialize(); - t2 = x.get$keys(); - t2 = H.MappedIterable_MappedIterable(t2, serializeTearOff, H.getRuntimeTypeArgument(t2, "Iterable", 0), null); - t2 = P.List_List$from(t2, true, H.getRuntimeTypeArgument(t2, "Iterable", 0)); - t1 = t1.get$values(x); - t1 = H.MappedIterable_MappedIterable(t1, serializeTearOff, H.getRuntimeTypeArgument(t1, "Iterable", 0), null); - return ["map", t2, P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "Iterable", 0))]; + startRootIsolate_closure0: { + "^": "Closure:1;_box_0,entry", + call$0: function() { + this.entry.call$2(this._box_0.args, null); + } + }, + _Manager: { + "^": "Object;nextIsolateId,currentManagerId,nextManagerId,currentContext,rootContext,topEventLoop,fromCommandLine,isWorker,supportsWorkers,isolates,mainManager,managers,entry", + static: { + _Manager__serializePrintMessage: function(object) { + var t1 = P.LinkedHashMap__makeLiteral(["command", "print", "msg", object]); + return new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t1); } - if (!!t1.$isJSObject) - return this.serializeJSObject$1(x); - if (!!t1.$isInterceptor) - this.unsupported$1(x); - if (!!t1.$isRawReceivePort) - this.unsupported$2(x, "RawReceivePorts can't be transmitted:"); - if (!!t1.$is_NativeJsSendPort) - return this.serializeJsSendPort$1(x); - if (!!t1.$is_WorkerSendPort) - return this.serializeWorkerSendPort$1(x); - if (!!t1.$isClosure) { - $name = x.$static_name; - if ($name == null) - this.unsupported$2(x, "Closures can't be transmitted:"); - return ["function", $name]; + } + }, + _IsolateContext: { + "^": "Object;id,ports,weakPorts,isolateStatics<,controlPort<,pauseCapability,terminateCapability,initialized,isPaused,delayedEvents,pauseTokens,doneHandlers,_scheduledControlEvents,_isExecutingEvent,errorsAreFatal,errorPorts", + addPause$2: function(authentification, resume) { + if (!this.pauseCapability.$eq(0, authentification)) + return; + if (this.pauseTokens.add$1(0, resume) && !this.isPaused) + this.isPaused = true; + this._updateGlobalState$0(); + }, + removePause$1: function(resume) { + var t1, t2, $event, t3, t4, t5; + if (!this.isPaused) + return; + t1 = this.pauseTokens; + t1.remove$1(0, resume); + if (t1._collection$_length === 0) { + for (t1 = this.delayedEvents; t2 = t1.length, t2 !== 0;) { + if (0 >= t2) + return H.ioore(t1, -1); + $event = t1.pop(); + t2 = init.globalState.topEventLoop.events; + t3 = t2._head; + t4 = t2._table; + t5 = t4.length; + t3 = (t3 - 1 & t5 - 1) >>> 0; + t2._head = t3; + if (t3 < 0 || t3 >= t5) + return H.ioore(t4, t3); + t4[t3] = $event; + if (t3 === t2._tail) + t2._grow$0(); + ++t2._modificationCount; + } + this.isPaused = false; } - if (!!t1.$isCapabilityImpl) - return ["capability", x._id]; - if (!(x instanceof P.Object)) - this.unsupported$1(x); - return ["dart", init.classIdExtractor(x), this.serializeArrayInPlace$1(init.classFieldsExtractor(x))]; - }, "call$1", "get$serialize", 2, 0, 0, 21], - unsupported$2: function(x, message) { - throw H.wrapException(new P.UnsupportedError(H.S(message == null ? "Can't transmit:" : message) + " " + H.S(x))); + this._updateGlobalState$0(); }, - unsupported$1: function(x) { - return this.unsupported$2(x, null); + addDoneListener$2: function(responsePort, response) { + var t1, i, t2; + if (this.doneHandlers == null) + this.doneHandlers = []; + for (t1 = J.getInterceptor(responsePort), i = 0; t2 = this.doneHandlers, i < t2.length; i += 2) + if (t1.$eq(responsePort, t2[i])) { + t1 = this.doneHandlers; + t2 = i + 1; + if (t2 >= t1.length) + return H.ioore(t1, t2); + t1[t2] = response; + return; + } + t2.push(responsePort); + this.doneHandlers.push(response); }, - serializeJSIndexable$1: function(indexable) { - var serialized = this.serializeArray$1(indexable); - if (!!indexable.fixed$length) - return ["fixed", serialized]; - if (!indexable.fixed$length) - return ["extendable", serialized]; - if (!indexable.immutable$list) - return ["mutable", serialized]; - if (indexable.constructor === Array) - return ["const", serialized]; - this.unsupported$2(indexable, "Can't serialize indexable: "); + removeDoneListener$1: function(responsePort) { + var t1, i, t2; + if (this.doneHandlers == null) + return; + for (t1 = J.getInterceptor(responsePort), i = 0; t2 = this.doneHandlers, i < t2.length; i += 2) + if (t1.$eq(responsePort, t2[i])) { + t1 = this.doneHandlers; + t2 = i + 2; + t1.toString; + if (typeof t1 !== "object" || t1 === null || !!t1.fixed$length) + H.throwExpression(new P.UnsupportedError("removeRange")); + P.RangeError_checkValidRange(i, t2, t1.length, null, null, null); + t1.splice(i, t2 - i); + return; + } }, - serializeArray$1: function(x) { - var serialized, i, t1; - serialized = []; - C.JSArray_methods.set$length(serialized, x.length); - for (i = 0; i < x.length; ++i) { - t1 = this.serialize$1(x[i]); - if (i >= serialized.length) - return H.ioore(serialized, i); - serialized[i] = t1; + setErrorsFatal$2: function(authentification, errorsAreFatal) { + if (!this.terminateCapability.$eq(0, authentification)) + return; + this.errorsAreFatal = errorsAreFatal; + }, + handlePing$3: function(responsePort, pingType, response) { + var t1 = J.getInterceptor(pingType); + if (!t1.$eq(pingType, 0)) + t1 = t1.$eq(pingType, 1) && !this._isExecutingEvent; + else + t1 = true; + if (t1) { + J.send$1$x(responsePort, response); + return; } - return serialized; + t1 = this._scheduledControlEvents; + if (t1 == null) { + t1 = P.ListQueue$(null, null); + this._scheduledControlEvents = t1; + } + t1._add$1(new H._IsolateContext_handlePing_respond(responsePort, response)); }, - serializeArrayInPlace$1: function(x) { - var i; - for (i = 0; i < x.length; ++i) - C.JSArray_methods.$indexSet(x, i, this.serialize$1(x[i])); - return x; + handleKill$2: function(authentification, priority) { + var t1; + if (!this.terminateCapability.$eq(0, authentification)) + return; + t1 = J.getInterceptor(priority); + if (!t1.$eq(priority, 0)) + t1 = t1.$eq(priority, 1) && !this._isExecutingEvent; + else + t1 = true; + if (t1) { + this.kill$0(); + return; + } + t1 = this._scheduledControlEvents; + if (t1 == null) { + t1 = P.ListQueue$(null, null); + this._scheduledControlEvents = t1; + } + t1._add$1(this.get$kill()); }, - serializeJSObject$1: function(x) { - var keys, values, i, t1; - if (!!x.constructor && x.constructor !== Object) - this.unsupported$2(x, "Only plain JS Objects are supported:"); - keys = Object.keys(x); - values = []; - C.JSArray_methods.set$length(values, keys.length); - for (i = 0; i < keys.length; ++i) { - t1 = this.serialize$1(x[keys[i]]); - if (i >= values.length) - return H.ioore(values, i); - values[i] = t1; + handleUncaughtError$2: function(error, stackTrace) { + var t1, message, t2; + t1 = this.errorPorts; + if (t1._collection$_length === 0) { + if (this.errorsAreFatal === true && this === init.globalState.rootContext) + return; + if (self.console && self.console.error) + self.console.error(error, stackTrace); + else { + P.print(error); + if (stackTrace != null) + P.print(stackTrace); + } + return; } - return ["js-object", keys, values]; + message = new Array(2); + message.fixed$length = Array; + message[0] = J.toString$0$(error); + message[1] = stackTrace == null ? null : J.toString$0$(stackTrace); + for (t2 = new P._LinkedHashSetIterator(t1, t1._collection$_modifications, null, null), t2._collection$_cell = t1._collection$_first; t2.moveNext$0();) + J.send$1$x(t2._collection$_current, message); }, - serializeWorkerSendPort$1: function(x) { - if (this._serializeSendPorts) - return ["sendport", x._workerId, x._isolateId, x._receivePortId]; - return ["raw sendport", x]; + eval$1: function(code) { + var old, result, oldIsExecutingEvent, e, s, exception, t1; + old = init.globalState.currentContext; + init.globalState.currentContext = this; + $ = this.isolateStatics; + result = null; + oldIsExecutingEvent = this._isExecutingEvent; + this._isExecutingEvent = true; + try { + result = code.call$0(); + } catch (exception) { + t1 = H.unwrapException(exception); + e = t1; + s = H.getTraceFromException(exception); + this.handleUncaughtError$2(e, s); + if (this.errorsAreFatal === true) { + this.kill$0(); + if (this === init.globalState.rootContext) + throw exception; + } + } finally { + this._isExecutingEvent = oldIsExecutingEvent; + init.globalState.currentContext = old; + if (old != null) + $ = old.get$isolateStatics(); + if (this._scheduledControlEvents != null) + for (; t1 = this._scheduledControlEvents, !t1.get$isEmpty(t1);) + this._scheduledControlEvents.removeFirst$0().call$0(); + } + return result; }, - serializeJsSendPort$1: function(x) { - if (this._serializeSendPorts) - return ["sendport", init.globalState.currentManagerId, x._isolateId, x._receivePort.get$_id()]; - return ["raw sendport", x]; - } - }, - _Deserializer: { - "^": "Object;_adjustSendPorts,deserializedObjects", - deserialize$1: [function(x) { - var serializationId, t1, result, classId, fields, emptyInstance; - if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean") - return x; - if (typeof x !== "object" || x === null || x.constructor !== Array) - throw H.wrapException(P.ArgumentError$("Bad serialized message: " + H.S(x))); - switch (C.JSArray_methods.get$first(x)) { - case "ref": - if (1 >= x.length) - return H.ioore(x, 1); - serializationId = x[1]; - t1 = this.deserializedObjects; - if (serializationId >>> 0 !== serializationId || serializationId >= t1.length) - return H.ioore(t1, serializationId); - return t1[serializationId]; - case "buffer": - if (1 >= x.length) - return H.ioore(x, 1); - result = x[1]; - this.deserializedObjects.push(result); - return result; - case "typed": - if (1 >= x.length) - return H.ioore(x, 1); - result = x[1]; - this.deserializedObjects.push(result); - return result; - case "fixed": - if (1 >= x.length) - return H.ioore(x, 1); - result = x[1]; - this.deserializedObjects.push(result); - t1 = H.setRuntimeTypeInfo(this.deserializeArrayInPlace$1(result), [null]); - t1.fixed$length = Array; - return t1; - case "extendable": - if (1 >= x.length) - return H.ioore(x, 1); - result = x[1]; - this.deserializedObjects.push(result); - return H.setRuntimeTypeInfo(this.deserializeArrayInPlace$1(result), [null]); - case "mutable": - if (1 >= x.length) - return H.ioore(x, 1); - result = x[1]; - this.deserializedObjects.push(result); - return this.deserializeArrayInPlace$1(result); - case "const": - if (1 >= x.length) - return H.ioore(x, 1); - result = x[1]; - this.deserializedObjects.push(result); - t1 = H.setRuntimeTypeInfo(this.deserializeArrayInPlace$1(result), [null]); - t1.fixed$length = Array; - return t1; - case "map": - return this.deserializeMap$1(x); - case "sendport": - return this.deserializeSendPort$1(x); - case "raw sendport": - if (1 >= x.length) - return H.ioore(x, 1); - result = x[1]; - this.deserializedObjects.push(result); - return result; - case "js-object": - return this.deserializeJSObject$1(x); - case "function": - if (1 >= x.length) - return H.ioore(x, 1); - result = init.globalFunctions[x[1]](); - this.deserializedObjects.push(result); - return result; - case "capability": - if (1 >= x.length) - return H.ioore(x, 1); - return new H.CapabilityImpl(x[1]); - case "dart": - t1 = x.length; - if (1 >= t1) - return H.ioore(x, 1); - classId = x[1]; - if (2 >= t1) - return H.ioore(x, 2); - fields = x[2]; - emptyInstance = init.instanceFromClassId(classId); - this.deserializedObjects.push(emptyInstance); - this.deserializeArrayInPlace$1(fields); - return init.initializeEmptyInstance(classId, emptyInstance, fields); - default: - throw H.wrapException("couldn't deserialize: " + H.S(x)); - } - }, "call$1", "get$deserialize", 2, 0, 0, 21], - deserializeArrayInPlace$1: function(x) { - var t1, i, t2; - t1 = J.getInterceptor$asx(x); - i = 0; - while (true) { - t2 = t1.get$length(x); - if (typeof t2 !== "number") - return H.iae(t2); - if (!(i < t2)) - break; - t1.$indexSet(x, i, this.deserialize$1(t1.$index(x, i))); - ++i; - } - return x; + lookup$1: function(portId) { + return this.ports.$index(0, portId); }, - deserializeMap$1: function(x) { - var t1, keys, values, result, t2, i; - t1 = x.length; - if (1 >= t1) - return H.ioore(x, 1); - keys = x[1]; - if (2 >= t1) - return H.ioore(x, 2); - values = x[2]; - result = P.LinkedHashMap__makeEmpty(); - this.deserializedObjects.push(result); - keys = J.map$1$ax(keys, this.get$deserialize()).toList$0(0); - for (t1 = J.getInterceptor$asx(keys), t2 = J.getInterceptor$asx(values), i = 0; i < t1.get$length(keys); ++i) - result.$indexSet(0, t1.$index(keys, i), this.deserialize$1(t2.$index(values, i))); - return result; + _addRegistration$2: function(portId, port) { + var t1 = this.ports; + if (t1.containsKey$1(portId)) + throw H.wrapException(P.Exception_Exception("Registry: ports must be registered only once.")); + t1.$indexSet(0, portId, port); }, - deserializeSendPort$1: function(x) { - var t1, managerId, isolateId, receivePortId, isolate, receivePort, result; - t1 = x.length; - if (1 >= t1) - return H.ioore(x, 1); - managerId = x[1]; - if (2 >= t1) - return H.ioore(x, 2); - isolateId = x[2]; - if (3 >= t1) - return H.ioore(x, 3); - receivePortId = x[3]; - if (J.$eq$(managerId, init.globalState.currentManagerId)) { - isolate = init.globalState.isolates.$index(0, isolateId); - if (isolate == null) - return; - receivePort = isolate.lookup$1(receivePortId); - if (receivePort == null) - return; - result = new H._NativeJsSendPort(receivePort, isolateId); - } else - result = new H._WorkerSendPort(managerId, receivePortId, isolateId); - this.deserializedObjects.push(result); - return result; + _updateGlobalState$0: function() { + var t1 = this.ports; + if (t1.get$length(t1) - this.weakPorts._collection$_length > 0 || this.isPaused || !this.initialized) + init.globalState.isolates.$indexSet(0, this.id, this); + else + this.kill$0(); }, - deserializeJSObject$1: function(x) { - var t1, keys, values, o, t2, i, t3; - t1 = x.length; - if (1 >= t1) - return H.ioore(x, 1); - keys = x[1]; - if (2 >= t1) - return H.ioore(x, 2); - values = x[2]; - o = {}; - this.deserializedObjects.push(o); - t1 = J.getInterceptor$asx(keys); - t2 = J.getInterceptor$asx(values); - i = 0; - while (true) { - t3 = t1.get$length(keys); - if (typeof t3 !== "number") - return H.iae(t3); - if (!(i < t3)) - break; - o[t1.$index(keys, i)] = this.deserialize$1(t2.$index(values, i)); - ++i; + kill$0: [function() { + var t1, t2, i, responsePort, t3; + t1 = this._scheduledControlEvents; + if (t1 != null) + t1.clear$0(0); + for (t1 = this.ports, t2 = t1.get$values(t1), t2 = t2.get$iterator(t2); t2.moveNext$0();) + t2.get$current().__isolate_helper$_close$0(); + t1.clear$0(0); + this.weakPorts.clear$0(0); + init.globalState.isolates.remove$1(0, this.id); + this.errorPorts.clear$0(0); + if (this.doneHandlers != null) { + for (i = 0; t1 = this.doneHandlers, t2 = t1.length, i < t2; i += 2) { + responsePort = t1[i]; + t3 = i + 1; + if (t3 >= t2) + return H.ioore(t1, t3); + J.send$1$x(responsePort, t1[t3]); + } + this.doneHandlers = null; } - return o; - } - } - }], ["_js_helper", "dart:_js_helper",, H, { - "^": "", - ConstantMap__throwUnmodifiable: function() { - throw H.wrapException(new P.UnsupportedError("Cannot modify unmodifiable Map")); - }, - jsConstructorNameToRti: function(constructorName) { - return init.getTypeFromName(constructorName); - }, - getType: function(index) { - return init.types[index]; - }, - isJsIndexable: function(object, record) { - var result; - if (record != null) { - result = record.x; - if (result != null) - return result; - } - return !!J.getInterceptor(object).$isJavaScriptIndexingBehavior; - }, - S: function(value) { - var res; - if (typeof value === "string") - return value; - if (typeof value === "number") { - if (value !== 0) - return "" + value; - } else if (true === value) - return "true"; - else if (false === value) - return "false"; - else if (value == null) - return "null"; - res = J.toString$0$(value); - if (typeof res !== "string") - throw H.wrapException(H.argumentErrorValue(value)); - return res; - }, - Primitives_objectHashCode: function(object) { - var hash = object.$identityHash; - if (hash == null) { - hash = Math.random() * 0x3fffffff | 0; - object.$identityHash = hash; - } - return hash; - }, - Primitives__parseIntError: function(source, handleError) { - throw H.wrapException(new P.FormatException(source, null, null)); + }, "call$0", "get$kill", 0, 0, 2] }, - Primitives_parseInt: function(source, radix, handleError) { - var match, decimalMatch, maxCharCode, digitsPart, t1, i; - H.checkString(source); - match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source); - if (match == null) - return H.Primitives__parseIntError(source, handleError); - if (3 >= match.length) - return H.ioore(match, 3); - decimalMatch = match[3]; - if (radix == null) { - if (decimalMatch != null) - return parseInt(source, 10); - if (match[2] != null) - return parseInt(source, 16); - return H.Primitives__parseIntError(source, handleError); - } - if (radix < 2 || radix > 36) - throw H.wrapException(P.RangeError$range(radix, 2, 36, "radix", null)); - if (radix === 10 && decimalMatch != null) - return parseInt(source, 10); - if (radix < 10 || decimalMatch == null) { - maxCharCode = radix <= 10 ? 47 + radix : 86 + radix; - digitsPart = match[1]; - for (t1 = digitsPart.length, i = 0; i < t1; ++i) - if ((C.JSString_methods.codeUnitAt$1(digitsPart, i) | 32) > maxCharCode) - return H.Primitives__parseIntError(source, handleError); + _IsolateContext_handlePing_respond: { + "^": "Closure:2;responsePort,response", + call$0: function() { + J.send$1$x(this.responsePort, this.response); } - return parseInt(source, radix); }, - Primitives_objectTypeName: function(object) { - var interceptor, interceptorConstructor, interceptorConstructorName, $name, dispatchName, objectConstructor, match, decompiledName; - interceptor = J.getInterceptor(object); - interceptorConstructor = interceptor.constructor; - if (typeof interceptorConstructor == "function") { - interceptorConstructorName = interceptorConstructor.name; - $name = typeof interceptorConstructorName === "string" ? interceptorConstructorName : null; - } else - $name = null; - if ($name == null || interceptor === C.Interceptor_methods || !!J.getInterceptor(object).$isUnknownJavaScriptObject) { - dispatchName = C.JS_CONST_8ZY(object); - if (dispatchName === "Object") { - objectConstructor = object.constructor; - if (typeof objectConstructor == "function") { - match = String(objectConstructor).match(/^\s*function\s*([\w$]*)\s*\(/); - decompiledName = match == null ? null : match[1]; - if (typeof decompiledName === "string" && /^\w+$/.test(decompiledName)) - $name = decompiledName; + _EventLoop: { + "^": "Object;events,_activeJsAsyncCount", + dequeue$0: function() { + var t1 = this.events; + if (t1._head === t1._tail) + return; + return t1.removeFirst$0(); + }, + runIteration$0: function() { + var $event, t1, t2; + $event = this.dequeue$0(); + if ($event == null) { + if (init.globalState.rootContext != null) + if (init.globalState.isolates.containsKey$1(init.globalState.rootContext.id)) + if (init.globalState.fromCommandLine === true) { + t1 = init.globalState.rootContext.ports; + t1 = t1.get$isEmpty(t1); + } else + t1 = false; + else + t1 = false; + else + t1 = false; + if (t1) + H.throwExpression(P.Exception_Exception("Program exited with open ReceivePorts.")); + t1 = init.globalState; + if (t1.isWorker === true) { + t2 = t1.isolates; + t2 = t2.get$isEmpty(t2) && t1.topEventLoop._activeJsAsyncCount === 0; + } else + t2 = false; + if (t2) { + t1 = t1.mainManager; + t2 = P.LinkedHashMap__makeLiteral(["command", "close"]); + t2 = new H._Serializer(true, H.setRuntimeTypeInfo(new P._LinkedIdentityHashMap(0, null, null, null, null, null, 0), [null, P.$int])).serialize$1(t2); + t1.toString; + self.postMessage(t2); } - if ($name == null) - $name = dispatchName; - } else - $name = dispatchName; - } - $name = $name; - if ($name.length > 1 && C.JSString_methods.codeUnitAt$1($name, 0) === 36) - $name = C.JSString_methods.substring$1($name, 1); - return function(str, names) { - return str.replace(/[^<,> ]+/g, function(m) { - return names[m] || m; - }); - }($name + H.joinArguments(H.getRuntimeTypeInfo(object), 0, null), init.mangledGlobalNames); - }, - Primitives_objectToHumanReadableString: function(object) { - return "Instance of '" + H.Primitives_objectTypeName(object) + "'"; - }, - Primitives_currentUri: function() { - if (!!self.location) - return self.location.href; - return; + return false; + } + $event.process$0(); + return true; + }, + _runHelper$0: function() { + if (self.window != null) + new H._EventLoop__runHelper_next(this).call$0(); + else + for (; this.runIteration$0();) + ; + }, + run$0: [function() { + var e, trace, exception, t1, t2; + if (init.globalState.isWorker !== true) + this._runHelper$0(); + else + try { + this._runHelper$0(); + } catch (exception) { + t1 = H.unwrapException(exception); + e = t1; + trace = H.getTraceFromException(exception); + t1 = init.globalState.mainManager; + t2 = P.LinkedHashMap__makeLiteral(["command", "error", "msg", H.S(e) + "\n" + H.S(trace)]); + t2 = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t2); + t1.toString; + self.postMessage(t2); + } + }, "call$0", "get$run", 0, 0, 2] }, - Primitives__fromCharCodeApply: function(array) { - var end, result, i, i0, chunkEnd; - end = array.length; - if (end <= 500) - return String.fromCharCode.apply(null, array); - for (result = "", i = 0; i < end; i = i0) { - i0 = i + 500; - chunkEnd = i0 < end ? i0 : end; - result += String.fromCharCode.apply(null, array.slice(i, chunkEnd)); + _EventLoop__runHelper_next: { + "^": "Closure:2;$this", + call$0: function() { + if (!this.$this.runIteration$0()) + return; + P.Timer_Timer(C.Duration_0, this); } - return result; }, - Primitives_stringFromCodePoints: function(codePoints) { - var a, t1, _i, i; - a = H.setRuntimeTypeInfo([], [P.$int]); - for (t1 = codePoints.length, _i = 0; _i < codePoints.length; codePoints.length === t1 || (0, H.throwConcurrentModificationError)(codePoints), ++_i) { - i = codePoints[_i]; - if (typeof i !== "number" || Math.floor(i) !== i) - throw H.wrapException(H.argumentErrorValue(i)); - if (i <= 65535) - a.push(i); - else if (i <= 1114111) { - a.push(55296 + (C.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); - a.push(56320 + (i & 1023)); - } else - throw H.wrapException(H.argumentErrorValue(i)); + _IsolateEvent: { + "^": "Object;isolate,fn,message>", + process$0: function() { + var t1 = this.isolate; + if (t1.isPaused) { + t1.delayedEvents.push(this); + return; + } + t1.eval$1(this.fn); } - return H.Primitives__fromCharCodeApply(a); }, - Primitives_stringFromCharCodes: function(charCodes) { - var t1, _i, t2, i; - for (t1 = charCodes.length, _i = 0; t2 = charCodes.length, _i < t2; t2 === t1 || (0, H.throwConcurrentModificationError)(charCodes), ++_i) { - i = charCodes[_i]; - if (typeof i !== "number" || Math.floor(i) !== i) - throw H.wrapException(H.argumentErrorValue(i)); - if (i < 0) - throw H.wrapException(H.argumentErrorValue(i)); - if (i > 65535) - return H.Primitives_stringFromCodePoints(charCodes); - } - return H.Primitives__fromCharCodeApply(charCodes); + _MainManagerStub: { + "^": "Object;" }, - Primitives_stringFromNativeUint8List: function(charCodes, start, end) { - var i, result, i0, chunkEnd; - if (J.$le$n(end, 500) && start === 0 && end === charCodes.length) - return String.fromCharCode.apply(null, charCodes); - if (typeof end !== "number") - return H.iae(end); - i = start; - result = ""; - for (; i < end; i = i0) { - i0 = i + 500; - if (i0 < end) - chunkEnd = i0; - else - chunkEnd = end; - result += String.fromCharCode.apply(null, charCodes.subarray(i, chunkEnd)); + IsolateNatives__processWorkerMessage_closure: { + "^": "Closure:1;entryPoint,args,message,isSpawnUri,startPaused,replyTo", + call$0: function() { + H.IsolateNatives__startIsolate(this.entryPoint, this.args, this.message, this.isSpawnUri, this.startPaused, this.replyTo); } - return result; }, - Primitives_stringFromCharCode: function(charCode) { - var bits; - if (typeof charCode !== "number") - return H.iae(charCode); - if (0 <= charCode) { - if (charCode <= 65535) - return String.fromCharCode(charCode); - if (charCode <= 1114111) { - bits = charCode - 65536; - return String.fromCharCode((55296 | C.JSInt_methods._shrOtherPositive$1(bits, 10)) >>> 0, 56320 | bits & 1023); + IsolateNatives__startIsolate_runStartFunction: { + "^": "Closure:2;topLevel,args,message,isSpawnUri,context", + call$0: function() { + var t1, t2, t3, t4; + t1 = this.context; + t1.initialized = true; + if (this.isSpawnUri !== true) + this.topLevel.call$1(this.message); + else { + t2 = this.topLevel; + t3 = H.getDynamicRuntimeType(); + t4 = H.buildFunctionType(t3, [t3, t3])._isTest$1(t2); + if (t4) + t2.call$2(this.args, this.message); + else { + t3 = H.buildFunctionType(t3, [t3])._isTest$1(t2); + if (t3) + t2.call$1(this.args); + else + t2.call$0(); + } } + t1._updateGlobalState$0(); } - throw H.wrapException(P.RangeError$range(charCode, 0, 1114111, null, null)); }, - Primitives_lazyAsJsDate: function(receiver) { - if (receiver.date === void 0) - receiver.date = new Date(receiver._core$_value); - return receiver.date; + _BaseSendPort: { + "^": "Object;" }, - Primitives_getProperty: function(object, key) { - if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string") - throw H.wrapException(H.argumentErrorValue(object)); - return object[key]; + _NativeJsSendPort: { + "^": "_BaseSendPort;_receivePort,_isolateId", + send$1: function(_, message) { + var isolate, t1, msg; + isolate = init.globalState.isolates.$index(0, this._isolateId); + if (isolate == null) + return; + t1 = this._receivePort; + if (t1.get$_isClosed()) + return; + msg = H._clone(message); + if (isolate.get$controlPort() === t1) { + t1 = J.getInterceptor$asx(msg); + switch (t1.$index(msg, 0)) { + case "pause": + isolate.addPause$2(t1.$index(msg, 1), t1.$index(msg, 2)); + break; + case "resume": + isolate.removePause$1(t1.$index(msg, 1)); + break; + case "add-ondone": + isolate.addDoneListener$2(t1.$index(msg, 1), t1.$index(msg, 2)); + break; + case "remove-ondone": + isolate.removeDoneListener$1(t1.$index(msg, 1)); + break; + case "set-errors-fatal": + isolate.setErrorsFatal$2(t1.$index(msg, 1), t1.$index(msg, 2)); + break; + case "ping": + isolate.handlePing$3(t1.$index(msg, 1), t1.$index(msg, 2), t1.$index(msg, 3)); + break; + case "kill": + isolate.handleKill$2(t1.$index(msg, 1), t1.$index(msg, 2)); + break; + case "getErrors": + t1 = t1.$index(msg, 1); + isolate.errorPorts.add$1(0, t1); + break; + case "stopErrors": + t1 = t1.$index(msg, 1); + isolate.errorPorts.remove$1(0, t1); + break; + } + return; + } + init.globalState.topEventLoop.events._add$1(new H._IsolateEvent(isolate, new H._NativeJsSendPort_send_closure(this, msg), "receive")); + }, + $eq: function(_, other) { + if (other == null) + return false; + return other instanceof H._NativeJsSendPort && J.$eq$(this._receivePort, other._receivePort); + }, + get$hashCode: function(_) { + return this._receivePort.get$_id(); + } }, - Primitives_setProperty: function(object, key, value) { - if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string") - throw H.wrapException(H.argumentErrorValue(object)); - object[key] = value; + _NativeJsSendPort_send_closure: { + "^": "Closure:1;$this,msg", + call$0: function() { + var t1 = this.$this._receivePort; + if (!t1.get$_isClosed()) + t1.__isolate_helper$_add$1(this.msg); + } }, - Primitives_functionNoSuchMethod: function($function, positionalArguments, namedArguments) { - var t1, $arguments, namedArgumentList; - t1 = {}; - t1.argumentCount = 0; - $arguments = []; - namedArgumentList = []; - t1.argumentCount = positionalArguments.length; - C.JSArray_methods.addAll$1($arguments, positionalArguments); - t1.names = ""; - if (namedArguments != null && !namedArguments.get$isEmpty(namedArguments)) - namedArguments.forEach$1(0, new H.Primitives_functionNoSuchMethod_closure(t1, $arguments, namedArgumentList)); - return J.noSuchMethod$1$($function, new H.JSInvocationMirror(C.Symbol_call, "call" + "$" + t1.argumentCount + t1.names, 0, $arguments, namedArgumentList, null)); - }, - Primitives_applyFunctionWithPositionalArguments: function($function, positionalArguments) { - var $arguments, t1; - $arguments = positionalArguments instanceof Array ? positionalArguments : P.List_List$from(positionalArguments, true, null); - t1 = $arguments.length; - if (t1 === 0) { - if (!!$function.call$0) - return $function.call$0(); - } else if (t1 === 1) { - if (!!$function.call$1) - return $function.call$1($arguments[0]); - } else if (t1 === 2) { - if (!!$function.call$2) - return $function.call$2($arguments[0], $arguments[1]); - } else if (t1 === 3) { - if (!!$function.call$3) - return $function.call$3($arguments[0], $arguments[1], $arguments[2]); - } else if (t1 === 4) { - if (!!$function.call$4) - return $function.call$4($arguments[0], $arguments[1], $arguments[2], $arguments[3]); - } else if (t1 === 5) - if (!!$function.call$5) - return $function.call$5($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4]); - return H.Primitives__genericApplyFunctionWithPositionalArguments($function, $arguments); - }, - Primitives__genericApplyFunctionWithPositionalArguments: function($function, $arguments) { - var argumentCount, jsFunction, info, requiredArgumentCount, maxArgumentCount, pos; - argumentCount = $arguments.length; - jsFunction = $function["call" + "$" + argumentCount]; - if (jsFunction == null) { - jsFunction = J.getInterceptor($function)["call*"]; - if (jsFunction == null) - return H.Primitives_functionNoSuchMethod($function, $arguments, null); - info = H.ReflectionInfo_ReflectionInfo(jsFunction); - requiredArgumentCount = info.requiredParameterCount; - maxArgumentCount = requiredArgumentCount + info.optionalParameterCount; - if (info.areOptionalParametersNamed || requiredArgumentCount > argumentCount || maxArgumentCount < argumentCount) - return H.Primitives_functionNoSuchMethod($function, $arguments, null); - $arguments = P.List_List$from($arguments, true, null); - for (pos = argumentCount; pos < maxArgumentCount; ++pos) - C.JSArray_methods.add$1($arguments, init.metadata[info.defaultValue$1(0, pos)]); - } - return jsFunction.apply($function, $arguments); - }, - iae: function(argument) { - throw H.wrapException(H.argumentErrorValue(argument)); - }, - ioore: function(receiver, index) { - if (receiver == null) - J.get$length$asx(receiver); - throw H.wrapException(H.diagnoseIndexError(receiver, index)); - }, - diagnoseIndexError: function(indexable, index) { - var $length, t1; - if (typeof index !== "number" || Math.floor(index) !== index) - return new P.ArgumentError(true, index, "index", null); - $length = J.get$length$asx(indexable); - if (!(index < 0)) { - if (typeof $length !== "number") - return H.iae($length); - t1 = index >= $length; - } else - t1 = true; - if (t1) - return P.IndexError$(index, indexable, "index", null, $length); - return P.RangeError$value(index, "index", null); - }, - diagnoseRangeError: function(start, end, $length) { - if (start > $length) - return new P.RangeError(0, $length, true, start, "start", "Invalid value"); - if (end != null) - if (end < start || end > $length) - return new P.RangeError(start, $length, true, end, "end", "Invalid value"); - return new P.ArgumentError(true, end, "end", null); - }, - argumentErrorValue: function(object) { - return new P.ArgumentError(true, object, null, null); - }, - checkInt: function(value) { - if (typeof value !== "number" || Math.floor(value) !== value) - throw H.wrapException(H.argumentErrorValue(value)); - return value; + _WorkerSendPort: { + "^": "_BaseSendPort;_workerId,_receivePortId,_isolateId", + send$1: function(_, message) { + var t1, workerMessage, manager; + t1 = P.LinkedHashMap__makeLiteral(["command", "message", "port", this, "msg", message]); + workerMessage = new H._Serializer(true, P._LinkedIdentityHashMap__LinkedIdentityHashMap$es6(null, P.$int)).serialize$1(t1); + if (init.globalState.isWorker === true) { + init.globalState.mainManager.toString; + self.postMessage(workerMessage); + } else { + manager = init.globalState.managers.$index(0, this._workerId); + if (manager != null) + manager.postMessage(workerMessage); + } + }, + $eq: function(_, other) { + if (other == null) + return false; + return other instanceof H._WorkerSendPort && J.$eq$(this._workerId, other._workerId) && J.$eq$(this._isolateId, other._isolateId) && J.$eq$(this._receivePortId, other._receivePortId); + }, + get$hashCode: function(_) { + var t1, t2, t3; + t1 = this._workerId; + if (typeof t1 !== "number") + return t1.$shl(); + t2 = this._isolateId; + if (typeof t2 !== "number") + return t2.$shl(); + t3 = this._receivePortId; + if (typeof t3 !== "number") + return H.iae(t3); + return (t1 << 16 ^ t2 << 8 ^ t3) >>> 0; + } }, - checkString: function(value) { - if (typeof value !== "string") - throw H.wrapException(H.argumentErrorValue(value)); - return value; + RawReceivePortImpl: { + "^": "Object;_id<,_handler,_isClosed<", + __isolate_helper$_close$0: function() { + this._isClosed = true; + this._handler = null; + }, + __isolate_helper$_add$1: function(dataEvent) { + if (this._isClosed) + return; + this._handler.call$1(dataEvent); + }, + $isRawReceivePort: 1 }, - wrapException: function(ex) { - var wrapper; - if (ex == null) - ex = new P.NullThrownError(); - wrapper = new Error(); - wrapper.dartException = ex; - if ("defineProperty" in Object) { - Object.defineProperty(wrapper, "message", {get: H.toStringWrapper}); - wrapper.name = ""; - } else - wrapper.toString = H.toStringWrapper; - return wrapper; + TimerImpl: { + "^": "Object;_once,_inEventLoop,_handle", + TimerImpl$periodic$2: function(milliseconds, callback) { + if (self.setTimeout != null) { + ++init.globalState.topEventLoop._activeJsAsyncCount; + this._handle = self.setInterval(H.convertDartClosureToJS(new H.TimerImpl$periodic_closure(this, callback), 0), milliseconds); + } else + throw H.wrapException(new P.UnsupportedError("Periodic timer.")); + }, + TimerImpl$2: function(milliseconds, callback) { + var t1, t2; + if (milliseconds === 0) + t1 = self.setTimeout == null || init.globalState.isWorker === true; + else + t1 = false; + if (t1) { + this._handle = 1; + t1 = init.globalState.topEventLoop; + t2 = init.globalState.currentContext; + t1.events._add$1(new H._IsolateEvent(t2, new H.TimerImpl_internalCallback(this, callback), "timer")); + this._inEventLoop = true; + } else if (self.setTimeout != null) { + ++init.globalState.topEventLoop._activeJsAsyncCount; + this._handle = self.setTimeout(H.convertDartClosureToJS(new H.TimerImpl_internalCallback0(this, callback), 0), milliseconds); + } else + throw H.wrapException(new P.UnsupportedError("Timer greater than 0.")); + }, + static: { + TimerImpl$: function(milliseconds, callback) { + var t1 = new H.TimerImpl(true, false, null); + t1.TimerImpl$2(milliseconds, callback); + return t1; + }, + TimerImpl$periodic: function(milliseconds, callback) { + var t1 = new H.TimerImpl(false, false, null); + t1.TimerImpl$periodic$2(milliseconds, callback); + return t1; + } + } }, - toStringWrapper: [function() { - return J.toString$0$(this.dartException); - }, null, null, 0, 0, null], - throwExpression: function(ex) { - throw H.wrapException(ex); + TimerImpl_internalCallback: { + "^": "Closure:2;$this,callback", + call$0: function() { + this.$this._handle = null; + this.callback.call$0(); + } }, - throwConcurrentModificationError: function(collection) { - throw H.wrapException(new P.ConcurrentModificationError(collection)); + TimerImpl_internalCallback0: { + "^": "Closure:2;$this,callback", + call$0: function() { + this.$this._handle = null; + --init.globalState.topEventLoop._activeJsAsyncCount; + this.callback.call$0(); + } }, - unwrapException: function(ex) { - var t1, message, number, ieErrorCode, t2, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match; - t1 = new H.unwrapException_saveStackTrace(ex); - if (ex == null) - return; - if (ex instanceof H.ExceptionAndStackTrace) - return t1.call$1(ex.dartException); - if (typeof ex !== "object") - return ex; - if ("dartException" in ex) - return t1.call$1(ex.dartException); - else if (!("message" in ex)) - return ex; - message = ex.message; - if ("number" in ex && typeof ex.number == "number") { - number = ex.number; - ieErrorCode = number & 65535; - if ((C.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) - switch (ieErrorCode) { - case 438: - return t1.call$1(H.JsNoSuchMethodError$(H.S(message) + " (Error " + ieErrorCode + ")", null)); - case 445: - case 5007: - t2 = H.S(message) + " (Error " + ieErrorCode + ")"; - return t1.call$1(new H.NullError(t2, null)); - } + TimerImpl$periodic_closure: { + "^": "Closure:1;$this,callback", + call$0: function() { + this.callback.call$1(this.$this); } - if (ex instanceof TypeError) { - nsme = $.$get$TypeErrorDecoder_noSuchMethodPattern(); - notClosure = $.$get$TypeErrorDecoder_notClosurePattern(); - nullCall = $.$get$TypeErrorDecoder_nullCallPattern(); - nullLiteralCall = $.$get$TypeErrorDecoder_nullLiteralCallPattern(); - undefCall = $.$get$TypeErrorDecoder_undefinedCallPattern(); - undefLiteralCall = $.$get$TypeErrorDecoder_undefinedLiteralCallPattern(); - nullProperty = $.$get$TypeErrorDecoder_nullPropertyPattern(); - $.$get$TypeErrorDecoder_nullLiteralPropertyPattern(); - undefProperty = $.$get$TypeErrorDecoder_undefinedPropertyPattern(); - undefLiteralProperty = $.$get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); - match = nsme.matchTypeError$1(message); - if (match != null) - return t1.call$1(H.JsNoSuchMethodError$(message, match)); - else { - match = notClosure.matchTypeError$1(message); - if (match != null) { - match.method = "call"; - return t1.call$1(H.JsNoSuchMethodError$(message, match)); - } else { - match = nullCall.matchTypeError$1(message); - if (match == null) { - match = nullLiteralCall.matchTypeError$1(message); - if (match == null) { - match = undefCall.matchTypeError$1(message); - if (match == null) { - match = undefLiteralCall.matchTypeError$1(message); - if (match == null) { - match = nullProperty.matchTypeError$1(message); - if (match == null) { - match = nullLiteralCall.matchTypeError$1(message); - if (match == null) { - match = undefProperty.matchTypeError$1(message); - if (match == null) { - match = undefLiteralProperty.matchTypeError$1(message); - t2 = match != null; - } else - t2 = true; - } else - t2 = true; - } else - t2 = true; - } else - t2 = true; - } else - t2 = true; - } else - t2 = true; - } else - t2 = true; - if (t2) - return t1.call$1(new H.NullError(message, match == null ? null : match.method)); - } + }, + CapabilityImpl: { + "^": "Object;_id<", + get$hashCode: function(_) { + var hash = this._id; + if (typeof hash !== "number") + return hash.$shr(); + hash = C.JSNumber_methods._shrOtherPositive$1(hash, 0) ^ C.JSNumber_methods._tdivFast$1(hash, 4294967296); + hash = (~hash >>> 0) + (hash << 15 >>> 0) & 4294967295; + hash = ((hash ^ hash >>> 12) >>> 0) * 5 & 4294967295; + hash = ((hash ^ hash >>> 4) >>> 0) * 2057 & 4294967295; + return (hash ^ hash >>> 16) >>> 0; + }, + $eq: function(_, other) { + var t1, t2; + if (other == null) + return false; + if (other === this) + return true; + if (other instanceof H.CapabilityImpl) { + t1 = this._id; + t2 = other._id; + return t1 == null ? t2 == null : t1 === t2; } - return t1.call$1(new H.UnknownJsTypeError(typeof message === "string" ? message : "")); + return false; } - if (ex instanceof RangeError) { - if (typeof message === "string" && message.indexOf("call stack") !== -1) - return new P.StackOverflowError(); - message = function(ex) { - try { - return String(ex); - } catch (e) { - } - return null; - }(ex); - return t1.call$1(new P.ArgumentError(false, null, null, typeof message === "string" ? message.replace(/^RangeError:\s*/, "") : message)); - } - if (typeof InternalError == "function" && ex instanceof InternalError) - if (typeof message === "string" && message === "too much recursion") - return new P.StackOverflowError(); - return ex; - }, - getTraceFromException: function(exception) { - var trace; - if (exception instanceof H.ExceptionAndStackTrace) - return exception.stackTrace; - if (exception == null) - return new H._StackTrace(exception, null); - trace = exception.$cachedTrace; - if (trace != null) - return trace; - return exception.$cachedTrace = new H._StackTrace(exception, null); - }, - objectHashCode: function(object) { - if (object == null || typeof object != 'object') - return J.get$hashCode$(object); - else - return H.Primitives_objectHashCode(object); - }, - fillLiteralMap: function(keyValuePairs, result) { - var $length, index, index0, index1; - $length = keyValuePairs.length; - for (index = 0; index < $length; index = index1) { - index0 = index + 1; - index1 = index0 + 1; - result.$indexSet(0, keyValuePairs[index], keyValuePairs[index0]); - } - return result; - }, - invokeClosure: [function(closure, isolate, numberOfArguments, arg1, arg2, arg3, arg4) { - switch (numberOfArguments) { - case 0: - return H._callInIsolate(isolate, new H.invokeClosure_closure(closure)); - case 1: - return H._callInIsolate(isolate, new H.invokeClosure_closure0(closure, arg1)); - case 2: - return H._callInIsolate(isolate, new H.invokeClosure_closure1(closure, arg1, arg2)); - case 3: - return H._callInIsolate(isolate, new H.invokeClosure_closure2(closure, arg1, arg2, arg3)); - case 4: - return H._callInIsolate(isolate, new H.invokeClosure_closure3(closure, arg1, arg2, arg3, arg4)); - } - throw H.wrapException(P.Exception_Exception("Unsupported number of arguments for wrapped closure")); - }, null, null, 14, 0, null, 30, 29, 28, 23, 19, 27, 26], - convertDartClosureToJS: function(closure, arity) { - var $function; - if (closure == null) - return; - $function = closure.$identity; - if (!!$function) - return $function; - $function = function(closure, arity, context, invoke) { - return function(a1, a2, a3, a4) { - return invoke(closure, context, arity, a1, a2, a3, a4); - }; - }(closure, arity, init.globalState.currentContext, H.invokeClosure); - closure.$identity = $function; - return $function; }, - Closure_fromTearOff: function(receiver, functions, reflectionInfo, isStatic, jsArguments, propertyName) { - var $function, callName, functionType, $prototype, $constructor, t1, isIntercepted, trampoline, signatureFunction, getReceiver, i, stub, stubCallName, t2; - $function = functions[0]; - callName = $function.$callName; - if (!!J.getInterceptor(reflectionInfo).$isList) { - $function.$reflectionInfo = reflectionInfo; - functionType = H.ReflectionInfo_ReflectionInfo($function).functionType; - } else - functionType = reflectionInfo; - $prototype = isStatic ? Object.create(new H.StaticClosure().constructor.prototype) : Object.create(new H.BoundClosure(null, null, null, null).constructor.prototype); - $prototype.$initialize = $prototype.constructor; - if (isStatic) - $constructor = function() { - this.$initialize(); - }; - else { - t1 = $.Closure_functionCounter; - $.Closure_functionCounter = J.$add$ns(t1, 1); - t1 = new Function("a,b,c,d" + t1, "this.$initialize(a,b,c,d" + t1 + ")"); - $constructor = t1; - } - $prototype.constructor = $constructor; - $constructor.prototype = $prototype; - t1 = !isStatic; - if (t1) { - isIntercepted = jsArguments.length == 1 && true; - trampoline = H.Closure_forwardCallTo(receiver, $function, isIntercepted); - trampoline.$reflectionInfo = reflectionInfo; - } else { - $prototype.$static_name = propertyName; - trampoline = $function; - isIntercepted = false; - } - if (typeof functionType == "number") - signatureFunction = function(getType, t) { - return function() { - return getType(t); - }; - }(H.getType, functionType); - else if (t1 && typeof functionType == "function") { - getReceiver = isIntercepted ? H.BoundClosure_receiverOf : H.BoundClosure_selfOf; - signatureFunction = function(f, r) { - return function() { - return f.apply({$receiver: r(this)}, arguments); - }; - }(functionType, getReceiver); - } else - throw H.wrapException("Error in reflectionInfo."); - $prototype.$signature = signatureFunction; - $prototype[callName] = trampoline; - for (t1 = functions.length, i = 1; i < t1; ++i) { - stub = functions[i]; - stubCallName = stub.$callName; - if (stubCallName != null) { - t2 = isStatic ? stub : H.Closure_forwardCallTo(receiver, stub, isIntercepted); - $prototype[stubCallName] = t2; + _Serializer: { + "^": "Object;_serializeSendPorts,serializedObjectIds", + serialize$1: [function(x) { + var t1, serializationId, serializeTearOff, t2, $name; + if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean") + return x; + t1 = this.serializedObjectIds; + serializationId = t1.$index(0, x); + if (serializationId != null) + return ["ref", serializationId]; + t1.$indexSet(0, x, t1.get$length(t1)); + t1 = J.getInterceptor(x); + if (!!t1.$isNativeByteBuffer) + return ["buffer", x]; + if (!!t1.$isNativeTypedData) + return ["typed", x]; + if (!!t1.$isJSIndexable) + return this.serializeJSIndexable$1(x); + if (!!t1.$isInternalMap) { + serializeTearOff = this.get$serialize(); + t2 = x.get$keys(); + t2 = H.MappedIterable_MappedIterable(t2, serializeTearOff, H.getRuntimeTypeArgument(t2, "Iterable", 0), null); + t2 = P.List_List$from(t2, true, H.getRuntimeTypeArgument(t2, "Iterable", 0)); + t1 = t1.get$values(x); + t1 = H.MappedIterable_MappedIterable(t1, serializeTearOff, H.getRuntimeTypeArgument(t1, "Iterable", 0), null); + return ["map", t2, P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "Iterable", 0))]; + } + if (!!t1.$isJSObject) + return this.serializeJSObject$1(x); + if (!!t1.$isInterceptor) + this.unsupported$1(x); + if (!!t1.$isRawReceivePort) + this.unsupported$2(x, "RawReceivePorts can't be transmitted:"); + if (!!t1.$is_NativeJsSendPort) + return this.serializeJsSendPort$1(x); + if (!!t1.$is_WorkerSendPort) + return this.serializeWorkerSendPort$1(x); + if (!!t1.$isClosure) { + $name = x.$static_name; + if ($name == null) + this.unsupported$2(x, "Closures can't be transmitted:"); + return ["function", $name]; + } + if (!!t1.$isCapabilityImpl) + return ["capability", x._id]; + if (!(x instanceof P.Object)) + this.unsupported$1(x); + return ["dart", init.classIdExtractor(x), this.serializeArrayInPlace$1(init.classFieldsExtractor(x))]; + }, "call$1", "get$serialize", 2, 0, 0], + unsupported$2: function(x, message) { + throw H.wrapException(new P.UnsupportedError(H.S(message == null ? "Can't transmit:" : message) + " " + H.S(x))); + }, + unsupported$1: function(x) { + return this.unsupported$2(x, null); + }, + serializeJSIndexable$1: function(indexable) { + var serialized = this.serializeArray$1(indexable); + if (!!indexable.fixed$length) + return ["fixed", serialized]; + if (!indexable.fixed$length) + return ["extendable", serialized]; + if (!indexable.immutable$list) + return ["mutable", serialized]; + if (indexable.constructor === Array) + return ["const", serialized]; + this.unsupported$2(indexable, "Can't serialize indexable: "); + }, + serializeArray$1: function(x) { + var serialized, i, t1; + serialized = []; + C.JSArray_methods.set$length(serialized, x.length); + for (i = 0; i < x.length; ++i) { + t1 = this.serialize$1(x[i]); + if (i >= serialized.length) + return H.ioore(serialized, i); + serialized[i] = t1; + } + return serialized; + }, + serializeArrayInPlace$1: function(x) { + var i; + for (i = 0; i < x.length; ++i) + C.JSArray_methods.$indexSet(x, i, this.serialize$1(x[i])); + return x; + }, + serializeJSObject$1: function(x) { + var keys, values, i, t1; + if (!!x.constructor && x.constructor !== Object) + this.unsupported$2(x, "Only plain JS Objects are supported:"); + keys = Object.keys(x); + values = []; + C.JSArray_methods.set$length(values, keys.length); + for (i = 0; i < keys.length; ++i) { + t1 = this.serialize$1(x[keys[i]]); + if (i >= values.length) + return H.ioore(values, i); + values[i] = t1; } + return ["js-object", keys, values]; + }, + serializeWorkerSendPort$1: function(x) { + if (this._serializeSendPorts) + return ["sendport", x._workerId, x._isolateId, x._receivePortId]; + return ["raw sendport", x]; + }, + serializeJsSendPort$1: function(x) { + if (this._serializeSendPorts) + return ["sendport", init.globalState.currentManagerId, x._isolateId, x._receivePort.get$_id()]; + return ["raw sendport", x]; } - $prototype["call*"] = trampoline; - $prototype.$requiredArgCount = $function.$requiredArgCount; - $prototype.$defaultValues = $function.$defaultValues; - return $constructor; }, - Closure_cspForwardCall: function(arity, isSuperCall, stubName, $function) { - var getSelf = H.BoundClosure_selfOf; - switch (isSuperCall ? -1 : arity) { - case 0: - return function(n, S) { - return function() { - return S(this)[n](); - }; - }(stubName, getSelf); - case 1: - return function(n, S) { - return function(a) { - return S(this)[n](a); - }; - }(stubName, getSelf); - case 2: - return function(n, S) { - return function(a, b) { - return S(this)[n](a, b); - }; - }(stubName, getSelf); - case 3: - return function(n, S) { - return function(a, b, c) { - return S(this)[n](a, b, c); - }; - }(stubName, getSelf); - case 4: - return function(n, S) { - return function(a, b, c, d) { - return S(this)[n](a, b, c, d); - }; - }(stubName, getSelf); - case 5: - return function(n, S) { - return function(a, b, c, d, e) { - return S(this)[n](a, b, c, d, e); - }; - }(stubName, getSelf); - default: - return function(f, s) { - return function() { - return f.apply(s(this), arguments); - }; - }($function, getSelf); - } - }, - Closure_forwardCallTo: function(receiver, $function, isIntercepted) { - var stubName, arity, lookedUpFunction, t1, t2, selfName, $arguments; - if (isIntercepted) - return H.Closure_forwardInterceptedCallTo(receiver, $function); - stubName = $function.$stubName; - arity = $function.length; - lookedUpFunction = receiver[stubName]; - t1 = $function == null ? lookedUpFunction == null : $function === lookedUpFunction; - t2 = !t1 || arity >= 27; - if (t2) - return H.Closure_cspForwardCall(arity, !t1, stubName, $function); - if (arity === 0) { - t1 = $.Closure_functionCounter; - $.Closure_functionCounter = J.$add$ns(t1, 1); - selfName = "self" + H.S(t1); - t1 = "return function(){var " + selfName + " = this."; - t2 = $.BoundClosure_selfFieldNameCache; - if (t2 == null) { - t2 = H.BoundClosure_computeFieldNamed("self"); - $.BoundClosure_selfFieldNameCache = t2; + _Deserializer: { + "^": "Object;_adjustSendPorts,deserializedObjects", + deserialize$1: [function(x) { + var serializationId, t1, result, classId, fields, emptyInstance; + if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean") + return x; + if (typeof x !== "object" || x === null || x.constructor !== Array) + throw H.wrapException(P.ArgumentError$("Bad serialized message: " + H.S(x))); + switch (C.JSArray_methods.get$first(x)) { + case "ref": + if (1 >= x.length) + return H.ioore(x, 1); + serializationId = x[1]; + t1 = this.deserializedObjects; + if (serializationId >>> 0 !== serializationId || serializationId >= t1.length) + return H.ioore(t1, serializationId); + return t1[serializationId]; + case "buffer": + if (1 >= x.length) + return H.ioore(x, 1); + result = x[1]; + this.deserializedObjects.push(result); + return result; + case "typed": + if (1 >= x.length) + return H.ioore(x, 1); + result = x[1]; + this.deserializedObjects.push(result); + return result; + case "fixed": + if (1 >= x.length) + return H.ioore(x, 1); + result = x[1]; + this.deserializedObjects.push(result); + t1 = H.setRuntimeTypeInfo(this.deserializeArrayInPlace$1(result), [null]); + t1.fixed$length = Array; + return t1; + case "extendable": + if (1 >= x.length) + return H.ioore(x, 1); + result = x[1]; + this.deserializedObjects.push(result); + return H.setRuntimeTypeInfo(this.deserializeArrayInPlace$1(result), [null]); + case "mutable": + if (1 >= x.length) + return H.ioore(x, 1); + result = x[1]; + this.deserializedObjects.push(result); + return this.deserializeArrayInPlace$1(result); + case "const": + if (1 >= x.length) + return H.ioore(x, 1); + result = x[1]; + this.deserializedObjects.push(result); + t1 = H.setRuntimeTypeInfo(this.deserializeArrayInPlace$1(result), [null]); + t1.fixed$length = Array; + return t1; + case "map": + return this.deserializeMap$1(x); + case "sendport": + return this.deserializeSendPort$1(x); + case "raw sendport": + if (1 >= x.length) + return H.ioore(x, 1); + result = x[1]; + this.deserializedObjects.push(result); + return result; + case "js-object": + return this.deserializeJSObject$1(x); + case "function": + if (1 >= x.length) + return H.ioore(x, 1); + result = init.globalFunctions[x[1]](); + this.deserializedObjects.push(result); + return result; + case "capability": + if (1 >= x.length) + return H.ioore(x, 1); + return new H.CapabilityImpl(x[1]); + case "dart": + t1 = x.length; + if (1 >= t1) + return H.ioore(x, 1); + classId = x[1]; + if (2 >= t1) + return H.ioore(x, 2); + fields = x[2]; + emptyInstance = init.instanceFromClassId(classId); + this.deserializedObjects.push(emptyInstance); + this.deserializeArrayInPlace$1(fields); + return init.initializeEmptyInstance(classId, emptyInstance, fields); + default: + throw H.wrapException("couldn't deserialize: " + H.S(x)); } - return new Function(t1 + H.S(t2) + ";return " + selfName + "." + H.S(stubName) + "();}")(); + }, "call$1", "get$deserialize", 2, 0, 0], + deserializeArrayInPlace$1: function(x) { + var t1, i, t2; + t1 = J.getInterceptor$asx(x); + i = 0; + while (true) { + t2 = t1.get$length(x); + if (typeof t2 !== "number") + return H.iae(t2); + if (!(i < t2)) + break; + t1.$indexSet(x, i, this.deserialize$1(t1.$index(x, i))); + ++i; + } + return x; + }, + deserializeMap$1: function(x) { + var t1, keys, values, result, t2, i; + t1 = x.length; + if (1 >= t1) + return H.ioore(x, 1); + keys = x[1]; + if (2 >= t1) + return H.ioore(x, 2); + values = x[2]; + result = P.LinkedHashMap__makeEmpty(); + this.deserializedObjects.push(result); + keys = J.map$1$ax(keys, this.get$deserialize()).toList$0(0); + for (t1 = J.getInterceptor$asx(keys), t2 = J.getInterceptor$asx(values), i = 0; i < t1.get$length(keys); ++i) { + if (i >= keys.length) + return H.ioore(keys, i); + result.$indexSet(0, keys[i], this.deserialize$1(t2.$index(values, i))); + } + return result; + }, + deserializeSendPort$1: function(x) { + var t1, managerId, isolateId, receivePortId, isolate, receivePort, result; + t1 = x.length; + if (1 >= t1) + return H.ioore(x, 1); + managerId = x[1]; + if (2 >= t1) + return H.ioore(x, 2); + isolateId = x[2]; + if (3 >= t1) + return H.ioore(x, 3); + receivePortId = x[3]; + if (J.$eq$(managerId, init.globalState.currentManagerId)) { + isolate = init.globalState.isolates.$index(0, isolateId); + if (isolate == null) + return; + receivePort = isolate.lookup$1(receivePortId); + if (receivePort == null) + return; + result = new H._NativeJsSendPort(receivePort, isolateId); + } else + result = new H._WorkerSendPort(managerId, receivePortId, isolateId); + this.deserializedObjects.push(result); + return result; + }, + deserializeJSObject$1: function(x) { + var t1, keys, values, o, t2, i, t3; + t1 = x.length; + if (1 >= t1) + return H.ioore(x, 1); + keys = x[1]; + if (2 >= t1) + return H.ioore(x, 2); + values = x[2]; + o = {}; + this.deserializedObjects.push(o); + t1 = J.getInterceptor$asx(keys); + t2 = J.getInterceptor$asx(values); + i = 0; + while (true) { + t3 = t1.get$length(keys); + if (typeof t3 !== "number") + return H.iae(t3); + if (!(i < t3)) + break; + o[t1.$index(keys, i)] = this.deserialize$1(t2.$index(values, i)); + ++i; + } + return o; } - $arguments = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity).join(","); - t1 = $.Closure_functionCounter; - $.Closure_functionCounter = J.$add$ns(t1, 1); - $arguments += H.S(t1); - t1 = "return function(" + $arguments + "){return this."; - t2 = $.BoundClosure_selfFieldNameCache; - if (t2 == null) { - t2 = H.BoundClosure_computeFieldNamed("self"); - $.BoundClosure_selfFieldNameCache = t2; + } + }], ["_js_helper", "dart:_js_helper",, H, { + "^": "", + ConstantMap__throwUnmodifiable: function() { + throw H.wrapException(new P.UnsupportedError("Cannot modify unmodifiable Map")); + }, + jsConstructorNameToRti: function(constructorName) { + return init.getTypeFromName(constructorName); + }, + getType: function(index) { + return init.types[index]; + }, + isJsIndexable: function(object, record) { + var result; + if (record != null) { + result = record.x; + if (result != null) + return result; } - return new Function(t1 + H.S(t2) + "." + H.S(stubName) + "(" + $arguments + ");}")(); + return !!J.getInterceptor(object).$isJavaScriptIndexingBehavior; }, - Closure_cspForwardInterceptedCall: function(arity, isSuperCall, $name, $function) { - var getSelf, getReceiver; - getSelf = H.BoundClosure_selfOf; - getReceiver = H.BoundClosure_receiverOf; - switch (isSuperCall ? -1 : arity) { - case 0: - throw H.wrapException(new H.RuntimeError("Intercepted function with no arguments.")); - case 1: - return function(n, s, r) { - return function() { - return s(this)[n](r(this)); - }; - }($name, getSelf, getReceiver); - case 2: - return function(n, s, r) { - return function(a) { - return s(this)[n](r(this), a); - }; - }($name, getSelf, getReceiver); - case 3: - return function(n, s, r) { - return function(a, b) { - return s(this)[n](r(this), a, b); - }; - }($name, getSelf, getReceiver); - case 4: - return function(n, s, r) { - return function(a, b, c) { - return s(this)[n](r(this), a, b, c); - }; - }($name, getSelf, getReceiver); - case 5: - return function(n, s, r) { - return function(a, b, c, d) { - return s(this)[n](r(this), a, b, c, d); - }; - }($name, getSelf, getReceiver); - case 6: - return function(n, s, r) { - return function(a, b, c, d, e) { - return s(this)[n](r(this), a, b, c, d, e); - }; - }($name, getSelf, getReceiver); - default: - return function(f, s, r, a) { - return function() { - a = [r(this)]; - Array.prototype.push.apply(a, arguments); - return f.apply(s(this), a); - }; - }($function, getSelf, getReceiver); + S: function(value) { + var res; + if (typeof value === "string") + return value; + if (typeof value === "number") { + if (value !== 0) + return "" + value; + } else if (true === value) + return "true"; + else if (false === value) + return "false"; + else if (value == null) + return "null"; + res = J.toString$0$(value); + if (typeof res !== "string") + throw H.wrapException(H.argumentErrorValue(value)); + return res; + }, + Primitives_objectHashCode: function(object) { + var hash = object.$identityHash; + if (hash == null) { + hash = Math.random() * 0x3fffffff | 0; + object.$identityHash = hash; } + return hash; }, - Closure_forwardInterceptedCallTo: function(receiver, $function) { - var selfField, t1, stubName, arity, lookedUpFunction, t2, t3, $arguments; - selfField = H.BoundClosure_selfFieldName(); - t1 = $.BoundClosure_receiverFieldNameCache; - if (t1 == null) { - t1 = H.BoundClosure_computeFieldNamed("receiver"); - $.BoundClosure_receiverFieldNameCache = t1; + Primitives__parseIntError: function(source, handleError) { + if (handleError == null) + throw H.wrapException(new P.FormatException(source, null, null)); + return handleError.call$1(source); + }, + Primitives_parseInt: function(source, radix, handleError) { + var match, decimalMatch, maxCharCode, digitsPart, t1, i; + H.checkString(source); + match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source); + if (match == null) + return H.Primitives__parseIntError(source, handleError); + if (3 >= match.length) + return H.ioore(match, 3); + decimalMatch = match[3]; + if (radix == null) { + if (decimalMatch != null) + return parseInt(source, 10); + if (match[2] != null) + return parseInt(source, 16); + return H.Primitives__parseIntError(source, handleError); } - stubName = $function.$stubName; - arity = $function.length; - lookedUpFunction = receiver[stubName]; - t2 = $function == null ? lookedUpFunction == null : $function === lookedUpFunction; - t3 = !t2 || arity >= 28; - if (t3) - return H.Closure_cspForwardInterceptedCall(arity, !t2, stubName, $function); - if (arity === 1) { - t1 = "return function(){return this." + H.S(selfField) + "." + H.S(stubName) + "(this." + H.S(t1) + ");"; - t2 = $.Closure_functionCounter; - $.Closure_functionCounter = J.$add$ns(t2, 1); - return new Function(t1 + H.S(t2) + "}")(); + if (radix < 2 || radix > 36) + throw H.wrapException(P.RangeError$range(radix, 2, 36, "radix", null)); + if (radix === 10 && decimalMatch != null) + return parseInt(source, 10); + if (radix < 10 || decimalMatch == null) { + maxCharCode = radix <= 10 ? 47 + radix : 86 + radix; + digitsPart = match[1]; + for (t1 = digitsPart.length, i = 0; i < t1; ++i) + if ((C.JSString_methods.codeUnitAt$1(digitsPart, i) | 32) > maxCharCode) + return H.Primitives__parseIntError(source, handleError); } - $arguments = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity - 1).join(","); - t1 = "return function(" + $arguments + "){return this." + H.S(selfField) + "." + H.S(stubName) + "(this." + H.S(t1) + ", " + $arguments + ");"; - t2 = $.Closure_functionCounter; - $.Closure_functionCounter = J.$add$ns(t2, 1); - return new Function(t1 + H.S(t2) + "}")(); + return parseInt(source, radix); }, - closureFromTearOff: function(receiver, functions, reflectionInfo, isStatic, jsArguments, $name) { - var t1; - functions.fixed$length = Array; - if (!!J.getInterceptor(reflectionInfo).$isList) { - reflectionInfo.fixed$length = Array; - t1 = reflectionInfo; + Primitives_objectTypeName: function(object) { + var interceptor, interceptorConstructor, interceptorConstructorName, $name, dispatchName, objectConstructor, match, decompiledName; + interceptor = J.getInterceptor(object); + interceptorConstructor = interceptor.constructor; + if (typeof interceptorConstructor == "function") { + interceptorConstructorName = interceptorConstructor.name; + $name = typeof interceptorConstructorName === "string" ? interceptorConstructorName : null; } else - t1 = reflectionInfo; - return H.Closure_fromTearOff(receiver, functions, t1, !!isStatic, jsArguments, $name); + $name = null; + if ($name == null || interceptor === C.Interceptor_methods || !!J.getInterceptor(object).$isUnknownJavaScriptObject) { + dispatchName = C.JS_CONST_8ZY(object); + if (dispatchName === "Object") { + objectConstructor = object.constructor; + if (typeof objectConstructor == "function") { + match = String(objectConstructor).match(/^\s*function\s*([\w$]*)\s*\(/); + decompiledName = match == null ? null : match[1]; + if (typeof decompiledName === "string" && /^\w+$/.test(decompiledName)) + $name = decompiledName; + } + if ($name == null) + $name = dispatchName; + } else + $name = dispatchName; + } + $name = $name; + if ($name.length > 1 && C.JSString_methods.codeUnitAt$1($name, 0) === 36) + $name = C.JSString_methods.substring$1($name, 1); + return function(str, names) { + return str.replace(/[^<,> ]+/g, function(m) { + return names[m] || m; + }); + }($name + H.joinArguments(H.getRuntimeTypeInfo(object), 0, null), init.mangledGlobalNames); }, - intTypeCast: function(value) { - if (typeof value === "number" && Math.floor(value) === value || value == null) - return value; - throw H.wrapException(H.CastErrorImplementation$(H.Primitives_objectTypeName(value), "int")); + Primitives_objectToHumanReadableString: function(object) { + return "Instance of '" + H.Primitives_objectTypeName(object) + "'"; }, - throwCyclicInit: function(staticName) { - throw H.wrapException(new P.CyclicInitializationError("Cyclic initialization for static " + H.S(staticName))); + Primitives_currentUri: function() { + if (!!self.location) + return self.location.href; + return; }, - buildFunctionType: function(returnType, parameterTypes, optionalParameterTypes) { - return new H.RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, null); + Primitives__fromCharCodeApply: function(array) { + var end, result, i, i0, chunkEnd; + end = array.length; + if (end <= 500) + return String.fromCharCode.apply(null, array); + for (result = "", i = 0; i < end; i = i0) { + i0 = i + 500; + chunkEnd = i0 < end ? i0 : end; + result += String.fromCharCode.apply(null, array.slice(i, chunkEnd)); + } + return result; }, - buildInterfaceType: function(rti, typeArguments) { - var jsConstructorName = rti.builtin$cls; - if (typeArguments == null || typeArguments.length === 0) - return new H.RuntimeTypePlain(jsConstructorName); - return new H.RuntimeTypeGeneric(jsConstructorName, typeArguments, null); + Primitives_stringFromCodePoints: function(codePoints) { + var a, t1, _i, i; + a = H.setRuntimeTypeInfo([], [P.$int]); + for (t1 = codePoints.length, _i = 0; _i < codePoints.length; codePoints.length === t1 || (0, H.throwConcurrentModificationError)(codePoints), ++_i) { + i = codePoints[_i]; + if (typeof i !== "number" || Math.floor(i) !== i) + throw H.wrapException(H.argumentErrorValue(i)); + if (i <= 65535) + a.push(i); + else if (i <= 1114111) { + a.push(55296 + (C.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); + a.push(56320 + (i & 1023)); + } else + throw H.wrapException(H.argumentErrorValue(i)); + } + return H.Primitives__fromCharCodeApply(a); }, - getDynamicRuntimeType: function() { - return C.C_DynamicRuntimeType; + Primitives_stringFromCharCodes: function(charCodes) { + var t1, _i, t2, i; + for (t1 = charCodes.length, _i = 0; t2 = charCodes.length, _i < t2; t2 === t1 || (0, H.throwConcurrentModificationError)(charCodes), ++_i) { + i = charCodes[_i]; + if (typeof i !== "number" || Math.floor(i) !== i) + throw H.wrapException(H.argumentErrorValue(i)); + if (i < 0) + throw H.wrapException(H.argumentErrorValue(i)); + if (i > 65535) + return H.Primitives_stringFromCodePoints(charCodes); + } + return H.Primitives__fromCharCodeApply(charCodes); }, - random64: function() { - return (Math.random() * 0x100000000 >>> 0) + (Math.random() * 0x100000000 >>> 0) * 4294967296; + Primitives_stringFromNativeUint8List: function(charCodes, start, end) { + var t1, i, result, i0, chunkEnd; + t1 = J.getInterceptor$n(end); + if (t1.$le(end, 500) && start === 0 && t1.$eq(end, charCodes.length)) + return String.fromCharCode.apply(null, charCodes); + if (typeof end !== "number") + return H.iae(end); + i = start; + result = ""; + for (; i < end; i = i0) { + i0 = i + 500; + if (i0 < end) + chunkEnd = i0; + else + chunkEnd = end; + result += String.fromCharCode.apply(null, charCodes.subarray(i, chunkEnd)); + } + return result; }, - getIsolateAffinityTag: function($name) { - return init.getIsolateTag($name); + Primitives_stringFromCharCode: function(charCode) { + var bits; + if (0 <= charCode) { + if (charCode <= 65535) + return String.fromCharCode(charCode); + if (charCode <= 1114111) { + bits = charCode - 65536; + return String.fromCharCode((55296 | C.JSInt_methods._shrOtherPositive$1(bits, 10)) >>> 0, 56320 | bits & 1023); + } + } + throw H.wrapException(P.RangeError$range(charCode, 0, 1114111, null, null)); }, - setRuntimeTypeInfo: function(target, rti) { - target.$builtinTypeInfo = rti; - return target; + Primitives_lazyAsJsDate: function(receiver) { + if (receiver.date === void 0) + receiver.date = new Date(receiver._core$_value); + return receiver.date; }, - getRuntimeTypeInfo: function(target) { - if (target == null) - return; - return target.$builtinTypeInfo; + Primitives_getProperty: function(object, key) { + if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string") + throw H.wrapException(H.argumentErrorValue(object)); + return object[key]; }, - getRuntimeTypeArguments: function(target, substitutionName) { - return H.substitute(target["$as" + H.S(substitutionName)], H.getRuntimeTypeInfo(target)); + Primitives_setProperty: function(object, key, value) { + if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string") + throw H.wrapException(H.argumentErrorValue(object)); + object[key] = value; }, - getRuntimeTypeArgument: function(target, substitutionName, index) { - var $arguments = H.getRuntimeTypeArguments(target, substitutionName); - return $arguments == null ? null : $arguments[index]; + iae: function(argument) { + throw H.wrapException(H.argumentErrorValue(argument)); }, - getTypeArgumentByIndex: function(target, index) { - var rti = H.getRuntimeTypeInfo(target); - return rti == null ? null : rti[index]; + ioore: function(receiver, index) { + if (receiver == null) + J.get$length$asx(receiver); + throw H.wrapException(H.diagnoseIndexError(receiver, index)); }, - runtimeTypeToString: function(rti, onTypeVariable) { - if (rti == null) - return "dynamic"; - else if (typeof rti === "object" && rti !== null && rti.constructor === Array) - return rti[0].builtin$cls + H.joinArguments(rti, 1, onTypeVariable); - else if (typeof rti == "function") - return rti.builtin$cls; - else if (typeof rti === "number" && Math.floor(rti) === rti) - return C.JSInt_methods.toString$0(rti); - else - return; + diagnoseIndexError: function(indexable, index) { + var $length, t1; + if (typeof index !== "number" || Math.floor(index) !== index) + return new P.ArgumentError(true, index, "index", null); + $length = J.get$length$asx(indexable); + if (!(index < 0)) { + if (typeof $length !== "number") + return H.iae($length); + t1 = index >= $length; + } else + t1 = true; + if (t1) + return P.IndexError$(index, indexable, "index", null, $length); + return P.RangeError$value(index, "index", null); }, - joinArguments: function(types, startIndex, onTypeVariable) { - var buffer, index, firstArgument, allDynamic, t1, argument; - if (types == null) - return ""; - buffer = new P.StringBuffer(""); - for (index = startIndex, firstArgument = true, allDynamic = true, t1 = ""; index < types.length; ++index) { - if (firstArgument) - firstArgument = false; - else - buffer._contents = t1 + ", "; - argument = types[index]; - if (argument != null) - allDynamic = false; - t1 = buffer._contents += H.S(H.runtimeTypeToString(argument, onTypeVariable)); - } - return allDynamic ? "" : "<" + H.S(buffer) + ">"; + diagnoseRangeError: function(start, end, $length) { + if (start > $length) + return new P.RangeError(0, $length, true, start, "start", "Invalid value"); + if (end != null) + if (end < start || end > $length) + return new P.RangeError(start, $length, true, end, "end", "Invalid value"); + return new P.ArgumentError(true, end, "end", null); }, - substitute: function(substitution, $arguments) { - if (typeof substitution == "function") { - substitution = substitution.apply(null, $arguments); - if (substitution == null) - return substitution; - if (typeof substitution === "object" && substitution !== null && substitution.constructor === Array) - return substitution; - if (typeof substitution == "function") - return substitution.apply(null, $arguments); - } - return $arguments; + argumentErrorValue: function(object) { + return new P.ArgumentError(true, object, null, null); }, - areSubtypes: function(s, t) { - var len, i; - if (s == null || t == null) - return true; - len = s.length; - for (i = 0; i < len; ++i) - if (!H.isSubtype(s[i], t[i])) - return false; - return true; + checkInt: function(value) { + if (typeof value !== "number" || Math.floor(value) !== value) + throw H.wrapException(H.argumentErrorValue(value)); + return value; }, - computeSignature: function(signature, context, contextName) { - return signature.apply(context, H.getRuntimeTypeArguments(context, contextName)); + checkString: function(value) { + if (typeof value !== "string") + throw H.wrapException(H.argumentErrorValue(value)); + return value; }, - isSubtype: function(s, t) { - var t1, typeOfS, t2, typeOfT, substitution; - if (s === t) - return true; - if (s == null || t == null) - return true; - if ('func' in t) - return H.isFunctionSubtype(s, t); - if ('func' in s) - return t.builtin$cls === "Function"; - t1 = typeof s === "object" && s !== null && s.constructor === Array; - typeOfS = t1 ? s[0] : s; - t2 = typeof t === "object" && t !== null && t.constructor === Array; - typeOfT = t2 ? t[0] : t; - if (typeOfT !== typeOfS) { - if (!('$is' + H.runtimeTypeToString(typeOfT, null) in typeOfS.prototype)) - return false; - substitution = typeOfS.prototype["$as" + H.S(H.runtimeTypeToString(typeOfT, null))]; + wrapException: function(ex) { + var wrapper; + if (ex == null) + ex = new P.NullThrownError(); + wrapper = new Error(); + wrapper.dartException = ex; + if ("defineProperty" in Object) { + Object.defineProperty(wrapper, "message", {get: H.toStringWrapper}); + wrapper.name = ""; } else - substitution = null; - if (!t1 && substitution == null || !t2) - return true; - t1 = t1 ? s.slice(1) : null; - t2 = t2 ? t.slice(1) : null; - return H.areSubtypes(H.substitute(substitution, t1), t2); - }, - areAssignable: function(s, t, allowShorter) { - var t1, sLength, tLength, i, t2; - t1 = t == null; - if (t1 && s == null) - return true; - if (t1) - return allowShorter; - if (s == null) - return false; - sLength = s.length; - tLength = t.length; - if (allowShorter) { - if (sLength < tLength) - return false; - } else if (sLength !== tLength) - return false; - for (i = 0; i < tLength; ++i) { - t1 = s[i]; - t2 = t[i]; - if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) - return false; - } - return true; - }, - areAssignableMaps: function(s, t) { - var t1, names, i, $name, tType, sType; - if (t == null) - return true; - if (s == null) - return false; - t1 = Object.getOwnPropertyNames(t); - t1.fixed$length = Array; - names = t1; - for (t1 = names.length, i = 0; i < t1; ++i) { - $name = names[i]; - if (!Object.hasOwnProperty.call(s, $name)) - return false; - tType = t[$name]; - sType = s[$name]; - if (!(H.isSubtype(tType, sType) || H.isSubtype(sType, tType))) - return false; - } - return true; - }, - isFunctionSubtype: function(s, t) { - var sReturnType, tReturnType, sParameterTypes, tParameterTypes, sOptionalParameterTypes, tOptionalParameterTypes, sParametersLen, tParametersLen, sOptionalParametersLen, tOptionalParametersLen, pos, t1, t2, tPos, sPos; - if (!('func' in s)) - return false; - if ("v" in s) { - if (!("v" in t) && "ret" in t) - return false; - } else if (!("v" in t)) { - sReturnType = s.ret; - tReturnType = t.ret; - if (!(H.isSubtype(sReturnType, tReturnType) || H.isSubtype(tReturnType, sReturnType))) - return false; - } - sParameterTypes = s.args; - tParameterTypes = t.args; - sOptionalParameterTypes = s.opt; - tOptionalParameterTypes = t.opt; - sParametersLen = sParameterTypes != null ? sParameterTypes.length : 0; - tParametersLen = tParameterTypes != null ? tParameterTypes.length : 0; - sOptionalParametersLen = sOptionalParameterTypes != null ? sOptionalParameterTypes.length : 0; - tOptionalParametersLen = tOptionalParameterTypes != null ? tOptionalParameterTypes.length : 0; - if (sParametersLen > tParametersLen) - return false; - if (sParametersLen + sOptionalParametersLen < tParametersLen + tOptionalParametersLen) - return false; - if (sParametersLen === tParametersLen) { - if (!H.areAssignable(sParameterTypes, tParameterTypes, false)) - return false; - if (!H.areAssignable(sOptionalParameterTypes, tOptionalParameterTypes, true)) - return false; - } else { - for (pos = 0; pos < sParametersLen; ++pos) { - t1 = sParameterTypes[pos]; - t2 = tParameterTypes[pos]; - if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) - return false; - } - for (tPos = pos, sPos = 0; tPos < tParametersLen; ++sPos, ++tPos) { - t1 = sOptionalParameterTypes[sPos]; - t2 = tParameterTypes[tPos]; - if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) - return false; - } - for (tPos = 0; tPos < tOptionalParametersLen; ++sPos, ++tPos) { - t1 = sOptionalParameterTypes[sPos]; - t2 = tOptionalParameterTypes[tPos]; - if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) - return false; - } - } - return H.areAssignableMaps(s.named, t.named); + wrapper.toString = H.toStringWrapper; + return wrapper; }, - toStringForNativeObject: function(obj) { - var t1 = $.getTagFunction; - return "Instance of " + (t1 == null ? "<Unknown>" : t1.call$1(obj)); + toStringWrapper: function() { + return J.toString$0$(this.dartException); }, - hashCodeForNativeObject: function(object) { - return H.Primitives_objectHashCode(object); + throwExpression: function(ex) { + throw H.wrapException(ex); }, - defineProperty: function(obj, property, value) { - Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true}); + throwConcurrentModificationError: function(collection) { + throw H.wrapException(new P.ConcurrentModificationError(collection)); }, - lookupAndCacheInterceptor: function(obj) { - var tag, record, interceptor, interceptorClass, mark, t1; - tag = $.getTagFunction.call$1(obj); - record = $.dispatchRecordsForInstanceTags[tag]; - if (record != null) { - Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); - return record.i; + unwrapException: function(ex) { + var t1, message, number, ieErrorCode, t2, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match; + t1 = new H.unwrapException_saveStackTrace(ex); + if (ex == null) + return; + if (ex instanceof H.ExceptionAndStackTrace) + return t1.call$1(ex.dartException); + if (typeof ex !== "object") + return ex; + if ("dartException" in ex) + return t1.call$1(ex.dartException); + else if (!("message" in ex)) + return ex; + message = ex.message; + if ("number" in ex && typeof ex.number == "number") { + number = ex.number; + ieErrorCode = number & 65535; + if ((C.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) + switch (ieErrorCode) { + case 438: + return t1.call$1(H.JsNoSuchMethodError$(H.S(message) + " (Error " + ieErrorCode + ")", null)); + case 445: + case 5007: + t2 = H.S(message) + " (Error " + ieErrorCode + ")"; + return t1.call$1(new H.NullError(t2, null)); + } } - interceptor = $.interceptorsForUncacheableTags[tag]; - if (interceptor != null) - return interceptor; - interceptorClass = init.interceptorsByTag[tag]; - if (interceptorClass == null) { - tag = $.alternateTagFunction.call$2(obj, tag); - if (tag != null) { - record = $.dispatchRecordsForInstanceTags[tag]; - if (record != null) { - Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); - return record.i; + if (ex instanceof TypeError) { + nsme = $.$get$TypeErrorDecoder_noSuchMethodPattern(); + notClosure = $.$get$TypeErrorDecoder_notClosurePattern(); + nullCall = $.$get$TypeErrorDecoder_nullCallPattern(); + nullLiteralCall = $.$get$TypeErrorDecoder_nullLiteralCallPattern(); + undefCall = $.$get$TypeErrorDecoder_undefinedCallPattern(); + undefLiteralCall = $.$get$TypeErrorDecoder_undefinedLiteralCallPattern(); + nullProperty = $.$get$TypeErrorDecoder_nullPropertyPattern(); + $.$get$TypeErrorDecoder_nullLiteralPropertyPattern(); + undefProperty = $.$get$TypeErrorDecoder_undefinedPropertyPattern(); + undefLiteralProperty = $.$get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); + match = nsme.matchTypeError$1(message); + if (match != null) + return t1.call$1(H.JsNoSuchMethodError$(message, match)); + else { + match = notClosure.matchTypeError$1(message); + if (match != null) { + match.method = "call"; + return t1.call$1(H.JsNoSuchMethodError$(message, match)); + } else { + match = nullCall.matchTypeError$1(message); + if (match == null) { + match = nullLiteralCall.matchTypeError$1(message); + if (match == null) { + match = undefCall.matchTypeError$1(message); + if (match == null) { + match = undefLiteralCall.matchTypeError$1(message); + if (match == null) { + match = nullProperty.matchTypeError$1(message); + if (match == null) { + match = nullLiteralCall.matchTypeError$1(message); + if (match == null) { + match = undefProperty.matchTypeError$1(message); + if (match == null) { + match = undefLiteralProperty.matchTypeError$1(message); + t2 = match != null; + } else + t2 = true; + } else + t2 = true; + } else + t2 = true; + } else + t2 = true; + } else + t2 = true; + } else + t2 = true; + } else + t2 = true; + if (t2) + return t1.call$1(new H.NullError(message, match == null ? null : match.method)); } - interceptor = $.interceptorsForUncacheableTags[tag]; - if (interceptor != null) - return interceptor; - interceptorClass = init.interceptorsByTag[tag]; } + return t1.call$1(new H.UnknownJsTypeError(typeof message === "string" ? message : "")); } - if (interceptorClass == null) - return; - interceptor = interceptorClass.prototype; - mark = tag[0]; - if (mark === "!") { - record = H.makeLeafDispatchRecord(interceptor); - $.dispatchRecordsForInstanceTags[tag] = record; - Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); - return record.i; - } - if (mark === "~") { - $.interceptorsForUncacheableTags[tag] = interceptor; - return interceptor; - } - if (mark === "-") { - t1 = H.makeLeafDispatchRecord(interceptor); - Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); - return t1.i; + if (ex instanceof RangeError) { + if (typeof message === "string" && message.indexOf("call stack") !== -1) + return new P.StackOverflowError(); + message = function(ex) { + try { + return String(ex); + } catch (e) { + } + return null; + }(ex); + return t1.call$1(new P.ArgumentError(false, null, null, typeof message === "string" ? message.replace(/^RangeError:\s*/, "") : message)); } - if (mark === "+") - return H.patchInteriorProto(obj, interceptor); - if (mark === "*") - throw H.wrapException(new P.UnimplementedError(tag)); - if (init.leafTags[tag] === true) { - t1 = H.makeLeafDispatchRecord(interceptor); - Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); - return t1.i; - } else - return H.patchInteriorProto(obj, interceptor); - }, - patchInteriorProto: function(obj, interceptor) { - var proto = Object.getPrototypeOf(obj); - Object.defineProperty(proto, init.dispatchPropertyName, {value: J.makeDispatchRecord(interceptor, proto, null, null), enumerable: false, writable: true, configurable: true}); - return interceptor; + if (typeof InternalError == "function" && ex instanceof InternalError) + if (typeof message === "string" && message === "too much recursion") + return new P.StackOverflowError(); + return ex; }, - makeLeafDispatchRecord: function(interceptor) { - return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); + getTraceFromException: function(exception) { + var trace; + if (exception instanceof H.ExceptionAndStackTrace) + return exception.stackTrace; + if (exception == null) + return new H._StackTrace(exception, null); + trace = exception.$cachedTrace; + if (trace != null) + return trace; + return exception.$cachedTrace = new H._StackTrace(exception, null); }, - makeDefaultDispatchRecord: function(tag, interceptorClass, proto) { - var interceptor = interceptorClass.prototype; - if (init.leafTags[tag] === true) - return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); + objectHashCode: function(object) { + if (object == null || typeof object != 'object') + return J.get$hashCode$(object); else - return J.makeDispatchRecord(interceptor, proto, null, null); - }, - initNativeDispatch: function() { - if (true === $.initNativeDispatchFlag) - return; - $.initNativeDispatchFlag = true; - H.initNativeDispatchContinue(); + return H.Primitives_objectHashCode(object); }, - initNativeDispatchContinue: function() { - var map, tags, fun, i, tag, proto, record, interceptorClass; - $.dispatchRecordsForInstanceTags = Object.create(null); - $.interceptorsForUncacheableTags = Object.create(null); - H.initHooks(); - map = init.interceptorsByTag; - tags = Object.getOwnPropertyNames(map); - if (typeof window != "undefined") { - window; - fun = function() { - }; - for (i = 0; i < tags.length; ++i) { - tag = tags[i]; - proto = $.prototypeForTagFunction.call$1(tag); - if (proto != null) { - record = H.makeDefaultDispatchRecord(tag, map[tag], proto); - if (record != null) { - Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); - fun.prototype = proto; - } - } - } - } - for (i = 0; i < tags.length; ++i) { - tag = tags[i]; - if (/^[A-Za-z_]/.test(tag)) { - interceptorClass = map[tag]; - map["!" + tag] = interceptorClass; - map["~" + tag] = interceptorClass; - map["-" + tag] = interceptorClass; - map["+" + tag] = interceptorClass; - map["*" + tag] = interceptorClass; - } + fillLiteralMap: function(keyValuePairs, result) { + var $length, index, index0, index1; + $length = keyValuePairs.length; + for (index = 0; index < $length; index = index1) { + index0 = index + 1; + index1 = index0 + 1; + result.$indexSet(0, keyValuePairs[index], keyValuePairs[index0]); } + return result; }, - initHooks: function() { - var hooks, transformers, i, transformer, getTag, getUnknownTag, prototypeForTag; - hooks = C.JS_CONST_gkc(); - hooks = H.applyHooksTransformer(C.JS_CONST_0, H.applyHooksTransformer(C.JS_CONST_rr7, H.applyHooksTransformer(C.JS_CONST_Fs4, H.applyHooksTransformer(C.JS_CONST_Fs4, H.applyHooksTransformer(C.JS_CONST_gkc0, H.applyHooksTransformer(C.JS_CONST_4hp, H.applyHooksTransformer(C.JS_CONST_QJm(C.JS_CONST_8ZY), hooks))))))); - if (typeof dartNativeDispatchHooksTransformer != "undefined") { - transformers = dartNativeDispatchHooksTransformer; - if (typeof transformers == "function") - transformers = [transformers]; - if (transformers.constructor == Array) - for (i = 0; i < transformers.length; ++i) { - transformer = transformers[i]; - if (typeof transformer == "function") - hooks = transformer(hooks) || hooks; - } + invokeClosure: function(closure, isolate, numberOfArguments, arg1, arg2, arg3, arg4) { + switch (numberOfArguments) { + case 0: + return H._callInIsolate(isolate, new H.invokeClosure_closure(closure)); + case 1: + return H._callInIsolate(isolate, new H.invokeClosure_closure0(closure, arg1)); + case 2: + return H._callInIsolate(isolate, new H.invokeClosure_closure1(closure, arg1, arg2)); + case 3: + return H._callInIsolate(isolate, new H.invokeClosure_closure2(closure, arg1, arg2, arg3)); + case 4: + return H._callInIsolate(isolate, new H.invokeClosure_closure3(closure, arg1, arg2, arg3, arg4)); } - getTag = hooks.getTag; - getUnknownTag = hooks.getUnknownTag; - prototypeForTag = hooks.prototypeForTag; - $.getTagFunction = new H.initHooks_closure(getTag); - $.alternateTagFunction = new H.initHooks_closure0(getUnknownTag); - $.prototypeForTagFunction = new H.initHooks_closure1(prototypeForTag); - }, - applyHooksTransformer: function(transformer, hooks) { - return transformer(hooks) || hooks; + throw H.wrapException(P.Exception_Exception("Unsupported number of arguments for wrapped closure")); }, - stringContainsUnchecked: function(receiver, other, startIndex) { - var t1; - if (typeof other === "string") - return receiver.indexOf(other, startIndex) >= 0; - else { - t1 = J.getInterceptor(other); - if (!!t1.$isJSSyntaxRegExp) { - t1 = C.JSString_methods.substring$1(receiver, startIndex); - return other._nativeRegExp.test(H.checkString(t1)); - } else { - t1 = t1.allMatches$1(other, C.JSString_methods.substring$1(receiver, startIndex)); - return !t1.get$isEmpty(t1); - } - } - }, - stringReplaceFirstRE: function(receiver, regexp, replacement, startIndex) { - var match, t1, start, t2; - match = regexp._execGlobal$2(receiver, startIndex); - if (match == null) - return receiver; - t1 = match._match; - start = t1.index; - t2 = t1.index; - if (0 >= t1.length) - return H.ioore(t1, 0); - t1 = J.get$length$asx(t1[0]); - if (typeof t1 !== "number") - return H.iae(t1); - return H.stringReplaceRangeUnchecked(receiver, start, t2 + t1, replacement); + convertDartClosureToJS: function(closure, arity) { + var $function; + if (closure == null) + return; + $function = closure.$identity; + if (!!$function) + return $function; + $function = function(closure, arity, context, invoke) { + return function(a1, a2, a3, a4) { + return invoke(closure, context, arity, a1, a2, a3, a4); + }; + }(closure, arity, init.globalState.currentContext, H.invokeClosure); + closure.$identity = $function; + return $function; }, - stringReplaceAllUnchecked: function(receiver, pattern, replacement) { - var $length, t1, i, nativeRegexp; - H.checkString(replacement); - if (typeof pattern === "string") - if (pattern === "") - if (receiver === "") - return replacement; - else { - $length = receiver.length; - for (t1 = replacement, i = 0; i < $length; ++i) - t1 = t1 + receiver[i] + replacement; - return t1.charCodeAt(0) == 0 ? t1 : t1; - } - else - return receiver.replace(new RegExp(pattern.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"), 'g'), replacement.replace(/\$/g, "$$$$")); - else if (pattern instanceof H.JSSyntaxRegExp) { - nativeRegexp = pattern.get$_nativeGlobalVersion(); - nativeRegexp.lastIndex = 0; - return receiver.replace(nativeRegexp, replacement.replace(/\$/g, "$$$$")); + Closure_fromTearOff: function(receiver, functions, reflectionInfo, isStatic, jsArguments, propertyName) { + var $function, callName, functionType, $prototype, $constructor, t1, isIntercepted, trampoline, signatureFunction, getReceiver, i, stub, stubCallName, t2; + $function = functions[0]; + callName = $function.$callName; + if (!!J.getInterceptor(reflectionInfo).$isList) { + $function.$reflectionInfo = reflectionInfo; + functionType = H.ReflectionInfo_ReflectionInfo($function).functionType; + } else + functionType = reflectionInfo; + $prototype = isStatic ? Object.create(new H.StaticClosure().constructor.prototype) : Object.create(new H.BoundClosure(null, null, null, null).constructor.prototype); + $prototype.$initialize = $prototype.constructor; + if (isStatic) + $constructor = function() { + this.$initialize(); + }; + else { + t1 = $.Closure_functionCounter; + $.Closure_functionCounter = J.$add$ns(t1, 1); + t1 = new Function("a,b,c,d" + t1, "this.$initialize(a,b,c,d" + t1 + ")"); + $constructor = t1; + } + $prototype.constructor = $constructor; + $constructor.prototype = $prototype; + t1 = !isStatic; + if (t1) { + isIntercepted = jsArguments.length == 1 && true; + trampoline = H.Closure_forwardCallTo(receiver, $function, isIntercepted); + trampoline.$reflectionInfo = reflectionInfo; } else { - if (pattern == null) - H.throwExpression(H.argumentErrorValue(pattern)); - throw H.wrapException("String.replaceAll(Pattern) UNIMPLEMENTED"); + $prototype.$static_name = propertyName; + trampoline = $function; + isIntercepted = false; } - }, - stringReplaceFirstUnchecked: function(receiver, pattern, replacement, startIndex) { - var index, t1, matches, match; - if (typeof pattern === "string") { - index = receiver.indexOf(pattern, startIndex); - if (index < 0) - return receiver; - return H.stringReplaceRangeUnchecked(receiver, index, index + pattern.length, replacement); + if (typeof functionType == "number") + signatureFunction = function(getType, t) { + return function() { + return getType(t); + }; + }(H.getType, functionType); + else if (t1 && typeof functionType == "function") { + getReceiver = isIntercepted ? H.BoundClosure_receiverOf : H.BoundClosure_selfOf; + signatureFunction = function(f, r) { + return function() { + return f.apply({$receiver: r(this)}, arguments); + }; + }(functionType, getReceiver); + } else + throw H.wrapException("Error in reflectionInfo."); + $prototype.$signature = signatureFunction; + $prototype[callName] = trampoline; + for (t1 = functions.length, i = 1; i < t1; ++i) { + stub = functions[i]; + stubCallName = stub.$callName; + if (stubCallName != null) { + t2 = isStatic ? stub : H.Closure_forwardCallTo(receiver, stub, isIntercepted); + $prototype[stubCallName] = t2; + } } - t1 = J.getInterceptor(pattern); - if (!!t1.$isJSSyntaxRegExp) - return startIndex === 0 ? receiver.replace(pattern._nativeRegExp, replacement.replace(/\$/g, "$$$$")) : H.stringReplaceFirstRE(receiver, pattern, replacement, startIndex); - if (pattern == null) - H.throwExpression(H.argumentErrorValue(pattern)); - t1 = t1.allMatches$2(pattern, receiver, startIndex); - matches = t1.get$iterator(t1); - if (!matches.moveNext$0()) - return receiver; - match = matches.get$current(); - return C.JSString_methods.replaceRange$3(receiver, match.get$start(match), match.get$end(), replacement); - }, - stringReplaceRangeUnchecked: function(receiver, start, end, replacement) { - var prefix, suffix; - prefix = receiver.substring(0, start); - suffix = receiver.substring(end); - return prefix + replacement + suffix; - }, - ConstantMapView: { - "^": "UnmodifiableMapView;_map", - $asUnmodifiableMapView: Isolate.functionThatReturnsNull, - $asMap: Isolate.functionThatReturnsNull, - $isMap: 1 - }, - ConstantMap: { - "^": "Object;", - get$isEmpty: function(_) { - return this.get$length(this) === 0; - }, - get$isNotEmpty: function(_) { - return this.get$length(this) !== 0; - }, - toString$0: function(_) { - return P.Maps_mapToString(this); - }, - $indexSet: function(_, key, val) { - return H.ConstantMap__throwUnmodifiable(); - }, - $isMap: 1 + $prototype["call*"] = trampoline; + $prototype.$requiredArgCount = $function.$requiredArgCount; + $prototype.$defaultValues = $function.$defaultValues; + return $constructor; }, - ConstantStringMap: { - "^": "ConstantMap;__js_helper$_length,__js_helper$_jsObject,__js_helper$_keys", - get$length: function(_) { - return this.__js_helper$_length; - }, - containsKey$1: function(key) { - if (typeof key !== "string") - return false; - if ("__proto__" === key) - return false; - return this.__js_helper$_jsObject.hasOwnProperty(key); - }, - $index: function(_, key) { - if (!this.containsKey$1(key)) - return; - return this._fetch$1(key); - }, - _fetch$1: function(key) { - return this.__js_helper$_jsObject[key]; - }, - forEach$1: function(_, f) { - var keys, t1, i, key; - keys = this.__js_helper$_keys; - for (t1 = keys.length, i = 0; i < t1; ++i) { - key = keys[i]; - f.call$2(key, this._fetch$1(key)); - } + Closure_cspForwardCall: function(arity, isSuperCall, stubName, $function) { + var getSelf = H.BoundClosure_selfOf; + switch (isSuperCall ? -1 : arity) { + case 0: + return function(n, S) { + return function() { + return S(this)[n](); + }; + }(stubName, getSelf); + case 1: + return function(n, S) { + return function(a) { + return S(this)[n](a); + }; + }(stubName, getSelf); + case 2: + return function(n, S) { + return function(a, b) { + return S(this)[n](a, b); + }; + }(stubName, getSelf); + case 3: + return function(n, S) { + return function(a, b, c) { + return S(this)[n](a, b, c); + }; + }(stubName, getSelf); + case 4: + return function(n, S) { + return function(a, b, c, d) { + return S(this)[n](a, b, c, d); + }; + }(stubName, getSelf); + case 5: + return function(n, S) { + return function(a, b, c, d, e) { + return S(this)[n](a, b, c, d, e); + }; + }(stubName, getSelf); + default: + return function(f, s) { + return function() { + return f.apply(s(this), arguments); + }; + }($function, getSelf); } }, - JSInvocationMirror: { - "^": "Object;__js_helper$_memberName,_internalName,_kind,_arguments,_namedArgumentNames,_namedIndices", - get$memberName: function() { - return this.__js_helper$_memberName; - }, - get$positionalArguments: function() { - var t1, argumentCount, list, index; - if (this._kind === 1) - return C.List_empty0; - t1 = this._arguments; - argumentCount = t1.length - this._namedArgumentNames.length; - if (argumentCount === 0) - return C.List_empty0; - list = []; - for (index = 0; index < argumentCount; ++index) { - if (index >= t1.length) - return H.ioore(t1, index); - list.push(t1[index]); - } - return J.JSArray_markUnmodifiableList(list); - }, - get$namedArguments: function() { - var t1, namedArgumentCount, t2, namedArgumentsStartIndex, map, i, t3, t4; - if (this._kind !== 0) - return C.Map_empty; - t1 = this._namedArgumentNames; - namedArgumentCount = t1.length; - t2 = this._arguments; - namedArgumentsStartIndex = t2.length - namedArgumentCount; - if (namedArgumentCount === 0) - return C.Map_empty; - map = H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [P.Symbol, null]); - for (i = 0; i < namedArgumentCount; ++i) { - if (i >= t1.length) - return H.ioore(t1, i); - t3 = t1[i]; - t4 = namedArgumentsStartIndex + i; - if (t4 < 0 || t4 >= t2.length) - return H.ioore(t2, t4); - map.$indexSet(0, new H.Symbol0(t3), t2[t4]); + Closure_forwardCallTo: function(receiver, $function, isIntercepted) { + var stubName, arity, lookedUpFunction, t1, t2, selfName, $arguments; + if (isIntercepted) + return H.Closure_forwardInterceptedCallTo(receiver, $function); + stubName = $function.$stubName; + arity = $function.length; + lookedUpFunction = receiver[stubName]; + t1 = $function == null ? lookedUpFunction == null : $function === lookedUpFunction; + t2 = !t1 || arity >= 27; + if (t2) + return H.Closure_cspForwardCall(arity, !t1, stubName, $function); + if (arity === 0) { + t1 = $.Closure_functionCounter; + $.Closure_functionCounter = J.$add$ns(t1, 1); + selfName = "self" + H.S(t1); + t1 = "return function(){var " + selfName + " = this."; + t2 = $.BoundClosure_selfFieldNameCache; + if (t2 == null) { + t2 = H.BoundClosure_computeFieldNamed("self"); + $.BoundClosure_selfFieldNameCache = t2; } - return H.setRuntimeTypeInfo(new H.ConstantMapView(map), [P.Symbol, null]); + return new Function(t1 + H.S(t2) + ";return " + selfName + "." + H.S(stubName) + "();}")(); } - }, - ReflectionInfo: { - "^": "Object;jsFunction,data>,isAccessor,requiredParameterCount,optionalParameterCount,areOptionalParametersNamed,functionType,cachedSortedIndices", - defaultValue$1: function(_, parameter) { - var t1 = this.requiredParameterCount; - if (typeof parameter !== "number") - return parameter.$lt(); - if (parameter < t1) - return; - return this.data[3 + parameter - t1]; - }, - static: { - ReflectionInfo_ReflectionInfo: function(jsFunction) { - var data, requiredParametersInfo, optionalParametersInfo; - data = jsFunction.$reflectionInfo; - if (data == null) - return; - data.fixed$length = Array; - data = data; - requiredParametersInfo = data[0]; - optionalParametersInfo = data[1]; - return new H.ReflectionInfo(jsFunction, data, (requiredParametersInfo & 1) === 1, requiredParametersInfo >> 1, optionalParametersInfo >> 1, (optionalParametersInfo & 1) === 1, data[2], null); - } + $arguments = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity).join(","); + t1 = $.Closure_functionCounter; + $.Closure_functionCounter = J.$add$ns(t1, 1); + $arguments += H.S(t1); + t1 = "return function(" + $arguments + "){return this."; + t2 = $.BoundClosure_selfFieldNameCache; + if (t2 == null) { + t2 = H.BoundClosure_computeFieldNamed("self"); + $.BoundClosure_selfFieldNameCache = t2; } + return new Function(t1 + H.S(t2) + "." + H.S(stubName) + "(" + $arguments + ");}")(); }, - Primitives_functionNoSuchMethod_closure: { - "^": "Closure:40;_box_0,$arguments,namedArgumentList", - call$2: function($name, argument) { - var t1 = this._box_0; - t1.names = t1.names + "$" + H.S($name); - this.namedArgumentList.push($name); - this.$arguments.push(argument); - ++t1.argumentCount; + Closure_cspForwardInterceptedCall: function(arity, isSuperCall, $name, $function) { + var getSelf, getReceiver; + getSelf = H.BoundClosure_selfOf; + getReceiver = H.BoundClosure_receiverOf; + switch (isSuperCall ? -1 : arity) { + case 0: + throw H.wrapException(new H.RuntimeError("Intercepted function with no arguments.")); + case 1: + return function(n, s, r) { + return function() { + return s(this)[n](r(this)); + }; + }($name, getSelf, getReceiver); + case 2: + return function(n, s, r) { + return function(a) { + return s(this)[n](r(this), a); + }; + }($name, getSelf, getReceiver); + case 3: + return function(n, s, r) { + return function(a, b) { + return s(this)[n](r(this), a, b); + }; + }($name, getSelf, getReceiver); + case 4: + return function(n, s, r) { + return function(a, b, c) { + return s(this)[n](r(this), a, b, c); + }; + }($name, getSelf, getReceiver); + case 5: + return function(n, s, r) { + return function(a, b, c, d) { + return s(this)[n](r(this), a, b, c, d); + }; + }($name, getSelf, getReceiver); + case 6: + return function(n, s, r) { + return function(a, b, c, d, e) { + return s(this)[n](r(this), a, b, c, d, e); + }; + }($name, getSelf, getReceiver); + default: + return function(f, s, r, a) { + return function() { + a = [r(this)]; + Array.prototype.push.apply(a, arguments); + return f.apply(s(this), a); + }; + }($function, getSelf, getReceiver); } }, - TypeErrorDecoder: { - "^": "Object;_pattern,_arguments,_argumentsExpr,_expr,_method,_receiver", - matchTypeError$1: function(message) { - var match, result, t1; - match = new RegExp(this._pattern).exec(message); - if (match == null) - return; - result = Object.create(null); - t1 = this._arguments; - if (t1 !== -1) - result.arguments = match[t1 + 1]; - t1 = this._argumentsExpr; - if (t1 !== -1) - result.argumentsExpr = match[t1 + 1]; - t1 = this._expr; - if (t1 !== -1) - result.expr = match[t1 + 1]; - t1 = this._method; - if (t1 !== -1) - result.method = match[t1 + 1]; - t1 = this._receiver; - if (t1 !== -1) - result.receiver = match[t1 + 1]; - return result; - }, - static: { - TypeErrorDecoder_extractPattern: function(message) { - var match, $arguments, argumentsExpr, expr, method, receiver; - message = message.replace(String({}), '$receiver$').replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"); - match = message.match(/\\\$[a-zA-Z]+\\\$/g); - if (match == null) - match = []; - $arguments = match.indexOf("\\$arguments\\$"); - argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); - expr = match.indexOf("\\$expr\\$"); - method = match.indexOf("\\$method\\$"); - receiver = match.indexOf("\\$receiver\\$"); - return new H.TypeErrorDecoder(message.replace(new RegExp('\\\\\\$arguments\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$argumentsExpr\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$expr\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$method\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$receiver\\\\\\$', 'g'), '((?:x|[^x])*)'), $arguments, argumentsExpr, expr, method, receiver); - }, - TypeErrorDecoder_provokeCallErrorOn: function(expression) { - return function($expr$) { - var $argumentsExpr$ = '$arguments$'; - try { - $expr$.$method$($argumentsExpr$); - } catch (e) { - return e.message; - } - }(expression); - }, - TypeErrorDecoder_provokePropertyErrorOn: function(expression) { - return function($expr$) { - try { - $expr$.$method$; - } catch (e) { - return e.message; - } - }(expression); - } + Closure_forwardInterceptedCallTo: function(receiver, $function) { + var selfField, t1, stubName, arity, lookedUpFunction, t2, t3, $arguments; + selfField = H.BoundClosure_selfFieldName(); + t1 = $.BoundClosure_receiverFieldNameCache; + if (t1 == null) { + t1 = H.BoundClosure_computeFieldNamed("receiver"); + $.BoundClosure_receiverFieldNameCache = t1; } - }, - NullError: { - "^": "Error;_message,_method", - toString$0: function(_) { - var t1 = this._method; - if (t1 == null) - return "NullError: " + H.S(this._message); - return "NullError: method not found: '" + H.S(t1) + "' on null"; + stubName = $function.$stubName; + arity = $function.length; + lookedUpFunction = receiver[stubName]; + t2 = $function == null ? lookedUpFunction == null : $function === lookedUpFunction; + t3 = !t2 || arity >= 28; + if (t3) + return H.Closure_cspForwardInterceptedCall(arity, !t2, stubName, $function); + if (arity === 1) { + t1 = "return function(){return this." + H.S(selfField) + "." + H.S(stubName) + "(this." + H.S(t1) + ");"; + t2 = $.Closure_functionCounter; + $.Closure_functionCounter = J.$add$ns(t2, 1); + return new Function(t1 + H.S(t2) + "}")(); } + $arguments = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity - 1).join(","); + t1 = "return function(" + $arguments + "){return this." + H.S(selfField) + "." + H.S(stubName) + "(this." + H.S(t1) + ", " + $arguments + ");"; + t2 = $.Closure_functionCounter; + $.Closure_functionCounter = J.$add$ns(t2, 1); + return new Function(t1 + H.S(t2) + "}")(); }, - JsNoSuchMethodError: { - "^": "Error;_message,_method,_receiver", - toString$0: function(_) { - var t1, t2; - t1 = this._method; - if (t1 == null) - return "NoSuchMethodError: " + H.S(this._message); - t2 = this._receiver; - if (t2 == null) - return "NoSuchMethodError: method not found: '" + H.S(t1) + "' (" + H.S(this._message) + ")"; - return "NoSuchMethodError: method not found: '" + H.S(t1) + "' on '" + H.S(t2) + "' (" + H.S(this._message) + ")"; - }, - static: { - JsNoSuchMethodError$: function(_message, match) { - var t1, t2; - t1 = match == null; - t2 = t1 ? null : match.method; - return new H.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver); - } - } + closureFromTearOff: function(receiver, functions, reflectionInfo, isStatic, jsArguments, $name) { + var t1; + functions.fixed$length = Array; + if (!!J.getInterceptor(reflectionInfo).$isList) { + reflectionInfo.fixed$length = Array; + t1 = reflectionInfo; + } else + t1 = reflectionInfo; + return H.Closure_fromTearOff(receiver, functions, t1, !!isStatic, jsArguments, $name); }, - UnknownJsTypeError: { - "^": "Error;_message", - toString$0: function(_) { - var t1 = this._message; - return t1.length === 0 ? "Error" : "Error: " + t1; - } + intTypeCast: function(value) { + if (typeof value === "number" && Math.floor(value) === value || value == null) + return value; + throw H.wrapException(H.CastErrorImplementation$(H.Primitives_objectTypeName(value), "int")); }, - ExceptionAndStackTrace: { - "^": "Object;dartException,stackTrace<" + throwCyclicInit: function(staticName) { + throw H.wrapException(new P.CyclicInitializationError("Cyclic initialization for static " + H.S(staticName))); }, - unwrapException_saveStackTrace: { - "^": "Closure:0;ex", - call$1: function(error) { - if (!!J.getInterceptor(error).$isError) - if (error.$thrownJsError == null) - error.$thrownJsError = this.ex; - return error; - } + buildFunctionType: function(returnType, parameterTypes, optionalParameterTypes) { + return new H.RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, null); }, - _StackTrace: { - "^": "Object;_exception,_trace", - toString$0: function(_) { - var t1, trace; - t1 = this._trace; - if (t1 != null) - return t1; - t1 = this._exception; - trace = t1 !== null && typeof t1 === "object" ? t1.stack : null; - t1 = trace == null ? "" : trace; - this._trace = t1; - return t1; - } + buildInterfaceType: function(rti, typeArguments) { + var jsConstructorName = rti.builtin$cls; + if (typeArguments == null || typeArguments.length === 0) + return new H.RuntimeTypePlain(jsConstructorName); + return new H.RuntimeTypeGeneric(jsConstructorName, typeArguments, null); }, - invokeClosure_closure: { - "^": "Closure:1;closure", - call$0: function() { - return this.closure.call$0(); - } + getDynamicRuntimeType: function() { + return C.C_DynamicRuntimeType; }, - invokeClosure_closure0: { - "^": "Closure:1;closure,arg1", - call$0: function() { - return this.closure.call$1(this.arg1); - } + random64: function() { + return (Math.random() * 0x100000000 >>> 0) + (Math.random() * 0x100000000 >>> 0) * 4294967296; }, - invokeClosure_closure1: { - "^": "Closure:1;closure,arg1,arg2", - call$0: function() { - return this.closure.call$2(this.arg1, this.arg2); - } + setRuntimeTypeInfo: function(target, rti) { + target.$builtinTypeInfo = rti; + return target; }, - invokeClosure_closure2: { - "^": "Closure:1;closure,arg1,arg2,arg3", - call$0: function() { - return this.closure.call$3(this.arg1, this.arg2, this.arg3); - } + getRuntimeTypeInfo: function(target) { + if (target == null) + return; + return target.$builtinTypeInfo; }, - invokeClosure_closure3: { - "^": "Closure:1;closure,arg1,arg2,arg3,arg4", - call$0: function() { - return this.closure.call$4(this.arg1, this.arg2, this.arg3, this.arg4); + getRuntimeTypeArguments: function(target, substitutionName) { + return H.substitute(target["$as" + H.S(substitutionName)], H.getRuntimeTypeInfo(target)); + }, + getRuntimeTypeArgument: function(target, substitutionName, index) { + var $arguments = H.getRuntimeTypeArguments(target, substitutionName); + return $arguments == null ? null : $arguments[index]; + }, + getTypeArgumentByIndex: function(target, index) { + var rti = H.getRuntimeTypeInfo(target); + return rti == null ? null : rti[index]; + }, + runtimeTypeToString: function(rti, onTypeVariable) { + if (rti == null) + return "dynamic"; + else if (typeof rti === "object" && rti !== null && rti.constructor === Array) + return rti[0].builtin$cls + H.joinArguments(rti, 1, onTypeVariable); + else if (typeof rti == "function") + return rti.builtin$cls; + else if (typeof rti === "number" && Math.floor(rti) === rti) + return C.JSInt_methods.toString$0(rti); + else + return; + }, + joinArguments: function(types, startIndex, onTypeVariable) { + var buffer, index, firstArgument, allDynamic, t1, argument; + if (types == null) + return ""; + buffer = new P.StringBuffer(""); + for (index = startIndex, firstArgument = true, allDynamic = true, t1 = ""; index < types.length; ++index) { + if (firstArgument) + firstArgument = false; + else + buffer._contents = t1 + ", "; + argument = types[index]; + if (argument != null) + allDynamic = false; + t1 = buffer._contents += H.S(H.runtimeTypeToString(argument, onTypeVariable)); } + return allDynamic ? "" : "<" + H.S(buffer) + ">"; }, - Closure: { - "^": "Object;", - toString$0: function(_) { - return "Closure '" + H.Primitives_objectTypeName(this) + "'"; - }, - get$$call: function() { - return this; - }, - $isFunction: 1, - get$$call: function() { - return this; + substitute: function(substitution, $arguments) { + if (typeof substitution == "function") { + substitution = substitution.apply(null, $arguments); + if (substitution == null) + return substitution; + if (typeof substitution === "object" && substitution !== null && substitution.constructor === Array) + return substitution; + if (typeof substitution == "function") + return substitution.apply(null, $arguments); } + return $arguments; }, - TearOffClosure: { - "^": "Closure;" + areSubtypes: function(s, t) { + var len, i; + if (s == null || t == null) + return true; + len = s.length; + for (i = 0; i < len; ++i) + if (!H.isSubtype(s[i], t[i])) + return false; + return true; }, - StaticClosure: { - "^": "TearOffClosure;", - toString$0: function(_) { - var $name = this.$static_name; - if ($name == null) - return "Closure of unknown static method"; - return "Closure '" + $name + "'"; - } + computeSignature: function(signature, context, contextName) { + return signature.apply(context, H.getRuntimeTypeArguments(context, contextName)); }, - BoundClosure: { - "^": "TearOffClosure;_self,__js_helper$_target,_receiver,_name", - $eq: function(_, other) { - if (other == null) + isSubtype: function(s, t) { + var t1, typeOfS, t2, typeOfT, substitution; + if (s === t) + return true; + if (s == null || t == null) + return true; + if ('func' in t) + return H.isFunctionSubtype(s, t); + if ('func' in s) + return t.builtin$cls === "Function"; + t1 = typeof s === "object" && s !== null && s.constructor === Array; + typeOfS = t1 ? s[0] : s; + t2 = typeof t === "object" && t !== null && t.constructor === Array; + typeOfT = t2 ? t[0] : t; + if (typeOfT !== typeOfS) { + if (!('$is' + H.runtimeTypeToString(typeOfT, null) in typeOfS.prototype)) return false; - if (this === other) - return true; - if (!(other instanceof H.BoundClosure)) + substitution = typeOfS.prototype["$as" + H.S(H.runtimeTypeToString(typeOfT, null))]; + } else + substitution = null; + if (!t1 && substitution == null || !t2) + return true; + t1 = t1 ? s.slice(1) : null; + t2 = t2 ? t.slice(1) : null; + return H.areSubtypes(H.substitute(substitution, t1), t2); + }, + areAssignable: function(s, t, allowShorter) { + var t1, sLength, tLength, i, t2; + t1 = t == null; + if (t1 && s == null) + return true; + if (t1) + return allowShorter; + if (s == null) + return false; + sLength = s.length; + tLength = t.length; + if (allowShorter) { + if (sLength < tLength) + return false; + } else if (sLength !== tLength) + return false; + for (i = 0; i < tLength; ++i) { + t1 = s[i]; + t2 = t[i]; + if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) return false; - return this._self === other._self && this.__js_helper$_target === other.__js_helper$_target && this._receiver === other._receiver; - }, - get$hashCode: function(_) { - var t1, receiverHashCode; - t1 = this._receiver; - if (t1 == null) - receiverHashCode = H.Primitives_objectHashCode(this._self); - else - receiverHashCode = typeof t1 !== "object" ? J.get$hashCode$(t1) : H.Primitives_objectHashCode(t1); - return J.$xor$n(receiverHashCode, H.Primitives_objectHashCode(this.__js_helper$_target)); - }, - toString$0: function(_) { - var receiver = this._receiver; - if (receiver == null) - receiver = this._self; - return "Closure '" + H.S(this._name) + "' of " + H.Primitives_objectToHumanReadableString(receiver); - }, - static: { - BoundClosure_selfOf: function(closure) { - return closure._self; - }, - BoundClosure_receiverOf: function(closure) { - return closure._receiver; - }, - BoundClosure_selfFieldName: function() { - var t1 = $.BoundClosure_selfFieldNameCache; - if (t1 == null) { - t1 = H.BoundClosure_computeFieldNamed("self"); - $.BoundClosure_selfFieldNameCache = t1; - } - return t1; - }, - BoundClosure_computeFieldNamed: function(fieldName) { - var template, t1, names, i, $name; - template = new H.BoundClosure("self", "target", "receiver", "name"); - t1 = Object.getOwnPropertyNames(template); - t1.fixed$length = Array; - names = t1; - for (t1 = names.length, i = 0; i < t1; ++i) { - $name = names[i]; - if (template[$name] === fieldName) - return $name; - } - } } + return true; }, - CastErrorImplementation: { - "^": "Error;message>", - toString$0: function(_) { - return this.message; - }, - static: { - CastErrorImplementation$: function(actualType, expectedType) { - return new H.CastErrorImplementation("CastError: Casting value of type " + H.S(actualType) + " to incompatible type " + H.S(expectedType)); - } + areAssignableMaps: function(s, t) { + var t1, names, i, $name, tType, sType; + if (t == null) + return true; + if (s == null) + return false; + t1 = Object.getOwnPropertyNames(t); + t1.fixed$length = Array; + names = t1; + for (t1 = names.length, i = 0; i < t1; ++i) { + $name = names[i]; + if (!Object.hasOwnProperty.call(s, $name)) + return false; + tType = t[$name]; + sType = s[$name]; + if (!(H.isSubtype(tType, sType) || H.isSubtype(sType, tType))) + return false; } + return true; }, - RuntimeError: { - "^": "Error;message>", - toString$0: function(_) { - return "RuntimeError: " + H.S(this.message); + isFunctionSubtype: function(s, t) { + var sReturnType, tReturnType, sParameterTypes, tParameterTypes, sOptionalParameterTypes, tOptionalParameterTypes, sParametersLen, tParametersLen, sOptionalParametersLen, tOptionalParametersLen, pos, t1, t2, tPos, sPos; + if (!('func' in s)) + return false; + if ("v" in s) { + if (!("v" in t) && "ret" in t) + return false; + } else if (!("v" in t)) { + sReturnType = s.ret; + tReturnType = t.ret; + if (!(H.isSubtype(sReturnType, tReturnType) || H.isSubtype(tReturnType, sReturnType))) + return false; } - }, - RuntimeType: { - "^": "Object;" - }, - RuntimeFunctionType: { - "^": "RuntimeType;returnType,parameterTypes,optionalParameterTypes,namedParameters", - _isTest$1: function(expression) { - var functionTypeObject = this._extractFunctionTypeObjectFrom$1(expression); - return functionTypeObject == null ? false : H.isFunctionSubtype(functionTypeObject, this.toRti$0()); - }, - _extractFunctionTypeObjectFrom$1: function(o) { - var interceptor = J.getInterceptor(o); - return "$signature" in interceptor ? interceptor.$signature() : null; - }, - toRti$0: function() { - var result, t1, t2, namedRti, keys, i, $name; - result = {func: "dynafunc"}; - t1 = this.returnType; - t2 = J.getInterceptor(t1); - if (!!t2.$isVoidRuntimeType) - result.v = true; - else if (!t2.$isDynamicRuntimeType) - result.ret = t1.toRti$0(); - t1 = this.parameterTypes; - if (t1 != null && t1.length !== 0) - result.args = H.RuntimeFunctionType_listToRti(t1); - t1 = this.optionalParameterTypes; - if (t1 != null && t1.length !== 0) - result.opt = H.RuntimeFunctionType_listToRti(t1); - t1 = this.namedParameters; - if (t1 != null) { - namedRti = Object.create(null); - keys = H.extractKeys(t1); - for (t2 = keys.length, i = 0; i < t2; ++i) { - $name = keys[i]; - namedRti[$name] = t1[$name].toRti$0(); - } - result.named = namedRti; + sParameterTypes = s.args; + tParameterTypes = t.args; + sOptionalParameterTypes = s.opt; + tOptionalParameterTypes = t.opt; + sParametersLen = sParameterTypes != null ? sParameterTypes.length : 0; + tParametersLen = tParameterTypes != null ? tParameterTypes.length : 0; + sOptionalParametersLen = sOptionalParameterTypes != null ? sOptionalParameterTypes.length : 0; + tOptionalParametersLen = tOptionalParameterTypes != null ? tOptionalParameterTypes.length : 0; + if (sParametersLen > tParametersLen) + return false; + if (sParametersLen + sOptionalParametersLen < tParametersLen + tOptionalParametersLen) + return false; + if (sParametersLen === tParametersLen) { + if (!H.areAssignable(sParameterTypes, tParameterTypes, false)) + return false; + if (!H.areAssignable(sOptionalParameterTypes, tOptionalParameterTypes, true)) + return false; + } else { + for (pos = 0; pos < sParametersLen; ++pos) { + t1 = sParameterTypes[pos]; + t2 = tParameterTypes[pos]; + if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) + return false; } - return result; - }, - toString$0: function(_) { - var t1, t2, result, needsComma, i, type, keys, $name; - t1 = this.parameterTypes; - if (t1 != null) - for (t2 = t1.length, result = "(", needsComma = false, i = 0; i < t2; ++i, needsComma = true) { - type = t1[i]; - if (needsComma) - result += ", "; - result += H.S(type); - } - else { - result = "("; - needsComma = false; + for (tPos = pos, sPos = 0; tPos < tParametersLen; ++sPos, ++tPos) { + t1 = sOptionalParameterTypes[sPos]; + t2 = tParameterTypes[tPos]; + if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) + return false; } - t1 = this.optionalParameterTypes; - if (t1 != null && t1.length !== 0) { - result = (needsComma ? result + ", " : result) + "["; - for (t2 = t1.length, needsComma = false, i = 0; i < t2; ++i, needsComma = true) { - type = t1[i]; - if (needsComma) - result += ", "; - result += H.S(type); + for (tPos = 0; tPos < tOptionalParametersLen; ++sPos, ++tPos) { + t1 = sOptionalParameterTypes[sPos]; + t2 = tOptionalParameterTypes[tPos]; + if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) + return false; + } + } + return H.areAssignableMaps(s.named, t.named); + }, + toStringForNativeObject: function(obj) { + var t1 = $.getTagFunction; + return "Instance of " + (t1 == null ? "<Unknown>" : t1.call$1(obj)); + }, + hashCodeForNativeObject: function(object) { + return H.Primitives_objectHashCode(object); + }, + defineProperty: function(obj, property, value) { + Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true}); + }, + lookupAndCacheInterceptor: function(obj) { + var tag, record, interceptor, interceptorClass, mark, t1; + tag = $.getTagFunction.call$1(obj); + record = $.dispatchRecordsForInstanceTags[tag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + interceptor = $.interceptorsForUncacheableTags[tag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[tag]; + if (interceptorClass == null) { + tag = $.alternateTagFunction.call$2(obj, tag); + if (tag != null) { + record = $.dispatchRecordsForInstanceTags[tag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; } - result += "]"; - } else { - t1 = this.namedParameters; - if (t1 != null) { - result = (needsComma ? result + ", " : result) + "{"; - keys = H.extractKeys(t1); - for (t2 = keys.length, needsComma = false, i = 0; i < t2; ++i, needsComma = true) { - $name = keys[i]; - if (needsComma) - result += ", "; - result += H.S(t1[$name].toRti$0()) + " " + $name; + interceptor = $.interceptorsForUncacheableTags[tag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[tag]; + } + } + if (interceptorClass == null) + return; + interceptor = interceptorClass.prototype; + mark = tag[0]; + if (mark === "!") { + record = H.makeLeafDispatchRecord(interceptor); + $.dispatchRecordsForInstanceTags[tag] = record; + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + if (mark === "~") { + $.interceptorsForUncacheableTags[tag] = interceptor; + return interceptor; + } + if (mark === "-") { + t1 = H.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } + if (mark === "+") + return H.patchInteriorProto(obj, interceptor); + if (mark === "*") + throw H.wrapException(new P.UnimplementedError(tag)); + if (init.leafTags[tag] === true) { + t1 = H.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } else + return H.patchInteriorProto(obj, interceptor); + }, + patchInteriorProto: function(obj, interceptor) { + var proto = Object.getPrototypeOf(obj); + Object.defineProperty(proto, init.dispatchPropertyName, {value: J.makeDispatchRecord(interceptor, proto, null, null), enumerable: false, writable: true, configurable: true}); + return interceptor; + }, + makeLeafDispatchRecord: function(interceptor) { + return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); + }, + makeDefaultDispatchRecord: function(tag, interceptorClass, proto) { + var interceptor = interceptorClass.prototype; + if (init.leafTags[tag] === true) + return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); + else + return J.makeDispatchRecord(interceptor, proto, null, null); + }, + initNativeDispatch: function() { + if (true === $.initNativeDispatchFlag) + return; + $.initNativeDispatchFlag = true; + H.initNativeDispatchContinue(); + }, + initNativeDispatchContinue: function() { + var map, tags, fun, i, tag, proto, record, interceptorClass; + $.dispatchRecordsForInstanceTags = Object.create(null); + $.interceptorsForUncacheableTags = Object.create(null); + H.initHooks(); + map = init.interceptorsByTag; + tags = Object.getOwnPropertyNames(map); + if (typeof window != "undefined") { + window; + fun = function() { + }; + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + proto = $.prototypeForTagFunction.call$1(tag); + if (proto != null) { + record = H.makeDefaultDispatchRecord(tag, map[tag], proto); + if (record != null) { + Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + fun.prototype = proto; } - result += "}"; } } - return result + (") -> " + H.S(this.returnType)); - }, - static: { - RuntimeFunctionType_listToRti: function(list) { - var result, t1, i; - list = list; - result = []; - for (t1 = list.length, i = 0; i < t1; ++i) - result.push(list[i].toRti$0()); - return result; + } + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + if (/^[A-Za-z_]/.test(tag)) { + interceptorClass = map[tag]; + map["!" + tag] = interceptorClass; + map["~" + tag] = interceptorClass; + map["-" + tag] = interceptorClass; + map["+" + tag] = interceptorClass; + map["*" + tag] = interceptorClass; } } }, - DynamicRuntimeType: { - "^": "RuntimeType;", - toString$0: function(_) { - return "dynamic"; - }, - toRti$0: function() { - return; + initHooks: function() { + var hooks, transformers, i, transformer, getTag, getUnknownTag, prototypeForTag; + hooks = C.JS_CONST_gkc(); + hooks = H.applyHooksTransformer(C.JS_CONST_0, H.applyHooksTransformer(C.JS_CONST_rr7, H.applyHooksTransformer(C.JS_CONST_Fs4, H.applyHooksTransformer(C.JS_CONST_Fs4, H.applyHooksTransformer(C.JS_CONST_gkc0, H.applyHooksTransformer(C.JS_CONST_4hp, H.applyHooksTransformer(C.JS_CONST_QJm(C.JS_CONST_8ZY), hooks))))))); + if (typeof dartNativeDispatchHooksTransformer != "undefined") { + transformers = dartNativeDispatchHooksTransformer; + if (typeof transformers == "function") + transformers = [transformers]; + if (transformers.constructor == Array) + for (i = 0; i < transformers.length; ++i) { + transformer = transformers[i]; + if (typeof transformer == "function") + hooks = transformer(hooks) || hooks; + } } + getTag = hooks.getTag; + getUnknownTag = hooks.getUnknownTag; + prototypeForTag = hooks.prototypeForTag; + $.getTagFunction = new H.initHooks_closure(getTag); + $.alternateTagFunction = new H.initHooks_closure0(getUnknownTag); + $.prototypeForTagFunction = new H.initHooks_closure1(prototypeForTag); }, - RuntimeTypePlain: { - "^": "RuntimeType;_jsConstructorName", - toRti$0: function() { - var t1, rti; - t1 = this._jsConstructorName; - rti = H.jsConstructorNameToRti(t1); - if (rti == null) - throw H.wrapException("no type for '" + t1 + "'"); - return rti; - }, - toString$0: function(_) { - return this._jsConstructorName; - } + applyHooksTransformer: function(transformer, hooks) { + return transformer(hooks) || hooks; }, - RuntimeTypeGeneric: { - "^": "RuntimeType;_jsConstructorName,$arguments,rti", - toRti$0: function() { - var t1, result, t2, _i; - t1 = this.rti; - if (t1 != null) - return t1; - t1 = this._jsConstructorName; - result = [H.jsConstructorNameToRti(t1)]; - if (0 >= result.length) - return H.ioore(result, 0); - if (result[0] == null) - throw H.wrapException("no type for '" + t1 + "<...>'"); - for (t1 = this.$arguments, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) - result.push(t1[_i].toRti$0()); - this.rti = result; - return result; - }, - toString$0: function(_) { - var t1 = this.$arguments; - return this._jsConstructorName + "<" + (t1 && C.JSArray_methods).join$1(t1, ", ") + ">"; + stringContainsUnchecked: function(receiver, other, startIndex) { + var t1; + if (typeof other === "string") + return receiver.indexOf(other, startIndex) >= 0; + else { + t1 = J.getInterceptor(other); + if (!!t1.$isJSSyntaxRegExp) { + t1 = C.JSString_methods.substring$1(receiver, startIndex); + return other._nativeRegExp.test(H.checkString(t1)); + } else { + t1 = t1.allMatches$1(other, C.JSString_methods.substring$1(receiver, startIndex)); + return !t1.get$isEmpty(t1); + } } }, - JsLinkedHashMap: { - "^": "Object;__js_helper$_length,_strings,_nums,_rest,_first,_last,_modifications", - get$length: function(_) { - return this.__js_helper$_length; - }, + stringReplaceFirstRE: function(receiver, regexp, replacement, startIndex) { + var match, t1, start, t2; + match = regexp._execGlobal$2(receiver, startIndex); + if (match == null) + return receiver; + t1 = match._match; + start = t1.index; + t2 = t1.index; + if (0 >= t1.length) + return H.ioore(t1, 0); + t1 = J.get$length$asx(t1[0]); + if (typeof t1 !== "number") + return H.iae(t1); + return H.stringReplaceRangeUnchecked(receiver, start, t2 + t1, replacement); + }, + stringReplaceAllUnchecked: function(receiver, pattern, replacement) { + var $length, t1, i, nativeRegexp; + H.checkString(replacement); + if (typeof pattern === "string") + if (pattern === "") + if (receiver === "") + return replacement; + else { + $length = receiver.length; + for (t1 = replacement, i = 0; i < $length; ++i) + t1 = t1 + receiver[i] + replacement; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + else + return receiver.replace(new RegExp(pattern.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"), 'g'), replacement.replace(/\$/g, "$$$$")); + else if (pattern instanceof H.JSSyntaxRegExp) { + nativeRegexp = pattern.get$_nativeGlobalVersion(); + nativeRegexp.lastIndex = 0; + return receiver.replace(nativeRegexp, replacement.replace(/\$/g, "$$$$")); + } else { + if (pattern == null) + H.throwExpression(H.argumentErrorValue(pattern)); + throw H.wrapException("String.replaceAll(Pattern) UNIMPLEMENTED"); + } + }, + stringReplaceFirstUnchecked: function(receiver, pattern, replacement, startIndex) { + var index, t1, matches, match; + if (typeof pattern === "string") { + index = receiver.indexOf(pattern, startIndex); + if (index < 0) + return receiver; + return H.stringReplaceRangeUnchecked(receiver, index, index + pattern.length, replacement); + } + t1 = J.getInterceptor(pattern); + if (!!t1.$isJSSyntaxRegExp) + return startIndex === 0 ? receiver.replace(pattern._nativeRegExp, replacement.replace(/\$/g, "$$$$")) : H.stringReplaceFirstRE(receiver, pattern, replacement, startIndex); + if (pattern == null) + H.throwExpression(H.argumentErrorValue(pattern)); + t1 = t1.allMatches$2(pattern, receiver, startIndex); + matches = t1.get$iterator(t1); + if (!matches.moveNext$0()) + return receiver; + match = matches.get$current(); + return C.JSString_methods.replaceRange$3(receiver, match.get$start(match), match.get$end(), replacement); + }, + stringReplaceRangeUnchecked: function(receiver, start, end, replacement) { + var prefix, suffix; + prefix = receiver.substring(0, start); + suffix = receiver.substring(end); + return prefix + replacement + suffix; + }, + ConstantMap: { + "^": "Object;", get$isEmpty: function(_) { - return this.__js_helper$_length === 0; + return this.get$length(this) === 0; }, get$isNotEmpty: function(_) { - return !this.get$isEmpty(this); + return this.get$length(this) !== 0; }, - get$keys: function() { - return H.setRuntimeTypeInfo(new H.LinkedHashMapKeyIterable(this), [H.getTypeArgumentByIndex(this, 0)]); + toString$0: function(_) { + return P.Maps_mapToString(this); }, - get$values: function(_) { - return H.MappedIterable_MappedIterable(this.get$keys(), new H.JsLinkedHashMap_values_closure(this), H.getTypeArgumentByIndex(this, 0), H.getTypeArgumentByIndex(this, 1)); + $indexSet: function(_, key, val) { + return H.ConstantMap__throwUnmodifiable(); }, - containsKey$1: function(key) { - var strings, nums; - if (typeof key === "string") { - strings = this._strings; - if (strings == null) - return false; - return this._containsTableEntry$2(strings, key); - } else if (typeof key === "number" && (key & 0x3ffffff) === key) { - nums = this._nums; - if (nums == null) - return false; - return this._containsTableEntry$2(nums, key); - } else - return this.internalContainsKey$1(key); + $isMap: 1 + }, + ConstantStringMap: { + "^": "ConstantMap;__js_helper$_length,_jsObject,_keys", + get$length: function(_) { + return this.__js_helper$_length; }, - internalContainsKey$1: function(key) { - var rest = this._rest; - if (rest == null) + containsKey$1: function(key) { + if (typeof key !== "string") return false; - return this.internalFindBucketIndex$2(this._getTableBucket$2(rest, this.internalComputeHashCode$1(key)), key) >= 0; + if ("__proto__" === key) + return false; + return this._jsObject.hasOwnProperty(key); }, $index: function(_, key) { - var strings, cell, nums; - if (typeof key === "string") { - strings = this._strings; - if (strings == null) - return; - cell = this._getTableCell$2(strings, key); - return cell == null ? null : cell.get$hashMapCellValue(); - } else if (typeof key === "number" && (key & 0x3ffffff) === key) { - nums = this._nums; - if (nums == null) - return; - cell = this._getTableCell$2(nums, key); - return cell == null ? null : cell.get$hashMapCellValue(); - } else - return this.internalGet$1(key); - }, - internalGet$1: function(key) { - var rest, bucket, index; - rest = this._rest; - if (rest == null) - return; - bucket = this._getTableBucket$2(rest, this.internalComputeHashCode$1(key)); - index = this.internalFindBucketIndex$2(bucket, key); - if (index < 0) - return; - return bucket[index].get$hashMapCellValue(); - }, - $indexSet: function(_, key, value) { - var strings, nums, rest, hash, bucket, index; - if (typeof key === "string") { - strings = this._strings; - if (strings == null) { - strings = this._newHashTable$0(); - this._strings = strings; - } - this._addHashTableEntry$3(strings, key, value); - } else if (typeof key === "number" && (key & 0x3ffffff) === key) { - nums = this._nums; - if (nums == null) { - nums = this._newHashTable$0(); - this._nums = nums; - } - this._addHashTableEntry$3(nums, key, value); - } else { - rest = this._rest; - if (rest == null) { - rest = this._newHashTable$0(); - this._rest = rest; - } - hash = this.internalComputeHashCode$1(key); - bucket = this._getTableBucket$2(rest, hash); - if (bucket == null) - this._setTableEntry$3(rest, hash, [this._newLinkedCell$2(key, value)]); - else { - index = this.internalFindBucketIndex$2(bucket, key); - if (index >= 0) - bucket[index].set$hashMapCellValue(value); - else - bucket.push(this._newLinkedCell$2(key, value)); - } - } - }, - remove$1: function(_, key) { - if (typeof key === "string") - return this._removeHashTableEntry$2(this._strings, key); - else if (typeof key === "number" && (key & 0x3ffffff) === key) - return this._removeHashTableEntry$2(this._nums, key); - else - return this.internalRemove$1(key); - }, - internalRemove$1: function(key) { - var rest, bucket, index, cell; - rest = this._rest; - if (rest == null) - return; - bucket = this._getTableBucket$2(rest, this.internalComputeHashCode$1(key)); - index = this.internalFindBucketIndex$2(bucket, key); - if (index < 0) + if (!this.containsKey$1(key)) return; - cell = bucket.splice(index, 1)[0]; - this._unlinkCell$1(cell); - return cell.get$hashMapCellValue(); + return this._fetch$1(key); }, - clear$0: function(_) { - if (this.__js_helper$_length > 0) { - this._last = null; - this._first = null; - this._rest = null; - this._nums = null; - this._strings = null; - this.__js_helper$_length = 0; - this._modifications = this._modifications + 1 & 67108863; - } + _fetch$1: function(key) { + return this._jsObject[key]; }, - forEach$1: function(_, action) { - var cell, modifications; - cell = this._first; - modifications = this._modifications; - for (; cell != null;) { - action.call$2(cell.hashMapCellKey, cell.hashMapCellValue); - if (modifications !== this._modifications) - throw H.wrapException(new P.ConcurrentModificationError(this)); - cell = cell._next; + forEach$1: function(_, f) { + var keys, t1, i, key; + keys = this._keys; + for (t1 = keys.length, i = 0; i < t1; ++i) { + key = keys[i]; + f.call$2(key, this._fetch$1(key)); } - }, - _addHashTableEntry$3: function(table, key, value) { - var cell = this._getTableCell$2(table, key); - if (cell == null) - this._setTableEntry$3(table, key, this._newLinkedCell$2(key, value)); - else - cell.set$hashMapCellValue(value); - }, - _removeHashTableEntry$2: function(table, key) { - var cell; - if (table == null) - return; - cell = this._getTableCell$2(table, key); - if (cell == null) - return; - this._unlinkCell$1(cell); - this._deleteTableEntry$2(table, key); - return cell.get$hashMapCellValue(); - }, - _newLinkedCell$2: function(key, value) { - var cell, last; - cell = new H.LinkedHashMapCell(key, value, null, null); - if (this._first == null) { - this._last = cell; - this._first = cell; - } else { - last = this._last; - cell._previous = last; - last._next = cell; - this._last = cell; + } + }, + ReflectionInfo: { + "^": "Object;jsFunction,data>,isAccessor,requiredParameterCount,optionalParameterCount,areOptionalParametersNamed,functionType,cachedSortedIndices", + static: { + ReflectionInfo_ReflectionInfo: function(jsFunction) { + var data, requiredParametersInfo, optionalParametersInfo; + data = jsFunction.$reflectionInfo; + if (data == null) + return; + data.fixed$length = Array; + data = data; + requiredParametersInfo = data[0]; + optionalParametersInfo = data[1]; + return new H.ReflectionInfo(jsFunction, data, (requiredParametersInfo & 1) === 1, requiredParametersInfo >> 1, optionalParametersInfo >> 1, (optionalParametersInfo & 1) === 1, data[2], null); } - ++this.__js_helper$_length; - this._modifications = this._modifications + 1 & 67108863; - return cell; - }, - _unlinkCell$1: function(cell) { - var previous, next; - previous = cell.get$_previous(); - next = cell.get$_next(); - if (previous == null) - this._first = next; - else - previous._next = next; - if (next == null) - this._last = previous; - else - next._previous = previous; - --this.__js_helper$_length; - this._modifications = this._modifications + 1 & 67108863; - }, - internalComputeHashCode$1: function(key) { - return J.get$hashCode$(key) & 0x3ffffff; - }, - internalFindBucketIndex$2: function(bucket, key) { - var $length, i; - if (bucket == null) - return -1; - $length = bucket.length; - for (i = 0; i < $length; ++i) - if (J.$eq$(bucket[i].get$hashMapCellKey(), key)) - return i; - return -1; - }, - toString$0: function(_) { - return P.Maps_mapToString(this); - }, - _getTableCell$2: function(table, key) { - return table[key]; - }, - _getTableBucket$2: function(table, key) { - return table[key]; - }, - _setTableEntry$3: function(table, key, value) { - table[key] = value; - }, - _deleteTableEntry$2: function(table, key) { - delete table[key]; - }, - _containsTableEntry$2: function(table, key) { - return this._getTableCell$2(table, key) != null; - }, - _newHashTable$0: function() { - var table = Object.create(null); - this._setTableEntry$3(table, "<non-identifier-key>", table); - this._deleteTableEntry$2(table, "<non-identifier-key>"); - return table; + } + }, + TypeErrorDecoder: { + "^": "Object;_pattern,_arguments,_argumentsExpr,_expr,_method,_receiver", + matchTypeError$1: function(message) { + var match, result, t1; + match = new RegExp(this._pattern).exec(message); + if (match == null) + return; + result = Object.create(null); + t1 = this._arguments; + if (t1 !== -1) + result.arguments = match[t1 + 1]; + t1 = this._argumentsExpr; + if (t1 !== -1) + result.argumentsExpr = match[t1 + 1]; + t1 = this._expr; + if (t1 !== -1) + result.expr = match[t1 + 1]; + t1 = this._method; + if (t1 !== -1) + result.method = match[t1 + 1]; + t1 = this._receiver; + if (t1 !== -1) + result.receiver = match[t1 + 1]; + return result; }, - $isInternalMap: 1, - $isMap: 1, static: { - JsLinkedHashMap_JsLinkedHashMap$es6: function($K, $V) { - return H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [$K, $V]); + TypeErrorDecoder_extractPattern: function(message) { + var match, $arguments, argumentsExpr, expr, method, receiver; + message = message.replace(String({}), '$receiver$').replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"); + match = message.match(/\\\$[a-zA-Z]+\\\$/g); + if (match == null) + match = []; + $arguments = match.indexOf("\\$arguments\\$"); + argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); + expr = match.indexOf("\\$expr\\$"); + method = match.indexOf("\\$method\\$"); + receiver = match.indexOf("\\$receiver\\$"); + return new H.TypeErrorDecoder(message.replace(new RegExp('\\\\\\$arguments\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$argumentsExpr\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$expr\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$method\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$receiver\\\\\\$', 'g'), '((?:x|[^x])*)'), $arguments, argumentsExpr, expr, method, receiver); + }, + TypeErrorDecoder_provokeCallErrorOn: function(expression) { + return function($expr$) { + var $argumentsExpr$ = '$arguments$'; + try { + $expr$.$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }(expression); + }, + TypeErrorDecoder_provokePropertyErrorOn: function(expression) { + return function($expr$) { + try { + $expr$.$method$; + } catch (e) { + return e.message; + } + }(expression); } } }, - JsLinkedHashMap_values_closure: { - "^": "Closure:0;$this", - call$1: [function(each) { - return this.$this.$index(0, each); - }, null, null, 2, 0, null, 18, "call"] - }, - LinkedHashMapCell: { - "^": "Object;hashMapCellKey<,hashMapCellValue@,_next<,_previous<" + NullError: { + "^": "Error;_message,_method", + toString$0: function(_) { + var t1 = this._method; + if (t1 == null) + return "NullError: " + H.S(this._message); + return "NullError: method not found: '" + H.S(t1) + "' on null"; + } }, - LinkedHashMapKeyIterable: { - "^": "Iterable;__js_helper$_map", - get$length: function(_) { - return this.__js_helper$_map.__js_helper$_length; - }, - get$isEmpty: function(_) { - return this.__js_helper$_map.__js_helper$_length === 0; - }, - get$iterator: function(_) { + JsNoSuchMethodError: { + "^": "Error;_message,_method,_receiver", + toString$0: function(_) { var t1, t2; - t1 = this.__js_helper$_map; - t2 = new H.LinkedHashMapKeyIterator(t1, t1._modifications, null, null); - t2._cell = t1._first; - return t2; - }, - contains$1: function(_, element) { - return this.__js_helper$_map.containsKey$1(element); - }, - forEach$1: function(_, f) { - var t1, cell, modifications; - t1 = this.__js_helper$_map; - cell = t1._first; - modifications = t1._modifications; - for (; cell != null;) { - f.call$1(cell.hashMapCellKey); - if (modifications !== t1._modifications) - throw H.wrapException(new P.ConcurrentModificationError(t1)); - cell = cell._next; - } - }, - $isEfficientLength: 1 - }, - LinkedHashMapKeyIterator: { - "^": "Object;__js_helper$_map,_modifications,_cell,__js_helper$_current", - get$current: function() { - return this.__js_helper$_current; + t1 = this._method; + if (t1 == null) + return "NoSuchMethodError: " + H.S(this._message); + t2 = this._receiver; + if (t2 == null) + return "NoSuchMethodError: method not found: '" + H.S(t1) + "' (" + H.S(this._message) + ")"; + return "NoSuchMethodError: method not found: '" + H.S(t1) + "' on '" + H.S(t2) + "' (" + H.S(this._message) + ")"; }, - moveNext$0: function() { - var t1 = this.__js_helper$_map; - if (this._modifications !== t1._modifications) - throw H.wrapException(new P.ConcurrentModificationError(t1)); - else { - t1 = this._cell; - if (t1 == null) { - this.__js_helper$_current = null; - return false; - } else { - this.__js_helper$_current = t1.hashMapCellKey; - this._cell = t1._next; - return true; - } + static: { + JsNoSuchMethodError$: function(_message, match) { + var t1, t2; + t1 = match == null; + t2 = t1 ? null : match.method; + return new H.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver); } } }, - initHooks_closure: { - "^": "Closure:0;getTag", - call$1: function(o) { - return this.getTag(o); + UnknownJsTypeError: { + "^": "Error;_message", + toString$0: function(_) { + var t1 = this._message; + return t1.length === 0 ? "Error" : "Error: " + t1; } }, - initHooks_closure0: { - "^": "Closure:22;getUnknownTag", - call$2: function(o, tag) { - return this.getUnknownTag(o, tag); - } + ExceptionAndStackTrace: { + "^": "Object;dartException,stackTrace<" }, - initHooks_closure1: { - "^": "Closure:36;prototypeForTag", - call$1: function(tag) { - return this.prototypeForTag(tag); + unwrapException_saveStackTrace: { + "^": "Closure:0;ex", + call$1: function(error) { + if (!!J.getInterceptor(error).$isError) + if (error.$thrownJsError == null) + error.$thrownJsError = this.ex; + return error; } }, - JSSyntaxRegExp: { - "^": "Object;pattern,_nativeRegExp,_nativeGlobalRegExp,_nativeAnchoredRegExp", + _StackTrace: { + "^": "Object;_exception,__js_helper$_trace", toString$0: function(_) { - return "RegExp/" + this.pattern + "/"; - }, - get$_nativeGlobalVersion: function() { - var t1 = this._nativeGlobalRegExp; + var t1, trace; + t1 = this.__js_helper$_trace; if (t1 != null) return t1; - t1 = this._nativeRegExp; - t1 = H.JSSyntaxRegExp_makeNative(this.pattern, t1.multiline, !t1.ignoreCase, true); - this._nativeGlobalRegExp = t1; - return t1; - }, - get$_nativeAnchoredVersion: function() { - var t1 = this._nativeAnchoredRegExp; - if (t1 != null) - return t1; - t1 = this._nativeRegExp; - t1 = H.JSSyntaxRegExp_makeNative(this.pattern + "|()", t1.multiline, !t1.ignoreCase, true); - this._nativeAnchoredRegExp = t1; + t1 = this._exception; + trace = t1 !== null && typeof t1 === "object" ? t1.stack : null; + t1 = trace == null ? "" : trace; + this.__js_helper$_trace = t1; return t1; - }, - firstMatch$1: function(string) { - var m = this._nativeRegExp.exec(H.checkString(string)); - if (m == null) - return; - return new H._MatchImplementation(this, m); - }, - allMatches$2: function(_, string, start) { - H.checkString(string); - H.checkInt(start); - if (start > string.length) - throw H.wrapException(P.RangeError$range(start, 0, string.length, null, null)); - return new H._AllMatchesIterable(this, string, start); - }, - allMatches$1: function($receiver, string) { - return this.allMatches$2($receiver, string, 0); - }, - _execGlobal$2: function(string, start) { - var regexp, match; - regexp = this.get$_nativeGlobalVersion(); - regexp.lastIndex = start; - match = regexp.exec(string); - if (match == null) - return; - return new H._MatchImplementation(this, match); - }, - _execAnchored$2: function(string, start) { - var regexp, match, t1, t2; - regexp = this.get$_nativeAnchoredVersion(); - regexp.lastIndex = start; - match = regexp.exec(string); - if (match == null) - return; - t1 = match.length; - t2 = t1 - 1; - if (t2 < 0) - return H.ioore(match, t2); - if (match[t2] != null) - return; - C.JSArray_methods.set$length(match, t2); - return new H._MatchImplementation(this, match); - }, - matchAsPrefix$2: function(_, string, start) { - if (start < 0 || start > string.length) - throw H.wrapException(P.RangeError$range(start, 0, string.length, null, null)); - return this._execAnchored$2(string, start); - }, - $isRegExp: 1, - static: { - JSSyntaxRegExp_makeNative: function(source, multiLine, caseSensitive, global) { - var m, i, g, regexp; - H.checkString(source); - m = multiLine ? "m" : ""; - i = caseSensitive ? "" : "i"; - g = global ? "g" : ""; - regexp = function(source, modifiers) { - try { - return new RegExp(source, modifiers); - } catch (e) { - return e; - } - }(source, m + i + g); - if (regexp instanceof RegExp) - return regexp; - throw H.wrapException(new P.FormatException("Illegal RegExp pattern (" + String(regexp) + ")", source, null)); - } } }, - _MatchImplementation: { - "^": "Object;pattern,_match", - get$start: function(_) { - return this._match.index; - }, - get$end: function() { - var t1, t2; - t1 = this._match; - t2 = t1.index; - if (0 >= t1.length) - return H.ioore(t1, 0); - t1 = J.get$length$asx(t1[0]); - if (typeof t1 !== "number") - return H.iae(t1); - return t2 + t1; - }, - $index: function(_, index) { - var t1 = this._match; - if (index >>> 0 !== index || index >= t1.length) - return H.ioore(t1, index); - return t1[index]; + invokeClosure_closure: { + "^": "Closure:1;closure", + call$0: function() { + return this.closure.call$0(); } }, - _AllMatchesIterable: { - "^": "IterableBase;_re,_string,_start", - get$iterator: function(_) { - return new H._AllMatchesIterator(this._re, this._string, this._start, null); - }, - $asIterableBase: function() { - return [P.Match]; - }, - $asIterable: function() { - return [P.Match]; + invokeClosure_closure0: { + "^": "Closure:1;closure,arg1", + call$0: function() { + return this.closure.call$1(this.arg1); } }, - _AllMatchesIterator: { - "^": "Object;_regExp,_string,_nextIndex,__js_helper$_current", - get$current: function() { - return this.__js_helper$_current; - }, - moveNext$0: function() { - var t1, t2, match, t3, nextIndex; - t1 = this._string; - if (t1 == null) - return false; - t2 = this._nextIndex; - if (t2 <= t1.length) { - match = this._regExp._execGlobal$2(t1, t2); - if (match != null) { - this.__js_helper$_current = match; - t1 = match._match; - t2 = t1.index; - if (0 >= t1.length) - return H.ioore(t1, 0); - t3 = J.get$length$asx(t1[0]); - if (typeof t3 !== "number") - return H.iae(t3); - nextIndex = t2 + t3; - this._nextIndex = t1.index === nextIndex ? nextIndex + 1 : nextIndex; - return true; - } - } - this.__js_helper$_current = null; - this._string = null; - return false; + invokeClosure_closure1: { + "^": "Closure:1;closure,arg1,arg2", + call$0: function() { + return this.closure.call$2(this.arg1, this.arg2); } }, - StringMatch: { - "^": "Object;start>,input,pattern", - get$end: function() { - return this.start + this.pattern.length; - }, - $index: function(_, g) { - if (g !== 0) - H.throwExpression(P.RangeError$value(g, null, null)); - return this.pattern; + invokeClosure_closure2: { + "^": "Closure:1;closure,arg1,arg2,arg3", + call$0: function() { + return this.closure.call$3(this.arg1, this.arg2, this.arg3); } }, - _StringAllMatchesIterable: { - "^": "Iterable;_input,_pattern,__js_helper$_index", - get$iterator: function(_) { - return new H._StringAllMatchesIterator(this._input, this._pattern, this.__js_helper$_index, null); + invokeClosure_closure3: { + "^": "Closure:1;closure,arg1,arg2,arg3,arg4", + call$0: function() { + return this.closure.call$4(this.arg1, this.arg2, this.arg3, this.arg4); + } + }, + Closure: { + "^": "Object;", + toString$0: function(_) { + return "Closure '" + H.Primitives_objectTypeName(this) + "'"; }, - $asIterable: function() { - return [P.Match]; + get$$call: function() { + return this; + }, + get$$call: function() { + return this; } }, - _StringAllMatchesIterator: { - "^": "Object;_input,_pattern,__js_helper$_index,__js_helper$_current", - moveNext$0: function() { - var t1, t2, t3, t4, t5, t6, index, end; - t1 = this.__js_helper$_index; - t2 = this._pattern; - t3 = t2.length; - t4 = this._input; - t5 = J.getInterceptor$asx(t4); - t6 = t5.get$length(t4); - if (typeof t6 !== "number") - return H.iae(t6); - if (t1 + t3 > t6) { - this.__js_helper$_current = null; + TearOffClosure: { + "^": "Closure;" + }, + StaticClosure: { + "^": "TearOffClosure;", + toString$0: function(_) { + var $name = this.$static_name; + if ($name == null) + return "Closure of unknown static method"; + return "Closure '" + $name + "'"; + } + }, + BoundClosure: { + "^": "TearOffClosure;_self,_target,_receiver,_name", + $eq: function(_, other) { + if (other == null) return false; - } - index = t4.indexOf(t2, this.__js_helper$_index); - if (index < 0) { - this.__js_helper$_index = J.$add$ns(t5.get$length(t4), 1); - this.__js_helper$_current = null; + if (this === other) + return true; + if (!(other instanceof H.BoundClosure)) return false; - } - end = index + t3; - this.__js_helper$_current = new H.StringMatch(index, t4, t2); - this.__js_helper$_index = end === this.__js_helper$_index ? end + 1 : end; - return true; - }, - get$current: function() { - return this.__js_helper$_current; - } - } - }], ["", "package:stack_trace/src/chain.dart",, U, { - "^": "", - Chain: { - "^": "Object;traces", - get$terse: function() { - return this.foldFrames$2$terse(new U.Chain_terse_closure(), true); + return this._self === other._self && this._target === other._target && this._receiver === other._receiver; }, - foldFrames$2$terse: function(predicate, terse) { - var foldedTraces, nonEmptyTraces; - foldedTraces = H.setRuntimeTypeInfo(new H.MappedListIterable(this.traces, new U.Chain_foldFrames_closure(predicate, true)), [null, null]); - nonEmptyTraces = foldedTraces.super$Iterable$where(foldedTraces, new U.Chain_foldFrames_closure0(true)); - if (!nonEmptyTraces.get$iterator(nonEmptyTraces).moveNext$0() && !foldedTraces.get$isEmpty(foldedTraces)) - return new U.Chain(P.List_List$unmodifiable([foldedTraces.get$last(foldedTraces)], Y.Trace)); - return new U.Chain(P.List_List$unmodifiable(nonEmptyTraces, Y.Trace)); - }, - toTrace$0: function() { - var t1 = this.traces; - return new Y.Trace(P.List_List$unmodifiable(H.setRuntimeTypeInfo(new H.ExpandIterable(t1, new U.Chain_toTrace_closure()), [H.getTypeArgumentByIndex(t1, 0), null]), A.Frame)); + get$hashCode: function(_) { + var t1, receiverHashCode; + t1 = this._receiver; + if (t1 == null) + receiverHashCode = H.Primitives_objectHashCode(this._self); + else + receiverHashCode = typeof t1 !== "object" ? J.get$hashCode$(t1) : H.Primitives_objectHashCode(t1); + t1 = H.Primitives_objectHashCode(this._target); + if (typeof receiverHashCode !== "number") + return receiverHashCode.$xor(); + return (receiverHashCode ^ t1) >>> 0; }, toString$0: function(_) { - var t1 = this.traces; - return H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new U.Chain_toString_closure(H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new U.Chain_toString_closure0()), [null, null]).fold$2(0, 0, P.math__max$closure()))), [null, null]).join$1(0, "===== asynchronous gap ===========================\n"); + var receiver = this._receiver; + if (receiver == null) + receiver = this._self; + return "Closure '" + H.S(this._name) + "' of " + H.Primitives_objectToHumanReadableString(receiver); }, static: { - Chain_Chain$parse: function(chain) { - var t1 = J.getInterceptor$asx(chain); - if (t1.get$isEmpty(chain) === true) - return new U.Chain(P.List_List$unmodifiable([], Y.Trace)); - if (t1.contains$1(chain, "===== asynchronous gap ===========================\n") !== true) - return new U.Chain(P.List_List$unmodifiable([Y.Trace_Trace$parse(chain)], Y.Trace)); - return new U.Chain(P.List_List$unmodifiable(H.setRuntimeTypeInfo(new H.MappedListIterable(t1.split$1(chain, "===== asynchronous gap ===========================\n"), new U.closure2()), [null, null]), Y.Trace)); - } - } - }, - closure2: { - "^": "Closure:0;", - call$1: [function(trace) { - return Y.Trace$parseFriendly(trace); - }, null, null, 2, 0, null, 14, "call"] - }, - Chain_terse_closure: { - "^": "Closure:0;", - call$1: function(_) { - return false; + BoundClosure_selfOf: function(closure) { + return closure._self; + }, + BoundClosure_receiverOf: function(closure) { + return closure._receiver; + }, + BoundClosure_selfFieldName: function() { + var t1 = $.BoundClosure_selfFieldNameCache; + if (t1 == null) { + t1 = H.BoundClosure_computeFieldNamed("self"); + $.BoundClosure_selfFieldNameCache = t1; + } + return t1; + }, + BoundClosure_computeFieldNamed: function(fieldName) { + var template, t1, names, i, $name; + template = new H.BoundClosure("self", "target", "receiver", "name"); + t1 = Object.getOwnPropertyNames(template); + t1.fixed$length = Array; + names = t1; + for (t1 = names.length, i = 0; i < t1; ++i) { + $name = names[i]; + if (template[$name] === fieldName) + return $name; + } + } } }, - Chain_foldFrames_closure: { - "^": "Closure:0;predicate,terse", - call$1: [function(trace) { - return trace.foldFrames$2$terse(this.predicate, this.terse); - }, null, null, 2, 0, null, 14, "call"] - }, - Chain_foldFrames_closure0: { - "^": "Closure:0;terse", - call$1: function(trace) { - if (trace.get$frames().length > 1) - return true; - if (trace.get$frames().length === 0) - return false; - if (!this.terse) - return false; - return C.JSArray_methods.get$single(trace.get$frames()).get$line() != null; + CastErrorImplementation: { + "^": "Error;message>", + toString$0: function(_) { + return this.message; + }, + static: { + CastErrorImplementation$: function(actualType, expectedType) { + return new H.CastErrorImplementation("CastError: Casting value of type " + H.S(actualType) + " to incompatible type " + H.S(expectedType)); + } } }, - Chain_toTrace_closure: { - "^": "Closure:0;", - call$1: function(trace) { - return trace.get$frames(); + RuntimeError: { + "^": "Error;message>", + toString$0: function(_) { + return "RuntimeError: " + H.S(this.message); } }, - Chain_toString_closure0: { - "^": "Closure:0;", - call$1: [function(trace) { - return H.setRuntimeTypeInfo(new H.MappedListIterable(trace.get$frames(), new U.Chain_toString__closure0()), [null, null]).fold$2(0, 0, P.math__max$closure()); - }, null, null, 2, 0, null, 14, "call"] - }, - Chain_toString__closure0: { - "^": "Closure:0;", - call$1: [function(frame) { - return J.get$length$asx(J.get$location$x(frame)); - }, null, null, 2, 0, null, 11, "call"] - }, - Chain_toString_closure: { - "^": "Closure:0;longest", - call$1: [function(trace) { - return H.setRuntimeTypeInfo(new H.MappedListIterable(trace.get$frames(), new U.Chain_toString__closure(this.longest)), [null, null]).join$0(0); - }, null, null, 2, 0, null, 14, "call"] - }, - Chain_toString__closure: { - "^": "Closure:0;longest", - call$1: [function(frame) { - return H.S(B.padRight(J.get$location$x(frame), this.longest)) + " " + H.S(frame.get$member()) + "\n"; - }, null, null, 2, 0, null, 11, "call"] - } - }], ["dart._internal", "dart:_internal",, H, { - "^": "", - IterableElementError_noElement: function() { - return new P.StateError("No element"); - }, - IterableElementError_tooMany: function() { - return new P.StateError("Too many elements"); - }, - IterableElementError_tooFew: function() { - return new P.StateError("Too few elements"); + RuntimeType: { + "^": "Object;" }, - CodeUnits: { - "^": "UnmodifiableListBase;__internal$_string", - get$length: function(_) { - return this.__internal$_string.length; - }, - $index: function(_, i) { - return C.JSString_methods.codeUnitAt$1(this.__internal$_string, i); - }, - $asUnmodifiableListBase: function() { - return [P.$int]; - }, - $asListBase: function() { - return [P.$int]; + RuntimeFunctionType: { + "^": "RuntimeType;returnType,parameterTypes,optionalParameterTypes,namedParameters", + _isTest$1: function(expression) { + var functionTypeObject = this._extractFunctionTypeObjectFrom$1(expression); + return functionTypeObject == null ? false : H.isFunctionSubtype(functionTypeObject, this.toRti$0()); }, - $asList: function() { - return [P.$int]; - } - }, - ListIterable: { - "^": "Iterable;", - get$iterator: function(_) { - return new H.ListIterator(this, this.get$length(this), 0, null); + _extractFunctionTypeObjectFrom$1: function(o) { + var interceptor = J.getInterceptor(o); + return "$signature" in interceptor ? interceptor.$signature() : null; }, - forEach$1: function(_, action) { - var $length, i; - $length = this.get$length(this); - for (i = 0; i < $length; ++i) { - action.call$1(this.elementAt$1(0, i)); - if ($length !== this.get$length(this)) - throw H.wrapException(new P.ConcurrentModificationError(this)); + toRti$0: function() { + var result, t1, t2, namedRti, keys, i, $name; + result = {func: "dynafunc"}; + t1 = this.returnType; + t2 = J.getInterceptor(t1); + if (!!t2.$isVoidRuntimeType) + result.v = true; + else if (!t2.$isDynamicRuntimeType) + result.ret = t1.toRti$0(); + t1 = this.parameterTypes; + if (t1 != null && t1.length !== 0) + result.args = H.RuntimeFunctionType_listToRti(t1); + t1 = this.optionalParameterTypes; + if (t1 != null && t1.length !== 0) + result.opt = H.RuntimeFunctionType_listToRti(t1); + t1 = this.namedParameters; + if (t1 != null) { + namedRti = Object.create(null); + keys = H.extractKeys(t1); + for (t2 = keys.length, i = 0; i < t2; ++i) { + $name = keys[i]; + namedRti[$name] = t1[$name].toRti$0(); + } + result.named = namedRti; } + return result; }, - get$isEmpty: function(_) { - return this.get$length(this) === 0; - }, - get$last: function(_) { - if (this.get$length(this) === 0) - throw H.wrapException(H.IterableElementError_noElement()); - return this.elementAt$1(0, this.get$length(this) - 1); - }, - contains$1: function(_, element) { - var $length, i; - $length = this.get$length(this); - for (i = 0; i < $length; ++i) { - if (J.$eq$(this.elementAt$1(0, i), element)) - return true; - if ($length !== this.get$length(this)) - throw H.wrapException(new P.ConcurrentModificationError(this)); + toString$0: function(_) { + var t1, t2, result, needsComma, i, type, keys, $name; + t1 = this.parameterTypes; + if (t1 != null) + for (t2 = t1.length, result = "(", needsComma = false, i = 0; i < t2; ++i, needsComma = true) { + type = t1[i]; + if (needsComma) + result += ", "; + result += H.S(type); + } + else { + result = "("; + needsComma = false; } - return false; - }, - join$1: function(_, separator) { - var $length, first, buffer, i, t1; - $length = this.get$length(this); - if (separator.length !== 0) { - if ($length === 0) - return ""; - first = H.S(this.elementAt$1(0, 0)); - if ($length !== this.get$length(this)) - throw H.wrapException(new P.ConcurrentModificationError(this)); - buffer = new P.StringBuffer(first); - for (i = 1; i < $length; ++i) { - buffer._contents += separator; - buffer._contents += H.S(this.elementAt$1(0, i)); - if ($length !== this.get$length(this)) - throw H.wrapException(new P.ConcurrentModificationError(this)); + t1 = this.optionalParameterTypes; + if (t1 != null && t1.length !== 0) { + result = (needsComma ? result + ", " : result) + "["; + for (t2 = t1.length, needsComma = false, i = 0; i < t2; ++i, needsComma = true) { + type = t1[i]; + if (needsComma) + result += ", "; + result += H.S(type); } - t1 = buffer._contents; - return t1.charCodeAt(0) == 0 ? t1 : t1; + result += "]"; } else { - buffer = new P.StringBuffer(""); - for (i = 0; i < $length; ++i) { - buffer._contents += H.S(this.elementAt$1(0, i)); - if ($length !== this.get$length(this)) - throw H.wrapException(new P.ConcurrentModificationError(this)); + t1 = this.namedParameters; + if (t1 != null) { + result = (needsComma ? result + ", " : result) + "{"; + keys = H.extractKeys(t1); + for (t2 = keys.length, needsComma = false, i = 0; i < t2; ++i, needsComma = true) { + $name = keys[i]; + if (needsComma) + result += ", "; + result += H.S(t1[$name].toRti$0()) + " " + $name; + } + result += "}"; } - t1 = buffer._contents; - return t1.charCodeAt(0) == 0 ? t1 : t1; } + return result + (") -> " + H.S(this.returnType)); }, - join$0: function($receiver) { - return this.join$1($receiver, ""); - }, - map$1: function(_, f) { - return H.setRuntimeTypeInfo(new H.MappedListIterable(this, f), [H.getRuntimeTypeArgument(this, "ListIterable", 0), null]); - }, - fold$2: function(_, initialValue, combine) { - var $length, value, i; - $length = this.get$length(this); - for (value = initialValue, i = 0; i < $length; ++i) { - value = combine.call$2(value, this.elementAt$1(0, i)); - if ($length !== this.get$length(this)) - throw H.wrapException(new P.ConcurrentModificationError(this)); + static: { + RuntimeFunctionType_listToRti: function(list) { + var result, t1, i; + list = list; + result = []; + for (t1 = list.length, i = 0; i < t1; ++i) + result.push(list[i].toRti$0()); + return result; } - return value; + } + }, + DynamicRuntimeType: { + "^": "RuntimeType;", + toString$0: function(_) { + return "dynamic"; }, - toList$1$growable: function(_, growable) { - var result, i, t1; - result = H.setRuntimeTypeInfo([], [H.getRuntimeTypeArgument(this, "ListIterable", 0)]); - C.JSArray_methods.set$length(result, this.get$length(this)); - for (i = 0; i < this.get$length(this); ++i) { - t1 = this.elementAt$1(0, i); - if (i >= result.length) - return H.ioore(result, i); - result[i] = t1; - } - return result; - }, - toList$0: function($receiver) { - return this.toList$1$growable($receiver, true); - }, - $isEfficientLength: 1 + toRti$0: function() { + return; + } }, - SubListIterable: { - "^": "ListIterable;_iterable,__internal$_start,_endOrLength", - get$_endIndex: function() { - var $length, t1, t2; - $length = J.get$length$asx(this._iterable); - t1 = this._endOrLength; - if (t1 != null) { - if (typeof t1 !== "number") - return t1.$gt(); - t2 = t1 > $length; - } else - t2 = true; - if (t2) - return $length; - return t1; - }, - get$_startIndex: function() { - var $length, t1; - $length = J.get$length$asx(this._iterable); - t1 = this.__internal$_start; - if (t1 > $length) - return $length; - return t1; - }, - get$length: function(_) { - var $length, t1, t2, t3; - $length = J.get$length$asx(this._iterable); - t1 = this.__internal$_start; - if (t1 >= $length) - return 0; - t2 = this._endOrLength; - if (t2 != null) { - if (typeof t2 !== "number") - return t2.$ge(); - t3 = t2 >= $length; - } else - t3 = true; - if (t3) - return $length - t1; - if (typeof t2 !== "number") - return t2.$sub(); - return t2 - t1; - }, - elementAt$1: function(_, index) { - var t1, realIndex; - t1 = this.get$_startIndex(); - if (typeof index !== "number") - return H.iae(index); - realIndex = t1 + index; - if (!(index < 0)) { - t1 = this.get$_endIndex(); - if (typeof t1 !== "number") - return H.iae(t1); - t1 = realIndex >= t1; - } else - t1 = true; - if (t1) - throw H.wrapException(P.IndexError$(index, this, "index", null, null)); - return J.elementAt$1$ax(this._iterable, realIndex); - }, - take$1: function(_, count) { - var t1, t2, newEnd; - if (count < 0) - H.throwExpression(P.RangeError$range(count, 0, null, "count", null)); - t1 = this._endOrLength; - t2 = this.__internal$_start; - if (t1 == null) - return H.SubListIterable$(this._iterable, t2, t2 + count, H.getTypeArgumentByIndex(this, 0)); - else { - newEnd = t2 + count; - if (typeof t1 !== "number") - return t1.$lt(); - if (t1 < newEnd) - return this; - return H.SubListIterable$(this._iterable, t2, newEnd, H.getTypeArgumentByIndex(this, 0)); - } - }, - toList$1$growable: function(_, growable) { - var start, t1, t2, end, end0, t3, $length, result, i; - start = this.__internal$_start; - t1 = this._iterable; - t2 = J.getInterceptor$asx(t1); - end = t2.get$length(t1); - end0 = this._endOrLength; - if (end0 != null) { - if (typeof end0 !== "number") - return end0.$lt(); - t3 = end0 < end; - } else - t3 = false; - if (t3) - end = end0; - if (typeof end !== "number") - return end.$sub(); - $length = end - start; - if ($length < 0) - $length = 0; - result = H.setRuntimeTypeInfo(new Array($length), [H.getTypeArgumentByIndex(this, 0)]); - for (i = 0; i < $length; ++i) { - t3 = t2.elementAt$1(t1, start + i); - if (i >= result.length) - return H.ioore(result, i); - result[i] = t3; - if (t2.get$length(t1) < end) - throw H.wrapException(new P.ConcurrentModificationError(this)); - } - return result; - }, - SubListIterable$3: function(_iterable, _start, _endOrLength, $E) { - var t1, t2; - t1 = this.__internal$_start; - if (t1 < 0) - H.throwExpression(P.RangeError$range(t1, 0, null, "start", null)); - t2 = this._endOrLength; - if (t2 != null) { - if (typeof t2 !== "number") - return t2.$lt(); - if (t2 < 0) - H.throwExpression(P.RangeError$range(t2, 0, null, "end", null)); - if (t1 > t2) - throw H.wrapException(P.RangeError$range(t1, 0, t2, "start", null)); - } + RuntimeTypePlain: { + "^": "RuntimeType;_jsConstructorName", + toRti$0: function() { + var t1, rti; + t1 = this._jsConstructorName; + rti = H.jsConstructorNameToRti(t1); + if (rti == null) + throw H.wrapException("no type for '" + t1 + "'"); + return rti; }, - static: { - SubListIterable$: function(_iterable, _start, _endOrLength, $E) { - var t1 = H.setRuntimeTypeInfo(new H.SubListIterable(_iterable, _start, _endOrLength), [$E]); - t1.SubListIterable$3(_iterable, _start, _endOrLength, $E); - return t1; - } + toString$0: function(_) { + return this._jsConstructorName; } }, - ListIterator: { - "^": "Object;_iterable,__internal$_length,__internal$_index,_current", - get$current: function() { - return this._current; + RuntimeTypeGeneric: { + "^": "RuntimeType;_jsConstructorName,$arguments,rti", + toRti$0: function() { + var t1, result, t2, _i; + t1 = this.rti; + if (t1 != null) + return t1; + t1 = this._jsConstructorName; + result = [H.jsConstructorNameToRti(t1)]; + if (0 >= result.length) + return H.ioore(result, 0); + if (result[0] == null) + throw H.wrapException("no type for '" + t1 + "<...>'"); + for (t1 = this.$arguments, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) + result.push(t1[_i].toRti$0()); + this.rti = result; + return result; }, - moveNext$0: function() { - var t1, t2, $length, t3; - t1 = this._iterable; - t2 = J.getInterceptor$asx(t1); - $length = t2.get$length(t1); - if (this.__internal$_length !== $length) - throw H.wrapException(new P.ConcurrentModificationError(t1)); - t3 = this.__internal$_index; - if (t3 >= $length) { - this._current = null; - return false; - } - this._current = t2.elementAt$1(t1, t3); - ++this.__internal$_index; - return true; + toString$0: function(_) { + var t1 = this.$arguments; + return this._jsConstructorName + "<" + (t1 && C.JSArray_methods).join$1(t1, ", ") + ">"; } }, - MappedIterable: { - "^": "Iterable;_iterable,_f", - get$iterator: function(_) { - var t1 = new H.MappedIterator(null, J.get$iterator$ax(this._iterable), this._f); - t1.$builtinTypeInfo = this.$builtinTypeInfo; - return t1; - }, + JsLinkedHashMap: { + "^": "Object;__js_helper$_length,_strings,_nums,_rest,_first,_last,_modifications", get$length: function(_) { - return J.get$length$asx(this._iterable); + return this.__js_helper$_length; }, get$isEmpty: function(_) { - return J.get$isEmpty$asx(this._iterable); - }, - get$last: function(_) { - return this._f$1(J.get$last$ax(this._iterable)); - }, - _f$1: function(arg0) { - return this._f.call$1(arg0); - }, - $asIterable: function($S, $T) { - return [$T]; + return this.__js_helper$_length === 0; }, - static: { - MappedIterable_MappedIterable: function(iterable, $function, $S, $T) { - if (!!J.getInterceptor(iterable).$isEfficientLength) - return H.setRuntimeTypeInfo(new H.EfficientLengthMappedIterable(iterable, $function), [$S, $T]); - return H.setRuntimeTypeInfo(new H.MappedIterable(iterable, $function), [$S, $T]); - } - } - }, - EfficientLengthMappedIterable: { - "^": "MappedIterable;_iterable,_f", - $isEfficientLength: 1 - }, - MappedIterator: { - "^": "Iterator;_current,_iterator,_f", - moveNext$0: function() { - var t1 = this._iterator; - if (t1.moveNext$0()) { - this._current = this._f$1(t1.get$current()); - return true; - } - this._current = null; - return false; + get$isNotEmpty: function(_) { + return !this.get$isEmpty(this); }, - get$current: function() { - return this._current; + get$keys: function() { + return H.setRuntimeTypeInfo(new H.LinkedHashMapKeyIterable(this), [H.getTypeArgumentByIndex(this, 0)]); }, - _f$1: function(arg0) { - return this._f.call$1(arg0); - } - }, - MappedListIterable: { - "^": "ListIterable;_source,_f", - get$length: function(_) { - return J.get$length$asx(this._source); + get$values: function(_) { + return H.MappedIterable_MappedIterable(this.get$keys(), new H.JsLinkedHashMap_values_closure(this), H.getTypeArgumentByIndex(this, 0), H.getTypeArgumentByIndex(this, 1)); }, - elementAt$1: function(_, index) { - return this._f$1(J.elementAt$1$ax(this._source, index)); + containsKey$1: function(key) { + var strings, nums; + if (typeof key === "string") { + strings = this._strings; + if (strings == null) + return false; + return this._containsTableEntry$2(strings, key); + } else if (typeof key === "number" && (key & 0x3ffffff) === key) { + nums = this._nums; + if (nums == null) + return false; + return this._containsTableEntry$2(nums, key); + } else + return this.internalContainsKey$1(key); }, - _f$1: function(arg0) { - return this._f.call$1(arg0); + internalContainsKey$1: function(key) { + var rest = this._rest; + if (rest == null) + return false; + return this.internalFindBucketIndex$2(this._getTableBucket$2(rest, this.internalComputeHashCode$1(key)), key) >= 0; }, - $asListIterable: function($S, $T) { - return [$T]; + $index: function(_, key) { + var strings, cell, nums; + if (typeof key === "string") { + strings = this._strings; + if (strings == null) + return; + cell = this._getTableCell$2(strings, key); + return cell == null ? null : cell.get$hashMapCellValue(); + } else if (typeof key === "number" && (key & 0x3ffffff) === key) { + nums = this._nums; + if (nums == null) + return; + cell = this._getTableCell$2(nums, key); + return cell == null ? null : cell.get$hashMapCellValue(); + } else + return this.internalGet$1(key); }, - $asIterable: function($S, $T) { - return [$T]; + internalGet$1: function(key) { + var rest, bucket, index; + rest = this._rest; + if (rest == null) + return; + bucket = this._getTableBucket$2(rest, this.internalComputeHashCode$1(key)); + index = this.internalFindBucketIndex$2(bucket, key); + if (index < 0) + return; + return bucket[index].get$hashMapCellValue(); }, - $isEfficientLength: 1 - }, - WhereIterable: { - "^": "Iterable;_iterable,_f", - get$iterator: function(_) { - var t1 = new H.WhereIterator(J.get$iterator$ax(this._iterable), this._f); - t1.$builtinTypeInfo = this.$builtinTypeInfo; - return t1; - } - }, - WhereIterator: { - "^": "Iterator;_iterator,_f", - moveNext$0: function() { - for (var t1 = this._iterator; t1.moveNext$0();) - if (this._f$1(t1.get$current()) === true) - return true; - return false; + $indexSet: function(_, key, value) { + var strings, nums, rest, hash, bucket, index; + if (typeof key === "string") { + strings = this._strings; + if (strings == null) { + strings = this._newHashTable$0(); + this._strings = strings; + } + this._addHashTableEntry$3(strings, key, value); + } else if (typeof key === "number" && (key & 0x3ffffff) === key) { + nums = this._nums; + if (nums == null) { + nums = this._newHashTable$0(); + this._nums = nums; + } + this._addHashTableEntry$3(nums, key, value); + } else { + rest = this._rest; + if (rest == null) { + rest = this._newHashTable$0(); + this._rest = rest; + } + hash = this.internalComputeHashCode$1(key); + bucket = this._getTableBucket$2(rest, hash); + if (bucket == null) + this._setTableEntry$3(rest, hash, [this._newLinkedCell$2(key, value)]); + else { + index = this.internalFindBucketIndex$2(bucket, key); + if (index >= 0) + bucket[index].set$hashMapCellValue(value); + else + bucket.push(this._newLinkedCell$2(key, value)); + } + } }, - get$current: function() { - return this._iterator.get$current(); + remove$1: function(_, key) { + if (typeof key === "string") + return this._removeHashTableEntry$2(this._strings, key); + else if (typeof key === "number" && (key & 0x3ffffff) === key) + return this._removeHashTableEntry$2(this._nums, key); + else + return this.internalRemove$1(key); }, - _f$1: function(arg0) { - return this._f.call$1(arg0); - } - }, - ExpandIterable: { - "^": "Iterable;_iterable,_f", - get$iterator: function(_) { - return new H.ExpandIterator(J.get$iterator$ax(this._iterable), this._f, C.C_EmptyIterator, null); + internalRemove$1: function(key) { + var rest, bucket, index, cell; + rest = this._rest; + if (rest == null) + return; + bucket = this._getTableBucket$2(rest, this.internalComputeHashCode$1(key)); + index = this.internalFindBucketIndex$2(bucket, key); + if (index < 0) + return; + cell = bucket.splice(index, 1)[0]; + this._unlinkCell$1(cell); + return cell.get$hashMapCellValue(); }, - $asIterable: function($S, $T) { - return [$T]; - } - }, - ExpandIterator: { - "^": "Object;_iterator,_f,_currentExpansion,_current", - get$current: function() { - return this._current; + clear$0: function(_) { + if (this.__js_helper$_length > 0) { + this._last = null; + this._first = null; + this._rest = null; + this._nums = null; + this._strings = null; + this.__js_helper$_length = 0; + this._modifications = this._modifications + 1 & 67108863; + } }, - moveNext$0: function() { - var t1, t2; - t1 = this._currentExpansion; - if (t1 == null) - return false; - for (t2 = this._iterator; !t1.moveNext$0();) { - this._current = null; - if (t2.moveNext$0()) { - this._currentExpansion = null; - t1 = J.get$iterator$ax(this._f$1(t2.get$current())); - this._currentExpansion = t1; - } else - return false; + forEach$1: function(_, action) { + var cell, modifications; + cell = this._first; + modifications = this._modifications; + for (; cell != null;) { + action.call$2(cell.hashMapCellKey, cell.hashMapCellValue); + if (modifications !== this._modifications) + throw H.wrapException(new P.ConcurrentModificationError(this)); + cell = cell._next; } - this._current = this._currentExpansion.get$current(); - return true; }, - _f$1: function(arg0) { - return this._f.call$1(arg0); - } - }, - SkipWhileIterable: { - "^": "Iterable;_iterable,_f", - get$iterator: function(_) { - var t1 = new H.SkipWhileIterator(J.get$iterator$ax(this._iterable), this._f, false); - t1.$builtinTypeInfo = this.$builtinTypeInfo; - return t1; - } - }, - SkipWhileIterator: { - "^": "Iterator;_iterator,_f,_hasSkipped", - moveNext$0: function() { - if (!this._hasSkipped) { - this._hasSkipped = true; - for (var t1 = this._iterator; t1.moveNext$0();) - if (this._f$1(t1.get$current()) !== true) - return true; + _addHashTableEntry$3: function(table, key, value) { + var cell = this._getTableCell$2(table, key); + if (cell == null) + this._setTableEntry$3(table, key, this._newLinkedCell$2(key, value)); + else + cell.set$hashMapCellValue(value); + }, + _removeHashTableEntry$2: function(table, key) { + var cell; + if (table == null) + return; + cell = this._getTableCell$2(table, key); + if (cell == null) + return; + this._unlinkCell$1(cell); + this._deleteTableEntry$2(table, key); + return cell.get$hashMapCellValue(); + }, + _newLinkedCell$2: function(key, value) { + var cell, last; + cell = new H.LinkedHashMapCell(key, value, null, null); + if (this._first == null) { + this._last = cell; + this._first = cell; + } else { + last = this._last; + cell._previous = last; + last._next = cell; + this._last = cell; } - return this._iterator.moveNext$0(); + ++this.__js_helper$_length; + this._modifications = this._modifications + 1 & 67108863; + return cell; }, - get$current: function() { - return this._iterator.get$current(); + _unlinkCell$1: function(cell) { + var previous, next; + previous = cell.get$_previous(); + next = cell._next; + if (previous == null) + this._first = next; + else + previous._next = next; + if (next == null) + this._last = previous; + else + next._previous = previous; + --this.__js_helper$_length; + this._modifications = this._modifications + 1 & 67108863; }, - _f$1: function(arg0) { - return this._f.call$1(arg0); - } - }, - EmptyIterator: { - "^": "Object;", - moveNext$0: function() { - return false; + internalComputeHashCode$1: function(key) { + return J.get$hashCode$(key) & 0x3ffffff; }, - get$current: function() { - return; - } - }, - FixedLengthListMixin: { - "^": "Object;", - set$length: function(receiver, newLength) { - throw H.wrapException(new P.UnsupportedError("Cannot change the length of a fixed-length list")); + internalFindBucketIndex$2: function(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) + if (J.$eq$(bucket[i].get$hashMapCellKey(), key)) + return i; + return -1; }, - add$1: function(receiver, value) { - throw H.wrapException(new P.UnsupportedError("Cannot add to a fixed-length list")); + toString$0: function(_) { + return P.Maps_mapToString(this); }, - replaceRange$3: function(receiver, start, end, iterable) { - throw H.wrapException(new P.UnsupportedError("Cannot remove from a fixed-length list")); - } - }, - UnmodifiableListMixin: { - "^": "Object;", - $indexSet: function(_, index, value) { - throw H.wrapException(new P.UnsupportedError("Cannot modify an unmodifiable list")); + _getTableCell$2: function(table, key) { + return table[key]; }, - set$length: function(_, newLength) { - throw H.wrapException(new P.UnsupportedError("Cannot change the length of an unmodifiable list")); + _getTableBucket$2: function(table, key) { + return table[key]; }, - add$1: function(_, value) { - throw H.wrapException(new P.UnsupportedError("Cannot add to an unmodifiable list")); + _setTableEntry$3: function(table, key, value) { + table[key] = value; }, - setRange$4: function(_, start, end, iterable, skipCount) { - throw H.wrapException(new P.UnsupportedError("Cannot modify an unmodifiable list")); + _deleteTableEntry$2: function(table, key) { + delete table[key]; }, - setRange$3: function($receiver, start, end, iterable) { - return this.setRange$4($receiver, start, end, iterable, 0); + _containsTableEntry$2: function(table, key) { + return this._getTableCell$2(table, key) != null; }, - replaceRange$3: function(_, start, end, iterable) { - throw H.wrapException(new P.UnsupportedError("Cannot remove from an unmodifiable list")); + _newHashTable$0: function() { + var table = Object.create(null); + this._setTableEntry$3(table, "<non-identifier-key>", table); + this._deleteTableEntry$2(table, "<non-identifier-key>"); + return table; }, - $isList: 1, - $asList: null, - $isEfficientLength: 1 + $isInternalMap: 1, + $isMap: 1, + static: { + JsLinkedHashMap_JsLinkedHashMap$es6: function($K, $V) { + return H.setRuntimeTypeInfo(new H.JsLinkedHashMap(0, null, null, null, null, null, 0), [$K, $V]); + } + } }, - UnmodifiableListBase: { - "^": "ListBase+UnmodifiableListMixin;", - $isList: 1, - $asList: null, - $isEfficientLength: 1 + JsLinkedHashMap_values_closure: { + "^": "Closure:0;$this", + call$1: function(each) { + return this.$this.$index(0, each); + } }, - ReversedListIterable: { - "^": "ListIterable;_source", + LinkedHashMapCell: { + "^": "Object;hashMapCellKey<,hashMapCellValue@,_next,_previous<" + }, + LinkedHashMapKeyIterable: { + "^": "Iterable;_map", get$length: function(_) { - return J.get$length$asx(this._source); + return this._map.__js_helper$_length; }, - elementAt$1: function(_, index) { - var t1, t2, t3; - t1 = this._source; - t2 = J.getInterceptor$asx(t1); - t3 = t2.get$length(t1); - if (typeof index !== "number") - return H.iae(index); - return t2.elementAt$1(t1, t3 - 1 - index); + get$isEmpty: function(_) { + return this._map.__js_helper$_length === 0; + }, + get$iterator: function(_) { + var t1, t2; + t1 = this._map; + t2 = new H.LinkedHashMapKeyIterator(t1, t1._modifications, null, null); + t2._cell = t1._first; + return t2; + }, + contains$1: function(_, element) { + return this._map.containsKey$1(element); + }, + forEach$1: function(_, f) { + var t1, cell, modifications; + t1 = this._map; + cell = t1._first; + modifications = t1._modifications; + for (; cell != null;) { + f.call$1(cell.hashMapCellKey); + if (modifications !== t1._modifications) + throw H.wrapException(new P.ConcurrentModificationError(t1)); + cell = cell._next; + } + }, + $isEfficientLength: 1 + }, + LinkedHashMapKeyIterator: { + "^": "Object;_map,_modifications,_cell,__js_helper$_current", + get$current: function() { + return this.__js_helper$_current; + }, + moveNext$0: function() { + var t1 = this._map; + if (this._modifications !== t1._modifications) + throw H.wrapException(new P.ConcurrentModificationError(t1)); + else { + t1 = this._cell; + if (t1 == null) { + this.__js_helper$_current = null; + return false; + } else { + this.__js_helper$_current = t1.hashMapCellKey; + this._cell = t1._next; + return true; + } + } } }, - Symbol0: { - "^": "Object;__internal$_name<", - $eq: function(_, other) { - if (other == null) - return false; - return other instanceof H.Symbol0 && J.$eq$(this.__internal$_name, other.__internal$_name); + initHooks_closure: { + "^": "Closure:0;getTag", + call$1: function(o) { + return this.getTag(o); + } + }, + initHooks_closure0: { + "^": "Closure:31;getUnknownTag", + call$2: function(o, tag) { + return this.getUnknownTag(o, tag); + } + }, + initHooks_closure1: { + "^": "Closure:28;prototypeForTag", + call$1: function(tag) { + return this.prototypeForTag(tag); + } + }, + JSSyntaxRegExp: { + "^": "Object;pattern,_nativeRegExp,_nativeGlobalRegExp,_nativeAnchoredRegExp", + toString$0: function(_) { + return "RegExp/" + this.pattern + "/"; }, - get$hashCode: function(_) { - var hash, t1; - hash = this._hashCode; - if (hash != null) - return hash; - t1 = J.get$hashCode$(this.__internal$_name); + get$_nativeGlobalVersion: function() { + var t1 = this._nativeGlobalRegExp; + if (t1 != null) + return t1; + t1 = this._nativeRegExp; + t1 = H.JSSyntaxRegExp_makeNative(this.pattern, t1.multiline, !t1.ignoreCase, true); + this._nativeGlobalRegExp = t1; + return t1; + }, + get$_nativeAnchoredVersion: function() { + var t1 = this._nativeAnchoredRegExp; + if (t1 != null) + return t1; + t1 = this._nativeRegExp; + t1 = H.JSSyntaxRegExp_makeNative(this.pattern + "|()", t1.multiline, !t1.ignoreCase, true); + this._nativeAnchoredRegExp = t1; + return t1; + }, + firstMatch$1: function(string) { + var m = this._nativeRegExp.exec(H.checkString(string)); + if (m == null) + return; + return new H._MatchImplementation(this, m); + }, + allMatches$2: function(_, string, start) { + H.checkString(string); + H.checkInt(start); + if (start > string.length) + throw H.wrapException(P.RangeError$range(start, 0, string.length, null, null)); + return new H._AllMatchesIterable(this, string, start); + }, + allMatches$1: function($receiver, string) { + return this.allMatches$2($receiver, string, 0); + }, + _execGlobal$2: function(string, start) { + var regexp, match; + regexp = this.get$_nativeGlobalVersion(); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return; + return new H._MatchImplementation(this, match); + }, + _execAnchored$2: function(string, start) { + var regexp, match, t1, t2; + regexp = this.get$_nativeAnchoredVersion(); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return; + t1 = match.length; + t2 = t1 - 1; + if (t2 < 0) + return H.ioore(match, t2); + if (match[t2] != null) + return; + C.JSArray_methods.set$length(match, t2); + return new H._MatchImplementation(this, match); + }, + matchAsPrefix$2: function(_, string, start) { + var t1 = J.getInterceptor$n(start); + if (t1.$lt(start, 0) || t1.$gt(start, string.length)) + throw H.wrapException(P.RangeError$range(start, 0, string.length, null, null)); + return this._execAnchored$2(string, start); + }, + $isRegExp: 1, + static: { + JSSyntaxRegExp_makeNative: function(source, multiLine, caseSensitive, global) { + var m, i, g, regexp; + H.checkString(source); + m = multiLine ? "m" : ""; + i = caseSensitive ? "" : "i"; + g = global ? "g" : ""; + regexp = function(source, modifiers) { + try { + return new RegExp(source, modifiers); + } catch (e) { + return e; + } + }(source, m + i + g); + if (regexp instanceof RegExp) + return regexp; + throw H.wrapException(new P.FormatException("Illegal RegExp pattern (" + String(regexp) + ")", source, null)); + } + } + }, + _MatchImplementation: { + "^": "Object;pattern,_match", + get$start: function(_) { + return this._match.index; + }, + get$end: function() { + var t1, t2; + t1 = this._match; + t2 = t1.index; + if (0 >= t1.length) + return H.ioore(t1, 0); + t1 = J.get$length$asx(t1[0]); if (typeof t1 !== "number") return H.iae(t1); - hash = 536870911 & 664597 * t1; - this._hashCode = hash; - return hash; + return t2 + t1; }, - toString$0: function(_) { - return 'Symbol("' + H.S(this.__internal$_name) + '")'; + $index: function(_, index) { + var t1 = this._match; + if (index >>> 0 !== index || index >= t1.length) + return H.ioore(t1, index); + return t1[index]; + } + }, + _AllMatchesIterable: { + "^": "IterableBase;_re,_string,_start", + get$iterator: function(_) { + return new H._AllMatchesIterator(this._re, this._string, this._start, null); + }, + $asIterableBase: function() { + return [P.Match]; + }, + $asIterable: function() { + return [P.Match]; + } + }, + _AllMatchesIterator: { + "^": "Object;_regExp,_string,_nextIndex,__js_helper$_current", + get$current: function() { + return this.__js_helper$_current; + }, + moveNext$0: function() { + var t1, t2, match, t3, nextIndex; + t1 = this._string; + if (t1 == null) + return false; + t2 = this._nextIndex; + if (t2 <= t1.length) { + match = this._regExp._execGlobal$2(t1, t2); + if (match != null) { + this.__js_helper$_current = match; + t1 = match._match; + t2 = t1.index; + if (0 >= t1.length) + return H.ioore(t1, 0); + t3 = J.get$length$asx(t1[0]); + if (typeof t3 !== "number") + return H.iae(t3); + nextIndex = t2 + t3; + this._nextIndex = t1.index === nextIndex ? nextIndex + 1 : nextIndex; + return true; + } + } + this.__js_helper$_current = null; + this._string = null; + return false; + } + }, + StringMatch: { + "^": "Object;start>,input,pattern", + get$end: function() { + return J.$add$ns(this.start, this.pattern.length); + }, + $index: function(_, g) { + if (g !== 0) + H.throwExpression(P.RangeError$value(g, null, null)); + return this.pattern; + } + }, + _StringAllMatchesIterable: { + "^": "Iterable;_input,_pattern,__js_helper$_index", + get$iterator: function(_) { + return new H._StringAllMatchesIterator(this._input, this._pattern, this.__js_helper$_index, null); + }, + $asIterable: function() { + return [P.Match]; + } + }, + _StringAllMatchesIterator: { + "^": "Object;_input,_pattern,__js_helper$_index,__js_helper$_current", + moveNext$0: function() { + var t1, t2, t3, t4, index, end; + t1 = this._pattern; + t2 = t1.length; + t3 = this._input; + t4 = J.getInterceptor$asx(t3); + if (J.$gt$n(J.$add$ns(this.__js_helper$_index, t2), t4.get$length(t3))) { + this.__js_helper$_current = null; + return false; + } + index = t3.indexOf(t1, this.__js_helper$_index); + if (index < 0) { + this.__js_helper$_index = J.$add$ns(t4.get$length(t3), 1); + this.__js_helper$_current = null; + return false; + } + end = index + t2; + this.__js_helper$_current = new H.StringMatch(index, t3, t1); + this.__js_helper$_index = end === this.__js_helper$_index ? end + 1 : end; + return true; + }, + get$current: function() { + return this.__js_helper$_current; } } }], ["dart._js_names", "dart:_js_names",, H, { @@ -5265,297 +4964,561 @@ t1.fixed$length = Array; return t1; } - }], ["dart.async", "dart:async",, P, { + }], ["dart2js._js_primitives", "dart:_js_primitives",, H, { "^": "", - _AsyncRun__initializeScheduleImmediate: function() { - var t1, div, span; - t1 = {}; - if (self.scheduleImmediate != null) - return P.async__AsyncRun__scheduleImmediateJsOverride$closure(); - if (self.MutationObserver != null && self.document != null) { - div = self.document.createElement("div"); - span = self.document.createElement("span"); - t1.storedCallback = null; - new self.MutationObserver(H.convertDartClosureToJS(new P._AsyncRun__initializeScheduleImmediate_internalCallback(t1), 1)).observe(div, {childList: true}); - return new P._AsyncRun__initializeScheduleImmediate_closure(t1, div, span); - } else if (self.setImmediate != null) - return P.async__AsyncRun__scheduleImmediateWithSetImmediate$closure(); - return P.async__AsyncRun__scheduleImmediateWithTimer$closure(); - }, - _AsyncRun__scheduleImmediateJsOverride: [function(callback) { - ++init.globalState.topEventLoop._activeJsAsyncCount; - self.scheduleImmediate(H.convertDartClosureToJS(new P._AsyncRun__scheduleImmediateJsOverride_internalCallback(callback), 0)); - }, "call$1", "async__AsyncRun__scheduleImmediateJsOverride$closure", 2, 0, 4], - _AsyncRun__scheduleImmediateWithSetImmediate: [function(callback) { - ++init.globalState.topEventLoop._activeJsAsyncCount; - self.setImmediate(H.convertDartClosureToJS(new P._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(callback), 0)); - }, "call$1", "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", 2, 0, 4], - _AsyncRun__scheduleImmediateWithTimer: [function(callback) { - P.Timer__createTimer(C.Duration_0, callback); - }, "call$1", "async__AsyncRun__scheduleImmediateWithTimer$closure", 2, 0, 4], - _asyncHelper: function(object, bodyFunctionOrErrorCode, completer) { - if (bodyFunctionOrErrorCode === 0) { - J.complete$1$x(completer, object); + printString: function(string) { + if (typeof dartPrint == "function") { + dartPrint(string); return; - } else if (bodyFunctionOrErrorCode === 1) { - completer.completeError$2(H.unwrapException(object), H.getTraceFromException(object)); + } + if (typeof console == "object" && typeof console.log != "undefined") { + console.log(string); return; } - P._awaitOnObject(object, bodyFunctionOrErrorCode); - return completer.get$future(); - }, - _awaitOnObject: function(object, bodyFunction) { - var thenCallback, errorCallback, t1, future; - thenCallback = new P._awaitOnObject_closure(bodyFunction); - errorCallback = new P._awaitOnObject_closure0(bodyFunction); - t1 = J.getInterceptor(object); - if (!!t1.$is_Future) - object._thenNoZoneRegistration$2(thenCallback, errorCallback); - else if (!!t1.$isFuture) - object.then$2$onError(thenCallback, errorCallback); - else { - future = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); - future._state = 4; - future._resultOrListeners = object; - future._thenNoZoneRegistration$2(thenCallback, null); + if (typeof window == "object") + return; + if (typeof print == "function") { + print(string); + return; } + throw "Unable to print message: " + String(string); + } + }], ["dart.typed_data.implementation", "dart:_native_typed_data",, H, { + "^": "", + _checkLength: function($length) { + if (typeof $length !== "number" || Math.floor($length) !== $length) + throw H.wrapException(P.ArgumentError$("Invalid length " + H.S($length))); + return $length; }, - _wrapJsFunctionForAsync: function($function) { - var $protected = function(fn, ERROR) { - return function(errorCode, result) { - while (true) - try { - fn(errorCode, result); - break; - } catch (error) { - result = error; - errorCode = ERROR; - } - }; - }($function, 1); - return $.Zone__current.registerBinaryCallback$1(new P._wrapJsFunctionForAsync_closure($protected)); - }, - _invokeErrorHandler: function(errorHandler, error, stackTrace) { - var t1 = H.getDynamicRuntimeType(); - t1 = H.buildFunctionType(t1, [t1, t1])._isTest$1(errorHandler); - if (t1) - return errorHandler.call$2(error, stackTrace); + _checkValidRange: function(start, end, $length) { + var t1; + if (!(start >>> 0 !== start)) + t1 = end >>> 0 !== end || start > end || end > $length; else - return errorHandler.call$1(error); - }, - _registerErrorHandler: function(errorHandler, zone) { - var t1 = H.getDynamicRuntimeType(); - t1 = H.buildFunctionType(t1, [t1, t1])._isTest$1(errorHandler); + t1 = true; if (t1) - return zone.registerBinaryCallback$1(errorHandler); - else - return zone.registerUnaryCallback$1(errorHandler); - }, - Future_Future$value: function(value, $T) { - var t1 = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [$T]); - t1._asyncComplete$1(value); - return t1; + throw H.wrapException(H.diagnoseRangeError(start, end, $length)); + return end; }, - Completer_Completer$sync: function($T) { - return H.setRuntimeTypeInfo(new P._SyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [$T])), [$T]); + NativeByteBuffer: { + "^": "Interceptor;", + $isNativeByteBuffer: 1, + "%": "ArrayBuffer" }, - _completeWithErrorCallback: function(result, error, stackTrace) { - var replacement = $.Zone__current.errorCallback$2(error, stackTrace); - if (replacement != null) { - error = J.get$error$x(replacement); - error = error != null ? error : new P.NullThrownError(); - stackTrace = replacement.get$stackTrace(); - } - result._completeError$2(error, stackTrace); + NativeTypedData: { + "^": "Interceptor;", + _invalidPosition$3: function(receiver, position, $length, $name) { + if (typeof position !== "number" || Math.floor(position) !== position) + throw H.wrapException(P.ArgumentError$value(position, $name, "Invalid list position")); + else + throw H.wrapException(P.RangeError$range(position, 0, $length, $name, null)); + }, + _checkPosition$3: function(receiver, position, $length, $name) { + if (position >>> 0 !== position || position > $length) + this._invalidPosition$3(receiver, position, $length, $name); + }, + $isNativeTypedData: 1, + "%": "DataView;ArrayBufferView;NativeTypedArray|NativeTypedArray_ListMixin|NativeTypedArray_ListMixin_FixedLengthListMixin|NativeTypedArrayOfDouble|NativeTypedArray_ListMixin0|NativeTypedArray_ListMixin_FixedLengthListMixin0|NativeTypedArrayOfInt" }, - _microtaskLoop: function() { - var t1, t2; - for (; t1 = $._nextCallback, t1 != null;) { - $._lastPriorityCallback = null; - t2 = t1.next; - $._nextCallback = t2; - if (t2 == null) - $._lastCallback = null; - t1.callback.call$0(); - } + NativeTypedArray: { + "^": "NativeTypedData;", + get$length: function(receiver) { + return receiver.length; + }, + _setRangeFast$4: function(receiver, start, end, source, skipCount) { + var targetLength, count, sourceLength; + targetLength = receiver.length; + this._checkPosition$3(receiver, start, targetLength, "start"); + this._checkPosition$3(receiver, end, targetLength, "end"); + if (J.$gt$n(start, end)) + throw H.wrapException(P.RangeError$range(start, 0, end, null, null)); + count = J.$sub$n(end, start); + if (J.$lt$n(skipCount, 0)) + throw H.wrapException(P.ArgumentError$(skipCount)); + sourceLength = source.length; + if (typeof skipCount !== "number") + return H.iae(skipCount); + if (typeof count !== "number") + return H.iae(count); + if (sourceLength - skipCount < count) + throw H.wrapException(new P.StateError("Not enough elements")); + if (skipCount !== 0 || sourceLength !== count) + source = source.subarray(skipCount, skipCount + count); + receiver.set(source, start); + }, + $isJavaScriptIndexingBehavior: 1, + $asJavaScriptIndexingBehavior: Isolate.functionThatReturnsNull, + $isJSIndexable: 1, + $asJSIndexable: Isolate.functionThatReturnsNull }, - _startMicrotaskLoop: [function() { - $._isInCallbackLoop = true; - try { - P._microtaskLoop(); - } finally { - $._lastPriorityCallback = null; - $._isInCallbackLoop = false; - if ($._nextCallback != null) - $.$get$_AsyncRun__scheduleImmediateClosure().call$1(P.async___startMicrotaskLoop$closure()); - } - }, "call$0", "async___startMicrotaskLoop$closure", 0, 0, 2], - _scheduleAsyncCallback: function(callback) { - var newEntry = new P._AsyncCallbackEntry(callback, null); - if ($._nextCallback == null) { - $._lastCallback = newEntry; - $._nextCallback = newEntry; - if (!$._isInCallbackLoop) - $.$get$_AsyncRun__scheduleImmediateClosure().call$1(P.async___startMicrotaskLoop$closure()); - } else { - $._lastCallback.next = newEntry; - $._lastCallback = newEntry; + NativeTypedArrayOfDouble: { + "^": "NativeTypedArray_ListMixin_FixedLengthListMixin;", + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $indexSet: function(receiver, index, value) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + receiver[index] = value; + }, + setRange$4: function(receiver, start, end, iterable, skipCount) { + if (!!J.getInterceptor(iterable).$isNativeTypedArrayOfDouble) { + this._setRangeFast$4(receiver, start, end, iterable, skipCount); + return; + } + this.super$ListMixin$setRange(receiver, start, end, iterable, skipCount); + }, + setRange$3: function($receiver, start, end, iterable) { + return this.setRange$4($receiver, start, end, iterable, 0); } }, - _schedulePriorityAsyncCallback: function(callback) { - var t1, entry, t2; - t1 = $._nextCallback; - if (t1 == null) { - P._scheduleAsyncCallback(callback); - $._lastPriorityCallback = $._lastCallback; - return; - } - entry = new P._AsyncCallbackEntry(callback, null); - t2 = $._lastPriorityCallback; - if (t2 == null) { - entry.next = t1; - $._lastPriorityCallback = entry; - $._nextCallback = entry; - } else { - entry.next = t2.next; - t2.next = entry; - $._lastPriorityCallback = entry; - if (entry.next == null) - $._lastCallback = entry; - } + NativeTypedArray_ListMixin: { + "^": "NativeTypedArray+ListMixin;", + $isList: 1, + $asList: function() { + return [P.$double]; + }, + $isEfficientLength: 1 }, - scheduleMicrotask: function(callback) { - var currentZone, t1; - currentZone = $.Zone__current; - if (C.C__RootZone === currentZone) { - P._rootScheduleMicrotask(null, null, C.C__RootZone, callback); - return; - } - if (C.C__RootZone === currentZone.get$_scheduleMicrotask().zone) - t1 = C.C__RootZone.get$errorZone() === currentZone.get$errorZone(); - else - t1 = false; - if (t1) { - P._rootScheduleMicrotask(null, null, currentZone, currentZone.registerCallback$1(callback)); - return; - } - t1 = $.Zone__current; - t1.scheduleMicrotask$1(t1.bindCallback$2$runGuarded(callback, true)); + NativeTypedArray_ListMixin_FixedLengthListMixin: { + "^": "NativeTypedArray_ListMixin+FixedLengthListMixin;" }, - StreamIterator_StreamIterator: function(stream, $T) { - var t1, t2, t3; - t1 = H.setRuntimeTypeInfo(new P._StreamIteratorImpl(null, null, null, 0), [$T]); - t2 = t1.get$_async$_onData(); - t3 = t1.get$_onError(); - t1._subscription = stream.listen$4$cancelOnError$onDone$onError(t2, true, t1.get$_onDone(), t3); - return t1; - }, - StreamController_StreamController: function(onCancel, onListen, onPause, onResume, sync, $T) { - return H.setRuntimeTypeInfo(new P._SyncStreamController(null, 0, null, onListen, onPause, onResume, onCancel), [$T]); + NativeTypedArrayOfInt: { + "^": "NativeTypedArray_ListMixin_FixedLengthListMixin0;", + $indexSet: function(receiver, index, value) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + receiver[index] = value; + }, + setRange$4: function(receiver, start, end, iterable, skipCount) { + if (!!J.getInterceptor(iterable).$isNativeTypedArrayOfInt) { + this._setRangeFast$4(receiver, start, end, iterable, skipCount); + return; + } + this.super$ListMixin$setRange(receiver, start, end, iterable, skipCount); + }, + setRange$3: function($receiver, start, end, iterable) { + return this.setRange$4($receiver, start, end, iterable, 0); + }, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1 }, - _runGuarded: function(notificationHandler) { - var result, e, s, exception, t1; - if (notificationHandler == null) - return; - try { - result = notificationHandler.call$0(); - if (!!J.getInterceptor(result).$isFuture) - return result; - return; - } catch (exception) { - t1 = H.unwrapException(exception); - e = t1; - s = H.getTraceFromException(exception); - $.Zone__current.handleUncaughtError$2(e, s); - } + NativeTypedArray_ListMixin0: { + "^": "NativeTypedArray+ListMixin;", + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1 }, - _nullDataHandler: [function(value) { - }, "call$1", "async___nullDataHandler$closure", 2, 0, 51, 7], - _nullErrorHandler: [function(error, stackTrace) { - $.Zone__current.handleUncaughtError$2(error, stackTrace); - }, function(error) { - return P._nullErrorHandler(error, null); - }, "call$2", "call$1", "async___nullErrorHandler$closure", 2, 2, 6, 5, 3, 4], - _nullDoneHandler: [function() { - }, "call$0", "async___nullDoneHandler$closure", 0, 0, 2], - _runUserCode: function(userCode, onSuccess, onError) { - var e, s, replacement, error, stackTrace, exception, t1, error0; - try { - onSuccess.call$1(userCode.call$0()); - } catch (exception) { - t1 = H.unwrapException(exception); - e = t1; - s = H.getTraceFromException(exception); - replacement = $.Zone__current.errorCallback$2(e, s); - if (replacement == null) - onError.call$2(e, s); - else { - error0 = J.get$error$x(replacement); - error = error0 != null ? error0 : new P.NullThrownError(); - stackTrace = replacement.get$stackTrace(); - onError.call$2(error, stackTrace); - } - } + NativeTypedArray_ListMixin_FixedLengthListMixin0: { + "^": "NativeTypedArray_ListMixin0+FixedLengthListMixin;" }, - _cancelAndError: function(subscription, future, error, stackTrace) { - var cancelFuture = subscription.cancel$0(); - if (!!J.getInterceptor(cancelFuture).$isFuture) - cancelFuture.whenComplete$1(new P._cancelAndError_closure(future, error, stackTrace)); - else - future._completeError$2(error, stackTrace); + NativeFloat32List: { + "^": "NativeTypedArrayOfDouble;", + $isList: 1, + $asList: function() { + return [P.$double]; + }, + $isEfficientLength: 1, + "%": "Float32Array" }, - _cancelAndErrorClosure: function(subscription, future) { - return new P._cancelAndErrorClosure_closure(subscription, future); + NativeFloat64List: { + "^": "NativeTypedArrayOfDouble;", + $isList: 1, + $asList: function() { + return [P.$double]; + }, + $isEfficientLength: 1, + "%": "Float64Array" }, - _cancelAndValue: function(subscription, future, value) { - var cancelFuture = subscription.cancel$0(); - if (!!J.getInterceptor(cancelFuture).$isFuture) - cancelFuture.whenComplete$1(new P._cancelAndValue_closure(future, value)); - else - future._complete$1(value); + NativeInt16List: { + "^": "NativeTypedArrayOfInt;", + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1, + "%": "Int16Array" }, - _addErrorWithReplacement: function(sink, error, stackTrace) { - var replacement = $.Zone__current.errorCallback$2(error, stackTrace); - if (replacement != null) { - error = J.get$error$x(replacement); - error = error != null ? error : new P.NullThrownError(); - stackTrace = replacement.get$stackTrace(); - } - sink._addError$2(error, stackTrace); + NativeInt32List: { + "^": "NativeTypedArrayOfInt;", + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1, + "%": "Int32Array" }, - Timer_Timer: function(duration, callback) { - var t1; - if (J.$eq$($.Zone__current, C.C__RootZone)) - return $.Zone__current.createTimer$2(duration, callback); - t1 = $.Zone__current; - return t1.createTimer$2(duration, t1.bindCallback$2$runGuarded(callback, true)); + NativeInt8List: { + "^": "NativeTypedArrayOfInt;", + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1, + "%": "Int8Array" }, - Timer_Timer$periodic: function(duration, callback) { - var boundCallback; - if (J.$eq$($.Zone__current, C.C__RootZone)) - return $.Zone__current.createPeriodicTimer$2(duration, callback); - boundCallback = $.Zone__current.bindUnaryCallback$2$runGuarded(callback, true); - return $.Zone__current.createPeriodicTimer$2(duration, boundCallback); + NativeUint16List: { + "^": "NativeTypedArrayOfInt;", + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1, + "%": "Uint16Array" }, - Timer__createTimer: function(duration, callback) { - var milliseconds = duration.get$inMilliseconds(); - return H.TimerImpl$(milliseconds < 0 ? 0 : milliseconds, callback); + NativeUint32List: { + "^": "NativeTypedArrayOfInt;", + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1, + "%": "Uint32Array" }, - Timer__createPeriodicTimer: function(duration, callback) { - var milliseconds = duration.get$inMilliseconds(); - return H.TimerImpl$periodic(milliseconds < 0 ? 0 : milliseconds, callback); + NativeUint8ClampedList: { + "^": "NativeTypedArrayOfInt;", + get$length: function(receiver) { + return receiver.length; + }, + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1, + "%": "CanvasPixelArray|Uint8ClampedArray" }, - _parentDelegate: function(zone) { - if (zone.get$parent(zone) == null) - return; - return zone.get$parent(zone).get$_delegate(); + NativeUint8List: { + "^": "NativeTypedArrayOfInt;", + get$length: function(receiver) { + return receiver.length; + }, + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + H.throwExpression(H.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + sublist$2: function(receiver, start, end) { + return new Uint8Array(receiver.subarray(start, H._checkValidRange(start, end, receiver.length))); + }, + $isNativeUint8List: 1, + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1, + "%": ";Uint8Array" + } + }], ["dart.async", "dart:async",, P, { + "^": "", + _AsyncRun__initializeScheduleImmediate: function() { + var t1, div, span; + t1 = {}; + if (self.scheduleImmediate != null) + return P.async__AsyncRun__scheduleImmediateJsOverride$closure(); + if (self.MutationObserver != null && self.document != null) { + div = self.document.createElement("div"); + span = self.document.createElement("span"); + t1.storedCallback = null; + new self.MutationObserver(H.convertDartClosureToJS(new P._AsyncRun__initializeScheduleImmediate_internalCallback(t1), 1)).observe(div, {childList: true}); + return new P._AsyncRun__initializeScheduleImmediate_closure(t1, div, span); + } else if (self.setImmediate != null) + return P.async__AsyncRun__scheduleImmediateWithSetImmediate$closure(); + return P.async__AsyncRun__scheduleImmediateWithTimer$closure(); }, - _rootHandleUncaughtError: [function($self, $parent, zone, error, stackTrace) { - var t1 = {}; - t1.error = error; - P._schedulePriorityAsyncCallback(new P._rootHandleUncaughtError_closure(t1, stackTrace)); - }, "call$5", "async___rootHandleUncaughtError$closure", 10, 0, 11, 0, 2, 1, 3, 4], - _rootRun: [function($self, $parent, zone, f) { + _AsyncRun__scheduleImmediateJsOverride: [function(callback) { + ++init.globalState.topEventLoop._activeJsAsyncCount; + self.scheduleImmediate(H.convertDartClosureToJS(new P._AsyncRun__scheduleImmediateJsOverride_internalCallback(callback), 0)); + }, "call$1", "async__AsyncRun__scheduleImmediateJsOverride$closure", 2, 0, 4], + _AsyncRun__scheduleImmediateWithSetImmediate: [function(callback) { + ++init.globalState.topEventLoop._activeJsAsyncCount; + self.setImmediate(H.convertDartClosureToJS(new P._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(callback), 0)); + }, "call$1", "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", 2, 0, 4], + _AsyncRun__scheduleImmediateWithTimer: [function(callback) { + P.Timer__createTimer(C.Duration_0, callback); + }, "call$1", "async__AsyncRun__scheduleImmediateWithTimer$closure", 2, 0, 4], + _asyncHelper: function(object, bodyFunctionOrErrorCode, completer) { + if (bodyFunctionOrErrorCode === 0) { + J.complete$1$x(completer, object); + return; + } else if (bodyFunctionOrErrorCode === 1) { + completer.completeError$2(H.unwrapException(object), H.getTraceFromException(object)); + return; + } + P._awaitOnObject(object, bodyFunctionOrErrorCode); + return completer.get$future(); + }, + _awaitOnObject: function(object, bodyFunction) { + var thenCallback, errorCallback, t1, future; + thenCallback = new P._awaitOnObject_closure(bodyFunction); + errorCallback = new P._awaitOnObject_closure0(bodyFunction); + t1 = J.getInterceptor(object); + if (!!t1.$is_Future) + object._thenNoZoneRegistration$2(thenCallback, errorCallback); + else if (!!t1.$isFuture) + object.then$2$onError(thenCallback, errorCallback); + else { + future = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); + future._state = 4; + future._resultOrListeners = object; + future._thenNoZoneRegistration$2(thenCallback, null); + } + }, + _wrapJsFunctionForAsync: function($function) { + var $protected = function(fn, ERROR) { + return function(errorCode, result) { + while (true) + try { + fn(errorCode, result); + break; + } catch (error) { + result = error; + errorCode = ERROR; + } + }; + }($function, 1); + return $.Zone__current.registerBinaryCallback$1(new P._wrapJsFunctionForAsync_closure($protected)); + }, + _registerErrorHandler: function(errorHandler, zone) { + var t1 = H.getDynamicRuntimeType(); + t1 = H.buildFunctionType(t1, [t1, t1])._isTest$1(errorHandler); + if (t1) + return zone.registerBinaryCallback$1(errorHandler); + else + return zone.registerUnaryCallback$1(errorHandler); + }, + Future_Future$value: function(value, $T) { + var t1 = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [$T]); + t1._asyncComplete$1(value); + return t1; + }, + Completer_Completer$sync: function($T) { + return H.setRuntimeTypeInfo(new P._SyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [$T])), [$T]); + }, + _microtaskLoop: function() { + var t1, t2; + for (; t1 = $._nextCallback, t1 != null;) { + $._lastPriorityCallback = null; + t2 = t1.next; + $._nextCallback = t2; + if (t2 == null) + $._lastCallback = null; + t1.callback.call$0(); + } + }, + _startMicrotaskLoop: [function() { + $._isInCallbackLoop = true; + try { + P._microtaskLoop(); + } finally { + $._lastPriorityCallback = null; + $._isInCallbackLoop = false; + if ($._nextCallback != null) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(P.async___startMicrotaskLoop$closure()); + } + }, "call$0", "async___startMicrotaskLoop$closure", 0, 0, 2], + _scheduleAsyncCallback: function(callback) { + var newEntry = new P._AsyncCallbackEntry(callback, null); + if ($._nextCallback == null) { + $._lastCallback = newEntry; + $._nextCallback = newEntry; + if (!$._isInCallbackLoop) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(P.async___startMicrotaskLoop$closure()); + } else { + $._lastCallback.next = newEntry; + $._lastCallback = newEntry; + } + }, + _schedulePriorityAsyncCallback: function(callback) { + var t1, entry, t2; + t1 = $._nextCallback; + if (t1 == null) { + P._scheduleAsyncCallback(callback); + $._lastPriorityCallback = $._lastCallback; + return; + } + entry = new P._AsyncCallbackEntry(callback, null); + t2 = $._lastPriorityCallback; + if (t2 == null) { + entry.next = t1; + $._lastPriorityCallback = entry; + $._nextCallback = entry; + } else { + entry.next = t2.next; + t2.next = entry; + $._lastPriorityCallback = entry; + if (entry.next == null) + $._lastCallback = entry; + } + }, + scheduleMicrotask: function(callback) { + var currentZone, t1; + currentZone = $.Zone__current; + if (C.C__RootZone === currentZone) { + P._rootScheduleMicrotask(null, null, C.C__RootZone, callback); + return; + } + if (C.C__RootZone === currentZone.get$_scheduleMicrotask().zone) + t1 = C.C__RootZone.get$errorZone() === currentZone.get$errorZone(); + else + t1 = false; + if (t1) { + P._rootScheduleMicrotask(null, null, currentZone, currentZone.registerCallback$1(callback)); + return; + } + t1 = $.Zone__current; + t1.scheduleMicrotask$1(t1.bindCallback$2$runGuarded(callback, true)); + }, + StreamIterator_StreamIterator: function(stream, $T) { + var t1, t2, t3; + t1 = H.setRuntimeTypeInfo(new P._StreamIteratorImpl(null, null, null, 0), [$T]); + t2 = t1.get$_async$_onData(); + t3 = t1.get$_onError(); + t1._subscription = stream.listen$4$cancelOnError$onDone$onError(t2, true, t1.get$_onDone(), t3); + return t1; + }, + StreamController_StreamController: function(onCancel, onListen, onPause, onResume, sync, $T) { + return H.setRuntimeTypeInfo(new P._SyncStreamController(null, 0, null, onListen, onPause, onResume, onCancel), [$T]); + }, + _runGuarded: function(notificationHandler) { + var result, e, s, exception, t1; + if (notificationHandler == null) + return; + try { + result = notificationHandler.call$0(); + if (!!J.getInterceptor(result).$isFuture) + return result; + return; + } catch (exception) { + t1 = H.unwrapException(exception); + e = t1; + s = H.getTraceFromException(exception); + $.Zone__current.handleUncaughtError$2(e, s); + } + }, + _nullDataHandler: [function(value) { + }, "call$1", "async___nullDataHandler$closure", 2, 0, 50], + _nullErrorHandler: [function(error, stackTrace) { + $.Zone__current.handleUncaughtError$2(error, stackTrace); + }, function(error) { + return P._nullErrorHandler(error, null); + }, "call$2", "call$1", "async___nullErrorHandler$closure", 2, 2, 6, 0], + _nullDoneHandler: [function() { + }, "call$0", "async___nullDoneHandler$closure", 0, 0, 2], + _runUserCode: function(userCode, onSuccess, onError) { + var e, s, replacement, error, stackTrace, exception, t1, error0; + try { + onSuccess.call$1(userCode.call$0()); + } catch (exception) { + t1 = H.unwrapException(exception); + e = t1; + s = H.getTraceFromException(exception); + replacement = $.Zone__current.errorCallback$2(e, s); + if (replacement == null) + onError.call$2(e, s); + else { + error0 = J.get$error$x(replacement); + error = error0 != null ? error0 : new P.NullThrownError(); + stackTrace = replacement.get$stackTrace(); + onError.call$2(error, stackTrace); + } + } + }, + _cancelAndError: function(subscription, future, error, stackTrace) { + var cancelFuture = subscription.cancel$0(); + if (!!J.getInterceptor(cancelFuture).$isFuture) + cancelFuture.whenComplete$1(new P._cancelAndError_closure(future, error, stackTrace)); + else + future._completeError$2(error, stackTrace); + }, + _cancelAndErrorClosure: function(subscription, future) { + return new P._cancelAndErrorClosure_closure(subscription, future); + }, + _cancelAndValue: function(subscription, future, value) { + var cancelFuture = subscription.cancel$0(); + if (!!J.getInterceptor(cancelFuture).$isFuture) + cancelFuture.whenComplete$1(new P._cancelAndValue_closure(future, value)); + else + future._complete$1(value); + }, + _addErrorWithReplacement: function(sink, error, stackTrace) { + var replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = J.get$error$x(replacement); + error = error != null ? error : new P.NullThrownError(); + stackTrace = replacement.get$stackTrace(); + } + sink._async$_addError$2(error, stackTrace); + }, + Timer_Timer: function(duration, callback) { + var t1; + if (J.$eq$($.Zone__current, C.C__RootZone)) + return $.Zone__current.createTimer$2(duration, callback); + t1 = $.Zone__current; + return t1.createTimer$2(duration, t1.bindCallback$2$runGuarded(callback, true)); + }, + Timer_Timer$periodic: function(duration, callback) { + var boundCallback; + if (J.$eq$($.Zone__current, C.C__RootZone)) + return $.Zone__current.createPeriodicTimer$2(duration, callback); + boundCallback = $.Zone__current.bindUnaryCallback$2$runGuarded(callback, true); + return $.Zone__current.createPeriodicTimer$2(duration, boundCallback); + }, + Timer__createTimer: function(duration, callback) { + var milliseconds = duration.get$inMilliseconds(); + return H.TimerImpl$(milliseconds < 0 ? 0 : milliseconds, callback); + }, + Timer__createPeriodicTimer: function(duration, callback) { + var milliseconds = duration.get$inMilliseconds(); + return H.TimerImpl$periodic(milliseconds < 0 ? 0 : milliseconds, callback); + }, + _parentDelegate: function(zone) { + if (zone.get$parent(zone) == null) + return; + return zone.get$parent(zone).get$_delegate(); + }, + _rootHandleUncaughtError: [function($self, $parent, zone, error, stackTrace) { + var t1 = {}; + t1.error = error; + P._schedulePriorityAsyncCallback(new P._rootHandleUncaughtError_closure(t1, stackTrace)); + }, "call$5", "async___rootHandleUncaughtError$closure", 10, 0, 20], + _rootRun: [function($self, $parent, zone, f) { var old, previous, t1; if (J.$eq$($.Zone__current, zone)) return f.call$0(); @@ -5568,7 +5531,7 @@ } finally { $.Zone__current = old; } - }, "call$4", "async___rootRun$closure", 8, 0, 52, 0, 2, 1, 9], + }, "call$4", "async___rootRun$closure", 8, 0, 51], _rootRunUnary: [function($self, $parent, zone, f, arg) { var old, previous, t1; if (J.$eq$($.Zone__current, zone)) @@ -5582,7 +5545,7 @@ } finally { $.Zone__current = old; } - }, "call$5", "async___rootRunUnary$closure", 10, 0, 53, 0, 2, 1, 9, 15], + }, "call$5", "async___rootRunUnary$closure", 10, 0, 52], _rootRunBinary: [function($self, $parent, zone, f, arg1, arg2) { var old, previous, t1; if (J.$eq$($.Zone__current, zone)) @@ -5596,34 +5559,34 @@ } finally { $.Zone__current = old; } - }, "call$6", "async___rootRunBinary$closure", 12, 0, 54, 0, 2, 1, 9, 23, 19], + }, "call$6", "async___rootRunBinary$closure", 12, 0, 53], _rootRegisterCallback: [function($self, $parent, zone, f) { return f; - }, "call$4", "async___rootRegisterCallback$closure", 8, 0, 55, 0, 2, 1, 9], + }, "call$4", "async___rootRegisterCallback$closure", 8, 0, 54], _rootRegisterUnaryCallback: [function($self, $parent, zone, f) { return f; - }, "call$4", "async___rootRegisterUnaryCallback$closure", 8, 0, 56, 0, 2, 1, 9], + }, "call$4", "async___rootRegisterUnaryCallback$closure", 8, 0, 55], _rootRegisterBinaryCallback: [function($self, $parent, zone, f) { return f; - }, "call$4", "async___rootRegisterBinaryCallback$closure", 8, 0, 57, 0, 2, 1, 9], + }, "call$4", "async___rootRegisterBinaryCallback$closure", 8, 0, 56], _rootErrorCallback: [function($self, $parent, zone, error, stackTrace) { return; - }, "call$5", "async___rootErrorCallback$closure", 10, 0, 58, 0, 2, 1, 3, 4], + }, "call$5", "async___rootErrorCallback$closure", 10, 0, 57], _rootScheduleMicrotask: [function($self, $parent, zone, f) { var t1 = C.C__RootZone !== zone; if (t1) f = zone.bindCallback$2$runGuarded(f, !(!t1 || C.C__RootZone.get$errorZone() === zone.get$errorZone())); P._scheduleAsyncCallback(f); - }, "call$4", "async___rootScheduleMicrotask$closure", 8, 0, 59, 0, 2, 1, 9], + }, "call$4", "async___rootScheduleMicrotask$closure", 8, 0, 58], _rootCreateTimer: [function($self, $parent, zone, duration, callback) { return P.Timer__createTimer(duration, C.C__RootZone !== zone ? zone.bindCallback$1(callback) : callback); - }, "call$5", "async___rootCreateTimer$closure", 10, 0, 60, 0, 2, 1, 20, 16], + }, "call$5", "async___rootCreateTimer$closure", 10, 0, 59], _rootCreatePeriodicTimer: [function($self, $parent, zone, duration, callback) { return P.Timer__createPeriodicTimer(duration, C.C__RootZone !== zone ? zone.bindUnaryCallback$1(callback) : callback); - }, "call$5", "async___rootCreatePeriodicTimer$closure", 10, 0, 61, 0, 2, 1, 20, 16], + }, "call$5", "async___rootCreatePeriodicTimer$closure", 10, 0, 60], _rootPrint: [function($self, $parent, zone, line) { H.printString(H.S(line)); - }, "call$4", "async___rootPrint$closure", 8, 0, 62, 0, 2, 1, 10], + }, "call$4", "async___rootPrint$closure", 8, 0, 61], _printToZone: [function(line) { J.print$1$x($.Zone__current, line); }, "call$1", "async___printToZone$closure", 2, 0, 7], @@ -5659,13 +5622,13 @@ t1._createTimer = zone.get$_createTimer(); specification.get$createPeriodicTimer(); t1._createPeriodicTimer = zone.get$_createPeriodicTimer(); - J.get$print$x(specification); + specification.get$print(specification); t1._print = zone.get$_print(); specification.get$fork(); t1._fork = zone.get$_fork(); t1._handleUncaughtError = specification.get$handleUncaughtError() != null ? new P._ZoneFunction(t1, specification.get$handleUncaughtError()) : zone.get$_handleUncaughtError(); return t1; - }, "call$5", "async___rootFork$closure", 10, 0, 63, 0, 2, 1, 31, 32], + }, "call$5", "async___rootFork$closure", 10, 0, 62], runZoned: function(body, onError, zoneSpecification, zoneValues) { var errorHandler, zone; errorHandler = new P.runZoned_closure(onError); @@ -5675,17 +5638,17 @@ }, _AsyncRun__initializeScheduleImmediate_internalCallback: { "^": "Closure:0;_box_0", - call$1: [function(_) { + call$1: function(_) { var t1, f; --init.globalState.topEventLoop._activeJsAsyncCount; t1 = this._box_0; f = t1.storedCallback; t1.storedCallback = null; f.call$0(); - }, null, null, 2, 0, null, 6, "call"] + } }, _AsyncRun__initializeScheduleImmediate_closure: { - "^": "Closure:39;_box_0,div,span", + "^": "Closure:29;_box_0,div,span", call$1: function(callback) { var t1, t2; ++init.globalState.topEventLoop._activeJsAsyncCount; @@ -5697,35 +5660,35 @@ }, _AsyncRun__scheduleImmediateJsOverride_internalCallback: { "^": "Closure:1;callback", - call$0: [function() { + call$0: function() { --init.globalState.topEventLoop._activeJsAsyncCount; this.callback.call$0(); - }, null, null, 0, 0, null, "call"] + } }, _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback: { "^": "Closure:1;callback", - call$0: [function() { + call$0: function() { --init.globalState.topEventLoop._activeJsAsyncCount; this.callback.call$0(); - }, null, null, 0, 0, null, "call"] + } }, _awaitOnObject_closure: { "^": "Closure:0;bodyFunction", - call$1: [function(result) { + call$1: function(result) { return this.bodyFunction.call$2(0, result); - }, null, null, 2, 0, null, 13, "call"] + } }, _awaitOnObject_closure0: { "^": "Closure:5;bodyFunction", - call$2: [function(error, stackTrace) { + call$2: function(error, stackTrace) { this.bodyFunction.call$2(1, new H.ExceptionAndStackTrace(error, stackTrace)); - }, null, null, 4, 0, null, 3, 4, "call"] + } }, _wrapJsFunctionForAsync_closure: { - "^": "Closure:45;$protected", - call$2: [function(errorCode, result) { + "^": "Closure:48;$protected", + call$2: function(errorCode, result) { this.$protected(errorCode, result); - }, null, null, 4, 0, null, 34, 13, "call"] + } }, Future: { "^": "Object;" @@ -5773,13 +5736,13 @@ t1._complete$1(value); }, function($receiver) { return this.complete$1($receiver, null); - }, "complete$0", "call$1", "call$0", "get$complete", 0, 2, 41, 5, 7], + }, "complete$0", "call$1", "call$0", "get$complete", 0, 2, 27, 0], _completeError$2: function(error, stackTrace) { this.future._completeError$2(error, stackTrace); } }, _FutureListener: { - "^": "Object;_nextListener@,result>,state,callback,errorCallback<", + "^": "Object;_nextListener<,result,state,callback,errorCallback", get$_zone: function() { return this.result._zone; }, @@ -5792,9 +5755,6 @@ get$handlesComplete: function() { return this.state === 8; }, - get$hasErrorCallback: function() { - return this.errorCallback != null; - }, handleValue$1: function(sourceResult) { return this.result._zone.runUnary$2(this.callback, sourceResult); }, @@ -5823,20 +5783,13 @@ } }, _Future: { - "^": "Object;_state<,_zone<,_resultOrListeners<", + "^": "Object;_state@,_zone,_resultOrListeners<", get$_isChained: function() { return this._state === 2; }, get$_isComplete: function() { return this._state >= 4; }, - get$_hasError: function() { - return this._state === 8; - }, - _setChained$1: function(source) { - this._state = 2; - this._resultOrListeners = source; - }, then$2$onError: function(f, onError) { var currentZone = $.Zone__current; if (currentZone !== C.C__RootZone) { @@ -5862,30 +5815,6 @@ this._addListener$1(new P._FutureListener(null, result, 8, t1 !== C.C__RootZone ? t1.registerCallback$1(action) : action, null)); return result; }, - _setPendingComplete$0: function() { - this._state = 1; - }, - _clearPendingComplete$0: function() { - this._state = 0; - }, - get$_error: function() { - return this._resultOrListeners; - }, - get$_chainSource: function() { - return this._resultOrListeners; - }, - _setValue$1: function(value) { - this._state = 4; - this._resultOrListeners = value; - }, - _setErrorObject$1: function(error) { - this._state = 8; - this._resultOrListeners = error; - }, - _cloneResult$1: function(source) { - this._state = source.get$_state(); - this._resultOrListeners = source.get$_resultOrListeners(); - }, _addListener$1: function(listener) { var t1, source; t1 = this._state; @@ -5899,8 +5828,8 @@ source._addListener$1(listener); return; } - this._state = source.get$_state(); - this._resultOrListeners = source.get$_resultOrListeners(); + this._state = source._state; + this._resultOrListeners = source._resultOrListeners; } this._zone.scheduleMicrotask$1(new P._Future__addListener_closure(this, listener)); } @@ -5917,8 +5846,8 @@ this._resultOrListeners = listeners; if (existingListeners != null) { for (cursor = listeners; cursor.get$_nextListener() != null;) - cursor = cursor.get$_nextListener(); - cursor.set$_nextListener(existingListeners); + cursor = cursor._nextListener; + cursor._nextListener = existingListeners; } } else { if (t2 === 2) { @@ -5927,8 +5856,8 @@ source._prependListeners$1(listeners); return; } - this._state = source.get$_state(); - this._resultOrListeners = source.get$_resultOrListeners(); + this._state = source._state; + this._resultOrListeners = source._resultOrListeners; } t1.listeners = this._reverseListeners$1(listeners); this._zone.scheduleMicrotask$1(new P._Future__prependListeners_closure(t1, this)); @@ -5943,7 +5872,7 @@ var current, prev, next; for (current = listeners, prev = null; current != null; prev = current, current = next) { next = current.get$_nextListener(); - current.set$_nextListener(prev); + current._nextListener = prev; } return prev; }, @@ -5965,7 +5894,7 @@ P._Future__propagateToListeners(this, listeners); }, function(error) { return this._completeError$2(error, null); - }, "_completeError$1", "call$2", "call$1", "get$_completeError", 2, 2, 6, 5, 3, 4], + }, "_completeError$1", "call$2", "call$1", "get$_completeError", 2, 2, 6, 0], _asyncComplete$1: function(value) { if (!!J.getInterceptor(value).$isFuture) { if (value._state === 8) { @@ -5986,7 +5915,7 @@ static: { _Future__chainForeignFuture: function(source, target) { var e, s, exception, t1; - target._setPendingComplete$0(); + target.set$_state(1); try { source.then$2$onError(new P._Future__chainForeignFuture_closure(target), new P._Future__chainForeignFuture_closure0(target)); } catch (exception) { @@ -5997,47 +5926,52 @@ } }, _Future__chainCoreFuture: function(source, target) { - var listeners; + var t1, current, listeners; for (; source.get$_isChained();) - source = source.get$_chainSource(); - if (source.get$_isComplete()) { - listeners = target._removeListeners$0(); - target._cloneResult$1(source); + source = source._resultOrListeners; + t1 = source.get$_isComplete(); + current = target._resultOrListeners; + if (t1) { + target._resultOrListeners = null; + listeners = target._reverseListeners$1(current); + target._state = source._state; + target._resultOrListeners = source._resultOrListeners; P._Future__propagateToListeners(target, listeners); } else { - listeners = target.get$_resultOrListeners(); - target._setChained$1(source); - source._prependListeners$1(listeners); + target._state = 2; + target._resultOrListeners = source; + source._prependListeners$1(current); } }, _Future__propagateToListeners: function(source, listeners) { - var t1, t2, t3, hasError, asyncError, listeners0, sourceResult, zone, oldZone, t4, result; + var t1, t2, t3, hasError, asyncError, listeners0, sourceResult, zone, oldZone, t4, result, current; t1 = {}; t1.source = source; for (t2 = source; true;) { t3 = {}; - hasError = t2.get$_hasError(); + hasError = t2._state === 8; if (listeners == null) { if (hasError) { - asyncError = t1.source.get$_error(); - t1.source.get$_zone().handleUncaughtError$2(J.get$error$x(asyncError), asyncError.get$stackTrace()); + asyncError = t2._resultOrListeners; + t2._zone.handleUncaughtError$2(J.get$error$x(asyncError), asyncError.get$stackTrace()); } return; } for (; listeners.get$_nextListener() != null; listeners = listeners0) { - listeners0 = listeners.get$_nextListener(); - listeners.set$_nextListener(null); + listeners0 = listeners._nextListener; + listeners._nextListener = null; P._Future__propagateToListeners(t1.source, listeners); } - sourceResult = t1.source.get$_resultOrListeners(); + sourceResult = t1.source._resultOrListeners; t3.listenerHasError = hasError; t3.listenerValueOrError = sourceResult; t2 = !hasError; if (!t2 || listeners.get$handlesValue() || listeners.get$handlesComplete()) { zone = listeners.get$_zone(); - if (hasError && !t1.source.get$_zone().inSameErrorZone$1(zone)) { - asyncError = t1.source.get$_error(); - t1.source.get$_zone().handleUncaughtError$2(J.get$error$x(asyncError), asyncError.get$stackTrace()); + if (hasError && !t1.source._zone.inSameErrorZone$1(zone)) { + t2 = t1.source; + asyncError = t2._resultOrListeners; + t2._zone.handleUncaughtError$2(J.get$error$x(asyncError), asyncError.get$stackTrace()); return; } oldZone = $.Zone__current; @@ -6057,11 +5991,14 @@ t2 = t3.listenerValueOrError; t4 = J.getInterceptor(t2); if (!!t4.$isFuture) { - result = J.get$result$x(listeners); + result = listeners.result; if (!!t4.$is_Future) if (t2._state >= 4) { - listeners = result._removeListeners$0(); - result._cloneResult$1(t2); + current = result._resultOrListeners; + result._resultOrListeners = null; + listeners = result._reverseListeners$1(current); + result._state = t2._state; + result._resultOrListeners = t2._resultOrListeners; t1.source = t2; continue; } else @@ -6071,14 +6008,17 @@ return; } } - result = J.get$result$x(listeners); + result = listeners.result; listeners = result._removeListeners$0(); t2 = t3.listenerHasError; t3 = t3.listenerValueOrError; - if (!t2) - result._setValue$1(t3); - else - result._setErrorObject$1(t3); + if (!t2) { + result._state = 4; + result._resultOrListeners = t3; + } else { + result._state = 8; + result._resultOrListeners = t3; + } t1.source = result; t2 = result; } @@ -6087,60 +6027,61 @@ }, _Future__addListener_closure: { "^": "Closure:1;$this,listener", - call$0: [function() { + call$0: function() { P._Future__propagateToListeners(this.$this, this.listener); - }, null, null, 0, 0, null, "call"] + } }, _Future__prependListeners_closure: { "^": "Closure:1;_box_0,$this", - call$0: [function() { + call$0: function() { P._Future__propagateToListeners(this.$this, this._box_0.listeners); - }, null, null, 0, 0, null, "call"] + } }, _Future__chainForeignFuture_closure: { "^": "Closure:0;target", - call$1: [function(value) { + call$1: function(value) { var t1 = this.target; - t1._clearPendingComplete$0(); + t1._state = 0; t1._complete$1(value); - }, null, null, 2, 0, null, 7, "call"] + } }, _Future__chainForeignFuture_closure0: { - "^": "Closure:38;target", - call$2: [function(error, stackTrace) { + "^": "Closure:32;target", + call$2: function(error, stackTrace) { this.target._completeError$2(error, stackTrace); - }, function(error) { + }, + call$1: function(error) { return this.call$2(error, null); - }, "call$1", null, null, null, 2, 2, null, 5, 3, 4, "call"] + } }, _Future__chainForeignFuture_closure1: { "^": "Closure:1;target,e,s", - call$0: [function() { + call$0: function() { this.target._completeError$2(this.e, this.s); - }, null, null, 0, 0, null, "call"] + } }, _Future__asyncComplete_closure: { "^": "Closure:1;$this,coreFuture", - call$0: [function() { + call$0: function() { P._Future__chainCoreFuture(this.coreFuture, this.$this); - }, null, null, 0, 0, null, "call"] + } }, _Future__asyncComplete_closure0: { "^": "Closure:1;$this,typedValue", - call$0: [function() { + call$0: function() { var t1, listeners; t1 = this.$this; listeners = t1._removeListeners$0(); t1._state = 4; t1._resultOrListeners = this.typedValue; P._Future__propagateToListeners(t1, listeners); - }, null, null, 0, 0, null, "call"] + } }, _Future__asyncCompleteError_closure: { "^": "Closure:1;$this,error,stackTrace", - call$0: [function() { + call$0: function() { this.$this._completeError$2(this.error, this.stackTrace); - }, null, null, 0, 0, null, "call"] + } }, _Future__propagateToListeners_handleWhenCompleteCallback: { "^": "Closure:2;_box_1,_box_0,hasError,listener", @@ -6154,7 +6095,7 @@ e = t1; s = H.getTraceFromException(exception); if (this.hasError) { - t1 = J.get$error$x(this._box_1.source.get$_error()); + t1 = J.get$error$x(this._box_1.source._resultOrListeners); t2 = e; t2 = t1 == null ? t2 == null : t1 === t2; t1 = t2; @@ -6162,7 +6103,7 @@ t1 = false; t2 = this._box_0; if (t1) - t2.listenerValueOrError = this._box_1.source.get$_error(); + t2.listenerValueOrError = this._box_1.source._resultOrListeners; else t2.listenerValueOrError = new P.AsyncError(e, s); t2.listenerHasError = true; @@ -6186,9 +6127,9 @@ }, _Future__propagateToListeners_handleWhenCompleteCallback_closure: { "^": "Closure:0;originalSource", - call$1: [function(_) { + call$1: function(_) { return this.originalSource; - }, null, null, 2, 0, null, 6, "call"] + } }, _Future__propagateToListeners_handleValueCallback: { "^": "Closure:2;_box_0,listener,sourceResult", @@ -6211,9 +6152,9 @@ call$0: function() { var asyncError, e, s, t1, t2, exception, t3, t4; try { - asyncError = this._box_1.source.get$_error(); + asyncError = this._box_1.source._resultOrListeners; t1 = this.listener; - if (t1.matchesErrorTest$1(asyncError) === true && t1.get$hasErrorCallback()) { + if (t1.matchesErrorTest$1(asyncError) === true && t1.errorCallback != null) { t2 = this._box_0; t2.listenerValueOrError = t1.handleError$1(asyncError); t2.listenerHasError = false; @@ -6223,11 +6164,11 @@ e = t1; s = H.getTraceFromException(exception); t1 = this._box_1; - t2 = J.get$error$x(t1.source.get$_error()); + t2 = J.get$error$x(t1.source._resultOrListeners); t3 = e; t4 = this._box_0; if (t2 == null ? t3 == null : t2 === t3) - t4.listenerValueOrError = t1.source.get$_error(); + t4.listenerValueOrError = t1.source._resultOrListeners; else t4.listenerValueOrError = new P.AsyncError(e, s); t4.listenerHasError = true; @@ -6242,12 +6183,6 @@ map$1: function(_, convert) { return H.setRuntimeTypeInfo(new P._MapStream(convert, this), [H.getRuntimeTypeArgument(this, "Stream", 0), null]); }, - handleError$2$test: function(onError, test) { - return H.setRuntimeTypeInfo(new P._HandleErrorStream(onError, test, this), [H.getRuntimeTypeArgument(this, "Stream", 0)]); - }, - handleError$1: function(onError) { - return this.handleError$2$test(onError, null); - }, pipe$1: function(streamConsumer) { return streamConsumer.addStream$1(this).then$1(new P.Stream_pipe_closure(streamConsumer)); }, @@ -6289,31 +6224,22 @@ future = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [[P.List, H.getRuntimeTypeArgument(this, "Stream", 0)]]); this.listen$4$cancelOnError$onDone$onError(new P.Stream_toList_closure(this, result), true, new P.Stream_toList_closure0(result, future), future.get$_completeError()); return future; - }, - get$last: function(_) { - var t1, future; - t1 = {}; - future = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [H.getRuntimeTypeArgument(this, "Stream", 0)]); - t1.result = null; - t1.foundResult = false; - this.listen$4$cancelOnError$onDone$onError(new P.Stream_last_closure(t1, this), true, new P.Stream_last_closure0(t1, future), future.get$_completeError()); - return future; } }, Stream_pipe_closure: { "^": "Closure:0;streamConsumer", - call$1: [function(_) { + call$1: function(_) { return this.streamConsumer.close$0(0); - }, null, null, 2, 0, null, 6, "call"] + } }, Stream_contains_closure: { "^": "Closure;_box_0,$this,needle,future", - call$1: [function(element) { + call$1: function(element) { var t1, t2; t1 = this._box_0; t2 = this.future; P._runUserCode(new P.Stream_contains__closure(this.needle, element), new P.Stream_contains__closure0(t1, t2), P._cancelAndErrorClosure(t1.subscription, t2)); - }, null, null, 2, 0, null, 22, "call"], + }, $signature: function() { return H.computeSignature(function(T) { return {func: 1, args: [T]}; @@ -6327,7 +6253,7 @@ } }, Stream_contains__closure0: { - "^": "Closure:37;_box_0,future", + "^": "Closure:30;_box_0,future", call$1: function(isMatch) { if (isMatch === true) P._cancelAndValue(this._box_0.subscription, this.future, true); @@ -6335,15 +6261,15 @@ }, Stream_contains_closure0: { "^": "Closure:1;future", - call$0: [function() { + call$0: function() { this.future._complete$1(false); - }, null, null, 0, 0, null, "call"] + } }, Stream_forEach_closure: { "^": "Closure;_box_0,$this,action,future", - call$1: [function(element) { + call$1: function(element) { P._runUserCode(new P.Stream_forEach__closure(this.action, element), new P.Stream_forEach__closure0(), P._cancelAndErrorClosure(this._box_0.subscription, this.future)); - }, null, null, 2, 0, null, 22, "call"], + }, $signature: function() { return H.computeSignature(function(T) { return {func: 1, args: [T]}; @@ -6363,39 +6289,39 @@ }, Stream_forEach_closure0: { "^": "Closure:1;future", - call$0: [function() { + call$0: function() { this.future._complete$1(null); - }, null, null, 0, 0, null, "call"] + } }, Stream_length_closure: { "^": "Closure:0;_box_0", - call$1: [function(_) { + call$1: function(_) { ++this._box_0.count; - }, null, null, 2, 0, null, 6, "call"] + } }, Stream_length_closure0: { "^": "Closure:1;_box_0,future", - call$0: [function() { + call$0: function() { this.future._complete$1(this._box_0.count); - }, null, null, 0, 0, null, "call"] + } }, Stream_isEmpty_closure: { "^": "Closure:0;_box_0,future", - call$1: [function(_) { + call$1: function(_) { P._cancelAndValue(this._box_0.subscription, this.future, false); - }, null, null, 2, 0, null, 6, "call"] + } }, Stream_isEmpty_closure0: { "^": "Closure:1;future", - call$0: [function() { + call$0: function() { this.future._complete$1(true); - }, null, null, 0, 0, null, "call"] + } }, Stream_toList_closure: { "^": "Closure;$this,result", - call$1: [function(data) { + call$1: function(data) { this.result.push(data); - }, null, null, 2, 0, null, 12, "call"], + }, $signature: function() { return H.computeSignature(function(T) { return {func: 1, args: [T]}; @@ -6404,52 +6330,15 @@ }, Stream_toList_closure0: { "^": "Closure:1;result,future", - call$0: [function() { + call$0: function() { this.future._complete$1(this.result); - }, null, null, 0, 0, null, "call"] - }, - Stream_last_closure: { - "^": "Closure;_box_0,$this", - call$1: [function(value) { - var t1 = this._box_0; - t1.foundResult = true; - t1.result = value; - }, null, null, 2, 0, null, 7, "call"], - $signature: function() { - return H.computeSignature(function(T) { - return {func: 1, args: [T]}; - }, this.$this, "Stream"); } }, - Stream_last_closure0: { - "^": "Closure:1;_box_0,future", - call$0: [function() { - var e, s, t1, exception; - t1 = this._box_0; - if (t1.foundResult) { - this.future._complete$1(t1.result); - return; - } - try { - t1 = H.IterableElementError_noElement(); - throw H.wrapException(t1); - } catch (exception) { - t1 = H.unwrapException(exception); - e = t1; - s = H.getTraceFromException(exception); - P._completeWithErrorCallback(this.future, e, s); - } - }, null, null, 0, 0, null, "call"] - }, StreamSubscription: { "^": "Object;" }, _StreamController: { - "^": "Object;_state<", - get$isPaused: function() { - var t1 = this._state; - return (t1 & 1) !== 0 ? this.get$_subscription().get$_isInputPaused() : (t1 & 2) === 0; - }, + "^": "Object;_state@", get$_pendingEvents: function() { if ((this._state & 8) === 0) return this._varData; @@ -6470,9 +6359,9 @@ if (state.get$varData() == null) { t1 = new P._StreamImplEvents(null, null, 0); t1.$builtinTypeInfo = this.$builtinTypeInfo; - state.set$varData(t1); + state.varData = t1; } - return state.get$varData(); + return state.varData; }, get$_subscription: function() { if ((this._state & 8) !== 0) @@ -6500,7 +6389,7 @@ return H.computeSignature(function(T) { return {func: 1, v: true, args: [T]}; }, this.$receiver, "_StreamController"); - }, 7], + }], addError$2: [function(error, stackTrace) { var replacement; if (this._state >= 4) @@ -6512,11 +6401,11 @@ error = error != null ? error : new P.NullThrownError(); stackTrace = replacement.get$stackTrace(); } - this._addError$2(error, stackTrace); + this._async$_addError$2(error, stackTrace); }, function(error) { return this.addError$2(error, null); - }, "addError$1", "call$2", "call$1", "get$addError", 2, 2, 9, 5, 3, 4], - close$0: [function(_) { + }, "addError$1", "call$2", "call$1", "get$addError", 2, 2, 10, 0], + close$0: function(_) { var t1 = this._state; if ((t1 & 4) !== 0) return this._ensureDoneFuture$0(); @@ -6529,7 +6418,7 @@ else if ((t1 & 3) === 0) this._ensurePendingEvents$0().add$1(0, C.C__DelayedDone); return this._ensureDoneFuture$0(); - }, null, "get$close", 0, 0, null], + }, _async$_add$1: function(value) { var t1, t2; t1 = this._state; @@ -6542,7 +6431,7 @@ t1.add$1(0, t2); } }, - _addError$2: function(error, stackTrace) { + _async$_addError$2: function(error, stackTrace) { var t1 = this._state; if ((t1 & 1) !== 0) this._sendError$2(error, stackTrace); @@ -6562,7 +6451,7 @@ if ((t1 & 8) !== 0) { addState = this._varData; addState.set$varData(subscription); - addState.resume$0(); + addState.addSubscription.resume$0(); } else this._varData = subscription; subscription._setPendingEvents$1(pendingEvents); @@ -6580,7 +6469,7 @@ if (t1 != null) if (result == null) try { - result = this.onCancel$0(); + result = t1.call$0(); } catch (exception) { t1 = H.unwrapException(exception); e = t1; @@ -6597,9 +6486,6 @@ else t1.call$0(); return result; - }, - onCancel$0: function() { - return this.onCancel.call$0(); } }, _StreamController__subscribe_closure: { @@ -6610,11 +6496,11 @@ }, _StreamController__recordCancel_complete: { "^": "Closure:2;$this", - call$0: [function() { + call$0: function() { var t1 = this.$this._doneFuture; if (t1 != null && t1._state === 0) t1._asyncComplete$1(null); - }, null, null, 0, 0, null, "call"] + } }, _SyncStreamControllerDispatch: { "^": "Object;", @@ -6622,7 +6508,7 @@ this.get$_subscription()._async$_add$1(data); }, _sendError$2: function(error, stackTrace) { - this.get$_subscription()._addError$2(error, stackTrace); + this.get$_subscription()._async$_addError$2(error, stackTrace); }, _sendDone$0: function() { this.get$_subscription()._close$0(); @@ -6675,13 +6561,13 @@ return H.computeSignature(function(T) { return {func: 1, v: true, args: [T]}; }, this.$receiver, "_StreamSinkWrapper"); - }, 12] + }] }, _EventSink: { "^": "Object;" }, _BufferingStreamSubscription: { - "^": "Object;_zone<,_state<", + "^": "Object;_state@", _setPendingEvents$1: function(pendingEvents) { if (pendingEvents == null) return; @@ -6736,12 +6622,6 @@ this._cancel$0(); return this._cancelFuture; }, - get$_isInputPaused: function() { - return (this._state & 4) !== 0; - }, - get$isPaused: function() { - return this._state >= 128; - }, _cancel$0: function() { var t1 = (this._state | 8) >>> 0; this._state = t1; @@ -6760,7 +6640,7 @@ else this._addPending$1(H.setRuntimeTypeInfo(new P._DelayedData(data, null), [null])); }], - _addError$2: ["super$_BufferingStreamSubscription$_addError", function(error, stackTrace) { + _async$_addError$2: ["super$_BufferingStreamSubscription$_addError", function(error, stackTrace) { var t1 = this._state; if ((t1 & 8) !== 0) return; @@ -6897,7 +6777,7 @@ }, _BufferingStreamSubscription__sendError_sendError: { "^": "Closure:2;$this,error,stackTrace", - call$0: [function() { + call$0: function() { var t1, t2, t3, t4, t5, t6; t1 = this.$this; t2 = t1._state; @@ -6914,11 +6794,11 @@ else t4.runUnaryGuarded$2(t6, t5); t1._state = (t1._state & 4294967263) >>> 0; - }, null, null, 0, 0, null, "call"] + } }, _BufferingStreamSubscription__sendDone_sendDone: { "^": "Closure:2;$this", - call$0: [function() { + call$0: function() { var t1, t2; t1 = this.$this; t2 = t1._state; @@ -6927,7 +6807,7 @@ t1._state = (t2 | 42) >>> 0; t1._zone.runGuarded$1(t1._onDone); t1._state = (t1._state & 4294967263) >>> 0; - }, null, null, 0, 0, null, "call"] + } }, _StreamImpl: { "^": "Stream;", @@ -6975,7 +6855,7 @@ } }, _PendingEvents: { - "^": "Object;_state<", + "^": "Object;_state@", schedule$1: function(dispatch) { var t1 = this._state; if (t1 === 1) @@ -6994,7 +6874,7 @@ }, _PendingEvents_schedule_closure: { "^": "Closure:1;$this,dispatch", - call$0: [function() { + call$0: function() { var t1, oldState, $event, t2; t1 = this.$this; oldState = t1._state; @@ -7007,7 +6887,7 @@ if (t2 == null) t1.lastPendingEvent = null; $event.perform$1(this.dispatch); - }, null, null, 0, 0, null, "call"] + } }, _StreamImplEvents: { "^": "_PendingEvents;firstPendingEvent,lastPendingEvent,_state", @@ -7026,10 +6906,7 @@ } }, _DoneStreamSubscription: { - "^": "Object;_zone<,_state<,_onDone", - get$isPaused: function() { - return this._state >= 4; - }, + "^": "Object;_zone,_state@,_onDone", _schedule$0: function() { if ((this._state & 2) !== 0) return; @@ -7066,7 +6943,7 @@ }, "call$0", "get$_sendDone", 0, 0, 2] }, _StreamIteratorImpl: { - "^": "Object;_subscription,_async$_current,_futureOrPrefetch,_state<", + "^": "Object;_subscription,_async$_current,_futureOrPrefetch,_state@", _clear$0: function(_) { this._subscription = null; this._futureOrPrefetch = null; @@ -7090,7 +6967,7 @@ return H.computeSignature(function(T) { return {func: 1, v: true, args: [T]}; }, this.$receiver, "_StreamIteratorImpl"); - }, 12], + }], _onError$2: [function(error, stackTrace) { var hasNext; if (this._state === 2) { @@ -7104,7 +6981,7 @@ this._state = 4; }, function(error) { return this._onError$2(error, null); - }, "_onError$1", "call$2", "call$1", "get$_onError", 2, 2, 9, 5, 3, 4], + }, "_onError$1", "call$2", "call$1", "get$_onError", 2, 2, 10, 0], _onDone$0: [function() { if (this._state === 2) { var hasNext = this._futureOrPrefetch; @@ -7133,9 +7010,9 @@ }, _cancelAndError_closure: { "^": "Closure:1;future,error,stackTrace", - call$0: [function() { + call$0: function() { return this.future._completeError$2(this.error, this.stackTrace); - }, null, null, 0, 0, null, "call"] + } }, _cancelAndErrorClosure_closure: { "^": "Closure:5;subscription,future", @@ -7145,9 +7022,9 @@ }, _cancelAndValue_closure: { "^": "Closure:1;future,value", - call$0: [function() { + call$0: function() { return this.future._complete$1(this.value); - }, null, null, 0, 0, null, "call"] + } }, _ForwardingStream: { "^": "Stream;", @@ -7167,7 +7044,7 @@ sink._async$_add$1(data); }, _handleError$3: function(error, stackTrace, sink) { - sink._addError$2(error, stackTrace); + sink._async$_addError$2(error, stackTrace); }, $asStream: function($S, $T) { return [$T]; @@ -7180,7 +7057,7 @@ return; this.super$_BufferingStreamSubscription$_add(data); }, - _addError$2: function(error, stackTrace) { + _async$_addError$2: function(error, stackTrace) { if ((this._state & 2) !== 0) return; this.super$_BufferingStreamSubscription$_addError(error, stackTrace); @@ -7211,10 +7088,10 @@ return H.computeSignature(function(S, T) { return {func: 1, v: true, args: [S]}; }, this.$receiver, "_ForwardingStreamSubscription"); - }, 12], + }], _handleError$2: [function(error, stackTrace) { this._stream._handleError$3(error, stackTrace, this); - }, "call$2", "get$_handleError", 4, 0, 10, 3, 4], + }, "call$2", "get$_handleError", 4, 0, 33], _handleDone$0: [function() { this._close$0(); }, "call$0", "get$_handleDone", 0, 0, 2], @@ -7243,7 +7120,7 @@ var outputEvent, e, s, exception, t1; outputEvent = null; try { - outputEvent = this._transform$1(inputEvent); + outputEvent = this._transform.call$1(inputEvent); } catch (exception) { t1 = H.unwrapException(exception); e = t1; @@ -7252,39 +7129,8 @@ return; } sink._async$_add$1(outputEvent); - }, - _transform$1: function(arg0) { - return this._transform.call$1(arg0); } }, - _HandleErrorStream: { - "^": "_ForwardingStream;_transform,_test,_async$_source", - _handleError$3: function(error, stackTrace, sink) { - var matches, e, s, exception, t1, t2; - matches = true; - if (matches === true) - try { - P._invokeErrorHandler(this._transform, error, stackTrace); - } catch (exception) { - t1 = H.unwrapException(exception); - e = t1; - s = H.getTraceFromException(exception); - t1 = e; - t2 = error; - if (t1 == null ? t2 == null : t1 === t2) - sink._addError$2(error, stackTrace); - else - P._addErrorWithReplacement(sink, e, s); - return; - } - else - sink._addError$2(error, stackTrace); - }, - $as_ForwardingStream: function($T) { - return [$T, $T]; - }, - $asStream: null - }, Timer: { "^": "Object;" }, @@ -7359,43 +7205,43 @@ implementation = this._delegationTarget.get$_handleUncaughtError(); implZone = implementation.zone; return implementation.$function.call$5(implZone, P._parentDelegate(implZone), zone, error, stackTrace); - }, "call$3", "get$handleUncaughtError", 6, 0, 35], + }, "call$3", "get$handleUncaughtError", 6, 0, 34], run$2: [function(zone, f) { var implementation, implZone; implementation = this._delegationTarget.get$_run(); implZone = implementation.zone; return implementation.$function.call$4(implZone, P._parentDelegate(implZone), zone, f); - }, "call$2", "get$run", 4, 0, 34], + }, "call$2", "get$run", 4, 0, 35], runUnary$3: [function(zone, f, arg) { var implementation, implZone; implementation = this._delegationTarget.get$_runUnary(); implZone = implementation.zone; return implementation.$function.call$5(implZone, P._parentDelegate(implZone), zone, f, arg); - }, "call$3", "get$runUnary", 6, 0, 32], + }, "call$3", "get$runUnary", 6, 0, 36], runBinary$4: [function(zone, f, arg1, arg2) { var implementation, implZone; implementation = this._delegationTarget.get$_runBinary(); implZone = implementation.zone; return implementation.$function.call$6(implZone, P._parentDelegate(implZone), zone, f, arg1, arg2); - }, "call$4", "get$runBinary", 8, 0, 31], + }, "call$4", "get$runBinary", 8, 0, 37], registerCallback$2: [function(zone, f) { var implementation, implZone; implementation = this._delegationTarget.get$_registerCallback(); implZone = implementation.zone; return implementation.$function.call$4(implZone, P._parentDelegate(implZone), zone, f); - }, "call$2", "get$registerCallback", 4, 0, 30], + }, "call$2", "get$registerCallback", 4, 0, 38], registerUnaryCallback$2: [function(zone, f) { var implementation, implZone; implementation = this._delegationTarget.get$_registerUnaryCallback(); implZone = implementation.zone; return implementation.$function.call$4(implZone, P._parentDelegate(implZone), zone, f); - }, "call$2", "get$registerUnaryCallback", 4, 0, 29], + }, "call$2", "get$registerUnaryCallback", 4, 0, 39], registerBinaryCallback$2: [function(zone, f) { var implementation, implZone; implementation = this._delegationTarget.get$_registerBinaryCallback(); implZone = implementation.zone; return implementation.$function.call$4(implZone, P._parentDelegate(implZone), zone, f); - }, "call$2", "get$registerBinaryCallback", 4, 0, 28], + }, "call$2", "get$registerBinaryCallback", 4, 0, 40], errorCallback$3: [function(zone, error, stackTrace) { var implementation, implZone; implementation = this._delegationTarget.get$_errorCallback(); @@ -7403,37 +7249,37 @@ if (implZone === C.C__RootZone) return; return implementation.$function.call$5(implZone, P._parentDelegate(implZone), zone, error, stackTrace); - }, "call$3", "get$errorCallback", 6, 0, 33], + }, "call$3", "get$errorCallback", 6, 0, 43], scheduleMicrotask$2: [function(zone, f) { var implementation, implZone; implementation = this._delegationTarget.get$_scheduleMicrotask(); implZone = implementation.zone; implementation.$function.call$4(implZone, P._parentDelegate(implZone), zone, f); - }, "call$2", "get$scheduleMicrotask", 4, 0, 23], + }, "call$2", "get$scheduleMicrotask", 4, 0, 22], createTimer$3: [function(zone, duration, f) { var implementation, implZone; implementation = this._delegationTarget.get$_createTimer(); implZone = implementation.zone; return implementation.$function.call$5(implZone, P._parentDelegate(implZone), zone, duration, f); - }, "call$3", "get$createTimer", 6, 0, 24], + }, "call$3", "get$createTimer", 6, 0, 23], createPeriodicTimer$3: [function(zone, period, f) { var implementation, implZone; implementation = this._delegationTarget.get$_createPeriodicTimer(); implZone = implementation.zone; return implementation.$function.call$5(implZone, P._parentDelegate(implZone), zone, period, f); - }, "call$3", "get$createPeriodicTimer", 6, 0, 25], + }, "call$3", "get$createPeriodicTimer", 6, 0, 24], print$2: [function(_, zone, line) { var implementation, implZone; implementation = this._delegationTarget.get$_print(); implZone = implementation.zone; implementation.$function.call$4(implZone, P._parentDelegate(implZone), zone, line); - }, "call$2", "get$print", 4, 0, 26], + }, "call$2", "get$print", 4, 0, 25], fork$3: [function(zone, specification, zoneValues) { var implementation, implZone; implementation = this._delegationTarget.get$_fork(); implZone = implementation.zone; return implementation.$function.call$5(implZone, P._parentDelegate(implZone), zone, specification, zoneValues); - }, "call$3", "get$fork", 6, 0, 27] + }, "call$3", "get$fork", 6, 0, 26] }, _Zone: { "^": "Object;", @@ -7537,42 +7383,42 @@ return implementation.$function.call$5(t1, parentDelegate, this, specification, zoneValues); }, function() { return this.fork$2$specification$zoneValues(null, null); - }, "fork$0", "call$2$specification$zoneValues", "call$0", "get$fork", 0, 5, 21, 5, 5], + }, "fork$0", "call$2$specification$zoneValues", "call$0", "get$fork", 0, 5, 11, 0, 0], run$1: [function(f) { var implementation, t1, parentDelegate; implementation = this._run; t1 = implementation.zone; parentDelegate = P._parentDelegate(t1); return implementation.$function.call$4(t1, parentDelegate, this, f); - }, "call$1", "get$run", 2, 0, 20], + }, "call$1", "get$run", 2, 0, 12], runUnary$2: [function(f, arg) { var implementation, t1, parentDelegate; implementation = this._runUnary; t1 = implementation.zone; parentDelegate = P._parentDelegate(t1); return implementation.$function.call$5(t1, parentDelegate, this, f, arg); - }, "call$2", "get$runUnary", 4, 0, 19], + }, "call$2", "get$runUnary", 4, 0, 13], runBinary$3: [function(f, arg1, arg2) { var implementation, t1, parentDelegate; implementation = this._runBinary; t1 = implementation.zone; parentDelegate = P._parentDelegate(t1); return implementation.$function.call$6(t1, parentDelegate, this, f, arg1, arg2); - }, "call$3", "get$runBinary", 6, 0, 18], + }, "call$3", "get$runBinary", 6, 0, 14], registerCallback$1: [function(callback) { var implementation, t1, parentDelegate; implementation = this._registerCallback; t1 = implementation.zone; parentDelegate = P._parentDelegate(t1); return implementation.$function.call$4(t1, parentDelegate, this, callback); - }, "call$1", "get$registerCallback", 2, 0, 17], + }, "call$1", "get$registerCallback", 2, 0, 15], registerUnaryCallback$1: [function(callback) { var implementation, t1, parentDelegate; implementation = this._registerUnaryCallback; t1 = implementation.zone; parentDelegate = P._parentDelegate(t1); return implementation.$function.call$4(t1, parentDelegate, this, callback); - }, "call$1", "get$registerUnaryCallback", 2, 0, 8], + }, "call$1", "get$registerUnaryCallback", 2, 0, 9], registerBinaryCallback$1: [function(callback) { var implementation, t1, parentDelegate; implementation = this._registerBinaryCallback; @@ -7588,7 +7434,7 @@ return; parentDelegate = P._parentDelegate(implementationZone); return implementation.$function.call$5(implementationZone, parentDelegate, this, error, stackTrace); - }, "call$2", "get$errorCallback", 4, 0, 15], + }, "call$2", "get$errorCallback", 4, 0, 17], scheduleMicrotask$1: [function(f) { var implementation, t1, parentDelegate; implementation = this._scheduleMicrotask; @@ -7602,14 +7448,14 @@ t1 = implementation.zone; parentDelegate = P._parentDelegate(t1); return implementation.$function.call$5(t1, parentDelegate, this, duration, f); - }, "call$2", "get$createTimer", 4, 0, 13], + }, "call$2", "get$createTimer", 4, 0, 18], createPeriodicTimer$2: [function(duration, f) { var implementation, t1, parentDelegate; implementation = this._createPeriodicTimer; t1 = implementation.zone; parentDelegate = P._parentDelegate(t1); return implementation.$function.call$5(t1, parentDelegate, this, duration, f); - }, "call$2", "get$createPeriodicTimer", 4, 0, 12], + }, "call$2", "get$createPeriodicTimer", 4, 0, 19], print$1: [function(_, line) { var implementation, t1, parentDelegate; implementation = this._print; @@ -7620,21 +7466,21 @@ }, _CustomZone_bindCallback_closure: { "^": "Closure:1;$this,registered", - call$0: [function() { + call$0: function() { return this.$this.runGuarded$1(this.registered); - }, null, null, 0, 0, null, "call"] + } }, _CustomZone_bindCallback_closure0: { "^": "Closure:1;$this,registered", - call$0: [function() { + call$0: function() { return this.$this.run$1(this.registered); - }, null, null, 0, 0, null, "call"] + } }, _CustomZone_bindUnaryCallback_closure: { "^": "Closure:0;$this,registered", - call$1: [function(arg) { + call$1: function(arg) { return this.$this.runUnaryGuarded$2(this.registered, arg); - }, null, null, 2, 0, null, 15, "call"] + } }, _rootHandleUncaughtError_closure: { "^": "Closure:1;_box_0,stackTrace", @@ -7787,68 +7633,68 @@ return P._rootFork(null, null, this, specification, zoneValues); }, function() { return this.fork$2$specification$zoneValues(null, null); - }, "fork$0", "call$2$specification$zoneValues", "call$0", "get$fork", 0, 5, 21, 5, 5], + }, "fork$0", "call$2$specification$zoneValues", "call$0", "get$fork", 0, 5, 11, 0, 0], run$1: [function(f) { if ($.Zone__current === C.C__RootZone) return f.call$0(); return P._rootRun(null, null, this, f); - }, "call$1", "get$run", 2, 0, 20], + }, "call$1", "get$run", 2, 0, 12], runUnary$2: [function(f, arg) { if ($.Zone__current === C.C__RootZone) return f.call$1(arg); return P._rootRunUnary(null, null, this, f, arg); - }, "call$2", "get$runUnary", 4, 0, 19], + }, "call$2", "get$runUnary", 4, 0, 13], runBinary$3: [function(f, arg1, arg2) { if ($.Zone__current === C.C__RootZone) return f.call$2(arg1, arg2); return P._rootRunBinary(null, null, this, f, arg1, arg2); - }, "call$3", "get$runBinary", 6, 0, 18], + }, "call$3", "get$runBinary", 6, 0, 14], registerCallback$1: [function(f) { return f; - }, "call$1", "get$registerCallback", 2, 0, 17], + }, "call$1", "get$registerCallback", 2, 0, 15], registerUnaryCallback$1: [function(f) { return f; - }, "call$1", "get$registerUnaryCallback", 2, 0, 8], + }, "call$1", "get$registerUnaryCallback", 2, 0, 9], registerBinaryCallback$1: [function(f) { return f; }, "call$1", "get$registerBinaryCallback", 2, 0, 16], errorCallback$2: [function(error, stackTrace) { return; - }, "call$2", "get$errorCallback", 4, 0, 15], + }, "call$2", "get$errorCallback", 4, 0, 17], scheduleMicrotask$1: [function(f) { P._rootScheduleMicrotask(null, null, this, f); }, "call$1", "get$scheduleMicrotask", 2, 0, 4], createTimer$2: [function(duration, f) { return P.Timer__createTimer(duration, f); - }, "call$2", "get$createTimer", 4, 0, 13], + }, "call$2", "get$createTimer", 4, 0, 18], createPeriodicTimer$2: [function(duration, f) { return P.Timer__createPeriodicTimer(duration, f); - }, "call$2", "get$createPeriodicTimer", 4, 0, 12], + }, "call$2", "get$createPeriodicTimer", 4, 0, 19], print$1: [function(_, line) { H.printString(line); }, "call$1", "get$print", 2, 0, 7] }, _RootZone_bindCallback_closure: { "^": "Closure:1;$this,f", - call$0: [function() { + call$0: function() { return this.$this.runGuarded$1(this.f); - }, null, null, 0, 0, null, "call"] + } }, _RootZone_bindCallback_closure0: { "^": "Closure:1;$this,f", - call$0: [function() { + call$0: function() { return this.$this.run$1(this.f); - }, null, null, 0, 0, null, "call"] + } }, _RootZone_bindUnaryCallback_closure: { "^": "Closure:0;$this,f", - call$1: [function(arg) { + call$1: function(arg) { return this.$this.runUnaryGuarded$2(this.f, arg); - }, null, null, 2, 0, null, 15, "call"] + } }, runZoned_closure: { - "^": "Closure:11;onError", - call$5: [function($self, $parent, zone, error, stackTrace) { + "^": "Closure:20;onError", + call$5: function($self, $parent, zone, error, stackTrace) { var e, s, t1, t2, exception; try { t1 = this.onError; @@ -7871,7 +7717,7 @@ else return $parent.handleUncaughtError$3(zone, e, s); } - }, null, null, 10, 0, null, 0, 2, 1, 3, 4, "call"] + } } }], ["dart.collection", "dart:collection",, P, { "^": "", @@ -7889,7 +7735,7 @@ }, HashMap_HashMap$from: function(other, $K, $V) { var result = P.HashMap_HashMap(null, null, null, $K, $V); - J.forEach$1$ax(other, new P.closure5(result)); + J.forEach$1$ax(other, new P.closure6(result)); return result; }, IterableBase_iterableToShortString: function(iterable, leftDelimiter, rightDelimiter) { @@ -7921,14 +7767,14 @@ t1.push(iterable); try { t2 = buffer; - t2.set$_contents(P.StringBuffer__writeAll(t2.get$_contents(), iterable, ", ")); + t2._contents = P.StringBuffer__writeAll(t2.get$_contents(), iterable, ", "); } finally { if (0 >= t1.length) return H.ioore(t1, -1); t1.pop(); } t1 = buffer; - t1.set$_contents(t1.get$_contents() + rightDelimiter); + t1._contents = t1.get$_contents() + rightDelimiter; t1 = buffer.get$_contents(); return t1.charCodeAt(0) == 0 ? t1 : t1; }, @@ -8035,11 +7881,11 @@ try { $.$get$_toStringVisiting().push(m); t2 = result; - t2.set$_contents(t2.get$_contents() + "{"); + t2._contents = t2.get$_contents() + "{"; t1.first = true; J.forEach$1$ax(m, new P.Maps_mapToString_closure(t1, result)); t1 = result; - t1.set$_contents(t1.get$_contents() + "}"); + t1._contents = t1.get$_contents() + "}"; } finally { t1 = $.$get$_toStringVisiting(); if (0 >= t1.length) @@ -8050,7 +7896,7 @@ return t1.charCodeAt(0) == 0 ? t1 : t1; }, _HashMap: { - "^": "Object;_collection$_length,_collection$_strings,_collection$_nums,_collection$_rest,_keys", + "^": "Object;_collection$_length,_collection$_strings,_collection$_nums,_collection$_rest,_collection$_keys", get$length: function(_) { return this._collection$_length; }, @@ -8140,7 +7986,7 @@ if (bucket == null) { P._HashMap__setTableEntry(rest, hash, [key, value]); ++this._collection$_length; - this._keys = null; + this._collection$_keys = null; } else { index = this._findBucketIndex$2(bucket, key); if (index >= 0) @@ -8148,7 +7994,7 @@ else { bucket.push(key, value); ++this._collection$_length; - this._keys = null; + this._collection$_keys = null; } } }, @@ -8158,13 +8004,13 @@ for ($length = keys.length, i = 0; i < $length; ++i) { key = keys[i]; action.call$2(key, this.$index(0, key)); - if (keys !== this._keys) + if (keys !== this._collection$_keys) throw H.wrapException(new P.ConcurrentModificationError(this)); } }, _collection$_computeKeys$0: function() { var t1, result, strings, names, entries, index, i, nums, rest, bucket, $length, i0; - t1 = this._keys; + t1 = this._collection$_keys; if (t1 != null) return t1; result = new Array(this._collection$_length); @@ -8201,13 +8047,13 @@ } } } - this._keys = result; + this._collection$_keys = result; return result; }, _collection$_addHashTableEntry$3: function(table, key, value) { if (table[key] == null) { ++this._collection$_length; - this._keys = null; + this._collection$_keys = null; } P._HashMap__setTableEntry(table, key, value); }, @@ -8327,18 +8173,12 @@ cell = this._collection$_first; modifications = this._collection$_modifications; for (; cell != null;) { - action.call$1(cell.get$_element()); + action.call$1(cell._element); if (modifications !== this._collection$_modifications) throw H.wrapException(new P.ConcurrentModificationError(this)); - cell = cell.get$_collection$_next(); + cell = cell._collection$_next; } }, - get$last: function(_) { - var t1 = this._collection$_last; - if (t1 == null) - throw H.wrapException(new P.StateError("No elements")); - return t1._element; - }, add$1: function(_, element) { var strings, table, nums; if (typeof element === "string" && element !== "__proto__") { @@ -8449,7 +8289,7 @@ _collection$_unlinkCell$1: function(cell) { var previous, next; previous = cell.get$_collection$_previous(); - next = cell.get$_collection$_next(); + next = cell._collection$_next; if (previous == null) this._collection$_first = next; else @@ -8457,7 +8297,7 @@ if (next == null) this._collection$_last = previous; else - next.set$_collection$_previous(previous); + next._collection$_previous = previous; --this._collection$_length; this._collection$_modifications = this._collection$_modifications + 1 & 67108863; }, @@ -8485,7 +8325,7 @@ } }, _LinkedHashSetCell: { - "^": "Object;_element<,_collection$_next<,_collection$_previous@" + "^": "Object;_element<,_collection$_next,_collection$_previous<" }, _LinkedHashSetIterator: { "^": "Object;_set,_collection$_modifications,_collection$_cell,_collection$_current", @@ -8502,18 +8342,18 @@ this._collection$_current = null; return false; } else { - this._collection$_current = t1.get$_element(); - this._collection$_cell = this._collection$_cell.get$_collection$_next(); + this._collection$_current = t1._element; + this._collection$_cell = t1._collection$_next; return true; } } } }, - closure5: { + closure6: { "^": "Closure:3;result", - call$2: [function(k, v) { + call$2: function(k, v) { this.result.$indexSet(0, k, v); - }, null, null, 4, 0, null, 36, 37, "call"] + } }, _HashSetBase: { "^": "SetBase;" @@ -8541,31 +8381,37 @@ forEach$1: function(receiver, action) { var $length, i; $length = this.get$length(receiver); - for (i = 0; i < $length; ++i) { + if (typeof $length !== "number") + return H.iae($length); + i = 0; + for (; i < $length; ++i) { action.call$1(this.$index(receiver, i)); if ($length !== this.get$length(receiver)) throw H.wrapException(new P.ConcurrentModificationError(receiver)); } }, get$isEmpty: function(receiver) { - return this.get$length(receiver) === 0; + return J.$eq$(this.get$length(receiver), 0); }, get$isNotEmpty: function(receiver) { return !this.get$isEmpty(receiver); }, - get$last: function(receiver) { - if (this.get$length(receiver) === 0) - throw H.wrapException(H.IterableElementError_noElement()); - return this.$index(receiver, this.get$length(receiver) - 1); - }, contains$1: function(receiver, element) { - var $length, i; + var $length, t1, i, t2; $length = this.get$length(receiver); - for (i = 0; i < this.get$length(receiver); ++i) { + t1 = J.getInterceptor($length); + i = 0; + while (true) { + t2 = this.get$length(receiver); + if (typeof t2 !== "number") + return H.iae(t2); + if (!(i < t2)) + break; if (J.$eq$(this.$index(receiver, i), element)) return true; - if ($length !== this.get$length(receiver)) + if (!t1.$eq($length, this.get$length(receiver))) throw H.wrapException(new P.ConcurrentModificationError(receiver)); + ++i; } return false; }, @@ -8575,68 +8421,94 @@ skip$1: function(receiver, count) { return H.SubListIterable$(receiver, count, null, H.getRuntimeTypeArgument(receiver, "ListMixin", 0)); }, - add$1: function(receiver, element) { - var t1 = this.get$length(receiver); - this.set$length(receiver, t1 + 1); - this.$indexSet(receiver, t1, element); + fillRange$3: function(receiver, start, end, fill) { + var i; + P.RangeError_checkValidRange(start, end, this.get$length(receiver), null, null, null); + for (i = start; i < end; ++i) + this.$indexSet(receiver, i, fill); }, setRange$4: ["super$ListMixin$setRange", function(receiver, start, end, iterable, skipCount) { - var $length, t1, otherStart, otherList, i; + var $length, t1, t2, otherStart, otherList, t3, i, t4; P.RangeError_checkValidRange(start, end, this.get$length(receiver), null, null, null); - $length = end - start; - if ($length === 0) + $length = J.$sub$n(end, start); + t1 = J.getInterceptor($length); + if (t1.$eq($length, 0)) return; - t1 = J.getInterceptor(iterable); - if (!!t1.$isList) { + if (J.$lt$n(skipCount, 0)) + H.throwExpression(P.RangeError$range(skipCount, 0, null, "skipCount", null)); + t2 = J.getInterceptor(iterable); + if (!!t2.$isList) { otherStart = skipCount; otherList = iterable; } else { - otherList = t1.skip$1(iterable, skipCount).toList$1$growable(0, false); + otherList = t2.skip$1(iterable, skipCount).toList$1$growable(0, false); otherStart = 0; } - t1 = J.getInterceptor$asx(otherList); - if (otherStart + $length > t1.get$length(otherList)) + t2 = J.getInterceptor$ns(otherStart); + t3 = J.getInterceptor$asx(otherList); + if (J.$gt$n(t2.$add(otherStart, $length), t3.get$length(otherList))) throw H.wrapException(H.IterableElementError_tooFew()); - if (otherStart < start) - for (i = $length - 1; i >= 0; --i) - this.$indexSet(receiver, start + i, t1.$index(otherList, otherStart + i)); - else - for (i = 0; i < $length; ++i) - this.$indexSet(receiver, start + i, t1.$index(otherList, otherStart + i)); + if (t2.$lt(otherStart, start)) + for (i = t1.$sub($length, 1), t1 = J.getInterceptor$ns(start); t4 = J.getInterceptor$n(i), t4.$ge(i, 0); i = t4.$sub(i, 1)) + this.$indexSet(receiver, t1.$add(start, i), t3.$index(otherList, t2.$add(otherStart, i))); + else { + if (typeof $length !== "number") + return H.iae($length); + t1 = J.getInterceptor$ns(start); + i = 0; + for (; i < $length; ++i) + this.$indexSet(receiver, t1.$add(start, i), t3.$index(otherList, t2.$add(otherStart, i))); + } }, function($receiver, start, end, iterable) { return this.setRange$4($receiver, start, end, iterable, 0); - }, "setRange$3", null, null, "get$setRange", 6, 2, null, 38], + }, "setRange$3", null, null, "get$setRange", 6, 2, null, 1], replaceRange$3: function(receiver, start, end, newContents) { - var removeLength, insertLength, insertEnd, delta, newLength; + var removeLength, insertLength, t1, t2, delta, insertEnd, newLength; P.RangeError_checkValidRange(start, end, this.get$length(receiver), null, null, null); newContents = C.JSString_methods.toList$0(newContents); - removeLength = end - start; + removeLength = J.$sub$n(end, start); insertLength = newContents.length; - insertEnd = start + insertLength; - if (removeLength >= insertLength) { - delta = removeLength - insertLength; - newLength = this.get$length(receiver) - delta; + t1 = J.getInterceptor$n(removeLength); + t2 = J.getInterceptor$ns(start); + if (t1.$ge(removeLength, insertLength)) { + delta = t1.$sub(removeLength, insertLength); + insertEnd = t2.$add(start, insertLength); + newLength = J.$sub$n(this.get$length(receiver), delta); this.setRange$3(receiver, start, insertEnd, newContents); - if (delta !== 0) { + if (!J.$eq$(delta, 0)) { this.setRange$4(receiver, insertEnd, newLength, receiver, end); this.set$length(receiver, newLength); } } else { - newLength = this.get$length(receiver) + (insertLength - removeLength); + if (typeof removeLength !== "number") + return H.iae(removeLength); + newLength = J.$add$ns(this.get$length(receiver), insertLength - removeLength); + insertEnd = t2.$add(start, insertLength); this.set$length(receiver, newLength); this.setRange$4(receiver, insertEnd, newLength, receiver, end); this.setRange$3(receiver, start, insertEnd, newContents); } }, indexOf$2: function(receiver, element, startIndex) { - var i; - if (startIndex >= this.get$length(receiver)) + var t1, i; + t1 = this.get$length(receiver); + if (typeof t1 !== "number") + return H.iae(t1); + if (startIndex >= t1) return -1; if (startIndex < 0) startIndex = 0; - for (i = startIndex; i < this.get$length(receiver); ++i) + i = startIndex; + while (true) { + t1 = this.get$length(receiver); + if (typeof t1 !== "number") + return H.iae(t1); + if (!(i < t1)) + break; if (J.$eq$(this.$index(receiver, i), element)) return i; + ++i; + } return -1; }, indexOf$1: function($receiver, element) { @@ -8659,30 +8531,30 @@ MapView: { "^": "Object;", $index: function(_, key) { - return J.$index$asx(this._map, key); + return J.$index$asx(this._collection$_map, key); }, $indexSet: function(_, key, value) { - J.$indexSet$ax(this._map, key, value); + J.$indexSet$ax(this._collection$_map, key, value); }, forEach$1: function(_, action) { - J.forEach$1$ax(this._map, action); + J.forEach$1$ax(this._collection$_map, action); }, get$isEmpty: function(_) { - return J.get$isEmpty$asx(this._map); + return J.get$isEmpty$asx(this._collection$_map); }, get$isNotEmpty: function(_) { - return J.get$isNotEmpty$asx(this._map); + return J.get$isNotEmpty$asx(this._collection$_map); }, get$length: function(_) { - return J.get$length$asx(this._map); + return J.get$length$asx(this._collection$_map); }, toString$0: function(_) { - return J.toString$0$(this._map); + return J.toString$0$(this._collection$_map); }, $isMap: 1 }, UnmodifiableMapView: { - "^": "MapView+_UnmodifiableMapMixin;_map", + "^": "MapView+_UnmodifiableMapMixin;_collection$_map", $isMap: 1 }, Maps_mapToString_closure: { @@ -8722,19 +8594,6 @@ get$length: function(_) { return (this._tail - this._head & this._table.length - 1) >>> 0; }, - get$last: function(_) { - var t1, t2, t3; - t1 = this._head; - t2 = this._tail; - if (t1 === t2) - throw H.wrapException(H.IterableElementError_noElement()); - t1 = this._table; - t3 = t1.length; - t2 = (t2 - 1 & t3 - 1) >>> 0; - if (t2 < 0 || t2 >= t3) - return H.ioore(t1, t2); - return t1[t2]; - }, elementAt$1: function(_, index) { var $length, t1, t2, t3; $length = (this._tail - this._head & this._table.length - 1) >>> 0; @@ -8749,9 +8608,6 @@ return H.ioore(t1, t3); return t1[t3]; }, - add$1: function(_, value) { - this._add$1(value); - }, clear$0: function(_) { var i, t1, t2, t3, t4; i = this._head; @@ -8870,17 +8726,6 @@ for (t1 = new P._LinkedHashSetIterator(this, this._collection$_modifications, null, null), t1._collection$_cell = this._collection$_first; t1.moveNext$0();) f.call$1(t1._collection$_current); }, - get$last: function(_) { - var it, result; - it = new P._LinkedHashSetIterator(this, this._collection$_modifications, null, null); - it._collection$_cell = this._collection$_first; - if (!it.moveNext$0()) - throw H.wrapException(H.IterableElementError_noElement()); - do - result = it._collection$_current; - while (it.moveNext$0()); - return result; - }, $isEfficientLength: 1 }, SetBase: { @@ -8917,7 +8762,7 @@ }, _defaultToEncodable: [function(object) { return object.toJson$0(); - }, "call$1", "convert___defaultToEncodable$closure", 2, 0, 0, 25], + }, "call$1", "convert___defaultToEncodable$closure", 2, 0, 0], _JsonMap: { "^": "Object;_original,_processed,_data", $index: function(_, key) { @@ -9064,9 +8909,9 @@ }, _JsonMap_values_closure: { "^": "Closure:0;$this", - call$1: [function(each) { + call$1: function(each) { return this.$this.$index(0, each); - }, null, null, 2, 0, null, 18, "call"] + } }, Codec: { "^": "Object;" @@ -9193,7 +9038,7 @@ return; this._checkCycle$1(object); try { - customJson = this._toEncodable$1(object); + customJson = this._toEncodable.call$1(object); if (!this.writeJsonValue$1(customJson)) throw H.wrapException(new P.JsonUnsupportedObjectError(object, null)); t1 = this._seen; @@ -9250,26 +9095,36 @@ } }, writeList$1: function(list) { - var t1, i; + var t1, i, t2; this.writeString$1("["); t1 = J.getInterceptor$asx(list); - if (t1.get$length(list) > 0) { + if (J.$gt$n(t1.get$length(list), 0)) { this.writeObject$1(t1.$index(list, 0)); - for (i = 1; i < t1.get$length(list); ++i) { + i = 1; + while (true) { + t2 = t1.get$length(list); + if (typeof t2 !== "number") + return H.iae(t2); + if (!(i < t2)) + break; this.writeString$1(","); this.writeObject$1(t1.$index(list, i)); + ++i; } } this.writeString$1("]"); }, writeMap$1: function(map) { - var t1, keyValueList, separator, i, t2; + var t1, t2, keyValueList, separator, i; t1 = {}; if (map.get$isEmpty(map) === true) { this.writeString$1("{}"); return true; } - keyValueList = new Array(J.$mul$ns(map.get$length(map), 2)); + t2 = J.$mul$ns(map.get$length(map), 2); + if (typeof t2 !== "number") + return H.iae(t2); + keyValueList = new Array(t2); t1.i = 0; t1.allStringKeys = true; map.forEach$1(0, new P._JsonStringifier_writeMap_closure(t1, keyValueList)); @@ -9287,14 +9142,11 @@ } this.writeString$1("}"); return true; - }, - _toEncodable$1: function(arg0) { - return this._toEncodable.call$1(arg0); } }, _JsonStringifier_writeMap_closure: { "^": "Closure:3;_box_0,keyValueList", - call$2: [function(key, value) { + call$2: function(key, value) { var t1, t2, t3, i, t4; if (typeof key !== "string") this._box_0.allStringKeys = false; @@ -9311,7 +9163,7 @@ if (i >= t4) return H.ioore(t1, i); t1[i] = value; - }, null, null, 4, 0, null, 17, 7, "call"] + } }, _JsonStringStringifier: { "^": "_JsonStringifier;_convert$_sink,_seen,_toEncodable", @@ -9358,9 +9210,10 @@ P.RangeError_checkValidRange(start, end, stringLength, null, null, null); t2 = J.getInterceptor$n(stringLength); $length = t2.$sub(stringLength, start); - if ($length === 0) + t3 = J.getInterceptor($length); + if (t3.$eq($length, 0)) return new Uint8Array(H._checkLength(0)); - t3 = new Uint8Array(H._checkLength($length * 3)); + t3 = new Uint8Array(H._checkLength(t3.$mul($length, 3))); encoder = new P._Utf8Encoder(0, 0, t3); if (encoder._fillBuffer$3(string, start, stringLength) !== stringLength) encoder._writeSurrogate$2(t1.codeUnitAt$1(string, t2.$sub(stringLength, 1)), 0); @@ -9440,7 +9293,7 @@ if (this._bufferIndex + 3 >= t2) break; stringIndex0 = stringIndex + 1; - if (this._writeSurrogate$2(codeUnit, t3.codeUnitAt$1(str, stringIndex0))) + if (this._writeSurrogate$2(codeUnit, C.JSString_methods.codeUnitAt$1(str, stringIndex0))) stringIndex = stringIndex0; } else if (codeUnit <= 2047) { t4 = this._bufferIndex; @@ -9517,11 +9370,12 @@ if (i === endIndex) break $loop$0; unit = t3.$index(codeUnits, i); - t5 = J.getInterceptor$n(unit); - if (t5.$and(unit, 192) !== 128) - throw H.wrapException(new P.FormatException("Bad UTF-8 encoding 0x" + t5.toRadixString$1(unit, 16), null, null)); + if (typeof unit !== "number") + return unit.$and(); + if ((unit & 192) !== 128) + throw H.wrapException(new P.FormatException("Bad UTF-8 encoding 0x" + C.JSNumber_methods.toRadixString$1(unit, 16), null, null)); else { - value = (value << 6 | t5.$and(unit, 63)) >>> 0; + value = (value << 6 | unit & 63) >>> 0; --expectedUnits; ++i; } @@ -9555,25 +9409,27 @@ if (t6.$lt(unit, 0)) throw H.wrapException(new P.FormatException("Negative UTF-8 code unit: -0x" + J.toRadixString$1$n(t6.$negate(unit), 16), null, null)); else { - if (t6.$and(unit, 224) === 192) { - value = t6.$and(unit, 31); + if (typeof unit !== "number") + return unit.$and(); + if ((unit & 224) === 192) { + value = unit & 31; expectedUnits = 1; extraUnits = 1; continue $loop$0; } - if (t6.$and(unit, 240) === 224) { - value = t6.$and(unit, 15); + if ((unit & 240) === 224) { + value = unit & 15; expectedUnits = 2; extraUnits = 2; continue $loop$0; } - if (t6.$and(unit, 248) === 240 && t6.$lt(unit, 245)) { - value = t6.$and(unit, 7); + if ((unit & 248) === 240 && unit < 245) { + value = unit & 7; expectedUnits = 3; extraUnits = 3; continue $loop$0; } - throw H.wrapException(new P.FormatException("Bad UTF-8 encoding 0x" + t6.toRadixString$1(unit, 16), null, null)); + throw H.wrapException(new P.FormatException("Bad UTF-8 encoding 0x" + C.JSNumber_methods.toRadixString$1(unit, 16), null, null)); } } break $loop$0; @@ -9586,20 +9442,22 @@ } }, _Utf8Decoder_convert_scanOneByteCharacters: { - "^": "Closure:42;endIndex", + "^": "Closure:41;endIndex", call$2: function(units, from) { var to, t1, i, unit; to = this.endIndex; for (t1 = J.getInterceptor$asx(units), i = from; i < to; ++i) { unit = t1.$index(units, i); - if (J.$and$n(unit, 127) !== unit) + if (typeof unit !== "number") + return unit.$and(); + if ((unit & 127) !== unit) return i - from; } return to - from; } }, _Utf8Decoder_convert_addSingleBytes: { - "^": "Closure:43;$this,codeUnits,startIndex,endIndex", + "^": "Closure:64;$this,codeUnits,startIndex,endIndex", call$2: function(from, to) { this.$this._stringSink._contents += P.String_String$fromCharCodes(this.codeUnits, from, to); } @@ -9680,7 +9538,10 @@ return result; }, List_List$unmodifiable: function(elements, $E) { - return J.JSArray_markUnmodifiableList(P.List_List$from(elements, false, $E)); + var result = P.List_List$from(elements, false, $E); + result.fixed$length = Array; + result.immutable$list = Array; + return result; }, print: function(object) { var line, t1; @@ -9708,18 +9569,474 @@ String_String$fromCharCode: function(charCode) { return H.Primitives_stringFromCharCode(charCode); }, - NoSuchMethodError_toString_closure: { - "^": "Closure:66;_box_0,sb", - call$2: [function(key, value) { - var t1, t2, t3; - t1 = this.sb; - t2 = this._box_0; - t1._contents += t2.comma; - t3 = t1._contents += H.S(key.get$__internal$_name()); - t1._contents = t3 + ": "; - t1._contents += H.S(P.Error_safeToString(value)); - t2.comma = ", "; - }, null, null, 4, 0, null, 17, 7, "call"] + Uri_base: function() { + var uri = H.Primitives_currentUri(); + if (uri != null) + return P.Uri_parse(uri, 0, null); + throw H.wrapException(new P.UnsupportedError("'Uri.base' is not supported")); + }, + Uri_parse: function(uri, start, end) { + var t1, t2, delta, t3, indices, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, t4, t5, isSimple, scheme, t6, t7, t8, schemeAuth, t9; + end = J.get$length$asx(uri); + t1 = start + 5; + t2 = J.getInterceptor$n(end); + if (t2.$ge(end, t1)) { + delta = ((J.getInterceptor$s(uri).codeUnitAt$1(uri, start + 4) ^ 58) * 3 | C.JSString_methods.codeUnitAt$1(uri, start) ^ 100 | C.JSString_methods.codeUnitAt$1(uri, start + 1) ^ 97 | C.JSString_methods.codeUnitAt$1(uri, start + 2) ^ 116 | C.JSString_methods.codeUnitAt$1(uri, start + 3) ^ 97) >>> 0; + if (delta === 0) + return P.UriData__parse(start > 0 || t2.$lt(end, uri.length) ? C.JSString_methods.substring$2(uri, start, end) : uri, 5, null).get$uri(); + else if (delta === 32) + return P.UriData__parse(C.JSString_methods.substring$2(uri, t1, end), 0, null).get$uri(); + } + t3 = new Array(8); + t3.fixed$length = Array; + indices = H.setRuntimeTypeInfo(t3, [P.$int]); + indices[0] = 0; + t3 = start - 1; + indices[1] = t3; + indices[2] = t3; + indices[7] = t3; + indices[3] = start; + indices[4] = start; + indices[5] = end; + indices[6] = end; + if (P._scan(uri, start, end, 0, indices) >= 14) + indices[7] = end; + schemeEnd = indices[1]; + t3 = J.getInterceptor$n(schemeEnd); + if (t3.$ge(schemeEnd, start)) + if (P._scan(uri, start, schemeEnd, 20, indices) === 20) + indices[7] = schemeEnd; + hostStart = J.$add$ns(indices[2], 1); + portStart = indices[3]; + pathStart = indices[4]; + queryStart = indices[5]; + fragmentStart = indices[6]; + t4 = J.getInterceptor$n(fragmentStart); + if (t4.$lt(fragmentStart, queryStart)) + queryStart = fragmentStart; + t5 = J.getInterceptor$n(pathStart); + if (t5.$lt(pathStart, hostStart) || t5.$le(pathStart, schemeEnd)) + pathStart = queryStart; + if (J.$lt$n(portStart, hostStart)) + portStart = pathStart; + isSimple = J.$lt$n(indices[7], start); + if (isSimple) { + t5 = J.getInterceptor$n(hostStart); + if (t5.$gt(hostStart, t3.$add(schemeEnd, 3))) { + scheme = null; + isSimple = false; + } else { + t6 = J.getInterceptor$n(portStart); + if (t6.$gt(portStart, start) && J.$eq$(t6.$add(portStart, 1), pathStart)) { + scheme = null; + isSimple = false; + } else { + t7 = J.getInterceptor$n(queryStart); + if (!(t7.$lt(queryStart, end) && t7.$eq(queryStart, J.$add$ns(pathStart, 2)) && J.startsWith$2$s(uri, "..", pathStart))) + t8 = t7.$gt(queryStart, J.$add$ns(pathStart, 2)) && J.startsWith$2$s(uri, "/..", t7.$sub(queryStart, 3)); + else + t8 = true; + if (t8) { + scheme = null; + isSimple = false; + } else { + if (t3.$eq(schemeEnd, start + 4)) + if (J.getInterceptor$s(uri).startsWith$2(uri, "file", start)) { + if (t5.$le(hostStart, start)) { + if (!C.JSString_methods.startsWith$2(uri, "/", pathStart)) { + schemeAuth = "file:///"; + delta = 3; + } else { + schemeAuth = "file://"; + delta = 2; + } + uri = schemeAuth + C.JSString_methods.substring$2(uri, pathStart, end); + schemeEnd = t3.$sub(schemeEnd, start); + t1 = delta - start; + queryStart = t7.$add(queryStart, t1); + fragmentStart = t4.$add(fragmentStart, t1); + end = uri.length; + start = 0; + hostStart = 7; + portStart = 7; + pathStart = 7; + } else { + t1 = J.getInterceptor(pathStart); + if (t1.$eq(pathStart, queryStart)) + if (start === 0 && t2.$eq(end, uri.length)) { + uri = C.JSString_methods.replaceRange$3(uri, pathStart, queryStart, "/"); + queryStart = t7.$add(queryStart, 1); + fragmentStart = t4.$add(fragmentStart, 1); + end = t2.$add(end, 1); + } else { + uri = C.JSString_methods.substring$2(uri, start, pathStart) + "/" + C.JSString_methods.substring$2(uri, queryStart, end); + schemeEnd = t3.$sub(schemeEnd, start); + hostStart = t5.$sub(hostStart, start); + portStart = t6.$sub(portStart, start); + pathStart = t1.$sub(pathStart, start); + t1 = 1 - start; + queryStart = t7.$add(queryStart, t1); + fragmentStart = t4.$add(fragmentStart, t1); + end = uri.length; + start = 0; + } + } + scheme = "file"; + } else if (C.JSString_methods.startsWith$2(uri, "http", start)) { + if (t6.$gt(portStart, start) && J.$eq$(t6.$add(portStart, 3), pathStart) && C.JSString_methods.startsWith$2(uri, "80", t6.$add(portStart, 1))) { + t1 = start === 0 && t2.$eq(end, uri.length); + t8 = J.getInterceptor$n(pathStart); + if (t1) { + uri = C.JSString_methods.replaceRange$3(uri, portStart, pathStart, ""); + pathStart = t8.$sub(pathStart, 3); + queryStart = t7.$sub(queryStart, 3); + fragmentStart = t4.$sub(fragmentStart, 3); + end = t2.$sub(end, 3); + } else { + uri = C.JSString_methods.substring$2(uri, start, portStart) + C.JSString_methods.substring$2(uri, pathStart, end); + schemeEnd = t3.$sub(schemeEnd, start); + hostStart = t5.$sub(hostStart, start); + portStart = t6.$sub(portStart, start); + t1 = 3 + start; + pathStart = t8.$sub(pathStart, t1); + queryStart = t7.$sub(queryStart, t1); + fragmentStart = t4.$sub(fragmentStart, t1); + end = uri.length; + start = 0; + } + } + scheme = "http"; + } else + scheme = null; + else if (t3.$eq(schemeEnd, t1) && J.startsWith$2$s(uri, "https", start)) { + if (t6.$gt(portStart, start) && J.$eq$(t6.$add(portStart, 4), pathStart) && J.startsWith$2$s(uri, "443", t6.$add(portStart, 1))) { + t1 = start === 0 && t2.$eq(end, J.get$length$asx(uri)); + t8 = J.getInterceptor$asx(uri); + t9 = J.getInterceptor$n(pathStart); + if (t1) { + uri = t8.replaceRange$3(uri, portStart, pathStart, ""); + pathStart = t9.$sub(pathStart, 4); + queryStart = t7.$sub(queryStart, 4); + fragmentStart = t4.$sub(fragmentStart, 4); + end = t2.$sub(end, 3); + } else { + uri = t8.substring$2(uri, start, portStart) + C.JSString_methods.substring$2(uri, pathStart, end); + schemeEnd = t3.$sub(schemeEnd, start); + hostStart = t5.$sub(hostStart, start); + portStart = t6.$sub(portStart, start); + t1 = 4 + start; + pathStart = t9.$sub(pathStart, t1); + queryStart = t7.$sub(queryStart, t1); + fragmentStart = t4.$sub(fragmentStart, t1); + end = uri.length; + start = 0; + } + } + scheme = "https"; + } else + scheme = null; + isSimple = true; + } + } + } + } else + scheme = null; + if (isSimple) { + if (start > 0 || J.$lt$n(end, J.get$length$asx(uri))) { + uri = J.substring$2$s(uri, start, end); + schemeEnd = J.$sub$n(schemeEnd, start); + hostStart = J.$sub$n(hostStart, start); + portStart = J.$sub$n(portStart, start); + pathStart = J.$sub$n(pathStart, start); + queryStart = J.$sub$n(queryStart, start); + fragmentStart = J.$sub$n(fragmentStart, start); + } + return new P._SimpleUri(uri, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, scheme, null); + } + return P._Uri__Uri$notSimple(uri, start, end, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, scheme); + }, + Uri_decodeComponent: [function(encodedComponent) { + return P._Uri__uriDecode(encodedComponent, 0, J.get$length$asx(encodedComponent), C.Utf8Codec_false, false); + }, "call$1", "core_Uri_decodeComponent$closure", 2, 0, 63], + Uri_splitQueryString: function(query, encoding) { + return C.JSArray_methods.fold$2(query.split("&"), P.LinkedHashMap__makeEmpty(), new P.Uri_splitQueryString_closure(encoding)); + }, + Uri__parseIPv4Address: function(host, start, end) { + var t1, t2, result, i, partStart, partIndex, t3, $char, part, partIndex0; + t1 = new P.Uri__parseIPv4Address_error(host); + t2 = H._checkLength(4); + result = new Uint8Array(t2); + for (i = start, partStart = i, partIndex = 0; t3 = J.getInterceptor$n(i), t3.$lt(i, end); i = t3.$add(i, 1)) { + $char = C.JSString_methods.codeUnitAt$1(host, i); + if ($char !== 46) { + if (($char ^ 48) > 9) + t1.call$2("invalid character", i); + } else { + if (partIndex === 3) + t1.call$2("IPv4 address should contain exactly 4 parts", i); + part = H.Primitives_parseInt(C.JSString_methods.substring$2(host, partStart, i), null, null); + if (J.$gt$n(part, 255)) + t1.call$2("each part must be in the range 0..255", partStart); + partIndex0 = partIndex + 1; + if (partIndex >= t2) + return H.ioore(result, partIndex); + result[partIndex] = part; + partStart = t3.$add(i, 1); + partIndex = partIndex0; + } + } + if (partIndex !== 3) + t1.call$2("IPv4 address should contain exactly 4 parts", end); + part = H.Primitives_parseInt(C.JSString_methods.substring$2(host, partStart, end), null, null); + if (J.$gt$n(part, 255)) + t1.call$2("each part must be in the range 0..255", partStart); + if (partIndex >= t2) + return H.ioore(result, partIndex); + result[partIndex] = part; + return result; + }, + Uri_parseIPv6Address: function(host, start, end) { + var t1, t2, parts, i, partStart, wildcardSeen, seenDot, t3, $char, atEnd, isLastWildcard, last, bytes, index, value, wildCardLength, j; + if (end == null) + end = host.length; + t1 = new P.Uri_parseIPv6Address_error(host); + t2 = new P.Uri_parseIPv6Address_parseHex(host, t1); + if (host.length < 2) + t1.call$1("address is too short"); + parts = []; + for (i = start, partStart = i, wildcardSeen = false, seenDot = false; t3 = J.getInterceptor$n(i), t3.$lt(i, end); i = J.$add$ns(i, 1)) { + $char = C.JSString_methods.codeUnitAt$1(host, i); + if ($char === 58) { + if (t3.$eq(i, start)) { + i = t3.$add(i, 1); + if (C.JSString_methods.codeUnitAt$1(host, i) !== 58) + t1.call$2("invalid start colon.", i); + partStart = i; + } + t3 = J.getInterceptor(i); + if (t3.$eq(i, partStart)) { + if (wildcardSeen) + t1.call$2("only one wildcard `::` is allowed", i); + parts.push(-1); + wildcardSeen = true; + } else + parts.push(t2.call$2(partStart, i)); + partStart = t3.$add(i, 1); + } else if ($char === 46) + seenDot = true; + } + if (parts.length === 0) + t1.call$1("too few parts"); + atEnd = J.$eq$(partStart, end); + isLastWildcard = J.$eq$(C.JSArray_methods.get$last(parts), -1); + if (atEnd && !isLastWildcard) + t1.call$2("expected a part after last `:`", end); + if (!atEnd) + if (!seenDot) + parts.push(t2.call$2(partStart, end)); + else { + last = P.Uri__parseIPv4Address(host, partStart, end); + t2 = last[0]; + if (typeof t2 !== "number") + return t2.$shl(); + t3 = last[1]; + if (typeof t3 !== "number") + return H.iae(t3); + parts.push((t2 << 8 | t3) >>> 0); + t3 = last[2]; + if (typeof t3 !== "number") + return t3.$shl(); + t2 = last[3]; + if (typeof t2 !== "number") + return H.iae(t2); + parts.push((t3 << 8 | t2) >>> 0); + } + if (wildcardSeen) { + if (parts.length > 7) + t1.call$1("an address with a wildcard must have less than 7 parts"); + } else if (parts.length !== 8) + t1.call$1("an address without a wildcard must contain exactly 8 parts"); + bytes = new Uint8Array(16); + for (i = 0, index = 0; i < parts.length; ++i) { + value = parts[i]; + if (J.getInterceptor(value).$eq(value, -1)) { + wildCardLength = 9 - parts.length; + for (j = 0; j < wildCardLength; ++j) { + if (index < 0 || index >= 16) + return H.ioore(bytes, index); + bytes[index] = 0; + t1 = index + 1; + if (t1 >= 16) + return H.ioore(bytes, t1); + bytes[t1] = 0; + index += 2; + } + } else { + if (typeof value !== "number") + return value.$shr(); + t1 = C.JSNumber_methods._shrOtherPositive$1(value, 8); + if (index < 0 || index >= 16) + return H.ioore(bytes, index); + bytes[index] = t1; + t1 = index + 1; + if (t1 >= 16) + return H.ioore(bytes, t1); + bytes[t1] = value & 255; + index += 2; + } + } + return bytes; + }, + _createTables: function() { + var tables, t1, t2, t3, b; + tables = P.List_List$generate(22, new P._createTables_closure(), true, P.Uint8List); + t1 = new P._createTables_build(tables); + t2 = new P._createTables_setChars(); + t3 = new P._createTables_setRange(); + b = t1.call$2(0, 225); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 1); + t2.call$3(b, ".", 14); + t2.call$3(b, ":", 34); + t2.call$3(b, "/", 3); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(14, 225); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 1); + t2.call$3(b, ".", 15); + t2.call$3(b, ":", 34); + t2.call$3(b, "/", 234); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(15, 225); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 1); + t2.call$3(b, "%", 225); + t2.call$3(b, ":", 34); + t2.call$3(b, "/", 9); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(1, 225); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 1); + t2.call$3(b, ":", 34); + t2.call$3(b, "/", 10); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(2, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 139); + t2.call$3(b, "/", 131); + t2.call$3(b, ".", 146); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(3, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, "/", 68); + t2.call$3(b, ".", 18); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(4, 229); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 5); + t3.call$3(b, "AZ", 229); + t2.call$3(b, ":", 102); + t2.call$3(b, "@", 68); + t2.call$3(b, "[", 232); + t2.call$3(b, "/", 138); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(5, 229); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 5); + t3.call$3(b, "AZ", 229); + t2.call$3(b, ":", 102); + t2.call$3(b, "@", 68); + t2.call$3(b, "/", 138); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(6, 231); + t3.call$3(b, "19", 7); + t2.call$3(b, "@", 68); + t2.call$3(b, "/", 138); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(7, 231); + t3.call$3(b, "09", 7); + t2.call$3(b, "@", 68); + t2.call$3(b, "/", 138); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + t2.call$3(t1.call$2(8, 8), "]", 5); + b = t1.call$2(9, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, ".", 16); + t2.call$3(b, "/", 234); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(16, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, ".", 17); + t2.call$3(b, "/", 234); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(17, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, "/", 9); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(10, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, ".", 18); + t2.call$3(b, "/", 234); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(18, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, ".", 19); + t2.call$3(b, "/", 234); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(19, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, "/", 234); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(11, 235); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 11); + t2.call$3(b, "/", 10); + t2.call$3(b, "?", 172); + t2.call$3(b, "#", 205); + b = t1.call$2(12, 236); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 12); + t2.call$3(b, "?", 12); + t2.call$3(b, "#", 205); + b = t1.call$2(13, 237); + t2.call$3(b, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", 13); + t2.call$3(b, "?", 13); + t3.call$3(t1.call$2(20, 245), "az", 21); + b = t1.call$2(21, 245); + t3.call$3(b, "az", 21); + t3.call$3(b, "09", 21); + t2.call$3(b, "+-.", 21); + return tables; + }, + _scan: function(uri, start, end, state, indices) { + var tables, t1, i, table, $char, transition, t2; + tables = $.$get$_scannerTables(); + if (typeof end !== "number") + return H.iae(end); + t1 = J.getInterceptor$s(uri); + i = start; + for (; i < end; ++i) { + if (state < 0 || state >= tables.length) + return H.ioore(tables, state); + table = tables[state]; + $char = t1.codeUnitAt$1(uri, i) ^ 96; + transition = J.$index$asx(table, $char > 95 ? 31 : $char); + if (typeof transition !== "number") + return transition.$and(); + state = transition & 31; + t2 = C.JSNumber_methods._shrOtherPositive$1(transition, 5); + if (t2 >= 8) + return H.ioore(indices, t2); + indices[t2] = i; + } + return state; }, bool: { "^": "Object;" @@ -9732,29 +10049,22 @@ return false; if (!(other instanceof P.DateTime)) return false; - return this._core$_value === other._core$_value && this.isUtc === other.isUtc; + return this._core$_value === other._core$_value && true; }, get$hashCode: function(_) { var t1 = this._core$_value; - return (t1 ^ C.JSNumber_methods._shrOtherPositive$1(t1, 30)) & 1073741823; + return (t1 ^ C.JSInt_methods._shrOtherPositive$1(t1, 30)) & 1073741823; }, toString$0: function(_) { - var t1, y, m, d, h, min, sec, ms; - t1 = this.isUtc; - y = P.DateTime__fourDigits(t1 ? H.Primitives_lazyAsJsDate(this).getUTCFullYear() + 0 : H.Primitives_lazyAsJsDate(this).getFullYear() + 0); - m = P.DateTime__twoDigits(t1 ? H.Primitives_lazyAsJsDate(this).getUTCMonth() + 1 : H.Primitives_lazyAsJsDate(this).getMonth() + 1); - d = P.DateTime__twoDigits(t1 ? H.Primitives_lazyAsJsDate(this).getUTCDate() + 0 : H.Primitives_lazyAsJsDate(this).getDate() + 0); - h = P.DateTime__twoDigits(t1 ? H.Primitives_lazyAsJsDate(this).getUTCHours() + 0 : H.Primitives_lazyAsJsDate(this).getHours() + 0); - min = P.DateTime__twoDigits(t1 ? H.Primitives_lazyAsJsDate(this).getUTCMinutes() + 0 : H.Primitives_lazyAsJsDate(this).getMinutes() + 0); - sec = P.DateTime__twoDigits(t1 ? H.Primitives_lazyAsJsDate(this).getUTCSeconds() + 0 : H.Primitives_lazyAsJsDate(this).getSeconds() + 0); - ms = P.DateTime__threeDigits(t1 ? H.Primitives_lazyAsJsDate(this).getUTCMilliseconds() + 0 : H.Primitives_lazyAsJsDate(this).getMilliseconds() + 0); - if (t1) - return y + "-" + m + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms + "Z"; - else - return y + "-" + m + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms; - }, - add$1: function(_, duration) { - return P.DateTime$_withValue(C.JSNumber_methods.$add(this._core$_value, duration.get$inMilliseconds()), this.isUtc); + var y, m, d, h, min, sec, ms; + y = P.DateTime__fourDigits(H.Primitives_lazyAsJsDate(this).getUTCFullYear() + 0); + m = P.DateTime__twoDigits(H.Primitives_lazyAsJsDate(this).getUTCMonth() + 1); + d = P.DateTime__twoDigits(H.Primitives_lazyAsJsDate(this).getUTCDate() + 0); + h = P.DateTime__twoDigits(H.Primitives_lazyAsJsDate(this).getUTCHours() + 0); + min = P.DateTime__twoDigits(H.Primitives_lazyAsJsDate(this).getUTCMinutes() + 0); + sec = P.DateTime__twoDigits(H.Primitives_lazyAsJsDate(this).getUTCSeconds() + 0); + ms = P.DateTime__threeDigits(H.Primitives_lazyAsJsDate(this).getUTCMilliseconds() + 0); + return y + "-" + m + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms + "Z"; }, get$millisecondsSinceEpoch: function() { return this._core$_value; @@ -9770,11 +10080,6 @@ throw H.wrapException(P.ArgumentError$(this.get$millisecondsSinceEpoch())); }, static: { - DateTime$_withValue: function(_value, isUtc) { - var t1 = new P.DateTime(_value, isUtc); - t1.DateTime$_withValue$2$isUtc(_value, isUtc); - return t1; - }, DateTime__fourDigits: function(n) { var absN, sign; absN = Math.abs(n); @@ -9808,15 +10113,13 @@ Duration: { "^": "Object;_duration<", $add: function(_, other) { - return new P.Duration(C.JSInt_methods.$add(this._duration, other.get$_duration())); + return new P.Duration(this._duration + other.get$_duration()); }, $sub: function(_, other) { return new P.Duration(this._duration - other.get$_duration()); }, - $tdiv: function(_, quotient) { - if (quotient === 0) - throw H.wrapException(new P.IntegerDivisionByZeroException()); - return new P.Duration(C.JSInt_methods.$tdiv(this._duration, quotient)); + $mul: function(_, factor) { + return new P.Duration(C.JSInt_methods.round$0(this._duration * factor)); }, $lt: function(_, other) { return this._duration < other.get$_duration(); @@ -9824,8 +10127,11 @@ $gt: function(_, other) { return this._duration > other.get$_duration(); }, + $le: function(_, other) { + return this._duration <= other.get$_duration(); + }, $ge: function(_, other) { - return C.JSInt_methods.$ge(this._duration, other.get$_duration()); + return this._duration >= other.get$_duration(); }, get$inMilliseconds: function() { return C.JSInt_methods._tdivFast$1(this._duration, 1000); @@ -9861,7 +10167,7 @@ } }, Duration_toString_sixDigits: { - "^": "Closure:14;", + "^": "Closure:21;", call$1: function(n) { if (n >= 100000) return "" + n; @@ -9877,7 +10183,7 @@ } }, Duration_toString_twoDigits: { - "^": "Closure:14;", + "^": "Closure:21;", call$1: function(n) { if (n >= 10) return "" + n; @@ -9962,11 +10268,20 @@ return new P.RangeError(minValue, maxValue, true, invalidValue, $name, "Invalid value"); }, RangeError_checkValueInInterval: function(value, minValue, maxValue, $name, message) { - if (value < minValue || value > maxValue) + var t1; + if (value >= minValue) { + if (typeof maxValue !== "number") + return H.iae(maxValue); + t1 = value > maxValue; + } else + t1 = true; + if (t1) throw H.wrapException(P.RangeError$range(value, minValue, maxValue, $name, message)); }, RangeError_checkValidRange: function(start, end, $length, startName, endName, message) { var t1; + if (typeof start !== "number") + return H.iae(start); if (!(0 > start)) { if (typeof $length !== "number") return H.iae($length); @@ -10001,7 +10316,7 @@ if (J.$lt$n(this.invalidValue, 0)) return ": index must not be negative"; var t1 = this.length; - if (t1 === 0) + if (J.$eq$(t1, 0)) return ": no indices are valid"; return ": index should be less than " + H.S(t1); }, @@ -10012,30 +10327,6 @@ } } }, - NoSuchMethodError: { - "^": "Error;_core$_receiver,_memberName,_core$_arguments,_namedArguments,_existingArgumentNames", - toString$0: function(_) { - var t1, sb, t2, t3, _i, argument, receiverText, actualParameters; - t1 = {}; - sb = new P.StringBuffer(""); - t1.comma = ""; - for (t2 = this._core$_arguments, t3 = t2.length, _i = 0; _i < t3; ++_i) { - argument = t2[_i]; - sb._contents += t1.comma; - sb._contents += H.S(P.Error_safeToString(argument)); - t1.comma = ", "; - } - this._namedArguments.forEach$1(0, new P.NoSuchMethodError_toString_closure(t1, sb)); - receiverText = P.Error_safeToString(this._core$_receiver); - actualParameters = H.S(sb); - return "NoSuchMethodError: method not found: '" + H.S(this._memberName.__internal$_name) + "'\nReceiver: " + H.S(receiverText) + "\nArguments: [" + actualParameters + "]"; - }, - static: { - NoSuchMethodError$: function(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames) { - return new P.NoSuchMethodError(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames); - } - } - }, UnsupportedError: { "^": "Error;message>", toString$0: function(_) { @@ -10159,14 +10450,14 @@ ++i; } t2 = J.getInterceptor$n(lineEnd); - if (t2.$sub(lineEnd, lineStart) > 78) + if (J.$gt$n(t2.$sub(lineEnd, lineStart), 78)) if (offset - lineStart < 75) { end = lineStart + 75; start = lineStart; prefix = ""; postfix = "..."; } else { - if (t2.$sub(lineEnd, offset) < 75) { + if (J.$lt$n(t2.$sub(lineEnd, offset), 75)) { start = t2.$sub(lineEnd, 75); end = lineEnd; postfix = ""; @@ -10184,15 +10475,11 @@ postfix = ""; } slice = t1.substring$2(source, start, end); + if (typeof start !== "number") + return H.iae(start); return report + prefix + slice + postfix + "\n" + C.JSString_methods.$mul(" ", offset - start + prefix.length) + "^\n"; } }, - IntegerDivisionByZeroException: { - "^": "Object;", - toString$0: function(_) { - return "IntegerDivisionByZeroException"; - } - }, Expando: { "^": "Object;name,_jsWeakMapOrKey", toString$0: function(_) { @@ -10335,11 +10622,8 @@ get$hashCode: function(_) { return H.Primitives_objectHashCode(this); }, - toString$0: ["super$Object$toString", function(_) { + toString$0: function(_) { return H.Primitives_objectToHumanReadableString(this); - }], - noSuchMethod$1: function(_, invocation) { - throw H.wrapException(P.NoSuchMethodError$(this, invocation.get$memberName(), invocation.get$positionalArguments(), invocation.get$namedArguments(), null)); }, toString: function() { return this.toString$0(this); @@ -10356,7 +10640,7 @@ }, "+String": 0, StringBuffer: { - "^": "Object;_contents@", + "^": "Object;_contents<", get$length: function(_) { return this._contents.length; }, @@ -10394,11 +10678,57 @@ } } }, - Symbol: { - "^": "Object;" + Uri_splitQueryString_closure: { + "^": "Closure:3;encoding", + call$2: function(map, element) { + var t1, index, key, value; + t1 = J.getInterceptor$asx(element); + index = t1.indexOf$1(element, "="); + if (index === -1) { + if (!t1.$eq(element, "")) + J.$indexSet$ax(map, P._Uri__uriDecode(element, 0, t1.get$length(element), this.encoding, true), ""); + } else if (index !== 0) { + key = t1.substring$2(element, 0, index); + value = C.JSString_methods.substring$1(element, index + 1); + t1 = this.encoding; + J.$indexSet$ax(map, P._Uri__uriDecode(key, 0, key.length, t1, true), P._Uri__uriDecode(value, 0, value.length, t1, true)); + } + return map; + } + }, + Uri__parseIPv4Address_error: { + "^": "Closure:44;host", + call$2: function(msg, position) { + throw H.wrapException(new P.FormatException("Illegal IPv4 address, " + msg, this.host, position)); + } + }, + Uri_parseIPv6Address_error: { + "^": "Closure:45;host", + call$2: function(msg, position) { + throw H.wrapException(new P.FormatException("Illegal IPv6 address, " + msg, this.host, position)); + }, + call$1: function(msg) { + return this.call$2(msg, null); + } + }, + Uri_parseIPv6Address_parseHex: { + "^": "Closure:46;host,error", + call$2: function(start, end) { + var value, t1; + if (J.$gt$n(J.$sub$n(end, start), 4)) + this.error.call$2("an IPv6 part can only contain a maximum of 4 hex digits", start); + value = H.Primitives_parseInt(C.JSString_methods.substring$2(this.host, start, end), 16, null); + t1 = J.getInterceptor$n(value); + if (t1.$lt(value, 0) || t1.$gt(value, 65535)) + this.error.call$2("each part must be in the range of `0x0..0xFFFF`", start); + return value; + } }, - Uri: { - "^": "Object;scheme,_userInfo,_host,_port,_path,_query,_fragment,_pathSegments,_queryParameters,_queryParameterLists", + _Uri: { + "^": "Object;scheme<,_userInfo,_host,_port,_path,_query,_fragment,_pathSegments,_text,_hashCodeCache,_queryParameters,_queryParameterLists", + get$userInfo: function() { + return this._userInfo; + }, get$host: function(_) { var t1 = this._host; if (t1 == null) @@ -10410,9 +10740,20 @@ get$port: function(_) { var t1 = this._port; if (t1 == null) - return P.Uri__defaultPort(this.scheme); + return P._Uri__defaultPort(this.scheme); return t1; }, + get$path: function(_) { + return this._path; + }, + get$query: function(_) { + var t1 = this._query; + return t1 == null ? "" : t1; + }, + get$fragment: function() { + var t1 = this._fragment; + return t1 == null ? "" : t1; + }, get$pathSegments: function() { var result, pathToSplit; result = this._pathSegments; @@ -10425,6 +10766,15 @@ this._pathSegments = result; return result; }, + get$queryParameters: function() { + var t1 = this._queryParameters; + if (t1 == null) { + t1 = this._query; + t1 = H.setRuntimeTypeInfo(new P.UnmodifiableMapView(P.Uri_splitQueryString(t1 == null ? "" : t1, C.Utf8Codec_false)), [P.String, P.String]); + this._queryParameters = t1; + } + return t1; + }, _mergePaths$2: function(base, reference) { var backCount, refStart, baseEnd, newEnd, delta, t1; for (backCount = 0, refStart = 0; C.JSString_methods.startsWith$2(reference, "../", refStart);) { @@ -10454,6 +10804,75 @@ } return C.JSString_methods.replaceRange$3(base, baseEnd + 1, null, C.JSString_methods.substring$1(reference, refStart - 3 * backCount)); }, + resolve$1: function(reference) { + return this.resolveUri$1(P.Uri_parse(reference, 0, null)); + }, + resolveUri$1: function(reference) { + var targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, t1, mergedPath; + if (reference.get$scheme().length !== 0) { + targetScheme = reference.get$scheme(); + if (reference.get$hasAuthority()) { + targetUserInfo = reference.get$userInfo(); + targetHost = reference.get$host(reference); + targetPort = reference.get$hasPort() ? reference.get$port(reference) : null; + } else { + targetUserInfo = ""; + targetHost = null; + targetPort = null; + } + targetPath = P._Uri__removeDotSegments(reference.get$path(reference)); + targetQuery = reference.get$hasQuery() ? reference.get$query(reference) : null; + } else { + targetScheme = this.scheme; + if (reference.get$hasAuthority()) { + targetUserInfo = reference.get$userInfo(); + targetHost = reference.get$host(reference); + targetPort = P._Uri__makePort(reference.get$hasPort() ? reference.get$port(reference) : null, targetScheme); + targetPath = P._Uri__removeDotSegments(reference.get$path(reference)); + targetQuery = reference.get$hasQuery() ? reference.get$query(reference) : null; + } else { + targetUserInfo = this._userInfo; + targetHost = this._host; + targetPort = this._port; + if (reference.get$path(reference) === "") { + targetPath = this._path; + targetQuery = reference.get$hasQuery() ? reference.get$query(reference) : this._query; + } else { + if (reference.get$hasAbsolutePath()) + targetPath = P._Uri__removeDotSegments(reference.get$path(reference)); + else { + t1 = this._path; + if (t1.length === 0) + if (targetHost == null) + targetPath = targetScheme.length === 0 ? reference.get$path(reference) : P._Uri__removeDotSegments(reference.get$path(reference)); + else + targetPath = P._Uri__removeDotSegments("/" + reference.get$path(reference)); + else { + mergedPath = this._mergePaths$2(t1, reference.get$path(reference)); + targetPath = targetScheme.length !== 0 || targetHost != null || C.JSString_methods.startsWith$1(t1, "/") ? P._Uri__removeDotSegments(mergedPath) : P._Uri__normalizeRelativePath(mergedPath); + } + } + targetQuery = reference.get$hasQuery() ? reference.get$query(reference) : null; + } + } + } + return new P._Uri(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, reference.get$hasFragment() ? reference.get$fragment() : null, null, null, null, null, null); + }, + get$hasAuthority: function() { + return this._host != null; + }, + get$hasPort: function() { + return this._port != null; + }, + get$hasQuery: function() { + return this._query != null; + }, + get$hasFragment: function() { + return this._fragment != null; + }, + get$hasAbsolutePath: function() { + return C.JSString_methods.startsWith$1(this._path, "/"); + }, get$origin: function(_) { var t1, t2; t1 = this.scheme; @@ -10468,138 +10887,195 @@ throw H.wrapException(new P.StateError("Origin is only applicable schemes http and https: " + this.toString$0(0))); t2 = this._port; if (t2 == null) - return t1 + "://" + H.S(this._host); - return t1 + "://" + H.S(this._host) + ":" + H.S(t2); + return H.S(t1) + "://" + H.S(this._host); + return H.S(t1) + "://" + H.S(this._host) + ":" + H.S(t2); }, toFilePath$1$windows: function(windows) { - var t1 = this.scheme; + var t1, pathSegments; + t1 = this.scheme; if (t1 !== "" && t1 !== "file") - throw H.wrapException(new P.UnsupportedError("Cannot extract a file path from a " + t1 + " URI")); + throw H.wrapException(new P.UnsupportedError("Cannot extract a file path from a " + H.S(t1) + " URI")); t1 = this._query; if ((t1 == null ? "" : t1) !== "") throw H.wrapException(new P.UnsupportedError("Cannot extract a file path from a URI with a query component")); t1 = this._fragment; if ((t1 == null ? "" : t1) !== "") throw H.wrapException(new P.UnsupportedError("Cannot extract a file path from a URI with a fragment component")); - if (this.get$host(this) !== "") + if (this._host != null && this.get$host(this) !== "") H.throwExpression(new P.UnsupportedError("Cannot extract a non-Windows file path from a file URI with an authority")); - P.Uri__checkNonWindowsPathReservedCharacters(this.get$pathSegments(), false); - t1 = this.get$_isPathAbsolute() ? "/" : ""; - t1 = P.StringBuffer__writeAll(t1, this.get$pathSegments(), "/"); + pathSegments = this.get$pathSegments(); + P._Uri__checkNonWindowsPathReservedCharacters(pathSegments, false); + t1 = P.StringBuffer__writeAll(C.JSString_methods.startsWith$1(this._path, "/") ? "/" : "", pathSegments, "/"); t1 = t1.charCodeAt(0) == 0 ? t1 : t1; return t1; }, toFilePath$0: function() { return this.toFilePath$1$windows(null); }, - get$_isPathAbsolute: function() { - if (this._path.length === 0) - return false; - return C.JSString_methods.startsWith$1(this._path, "/"); - }, get$data: function(_) { return this.scheme === "data" ? P.UriData_UriData$fromUri(this) : null; }, toString$0: function(_) { var t1, t2, t3, t4; - t1 = this.scheme; - t2 = "" !== t1 ? t1 + ":" : ""; - t3 = this._host; - t4 = t3 == null; - if (!t4 || C.JSString_methods.startsWith$1(this._path, "//") || t1 === "file") { - t1 = t2 + "//"; - t2 = this._userInfo; - if (t2.length !== 0) - t1 = t1 + t2 + "@"; - if (!t4) - t1 += H.S(t3); - t2 = this._port; + t1 = this._text; + if (t1 == null) { + t1 = this.scheme; + t2 = t1.length !== 0 ? H.S(t1) + ":" : ""; + t3 = this._host; + t4 = t3 == null; + if (!t4 || C.JSString_methods.startsWith$1(this._path, "//") || t1 === "file") { + t1 = t2 + "//"; + t2 = this._userInfo; + if (t2.length !== 0) + t1 = t1 + t2 + "@"; + if (!t4) + t1 += H.S(t3); + t2 = this._port; + if (t2 != null) + t1 = t1 + ":" + H.S(t2); + } else + t1 = t2; + t1 += this._path; + t2 = this._query; if (t2 != null) - t1 = t1 + ":" + H.S(t2); - } else - t1 = t2; - t1 += this._path; - t2 = this._query; - if (t2 != null) - t1 = t1 + "?" + H.S(t2); - t2 = this._fragment; - if (t2 != null) - t1 = t1 + "#" + H.S(t2); - return t1.charCodeAt(0) == 0 ? t1 : t1; + t1 = t1 + "?" + H.S(t2); + t2 = this._fragment; + if (t2 != null) + t1 = t1 + "#" + H.S(t2); + t1 = t1.charCodeAt(0) == 0 ? t1 : t1; + this._text = t1; + } + return t1; }, $eq: function(_, other) { - var t1, t2, t3, t4; + var t1, t2, t3; if (other == null) return false; + if (this === other) + return true; t1 = J.getInterceptor(other); - if (!t1.$isUri) - return false; - if (this.scheme === other.scheme) - if (this._host != null === (other._host != null)) - if (this._userInfo === other._userInfo) { - t2 = this.get$host(this); - t3 = t1.get$host(other); - if (t2 == null ? t3 == null : t2 === t3) { - t2 = this.get$port(this); - t1 = t1.get$port(other); - if (t2 == null ? t1 == null : t2 === t1) - if (this._path === other._path) { - t1 = this._query; - t2 = t1 == null; - t3 = other._query; - t4 = t3 == null; - if (!t2 === !t4) { - if (t2) - t1 = ""; - if (t1 == null ? (t4 ? "" : t3) == null : t1 === (t4 ? "" : t3)) { - t1 = this._fragment; - t2 = t1 == null; - t3 = other._fragment; - t4 = t3 == null; - if (!t2 === !t4) { - if (t2) - t1 = ""; - t1 = t1 == null ? (t4 ? "" : t3) == null : t1 === (t4 ? "" : t3); + if (!!t1.$isUri) { + t2 = this.scheme; + t3 = other.get$scheme(); + if (t2 == null ? t3 == null : t2 === t3) + if (this._host != null === other.get$hasAuthority()) + if (this._userInfo === other.get$userInfo()) { + t2 = this.get$host(this); + t3 = t1.get$host(other); + if (t2 == null ? t3 == null : t2 === t3) + if (J.$eq$(this.get$port(this), t1.get$port(other))) + if (this._path === t1.get$path(other)) { + t2 = this._query; + t3 = t2 == null; + if (!t3 === other.get$hasQuery()) { + if (t3) + t2 = ""; + if (t2 === t1.get$query(other)) { + t1 = this._fragment; + t2 = t1 == null; + if (!t2 === other.get$hasFragment()) { + if (t2) + t1 = ""; + t1 = t1 === other.get$fragment(); + } else + t1 = false; } else t1 = false; } else t1 = false; } else t1 = false; - } else + else t1 = false; else t1 = false; } else t1 = false; - } else + else t1 = false; else t1 = false; - else - t1 = false; - return t1; + return t1; + } + return false; }, get$hashCode: function(_) { - var t1, t2, t3, t4, t5; - t1 = new P.Uri_hashCode_combine(); - t2 = this.get$host(this); - t3 = this.get$port(this); - t4 = this._query; - if (t4 == null) - t4 = ""; - t5 = this._fragment; - return t1.call$2(this.scheme, t1.call$2(this._userInfo, t1.call$2(t2, t1.call$2(t3, t1.call$2(this._path, t1.call$2(t4, t1.call$2(t5 == null ? "" : t5, 1))))))); + var t1, t2, t3, t4; + t1 = this._hashCodeCache; + if (t1 == null) { + t1 = this._text; + if (t1 == null) { + t1 = this.scheme; + t2 = t1.length !== 0 ? H.S(t1) + ":" : ""; + t3 = this._host; + t4 = t3 == null; + if (!t4 || C.JSString_methods.startsWith$1(this._path, "//") || t1 === "file") { + t1 = t2 + "//"; + t2 = this._userInfo; + if (t2.length !== 0) + t1 = t1 + t2 + "@"; + if (!t4) + t1 += H.S(t3); + t2 = this._port; + if (t2 != null) + t1 = t1 + ":" + H.S(t2); + } else + t1 = t2; + t1 += this._path; + t2 = this._query; + if (t2 != null) + t1 = t1 + "?" + H.S(t2); + t2 = this._fragment; + if (t2 != null) + t1 = t1 + "#" + H.S(t2); + t1 = t1.charCodeAt(0) == 0 ? t1 : t1; + this._text = t1; + } + t1 = J.get$hashCode$(t1); + this._hashCodeCache = t1; + } + return t1; }, + $isUri: 1, static: { - Uri_Uri: function(fragment, host, path, pathSegments, port, query, queryParameters, scheme, userInfo) { + _Uri__Uri$notSimple: function(uri, start, end, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, scheme) { + var t1, userInfoStart, userInfo, host, port, path, query; + if (scheme == null) { + t1 = J.getInterceptor$n(schemeEnd); + if (t1.$gt(schemeEnd, start)) + scheme = P._Uri__makeScheme(uri, start, schemeEnd); + else { + if (t1.$eq(schemeEnd, start)) + P._Uri__fail(uri, start, "Invalid empty scheme"); + scheme = ""; + } + } + t1 = J.getInterceptor$n(hostStart); + if (t1.$gt(hostStart, start)) { + userInfoStart = J.$add$ns(schemeEnd, 3); + userInfo = J.$lt$n(userInfoStart, hostStart) ? P._Uri__makeUserInfo(uri, userInfoStart, t1.$sub(hostStart, 1)) : ""; + host = P._Uri__makeHost(uri, hostStart, portStart, false); + t1 = J.getInterceptor$ns(portStart); + port = J.$lt$n(t1.$add(portStart, 1), pathStart) ? P._Uri__makePort(H.Primitives_parseInt(J.substring$2$s(uri, t1.$add(portStart, 1), pathStart), null, new P.closure(uri, portStart)), scheme) : null; + } else { + userInfo = ""; + host = null; + port = null; + } + path = P._Uri__makePath(uri, pathStart, queryStart, null, scheme, host != null); + t1 = J.getInterceptor$n(queryStart); + query = t1.$lt(queryStart, fragmentStart) ? P._Uri__makeQuery(uri, t1.$add(queryStart, 1), fragmentStart, null) : null; + t1 = J.getInterceptor$n(fragmentStart); + return new P._Uri(scheme, userInfo, host, port, path, query, t1.$lt(fragmentStart, end) ? P._Uri__makeFragment(uri, t1.$add(fragmentStart, 1), end) : null, null, null, null, null, null); + }, + _Uri__Uri: function(fragment, host, path, pathSegments, port, query, queryParameters, scheme, userInfo) { var isFile, t1, t2; - scheme = P.Uri__makeScheme(scheme, 0, scheme.length); - userInfo = P.Uri__makeUserInfo(userInfo, 0, userInfo.length); - host = P.Uri__makeHost(host, 0, host == null ? 0 : J.get$length$asx(host), false); - query = P.Uri__makeQuery(query, 0, 0, queryParameters); - fragment = P.Uri__makeFragment(fragment, 0, 0); - port = P.Uri__makePort(port, scheme); + scheme = P._Uri__makeScheme(scheme, 0, scheme == null ? 0 : scheme.length); + userInfo = P._Uri__makeUserInfo(userInfo, 0, 0); + host = P._Uri__makeHost(host, 0, host == null ? 0 : J.get$length$asx(host), false); + query = P._Uri__makeQuery(query, 0, 0, queryParameters); + fragment = P._Uri__makeFragment(fragment, 0, 0); + port = P._Uri__makePort(port, scheme); isFile = scheme === "file"; if (host == null) t1 = userInfo.length !== 0 || port != null || isFile; @@ -10609,157 +11085,26 @@ host = ""; t1 = host == null; t2 = path == null ? 0 : path.length; - path = P.Uri__makePath(path, 0, t2, pathSegments, scheme, !t1); - return new P.Uri(scheme, userInfo, host, port, scheme.length === 0 && t1 && !C.JSString_methods.startsWith$1(path, "/") ? P.Uri__normalizeRelativePath(path) : P.Uri__removeDotSegments(path), query, fragment, null, null, null); + path = P._Uri__makePath(path, 0, t2, pathSegments, scheme, !t1); + return new P._Uri(scheme, userInfo, host, port, scheme.length === 0 && t1 && !C.JSString_methods.startsWith$1(path, "/") ? P._Uri__normalizeRelativePath(path) : P._Uri__removeDotSegments(path), query, fragment, null, null, null, null, null); }, - Uri__defaultPort: function(scheme) { + _Uri__defaultPort: function(scheme) { if (scheme === "http") return 80; if (scheme === "https") return 443; return 0; }, - Uri_parse: function(uri, start, end) { - var t1, pathStart, state, t2, i, t3, $char, index, path, numberSignIndex, query, fragment; - t1 = {}; - t1.end = end; - t1.scheme = ""; - t1.userinfo = ""; - t1.host = null; - t1.port = null; - t1.end = J.get$length$asx(uri); - t1.index = start; - t1.$char = -1; - t2 = J.getInterceptor$s(uri); - i = start; - while (true) { - t3 = t1.end; - if (typeof t3 !== "number") - return H.iae(t3); - if (!(i < t3)) { - pathStart = start; - state = 0; - break; - } - $char = t2.codeUnitAt$1(uri, i); - t1.$char = $char; - if ($char === 63 || $char === 35) { - pathStart = start; - state = 0; - break; - } - if ($char === 47) { - state = i === start ? 2 : 1; - pathStart = start; - break; - } - if ($char === 58) { - if (i === start) - P.Uri__fail(uri, start, "Invalid empty scheme"); - t1.scheme = P.Uri__makeScheme(uri, start, i); - ++i; - if (t1.scheme === "data") - return P.UriData__parse(uri, i, null).get$uri(); - if (i === t1.end) { - t1.$char = -1; - state = 0; - } else { - $char = t2.codeUnitAt$1(uri, i); - t1.$char = $char; - if ($char === 63 || $char === 35) - state = 0; - else - state = $char === 47 ? 2 : 1; - } - pathStart = i; - break; - } - ++i; - t1.$char = -1; - } - t1.index = i; - if (state === 2) { - index = i + 1; - t1.index = index; - if (index === t1.end) { - t1.$char = -1; - state = 0; - } else { - $char = t2.codeUnitAt$1(uri, index); - t1.$char = $char; - if ($char === 47) { - t1.index = J.$add$ns(t1.index, 1); - new P.Uri_parse_parseAuth(t1, uri, -1).call$0(); - pathStart = t1.index; - } - t3 = t1.$char; - state = t3 === 63 || t3 === 35 || t3 === -1 ? 0 : 1; - } - } - if (state === 1) - while (true) { - index = J.$add$ns(t1.index, 1); - t1.index = index; - t3 = t1.end; - if (typeof t3 !== "number") - return H.iae(t3); - if (!(index < t3)) - break; - $char = t2.codeUnitAt$1(uri, index); - t1.$char = $char; - if ($char === 63 || $char === 35) - break; - t1.$char = -1; - } - t3 = t1.host; - path = P.Uri__makePath(uri, pathStart, t1.index, null, t1.scheme, t3 != null); - t3 = t1.$char; - if (t3 === 63) { - i = J.$add$ns(t1.index, 1); - while (true) { - t3 = t1.end; - if (typeof t3 !== "number") - return H.iae(t3); - if (!(i < t3)) { - numberSignIndex = -1; - break; - } - if (t2.codeUnitAt$1(uri, i) === 35) { - numberSignIndex = i; - break; - } - ++i; - } - t2 = t1.index; - if (numberSignIndex < 0) { - query = P.Uri__makeQuery(uri, J.$add$ns(t2, 1), t1.end, null); - fragment = null; - } else { - query = P.Uri__makeQuery(uri, J.$add$ns(t2, 1), numberSignIndex, null); - fragment = P.Uri__makeFragment(uri, numberSignIndex + 1, t1.end); - } - } else { - fragment = t3 === 35 ? P.Uri__makeFragment(uri, J.$add$ns(t1.index, 1), t1.end) : null; - query = null; - } - return new P.Uri(t1.scheme, t1.userinfo, t1.host, t1.port, path, query, fragment, null, null, null); - }, - Uri__fail: function(uri, index, message) { + _Uri__fail: function(uri, index, message) { throw H.wrapException(new P.FormatException(message, uri, index)); }, - Uri_Uri$file: function(path, windows) { - return windows ? P.Uri__makeWindowsFileUrl(path, false) : P.Uri__makeFileUri(path, false); - }, - Uri_base: function() { - var uri = H.Primitives_currentUri(); - if (uri != null) - return P.Uri_parse(uri, 0, null); - throw H.wrapException(new P.UnsupportedError("'Uri.base' is not supported")); + _Uri__Uri$file: function(path, windows) { + return windows ? P._Uri__makeWindowsFileUrl(path, false) : P._Uri__makeFileUri(path, false); }, - Uri__checkNonWindowsPathReservedCharacters: function(segments, argumentError) { - C.JSArray_methods.forEach$1(segments, new P.Uri__checkNonWindowsPathReservedCharacters_closure(false)); + _Uri__checkNonWindowsPathReservedCharacters: function(segments, argumentError) { + C.JSArray_methods.forEach$1(segments, new P._Uri__checkNonWindowsPathReservedCharacters_closure(false)); }, - Uri__checkWindowsPathReservedCharacters: function(segments, argumentError, firstSegment) { + _Uri__checkWindowsPathReservedCharacters: function(segments, argumentError, firstSegment) { var t1; for (t1 = H.SubListIterable$(segments, firstSegment, null, H.getTypeArgumentByIndex(segments, 0)), t1 = new H.ListIterator(t1, t1.get$length(t1), 0, null); t1.moveNext$0();) if (J.contains$1$asx(t1._current, new H.JSSyntaxRegExp('["*/:<>?\\\\|]', H.JSSyntaxRegExp_makeNative('["*/:<>?\\\\|]', false, true, false), null, null)) === true) @@ -10768,7 +11113,7 @@ else throw H.wrapException(new P.UnsupportedError("Illegal character in path")); }, - Uri__checkWindowsDriveLetter: function(charCode, argumentError) { + _Uri__checkWindowsDriveLetter: function(charCode, argumentError) { var t1; if (!(65 <= charCode && charCode <= 90)) t1 = 97 <= charCode && charCode <= 122; @@ -10781,36 +11126,37 @@ else throw H.wrapException(new P.UnsupportedError("Illegal drive letter " + P.String_String$fromCharCode(charCode))); }, - Uri__makeFileUri: function(path, slashTerminated) { + _Uri__makeFileUri: function(path, slashTerminated) { var t1, segments; t1 = J.getInterceptor$s(path); segments = t1.split$1(path, "/"); if (t1.startsWith$1(path, "/")) - return P.Uri_Uri(null, null, null, segments, null, null, null, "file", ""); + return P._Uri__Uri(null, null, null, segments, null, null, null, "file", null); else - return P.Uri_Uri(null, null, null, segments, null, null, null, "", ""); + return P._Uri__Uri(null, null, null, segments, null, null, null, null, null); }, - Uri__makeWindowsFileUrl: function(path, slashTerminated) { + _Uri__makeWindowsFileUrl: function(path, slashTerminated) { var t1, pathSegments, pathStart, hostPart; - t1 = J.getInterceptor$s(path); - if (t1.startsWith$1(path, "\\\\?\\")) - if (t1.startsWith$2(path, "UNC\\", 4)) - path = t1.replaceRange$3(path, 0, 7, "\\"); + if (J.startsWith$1$s(path, "\\\\?\\")) + if (C.JSString_methods.startsWith$2(path, "UNC\\", 4)) + path = C.JSString_methods.replaceRange$3(path, 0, 7, "\\"); else { - path = t1.substring$1(path, 4); + path = C.JSString_methods.substring$1(path, 4); if (path.length < 3 || C.JSString_methods.codeUnitAt$1(path, 1) !== 58 || C.JSString_methods.codeUnitAt$1(path, 2) !== 92) throw H.wrapException(P.ArgumentError$("Windows paths with \\\\?\\ prefix must be absolute")); } - else - path = t1.replaceAll$2(path, "/", "\\"); + else { + H.checkString("\\"); + path = H.stringReplaceAllUnchecked(path, "/", "\\"); + } t1 = path.length; if (t1 > 1 && C.JSString_methods.codeUnitAt$1(path, 1) === 58) { - P.Uri__checkWindowsDriveLetter(C.JSString_methods.codeUnitAt$1(path, 0), true); + P._Uri__checkWindowsDriveLetter(C.JSString_methods.codeUnitAt$1(path, 0), true); if (t1 === 2 || C.JSString_methods.codeUnitAt$1(path, 2) !== 92) throw H.wrapException(P.ArgumentError$("Windows paths with drive letter must be absolute")); pathSegments = path.split("\\"); - P.Uri__checkWindowsPathReservedCharacters(pathSegments, true, 1); - return P.Uri_Uri(null, null, null, pathSegments, null, null, null, "file", ""); + P._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 1); + return P._Uri__Uri(null, null, null, pathSegments, null, null, null, "file", null); } if (C.JSString_methods.startsWith$1(path, "\\")) if (C.JSString_methods.startsWith$2(path, "\\", 1)) { @@ -10818,66 +11164,64 @@ t1 = pathStart < 0; hostPart = t1 ? C.JSString_methods.substring$1(path, 2) : C.JSString_methods.substring$2(path, 2, pathStart); pathSegments = (t1 ? "" : C.JSString_methods.substring$1(path, pathStart + 1)).split("\\"); - P.Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); - return P.Uri_Uri(null, hostPart, null, pathSegments, null, null, null, "file", ""); + P._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return P._Uri__Uri(null, hostPart, null, pathSegments, null, null, null, "file", null); } else { pathSegments = path.split("\\"); - P.Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); - return P.Uri_Uri(null, null, null, pathSegments, null, null, null, "file", ""); + P._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return P._Uri__Uri(null, null, null, pathSegments, null, null, null, "file", null); } else { pathSegments = path.split("\\"); - P.Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); - return P.Uri_Uri(null, null, null, pathSegments, null, null, null, "", ""); + P._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return P._Uri__Uri(null, null, null, pathSegments, null, null, null, null, null); } }, - Uri__makePort: function(port, scheme) { - if (port != null && port === P.Uri__defaultPort(scheme)) + _Uri__makePort: function(port, scheme) { + if (port != null && J.$eq$(port, P._Uri__defaultPort(scheme))) return; return port; }, - Uri__makeHost: function(host, start, end, strictIPv6) { - var t1, t2, t3, i; + _Uri__makeHost: function(host, start, end, strictIPv6) { + var t1, t2, i; if (host == null) return; t1 = J.getInterceptor(start); if (t1.$eq(start, end)) return ""; - t2 = J.getInterceptor$s(host); - if (t2.codeUnitAt$1(host, start) === 91) { - t3 = J.getInterceptor$n(end); - if (t2.codeUnitAt$1(host, t3.$sub(end, 1)) !== 93) - P.Uri__fail(host, start, "Missing end `]` to match `[` in host"); - P.Uri_parseIPv6Address(host, t1.$add(start, 1), t3.$sub(end, 1)); - return t2.substring$2(host, start, end).toLowerCase(); + if (J.getInterceptor$s(host).codeUnitAt$1(host, start) === 91) { + t2 = J.getInterceptor$n(end); + if (C.JSString_methods.codeUnitAt$1(host, t2.$sub(end, 1)) !== 93) + P._Uri__fail(host, start, "Missing end `]` to match `[` in host"); + P.Uri_parseIPv6Address(host, t1.$add(start, 1), t2.$sub(end, 1)); + return C.JSString_methods.substring$2(host, start, end).toLowerCase(); } - if (!strictIPv6) - for (i = start; t1 = J.getInterceptor$n(i), t1.$lt(i, end); i = t1.$add(i, 1)) - if (t2.codeUnitAt$1(host, i) === 58) { - P.Uri_parseIPv6Address(host, start, end); - return "[" + H.S(host) + "]"; - } - return P.Uri__normalizeRegName(host, start, end); + for (i = start; t1 = J.getInterceptor$n(i), t1.$lt(i, end); i = t1.$add(i, 1)) + if (C.JSString_methods.codeUnitAt$1(host, i) === 58) { + P.Uri_parseIPv6Address(host, start, end); + return "[" + host + "]"; + } + return P._Uri__normalizeRegName(host, start, end); }, - Uri__normalizeRegName: function(host, start, end) { - var t1, index, sectionStart, buffer, isNormalized, t2, $char, replacement, t3, slice, sourceLength, tail; - for (t1 = J.getInterceptor$s(host), index = start, sectionStart = index, buffer = null, isNormalized = true; t2 = J.getInterceptor$n(index), t2.$lt(index, end);) { - $char = t1.codeUnitAt$1(host, index); + _Uri__normalizeRegName: function(host, start, end) { + var index, sectionStart, buffer, isNormalized, t1, $char, replacement, t2, slice, sourceLength, tail; + for (index = start, sectionStart = index, buffer = null, isNormalized = true; t1 = J.getInterceptor$n(index), t1.$lt(index, end);) { + $char = C.JSString_methods.codeUnitAt$1(host, index); if ($char === 37) { - replacement = P.Uri__normalizeEscape(host, index, true); - t3 = replacement == null; - if (t3 && isNormalized) { - index = t2.$add(index, 3); + replacement = P._Uri__normalizeEscape(host, index, true); + t2 = replacement == null; + if (t2 && isNormalized) { + index = t1.$add(index, 3); continue; } if (buffer == null) buffer = new P.StringBuffer(""); - slice = t1.substring$2(host, sectionStart, index); + slice = C.JSString_methods.substring$2(host, sectionStart, index); if (!isNormalized) slice = slice.toLowerCase(); buffer._contents = buffer._contents + slice; - if (t3) { - replacement = t1.substring$2(host, index, t2.$add(index, 3)); + if (t2) { + replacement = C.JSString_methods.substring$2(host, index, t1.$add(index, 3)); sourceLength = 3; } else if (replacement === "%") { replacement = "%25"; @@ -10885,42 +11229,42 @@ } else sourceLength = 3; buffer._contents += replacement; - index = t2.$add(index, sourceLength); + index = t1.$add(index, sourceLength); sectionStart = index; isNormalized = true; } else { if ($char < 127) { - t3 = $char >>> 4; - if (t3 >= 8) - return H.ioore(C.List_qNA, t3); - t3 = (C.List_qNA[t3] & C.JSInt_methods._shlPositive$1(1, $char & 15)) !== 0; + t2 = $char >>> 4; + if (t2 >= 8) + return H.ioore(C.List_qNA, t2); + t2 = (C.List_qNA[t2] & C.JSInt_methods._shlPositive$1(1, $char & 15)) !== 0; } else - t3 = false; - if (t3) { + t2 = false; + if (t2) { if (isNormalized && 65 <= $char && 90 >= $char) { if (buffer == null) buffer = new P.StringBuffer(""); if (J.$lt$n(sectionStart, index)) { - t3 = t1.substring$2(host, sectionStart, index); - buffer._contents = buffer._contents + t3; + t2 = C.JSString_methods.substring$2(host, sectionStart, index); + buffer._contents = buffer._contents + t2; sectionStart = index; } isNormalized = false; } - index = t2.$add(index, 1); + index = t1.$add(index, 1); } else { if ($char <= 93) { - t3 = $char >>> 4; - if (t3 >= 8) - return H.ioore(C.List_2Vk, t3); - t3 = (C.List_2Vk[t3] & C.JSInt_methods._shlPositive$1(1, $char & 15)) !== 0; + t2 = $char >>> 4; + if (t2 >= 8) + return H.ioore(C.List_2Vk, t2); + t2 = (C.List_2Vk[t2] & C.JSInt_methods._shlPositive$1(1, $char & 15)) !== 0; } else - t3 = false; - if (t3) - P.Uri__fail(host, index, "Invalid character"); + t2 = false; + if (t2) + P._Uri__fail(host, index, "Invalid character"); else { - if (($char & 64512) === 55296 && J.$lt$n(t2.$add(index, 1), end)) { - tail = t1.codeUnitAt$1(host, t2.$add(index, 1)); + if (($char & 64512) === 55296 && J.$lt$n(t1.$add(index, 1), end)) { + tail = C.JSString_methods.codeUnitAt$1(host, t1.$add(index, 1)); if ((tail & 64512) === 56320) { $char = (65536 | ($char & 1023) << 10 | tail & 1023) >>> 0; sourceLength = 2; @@ -10930,61 +11274,71 @@ sourceLength = 1; if (buffer == null) buffer = new P.StringBuffer(""); - slice = t1.substring$2(host, sectionStart, index); + slice = C.JSString_methods.substring$2(host, sectionStart, index); if (!isNormalized) slice = slice.toLowerCase(); buffer._contents = buffer._contents + slice; - buffer._contents += P.Uri__escapeChar($char); - index = t2.$add(index, sourceLength); + buffer._contents += P._Uri__escapeChar($char); + index = t1.$add(index, sourceLength); sectionStart = index; } } } } if (buffer == null) - return t1.substring$2(host, start, end); + return C.JSString_methods.substring$2(host, start, end); if (J.$lt$n(sectionStart, end)) { - slice = t1.substring$2(host, sectionStart, end); + slice = C.JSString_methods.substring$2(host, sectionStart, end); buffer._contents += !isNormalized ? slice.toLowerCase() : slice; } t1 = buffer._contents; return t1.charCodeAt(0) == 0 ? t1 : t1; }, - Uri__makeScheme: function(scheme, start, end) { - var t1, lowerCase, i, containsUpperCase, codeUnit, t2; + _Uri__makeScheme: function(scheme, start, end) { + var lowerCase, i, containsUpperCase, codeUnit, t1; if (start === end) return ""; - t1 = J.getInterceptor$s(scheme); - lowerCase = t1.codeUnitAt$1(scheme, start) | 32; + lowerCase = J.getInterceptor$s(scheme).codeUnitAt$1(scheme, start) | 32; if (!(97 <= lowerCase && lowerCase <= 122)) - P.Uri__fail(scheme, start, "Scheme not starting with alphabetic character"); + P._Uri__fail(scheme, start, "Scheme not starting with alphabetic character"); if (typeof end !== "number") return H.iae(end); i = start; containsUpperCase = false; for (; i < end; ++i) { - codeUnit = t1.codeUnitAt$1(scheme, i); + codeUnit = C.JSString_methods.codeUnitAt$1(scheme, i); if (codeUnit < 128) { - t2 = codeUnit >>> 4; - if (t2 >= 8) - return H.ioore(C.List_JYB, t2); - t2 = (C.List_JYB[t2] & C.JSInt_methods._shlPositive$1(1, codeUnit & 15)) !== 0; + t1 = codeUnit >>> 4; + if (t1 >= 8) + return H.ioore(C.List_JYB, t1); + t1 = (C.List_JYB[t1] & C.JSInt_methods._shlPositive$1(1, codeUnit & 15)) !== 0; } else - t2 = false; - if (!t2) - P.Uri__fail(scheme, i, "Illegal scheme character"); + t1 = false; + if (!t1) + P._Uri__fail(scheme, i, "Illegal scheme character"); if (65 <= codeUnit && codeUnit <= 90) containsUpperCase = true; } - scheme = t1.substring$2(scheme, start, end); - return containsUpperCase ? scheme.toLowerCase() : scheme; + scheme = C.JSString_methods.substring$2(scheme, start, end); + return P._Uri__canonicalizeScheme(containsUpperCase ? scheme.toLowerCase() : scheme); + }, + _Uri__canonicalizeScheme: function(scheme) { + if (scheme === "http") + return "http"; + if (scheme === "file") + return "file"; + if (scheme === "https") + return "https"; + if (scheme === "package") + return "package"; + return scheme; }, - Uri__makeUserInfo: function(userInfo, start, end) { + _Uri__makeUserInfo: function(userInfo, start, end) { if (userInfo == null) return ""; - return P.Uri__normalize(userInfo, start, end, C.List_gRj); + return P._Uri__normalize(userInfo, start, end, C.List_gRj); }, - Uri__makePath: function(path, start, end, pathSegments, scheme, hasAuthority) { + _Uri__makePath: function(path, start, end, pathSegments, scheme, hasAuthority) { var isFile, ensureLeadingSlash, t1, result; isFile = scheme === "file"; ensureLeadingSlash = isFile || hasAuthority; @@ -10995,71 +11349,59 @@ if (t1 && pathSegments != null) throw H.wrapException(P.ArgumentError$("Both path and pathSegments specified")); if (t1) - result = P.Uri__normalize(path, start, end, C.List_qg4); + result = P._Uri__normalize(path, start, end, C.List_qg4); else { pathSegments.toString; - result = H.setRuntimeTypeInfo(new H.MappedListIterable(pathSegments, new P.Uri__makePath_closure()), [null, null]).join$1(0, "/"); + result = H.setRuntimeTypeInfo(new H.MappedListIterable(pathSegments, new P._Uri__makePath_closure()), [null, null]).join$1(0, "/"); } if (result.length === 0) { if (isFile) return "/"; } else if (ensureLeadingSlash && !C.JSString_methods.startsWith$1(result, "/")) result = "/" + result; - return P.Uri__normalizePath(result, scheme, hasAuthority); + return P._Uri__normalizePath(result, scheme, hasAuthority); }, - Uri__normalizePath: function(path, scheme, hasAuthority) { + _Uri__normalizePath: function(path, scheme, hasAuthority) { if (scheme.length === 0 && !hasAuthority && !C.JSString_methods.startsWith$1(path, "/")) - return P.Uri__normalizeRelativePath(path); - return P.Uri__removeDotSegments(path); + return P._Uri__normalizeRelativePath(path); + return P._Uri__removeDotSegments(path); }, - Uri__makeQuery: function(query, start, end, queryParameters) { - var t1, t2, result; - t1 = {}; - t2 = query == null; - if (t2 && true) - return; - t2 = !t2; - t2; - if (t2) - return P.Uri__normalize(query, start, end, C.List_CVk); - result = new P.StringBuffer(""); - t1.separator = ""; - C.JSNull_methods.forEach$1(queryParameters, new P.Uri__makeQuery_closure(new P.Uri__makeQuery_writeParameter(t1, result))); - t1 = result._contents; - return t1.charCodeAt(0) == 0 ? t1 : t1; + _Uri__makeQuery: function(query, start, end, queryParameters) { + if (query != null) + return P._Uri__normalize(query, start, end, C.List_CVk); + return; }, - Uri__makeFragment: function(fragment, start, end) { + _Uri__makeFragment: function(fragment, start, end) { if (fragment == null) return; - return P.Uri__normalize(fragment, start, end, C.List_CVk); + return P._Uri__normalize(fragment, start, end, C.List_CVk); }, - Uri__normalizeEscape: function(source, index, lowerCase) { - var t1, t2, firstDigit, secondDigit, firstDigitValue, secondDigitValue, value, t3; + _Uri__normalizeEscape: function(source, index, lowerCase) { + var t1, firstDigit, secondDigit, firstDigitValue, secondDigitValue, value, t2; t1 = J.getInterceptor$ns(index); - t2 = J.getInterceptor$asx(source); - if (J.$ge$n(t1.$add(index, 2), t2.get$length(source))) + if (J.$ge$n(t1.$add(index, 2), source.length)) return "%"; - firstDigit = t2.codeUnitAt$1(source, t1.$add(index, 1)); - secondDigit = t2.codeUnitAt$1(source, t1.$add(index, 2)); - firstDigitValue = P.Uri__parseHexDigit(firstDigit); - secondDigitValue = P.Uri__parseHexDigit(secondDigit); + firstDigit = C.JSString_methods.codeUnitAt$1(source, t1.$add(index, 1)); + secondDigit = C.JSString_methods.codeUnitAt$1(source, t1.$add(index, 2)); + firstDigitValue = P._Uri__parseHexDigit(firstDigit); + secondDigitValue = P._Uri__parseHexDigit(secondDigit); if (firstDigitValue < 0 || secondDigitValue < 0) return "%"; value = firstDigitValue * 16 + secondDigitValue; if (value < 127) { - t3 = C.JSInt_methods._shrOtherPositive$1(value, 4); - if (t3 >= 8) - return H.ioore(C.List_nxB, t3); - t3 = (C.List_nxB[t3] & C.JSInt_methods._shlPositive$1(1, value & 15)) !== 0; + t2 = C.JSInt_methods._shrOtherPositive$1(value, 4); + if (t2 >= 8) + return H.ioore(C.List_nxB, t2); + t2 = (C.List_nxB[t2] & C.JSInt_methods._shlPositive$1(1, value & 15)) !== 0; } else - t3 = false; - if (t3) + t2 = false; + if (t2) return H.Primitives_stringFromCharCode(lowerCase && 65 <= value && 90 >= value ? (value | 32) >>> 0 : value); if (firstDigit >= 97 || secondDigit >= 97) - return t2.substring$2(source, index, t1.$add(index, 3)).toUpperCase(); + return C.JSString_methods.substring$2(source, index, t1.$add(index, 3)).toUpperCase(); return; }, - Uri__parseHexDigit: function($char) { + _Uri__parseHexDigit: function($char) { var digit, lowerCase; digit = $char ^ 48; if (digit <= 9) @@ -11069,7 +11411,7 @@ return lowerCase - 87; return -1; }, - Uri__escapeChar: function($char) { + _Uri__escapeChar: function($char) { var codeUnits, flag, encodedBytes, t1, index, $byte, t2, t3; if ($char < 128) { codeUnits = new Array(3); @@ -11113,7 +11455,7 @@ } return P.String_String$fromCharCodes(codeUnits, 0, null); }, - Uri__normalize: function(component, start, end, charTable) { + _Uri__normalize: function(component, start, end, charTable) { var t1, index, sectionStart, buffer, t2, $char, t3, replacement, sourceLength, tail; for (t1 = J.getInterceptor$s(component), index = start, sectionStart = index, buffer = null; t2 = J.getInterceptor$n(index), t2.$lt(index, end);) { $char = t1.codeUnitAt$1(component, index); @@ -11128,7 +11470,7 @@ index = t2.$add(index, 1); else { if ($char === 37) { - replacement = P.Uri__normalizeEscape(component, index, false); + replacement = P._Uri__normalizeEscape(component, index, false); if (replacement == null) { index = t2.$add(index, 3); continue; @@ -11147,13 +11489,13 @@ } else t3 = false; if (t3) { - P.Uri__fail(component, index, "Invalid character"); + P._Uri__fail(component, index, "Invalid character"); replacement = null; sourceLength = null; } else { if (($char & 64512) === 55296) if (J.$lt$n(t2.$add(index, 1), end)) { - tail = t1.codeUnitAt$1(component, t2.$add(index, 1)); + tail = C.JSString_methods.codeUnitAt$1(component, t2.$add(index, 1)); if ((tail & 64512) === 56320) { $char = (65536 | ($char & 1023) << 10 | tail & 1023) >>> 0; sourceLength = 2; @@ -11163,12 +11505,12 @@ sourceLength = 1; else sourceLength = 1; - replacement = P.Uri__escapeChar($char); + replacement = P._Uri__escapeChar($char); } } if (buffer == null) buffer = new P.StringBuffer(""); - t3 = t1.substring$2(component, sectionStart, index); + t3 = C.JSString_methods.substring$2(component, sectionStart, index); buffer._contents = buffer._contents + t3; buffer._contents += H.S(replacement); index = t2.$add(index, sourceLength); @@ -11182,14 +11524,14 @@ t1 = buffer._contents; return t1.charCodeAt(0) == 0 ? t1 : t1; }, - Uri__mayContainDotSegments: function(path) { + _Uri__mayContainDotSegments: function(path) { if (C.JSString_methods.startsWith$1(path, ".")) return true; return C.JSString_methods.indexOf$1(path, "/.") !== -1; }, - Uri__removeDotSegments: function(path) { + _Uri__removeDotSegments: function(path) { var output, t1, t2, appendSlash, _i, segment, t3; - if (!P.Uri__mayContainDotSegments(path)) + if (!P._Uri__mayContainDotSegments(path)) return path; output = []; for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) { @@ -11215,9 +11557,9 @@ output.push(""); return C.JSArray_methods.join$1(output, "/"); }, - Uri__normalizeRelativePath: function(path) { + _Uri__normalizeRelativePath: function(path) { var output, t1, t2, appendSlash, _i, segment; - if (!P.Uri__mayContainDotSegments(path)) + if (!P._Uri__mayContainDotSegments(path)) return path; output = []; for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) { @@ -11255,123 +11597,9 @@ output.push(""); return C.JSArray_methods.join$1(output, "/"); }, - Uri_decodeComponent: [function(encodedComponent) { - return P.Uri__uriDecode(encodedComponent, 0, J.get$length$asx(encodedComponent), C.Utf8Codec_false, false); - }, "call$1", "core_Uri_decodeComponent$closure", 2, 0, 64, 39], - Uri_splitQueryString: function(query, encoding) { - return C.JSArray_methods.fold$2(query.split("&"), P.LinkedHashMap__makeEmpty(), new P.Uri_splitQueryString_closure(encoding)); - }, - Uri_parseIPv4Address: function(host) { - var t1, bytes; - t1 = new P.Uri_parseIPv4Address_error(); - bytes = host.split("."); - if (bytes.length !== 4) - t1.call$1("IPv4 address should contain exactly 4 parts"); - return H.setRuntimeTypeInfo(new H.MappedListIterable(bytes, new P.Uri_parseIPv4Address_closure(t1)), [null, null]).toList$0(0); - }, - Uri_parseIPv6Address: function(host, start, end) { - var error, parseHex, parts, partStart, last, i, wildcardSeen, t1, atEnd, isLastWildcard, exception, t2, bytes, index, value, wildCardLength, j; - if (end == null) - end = J.get$length$asx(host); - error = new P.Uri_parseIPv6Address_error(host); - parseHex = new P.Uri_parseIPv6Address_parseHex(host, error); - if (J.$lt$n(J.get$length$asx(host), 2)) - error.call$1("address is too short"); - parts = []; - partStart = start; - for (i = start, wildcardSeen = false; t1 = J.getInterceptor$n(i), t1.$lt(i, end); i = J.$add$ns(i, 1)) - if (J.codeUnitAt$1$s(host, i) === 58) { - if (t1.$eq(i, start)) { - i = t1.$add(i, 1); - if (J.codeUnitAt$1$s(host, i) !== 58) - error.call$2("invalid start colon.", i); - partStart = i; - } - t1 = J.getInterceptor(i); - if (t1.$eq(i, partStart)) { - if (wildcardSeen) - error.call$2("only one wildcard `::` is allowed", i); - J.add$1$ax(parts, -1); - wildcardSeen = true; - } else - J.add$1$ax(parts, parseHex.call$2(partStart, i)); - partStart = t1.$add(i, 1); - } - if (J.get$length$asx(parts) === 0) - error.call$1("too few parts"); - atEnd = J.$eq$(partStart, end); - isLastWildcard = J.$eq$(J.get$last$ax(parts), -1); - if (atEnd && !isLastWildcard) - error.call$2("expected a part after last `:`", end); - if (!atEnd) - try { - J.add$1$ax(parts, parseHex.call$2(partStart, end)); - } catch (exception) { - H.unwrapException(exception); - try { - last = P.Uri_parseIPv4Address(J.substring$2$s(host, partStart, end)); - t1 = J.$shl$n(J.$index$asx(last, 0), 8); - t2 = J.$index$asx(last, 1); - if (typeof t2 !== "number") - return H.iae(t2); - J.add$1$ax(parts, (t1 | t2) >>> 0); - t2 = J.$shl$n(J.$index$asx(last, 2), 8); - t1 = J.$index$asx(last, 3); - if (typeof t1 !== "number") - return H.iae(t1); - J.add$1$ax(parts, (t2 | t1) >>> 0); - } catch (exception) { - H.unwrapException(exception); - error.call$2("invalid end of IPv6 address.", partStart); - } - } - if (wildcardSeen) { - if (J.get$length$asx(parts) > 7) - error.call$1("an address with a wildcard must have less than 7 parts"); - } else if (J.get$length$asx(parts) !== 8) - error.call$1("an address without a wildcard must contain exactly 8 parts"); - bytes = new Uint8Array(16); - i = 0; - index = 0; - while (true) { - t1 = J.get$length$asx(parts); - if (typeof t1 !== "number") - return H.iae(t1); - if (!(i < t1)) - break; - value = J.$index$asx(parts, i); - t1 = J.getInterceptor(value); - if (t1.$eq(value, -1)) { - wildCardLength = 9 - J.get$length$asx(parts); - for (j = 0; j < wildCardLength; ++j) { - if (index < 0 || index >= 16) - return H.ioore(bytes, index); - bytes[index] = 0; - t1 = index + 1; - if (t1 >= 16) - return H.ioore(bytes, t1); - bytes[t1] = 0; - index += 2; - } - } else { - t2 = t1.$shr(value, 8); - if (index < 0 || index >= 16) - return H.ioore(bytes, index); - bytes[index] = t2; - t2 = index + 1; - t1 = t1.$and(value, 255); - if (t2 >= 16) - return H.ioore(bytes, t2); - bytes[t2] = t1; - index += 2; - } - ++i; - } - return bytes; - }, - Uri__uriEncode: function(canonicalTable, text, encoding, spaceToPlus) { + _Uri__uriEncode: function(canonicalTable, text, encoding, spaceToPlus) { var result, bytes, t1, i, t2, $byte, t3; - if (encoding === C.Utf8Codec_false && $.$get$Uri__needsNoEncoding()._nativeRegExp.test(H.checkString(text))) + if (encoding === C.Utf8Codec_false && $.$get$_Uri__needsNoEncoding()._nativeRegExp.test(H.checkString(text))) return text; result = new P.StringBuffer(""); bytes = encoding.get$encoder().convert$1(text); @@ -11400,10 +11628,10 @@ } return t2.charCodeAt(0) == 0 ? t2 : t2; }, - Uri__hexCharPairToByte: function(s, pos) { - var t1, $byte, i, charCode; - for (t1 = J.getInterceptor$s(s), $byte = 0, i = 0; i < 2; ++i) { - charCode = t1.codeUnitAt$1(s, pos + i); + _Uri__hexCharPairToByte: function(s, pos) { + var $byte, i, charCode; + for ($byte = 0, i = 0; i < 2; ++i) { + charCode = C.JSString_methods.codeUnitAt$1(s, pos + i); if (48 <= charCode && charCode <= 57) $byte = $byte * 16 + charCode - 48; else { @@ -11416,11 +11644,11 @@ } return $byte; }, - Uri__uriDecode: function(text, start, end, encoding, plusToSpace) { + _Uri__uriDecode: function(text, start, end, encoding, plusToSpace) { var t1, i, simple, codeUnit, t2, bytes; if (typeof end !== "number") return H.iae(end); - t1 = J.getInterceptor$asx(text); + t1 = J.getInterceptor$s(text); i = start; while (true) { if (!(i < end)) { @@ -11442,3599 +11670,3328 @@ ++i; } if (simple) { - if (C.Utf8Codec_false !== encoding) - t2 = false; - else - t2 = true; - if (t2) - return t1.substring$2(text, start, end); - else - bytes = new H.CodeUnits(t1.substring$2(text, start, end)); - } else { - bytes = []; - for (i = start; i < end; ++i) { - codeUnit = t1.codeUnitAt$1(text, i); - if (codeUnit > 127) - throw H.wrapException(P.ArgumentError$("Illegal percent encoding in URI")); - if (codeUnit === 37) { - t2 = t1.get$length(text); - if (typeof t2 !== "number") - return H.iae(t2); - if (i + 3 > t2) - throw H.wrapException(P.ArgumentError$("Truncated URI")); - bytes.push(P.Uri__hexCharPairToByte(text, i + 1)); - i += 2; - } else if (plusToSpace && codeUnit === 43) - bytes.push(32); - else - bytes.push(codeUnit); - } - } - return new P.Utf8Decoder(false).convert$1(bytes); - } - } - }, - Uri_parse_parseAuth: { - "^": "Closure:2;_box_0,uri,EOI", - call$0: function() { - var t1, hostStart, t2, t3, $char, lastColon, lastAt, char0, endBracket, hostEnd, t4, t5, t6, i, portNumber, digit; - t1 = this._box_0; - hostStart = t1.index; - t2 = t1.end; - if (hostStart == null ? t2 == null : hostStart === t2) { - t1.$char = this.EOI; - return; - } - t2 = this.uri; - t3 = J.getInterceptor$s(t2); - t1.$char = t3.codeUnitAt$1(t2, hostStart); - for ($char = this.EOI, lastColon = -1, lastAt = -1; J.$lt$n(t1.index, t1.end);) { - char0 = t3.codeUnitAt$1(t2, t1.index); - t1.$char = char0; - if (char0 === 47 || char0 === 63 || char0 === 35) - break; - if (char0 === 64) { - lastAt = t1.index; - lastColon = -1; - } else if (char0 === 58) - lastColon = t1.index; - else if (char0 === 91) { - endBracket = t3.indexOf$2(t2, "]", J.$add$ns(t1.index, 1)); - if (endBracket === -1) { - t1.index = t1.end; - t1.$char = $char; - lastColon = -1; - break; - } else - t1.index = endBracket; - lastColon = -1; - } - t1.index = J.$add$ns(t1.index, 1); - t1.$char = $char; - } - hostEnd = t1.index; - t4 = J.getInterceptor$n(lastAt); - if (t4.$ge(lastAt, 0)) { - t1.userinfo = P.Uri__makeUserInfo(t2, hostStart, lastAt); - hostStart = t4.$add(lastAt, 1); - } - t4 = J.getInterceptor$n(lastColon); - if (t4.$ge(lastColon, 0)) { - t5 = t4.$add(lastColon, 1); - t6 = t1.index; - if (typeof t6 !== "number") - return H.iae(t6); - if (t5 < t6) { - i = t4.$add(lastColon, 1); - portNumber = 0; - while (true) { - t4 = t1.index; - if (typeof t4 !== "number") - return H.iae(t4); - if (!(i < t4)) - break; - digit = t3.codeUnitAt$1(t2, i); - if (48 > digit || 57 < digit) - P.Uri__fail(t2, i, "Invalid port number"); - portNumber = portNumber * 10 + (digit - 48); - ++i; - } - } else - portNumber = null; - t1.port = P.Uri__makePort(portNumber, t1.scheme); - hostEnd = lastColon; - } - t1.host = P.Uri__makeHost(t2, hostStart, hostEnd, true); - if (J.$lt$n(t1.index, t1.end)) - t1.$char = t3.codeUnitAt$1(t2, t1.index); - } - }, - Uri__checkNonWindowsPathReservedCharacters_closure: { - "^": "Closure:0;argumentError", - call$1: function(segment) { - if (J.contains$1$asx(segment, "/") === true) - if (this.argumentError) - throw H.wrapException(P.ArgumentError$("Illegal path character " + H.S(segment))); - else - throw H.wrapException(new P.UnsupportedError("Illegal path character " + H.S(segment))); - } - }, - Uri__makePath_closure: { - "^": "Closure:0;", - call$1: [function(s) { - return P.Uri__uriEncode(C.List_qg40, s, C.Utf8Codec_false, false); - }, null, null, 2, 0, null, 40, "call"] - }, - Uri__makeQuery_writeParameter: { - "^": "Closure:46;_box_0,result", - call$2: function(key, value) { - var t1, t2; - t1 = this.result; - t2 = this._box_0; - t1._contents += t2.separator; - t2.separator = "&"; - t1._contents += H.S(P.Uri__uriEncode(C.List_nxB, key, C.Utf8Codec_false, true)); - if (value.get$isNotEmpty(value)) { - t1._contents += "="; - t1._contents += H.S(P.Uri__uriEncode(C.List_nxB, value, C.Utf8Codec_false, true)); - } - } - }, - Uri__makeQuery_closure: { - "^": "Closure:3;writeParameter", - call$2: function(key, value) { - this.writeParameter.call$2(key, value); - } - }, - Uri_hashCode_combine: { - "^": "Closure:47;", - call$2: function(part, current) { - return current * 31 + J.get$hashCode$(part) & 1073741823; - } - }, - Uri_splitQueryString_closure: { - "^": "Closure:3;encoding", - call$2: function(map, element) { - var t1, index, key, value; - t1 = J.getInterceptor$asx(element); - index = t1.indexOf$1(element, "="); - if (index === -1) { - if (!t1.$eq(element, "")) - J.$indexSet$ax(map, P.Uri__uriDecode(element, 0, t1.get$length(element), this.encoding, true), ""); - } else if (index !== 0) { - key = t1.substring$2(element, 0, index); - value = t1.substring$1(element, index + 1); - t1 = this.encoding; - J.$indexSet$ax(map, P.Uri__uriDecode(key, 0, key.length, t1, true), P.Uri__uriDecode(value, 0, value.length, t1, true)); - } - return map; - } - }, - Uri_parseIPv4Address_error: { - "^": "Closure:7;", - call$1: function(msg) { - throw H.wrapException(new P.FormatException("Illegal IPv4 address, " + msg, null, null)); - } - }, - Uri_parseIPv4Address_closure: { - "^": "Closure:0;error", - call$1: [function(byteString) { - var $byte, t1; - $byte = H.Primitives_parseInt(byteString, null, null); - t1 = J.getInterceptor$n($byte); - if (t1.$lt($byte, 0) || t1.$gt($byte, 255)) - this.error.call$1("each part must be in the range of `0..255`"); - return $byte; - }, null, null, 2, 0, null, 41, "call"] - }, - Uri_parseIPv6Address_error: { - "^": "Closure:48;host", - call$2: function(msg, position) { - throw H.wrapException(new P.FormatException("Illegal IPv6 address, " + msg, this.host, position)); - }, - call$1: function(msg) { - return this.call$2(msg, null); - } - }, - Uri_parseIPv6Address_parseHex: { - "^": "Closure:49;host,error", - call$2: function(start, end) { - var value, t1; - if (J.$gt$n(J.$sub$n(end, start), 4)) - this.error.call$2("an IPv6 part can only contain a maximum of 4 hex digits", start); - value = H.Primitives_parseInt(J.substring$2$s(this.host, start, end), 16, null); - t1 = J.getInterceptor$n(value); - if (t1.$lt(value, 0) || t1.$gt(value, 65535)) - this.error.call$2("each part must be in the range of `0x0..0xFFFF`", start); - return value; - } - }, - UriData: { - "^": "Object;_text,_separatorIndices,_uriCache", - get$uri: function() { - var t1, t2, t3, queryIndex, query, end; - t1 = this._uriCache; - if (t1 != null) - return t1; - t1 = this._separatorIndices; - if (0 >= t1.length) - return H.ioore(t1, 0); - t2 = this._text; - t1 = t1[0] + 1; - t3 = J.getInterceptor$asx(t2); - queryIndex = t3.indexOf$2(t2, "?", t1); - if (queryIndex >= 0) { - query = t3.substring$1(t2, queryIndex + 1); - end = queryIndex; - } else { - query = null; - end = null; - } - t1 = new P.Uri("data", "", null, null, t3.substring$2(t2, t1, end), query, null, null, null, null); - this._uriCache = t1; - return t1; - }, - toString$0: function(_) { - var t1, t2; - t1 = this._separatorIndices; - if (0 >= t1.length) - return H.ioore(t1, 0); - t2 = this._text; - return t1[0] === -1 ? "data:" + H.S(t2) : t2; - }, - static: { - UriData_UriData$fromUri: function(uri) { - if (uri.scheme !== "data") - throw H.wrapException(P.ArgumentError$value(uri, "uri", "Scheme must be 'data'")); - if (uri._host != null) - throw H.wrapException(P.ArgumentError$value(uri, "uri", "Data uri must not have authority")); - if (uri._fragment != null) - throw H.wrapException(P.ArgumentError$value(uri, "uri", "Data uri must not have a fragment part")); - if (uri._query == null) - return P.UriData__parse(uri._path, 0, uri); - return P.UriData__parse(uri.toString$0(0), 5, uri); - }, - UriData__parse: function(text, start, sourceUri) { - var indices, t1, i, slashIndex, $char, t2, equalsIndex, lastSeparator; - indices = [start - 1]; - t1 = J.getInterceptor$asx(text); - i = start; - slashIndex = -1; - $char = null; - while (true) { - t2 = t1.get$length(text); - if (typeof t2 !== "number") - return H.iae(t2); - if (!(i < t2)) - break; - c$0: { - $char = t1.codeUnitAt$1(text, i); - if ($char === 44 || $char === 59) - break; - if ($char === 47) { - if (slashIndex < 0) { - slashIndex = i; - break c$0; - } - throw H.wrapException(new P.FormatException("Invalid MIME type", text, i)); - } - } - ++i; - } - if (slashIndex < 0 && i > start) - throw H.wrapException(new P.FormatException("Invalid MIME type", text, i)); - for (; $char !== 44;) { - indices.push(i); - ++i; - equalsIndex = -1; - while (true) { - t2 = t1.get$length(text); - if (typeof t2 !== "number") - return H.iae(t2); - if (!(i < t2)) - break; - $char = t1.codeUnitAt$1(text, i); - if ($char === 61) { - if (equalsIndex < 0) - equalsIndex = i; - } else if ($char === 59 || $char === 44) - break; - ++i; - } - if (equalsIndex >= 0) - indices.push(equalsIndex); - else { - lastSeparator = C.JSArray_methods.get$last(indices); - if ($char !== 44 || i !== lastSeparator + 7 || !t1.startsWith$2(text, "base64", lastSeparator + 1)) - throw H.wrapException(new P.FormatException("Expecting '='", text, i)); - break; - } - } - indices.push(i); - return new P.UriData(text, indices, sourceUri); - } - } - } - }], ["dart.dom.html", "dart:html",, W, { - "^": "", - WebSocket_WebSocket: function(url, protocols) { - return new WebSocket(url); - }, - _JenkinsSmiHash_combine: function(hash, value) { - hash = 536870911 & hash + value; - hash = 536870911 & hash + ((524287 & hash) << 10 >>> 0); - return hash ^ hash >>> 6; - }, - _JenkinsSmiHash_finish: function(hash) { - hash = 536870911 & hash + ((67108863 & hash) << 3 >>> 0); - hash ^= hash >>> 11; - return 536870911 & hash + ((16383 & hash) << 15 >>> 0); - }, - _ElementCssClassSet__add: function(_element, value) { - var list, t1; - list = _element.classList; - t1 = list.contains(value); - list.add(value); - return !t1; - }, - _ElementCssClassSet__remove: function(_element, value) { - var list, removed; - list = _element.classList; - removed = list.contains(value); - list.remove(value); - return removed; - }, - _convertNativeToDart_Window: function(win) { - if (win == null) - return; - return W._DOMWindowCrossFrame__createSafe(win); - }, - _wrapZone: function(callback) { - if (J.$eq$($.Zone__current, C.C__RootZone)) - return callback; - if (callback == null) - return; - return $.Zone__current.bindUnaryCallback$2$runGuarded(callback, true); - }, - HtmlElement: { - "^": "Element;", - "%": "HTMLAppletElement|HTMLBRElement|HTMLBaseElement|HTMLButtonElement|HTMLCanvasElement|HTMLContentElement|HTMLDListElement|HTMLDataListElement|HTMLDetailsElement|HTMLDialogElement|HTMLDirectoryElement|HTMLFieldSetElement|HTMLFontElement|HTMLFrameElement|HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMarqueeElement|HTMLMenuElement|HTMLMenuItemElement|HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLOptGroupElement|HTMLOptionElement|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPictureElement|HTMLPreElement|HTMLProgressElement|HTMLQuoteElement|HTMLShadowElement|HTMLSpanElement|HTMLStyleElement|HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement|HTMLTableRowElement|HTMLTableSectionElement|HTMLTemplateElement|HTMLTextAreaElement|HTMLTitleElement|HTMLUListElement|HTMLUnknownElement;HTMLElement" - }, - AnchorElement: { - "^": "HtmlElement;origin=", - toString$0: function(receiver) { - return String(receiver); - }, - $isInterceptor: 1, - "%": "HTMLAnchorElement" - }, - ApplicationCacheErrorEvent: { - "^": "Event;message=", - "%": "ApplicationCacheErrorEvent" - }, - AreaElement: { - "^": "HtmlElement;origin=", - toString$0: function(receiver) { - return String(receiver); - }, - $isInterceptor: 1, - "%": "HTMLAreaElement" - }, - Blob: { - "^": "Interceptor;", - $isBlob: 1, - "%": ";Blob" - }, - BodyElement: { - "^": "HtmlElement;", - $isInterceptor: 1, - "%": "HTMLBodyElement" - }, - CharacterData: { - "^": "Node;data=,length=", - $isInterceptor: 1, - "%": "CDATASection|CharacterData|Comment|ProcessingInstruction|Text" - }, - CompositionEvent: { - "^": "UIEvent;data=", - "%": "CompositionEvent" - }, - CrossOriginServiceWorkerClient: { - "^": "EventTarget;origin=", - postMessage$2: function(receiver, message, transfer) { - receiver.postMessage(new P._StructuredCloneDart2Js([], []).walk$1(message), transfer); - return; - }, - "%": "CrossOriginServiceWorkerClient" - }, - CssStyleDeclaration: { - "^": "Interceptor_CssStyleDeclarationBase;length=", - "%": "CSS2Properties|CSSStyleDeclaration|MSStyleCSSProperties" - }, - Interceptor_CssStyleDeclarationBase: { - "^": "Interceptor+CssStyleDeclarationBase;" - }, - CssStyleDeclarationBase: { - "^": "Object;" - }, - DivElement: { - "^": "HtmlElement;", - "%": ";HTMLDivElement" - }, - Document: { - "^": "Node;origin=", - "%": "Document|HTMLDocument|XMLDocument" - }, - DocumentFragment: { - "^": "Node;", - $isInterceptor: 1, - "%": "DocumentFragment|ShadowRoot" - }, - DomError: { - "^": "Interceptor;message=", - "%": "DOMError|FileError" - }, - DomException: { - "^": "Interceptor;message=", - toString$0: function(receiver) { - return String(receiver); - }, - "%": "DOMException" - }, - DomRectReadOnly: { - "^": "Interceptor;", - toString$0: function(receiver) { - return "Rectangle (" + H.S(receiver.left) + ", " + H.S(receiver.top) + ") " + H.S(this.get$width(receiver)) + " x " + H.S(this.get$height(receiver)); - }, - $eq: function(receiver, other) { - var t1; - if (other == null) - return false; - t1 = J.getInterceptor(other); - if (!t1.$isRectangle) - return false; - return receiver.left === t1.get$left(other) && receiver.top === t1.get$top(other) && this.get$width(receiver) === t1.get$width(other) && this.get$height(receiver) === t1.get$height(other); - }, - get$hashCode: function(receiver) { - var t1, t2, t3, t4; - t1 = receiver.left; - t2 = receiver.top; - t3 = this.get$width(receiver); - t4 = this.get$height(receiver); - return W._JenkinsSmiHash_finish(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(0, t1 & 0x1FFFFFFF), t2 & 0x1FFFFFFF), t3 & 0x1FFFFFFF), t4 & 0x1FFFFFFF)); - }, - get$height: function(receiver) { - return receiver.height; - }, - get$left: function(receiver) { - return receiver.left; - }, - get$top: function(receiver) { - return receiver.top; - }, - get$width: function(receiver) { - return receiver.width; - }, - $isRectangle: 1, - $asRectangle: Isolate.functionThatReturnsNull, - "%": ";DOMRectReadOnly" - }, - DomTokenList: { - "^": "Interceptor;length=", - add$1: function(receiver, tokens) { - return receiver.add(tokens); - }, - contains$1: function(receiver, token) { - return receiver.contains(token); - }, - "%": "DOMSettableTokenList|DOMTokenList" - }, - Element: { - "^": "Node;", - toString$0: function(receiver) { - return receiver.localName; - }, - get$onClick: function(receiver) { - return H.setRuntimeTypeInfo(new W._ElementEventStreamImpl(receiver, "click", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_click, 0)]); - }, - $isElement: 1, - $isNode: 1, - $isObject: 1, - $isInterceptor: 1, - "%": ";Element" - }, - EmbedElement: { - "^": "HtmlElement;src%", - "%": "HTMLEmbedElement" - }, - ErrorEvent: { - "^": "Event;error=,message=", - "%": "ErrorEvent" - }, - Event: { - "^": "Interceptor;", - stopPropagation$0: function(receiver) { - return receiver.stopPropagation(); - }, - $isEvent: 1, - "%": "AnimationEvent|AnimationPlayerEvent|AudioProcessingEvent|AutocompleteErrorEvent|BeforeInstallPromptEvent|BeforeUnloadEvent|ClipboardEvent|CloseEvent|CrossOriginConnectEvent|CustomEvent|DefaultSessionStartEvent|DeviceLightEvent|DeviceMotionEvent|DeviceOrientationEvent|FontFaceSetLoadEvent|GamepadEvent|GeofencingEvent|HashChangeEvent|IDBVersionChangeEvent|MIDIConnectionEvent|MediaEncryptedEvent|MediaQueryListEvent|MediaStreamEvent|MediaStreamTrackEvent|OfflineAudioCompletionEvent|PageTransitionEvent|PopStateEvent|ProgressEvent|PromiseRejectionEvent|RTCDTMFToneChangeEvent|RTCDataChannelEvent|RTCIceCandidateEvent|RTCPeerConnectionIceEvent|RelatedEvent|ResourceProgressEvent|SecurityPolicyViolationEvent|SpeechRecognitionEvent|SpeechSynthesisEvent|StorageEvent|TrackEvent|TransitionEvent|WebGLContextEvent|WebKitTransitionEvent|XMLHttpRequestProgressEvent;Event|InputEvent" - }, - EventTarget: { - "^": "Interceptor;", - _addEventListener$3: function(receiver, type, listener, capture) { - return receiver.addEventListener(type, H.convertDartClosureToJS(listener, 1), false); - }, - _removeEventListener$3: function(receiver, type, listener, capture) { - return receiver.removeEventListener(type, H.convertDartClosureToJS(listener, 1), false); - }, - "%": "MediaStream;EventTarget" - }, - ExtendableEvent: { - "^": "Event;", - "%": "FetchEvent|NotificationEvent|PeriodicSyncEvent|SyncEvent;ExtendableEvent" - }, - File: { - "^": "Blob;", - $isFile: 1, - "%": "File" - }, - FormElement: { - "^": "HtmlElement;length=", - "%": "HTMLFormElement" - }, - HtmlCollection: { - "^": "Interceptor_ListMixin_ImmutableListMixin;", - get$length: function(receiver) { - return receiver.length; - }, - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - throw H.wrapException(P.IndexError$(index, receiver, null, null, null)); - return receiver[index]; - }, - $indexSet: function(receiver, index, value) { - throw H.wrapException(new P.UnsupportedError("Cannot assign element of immutable List.")); - }, - set$length: function(receiver, value) { - throw H.wrapException(new P.UnsupportedError("Cannot resize immutable List.")); - }, - get$last: function(receiver) { - var len = receiver.length; - if (len > 0) - return receiver[len - 1]; - throw H.wrapException(new P.StateError("No elements")); - }, - elementAt$1: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - return H.ioore(receiver, index); - return receiver[index]; - }, - $isList: 1, - $asList: function() { - return [W.Node]; - }, - $isEfficientLength: 1, - $isJavaScriptIndexingBehavior: 1, - $asJavaScriptIndexingBehavior: function() { - return [W.Node]; - }, - $isJSIndexable: 1, - $asJSIndexable: function() { - return [W.Node]; - }, - "%": "HTMLCollection|HTMLFormControlsCollection|HTMLOptionsCollection" - }, - Interceptor_ListMixin: { - "^": "Interceptor+ListMixin;", - $isList: 1, - $asList: function() { - return [W.Node]; - }, - $isEfficientLength: 1 - }, - Interceptor_ListMixin_ImmutableListMixin: { - "^": "Interceptor_ListMixin+ImmutableListMixin;", - $isList: 1, - $asList: function() { - return [W.Node]; - }, - $isEfficientLength: 1 - }, - IFrameElement: { - "^": "HtmlElement;src%", - get$contentWindow: function(receiver) { - return W._convertNativeToDart_Window(receiver.contentWindow); - }, - $isElement: 1, - $isNode: 1, - $isObject: 1, - "%": "HTMLIFrameElement" - }, - ImageData: { - "^": "Interceptor;data=", - $isImageData: 1, - "%": "ImageData" - }, - ImageElement: { - "^": "HtmlElement;src%", - complete$1: function($receiver, arg0) { - return $receiver.complete.call$1(arg0); - }, - "%": "HTMLImageElement" - }, - InputElement: { - "^": "HtmlElement;src%", - $isInterceptor: 1, - $isNode: 1, - "%": "HTMLInputElement" - }, - KeyboardEvent: { - "^": "UIEvent;location=", - "%": "KeyboardEvent" - }, - Location: { - "^": "Interceptor;", - get$origin: function(receiver) { - if ("origin" in receiver) - return receiver.origin; - return H.S(receiver.protocol) + "//" + H.S(receiver.host); - }, - toString$0: function(receiver) { - return String(receiver); - }, - "%": "Location" - }, - MediaElement: { - "^": "HtmlElement;error=,src%", - "%": "HTMLAudioElement|HTMLMediaElement|HTMLVideoElement" - }, - MediaKeyEvent: { - "^": "Event;message=", - "%": "MediaKeyEvent" - }, - MediaKeyMessageEvent: { - "^": "Event;message=", - "%": "MediaKeyMessageEvent" - }, - MessageEvent: { - "^": "Event;origin=", - get$data: function(receiver) { - var t1, t2; - t1 = receiver.data; - t2 = new P._AcceptStructuredCloneDart2Js([], [], false); - t2.mustCopy = true; - return t2.walk$1(t1); - }, - $isObject: 1, - "%": "MessageEvent" - }, - MidiMessageEvent: { - "^": "Event;data=", - "%": "MIDIMessageEvent" - }, - MidiOutput: { - "^": "MidiPort;", - send$2: function(receiver, data, timestamp) { - return receiver.send(data, timestamp); - }, - send$1: function($receiver, data) { - return $receiver.send(data); - }, - "%": "MIDIOutput" - }, - MidiPort: { - "^": "EventTarget;", - "%": "MIDIInput;MIDIPort" + if (C.Utf8Codec_false !== encoding) + t2 = false; + else + t2 = true; + if (t2) + return t1.substring$2(text, start, end); + else + bytes = new H.CodeUnits(t1.substring$2(text, start, end)); + } else { + bytes = []; + for (i = start; i < end; ++i) { + codeUnit = t1.codeUnitAt$1(text, i); + if (codeUnit > 127) + throw H.wrapException(P.ArgumentError$("Illegal percent encoding in URI")); + if (codeUnit === 37) { + if (i + 3 > text.length) + throw H.wrapException(P.ArgumentError$("Truncated URI")); + bytes.push(P._Uri__hexCharPairToByte(text, i + 1)); + i += 2; + } else if (plusToSpace && codeUnit === 43) + bytes.push(32); + else + bytes.push(codeUnit); + } + } + return new P.Utf8Decoder(false).convert$1(bytes); + } + } }, - MouseEvent: { - "^": "UIEvent;", - $isObject: 1, - "%": "DragEvent|MouseEvent|PointerEvent|WheelEvent" + closure: { + "^": "Closure:0;uri,portStart", + call$1: function(_) { + throw H.wrapException(new P.FormatException("Invalid port", this.uri, J.$add$ns(this.portStart, 1))); + } }, - Navigator: { - "^": "Interceptor;", - $isInterceptor: 1, - "%": "Navigator" + _Uri__checkNonWindowsPathReservedCharacters_closure: { + "^": "Closure:0;argumentError", + call$1: function(segment) { + if (J.contains$1$asx(segment, "/") === true) + if (this.argumentError) + throw H.wrapException(P.ArgumentError$("Illegal path character " + H.S(segment))); + else + throw H.wrapException(new P.UnsupportedError("Illegal path character " + H.S(segment))); + } }, - NavigatorUserMediaError: { - "^": "Interceptor;message=", - "%": "NavigatorUserMediaError" + _Uri__makePath_closure: { + "^": "Closure:0;", + call$1: function(s) { + return P._Uri__uriEncode(C.List_qg40, s, C.Utf8Codec_false, false); + } }, - Node: { - "^": "EventTarget;parent:parentElement=", - remove$0: function(receiver) { - var t1 = receiver.parentNode; + UriData: { + "^": "Object;_text,_separatorIndices,_uriCache", + get$uri: function() { + var t1, t2, t3, queryIndex, query, end; + t1 = this._uriCache; if (t1 != null) - t1.removeChild(receiver); - }, - toString$0: function(receiver) { - var value = receiver.nodeValue; - return value == null ? this.super$Interceptor$toString(receiver) : value; - }, - contains$1: function(receiver, other) { - return receiver.contains(other); - }, - $isNode: 1, - $isObject: 1, - "%": "Attr;Node" - }, - NodeList: { - "^": "Interceptor_ListMixin_ImmutableListMixin0;", - get$length: function(receiver) { - return receiver.length; - }, - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - throw H.wrapException(P.IndexError$(index, receiver, null, null, null)); - return receiver[index]; - }, - $indexSet: function(receiver, index, value) { - throw H.wrapException(new P.UnsupportedError("Cannot assign element of immutable List.")); - }, - set$length: function(receiver, value) { - throw H.wrapException(new P.UnsupportedError("Cannot resize immutable List.")); - }, - get$last: function(receiver) { - var len = receiver.length; - if (len > 0) - return receiver[len - 1]; - throw H.wrapException(new P.StateError("No elements")); - }, - elementAt$1: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - return H.ioore(receiver, index); - return receiver[index]; - }, - $isList: 1, - $asList: function() { - return [W.Node]; - }, - $isEfficientLength: 1, - $isJavaScriptIndexingBehavior: 1, - $asJavaScriptIndexingBehavior: function() { - return [W.Node]; - }, - $isJSIndexable: 1, - $asJSIndexable: function() { - return [W.Node]; - }, - "%": "NodeList|RadioNodeList" - }, - Interceptor_ListMixin0: { - "^": "Interceptor+ListMixin;", - $isList: 1, - $asList: function() { - return [W.Node]; - }, - $isEfficientLength: 1 - }, - Interceptor_ListMixin_ImmutableListMixin0: { - "^": "Interceptor_ListMixin0+ImmutableListMixin;", - $isList: 1, - $asList: function() { - return [W.Node]; + return t1; + t1 = this._separatorIndices; + if (0 >= t1.length) + return H.ioore(t1, 0); + t2 = this._text; + t1 = t1[0] + 1; + t3 = J.getInterceptor$asx(t2); + queryIndex = t3.indexOf$2(t2, "?", t1); + if (queryIndex >= 0) { + query = t3.substring$1(t2, queryIndex + 1); + end = queryIndex; + } else { + query = null; + end = null; + } + t1 = new P._Uri("data", "", null, null, t3.substring$2(t2, t1, end), query, null, null, null, null, null, null); + this._uriCache = t1; + return t1; }, - $isEfficientLength: 1 - }, - ObjectElement: { - "^": "HtmlElement;data=", - "%": "HTMLObjectElement" - }, - PluginPlaceholderElement: { - "^": "DivElement;message=", - "%": "PluginPlaceholderElement" - }, - PositionError: { - "^": "Interceptor;message=", - "%": "PositionError" - }, - PushEvent: { - "^": "ExtendableEvent;data=", - "%": "PushEvent" - }, - ScriptElement: { - "^": "HtmlElement;src%", - "%": "HTMLScriptElement" - }, - SelectElement: { - "^": "HtmlElement;length=", - "%": "HTMLSelectElement" - }, - ServicePortConnectEvent: { - "^": "ExtendableEvent;origin=", - "%": "ServicePortConnectEvent" - }, - ServiceWorkerMessageEvent: { - "^": "Event;origin=", - get$data: function(receiver) { + toString$0: function(_) { var t1, t2; - t1 = receiver.data; - t2 = new P._AcceptStructuredCloneDart2Js([], [], false); - t2.mustCopy = true; - return t2.walk$1(t1); + t1 = this._separatorIndices; + if (0 >= t1.length) + return H.ioore(t1, 0); + t2 = this._text; + return t1[0] === -1 ? "data:" + H.S(t2) : t2; }, - "%": "ServiceWorkerMessageEvent" - }, - SourceElement: { - "^": "HtmlElement;src%", - "%": "HTMLSourceElement" - }, - SpeechRecognitionError: { - "^": "Event;error=,message=", - "%": "SpeechRecognitionError" + static: { + UriData_UriData$fromUri: function(uri) { + var t1, t2, t3, t4, t5, t6, t7; + t1 = uri.scheme; + if (t1 !== "data") + throw H.wrapException(P.ArgumentError$value(uri, "uri", "Scheme must be 'data'")); + t2 = uri._host; + t3 = t2 != null; + if (t3) + throw H.wrapException(P.ArgumentError$value(uri, "uri", "Data uri must not have authority")); + t4 = uri._fragment; + t5 = t4 != null; + if (t5) + throw H.wrapException(P.ArgumentError$value(uri, "uri", "Data uri must not have a fragment part")); + t6 = uri._query; + if (t6 == null) + return P.UriData__parse(uri._path, 0, uri); + t7 = uri._text; + if (t7 == null) { + t7 = t1.length !== 0 ? H.S(t1) + ":" : ""; + t1 = C.JSString_methods.startsWith$1(uri._path, "//") || t1 === "file"; + if (t1) { + t1 = t7 + "//"; + t7 = uri._userInfo; + if (t7.length !== 0) + t1 = t1 + t7 + "@"; + if (t3) + t1 += H.S(t2); + t2 = uri._port; + if (t2 != null) + t1 = t1 + ":" + H.S(t2); + } else + t1 = t7; + t1 += uri._path; + t1 = t1 + "?" + H.S(t6); + if (t5) + t1 = t1 + "#" + H.S(t4); + t1 = t1.charCodeAt(0) == 0 ? t1 : t1; + uri._text = t1; + } else + t1 = t7; + return P.UriData__parse(t1, 5, uri); + }, + UriData__parse: function(text, start, sourceUri) { + var indices, t1, i, slashIndex, $char, t2, equalsIndex, lastSeparator; + indices = [start - 1]; + t1 = J.getInterceptor$asx(text); + i = start; + slashIndex = -1; + $char = null; + while (true) { + t2 = t1.get$length(text); + if (typeof t2 !== "number") + return H.iae(t2); + if (!(i < t2)) + break; + c$0: { + $char = t1.codeUnitAt$1(text, i); + if ($char === 44 || $char === 59) + break; + if ($char === 47) { + if (slashIndex < 0) { + slashIndex = i; + break c$0; + } + throw H.wrapException(new P.FormatException("Invalid MIME type", text, i)); + } + } + ++i; + } + if (slashIndex < 0 && i > start) + throw H.wrapException(new P.FormatException("Invalid MIME type", text, i)); + for (; $char !== 44;) { + indices.push(i); + ++i; + equalsIndex = -1; + while (true) { + t2 = t1.get$length(text); + if (typeof t2 !== "number") + return H.iae(t2); + if (!(i < t2)) + break; + $char = t1.codeUnitAt$1(text, i); + if ($char === 61) { + if (equalsIndex < 0) + equalsIndex = i; + } else if ($char === 59 || $char === 44) + break; + ++i; + } + if (equalsIndex >= 0) + indices.push(equalsIndex); + else { + lastSeparator = C.JSArray_methods.get$last(indices); + if ($char !== 44 || i !== lastSeparator + 7 || !t1.startsWith$2(text, "base64", lastSeparator + 1)) + throw H.wrapException(new P.FormatException("Expecting '='", text, i)); + break; + } + } + indices.push(i); + return new P.UriData(text, indices, sourceUri); + } + } }, - TextEvent: { - "^": "UIEvent;data=", - "%": "TextEvent" + _createTables_closure: { + "^": "Closure:0;", + call$1: function(_) { + return new Uint8Array(H._checkLength(96)); + } }, - TrackElement: { - "^": "HtmlElement;src%", - "%": "HTMLTrackElement" + _createTables_build: { + "^": "Closure:47;tables", + call$2: function(state, defaultTransition) { + var t1 = this.tables; + if (state >= t1.length) + return H.ioore(t1, state); + t1 = t1[state]; + J.fillRange$3$ax(t1, 0, 96, defaultTransition); + return t1; + } }, - UIEvent: { - "^": "Event;", - "%": "FocusEvent|SVGZoomEvent|TouchEvent;UIEvent" + _createTables_setChars: { + "^": "Closure:8;", + call$3: function(target, chars, transition) { + var t1, t2, i; + for (t1 = chars.length, t2 = J.getInterceptor$ax(target), i = 0; i < t1; ++i) + t2.$indexSet(target, C.JSString_methods.codeUnitAt$1(chars, i) ^ 96, transition); + } }, - WebSocket: { - "^": "EventTarget;", - send$1: function(receiver, data) { - return receiver.send(data); - }, - "%": "WebSocket" + _createTables_setRange: { + "^": "Closure:8;", + call$3: function(target, range, transition) { + var i, n, t1; + for (i = C.JSString_methods.codeUnitAt$1(range, 0), n = C.JSString_methods.codeUnitAt$1(range, 1), t1 = J.getInterceptor$ax(target); i <= n; ++i) + t1.$indexSet(target, (i ^ 96) >>> 0, transition); + } }, - Window: { - "^": "EventTarget;", - get$location: function(receiver) { - return receiver.location; + _SimpleUri: { + "^": "Object;_uri,_schemeEnd,_hostStart,_portStart,_pathStart,_queryStart,_fragmentStart,_schemeCache,_hashCodeCache", + get$hasAuthority: function() { + return J.$gt$n(this._hostStart, 0); }, - get$parent: function(receiver) { - return W._convertNativeToDart_Window(receiver.parent); + get$hasPort: function() { + return J.$gt$n(this._hostStart, 0) && J.$lt$n(J.$add$ns(this._portStart, 1), this._pathStart); }, - postMessage$3: function(receiver, message, targetOrigin, transfer) { - receiver.postMessage(new P._StructuredCloneDart2Js([], []).walk$1(message), targetOrigin); - return; + get$hasQuery: function() { + return J.$lt$n(this._queryStart, this._fragmentStart); }, - postMessage$2: function($receiver, message, targetOrigin) { - return this.postMessage$3($receiver, message, targetOrigin, null); + get$hasFragment: function() { + return J.$lt$n(this._fragmentStart, J.get$length$asx(this._uri)); }, - print$0: [function(receiver) { - return receiver.print(); - }, "call$0", "get$print", 0, 0, 2], - $isWindow: 1, - $isInterceptor: 1, - "%": "DOMWindow|Window" - }, - _ClientRect: { - "^": "Interceptor;height=,left=,top=,width=", - toString$0: function(receiver) { - return "Rectangle (" + H.S(receiver.left) + ", " + H.S(receiver.top) + ") " + H.S(receiver.width) + " x " + H.S(receiver.height); + get$hasAbsolutePath: function() { + return J.startsWith$2$s(this._uri, "/", this._pathStart); }, - $eq: function(receiver, other) { + get$scheme: function() { var t1, t2, t3; - if (other == null) - return false; - t1 = J.getInterceptor(other); - if (!t1.$isRectangle) - return false; - t2 = receiver.left; - t3 = t1.get$left(other); - if (t2 == null ? t3 == null : t2 === t3) { - t2 = receiver.top; - t3 = t1.get$top(other); - if (t2 == null ? t3 == null : t2 === t3) { - t2 = receiver.width; - t3 = t1.get$width(other); - if (t2 == null ? t3 == null : t2 === t3) { - t2 = receiver.height; - t1 = t1.get$height(other); - t1 = t2 == null ? t1 == null : t2 === t1; - } else - t1 = false; - } else - t1 = false; - } else - t1 = false; + t1 = this._schemeEnd; + t2 = J.getInterceptor$n(t1); + if (t2.$le(t1, 0)) + return ""; + t3 = this._schemeCache; + if (t3 != null) + return t3; + if (t2.$eq(t1, 4) && J.startsWith$1$s(this._uri, "http")) { + this._schemeCache = "http"; + t1 = "http"; + } else if (t2.$eq(t1, 5) && J.startsWith$1$s(this._uri, "https")) { + this._schemeCache = "https"; + t1 = "https"; + } else if (t2.$eq(t1, 4) && J.startsWith$1$s(this._uri, "file")) { + this._schemeCache = "file"; + t1 = "file"; + } else if (t2.$eq(t1, 7) && J.startsWith$1$s(this._uri, "package")) { + this._schemeCache = "package"; + t1 = "package"; + } else { + t1 = J.substring$2$s(this._uri, 0, t1); + this._schemeCache = t1; + } return t1; }, - get$hashCode: function(receiver) { + get$userInfo: function() { var t1, t2, t3, t4; - t1 = J.get$hashCode$(receiver.left); - t2 = J.get$hashCode$(receiver.top); - t3 = J.get$hashCode$(receiver.width); - t4 = J.get$hashCode$(receiver.height); - return W._JenkinsSmiHash_finish(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(0, t1), t2), t3), t4)); - }, - $isRectangle: 1, - $asRectangle: Isolate.functionThatReturnsNull, - "%": "ClientRect" - }, - _DocumentType: { - "^": "Node;", - $isInterceptor: 1, - "%": "DocumentType" - }, - _DomRect: { - "^": "DomRectReadOnly;", - get$height: function(receiver) { - return receiver.height; - }, - get$width: function(receiver) { - return receiver.width; - }, - "%": "DOMRect" - }, - _HTMLFrameSetElement: { - "^": "HtmlElement;", - $isInterceptor: 1, - "%": "HTMLFrameSetElement" - }, - _NamedNodeMap: { - "^": "Interceptor_ListMixin_ImmutableListMixin1;", - get$length: function(receiver) { - return receiver.length; - }, - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - throw H.wrapException(P.IndexError$(index, receiver, null, null, null)); - return receiver[index]; - }, - $indexSet: function(receiver, index, value) { - throw H.wrapException(new P.UnsupportedError("Cannot assign element of immutable List.")); - }, - set$length: function(receiver, value) { - throw H.wrapException(new P.UnsupportedError("Cannot resize immutable List.")); - }, - get$last: function(receiver) { - var len = receiver.length; - if (len > 0) - return receiver[len - 1]; - throw H.wrapException(new P.StateError("No elements")); - }, - elementAt$1: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - return H.ioore(receiver, index); - return receiver[index]; - }, - $isList: 1, - $asList: function() { - return [W.Node]; - }, - $isEfficientLength: 1, - $isJavaScriptIndexingBehavior: 1, - $asJavaScriptIndexingBehavior: function() { - return [W.Node]; - }, - $isJSIndexable: 1, - $asJSIndexable: function() { - return [W.Node]; - }, - "%": "MozNamedAttrMap|NamedNodeMap" - }, - Interceptor_ListMixin1: { - "^": "Interceptor+ListMixin;", - $isList: 1, - $asList: function() { - return [W.Node]; - }, - $isEfficientLength: 1 - }, - Interceptor_ListMixin_ImmutableListMixin1: { - "^": "Interceptor_ListMixin1+ImmutableListMixin;", - $isList: 1, - $asList: function() { - return [W.Node]; + t1 = this._hostStart; + t2 = this._schemeEnd; + t3 = J.getInterceptor$ns(t2); + t4 = J.getInterceptor$n(t1); + return t4.$gt(t1, t3.$add(t2, 3)) ? J.substring$2$s(this._uri, t3.$add(t2, 3), t4.$sub(t1, 1)) : ""; }, - $isEfficientLength: 1 - }, - EventStreamProvider: { - "^": "Object;_eventType" - }, - _EventStream: { - "^": "Stream;_target,_eventType,_useCapture", - listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) { - var t1 = new W._EventStreamSubscription(0, this._target, this._eventType, W._wrapZone(onData), false); - t1.$builtinTypeInfo = this.$builtinTypeInfo; - t1._tryResume$0(); - return t1; + get$host: function(_) { + var t1 = this._hostStart; + return J.$gt$n(t1, 0) ? J.substring$2$s(this._uri, t1, this._portStart) : ""; }, - listen$1: function(onData) { - return this.listen$4$cancelOnError$onDone$onError(onData, null, null, null); + get$port: function(_) { + var t1, t2; + if (this.get$hasPort()) + return H.Primitives_parseInt(J.substring$2$s(this._uri, J.$add$ns(this._portStart, 1), this._pathStart), null, null); + t1 = this._schemeEnd; + t2 = J.getInterceptor(t1); + if (t2.$eq(t1, 4) && J.startsWith$1$s(this._uri, "http")) + return 80; + if (t2.$eq(t1, 5) && J.startsWith$1$s(this._uri, "https")) + return 443; + return 0; }, - listen$3$onDone$onError: function(onData, onDone, onError) { - return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); - } - }, - _ElementEventStreamImpl: { - "^": "_EventStream;_target,_eventType,_useCapture" - }, - _EventStreamSubscription: { - "^": "StreamSubscription;_pauseCount,_target,_eventType,_onData,_useCapture", - cancel$0: function() { - if (this._target == null) - return; - this._unlisten$0(); - this._target = null; - this._onData = null; - return; + get$path: function(_) { + return J.substring$2$s(this._uri, this._pathStart, this._queryStart); }, - pause$1: function(_, resumeSignal) { - if (this._target == null) - return; - ++this._pauseCount; - this._unlisten$0(); + get$query: function(_) { + var t1, t2, t3; + t1 = this._queryStart; + t2 = this._fragmentStart; + t3 = J.getInterceptor$n(t1); + return t3.$lt(t1, t2) ? J.substring$2$s(this._uri, t3.$add(t1, 1), t2) : ""; }, - pause$0: function($receiver) { - return this.pause$1($receiver, null); + get$fragment: function() { + var t1, t2, t3, t4; + t1 = this._fragmentStart; + t2 = this._uri; + t3 = J.getInterceptor$asx(t2); + t4 = J.getInterceptor$n(t1); + return t4.$lt(t1, t3.get$length(t2)) ? t3.substring$1(t2, t4.$add(t1, 1)) : ""; }, - get$isPaused: function() { - return this._pauseCount > 0; + get$origin: function(_) { + var t1, t2, isHttp, t3, t4; + t1 = this._schemeEnd; + t2 = J.getInterceptor(t1); + isHttp = t2.$eq(t1, 4) && J.startsWith$1$s(this._uri, "http"); + if (t2.$lt(t1, 0) || J.$eq$(this._hostStart, this._portStart)) + throw H.wrapException(new P.StateError("Cannot use origin without a scheme: " + H.S(this))); + if (!isHttp) + t3 = !(t2.$eq(t1, 5) && J.startsWith$1$s(this._uri, "https")); + else + t3 = false; + if (t3) + throw H.wrapException(new P.StateError("Origin is only applicable schemes http and https: " + H.S(this))); + t3 = this._hostStart; + if (J.$eq$(t3, t2.$add(t1, 3))) + return J.substring$2$s(this._uri, 0, this._pathStart); + t4 = this._uri; + return J.getInterceptor$s(t4).substring$2(t4, 0, t2.$add(t1, 3)) + C.JSString_methods.substring$2(t4, t3, this._pathStart); + }, + get$queryParameters: function() { + if (!J.$lt$n(this._queryStart, this._fragmentStart)) + return C.Map_empty; + return H.setRuntimeTypeInfo(new P.UnmodifiableMapView(P.Uri_splitQueryString(this.get$query(this), C.Utf8Codec_false)), [P.String, P.String]); }, - resume$0: function() { - if (this._target == null || this._pauseCount <= 0) - return; - --this._pauseCount; - this._tryResume$0(); + _isPort$1: function(port) { + var portDigitStart = J.$add$ns(this._portStart, 1); + return J.$eq$(J.$add$ns(portDigitStart, port.length), this._pathStart) && J.startsWith$2$s(this._uri, port, portDigitStart); }, - _tryResume$0: function() { + removeFragment$0: function() { var t1, t2, t3; - t1 = this._onData; - t2 = t1 != null; - if (t2 && this._pauseCount <= 0) { - t3 = this._target; - t3.toString; - if (t2) - J._addEventListener$3$x(t3, this._eventType, t1, false); + t1 = this._fragmentStart; + t2 = this._uri; + t3 = J.getInterceptor$asx(t2); + if (!J.$lt$n(t1, t3.get$length(t2))) + return this; + return new P._SimpleUri(t3.substring$2(t2, 0, t1), this._schemeEnd, this._hostStart, this._portStart, this._pathStart, this._queryStart, t1, this._schemeCache, null); + }, + resolve$1: function(reference) { + return this.resolveUri$1(P.Uri_parse(reference, 0, null)); + }, + resolveUri$1: function(reference) { + if (reference instanceof P._SimpleUri) + return this._simpleMerge$2(this, reference); + return this._toNonSimple$0().resolveUri$1(reference); + }, + _simpleMerge$2: function(base, ref) { + var t1, t2, t3, t4, t5, t6, isSimple, delta, refStart, baseEnd, backCount, insert; + t1 = ref._schemeEnd; + t2 = J.getInterceptor$n(t1); + if (t2.$gt(t1, 0)) + return ref; + t3 = ref._hostStart; + t4 = J.getInterceptor$n(t3); + if (t4.$gt(t3, 0)) { + t5 = base._schemeEnd; + t6 = J.getInterceptor$n(t5); + if (!t6.$gt(t5, 0)) + return ref; + if (t6.$eq(t5, 4) && J.startsWith$1$s(base._uri, "file")) + isSimple = !J.$eq$(ref._pathStart, ref._queryStart); + else if (t6.$eq(t5, 4) && J.startsWith$1$s(base._uri, "http")) + isSimple = !ref._isPort$1("80"); + else + isSimple = !(t6.$eq(t5, 5) && J.startsWith$1$s(base._uri, "https")) || !ref._isPort$1("443"); + if (isSimple) { + delta = t6.$add(t5, 1); + return new P._SimpleUri(J.substring$2$s(base._uri, 0, t6.$add(t5, 1)) + J.substring$1$s(ref._uri, t2.$add(t1, 1)), t5, t4.$add(t3, delta), J.$add$ns(ref._portStart, delta), J.$add$ns(ref._pathStart, delta), J.$add$ns(ref._queryStart, delta), J.$add$ns(ref._fragmentStart, delta), base._schemeCache, null); + } else + return this._toNonSimple$0().resolveUri$1(ref); + } + refStart = ref._pathStart; + t1 = ref._queryStart; + if (J.$eq$(refStart, t1)) { + t2 = ref._fragmentStart; + t3 = J.getInterceptor$n(t1); + if (t3.$lt(t1, t2)) { + t4 = base._queryStart; + delta = J.$sub$n(t4, t1); + return new P._SimpleUri(J.substring$2$s(base._uri, 0, t4) + J.substring$1$s(ref._uri, t1), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, t3.$add(t1, delta), J.$add$ns(t2, delta), base._schemeCache, null); + } + t1 = ref._uri; + t3 = J.getInterceptor$asx(t1); + t4 = J.getInterceptor$n(t2); + if (t4.$lt(t2, t3.get$length(t1))) { + t5 = base._fragmentStart; + delta = J.$sub$n(t5, t2); + return new P._SimpleUri(J.substring$2$s(base._uri, 0, t5) + t3.substring$1(t1, t2), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, base._queryStart, t4.$add(t2, delta), base._schemeCache, null); + } + return base.removeFragment$0(); + } + t2 = ref._uri; + if (J.getInterceptor$s(t2).startsWith$2(t2, "/", refStart)) { + t3 = base._pathStart; + delta = J.$sub$n(t3, refStart); + return new P._SimpleUri(J.substring$2$s(base._uri, 0, t3) + C.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, t3, J.$add$ns(t1, delta), J.$add$ns(ref._fragmentStart, delta), base._schemeCache, null); + } + t3 = base._pathStart; + baseEnd = base._queryStart; + t4 = J.getInterceptor(t3); + if (t4.$eq(t3, baseEnd) && J.$gt$n(base._hostStart, 0)) { + for (; C.JSString_methods.startsWith$2(t2, "../", refStart);) + refStart = J.$add$ns(refStart, 3); + delta = J.$add$ns(t4.$sub(t3, refStart), 1); + return new P._SimpleUri(J.substring$2$s(base._uri, 0, t3) + "/" + C.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, t3, J.$add$ns(t1, delta), J.$add$ns(ref._fragmentStart, delta), base._schemeCache, null); + } + t4 = base._uri; + if (J.getInterceptor$s(t4).startsWith$2(t4, "../", t3)) + return this._toNonSimple$0().resolveUri$1(ref); + backCount = 1; + while (true) { + t5 = J.getInterceptor$ns(refStart); + if (!(J.$le$n(t5.$add(refStart, 3), t1) && C.JSString_methods.startsWith$2(t2, "../", refStart))) + break; + refStart = t5.$add(refStart, 3); + ++backCount; } - }, - _unlisten$0: function() { - var t1, t2, t3; - t1 = this._onData; - t2 = t1 != null; - if (t2) { - t3 = this._target; - t3.toString; - if (t2) - J._removeEventListener$3$x(t3, this._eventType, t1, false); + for (insert = ""; t5 = J.getInterceptor$n(baseEnd), t5.$gt(baseEnd, t3);) { + baseEnd = t5.$sub(baseEnd, 1); + if (C.JSString_methods.codeUnitAt$1(t4, baseEnd) === 47) { + --backCount; + if (backCount === 0) { + insert = "/"; + break; + } + insert = "/"; + } } - } - }, - ImmutableListMixin: { - "^": "Object;", - get$iterator: function(receiver) { - return new W.FixedSizeListIterator(receiver, this.get$length(receiver), -1, null); + t5 = J.getInterceptor(baseEnd); + if (t5.$eq(baseEnd, 0) && !C.JSString_methods.startsWith$2(t4, "/", t3)) + insert = ""; + delta = J.$add$ns(t5.$sub(baseEnd, refStart), insert.length); + return new P._SimpleUri(C.JSString_methods.substring$2(t4, 0, baseEnd) + insert + C.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, t3, J.$add$ns(t1, delta), J.$add$ns(ref._fragmentStart, delta), base._schemeCache, null); }, - add$1: function(receiver, value) { - throw H.wrapException(new P.UnsupportedError("Cannot add to immutable List.")); + toFilePath$1$windows: function(windows) { + var t1, t2, t3, t4; + t1 = this._schemeEnd; + t2 = J.getInterceptor$n(t1); + if (t2.$ge(t1, 0)) { + t3 = !(t2.$eq(t1, 4) && J.startsWith$1$s(this._uri, "file")); + t1 = t3; + } else + t1 = false; + if (t1) + throw H.wrapException(new P.UnsupportedError("Cannot extract a file path from a " + H.S(this.get$scheme()) + " URI")); + t1 = this._queryStart; + t2 = this._uri; + t3 = J.getInterceptor$asx(t2); + t4 = J.getInterceptor$n(t1); + if (t4.$lt(t1, t3.get$length(t2))) { + if (t4.$lt(t1, this._fragmentStart)) + throw H.wrapException(new P.UnsupportedError("Cannot extract a file path from a URI with a query component")); + throw H.wrapException(new P.UnsupportedError("Cannot extract a file path from a URI with a fragment component")); + } + if (J.$lt$n(this._hostStart, this._portStart)) + H.throwExpression(new P.UnsupportedError("Cannot extract a non-Windows file path from a file URI with an authority")); + t1 = t3.substring$2(t2, this._pathStart, t1); + return t1; }, - setRange$4: function(receiver, start, end, iterable, skipCount) { - throw H.wrapException(new P.UnsupportedError("Cannot setRange on immutable List.")); + toFilePath$0: function() { + return this.toFilePath$1$windows(null); }, - setRange$3: function($receiver, start, end, iterable) { - return this.setRange$4($receiver, start, end, iterable, 0); + get$data: function(_) { + return; }, - replaceRange$3: function(receiver, start, end, iterable) { - throw H.wrapException(new P.UnsupportedError("Cannot modify an immutable List.")); + get$hashCode: function(_) { + var t1 = this._hashCodeCache; + if (t1 == null) { + t1 = J.get$hashCode$(this._uri); + this._hashCodeCache = t1; + } + return t1; }, - $isList: 1, - $asList: null, - $isEfficientLength: 1 - }, - FixedSizeListIterator: { - "^": "Object;_array,_length,_position,_html$_current", - moveNext$0: function() { - var nextPosition, t1; - nextPosition = this._position + 1; - t1 = this._length; - if (nextPosition < t1) { - this._html$_current = J.$index$asx(this._array, nextPosition); - this._position = nextPosition; + $eq: function(_, other) { + var t1; + if (other == null) + return false; + if (this === other) return true; - } - this._html$_current = null; - this._position = t1; + t1 = J.getInterceptor(other); + if (!!t1.$isUri) + return J.$eq$(this._uri, t1.toString$0(other)); return false; }, - get$current: function() { - return this._html$_current; - } - }, - _DOMWindowCrossFrame: { - "^": "Object;_window", - get$location: function(_) { - return W._LocationCrossFrame__createSafe(this._window.location); + _toNonSimple$0: function() { + var t1, t2, t3, t4, t5, t6, t7, t8; + t1 = this.get$scheme(); + t2 = this.get$userInfo(); + t3 = this._hostStart; + t4 = J.getInterceptor$n(t3); + if (t4.$gt(t3, 0)) + t3 = t4.$gt(t3, 0) ? J.substring$2$s(this._uri, t3, this._portStart) : ""; + else + t3 = null; + t4 = this.get$hasPort() ? this.get$port(this) : null; + t5 = this._uri; + t6 = this._queryStart; + t7 = J.substring$2$s(t5, this._pathStart, t6); + t8 = this._fragmentStart; + t6 = J.$lt$n(t6, t8) ? this.get$query(this) : null; + return new P._Uri(t1, t2, t3, t4, t7, t6, J.$lt$n(t8, t5.length) ? this.get$fragment() : null, null, null, null, null, null); }, - get$parent: function(_) { - return W._DOMWindowCrossFrame__createSafe(this._window.parent); + toString$0: function(_) { + return this._uri; }, - postMessage$3: function(_, message, targetOrigin, messagePorts) { - this._window.postMessage(new P._StructuredCloneDart2Js([], []).walk$1(message), targetOrigin); + $isUri: 1 + } + }], ["dart.dom.html", "dart:html",, W, { + "^": "", + WebSocket_WebSocket: function(url, protocols) { + return new WebSocket(url); + }, + _JenkinsSmiHash_combine: function(hash, value) { + hash = 536870911 & hash + value; + hash = 536870911 & hash + ((524287 & hash) << 10 >>> 0); + return hash ^ hash >>> 6; + }, + _JenkinsSmiHash_finish: function(hash) { + hash = 536870911 & hash + ((67108863 & hash) << 3 >>> 0); + hash ^= hash >>> 11; + return 536870911 & hash + ((16383 & hash) << 15 >>> 0); + }, + _ElementCssClassSet__add: function(_element, value) { + var list, t1; + list = _element.classList; + t1 = list.contains(value); + list.add(value); + return !t1; + }, + _ElementCssClassSet__remove: function(_element, value) { + var list, removed; + list = _element.classList; + removed = list.contains(value); + list.remove(value); + return removed; + }, + _convertNativeToDart_Window: function(win) { + if (win == null) + return; + return W._DOMWindowCrossFrame__createSafe(win); + }, + _wrapZone: function(callback) { + if (J.$eq$($.Zone__current, C.C__RootZone)) + return callback; + if (callback == null) + return; + return $.Zone__current.bindUnaryCallback$2$runGuarded(callback, true); + }, + HtmlElement: { + "^": "Element;", + "%": "HTMLAppletElement|HTMLBRElement|HTMLBaseElement|HTMLButtonElement|HTMLCanvasElement|HTMLContentElement|HTMLDListElement|HTMLDataListElement|HTMLDetailsElement|HTMLDialogElement|HTMLDirectoryElement|HTMLFieldSetElement|HTMLFontElement|HTMLFrameElement|HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMarqueeElement|HTMLMenuElement|HTMLMenuItemElement|HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLOptGroupElement|HTMLOptionElement|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPictureElement|HTMLPreElement|HTMLProgressElement|HTMLQuoteElement|HTMLShadowElement|HTMLSpanElement|HTMLStyleElement|HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement|HTMLTableRowElement|HTMLTableSectionElement|HTMLTemplateElement|HTMLTextAreaElement|HTMLTitleElement|HTMLUListElement|HTMLUnknownElement;HTMLElement" + }, + AnchorElement: { + "^": "HtmlElement;origin=", + toString$0: function(receiver) { + return String(receiver); }, - postMessage$2: function($receiver, message, targetOrigin) { - return this.postMessage$3($receiver, message, targetOrigin, null); + $isInterceptor: 1, + "%": "HTMLAnchorElement" + }, + ApplicationCacheErrorEvent: { + "^": "Event;message=", + "%": "ApplicationCacheErrorEvent" + }, + AreaElement: { + "^": "HtmlElement;origin=", + toString$0: function(receiver) { + return String(receiver); }, $isInterceptor: 1, - static: { - _DOMWindowCrossFrame__createSafe: function(w) { - if (w === window) - return w; - else - return new W._DOMWindowCrossFrame(w); - } - } + "%": "HTMLAreaElement" }, - _LocationCrossFrame: { - "^": "Object;_location", - static: { - _LocationCrossFrame__createSafe: function($location) { - if ($location === window.location) - return $location; - else - return new W._LocationCrossFrame($location); - } - } - } - }], ["dart.dom.indexed_db", "dart:indexed_db",, P, { - "^": "", - KeyRange: { + Blob: { "^": "Interceptor;", - $isKeyRange: 1, - "%": "IDBKeyRange" - } - }], ["dart.dom.svg", "dart:svg",, P, { - "^": "", - AElement: { - "^": "GraphicsElement;", - $isInterceptor: 1, - "%": "SVGAElement" + $isBlob: 1, + "%": ";Blob" }, - AnimationElement: { - "^": "SvgElement;", + BodyElement: { + "^": "HtmlElement;", $isInterceptor: 1, - "%": "SVGAnimateElement|SVGAnimateMotionElement|SVGAnimateTransformElement|SVGAnimationElement|SVGSetElement" + "%": "HTMLBodyElement" }, - FEBlendElement: { - "^": "SvgElement;result=", + CharacterData: { + "^": "Node;data=,length=", $isInterceptor: 1, - "%": "SVGFEBlendElement" + "%": "CDATASection|CharacterData|Comment|ProcessingInstruction|Text" }, - FEColorMatrixElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEColorMatrixElement" + CompositionEvent: { + "^": "UIEvent;data=", + "%": "CompositionEvent" }, - FEComponentTransferElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEComponentTransferElement" + CrossOriginServiceWorkerClient: { + "^": "EventTarget;origin=", + postMessage$2: function(receiver, message, transfer) { + receiver.postMessage(new P._StructuredCloneDart2Js([], []).walk$1(message), transfer); + return; + }, + "%": "CrossOriginServiceWorkerClient" }, - FECompositeElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFECompositeElement" + CssStyleDeclaration: { + "^": "Interceptor_CssStyleDeclarationBase;length=", + "%": "CSS2Properties|CSSStyleDeclaration|MSStyleCSSProperties" }, - FEConvolveMatrixElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEConvolveMatrixElement" + Interceptor_CssStyleDeclarationBase: { + "^": "Interceptor+CssStyleDeclarationBase;" }, - FEDiffuseLightingElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEDiffuseLightingElement" + CssStyleDeclarationBase: { + "^": "Object;" }, - FEDisplacementMapElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEDisplacementMapElement" + DivElement: { + "^": "HtmlElement;", + "%": ";HTMLDivElement" }, - FEFloodElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEFloodElement" + Document: { + "^": "Node;origin=", + "%": "Document|HTMLDocument|XMLDocument" }, - FEGaussianBlurElement: { - "^": "SvgElement;result=", + DocumentFragment: { + "^": "Node;", $isInterceptor: 1, - "%": "SVGFEGaussianBlurElement" + "%": "DocumentFragment|ShadowRoot" }, - FEImageElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEImageElement" + DomError: { + "^": "Interceptor;message=", + "%": "DOMError|FileError" }, - FEMergeElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEMergeElement" + DomException: { + "^": "Interceptor;message=", + toString$0: function(receiver) { + return String(receiver); + }, + "%": "DOMException" }, - FEMorphologyElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFEMorphologyElement" + DomRectReadOnly: { + "^": "Interceptor;", + toString$0: function(receiver) { + return "Rectangle (" + H.S(receiver.left) + ", " + H.S(receiver.top) + ") " + H.S(this.get$width(receiver)) + " x " + H.S(this.get$height(receiver)); + }, + $eq: function(receiver, other) { + var t1; + if (other == null) + return false; + t1 = J.getInterceptor(other); + if (!t1.$isRectangle) + return false; + return receiver.left === t1.get$left(other) && receiver.top === t1.get$top(other) && this.get$width(receiver) === t1.get$width(other) && this.get$height(receiver) === t1.get$height(other); + }, + get$hashCode: function(receiver) { + var t1, t2, t3, t4; + t1 = receiver.left; + t2 = receiver.top; + t3 = this.get$width(receiver); + t4 = this.get$height(receiver); + return W._JenkinsSmiHash_finish(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(0, t1 & 0x1FFFFFFF), t2 & 0x1FFFFFFF), t3 & 0x1FFFFFFF), t4 & 0x1FFFFFFF)); + }, + get$height: function(receiver) { + return receiver.height; + }, + get$left: function(receiver) { + return receiver.left; + }, + get$top: function(receiver) { + return receiver.top; + }, + get$width: function(receiver) { + return receiver.width; + }, + $isRectangle: 1, + $asRectangle: Isolate.functionThatReturnsNull, + "%": ";DOMRectReadOnly" + }, + DomTokenList: { + "^": "Interceptor;length=", + contains$1: function(receiver, token) { + return receiver.contains(token); + }, + "%": "DOMSettableTokenList|DOMTokenList" }, - FEOffsetElement: { - "^": "SvgElement;result=", + Element: { + "^": "Node;", + toString$0: function(receiver) { + return receiver.localName; + }, + get$onClick: function(receiver) { + return H.setRuntimeTypeInfo(new W._ElementEventStreamImpl(receiver, "click", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_click, 0)]); + }, + $isElement: 1, + $isNode: 1, + $isObject: 1, $isInterceptor: 1, - "%": "SVGFEOffsetElement" + "%": ";Element" }, - FESpecularLightingElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFESpecularLightingElement" + EmbedElement: { + "^": "HtmlElement;src%", + "%": "HTMLEmbedElement" }, - FETileElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFETileElement" + ErrorEvent: { + "^": "Event;error=,message=", + "%": "ErrorEvent" }, - FETurbulenceElement: { - "^": "SvgElement;result=", - $isInterceptor: 1, - "%": "SVGFETurbulenceElement" + Event: { + "^": "Interceptor;", + stopPropagation$0: function(receiver) { + return receiver.stopPropagation(); + }, + "%": "AnimationEvent|AnimationPlayerEvent|AudioProcessingEvent|AutocompleteErrorEvent|BeforeInstallPromptEvent|BeforeUnloadEvent|ClipboardEvent|CloseEvent|CrossOriginConnectEvent|CustomEvent|DefaultSessionStartEvent|DeviceLightEvent|DeviceMotionEvent|DeviceOrientationEvent|FontFaceSetLoadEvent|GamepadEvent|GeofencingEvent|HashChangeEvent|IDBVersionChangeEvent|MIDIConnectionEvent|MediaEncryptedEvent|MediaQueryListEvent|MediaStreamEvent|MediaStreamTrackEvent|OfflineAudioCompletionEvent|PageTransitionEvent|PopStateEvent|ProgressEvent|PromiseRejectionEvent|RTCDTMFToneChangeEvent|RTCDataChannelEvent|RTCIceCandidateEvent|RTCPeerConnectionIceEvent|RelatedEvent|ResourceProgressEvent|SecurityPolicyViolationEvent|SpeechRecognitionEvent|SpeechSynthesisEvent|StorageEvent|TrackEvent|TransitionEvent|WebGLContextEvent|WebKitTransitionEvent|XMLHttpRequestProgressEvent;Event|InputEvent" }, - FilterElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGFilterElement" + EventTarget: { + "^": "Interceptor;", + _addEventListener$3: function(receiver, type, listener, capture) { + return receiver.addEventListener(type, H.convertDartClosureToJS(listener, 1), false); + }, + _removeEventListener$3: function(receiver, type, listener, capture) { + return receiver.removeEventListener(type, H.convertDartClosureToJS(listener, 1), false); + }, + "%": "MediaStream;EventTarget" }, - GraphicsElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGCircleElement|SVGClipPathElement|SVGDefsElement|SVGEllipseElement|SVGForeignObjectElement|SVGGElement|SVGGeometryElement|SVGLineElement|SVGPathElement|SVGPolygonElement|SVGPolylineElement|SVGRectElement|SVGSwitchElement;SVGGraphicsElement" + ExtendableEvent: { + "^": "Event;", + "%": "FetchEvent|NotificationEvent|PeriodicSyncEvent|SyncEvent;ExtendableEvent" }, - ImageElement0: { - "^": "GraphicsElement;", - $isInterceptor: 1, - "%": "SVGImageElement" + File: { + "^": "Blob;", + $isFile: 1, + "%": "File" }, - MarkerElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGMarkerElement" + FormElement: { + "^": "HtmlElement;length=", + "%": "HTMLFormElement" }, - MaskElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGMaskElement" + HtmlCollection: { + "^": "Interceptor_ListMixin_ImmutableListMixin;", + get$length: function(receiver) { + return receiver.length; + }, + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + throw H.wrapException(P.IndexError$(index, receiver, null, null, null)); + return receiver[index]; + }, + $indexSet: function(receiver, index, value) { + throw H.wrapException(new P.UnsupportedError("Cannot assign element of immutable List.")); + }, + set$length: function(receiver, value) { + throw H.wrapException(new P.UnsupportedError("Cannot resize immutable List.")); + }, + elementAt$1: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + return H.ioore(receiver, index); + return receiver[index]; + }, + $isList: 1, + $asList: function() { + return [W.Node]; + }, + $isEfficientLength: 1, + $isJavaScriptIndexingBehavior: 1, + $asJavaScriptIndexingBehavior: function() { + return [W.Node]; + }, + $isJSIndexable: 1, + $asJSIndexable: function() { + return [W.Node]; + }, + "%": "HTMLCollection|HTMLFormControlsCollection|HTMLOptionsCollection" }, - PatternElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGPatternElement" + Interceptor_ListMixin: { + "^": "Interceptor+ListMixin;", + $isList: 1, + $asList: function() { + return [W.Node]; + }, + $isEfficientLength: 1 }, - ScriptElement0: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGScriptElement" + Interceptor_ListMixin_ImmutableListMixin: { + "^": "Interceptor_ListMixin+ImmutableListMixin;", + $isList: 1, + $asList: function() { + return [W.Node]; + }, + $isEfficientLength: 1 }, - SvgElement: { - "^": "Element;", - get$onClick: function(receiver) { - return H.setRuntimeTypeInfo(new W._ElementEventStreamImpl(receiver, "click", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_click, 0)]); + IFrameElement: { + "^": "HtmlElement;src%", + get$contentWindow: function(receiver) { + return W._convertNativeToDart_Window(receiver.contentWindow); }, - $isInterceptor: 1, - "%": "SVGComponentTransferFunctionElement|SVGDescElement|SVGDiscardElement|SVGFEDistantLightElement|SVGFEFuncAElement|SVGFEFuncBElement|SVGFEFuncGElement|SVGFEFuncRElement|SVGFEMergeNodeElement|SVGFEPointLightElement|SVGFESpotLightElement|SVGMetadataElement|SVGStopElement|SVGStyleElement|SVGTitleElement;SVGElement" + $isElement: 1, + $isNode: 1, + $isObject: 1, + "%": "HTMLIFrameElement" }, - SvgSvgElement: { - "^": "GraphicsElement;", - $isInterceptor: 1, - "%": "SVGSVGElement" + ImageElement: { + "^": "HtmlElement;src%", + complete$1: function($receiver, arg0) { + return $receiver.complete.call$1(arg0); + }, + "%": "HTMLImageElement" }, - SymbolElement: { - "^": "SvgElement;", + InputElement: { + "^": "HtmlElement;src%", $isInterceptor: 1, - "%": "SVGSymbolElement" + "%": "HTMLInputElement" }, - TextContentElement: { - "^": "GraphicsElement;", - "%": "SVGTSpanElement|SVGTextElement|SVGTextPositioningElement;SVGTextContentElement" + KeyboardEvent: { + "^": "UIEvent;location=", + "%": "KeyboardEvent" }, - TextPathElement: { - "^": "TextContentElement;", - $isInterceptor: 1, - "%": "SVGTextPathElement" + Location: { + "^": "Interceptor;", + get$origin: function(receiver) { + if ("origin" in receiver) + return receiver.origin; + return H.S(receiver.protocol) + "//" + H.S(receiver.host); + }, + toString$0: function(receiver) { + return String(receiver); + }, + "%": "Location" }, - UseElement: { - "^": "GraphicsElement;", - $isInterceptor: 1, - "%": "SVGUseElement" + MediaElement: { + "^": "HtmlElement;error=,src%", + "%": "HTMLAudioElement|HTMLMediaElement|HTMLVideoElement" }, - ViewElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGViewElement" + MediaKeyEvent: { + "^": "Event;message=", + "%": "MediaKeyEvent" }, - _GradientElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGGradientElement|SVGLinearGradientElement|SVGRadialGradientElement" + MediaKeyMessageEvent: { + "^": "Event;message=", + "%": "MediaKeyMessageEvent" }, - _SVGCursorElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGCursorElement" + MessageEvent: { + "^": "Event;origin=", + get$data: function(receiver) { + var t1, t2; + t1 = receiver.data; + t2 = new P._AcceptStructuredCloneDart2Js([], [], false); + t2.mustCopy = true; + return t2.walk$1(t1); + }, + $isObject: 1, + "%": "MessageEvent" }, - _SVGFEDropShadowElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGFEDropShadowElement" + MidiMessageEvent: { + "^": "Event;data=", + "%": "MIDIMessageEvent" }, - _SVGMPathElement: { - "^": "SvgElement;", - $isInterceptor: 1, - "%": "SVGMPathElement" - } - }], ["dart.dom.web_audio", "dart:web_audio",, P, { - "^": "" - }], ["dart.dom.web_gl", "dart:web_gl",, P, { - "^": "" - }], ["dart.dom.web_sql", "dart:web_sql",, P, { - "^": "", - SqlError: { - "^": "Interceptor;message=", - "%": "SQLError" - } - }], ["dart.isolate", "dart:isolate",, P, { - "^": "", - Capability: { - "^": "Object;" - } - }], ["dart.js", "dart:js",, P, { - "^": "", - _callDartFunction: [function(callback, captureThis, $self, $arguments) { - var arguments0, dartArgs; - if (captureThis === true) { - arguments0 = [$self]; - C.JSArray_methods.addAll$1(arguments0, $arguments); - $arguments = arguments0; - } - dartArgs = P.List_List$from(J.map$1$ax($arguments, P.js___convertToDart$closure()), true, null); - return P._convertToJS(H.Primitives_applyFunctionWithPositionalArguments(callback, dartArgs)); - }, null, null, 8, 0, null, 16, 42, 0, 43], - _defineProperty: function(o, $name, value) { - var exception; - try { - if (Object.isExtensible(o) && !Object.prototype.hasOwnProperty.call(o, $name)) { - Object.defineProperty(o, $name, {value: value}); - return true; - } - } catch (exception) { - H.unwrapException(exception); - } - return false; + MidiOutput: { + "^": "MidiPort;", + send$2: function(receiver, data, timestamp) { + return receiver.send(data, timestamp); + }, + send$1: function($receiver, data) { + return $receiver.send(data); + }, + "%": "MIDIOutput" }, - _getOwnProperty: function(o, $name) { - if (Object.prototype.hasOwnProperty.call(o, $name)) - return o[$name]; - return; + MidiPort: { + "^": "EventTarget;", + "%": "MIDIInput;MIDIPort" }, - _convertToJS: [function(o) { - var t1; - if (o == null || typeof o === "string" || typeof o === "number" || typeof o === "boolean") - return o; - t1 = J.getInterceptor(o); - if (!!t1.$isJsObject) - return o._jsObject; - if (!!t1.$isBlob || !!t1.$isEvent || !!t1.$isKeyRange || !!t1.$isImageData || !!t1.$isNode || !!t1.$isTypedData || !!t1.$isWindow) - return o; - if (!!t1.$isDateTime) - return H.Primitives_lazyAsJsDate(o); - if (!!t1.$isFunction) - return P._getJsProxy(o, "$dart_jsFunction", new P._convertToJS_closure()); - return P._getJsProxy(o, "_$dart_jsObject", new P._convertToJS_closure0($.$get$_dartProxyCtor())); - }, "call$1", "js___convertToJS$closure", 2, 0, 0, 24], - _getJsProxy: function(o, propertyName, createProxy) { - var jsProxy = P._getOwnProperty(o, propertyName); - if (jsProxy == null) { - jsProxy = createProxy.call$1(o); - P._defineProperty(o, propertyName, jsProxy); - } - return jsProxy; - }, - _convertToDart: [function(o) { - var t1, ms; - if (o == null || typeof o == "string" || typeof o == "number" || typeof o == "boolean") - return o; - else { - if (o instanceof Object) { - t1 = J.getInterceptor(o); - t1 = !!t1.$isBlob || !!t1.$isEvent || !!t1.$isKeyRange || !!t1.$isImageData || !!t1.$isNode || !!t1.$isTypedData || !!t1.$isWindow; - } else - t1 = false; - if (t1) - return o; - else if (o instanceof Date) { - ms = o.getTime(); - t1 = new P.DateTime(ms, false); - t1.DateTime$_withValue$2$isUtc(ms, false); - return t1; - } else if (o.constructor === $.$get$_dartProxyCtor()) - return o.o; - else - return P._wrapToDart(o); - } - }, "call$1", "js___convertToDart$closure", 2, 0, 65, 24], - _wrapToDart: function(o) { - if (typeof o == "function") - return P._getDartProxy(o, $.$get$DART_CLOSURE_PROPERTY_NAME(), new P._wrapToDart_closure()); - if (o instanceof Array) - return P._getDartProxy(o, $.$get$_DART_OBJECT_PROPERTY_NAME(), new P._wrapToDart_closure0()); - return P._getDartProxy(o, $.$get$_DART_OBJECT_PROPERTY_NAME(), new P._wrapToDart_closure1()); - }, - _getDartProxy: function(o, propertyName, createProxy) { - var dartProxy = P._getOwnProperty(o, propertyName); - if (dartProxy == null || !(o instanceof Object)) { - dartProxy = createProxy.call$1(o); - P._defineProperty(o, propertyName, dartProxy); - } - return dartProxy; - }, - JsObject: { - "^": "Object;_jsObject", - $index: ["super$JsObject$$index", function(_, property) { - if (typeof property !== "string" && typeof property !== "number") - throw H.wrapException(P.ArgumentError$("property is not a String or num")); - return P._convertToDart(this._jsObject[property]); - }], - $indexSet: ["super$JsObject$$indexSet", function(_, property, value) { - if (typeof property !== "string" && typeof property !== "number") - throw H.wrapException(P.ArgumentError$("property is not a String or num")); - this._jsObject[property] = P._convertToJS(value); - }], - get$hashCode: function(_) { - return 0; + MouseEvent: { + "^": "UIEvent;", + $isObject: 1, + "%": "DragEvent|MouseEvent|PointerEvent|WheelEvent" + }, + Navigator: { + "^": "Interceptor;", + $isInterceptor: 1, + "%": "Navigator" + }, + NavigatorUserMediaError: { + "^": "Interceptor;message=", + "%": "NavigatorUserMediaError" + }, + Node: { + "^": "EventTarget;parent:parentElement=", + remove$0: function(receiver) { + var t1 = receiver.parentNode; + if (t1 != null) + t1.removeChild(receiver); }, - $eq: function(_, other) { - if (other == null) - return false; - return other instanceof P.JsObject && this._jsObject === other._jsObject; + toString$0: function(receiver) { + var value = receiver.nodeValue; + return value == null ? this.super$Interceptor$toString(receiver) : value; }, - toString$0: function(_) { - var t1, exception; - try { - t1 = String(this._jsObject); - return t1; - } catch (exception) { - H.unwrapException(exception); - return this.super$Object$toString(this); - } + contains$1: function(receiver, other) { + return receiver.contains(other); }, - callMethod$2: function(method, args) { - var t1, t2; - t1 = this._jsObject; - t2 = args == null ? null : P.List_List$from(H.setRuntimeTypeInfo(new H.MappedListIterable(args, P.js___convertToJS$closure()), [null, null]), true, null); - return P._convertToDart(t1[method].apply(t1, t2)); - } - }, - JsFunction: { - "^": "JsObject;_jsObject" + $isNode: 1, + $isObject: 1, + "%": "Attr;Node" }, - JsArray: { - "^": "JsObject_ListMixin;_jsObject", - $index: function(_, index) { - var t1; - if (typeof index === "number" && index === C.JSNumber_methods.toInt$0(index)) { - if (typeof index === "number" && Math.floor(index) === index) - t1 = index < 0 || index >= this.get$length(this); - else - t1 = false; - if (t1) - H.throwExpression(P.RangeError$range(index, 0, this.get$length(this), null, null)); - } - return this.super$JsObject$$index(this, index); + NodeList: { + "^": "Interceptor_ListMixin_ImmutableListMixin0;", + get$length: function(receiver) { + return receiver.length; }, - $indexSet: function(_, index, value) { - var t1; - if (typeof index === "number" && index === C.JSNumber_methods.toInt$0(index)) { - if (typeof index === "number" && Math.floor(index) === index) - t1 = index < 0 || index >= this.get$length(this); - else - t1 = false; - if (t1) - H.throwExpression(P.RangeError$range(index, 0, this.get$length(this), null, null)); - } - this.super$JsObject$$indexSet(this, index, value); + $index: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + throw H.wrapException(P.IndexError$(index, receiver, null, null, null)); + return receiver[index]; }, - get$length: function(_) { - var len = this._jsObject.length; - if (typeof len === "number" && len >>> 0 === len) - return len; - throw H.wrapException(new P.StateError("Bad JsArray length")); + $indexSet: function(receiver, index, value) { + throw H.wrapException(new P.UnsupportedError("Cannot assign element of immutable List.")); }, - set$length: function(_, $length) { - this.super$JsObject$$indexSet(this, "length", $length); + set$length: function(receiver, value) { + throw H.wrapException(new P.UnsupportedError("Cannot resize immutable List.")); }, - add$1: function(_, value) { - this.callMethod$2("push", [value]); + elementAt$1: function(receiver, index) { + if (index >>> 0 !== index || index >= receiver.length) + return H.ioore(receiver, index); + return receiver[index]; }, - setRange$4: function(_, start, end, iterable, skipCount) { - var $length, args, t1, t2, t3; - P.JsArray__checkRange(start, end, this.get$length(this)); - $length = end - start; - if ($length === 0) - return; - args = [start, $length]; - t1 = H.setRuntimeTypeInfo(new H.SubListIterable(iterable, skipCount, null), [H.getRuntimeTypeArgument(iterable, "ListMixin", 0)]); - t2 = t1.__internal$_start; - if (t2 < 0) - H.throwExpression(P.RangeError$range(t2, 0, null, "start", null)); - t3 = t1._endOrLength; - if (t3 != null) { - if (typeof t3 !== "number") - return t3.$lt(); - if (t3 < 0) - H.throwExpression(P.RangeError$range(t3, 0, null, "end", null)); - if (t2 > t3) - H.throwExpression(P.RangeError$range(t2, 0, t3, "start", null)); - } - C.JSArray_methods.addAll$1(args, t1.take$1(0, $length)); - this.callMethod$2("splice", args); + $isList: 1, + $asList: function() { + return [W.Node]; }, - setRange$3: function($receiver, start, end, iterable) { - return this.setRange$4($receiver, start, end, iterable, 0); + $isEfficientLength: 1, + $isJavaScriptIndexingBehavior: 1, + $asJavaScriptIndexingBehavior: function() { + return [W.Node]; }, - static: { - JsArray__checkRange: function(start, end, $length) { - if (start > $length) - throw H.wrapException(P.RangeError$range(start, 0, $length, null, null)); - if (end < start || end > $length) - throw H.wrapException(P.RangeError$range(end, start, $length, null, null)); - } - } + $isJSIndexable: 1, + $asJSIndexable: function() { + return [W.Node]; + }, + "%": "NodeList|RadioNodeList" }, - JsObject_ListMixin: { - "^": "JsObject+ListMixin;", + Interceptor_ListMixin0: { + "^": "Interceptor+ListMixin;", $isList: 1, - $asList: null, + $asList: function() { + return [W.Node]; + }, $isEfficientLength: 1 }, - _convertToJS_closure: { - "^": "Closure:0;", - call$1: function(o) { - var jsFunction = function(_call, f, captureThis) { - return function() { - return _call(f, captureThis, this, Array.prototype.slice.apply(arguments)); - }; - }(P._callDartFunction, o, false); - P._defineProperty(jsFunction, $.$get$DART_CLOSURE_PROPERTY_NAME(), o); - return jsFunction; - } + Interceptor_ListMixin_ImmutableListMixin0: { + "^": "Interceptor_ListMixin0+ImmutableListMixin;", + $isList: 1, + $asList: function() { + return [W.Node]; + }, + $isEfficientLength: 1 }, - _convertToJS_closure0: { - "^": "Closure:0;ctor", - call$1: function(o) { - return new this.ctor(o); - } + ObjectElement: { + "^": "HtmlElement;data=", + "%": "HTMLObjectElement" }, - _wrapToDart_closure: { - "^": "Closure:0;", - call$1: function(o) { - return new P.JsFunction(o); - } + PluginPlaceholderElement: { + "^": "DivElement;message=", + "%": "PluginPlaceholderElement" }, - _wrapToDart_closure0: { - "^": "Closure:0;", - call$1: function(o) { - return H.setRuntimeTypeInfo(new P.JsArray(o), [null]); - } + PositionError: { + "^": "Interceptor;message=", + "%": "PositionError" }, - _wrapToDart_closure1: { - "^": "Closure:0;", - call$1: function(o) { - return new P.JsObject(o); - } - } - }], ["dart.math", "dart:math",, P, { - "^": "", - max: [function(a, b) { - if (typeof a !== "number") - throw H.wrapException(P.ArgumentError$(a)); - if (typeof b !== "number") - throw H.wrapException(P.ArgumentError$(b)); - if (a > b) - return a; - if (a < b) - return b; - if (typeof b === "number") { - if (typeof a === "number") - if (a === 0) - return a + b; - if (isNaN(b)) - return b; - return a; - } - if (b === 0 && C.JSNumber_methods.get$isNegative(a)) - return b; - return a; - }, "call$2", "math__max$closure", 4, 0, 44] - }], ["dart.typed_data", "dart:typed_data",, P, { - "^": "", - Uint8List: { - "^": "Object;", - $isList: 1, - $asList: function() { - return [P.$int]; + PushEvent: { + "^": "ExtendableEvent;data=", + "%": "PushEvent" + }, + ScriptElement: { + "^": "HtmlElement;src%", + "%": "HTMLScriptElement" + }, + SelectElement: { + "^": "HtmlElement;length=", + "%": "HTMLSelectElement" + }, + ServicePortConnectEvent: { + "^": "ExtendableEvent;origin=", + "%": "ServicePortConnectEvent" + }, + ServiceWorkerMessageEvent: { + "^": "Event;origin=", + get$data: function(receiver) { + var t1, t2; + t1 = receiver.data; + t2 = new P._AcceptStructuredCloneDart2Js([], [], false); + t2.mustCopy = true; + return t2.walk$1(t1); }, - $isTypedData: 1, - $isEfficientLength: 1 - } - }], ["dart.typed_data.implementation", "dart:_native_typed_data",, H, { - "^": "", - _checkLength: function($length) { - if (typeof $length !== "number" || Math.floor($length) !== $length) - throw H.wrapException(P.ArgumentError$("Invalid length " + H.S($length))); - return $length; + "%": "ServiceWorkerMessageEvent" + }, + SourceElement: { + "^": "HtmlElement;src%", + "%": "HTMLSourceElement" + }, + SpeechRecognitionError: { + "^": "Event;error=,message=", + "%": "SpeechRecognitionError" + }, + TextEvent: { + "^": "UIEvent;data=", + "%": "TextEvent" + }, + TrackElement: { + "^": "HtmlElement;src%", + "%": "HTMLTrackElement" + }, + UIEvent: { + "^": "Event;", + "%": "FocusEvent|SVGZoomEvent|TouchEvent;UIEvent" + }, + WebSocket: { + "^": "EventTarget;", + send$1: function(receiver, data) { + return receiver.send(data); + }, + "%": "WebSocket" + }, + Window: { + "^": "EventTarget;", + get$location: function(receiver) { + return receiver.location; + }, + get$parent: function(receiver) { + return W._convertNativeToDart_Window(receiver.parent); + }, + postMessage$3: function(receiver, message, targetOrigin, transfer) { + receiver.postMessage(new P._StructuredCloneDart2Js([], []).walk$1(message), targetOrigin); + return; + }, + postMessage$2: function($receiver, message, targetOrigin) { + return this.postMessage$3($receiver, message, targetOrigin, null); + }, + $isInterceptor: 1, + "%": "DOMWindow|Window" }, - _checkValidRange: function(start, end, $length) { - var t1; - if (!(start >>> 0 !== start)) - t1 = end >>> 0 !== end || start > end || end > $length; - else - t1 = true; - if (t1) - throw H.wrapException(H.diagnoseRangeError(start, end, $length)); - return end; + _ClientRect: { + "^": "Interceptor;height=,left=,top=,width=", + toString$0: function(receiver) { + return "Rectangle (" + H.S(receiver.left) + ", " + H.S(receiver.top) + ") " + H.S(receiver.width) + " x " + H.S(receiver.height); + }, + $eq: function(receiver, other) { + var t1, t2, t3; + if (other == null) + return false; + t1 = J.getInterceptor(other); + if (!t1.$isRectangle) + return false; + t2 = receiver.left; + t3 = t1.get$left(other); + if (t2 == null ? t3 == null : t2 === t3) { + t2 = receiver.top; + t3 = t1.get$top(other); + if (t2 == null ? t3 == null : t2 === t3) { + t2 = receiver.width; + t3 = t1.get$width(other); + if (t2 == null ? t3 == null : t2 === t3) { + t2 = receiver.height; + t1 = t1.get$height(other); + t1 = t2 == null ? t1 == null : t2 === t1; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + return t1; + }, + get$hashCode: function(receiver) { + var t1, t2, t3, t4; + t1 = J.get$hashCode$(receiver.left); + t2 = J.get$hashCode$(receiver.top); + t3 = J.get$hashCode$(receiver.width); + t4 = J.get$hashCode$(receiver.height); + return W._JenkinsSmiHash_finish(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(0, t1), t2), t3), t4)); + }, + $isRectangle: 1, + $asRectangle: Isolate.functionThatReturnsNull, + "%": "ClientRect" }, - NativeByteBuffer: { - "^": "Interceptor;", - $isNativeByteBuffer: 1, - "%": "ArrayBuffer" + _DocumentType: { + "^": "Node;", + $isInterceptor: 1, + "%": "DocumentType" }, - NativeTypedData: { - "^": "Interceptor;", - _invalidPosition$3: function(receiver, position, $length, $name) { - throw H.wrapException(P.RangeError$range(position, 0, $length, $name, null)); + _DomRect: { + "^": "DomRectReadOnly;", + get$height: function(receiver) { + return receiver.height; }, - _checkPosition$3: function(receiver, position, $length, $name) { - if (position >>> 0 !== position || position > $length) - this._invalidPosition$3(receiver, position, $length, $name); + get$width: function(receiver) { + return receiver.width; }, - $isNativeTypedData: 1, - $isTypedData: 1, - "%": ";ArrayBufferView;NativeTypedArray|NativeTypedArray_ListMixin|NativeTypedArray_ListMixin_FixedLengthListMixin|NativeTypedArrayOfDouble|NativeTypedArray_ListMixin0|NativeTypedArray_ListMixin_FixedLengthListMixin0|NativeTypedArrayOfInt" + "%": "DOMRect" }, - NativeByteData: { - "^": "NativeTypedData;", - $isTypedData: 1, - "%": "DataView" + _HTMLFrameSetElement: { + "^": "HtmlElement;", + $isInterceptor: 1, + "%": "HTMLFrameSetElement" }, - NativeTypedArray: { - "^": "NativeTypedData;", + _NamedNodeMap: { + "^": "Interceptor_ListMixin_ImmutableListMixin1;", get$length: function(receiver) { return receiver.length; }, - _setRangeFast$4: function(receiver, start, end, source, skipCount) { - var targetLength, count, sourceLength; - targetLength = receiver.length; - this._checkPosition$3(receiver, start, targetLength, "start"); - this._checkPosition$3(receiver, end, targetLength, "end"); - if (start > end) - throw H.wrapException(P.RangeError$range(start, 0, end, null, null)); - count = end - start; - sourceLength = source.length; - if (sourceLength - skipCount < count) - throw H.wrapException(new P.StateError("Not enough elements")); - if (skipCount !== 0 || sourceLength !== count) - source = source.subarray(skipCount, skipCount + count); - receiver.set(source, start); - }, - $isJavaScriptIndexingBehavior: 1, - $asJavaScriptIndexingBehavior: Isolate.functionThatReturnsNull, - $isJSIndexable: 1, - $asJSIndexable: Isolate.functionThatReturnsNull - }, - NativeTypedArrayOfDouble: { - "^": "NativeTypedArray_ListMixin_FixedLengthListMixin;", $index: function(receiver, index) { if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); + throw H.wrapException(P.IndexError$(index, receiver, null, null, null)); return receiver[index]; }, $indexSet: function(receiver, index, value) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - receiver[index] = value; - }, - setRange$4: function(receiver, start, end, iterable, skipCount) { - if (!!J.getInterceptor(iterable).$isNativeTypedArrayOfDouble) { - this._setRangeFast$4(receiver, start, end, iterable, skipCount); - return; - } - this.super$ListMixin$setRange(receiver, start, end, iterable, skipCount); + throw H.wrapException(new P.UnsupportedError("Cannot assign element of immutable List.")); }, - setRange$3: function($receiver, start, end, iterable) { - return this.setRange$4($receiver, start, end, iterable, 0); - } - }, - NativeTypedArray_ListMixin: { - "^": "NativeTypedArray+ListMixin;", - $isList: 1, - $asList: function() { - return [P.$double]; + set$length: function(receiver, value) { + throw H.wrapException(new P.UnsupportedError("Cannot resize immutable List.")); }, - $isEfficientLength: 1 - }, - NativeTypedArray_ListMixin_FixedLengthListMixin: { - "^": "NativeTypedArray_ListMixin+FixedLengthListMixin;" - }, - NativeTypedArrayOfInt: { - "^": "NativeTypedArray_ListMixin_FixedLengthListMixin0;", - $indexSet: function(receiver, index, value) { + elementAt$1: function(receiver, index) { if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - receiver[index] = value; - }, - setRange$4: function(receiver, start, end, iterable, skipCount) { - if (!!J.getInterceptor(iterable).$isNativeTypedArrayOfInt) { - this._setRangeFast$4(receiver, start, end, iterable, skipCount); - return; - } - this.super$ListMixin$setRange(receiver, start, end, iterable, skipCount); - }, - setRange$3: function($receiver, start, end, iterable) { - return this.setRange$4($receiver, start, end, iterable, 0); + return H.ioore(receiver, index); + return receiver[index]; }, $isList: 1, $asList: function() { - return [P.$int]; + return [W.Node]; }, - $isEfficientLength: 1 + $isEfficientLength: 1, + $isJavaScriptIndexingBehavior: 1, + $asJavaScriptIndexingBehavior: function() { + return [W.Node]; + }, + $isJSIndexable: 1, + $asJSIndexable: function() { + return [W.Node]; + }, + "%": "MozNamedAttrMap|NamedNodeMap" }, - NativeTypedArray_ListMixin0: { - "^": "NativeTypedArray+ListMixin;", + Interceptor_ListMixin1: { + "^": "Interceptor+ListMixin;", $isList: 1, $asList: function() { - return [P.$int]; + return [W.Node]; }, $isEfficientLength: 1 }, - NativeTypedArray_ListMixin_FixedLengthListMixin0: { - "^": "NativeTypedArray_ListMixin0+FixedLengthListMixin;" - }, - NativeFloat32List: { - "^": "NativeTypedArrayOfDouble;", - $isTypedData: 1, + Interceptor_ListMixin_ImmutableListMixin1: { + "^": "Interceptor_ListMixin1+ImmutableListMixin;", $isList: 1, $asList: function() { - return [P.$double]; + return [W.Node]; }, - $isEfficientLength: 1, - "%": "Float32Array" + $isEfficientLength: 1 }, - NativeFloat64List: { - "^": "NativeTypedArrayOfDouble;", - $isTypedData: 1, - $isList: 1, - $asList: function() { - return [P.$double]; - }, - $isEfficientLength: 1, - "%": "Float64Array" + EventStreamProvider: { + "^": "Object;_eventType" }, - NativeInt16List: { - "^": "NativeTypedArrayOfInt;", - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - return receiver[index]; + _EventStream: { + "^": "Stream;_html$_target,_eventType,_useCapture", + listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) { + var t1 = new W._EventStreamSubscription(0, this._html$_target, this._eventType, W._wrapZone(onData), false); + t1.$builtinTypeInfo = this.$builtinTypeInfo; + t1._tryResume$0(); + return t1; }, - $isTypedData: 1, - $isList: 1, - $asList: function() { - return [P.$int]; + listen$1: function(onData) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, null, null); }, - $isEfficientLength: 1, - "%": "Int16Array" + listen$3$onDone$onError: function(onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); + } }, - NativeInt32List: { - "^": "NativeTypedArrayOfInt;", - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - return receiver[index]; - }, - $isTypedData: 1, - $isList: 1, - $asList: function() { - return [P.$int]; - }, - $isEfficientLength: 1, - "%": "Int32Array" + _ElementEventStreamImpl: { + "^": "_EventStream;_html$_target,_eventType,_useCapture" }, - NativeInt8List: { - "^": "NativeTypedArrayOfInt;", - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - return receiver[index]; - }, - $isTypedData: 1, - $isList: 1, - $asList: function() { - return [P.$int]; + _EventStreamSubscription: { + "^": "StreamSubscription;_pauseCount,_html$_target,_eventType,_onData,_useCapture", + cancel$0: function() { + if (this._html$_target == null) + return; + this._unlisten$0(); + this._html$_target = null; + this._onData = null; + return; }, - $isEfficientLength: 1, - "%": "Int8Array" - }, - NativeUint16List: { - "^": "NativeTypedArrayOfInt;", - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - return receiver[index]; + pause$1: function(_, resumeSignal) { + if (this._html$_target == null) + return; + ++this._pauseCount; + this._unlisten$0(); }, - $isTypedData: 1, - $isList: 1, - $asList: function() { - return [P.$int]; + pause$0: function($receiver) { + return this.pause$1($receiver, null); }, - $isEfficientLength: 1, - "%": "Uint16Array" - }, - NativeUint32List: { - "^": "NativeTypedArrayOfInt;", - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - return receiver[index]; + resume$0: function() { + if (this._html$_target == null || this._pauseCount <= 0) + return; + --this._pauseCount; + this._tryResume$0(); }, - $isTypedData: 1, - $isList: 1, - $asList: function() { - return [P.$int]; + _tryResume$0: function() { + var t1, t2, t3; + t1 = this._onData; + t2 = t1 != null; + if (t2 && this._pauseCount <= 0) { + t3 = this._html$_target; + t3.toString; + if (t2) + J._addEventListener$3$x(t3, this._eventType, t1, false); + } }, - $isEfficientLength: 1, - "%": "Uint32Array" + _unlisten$0: function() { + var t1, t2, t3; + t1 = this._onData; + t2 = t1 != null; + if (t2) { + t3 = this._html$_target; + t3.toString; + if (t2) + J._removeEventListener$3$x(t3, this._eventType, t1, false); + } + } }, - NativeUint8ClampedList: { - "^": "NativeTypedArrayOfInt;", - get$length: function(receiver) { - return receiver.length; + ImmutableListMixin: { + "^": "Object;", + get$iterator: function(receiver) { + return new W.FixedSizeListIterator(receiver, this.get$length(receiver), -1, null); }, - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - return receiver[index]; + setRange$4: function(receiver, start, end, iterable, skipCount) { + throw H.wrapException(new P.UnsupportedError("Cannot setRange on immutable List.")); + }, + setRange$3: function($receiver, start, end, iterable) { + return this.setRange$4($receiver, start, end, iterable, 0); + }, + replaceRange$3: function(receiver, start, end, iterable) { + throw H.wrapException(new P.UnsupportedError("Cannot modify an immutable List.")); + }, + fillRange$3: function(receiver, start, end, fillValue) { + throw H.wrapException(new P.UnsupportedError("Cannot modify an immutable List.")); }, - $isTypedData: 1, $isList: 1, - $asList: function() { - return [P.$int]; + $asList: null, + $isEfficientLength: 1 + }, + FixedSizeListIterator: { + "^": "Object;_array,_html$_length,_position,_html$_current", + moveNext$0: function() { + var nextPosition, t1; + nextPosition = this._position + 1; + t1 = this._html$_length; + if (nextPosition < t1) { + this._html$_current = J.$index$asx(this._array, nextPosition); + this._position = nextPosition; + return true; + } + this._html$_current = null; + this._position = t1; + return false; }, - $isEfficientLength: 1, - "%": "CanvasPixelArray|Uint8ClampedArray" + get$current: function() { + return this._html$_current; + } }, - NativeUint8List: { - "^": "NativeTypedArrayOfInt;", - get$length: function(receiver) { - return receiver.length; + _DOMWindowCrossFrame: { + "^": "Object;_window", + get$location: function(_) { + return W._LocationCrossFrame__createSafe(this._window.location); }, - $index: function(receiver, index) { - if (index >>> 0 !== index || index >= receiver.length) - H.throwExpression(H.diagnoseIndexError(receiver, index)); - return receiver[index]; + get$parent: function(_) { + return W._DOMWindowCrossFrame__createSafe(this._window.parent); }, - sublist$2: function(receiver, start, end) { - return new Uint8Array(receiver.subarray(start, H._checkValidRange(start, end, receiver.length))); + postMessage$3: function(_, message, targetOrigin, messagePorts) { + this._window.postMessage(new P._StructuredCloneDart2Js([], []).walk$1(message), targetOrigin); }, - $isNativeUint8List: 1, - $isTypedData: 1, - $isList: 1, - $asList: function() { - return [P.$int]; + postMessage$2: function($receiver, message, targetOrigin) { + return this.postMessage$3($receiver, message, targetOrigin, null); }, - $isEfficientLength: 1, - "%": ";Uint8Array" - } - }], ["dart2js._js_primitives", "dart:_js_primitives",, H, { - "^": "", - printString: function(string) { - if (typeof dartPrint == "function") { - dartPrint(string); - return; - } - if (typeof console == "object" && typeof console.log != "undefined") { - console.log(string); - return; + $isInterceptor: 1, + static: { + _DOMWindowCrossFrame__createSafe: function(w) { + if (w === window) + return w; + else + return new W._DOMWindowCrossFrame(w); + } } - if (typeof window == "object") - return; - if (typeof print == "function") { - print(string); - return; + }, + _LocationCrossFrame: { + "^": "Object;_location", + static: { + _LocationCrossFrame__createSafe: function($location) { + if ($location === window.location) + return $location; + else + return new W._LocationCrossFrame($location); + } } - throw "Unable to print message: " + String(string); } - }], ["", "package:stack_trace/src/frame.dart",, A, { + }], ["html_common", "dart:html_common",, P, { "^": "", - Frame: { - "^": "Object;uri<,line<,column<,member<", - get$isCore: function() { - return this.uri.scheme === "dart"; - }, - get$library: function() { - var t1 = this.uri; - if (t1.scheme === "data") - return "data:..."; - return $.$get$context0().prettyUri$1(t1); - }, - get$$package: function() { - var t1 = this.uri; - if (t1.scheme !== "package") - return; - return C.JSArray_methods.get$first(t1._path.split("/")); - }, - get$location: function(_) { - var t1, t2; - t1 = this.line; - if (t1 == null) - return this.get$library(); - t2 = this.column; - if (t2 == null) - return this.get$library() + " " + H.S(t1); - return this.get$library() + " " + H.S(t1) + ":" + H.S(t2); - }, - toString$0: function(_) { - return this.get$location(this) + " in " + H.S(this.member); + convertNativePromiseToDartFuture: function(promise) { + var completer = H.setRuntimeTypeInfo(new P._AsyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]); + promise.then(H.convertDartClosureToJS(new P.convertNativePromiseToDartFuture_closure(completer), 1))["catch"](H.convertDartClosureToJS(new P.convertNativePromiseToDartFuture_closure0(completer), 1)); + return completer.future; + }, + _StructuredClone: { + "^": "Object;", + findSlot$1: function(value) { + var t1, $length, i; + t1 = this.values; + $length = t1.length; + for (i = 0; i < $length; ++i) + if (t1[i] === value) + return i; + t1.push(value); + this.copies.push(null); + return $length; }, - static: { - Frame_Frame$parseVM: function(frame) { - return A.Frame__catchFormatException(frame, new A.closure0(frame)); - }, - Frame_Frame$parseV8: function(frame) { - return A.Frame__catchFormatException(frame, new A.closure4(frame)); - }, - Frame_Frame$parseFirefox: function(frame) { - return A.Frame__catchFormatException(frame, new A.closure3(frame)); - }, - Frame_Frame$parseFriendly: function(frame) { - return A.Frame__catchFormatException(frame, new A.closure1(frame)); - }, - Frame__uriOrPathToUri: function(uriOrPath) { - var t1 = J.getInterceptor$asx(uriOrPath); - if (t1.contains$1(uriOrPath, $.$get$Frame__uriRegExp()) === true) - return P.Uri_parse(uriOrPath, 0, null); - else if (t1.contains$1(uriOrPath, $.$get$Frame__windowsRegExp()) === true) - return P.Uri_Uri$file(uriOrPath, true); - else if (t1.startsWith$1(uriOrPath, "/")) - return P.Uri_Uri$file(uriOrPath, false); - if (t1.contains$1(uriOrPath, "\\") === true) - return $.$get$windows().toUri$1(uriOrPath); - return P.Uri_parse(uriOrPath, 0, null); - }, - Frame__catchFormatException: function(text, body) { - var t1, exception; - try { - t1 = body.call$0(); - return t1; - } catch (exception) { - if (H.unwrapException(exception) instanceof P.FormatException) - return new N.UnparsedFrame(P.Uri_Uri(null, null, "unparsed", null, null, null, null, "", ""), null, null, false, "unparsed", null, "unparsed", text); - else - throw exception; - } + walk$1: function(e) { + var t1, t2, slot, t3, t4, copy; + t1 = {}; + if (e == null) + return e; + if (typeof e === "boolean") + return e; + if (typeof e === "number") + return e; + if (typeof e === "string") + return e; + t2 = J.getInterceptor(e); + if (!!t2.$isDateTime) + return new Date(e._core$_value); + if (!!t2.$isRegExp) + throw H.wrapException(new P.UnimplementedError("structured clone of RegExp")); + if (!!t2.$isFile) + return e; + if (!!t2.$isBlob) + return e; + if (!!t2.$isNativeByteBuffer || !!t2.$isNativeTypedData) + return e; + if (!!t2.$isMap) { + slot = this.findSlot$1(e); + t3 = this.copies; + t4 = t3.length; + if (slot >= t4) + return H.ioore(t3, slot); + copy = t3[slot]; + t1.copy = copy; + if (copy != null) + return copy; + copy = {}; + t1.copy = copy; + if (slot >= t4) + return H.ioore(t3, slot); + t3[slot] = copy; + t2.forEach$1(e, new P._StructuredClone_walk_closure(t1, this)); + return t1.copy; + } + if (!!t2.$isList) { + slot = this.findSlot$1(e); + t1 = this.copies; + if (slot >= t1.length) + return H.ioore(t1, slot); + copy = t1[slot]; + if (copy != null) + return copy; + return this.copyList$2(e, slot); + } + throw H.wrapException(new P.UnimplementedError("structured clone of other type")); + }, + copyList$2: function(e, slot) { + var t1, $length, copy, t2, i; + t1 = J.getInterceptor$asx(e); + $length = t1.get$length(e); + copy = new Array($length); + t2 = this.copies; + if (slot >= t2.length) + return H.ioore(t2, slot); + t2[slot] = copy; + if (typeof $length !== "number") + return H.iae($length); + i = 0; + for (; i < $length; ++i) { + t2 = this.walk$1(t1.$index(e, i)); + if (i >= copy.length) + return H.ioore(copy, i); + copy[i] = t2; } + return copy; } }, - closure0: { - "^": "Closure:1;frame", - call$0: function() { - var t1, match, t2, member, uri, lineAndColumn, line; - t1 = this.frame; - if (J.$eq$(t1, "...")) - return new A.Frame(P.Uri_Uri(null, null, null, null, null, null, null, "", ""), null, null, "..."); - match = $.$get$_vmFrame().firstMatch$1(t1); - if (match == null) - return new N.UnparsedFrame(P.Uri_Uri(null, null, "unparsed", null, null, null, null, "", ""), null, null, false, "unparsed", null, "unparsed", t1); - t1 = match._match; - if (1 >= t1.length) - return H.ioore(t1, 1); - t2 = J.replaceAll$2$s(t1[1], $.$get$_asyncBody(), "<async>"); - H.checkString("<fn>"); - member = H.stringReplaceAllUnchecked(t2, "<anonymous closure>", "<fn>"); - if (2 >= t1.length) - return H.ioore(t1, 2); - uri = P.Uri_parse(t1[2], 0, null); - if (3 >= t1.length) - return H.ioore(t1, 3); - lineAndColumn = J.split$1$s(t1[3], ":"); - line = lineAndColumn.length > 1 ? H.Primitives_parseInt(lineAndColumn[1], null, null) : null; - return new A.Frame(uri, line, lineAndColumn.length > 2 ? H.Primitives_parseInt(lineAndColumn[2], null, null) : null, member); + _StructuredClone_walk_closure: { + "^": "Closure:3;_box_0,$this", + call$2: function(key, value) { + this._box_0.copy[key] = this.$this.walk$1(value); } }, - closure4: { - "^": "Closure:1;frame", - call$0: function() { - var t1, match, t2, t3, t4; - t1 = this.frame; - match = $.$get$_v8Frame().firstMatch$1(t1); - if (match == null) - return new N.UnparsedFrame(P.Uri_Uri(null, null, "unparsed", null, null, null, null, "", ""), null, null, false, "unparsed", null, "unparsed", t1); - t1 = new A._parseLocation(t1); - t2 = match._match; - t3 = t2.length; - if (2 >= t3) - return H.ioore(t2, 2); - t4 = t2[2]; - if (t4 != null) { - t2 = J.replaceAll$2$s(t2[1], "<anonymous>", "<fn>"); - H.checkString("<fn>"); - return t1.call$2(t4, H.stringReplaceAllUnchecked(t2, "Anonymous function", "<fn>")); - } else { - if (3 >= t3) - return H.ioore(t2, 3); - return t1.call$2(t2[3], "<fn>"); + _AcceptStructuredClone: { + "^": "Object;", + findSlot$1: function(value) { + var t1, $length, i, t2; + t1 = this.values; + $length = t1.length; + for (i = 0; i < $length; ++i) { + t2 = t1[i]; + if (t2 == null ? value == null : t2 === value) + return i; } - } - }, - _parseLocation: { - "^": "Closure:3;frame", - call$2: function($location, member) { - var t1, evalMatch, t2, urlMatch, t3; - t1 = $.$get$_v8EvalLocation(); - evalMatch = t1.firstMatch$1($location); - for (; evalMatch != null;) { - t2 = evalMatch._match; - if (1 >= t2.length) - return H.ioore(t2, 1); - $location = t2[1]; - evalMatch = t1.firstMatch$1($location); + t1.push(value); + this.copies.push(null); + return $length; + }, + walk$1: function(e) { + var t1, millisSinceEpoch, proto, slot, t2, t3, copy, $length, i; + t1 = {}; + if (e == null) + return e; + if (typeof e === "boolean") + return e; + if (typeof e === "number") + return e; + if (typeof e === "string") + return e; + if (e instanceof Date) { + millisSinceEpoch = e.getTime(); + t1 = new P.DateTime(millisSinceEpoch, true); + t1.DateTime$_withValue$2$isUtc(millisSinceEpoch, true); + return t1; } - if (J.$eq$($location, "native")) - return new A.Frame(P.Uri_parse("native", 0, null), null, null, member); - urlMatch = $.$get$_v8UrlLocation().firstMatch$1($location); - if (urlMatch == null) - return new N.UnparsedFrame(P.Uri_Uri(null, null, "unparsed", null, null, null, null, "", ""), null, null, false, "unparsed", null, "unparsed", this.frame); - t1 = urlMatch._match; - if (1 >= t1.length) - return H.ioore(t1, 1); - t2 = A.Frame__uriOrPathToUri(t1[1]); - if (2 >= t1.length) - return H.ioore(t1, 2); - t3 = H.Primitives_parseInt(t1[2], null, null); - if (3 >= t1.length) - return H.ioore(t1, 3); - return new A.Frame(t2, t3, H.Primitives_parseInt(t1[3], null, null), member); - } - }, - closure3: { - "^": "Closure:1;frame", - call$0: function() { - var t1, match, uri, t2, t3, member, line, column; - t1 = this.frame; - match = $.$get$_firefoxSafariFrame().firstMatch$1(t1); - if (match == null) - return new N.UnparsedFrame(P.Uri_Uri(null, null, "unparsed", null, null, null, null, "", ""), null, null, false, "unparsed", null, "unparsed", t1); - t1 = match._match; - if (3 >= t1.length) - return H.ioore(t1, 3); - uri = A.Frame__uriOrPathToUri(t1[3]); - t2 = t1.length; - if (1 >= t2) - return H.ioore(t1, 1); - t3 = t1[1]; - if (t3 != null) { - if (2 >= t2) - return H.ioore(t1, 2); - t2 = C.JSString_methods.allMatches$1("/", t1[2]); - member = J.$add$ns(t3, C.JSArray_methods.join$0(P.List_List$filled(t2.get$length(t2), ".<fn>", false, null))); - if (J.$eq$(member, "")) - member = "<fn>"; - member = J.replaceFirst$2$s(member, $.$get$_initialDot(), ""); - } else - member = "<fn>"; - if (4 >= t1.length) - return H.ioore(t1, 4); - if (J.$eq$(t1[4], "")) - line = null; - else { - if (4 >= t1.length) - return H.ioore(t1, 4); - line = H.Primitives_parseInt(t1[4], null, null); + if (e instanceof RegExp) + throw H.wrapException(new P.UnimplementedError("structured clone of RegExp")); + if (typeof Promise != "undefined" && e instanceof Promise) + return P.convertNativePromiseToDartFuture(e); + proto = Object.getPrototypeOf(e); + if (proto === Object.prototype || proto === null) { + slot = this.findSlot$1(e); + t2 = this.copies; + t3 = t2.length; + if (slot >= t3) + return H.ioore(t2, slot); + copy = t2[slot]; + t1.copy = copy; + if (copy != null) + return copy; + copy = P.LinkedHashMap__makeEmpty(); + t1.copy = copy; + if (slot >= t3) + return H.ioore(t2, slot); + t2[slot] = copy; + this.forEachJsField$2(e, new P._AcceptStructuredClone_walk_closure(t1, this)); + return t1.copy; } - if (5 >= t1.length) - return H.ioore(t1, 5); - t2 = t1[5]; - if (t2 == null || J.$eq$(t2, "")) - column = null; - else { - if (5 >= t1.length) - return H.ioore(t1, 5); - column = H.Primitives_parseInt(t1[5], null, null); + if (e instanceof Array) { + slot = this.findSlot$1(e); + t1 = this.copies; + if (slot >= t1.length) + return H.ioore(t1, slot); + copy = t1[slot]; + if (copy != null) + return copy; + t2 = J.getInterceptor$asx(e); + $length = t2.get$length(e); + copy = this.mustCopy ? new Array($length) : e; + if (slot >= t1.length) + return H.ioore(t1, slot); + t1[slot] = copy; + if (typeof $length !== "number") + return H.iae($length); + t1 = J.getInterceptor$ax(copy); + i = 0; + for (; i < $length; ++i) + t1.$indexSet(copy, i, this.walk$1(t2.$index(e, i))); + return copy; } - return new A.Frame(uri, line, column, member); + return e; } }, - closure1: { - "^": "Closure:1;frame", - call$0: function() { - var t1, match, uri, t2, line, column; - t1 = this.frame; - match = $.$get$_friendlyFrame().firstMatch$1(t1); - if (match == null) - throw H.wrapException(new P.FormatException("Couldn't parse package:stack_trace stack trace line '" + H.S(t1) + "'.", null, null)); - t1 = match._match; - if (1 >= t1.length) - return H.ioore(t1, 1); - uri = P.Uri_parse(t1[1], 0, null); - if (uri.scheme === "") { - t2 = $.$get$context0(); - uri = t2.toUri$1(t2.absolute$7(0, t2.fromUri$1(uri), null, null, null, null, null, null)); + _AcceptStructuredClone_walk_closure: { + "^": "Closure:3;_box_0,$this", + call$2: function(key, value) { + var t1, t2; + t1 = this._box_0.copy; + t2 = this.$this.walk$1(value); + J.$indexSet$ax(t1, key, t2); + return t2; + } + }, + _StructuredCloneDart2Js: { + "^": "_StructuredClone;values,copies" + }, + _AcceptStructuredCloneDart2Js: { + "^": "_AcceptStructuredClone;values,copies,mustCopy", + forEachJsField$2: function(object, action) { + var t1, t2, _i, key; + for (t1 = Object.keys(object), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) { + key = t1[_i]; + action.call$2(key, object[key]); } - if (2 >= t1.length) - return H.ioore(t1, 2); - t2 = t1[2]; - line = t2 == null ? null : H.Primitives_parseInt(t2, null, null); - if (3 >= t1.length) - return H.ioore(t1, 3); - t2 = t1[3]; - column = t2 == null ? null : H.Primitives_parseInt(t2, null, null); - if (4 >= t1.length) - return H.ioore(t1, 4); - return new A.Frame(uri, line, column, t1[4]); + } + }, + convertNativePromiseToDartFuture_closure: { + "^": "Closure:0;completer", + call$1: function(result) { + return this.completer.complete$1(0, result); + } + }, + convertNativePromiseToDartFuture_closure0: { + "^": "Closure:0;completer", + call$1: function(result) { + return this.completer.completeError$1(result); } } - }], ["", "package:stream_channel/src/guarantee_channel.dart",, K, { + }], ["dart.dom.indexed_db", "dart:indexed_db",, P, { + "^": "" + }], ["dart.math", "dart:math",, P, { "^": "", - GuaranteeChannel: { - "^": "StreamChannelMixin;_sink,_streamController,_guarantee_channel$_subscription,_disconnected", - _onSinkDisconnected$0: function() { - this._disconnected = true; - var t1 = this._guarantee_channel$_subscription; - if (t1 != null) - t1.cancel$0(); - this._streamController.close$0(0); - }, - GuaranteeChannel$3$allowSinkErrors: function(innerSink, allowSinkErrors, _box_0, $T) { - this._sink = H.setRuntimeTypeInfo(new K._GuaranteeSink(innerSink, this, H.setRuntimeTypeInfo(new P._AsyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]), false, false, null, null, true), [$T]); - this._streamController = P.StreamController_StreamController(null, new K.GuaranteeChannel_closure(_box_0, this), null, null, true, $T); - }, - static: { - GuaranteeChannel$: function(innerStream, innerSink, allowSinkErrors, $T) { - var t1, t2; - t1 = {}; - t1.innerStream = innerStream; - t2 = H.setRuntimeTypeInfo(new K.GuaranteeChannel(null, null, null, false), [$T]); - t2.GuaranteeChannel$3$allowSinkErrors(innerSink, true, t1, $T); - return t2; - } + max: [function(a, b) { + var t1; + if (typeof a !== "number") + throw H.wrapException(P.ArgumentError$(a)); + if (typeof b !== "number") + throw H.wrapException(P.ArgumentError$(b)); + if (a > b) + return a; + if (a < b) + return b; + if (typeof b === "number") { + if (typeof a === "number") + if (a === 0) + return a + b; + if (isNaN(b)) + return b; + return a; } + if (b === 0) + t1 = a === 0 ? 1 / a < 0 : a < 0; + else + t1 = false; + if (t1) + return b; + return a; + }, "call$2", "math__max$closure", 4, 0, 42] + }], ["dart.dom.svg", "dart:svg",, P, { + "^": "", + AElement: { + "^": "GraphicsElement;", + $isInterceptor: 1, + "%": "SVGAElement" }, - GuaranteeChannel_closure: { - "^": "Closure:1;_box_0,$this", - call$0: function() { - var t1, t2, t3; - t1 = this.$this; - if (t1._disconnected) - return; - t2 = this._box_0.innerStream; - t3 = t1._streamController; - t1._guarantee_channel$_subscription = t2.listen$3$onDone$onError(t3.get$add(t3), new K.GuaranteeChannel__closure(t1), t1._streamController.get$addError()); - } + AnimationElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGAnimateElement|SVGAnimateMotionElement|SVGAnimateTransformElement|SVGAnimationElement|SVGSetElement" }, - GuaranteeChannel__closure: { - "^": "Closure:1;$this", - call$0: [function() { - var t1 = this.$this; - t1._sink._onStreamDisconnected$0(); - t1._streamController.close$0(0); - }, null, null, 0, 0, null, "call"] + FEBlendElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEBlendElement" }, - _GuaranteeSink: { - "^": "Object;_inner,_channel,_doneCompleter,_disconnected,_closed,_addStreamSubscription,_addStreamCompleter,_allowErrors", - add$1: function(_, data) { - var t1; - if (this._closed) - throw H.wrapException(new P.StateError("Cannot add event after closing.")); - if (this._addStreamSubscription != null) - throw H.wrapException(new P.StateError("Cannot add event while adding stream.")); - if (this._disconnected) - return; - t1 = this._inner._async$_target; - if (t1._state >= 4) - H.throwExpression(t1._badEventState$0()); - t1._async$_add$1(data); - }, - addError$2: [function(error, stackTrace) { - if (this._closed) - throw H.wrapException(new P.StateError("Cannot add event after closing.")); - if (this._addStreamSubscription != null) - throw H.wrapException(new P.StateError("Cannot add event while adding stream.")); - if (this._disconnected) - return; - this._guarantee_channel$_addError$2(error, stackTrace); - }, function(error) { - return this.addError$2(error, null); - }, "addError$1", "call$2", "call$1", "get$addError", 2, 2, 6, 5, 3, 4], - _guarantee_channel$_addError$2: [function(error, stackTrace) { - this._inner._async$_target.addError$2(error, stackTrace); - return; - }, function(error) { - return this._guarantee_channel$_addError$2(error, null); - }, "_guarantee_channel$_addError$1", "call$2", "call$1", "get$_guarantee_channel$_addError", 2, 2, 6, 5, 3, 4], - addStream$1: function(stream) { - var t1, t2, t3; - if (this._closed) - throw H.wrapException(new P.StateError("Cannot add stream after closing.")); - if (this._addStreamSubscription != null) - throw H.wrapException(new P.StateError("Cannot add stream while adding stream.")); - if (this._disconnected) { - t1 = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); - t1._asyncComplete$1(null); - return t1; - } - this._addStreamCompleter = H.setRuntimeTypeInfo(new P._SyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]); - t1 = this._inner; - t1 = t1.get$add(t1); - t2 = this.get$_guarantee_channel$_addError(); - t3 = this._addStreamCompleter; - this._addStreamSubscription = stream.listen$3$onDone$onError(t1, t3.get$complete(t3), t2); - return this._addStreamCompleter.future.then$1(new K._GuaranteeSink_addStream_closure(this)); - }, - close$0: function(_) { - if (this._addStreamSubscription != null) - throw H.wrapException(new P.StateError("Cannot close sink while adding stream.")); - if (this._closed) - return this._doneCompleter.future; - this._closed = true; - if (!this._disconnected) { - this._channel._onSinkDisconnected$0(); - this._doneCompleter.complete$1(0, this._inner._async$_target.close$0(0)); - } - return this._doneCompleter.future; + FEColorMatrixElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEColorMatrixElement" + }, + FEComponentTransferElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEComponentTransferElement" + }, + FECompositeElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFECompositeElement" + }, + FEConvolveMatrixElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEConvolveMatrixElement" + }, + FEDiffuseLightingElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEDiffuseLightingElement" + }, + FEDisplacementMapElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEDisplacementMapElement" + }, + FEFloodElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEFloodElement" + }, + FEGaussianBlurElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEGaussianBlurElement" + }, + FEImageElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEImageElement" + }, + FEMergeElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEMergeElement" + }, + FEMorphologyElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEMorphologyElement" + }, + FEOffsetElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEOffsetElement" + }, + FESpecularLightingElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFESpecularLightingElement" + }, + FETileElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFETileElement" + }, + FETurbulenceElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFETurbulenceElement" + }, + FilterElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFilterElement" + }, + GraphicsElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGCircleElement|SVGClipPathElement|SVGDefsElement|SVGEllipseElement|SVGForeignObjectElement|SVGGElement|SVGGeometryElement|SVGLineElement|SVGPathElement|SVGPolygonElement|SVGPolylineElement|SVGRectElement|SVGSwitchElement;SVGGraphicsElement" + }, + ImageElement0: { + "^": "GraphicsElement;", + $isInterceptor: 1, + "%": "SVGImageElement" + }, + MarkerElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGMarkerElement" + }, + MaskElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGMaskElement" + }, + PatternElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGPatternElement" + }, + ScriptElement0: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGScriptElement" + }, + SvgElement: { + "^": "Element;", + get$onClick: function(receiver) { + return H.setRuntimeTypeInfo(new W._ElementEventStreamImpl(receiver, "click", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_click, 0)]); }, - _onStreamDisconnected$0: function() { - this._disconnected = true; - var t1 = this._doneCompleter; - if (t1.future._state === 0) - t1.complete$0(0); - t1 = this._addStreamSubscription; - if (t1 == null) - return; - this._addStreamCompleter.complete$1(0, t1.cancel$0()); - this._addStreamCompleter = null; - this._addStreamSubscription = null; - } + $isInterceptor: 1, + "%": "SVGComponentTransferFunctionElement|SVGDescElement|SVGDiscardElement|SVGFEDistantLightElement|SVGFEFuncAElement|SVGFEFuncBElement|SVGFEFuncGElement|SVGFEFuncRElement|SVGFEMergeNodeElement|SVGFEPointLightElement|SVGFESpotLightElement|SVGMetadataElement|SVGStopElement|SVGStyleElement|SVGTitleElement;SVGElement" }, - _GuaranteeSink_addStream_closure: { - "^": "Closure:0;$this", - call$1: [function(_) { - var t1 = this.$this; - t1._addStreamCompleter = null; - t1._addStreamSubscription = null; - }, null, null, 2, 0, null, 6, "call"] - } - }], ["", "host.dart",, M, { - "^": "", - main: [function() { - var testRunner = J.$index$asx($.$get$context(), "testRunner"); - if (testRunner != null) - testRunner.callMethod$2("waitUntilDone", []); - P.runZoned(new M.main_closure(), new M.main_closure0(), null, null); - }, "call$0", "host__main$closure", 0, 0, 2], - _connectToServer: function() { - var currentUrl, t1, webSocket, controller; - currentUrl = P.Uri_parse(window.location.href, 0, null); - t1 = currentUrl._queryParameters; - if (t1 == null) { - t1 = currentUrl._query; - t1 = H.setRuntimeTypeInfo(new P.UnmodifiableMapView(P.Uri_splitQueryString(t1 == null ? "" : t1, C.Utf8Codec_false)), [P.String, P.String]); - currentUrl._queryParameters = t1; - } - webSocket = W.WebSocket_WebSocket(J.$index$asx(t1._map, "managerUrl"), null); - controller = B.StreamChannelController$(true, true, null); - t1 = H.setRuntimeTypeInfo(new W._EventStream(webSocket, "message", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_message, 0)]); - H.setRuntimeTypeInfo(new W._EventStreamSubscription(0, t1._target, t1._eventType, W._wrapZone(new M._connectToServer_closure(controller)), false), [H.getTypeArgumentByIndex(t1, 0)])._tryResume$0(); - t1 = controller._local._streamController; - t1.toString; - H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).listen$1(new M._connectToServer_closure0(webSocket)); - return D._MultiChannel$(controller._foreign); + SvgSvgElement: { + "^": "GraphicsElement;", + $isInterceptor: 1, + "%": "SVGSVGElement" }, - _connectToIframe: function(url, id) { - var t1, iframe, controller, readyCompleter; - t1 = document; - iframe = t1.createElement("iframe"); - $.$get$_iframes().$indexSet(0, id, iframe); - J.set$src$x(iframe, url); - document.body.appendChild(iframe); - controller = B.StreamChannelController$(true, true, null); - readyCompleter = H.setRuntimeTypeInfo(new P._AsyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]); - t1 = H.setRuntimeTypeInfo(new W._EventStream(window, "message", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_message, 0)]); - H.setRuntimeTypeInfo(new W._EventStreamSubscription(0, t1._target, t1._eventType, W._wrapZone(new M._connectToIframe_closure(iframe, controller, readyCompleter)), false), [H.getTypeArgumentByIndex(t1, 0)])._tryResume$0(); - t1 = controller._local._streamController; - t1.toString; - H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).listen$1(new M._connectToIframe_closure0(iframe, readyCompleter)); - return controller._foreign; + SymbolElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGSymbolElement" }, - main_closure: { - "^": "Closure:1;", - call$0: [function() { - var serverChannel, t1; - serverChannel = M._connectToServer(); - t1 = serverChannel._mainController._foreign._streamController; - t1.toString; - H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).listen$1(new M.main__closure(serverChannel)); - P.Timer_Timer$periodic(P.Duration$(0, 0, 0, 0, 0, 1), new M.main__closure0(serverChannel)); - t1 = J.get$onClick$x(document.querySelector("#play")); - H.setRuntimeTypeInfo(new W._EventStreamSubscription(0, t1._target, t1._eventType, W._wrapZone(new M.main__closure1(serverChannel)), false), [H.getTypeArgumentByIndex(t1, 0)])._tryResume$0(); - }, null, null, 0, 0, null, "call"] + TextContentElement: { + "^": "GraphicsElement;", + "%": "SVGTSpanElement|SVGTextElement|SVGTextPositioningElement;SVGTextContentElement" }, - main__closure: { - "^": "Closure:0;serverChannel", - call$1: [function(message) { - var t1, suiteChannel, iframeChannel; - t1 = J.getInterceptor$asx(message); - if (J.$eq$(t1.$index(message, "command"), "loadSuite")) { - suiteChannel = this.serverChannel.virtualChannel$1(t1.$index(message, "channel")); - iframeChannel = M._connectToIframe(t1.$index(message, "url"), t1.$index(message, "id")); - suiteChannel.stream.pipe$1(iframeChannel._sink); - t1 = iframeChannel._streamController; - t1.toString; - H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).pipe$1(suiteChannel.sink); - } else if (J.$eq$(t1.$index(message, "command"), "displayPause")) { - t1 = document.body; - t1.toString; - W._ElementCssClassSet__add(t1, "paused"); - } else if (J.$eq$(t1.$index(message, "command"), "resume")) { - t1 = document.body; - t1.toString; - W._ElementCssClassSet__remove(t1, "paused"); - } else - J.remove$0$ax($.$get$_iframes().$index(0, t1.$index(message, "id"))); - }, null, null, 2, 0, null, 8, "call"] + TextPathElement: { + "^": "TextContentElement;", + $isInterceptor: 1, + "%": "SVGTextPathElement" }, - main__closure0: { - "^": "Closure:0;serverChannel", - call$1: [function(_) { - return this.serverChannel._mainController._foreign._sink.add$1(0, P.LinkedHashMap__makeLiteral(["command", "ping"])); - }, null, null, 2, 0, null, 6, "call"] + UseElement: { + "^": "GraphicsElement;", + $isInterceptor: 1, + "%": "SVGUseElement" }, - main__closure1: { - "^": "Closure:0;serverChannel", - call$1: [function(_) { - var t1 = document.body; - t1.toString; - W._ElementCssClassSet__remove(t1, "paused"); - this.serverChannel._mainController._foreign._sink.add$1(0, P.LinkedHashMap__makeLiteral(["command", "resume"])); - }, null, null, 2, 0, null, 6, "call"] + ViewElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGViewElement" }, - main_closure0: { - "^": "Closure:3;", - call$2: [function(error, stackTrace) { - P.print(H.S(error) + "\n" + H.S(Y.Trace_Trace$from(stackTrace).get$terse())); - }, null, null, 4, 0, null, 3, 4, "call"] + _GradientElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGGradientElement|SVGLinearGradientElement|SVGRadialGradientElement" }, - _connectToServer_closure: { - "^": "Closure:0;controller", - call$1: [function(message) { - this.controller._local._sink.add$1(0, C.JsonCodec_null_null.decode$1(J.get$data$x(message))); - }, null, null, 2, 0, null, 8, "call"] + _SVGCursorElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGCursorElement" }, - _connectToServer_closure0: { - "^": "Closure:0;webSocket", - call$1: [function(message) { - return this.webSocket.send(C.JsonCodec_null_null.encode$1(message)); - }, null, null, 2, 0, null, 8, "call"] + _SVGFEDropShadowElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGFEDropShadowElement" }, - _connectToIframe_closure: { - "^": "Closure:0;iframe,controller,readyCompleter", - call$1: [function(message) { - var t1, t2, t3; - t1 = J.getInterceptor$x(message); - t2 = t1.get$origin(message); - t3 = window.location; - if (t2 !== (t3 && C.Location_methods).get$origin(t3)) - return; - if (!J.$eq$(J.$index$asx(t1.get$data(message), "href"), J.get$src$x(this.iframe))) - return; - t1.stopPropagation$0(message); - if (J.$eq$(J.$index$asx(t1.get$data(message), "ready"), true)) - this.readyCompleter.complete$0(0); - else - this.controller._local._sink.add$1(0, J.$index$asx(t1.get$data(message), "data")); - }, null, null, 2, 0, null, 8, "call"] + _SVGMPathElement: { + "^": "SvgElement;", + $isInterceptor: 1, + "%": "SVGMPathElement" + } + }], ["dart.typed_data", "dart:typed_data",, P, { + "^": "", + Uint8List: { + "^": "Object;", + $isList: 1, + $asList: function() { + return [P.$int]; + }, + $isEfficientLength: 1 + } + }], ["dart.dom.web_audio", "dart:web_audio",, P, { + "^": "" + }], ["dart.dom.web_gl", "dart:web_gl",, P, { + "^": "" + }], ["dart.dom.web_sql", "dart:web_sql",, P, { + "^": "", + SqlError: { + "^": "Interceptor;message=", + "%": "SQLError" + } + }], ["", "package:async/src/null_stream_sink.dart",, S, { + "^": "", + NullStreamSink: { + "^": "Object;done,_null_stream_sink$_closed,_addingStream", + addStream$1: function(stream) { + var future; + this._checkEventAllowed$0(); + this._addingStream = true; + future = stream.listen$1(null).cancel$0(); + if (future == null) { + future = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); + future._asyncComplete$1(null); + } + return future.whenComplete$1(new S.NullStreamSink_addStream_closure(this)); + }, + _checkEventAllowed$0: function() { + if (this._null_stream_sink$_closed) + throw H.wrapException(new P.StateError("Cannot add to a closed sink.")); + if (this._addingStream) + throw H.wrapException(new P.StateError("Cannot add to a sink while adding a stream.")); + }, + close$0: function(_) { + this._null_stream_sink$_closed = true; + return this.done; + } }, - _connectToIframe_closure0: { - "^": "Closure:50;iframe,readyCompleter", - call$1: [function(message) { - var $async$goto = 0, $async$completer = new P.Completer_Completer$sync(), $async$handler = 1, $async$currentError, $async$self = this, t1, t2; - var $async$call$1 = P._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { - if ($async$errorCode === 1) { - $async$currentError = $async$result; - $async$goto = $async$handler; - } - while (true) - switch ($async$goto) { - case 0: - // Function start - $async$goto = 2; - return P._asyncHelper($async$self.readyCompleter.future, $async$call$1, $async$completer); - case 2: - // returning from await. - t1 = J.get$contentWindow$x($async$self.iframe); - t2 = window.location; - J.postMessage$2$x(t1, message, (t2 && C.Location_methods).get$origin(t2)); - // implicit return - return P._asyncHelper(null, 0, $async$completer, null); - case 1: - // rethrow - return P._asyncHelper($async$currentError, 1, $async$completer); - } - }); - return P._asyncHelper(null, $async$call$1, $async$completer, null); - }, null, null, 2, 0, null, 8, "call"] + NullStreamSink_addStream_closure: { + "^": "Closure:1;$this", + call$0: function() { + this.$this._addingStream = false; + } + } + }], ["path", "package:path/path.dart",, B, { + "^": "", + current: function() { + var uri, t1, t2, path; + uri = P.Uri_base(); + if (J.$eq$(uri, $._currentUriBase)) + return $._current; + $._currentUriBase = uri; + t1 = $.$get$Style_platform(); + t2 = $.$get$Style_url(); + if (t1 == null ? t2 == null : t1 === t2) { + t1 = uri.resolve$1(".").toString$0(0); + $._current = t1; + return t1; + } else { + path = uri.toFilePath$0(); + t1 = C.JSString_methods.substring$2(path, 0, path.length - 1); + $._current = t1; + return t1; + } } - }, 1], ["html_common", "dart:html_common",, P, { + }], ["path.context", "package:path/src/context.dart",, F, { "^": "", - convertNativePromiseToDartFuture: function(promise) { - var completer = H.setRuntimeTypeInfo(new P._AsyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]); - promise.then(H.convertDartClosureToJS(new P.convertNativePromiseToDartFuture_closure(completer), 1))["catch"](H.convertDartClosureToJS(new P.convertNativePromiseToDartFuture_closure0(completer), 1)); - return completer.future; + _validateArgList: function(method, args) { + var numArgs, i, numArgs0, message, t1, t2, t3, t4, t5; + for (numArgs = args.length, i = 1; i < numArgs; ++i) { + if (args[i] == null || args[i - 1] != null) + continue; + for (; numArgs >= 1; numArgs = numArgs0) { + numArgs0 = numArgs - 1; + if (args[numArgs0] != null) + break; + } + message = new P.StringBuffer(""); + t1 = method + "("; + message._contents = t1; + t2 = H.setRuntimeTypeInfo(new H.SubListIterable(args, 0, numArgs), [H.getTypeArgumentByIndex(args, 0)]); + t3 = t2.__internal$_start; + t4 = J.getInterceptor$n(t3); + if (t4.$lt(t3, 0)) + H.throwExpression(P.RangeError$range(t3, 0, null, "start", null)); + t5 = t2._endOrLength; + if (t5 != null) { + if (J.$lt$n(t5, 0)) + H.throwExpression(P.RangeError$range(t5, 0, null, "end", null)); + if (t4.$gt(t3, t5)) + H.throwExpression(P.RangeError$range(t3, 0, t5, "start", null)); + } + t1 += H.setRuntimeTypeInfo(new H.MappedListIterable(t2, new F._validateArgList_closure()), [H.getRuntimeTypeArgument(t2, "ListIterable", 0), null]).join$1(0, ", "); + message._contents = t1; + message._contents = t1 + ("): part " + (i - 1) + " was null, but part " + i + " was not."); + throw H.wrapException(P.ArgumentError$(message.toString$0(0))); + } }, - _StructuredClone: { - "^": "Object;", - findSlot$1: function(value) { - var t1, $length, i; - t1 = this.values; - $length = t1.length; - for (i = 0; i < $length; ++i) - if (t1[i] === value) - return i; - t1.push(value); - this.copies.push(null); - return $length; + Context: { + "^": "Object;style,_context$_current", + absolute$7: function(_, part1, part2, part3, part4, part5, part6, part7) { + var t1; + F._validateArgList("absolute", [part1, part2, part3, part4, part5, part6, part7]); + t1 = this.style; + t1 = t1.rootLength$1(part1) > 0 && !t1.isRootRelative$1(part1); + if (t1) + return part1; + t1 = this._context$_current; + return this.join$8(0, t1 != null ? t1 : B.current(), part1, part2, part3, part4, part5, part6, part7); }, - walk$1: function(e) { - var t1, t2, slot, t3, t4, copy; - t1 = {}; - if (e == null) - return e; - if (typeof e === "boolean") - return e; - if (typeof e === "number") - return e; - if (typeof e === "string") - return e; - t2 = J.getInterceptor(e); - if (!!t2.$isDateTime) - return new Date(e._core$_value); - if (!!t2.$isRegExp) - throw H.wrapException(new P.UnimplementedError("structured clone of RegExp")); - if (!!t2.$isFile) - return e; - if (!!t2.$isBlob) - return e; - if (!!t2.$isImageData) - return e; - if (!!t2.$isNativeByteBuffer || !!t2.$isNativeTypedData) - return e; - if (!!t2.$isMap) { - slot = this.findSlot$1(e); - t3 = this.copies; - t4 = t3.length; - if (slot >= t4) - return H.ioore(t3, slot); - copy = t3[slot]; - t1.copy = copy; - if (copy != null) - return copy; - copy = {}; - t1.copy = copy; - if (slot >= t4) - return H.ioore(t3, slot); - t3[slot] = copy; - t2.forEach$1(e, new P._StructuredClone_walk_closure(t1, this)); - return t1.copy; + absolute$1: function($receiver, part1) { + return this.absolute$7($receiver, part1, null, null, null, null, null, null); + }, + join$8: function(_, part1, part2, part3, part4, part5, part6, part7, part8) { + var parts = H.setRuntimeTypeInfo([part1, part2, part3, part4, part5, part6, part7, part8], [P.String]); + F._validateArgList("join", parts); + return this.joinAll$1(H.setRuntimeTypeInfo(new H.WhereIterable(parts, new F.Context_join_closure()), [H.getTypeArgumentByIndex(parts, 0)])); + }, + join$2: function($receiver, part1, part2) { + return this.join$8($receiver, part1, part2, null, null, null, null, null, null); + }, + joinAll$1: function(parts) { + var buffer, t1, t2, t3, needsSeparator, isAbsoluteAndNotRootRelative, part, parsed, t4, t5; + buffer = new P.StringBuffer(""); + for (t1 = H.setRuntimeTypeInfo(new H.WhereIterable(parts, new F.Context_joinAll_closure()), [H.getRuntimeTypeArgument(parts, "Iterable", 0)]), t1 = H.setRuntimeTypeInfo(new H.WhereIterator(J.get$iterator$ax(t1._iterable), t1._f), [H.getTypeArgumentByIndex(t1, 0)]), t2 = this.style, t3 = t1._iterator, needsSeparator = false, isAbsoluteAndNotRootRelative = false; t1.moveNext$0();) { + part = t3.get$current(); + if (t2.isRootRelative$1(part) && isAbsoluteAndNotRootRelative) { + parsed = Q.ParsedPath_ParsedPath$parse(part, t2); + t4 = buffer._contents; + t4 = t4.charCodeAt(0) == 0 ? t4 : t4; + t4 = C.JSString_methods.substring$2(t4, 0, t2.rootLength$1(t4)); + parsed.root = t4; + if (t2.needsSeparator$1(t4)) { + t4 = parsed.separators; + t5 = t2.get$separator(); + if (0 >= t4.length) + return H.ioore(t4, 0); + t4[0] = t5; + } + buffer._contents = ""; + buffer._contents += parsed.toString$0(0); + } else if (t2.rootLength$1(part) > 0) { + isAbsoluteAndNotRootRelative = !t2.isRootRelative$1(part); + buffer._contents = ""; + buffer._contents += H.S(part); + } else { + t4 = J.getInterceptor$asx(part); + if (!(J.$gt$n(t4.get$length(part), 0) && t2.containsSeparator$1(t4.$index(part, 0)) === true)) + if (needsSeparator) + buffer._contents += t2.get$separator(); + buffer._contents += H.S(part); + } + needsSeparator = t2.needsSeparator$1(part); } - if (!!t2.$isList) { - slot = this.findSlot$1(e); - t1 = this.copies; - if (slot >= t1.length) - return H.ioore(t1, slot); - copy = t1[slot]; - if (copy != null) - return copy; - return this.copyList$2(e, slot); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + split$1: function(_, path) { + var parsed, t1, t2; + parsed = Q.ParsedPath_ParsedPath$parse(path, this.style); + t1 = parsed.parts; + t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new F.Context_split_closure()), [H.getTypeArgumentByIndex(t1, 0)]); + t1 = P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "Iterable", 0)); + parsed.parts = t1; + t2 = parsed.root; + if (t2 != null) + C.JSArray_methods.insert$2(t1, 0, t2); + return parsed.parts; + }, + normalize$1: function(path) { + var parsed; + if (!this._needsNormalization$1(path)) + return path; + parsed = Q.ParsedPath_ParsedPath$parse(path, this.style); + parsed.normalize$0(); + return parsed.toString$0(0); + }, + _needsNormalization$1: function(path) { + var codeUnits, t1, root, t2, i, start, previous, t3, previousPrevious, codeUnit, t4; + codeUnits = J.get$codeUnits$s(path); + t1 = this.style; + root = t1.rootLength$1(path); + if (root !== 0) { + if (t1 === $.$get$Style_windows()) + for (t2 = codeUnits.__internal$_string, i = 0; i < root; ++i) + if (C.JSString_methods.codeUnitAt$1(t2, i) === 47) + return true; + start = root; + previous = 47; + } else { + start = 0; + previous = null; + } + for (t2 = codeUnits.__internal$_string, t3 = t2.length, i = start, previousPrevious = null; i < t3; ++i, previousPrevious = previous, previous = codeUnit) { + codeUnit = C.JSString_methods.codeUnitAt$1(t2, i); + if (t1.isSeparator$1(codeUnit)) { + if (t1 === $.$get$Style_windows() && codeUnit === 47) + return true; + if (previous != null && t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t4 = previousPrevious == null || previousPrevious === 46 || t1.isSeparator$1(previousPrevious); + else + t4 = false; + if (t4) + return true; + } + } + if (previous == null) + return true; + if (t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t1 = previousPrevious == null || previousPrevious === 47 || previousPrevious === 46; + else + t1 = false; + if (t1) + return true; + return false; + }, + relative$2$from: function(path, from) { + var t1, fromParsed, pathParsed, t2, t3; + if (this.style.rootLength$1(path) <= 0) + return this.normalize$1(path); + t1 = this._context$_current; + from = t1 != null ? t1 : B.current(); + t1 = this.style; + if (t1.rootLength$1(from) <= 0 && t1.rootLength$1(path) > 0) + return this.normalize$1(path); + if (t1.rootLength$1(path) <= 0 || t1.isRootRelative$1(path)) + path = this.absolute$1(0, path); + if (t1.rootLength$1(path) <= 0 && t1.rootLength$1(from) > 0) + throw H.wrapException(new E.PathException('Unable to find a path to "' + H.S(path) + '" from "' + H.S(from) + '".')); + fromParsed = Q.ParsedPath_ParsedPath$parse(from, t1); + fromParsed.normalize$0(); + pathParsed = Q.ParsedPath_ParsedPath$parse(path, t1); + pathParsed.normalize$0(); + t2 = fromParsed.parts; + if (t2.length > 0 && J.$eq$(t2[0], ".")) + return pathParsed.toString$0(0); + if (!J.$eq$(fromParsed.root, pathParsed.root)) { + t2 = fromParsed.root; + if (!(t2 == null || pathParsed.root == null)) { + t2 = J.toLowerCase$0$s(t2); + H.checkString("\\"); + t2 = H.stringReplaceAllUnchecked(t2, "/", "\\"); + t3 = J.toLowerCase$0$s(pathParsed.root); + H.checkString("\\"); + t3 = t2 !== H.stringReplaceAllUnchecked(t3, "/", "\\"); + t2 = t3; + } else + t2 = true; + } else + t2 = false; + if (t2) + return pathParsed.toString$0(0); + while (true) { + t2 = fromParsed.parts; + if (t2.length > 0) { + t3 = pathParsed.parts; + t2 = t3.length > 0 && J.$eq$(t2[0], t3[0]); + } else + t2 = false; + if (!t2) + break; + C.JSArray_methods.removeAt$1(fromParsed.parts, 0); + C.JSArray_methods.removeAt$1(fromParsed.separators, 1); + C.JSArray_methods.removeAt$1(pathParsed.parts, 0); + C.JSArray_methods.removeAt$1(pathParsed.separators, 1); + } + t2 = fromParsed.parts; + if (t2.length > 0 && J.$eq$(t2[0], "..")) + throw H.wrapException(new E.PathException('Unable to find a path to "' + H.S(path) + '" from "' + H.S(from) + '".')); + C.JSArray_methods.insertAll$2(pathParsed.parts, 0, P.List_List$filled(fromParsed.parts.length, "..", false, null)); + t2 = pathParsed.separators; + if (0 >= t2.length) + return H.ioore(t2, 0); + t2[0] = ""; + C.JSArray_methods.insertAll$2(t2, 1, P.List_List$filled(fromParsed.parts.length, t1.get$separator(), false, null)); + t1 = pathParsed.parts; + t2 = t1.length; + if (t2 === 0) + return "."; + if (t2 > 1 && J.$eq$(C.JSArray_methods.get$last(t1), ".")) { + C.JSArray_methods.removeLast$0(pathParsed.parts); + t1 = pathParsed.separators; + C.JSArray_methods.removeLast$0(t1); + C.JSArray_methods.removeLast$0(t1); + C.JSArray_methods.add$1(t1, ""); } - throw H.wrapException(new P.UnimplementedError("structured clone of other type")); + pathParsed.root = ""; + pathParsed.removeTrailingSeparators$0(); + return pathParsed.toString$0(0); }, - copyList$2: function(e, slot) { - var t1, $length, copy, t2, i; - t1 = J.getInterceptor$asx(e); - $length = t1.get$length(e); - copy = new Array($length); - t2 = this.copies; - if (slot >= t2.length) - return H.ioore(t2, slot); - t2[slot] = copy; - for (i = 0; i < $length; ++i) { - t2 = this.walk$1(t1.$index(e, i)); - if (i >= copy.length) - return H.ioore(copy, i); - copy[i] = t2; + relative$1: function(path) { + return this.relative$2$from(path, null); + }, + fromUri$1: function(uri) { + return this.style.pathFromUri$1(uri); + }, + toUri$1: function(path) { + var t1, t2; + t1 = this.style; + if (t1.rootLength$1(path) <= 0) + return t1.relativePathToUri$1(path); + else { + t2 = this._context$_current; + return t1.absolutePathToUri$1(this.join$2(0, t2 != null ? t2 : B.current(), path)); + } + }, + prettyUri$1: function(uri) { + var t1, t2, path, rel; + if (uri.get$scheme() === "file") { + t1 = this.style; + t2 = $.$get$Style_url(); + t2 = t1 == null ? t2 == null : t1 === t2; + t1 = t2; + } else + t1 = false; + if (t1) + return uri.toString$0(0); + if (uri.get$scheme() !== "file") + if (uri.get$scheme() !== "") { + t1 = this.style; + t2 = $.$get$Style_url(); + t2 = t1 == null ? t2 != null : t1 !== t2; + t1 = t2; + } else + t1 = false; + else + t1 = false; + if (t1) + return uri.toString$0(0); + path = this.normalize$1(this.fromUri$1(uri)); + rel = this.relative$1(path); + return this.split$1(0, rel).length > this.split$1(0, path).length ? path : rel; + }, + static: { + Context_Context: function(current, style) { + current = style == null ? B.current() : "."; + if (style == null) + style = $.$get$Style_platform(); + return new F.Context(style, current); } - return copy; } }, - _StructuredClone_walk_closure: { - "^": "Closure:3;_box_0,$this", - call$2: [function(key, value) { - this._box_0.copy[key] = this.$this.walk$1(value); - }, null, null, 4, 0, null, 17, 7, "call"] + Context_join_closure: { + "^": "Closure:0;", + call$1: function(part) { + return part != null; + } }, - _AcceptStructuredClone: { - "^": "Object;", - findSlot$1: function(value) { - var t1, $length, i, t2; - t1 = this.values; - $length = t1.length; - for (i = 0; i < $length; ++i) { - t2 = t1[i]; - if (t2 == null ? value == null : t2 === value) - return i; + Context_joinAll_closure: { + "^": "Closure:0;", + call$1: function(part) { + return !J.$eq$(part, ""); + } + }, + Context_split_closure: { + "^": "Closure:0;", + call$1: function(part) { + return J.get$isEmpty$asx(part) !== true; + } + }, + _validateArgList_closure: { + "^": "Closure:0;", + call$1: function(arg) { + return arg == null ? "null" : '"' + H.S(arg) + '"'; + } + } + }], ["path.internal_style", "package:path/src/internal_style.dart",, E, { + "^": "", + InternalStyle: { + "^": "Style;", + getRoot$1: function(path) { + var $length = this.rootLength$1(path); + if ($length > 0) + return J.substring$2$s(path, 0, $length); + return this.isRootRelative$1(path) ? J.$index$asx(path, 0) : null; + }, + relativePathToUri$1: function(path) { + var segments, t1; + segments = F.Context_Context(null, this).split$1(0, path); + t1 = J.getInterceptor$asx(path); + if (this.isSeparator$1(t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)))) + C.JSArray_methods.add$1(segments, ""); + return P._Uri__Uri(null, null, null, segments, null, null, null, null, null); + } + } + }], ["path.parsed_path", "package:path/src/parsed_path.dart",, Q, { + "^": "", + ParsedPath: { + "^": "Object;style,root,isRootRelative,parts,separators", + get$hasTrailingSeparator: function() { + var t1 = this.parts; + if (t1.length !== 0) + t1 = J.$eq$(C.JSArray_methods.get$last(t1), "") || !J.$eq$(C.JSArray_methods.get$last(this.separators), ""); + else + t1 = false; + return t1; + }, + removeTrailingSeparators$0: function() { + var t1, t2; + while (true) { + t1 = this.parts; + if (!(t1.length !== 0 && J.$eq$(C.JSArray_methods.get$last(t1), ""))) + break; + C.JSArray_methods.removeLast$0(this.parts); + C.JSArray_methods.removeLast$0(this.separators); } - t1.push(value); - this.copies.push(null); - return $length; + t1 = this.separators; + t2 = t1.length; + if (t2 > 0) + t1[t2 - 1] = ""; }, - walk$1: function(e) { - var t1, millisSinceEpoch, proto, slot, t2, t3, copy, $length, i; - t1 = {}; - if (e == null) - return e; - if (typeof e === "boolean") - return e; - if (typeof e === "number") - return e; - if (typeof e === "string") - return e; - if (e instanceof Date) { - millisSinceEpoch = e.getTime(); - t1 = new P.DateTime(millisSinceEpoch, true); - t1.DateTime$_withValue$2$isUtc(millisSinceEpoch, true); - return t1; + normalize$0: function() { + var newParts, t1, t2, leadingDoubles, _i, part, t3, newSeparators; + newParts = H.setRuntimeTypeInfo([], [P.String]); + for (t1 = this.parts, t2 = t1.length, leadingDoubles = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) { + part = t1[_i]; + t3 = J.getInterceptor(part); + if (!(t3.$eq(part, ".") || t3.$eq(part, ""))) + if (t3.$eq(part, "..")) + if (newParts.length > 0) + newParts.pop(); + else + ++leadingDoubles; + else + newParts.push(part); } - if (e instanceof RegExp) - throw H.wrapException(new P.UnimplementedError("structured clone of RegExp")); - if (typeof Promise != "undefined" && e instanceof Promise) - return P.convertNativePromiseToDartFuture(e); - proto = Object.getPrototypeOf(e); - if (proto === Object.prototype || proto === null) { - slot = this.findSlot$1(e); - t2 = this.copies; - t3 = t2.length; - if (slot >= t3) - return H.ioore(t2, slot); - copy = t2[slot]; - t1.copy = copy; - if (copy != null) - return copy; - copy = P.LinkedHashMap__makeEmpty(); - t1.copy = copy; - if (slot >= t3) - return H.ioore(t2, slot); - t2[slot] = copy; - this.forEachJsField$2(e, new P._AcceptStructuredClone_walk_closure(t1, this)); - return t1.copy; + if (this.root == null) + C.JSArray_methods.insertAll$2(newParts, 0, P.List_List$filled(leadingDoubles, "..", false, null)); + if (newParts.length === 0 && this.root == null) + newParts.push("."); + newSeparators = P.List_List$generate(newParts.length, new Q.ParsedPath_normalize_closure(this), true, P.String); + t1 = this.root; + C.JSArray_methods.insert$2(newSeparators, 0, t1 != null && newParts.length > 0 && this.style.needsSeparator$1(t1) ? this.style.get$separator() : ""); + this.parts = newParts; + this.separators = newSeparators; + t1 = this.root; + if (t1 != null && this.style === $.$get$Style_windows()) + this.root = J.replaceAll$2$s(t1, "/", "\\"); + this.removeTrailingSeparators$0(); + }, + toString$0: function(_) { + var builder, t1, i; + builder = new P.StringBuffer(""); + t1 = this.root; + if (t1 != null) + builder._contents = H.S(t1); + for (i = 0; i < this.parts.length; ++i) { + t1 = this.separators; + if (i >= t1.length) + return H.ioore(t1, i); + builder._contents += H.S(t1[i]); + t1 = this.parts; + if (i >= t1.length) + return H.ioore(t1, i); + builder._contents += H.S(t1[i]); } - if (e instanceof Array) { - slot = this.findSlot$1(e); - t1 = this.copies; - if (slot >= t1.length) - return H.ioore(t1, slot); - copy = t1[slot]; - if (copy != null) - return copy; - t2 = J.getInterceptor$asx(e); - $length = t2.get$length(e); - copy = this.mustCopy ? new Array($length) : e; - if (slot >= t1.length) - return H.ioore(t1, slot); - t1[slot] = copy; - if (typeof $length !== "number") - return H.iae($length); - t1 = J.getInterceptor$ax(copy); - i = 0; - for (; i < $length; ++i) - t1.$indexSet(copy, i, this.walk$1(t2.$index(e, i))); - return copy; + t1 = builder._contents += H.S(C.JSArray_methods.get$last(this.separators)); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + static: { + ParsedPath_ParsedPath$parse: function(path, style) { + var root, isRootRelative, parts, separators, t1, start, i, t2; + root = style.getRoot$1(path); + isRootRelative = style.isRootRelative$1(path); + if (root != null) + path = J.substring$1$s(path, J.get$length$asx(root)); + parts = H.setRuntimeTypeInfo([], [P.String]); + separators = H.setRuntimeTypeInfo([], [P.String]); + t1 = J.getInterceptor$asx(path); + if (t1.get$isNotEmpty(path) && style.isSeparator$1(t1.codeUnitAt$1(path, 0))) { + separators.push(t1.$index(path, 0)); + start = 1; + } else { + separators.push(""); + start = 0; + } + i = start; + while (true) { + t2 = t1.get$length(path); + if (typeof t2 !== "number") + return H.iae(t2); + if (!(i < t2)) + break; + if (style.isSeparator$1(t1.codeUnitAt$1(path, i))) { + parts.push(C.JSString_methods.substring$2(path, start, i)); + if (i >= path.length) + return H.ioore(path, i); + separators.push(path[i]); + start = i + 1; + } + ++i; + } + t2 = t1.get$length(path); + if (typeof t2 !== "number") + return H.iae(t2); + if (start < t2) { + parts.push(t1.substring$1(path, start)); + separators.push(""); + } + return new Q.ParsedPath(style, root, isRootRelative, parts, separators); } - return e; - } - }, - _AcceptStructuredClone_walk_closure: { - "^": "Closure:3;_box_0,$this", - call$2: function(key, value) { - var t1, t2; - t1 = this._box_0.copy; - t2 = this.$this.walk$1(value); - J.$indexSet$ax(t1, key, t2); - return t2; } }, - _StructuredCloneDart2Js: { - "^": "_StructuredClone;values,copies" - }, - _AcceptStructuredCloneDart2Js: { - "^": "_AcceptStructuredClone;values,copies,mustCopy", - forEachJsField$2: function(object, action) { - var t1, t2, _i, key; - for (t1 = Object.keys(object), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) { - key = t1[_i]; - action.call$2(key, object[key]); - } + ParsedPath_normalize_closure: { + "^": "Closure:0;$this", + call$1: function(_) { + return this.$this.style.get$separator(); } - }, - convertNativePromiseToDartFuture_closure: { - "^": "Closure:0;completer", - call$1: [function(result) { - return this.completer.complete$1(0, result); - }, null, null, 2, 0, null, 13, "call"] - }, - convertNativePromiseToDartFuture_closure0: { - "^": "Closure:0;completer", - call$1: [function(result) { - return this.completer.completeError$1(result); - }, null, null, 2, 0, null, 13, "call"] } - }], ["", "package:stack_trace/src/lazy_trace.dart",, T, { + }], ["path.path_exception", "package:path/src/path_exception.dart",, E, { "^": "", - LazyTrace: { - "^": "Object;_thunk,_lazy_trace$_inner", - get$_lazy_trace$_trace: function() { - var t1 = this._lazy_trace$_inner; - if (t1 == null) { - t1 = this._thunk$0(); - this._lazy_trace$_inner = t1; - } - return t1; - }, - get$frames: function() { - return this.get$_lazy_trace$_trace().get$frames(); - }, - get$terse: function() { - return new T.LazyTrace(new T.LazyTrace_terse_closure(this), null); - }, - foldFrames$2$terse: function(predicate, terse) { - return new T.LazyTrace(new T.LazyTrace_foldFrames_closure(this, predicate, true), null); - }, + PathException: { + "^": "Object;message>", toString$0: function(_) { - return J.toString$0$(this.get$_lazy_trace$_trace()); - }, - _thunk$0: function() { - return this._thunk.call$0(); - }, - $isTrace: 1 - }, - LazyTrace_terse_closure: { - "^": "Closure:1;$this", - call$0: function() { - return this.$this.get$_lazy_trace$_trace().get$terse(); + return "PathException: " + this.message; } + } + }], ["path.style", "package:path/src/style.dart",, S, { + "^": "", + Style__getPlatformStyle: function() { + if (P.Uri_base().get$scheme() !== "file") + return $.$get$Style_url(); + var t1 = P.Uri_base(); + if (!C.JSString_methods.endsWith$1(t1.get$path(t1), "/")) + return $.$get$Style_url(); + if (P._Uri__Uri(null, null, "a/b", null, null, null, null, null, null).toFilePath$0() === "a\\b") + return $.$get$Style_windows(); + return $.$get$Style_posix(); }, - LazyTrace_foldFrames_closure: { - "^": "Closure:1;$this,predicate,terse", - call$0: function() { - return this.$this.get$_lazy_trace$_trace().foldFrames$2$terse(this.predicate, this.terse); + Style: { + "^": "Object;", + toString$0: function(_) { + return this.get$name(this); } } - }], ["", "package:stream_channel/src/multi_channel.dart",, D, { + }], ["path.style.posix", "package:path/src/style/posix.dart",, Z, { "^": "", - _MultiChannel: { - "^": "StreamChannelMixin;_multi_channel$_inner,_innerStreamSubscription,_mainController,_controllers,_nextId", - virtualChannel$1: function(id) { - var t1, t2, inputId, t3, controller; - t1 = {}; - t1.inputId = null; - t1.outputId = null; - if (id != null) { - t1.inputId = id; - t1.outputId = H.intTypeCast(id) + 1; - t2 = id; - } else { - t2 = this._nextId; - inputId = t2 + 1; - t1.inputId = inputId; - t1.outputId = t2; - this._nextId = t2 + 2; - t2 = inputId; - } - if (this._multi_channel$_inner == null) { - t1 = H.setRuntimeTypeInfo(new P._EmptyStream(), [null]); - t3 = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); - t3._asyncComplete$1(null); - return new D.VirtualChannel(this, t2, t1, H.setRuntimeTypeInfo(new S.NullStreamSink(t3, false, false), [null])); - } - t3 = this._controllers; - if (t3.containsKey$1(t2)) - throw H.wrapException(P.ArgumentError$("A virtual channel with id " + H.S(id) + " already exists.")); - controller = B.StreamChannelController$(true, true, null); - t3.$indexSet(0, t2, controller); - t2 = controller._local._streamController; - t2.toString; - H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]).listen$2$onDone(new D._MultiChannel_virtualChannel_closure(t1, this), new D._MultiChannel_virtualChannel_closure0(t1, this)); - t1 = t1.outputId; - t2 = controller._foreign._streamController; - t2.toString; - return new D.VirtualChannel(this, t1, H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]), controller._foreign._sink); + PosixStyle: { + "^": "InternalStyle;name>,separator<,separators,separatorPattern,needsSeparatorPattern,rootPattern,relativeRootPattern", + containsSeparator$1: function(path) { + return J.contains$1$asx(path, "/"); }, - _closeChannel$2: function(inputId, outputId) { - var t1, t2; - t1 = this._controllers; - t1.remove$1(0, inputId).get$local()._sink.close$0(0); - t2 = this._multi_channel$_inner; - if (t2 == null) - return; - t2._sink.add$1(0, [outputId]); - if (t1.get$isEmpty(t1)) - this._closeInnerChannel$0(); + isSeparator$1: function(codeUnit) { + return codeUnit === 47; }, - _closeInnerChannel$0: [function() { - var t1, t2, t3, _i; - this._multi_channel$_inner._sink.close$0(0); - this._innerStreamSubscription.cancel$0(); - this._multi_channel$_inner = null; - for (t1 = this._controllers, t2 = P.List_List$from(t1.get$values(t1), true, null), t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, H.throwConcurrentModificationError)(t2), ++_i) - t2[_i].get$local()._sink.close$0(0); - t1.clear$0(0); - }, "call$0", "get$_closeInnerChannel", 0, 0, 2], - _MultiChannel$1: function(_inner) { - var t1, t2; - t1 = this._mainController; - this._controllers.$indexSet(0, 0, t1); - t2 = t1._local._streamController; - t2.toString; - H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]).listen$2$onDone(new D._MultiChannel_closure(this), new D._MultiChannel_closure0(this)); - t2 = this._multi_channel$_inner._streamController; - t2.toString; - this._innerStreamSubscription = H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]).listen$3$onDone$onError(new D._MultiChannel_closure1(this), this.get$_closeInnerChannel(), t1._local._sink.get$addError()); + needsSeparator$1: function(path) { + var t1 = J.getInterceptor$asx(path); + return t1.get$isNotEmpty(path) && t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)) !== 47; }, - static: { - _MultiChannel$: function(_inner) { - var t1 = new D._MultiChannel(_inner, null, B.StreamChannelController$(true, true, null), P.LinkedHashMap_LinkedHashMap$_empty(P.$int, B.StreamChannelController), 1); - t1._MultiChannel$1(_inner); - return t1; + rootLength$1: function(path) { + var t1 = J.getInterceptor$asx(path); + if (t1.get$isNotEmpty(path) && t1.codeUnitAt$1(path, 0) === 47) + return 1; + return 0; + }, + isRootRelative$1: function(path) { + return false; + }, + pathFromUri$1: function(uri) { + var t1; + if (uri.get$scheme() === "" || uri.get$scheme() === "file") { + t1 = uri.get$path(uri); + return P._Uri__uriDecode(t1, 0, t1.length, C.Utf8Codec_false, false); } + throw H.wrapException(P.ArgumentError$("Uri " + H.S(uri) + " must have scheme 'file:'.")); + }, + absolutePathToUri$1: function(path) { + var parsed, t1; + parsed = Q.ParsedPath_ParsedPath$parse(path, this); + t1 = parsed.parts; + if (t1.length === 0) + C.JSArray_methods.addAll$1(t1, ["", ""]); + else if (parsed.get$hasTrailingSeparator()) + C.JSArray_methods.add$1(parsed.parts, ""); + return P._Uri__Uri(null, null, null, parsed.parts, null, null, null, "file", null); } - }, - _MultiChannel_closure: { - "^": "Closure:0;$this", - call$1: [function(message) { - return this.$this._multi_channel$_inner._sink.add$1(0, [0, message]); - }, null, null, 2, 0, null, 8, "call"] - }, - _MultiChannel_closure0: { - "^": "Closure:1;$this", - call$0: [function() { - return this.$this._closeChannel$2(0, 0); - }, null, null, 0, 0, null, "call"] - }, - _MultiChannel_closure1: { - "^": "Closure:0;$this", - call$1: [function(message) { - var t1, controller; - t1 = J.getInterceptor$asx(message); - controller = this.$this._controllers.$index(0, t1.$index(message, 0)); - if (controller == null) - return; - if (J.$gt$n(t1.get$length(message), 1)) { - controller._local._sink.add$1(0, t1.$index(message, 1)); - return; - } - controller._local._sink.close$0(0); - }, null, null, 2, 0, null, 8, "call"] - }, - _MultiChannel_virtualChannel_closure: { - "^": "Closure:0;_box_0,$this", - call$1: [function(message) { - return this.$this._multi_channel$_inner._sink.add$1(0, [this._box_0.outputId, message]); - }, null, null, 2, 0, null, 8, "call"] - }, - _MultiChannel_virtualChannel_closure0: { - "^": "Closure:1;_box_0,$this", - call$0: [function() { - var t1 = this._box_0; - return this.$this._closeChannel$2(t1.inputId, t1.outputId); - }, null, null, 0, 0, null, "call"] - }, - VirtualChannel: { - "^": "StreamChannelMixin;_parent,id,stream,sink" } - }], ["", "package:async/src/null_stream_sink.dart",, S, { + }], ["path.style.url", "package:path/src/style/url.dart",, E, { "^": "", - NullStreamSink: { - "^": "Object;done,_null_stream_sink$_closed,_addingStream", - add$1: function(_, data) { - this._checkEventAllowed$0(); + UrlStyle: { + "^": "InternalStyle;name>,separator<,separators,separatorPattern,needsSeparatorPattern,rootPattern,relativeRootPattern", + containsSeparator$1: function(path) { + return J.contains$1$asx(path, "/"); + }, + isSeparator$1: function(codeUnit) { + return codeUnit === 47; + }, + needsSeparator$1: function(path) { + var t1 = J.getInterceptor$asx(path); + if (t1.get$isEmpty(path) === true) + return false; + if (t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)) !== 47) + return true; + return C.JSString_methods.endsWith$1(path, "://") && this.rootLength$1(path) === path.length; }, - addStream$1: function(stream) { - var future; - this._checkEventAllowed$0(); - this._addingStream = true; - future = stream.listen$1(null).cancel$0(); - if (future == null) { - future = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); - future._asyncComplete$1(null); + rootLength$1: function(path) { + var t1, index; + t1 = J.getInterceptor$asx(path); + if (t1.get$isEmpty(path) === true) + return 0; + if (t1.codeUnitAt$1(path, 0) === 47) + return 1; + index = C.JSString_methods.indexOf$1(path, "/"); + if (index > 0 && C.JSString_methods.startsWith$2(path, "://", index - 1)) { + index = C.JSString_methods.indexOf$2(path, "/", index + 2); + if (index > 0) + return index; + return path.length; } - return future.whenComplete$1(new S.NullStreamSink_addStream_closure(this)); + return 0; }, - _checkEventAllowed$0: function() { - if (this._null_stream_sink$_closed) - throw H.wrapException(new P.StateError("Cannot add to a closed sink.")); - if (this._addingStream) - throw H.wrapException(new P.StateError("Cannot add to a sink while adding a stream.")); + isRootRelative$1: function(path) { + var t1 = J.getInterceptor$asx(path); + return t1.get$isNotEmpty(path) && t1.codeUnitAt$1(path, 0) === 47; }, - close$0: function(_) { - this._null_stream_sink$_closed = true; - return this.done; + pathFromUri$1: function(uri) { + return J.toString$0$(uri); + }, + relativePathToUri$1: function(path) { + return P.Uri_parse(path, 0, null); + }, + absolutePathToUri$1: function(path) { + return P.Uri_parse(path, 0, null); } - }, - NullStreamSink_addStream_closure: { - "^": "Closure:1;$this", - call$0: [function() { - this.$this._addingStream = false; - }, null, null, 0, 0, null, "call"] } - }], ["path", "package:path/path.dart",, B, { + }], ["path.style.windows", "package:path/src/style/windows.dart",, T, { "^": "", - current: function() { - var uri, t1, t2, targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, mergedPath, fragment, path; - uri = P.Uri_base(); - if (J.$eq$(uri, $._currentUriBase)) - return $._current; - $._currentUriBase = uri; - t1 = $.$get$Style_platform(); - t2 = $.$get$Style_url(); - if (t1 == null ? t2 == null : t1 === t2) { - uri.toString; - t1 = P.Uri_parse(".", 0, null); - targetScheme = t1.scheme; - if (targetScheme.length !== 0) { - if (t1._host != null) { - targetUserInfo = t1._userInfo; - targetHost = t1.get$host(t1); - targetPort = t1._port != null ? t1.get$port(t1) : null; - } else { - targetUserInfo = ""; - targetHost = null; - targetPort = null; + WindowsStyle: { + "^": "InternalStyle;name>,separator<,separators,separatorPattern,needsSeparatorPattern,rootPattern,relativeRootPattern", + containsSeparator$1: function(path) { + return J.contains$1$asx(path, "/"); + }, + isSeparator$1: function(codeUnit) { + return codeUnit === 47 || codeUnit === 92; + }, + needsSeparator$1: function(path) { + var t1 = J.getInterceptor$asx(path); + if (t1.get$isEmpty(path) === true) + return false; + t1 = t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)); + return !(t1 === 47 || t1 === 92); + }, + rootLength$1: function(path) { + var t1, index; + t1 = J.getInterceptor$asx(path); + if (t1.get$isEmpty(path) === true) + return 0; + if (t1.codeUnitAt$1(path, 0) === 47) + return 1; + if (C.JSString_methods.codeUnitAt$1(path, 0) === 92) { + t1 = path.length; + if (t1 < 2 || C.JSString_methods.codeUnitAt$1(path, 1) !== 92) + return 1; + index = C.JSString_methods.indexOf$2(path, "\\", 2); + if (index > 0) { + index = C.JSString_methods.indexOf$2(path, "\\", index + 1); + if (index > 0) + return index; } - targetPath = P.Uri__removeDotSegments(t1._path); - targetQuery = t1._query; - if (!(targetQuery != null)) - targetQuery = null; + return t1; + } + if (path.length < 3) + return 0; + t1 = C.JSString_methods.codeUnitAt$1(path, 0); + if (!(t1 >= 65 && t1 <= 90)) + t1 = t1 >= 97 && t1 <= 122; + else + t1 = true; + if (!t1) + return 0; + if (C.JSString_methods.codeUnitAt$1(path, 1) !== 58) + return 0; + t1 = C.JSString_methods.codeUnitAt$1(path, 2); + if (!(t1 === 47 || t1 === 92)) + return 0; + return 3; + }, + isRootRelative$1: function(path) { + return this.rootLength$1(path) === 1; + }, + pathFromUri$1: function(uri) { + var path, t1; + if (uri.get$scheme() !== "" && uri.get$scheme() !== "file") + throw H.wrapException(P.ArgumentError$("Uri " + H.S(uri) + " must have scheme 'file:'.")); + path = uri.get$path(uri); + if (uri.get$host(uri) === "") { + if (C.JSString_methods.startsWith$1(path, "/")) + path = C.JSString_methods.replaceFirst$2(path, "/", ""); + } else + path = "\\\\" + H.S(uri.get$host(uri)) + path; + H.checkString("\\"); + t1 = H.stringReplaceAllUnchecked(path, "/", "\\"); + return P._Uri__uriDecode(t1, 0, t1.length, C.Utf8Codec_false, false); + }, + absolutePathToUri$1: function(path) { + var parsed, t1, rootParts, t2; + parsed = Q.ParsedPath_ParsedPath$parse(path, this); + if (J.startsWith$1$s(parsed.root, "\\\\")) { + t1 = J.split$1$s(parsed.root, "\\"); + rootParts = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new T.WindowsStyle_absolutePathToUri_closure()), [H.getTypeArgumentByIndex(t1, 0)]); + C.JSArray_methods.insert$2(parsed.parts, 0, rootParts.get$last(rootParts)); + if (parsed.get$hasTrailingSeparator()) + C.JSArray_methods.add$1(parsed.parts, ""); + return P._Uri__Uri(null, rootParts.get$first(rootParts), null, parsed.parts, null, null, null, "file", null); } else { - targetScheme = uri.scheme; - if (t1._host != null) { - targetUserInfo = t1._userInfo; - targetHost = t1.get$host(t1); - targetPort = P.Uri__makePort(t1._port != null ? t1.get$port(t1) : null, targetScheme); - targetPath = P.Uri__removeDotSegments(t1._path); - targetQuery = t1._query; - if (!(targetQuery != null)) - targetQuery = null; - } else { - targetUserInfo = uri._userInfo; - targetHost = uri._host; - targetPort = uri._port; - targetPath = t1._path; - if (targetPath === "") { - targetPath = uri._path; - targetQuery = t1._query; - if (!(targetQuery != null)) - targetQuery = uri._query; - } else { - if (C.JSString_methods.startsWith$1(targetPath, "/")) - targetPath = P.Uri__removeDotSegments(targetPath); - else { - t2 = uri._path; - if (t2.length === 0) - targetPath = targetScheme.length === 0 && targetHost == null ? targetPath : P.Uri__removeDotSegments("/" + targetPath); - else { - mergedPath = uri._mergePaths$2(t2, targetPath); - targetPath = targetScheme.length !== 0 || targetHost != null || C.JSString_methods.startsWith$1(t2, "/") ? P.Uri__removeDotSegments(mergedPath) : P.Uri__normalizeRelativePath(mergedPath); - } - } - targetQuery = t1._query; - if (!(targetQuery != null)) - targetQuery = null; - } - } + if (parsed.parts.length === 0 || parsed.get$hasTrailingSeparator()) + C.JSArray_methods.add$1(parsed.parts, ""); + t1 = parsed.parts; + t2 = J.replaceAll$2$s(parsed.root, "/", ""); + H.checkString(""); + C.JSArray_methods.insert$2(t1, 0, H.stringReplaceAllUnchecked(t2, "\\", "")); + return P._Uri__Uri(null, null, null, parsed.parts, null, null, null, "file", null); } - fragment = t1._fragment; - if (!(fragment != null)) - fragment = null; - t1 = new P.Uri(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, fragment, null, null, null).toString$0(0); - $._current = t1; - return t1; - } else { - path = uri.toFilePath$0(); - t1 = C.JSString_methods.substring$2(path, 0, path.length - 1); - $._current = t1; - return t1; + } + }, + WindowsStyle_absolutePathToUri_closure: { + "^": "Closure:0;", + call$1: function(part) { + return !J.$eq$(part, ""); } } - }], ["path.context", "package:path/src/context.dart",, F, { + }], ["", "package:stack_trace/src/chain.dart",, U, { "^": "", - _validateArgList: function(method, args) { - var numArgs, i, numArgs0, message, t1, t2, t3, t4; - for (numArgs = args.length, i = 1; i < numArgs; ++i) { - if (args[i] == null || args[i - 1] != null) - continue; - for (; numArgs >= 1; numArgs = numArgs0) { - numArgs0 = numArgs - 1; - if (args[numArgs0] != null) - break; - } - message = new P.StringBuffer(""); - t1 = method + "("; - message._contents = t1; - t2 = H.setRuntimeTypeInfo(new H.SubListIterable(args, 0, numArgs), [H.getTypeArgumentByIndex(args, 0)]); - t3 = t2.__internal$_start; - if (t3 < 0) - H.throwExpression(P.RangeError$range(t3, 0, null, "start", null)); - t4 = t2._endOrLength; - if (t4 != null) { - if (typeof t4 !== "number") - return t4.$lt(); - if (t4 < 0) - H.throwExpression(P.RangeError$range(t4, 0, null, "end", null)); - if (t3 > t4) - H.throwExpression(P.RangeError$range(t3, 0, t4, "start", null)); + Chain: { + "^": "Object;traces", + get$terse: function() { + return this.foldFrames$2$terse(new U.Chain_terse_closure(), true); + }, + foldFrames$2$terse: function(predicate, terse) { + var foldedTraces, nonEmptyTraces; + foldedTraces = H.setRuntimeTypeInfo(new H.MappedListIterable(this.traces, new U.Chain_foldFrames_closure(predicate, true)), [null, null]); + nonEmptyTraces = foldedTraces.super$Iterable$where(foldedTraces, new U.Chain_foldFrames_closure0(true)); + if (!nonEmptyTraces.get$iterator(nonEmptyTraces).moveNext$0() && !foldedTraces.get$isEmpty(foldedTraces)) + return new U.Chain(P.List_List$unmodifiable([foldedTraces.get$last(foldedTraces)], Y.Trace)); + return new U.Chain(P.List_List$unmodifiable(nonEmptyTraces, Y.Trace)); + }, + toTrace$0: function() { + var t1 = this.traces; + return new Y.Trace(P.List_List$unmodifiable(H.setRuntimeTypeInfo(new H.ExpandIterable(t1, new U.Chain_toTrace_closure()), [H.getTypeArgumentByIndex(t1, 0), null]), A.Frame)); + }, + toString$0: function(_) { + var t1 = this.traces; + return H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new U.Chain_toString_closure(H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new U.Chain_toString_closure0()), [null, null]).fold$2(0, 0, P.math__max$closure()))), [null, null]).join$1(0, "===== asynchronous gap ===========================\n"); + }, + static: { + Chain_Chain$parse: function(chain) { + var t1 = J.getInterceptor$asx(chain); + if (t1.get$isEmpty(chain) === true) + return new U.Chain(P.List_List$unmodifiable([], Y.Trace)); + if (t1.contains$1(chain, "===== asynchronous gap ===========================\n") !== true) + return new U.Chain(P.List_List$unmodifiable([Y.Trace_Trace$parse(chain)], Y.Trace)); + return new U.Chain(P.List_List$unmodifiable(H.setRuntimeTypeInfo(new H.MappedListIterable(t1.split$1(chain, "===== asynchronous gap ===========================\n"), new U.closure3()), [null, null]), Y.Trace)); } - t1 += H.setRuntimeTypeInfo(new H.MappedListIterable(t2, new F._validateArgList_closure()), [H.getRuntimeTypeArgument(t2, "ListIterable", 0), null]).join$1(0, ", "); - message._contents = t1; - message._contents = t1 + ("): part " + (i - 1) + " was null, but part " + i + " was not."); - throw H.wrapException(P.ArgumentError$(message.toString$0(0))); } }, - Context: { - "^": "Object;style,_context$_current", - absolute$7: function(_, part1, part2, part3, part4, part5, part6, part7) { - var t1; - F._validateArgList("absolute", [part1, part2, part3, part4, part5, part6, part7]); - t1 = this.style; - t1 = J.$gt$n(t1.rootLength$1(part1), 0) && !t1.isRootRelative$1(part1); - if (t1) - return part1; - t1 = this._context$_current; - return this.join$8(0, t1 != null ? t1 : B.current(), part1, part2, part3, part4, part5, part6, part7); - }, - absolute$1: function($receiver, part1) { - return this.absolute$7($receiver, part1, null, null, null, null, null, null); - }, - join$8: function(_, part1, part2, part3, part4, part5, part6, part7, part8) { - var parts = H.setRuntimeTypeInfo([part1, part2, part3, part4, part5, part6, part7, part8], [P.String]); - F._validateArgList("join", parts); - return this.joinAll$1(H.setRuntimeTypeInfo(new H.WhereIterable(parts, new F.Context_join_closure()), [H.getTypeArgumentByIndex(parts, 0)])); + closure3: { + "^": "Closure:0;", + call$1: function(trace) { + return Y.Trace$parseFriendly(trace); + } + }, + Chain_terse_closure: { + "^": "Closure:0;", + call$1: function(_) { + return false; + } + }, + Chain_foldFrames_closure: { + "^": "Closure:0;predicate,terse", + call$1: function(trace) { + return trace.foldFrames$2$terse(this.predicate, this.terse); + } + }, + Chain_foldFrames_closure0: { + "^": "Closure:0;terse", + call$1: function(trace) { + if (trace.get$frames().length > 1) + return true; + if (trace.get$frames().length === 0) + return false; + if (!this.terse) + return false; + return C.JSArray_methods.get$single(trace.get$frames()).get$line() != null; + } + }, + Chain_toTrace_closure: { + "^": "Closure:0;", + call$1: function(trace) { + return trace.get$frames(); + } + }, + Chain_toString_closure0: { + "^": "Closure:0;", + call$1: function(trace) { + return H.setRuntimeTypeInfo(new H.MappedListIterable(trace.get$frames(), new U.Chain_toString__closure0()), [null, null]).fold$2(0, 0, P.math__max$closure()); + } + }, + Chain_toString__closure0: { + "^": "Closure:0;", + call$1: function(frame) { + return J.get$length$asx(J.get$location$x(frame)); + } + }, + Chain_toString_closure: { + "^": "Closure:0;longest", + call$1: function(trace) { + return H.setRuntimeTypeInfo(new H.MappedListIterable(trace.get$frames(), new U.Chain_toString__closure(this.longest)), [null, null]).join$0(0); + } + }, + Chain_toString__closure: { + "^": "Closure:0;longest", + call$1: function(frame) { + return H.S(B.padRight(J.get$location$x(frame), this.longest)) + " " + H.S(frame.get$member()) + "\n"; + } + } + }], ["", "package:stack_trace/src/frame.dart",, A, { + "^": "", + Frame: { + "^": "Object;uri<,line<,column<,member<", + get$isCore: function() { + return this.uri.get$scheme() === "dart"; }, - join$2: function($receiver, part1, part2) { - return this.join$8($receiver, part1, part2, null, null, null, null, null, null); + get$library: function() { + var t1 = this.uri; + if (t1.get$scheme() === "data") + return "data:..."; + return $.$get$context().prettyUri$1(t1); }, - joinAll$1: function(parts) { - var buffer, t1, t2, t3, needsSeparator, isAbsoluteAndNotRootRelative, part, parsed, t4, t5; - buffer = new P.StringBuffer(""); - for (t1 = H.setRuntimeTypeInfo(new H.WhereIterable(parts, new F.Context_joinAll_closure()), [H.getRuntimeTypeArgument(parts, "Iterable", 0)]), t1 = H.setRuntimeTypeInfo(new H.WhereIterator(J.get$iterator$ax(t1._iterable), t1._f), [H.getTypeArgumentByIndex(t1, 0)]), t2 = this.style, t3 = t1._iterator, needsSeparator = false, isAbsoluteAndNotRootRelative = false; t1.moveNext$0();) { - part = t3.get$current(); - if (t2.isRootRelative$1(part) && isAbsoluteAndNotRootRelative) { - parsed = Q.ParsedPath_ParsedPath$parse(part, t2); - t4 = buffer._contents; - t4 = t4.charCodeAt(0) == 0 ? t4 : t4; - t4 = C.JSString_methods.substring$2(t4, 0, t2.rootLength$1(t4)); - parsed.root = t4; - if (t2.needsSeparator$1(t4)) { - t4 = parsed.separators; - t5 = t2.get$separator(); - if (0 >= t4.length) - return H.ioore(t4, 0); - t4[0] = t5; - } - buffer._contents = ""; - buffer._contents += parsed.toString$0(0); - } else if (J.$gt$n(t2.rootLength$1(part), 0)) { - isAbsoluteAndNotRootRelative = !t2.isRootRelative$1(part); - buffer._contents = ""; - buffer._contents += H.S(part); - } else { - t4 = J.getInterceptor$asx(part); - if (!(J.$gt$n(t4.get$length(part), 0) && t2.containsSeparator$1(t4.$index(part, 0)) === true)) - if (needsSeparator) - buffer._contents += t2.get$separator(); - buffer._contents += H.S(part); - } - needsSeparator = t2.needsSeparator$1(part); - } - t1 = buffer._contents; - return t1.charCodeAt(0) == 0 ? t1 : t1; + get$$package: function() { + var t1 = this.uri; + if (t1.get$scheme() !== "package") + return; + return C.JSArray_methods.get$first(t1.get$path(t1).split("/")); }, - split$1: function(_, path) { - var parsed, t1, t2; - parsed = Q.ParsedPath_ParsedPath$parse(path, this.style); - t1 = parsed.parts; - t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new F.Context_split_closure()), [H.getTypeArgumentByIndex(t1, 0)]); - t1 = P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "Iterable", 0)); - parsed.parts = t1; - t2 = parsed.root; - if (t2 != null) - C.JSArray_methods.insert$2(t1, 0, t2); - return parsed.parts; + get$location: function(_) { + var t1, t2; + t1 = this.line; + if (t1 == null) + return this.get$library(); + t2 = this.column; + if (t2 == null) + return H.S(this.get$library()) + " " + H.S(t1); + return H.S(this.get$library()) + " " + H.S(t1) + ":" + H.S(t2); }, - normalize$1: function(path) { - var parsed; - if (!this._needsNormalization$1(path)) - return path; - parsed = Q.ParsedPath_ParsedPath$parse(path, this.style); - parsed.normalize$0(); - return parsed.toString$0(0); + toString$0: function(_) { + return H.S(this.get$location(this)) + " in " + H.S(this.member); }, - _needsNormalization$1: function(path) { - var t1, root, i, start, previous, t2, t3, previousPrevious, t4, codeUnit, t5; - t1 = this.style; - root = t1.rootLength$1(path); - if (root !== 0) { - if (t1 === $.$get$Style_windows()) { - if (typeof root !== "number") - return H.iae(root); - i = 0; - for (; i < root; ++i) - if (C.JSString_methods.codeUnitAt$1(path, i) === 47) - return true; - } - start = root; - previous = 47; - } else { - start = 0; - previous = null; - } - for (t2 = new H.CodeUnits(path).__internal$_string, t3 = t2.length, i = start, previousPrevious = null; t4 = J.getInterceptor$n(i), t4.$lt(i, t3); i = t4.$add(i, 1), previousPrevious = previous, previous = codeUnit) { - codeUnit = C.JSString_methods.codeUnitAt$1(t2, i); - if (t1.isSeparator$1(codeUnit)) { - if (t1 === $.$get$Style_windows() && codeUnit === 47) - return true; - if (previous != null && t1.isSeparator$1(previous)) - return true; - if (previous === 46) - t5 = previousPrevious == null || previousPrevious === 46 || t1.isSeparator$1(previousPrevious); + static: { + Frame_Frame$parseVM: function(frame) { + return A.Frame__catchFormatException(frame, new A.closure1(frame)); + }, + Frame_Frame$parseV8: function(frame) { + return A.Frame__catchFormatException(frame, new A.closure5(frame)); + }, + Frame_Frame$parseFirefox: function(frame) { + return A.Frame__catchFormatException(frame, new A.closure4(frame)); + }, + Frame_Frame$parseFriendly: function(frame) { + return A.Frame__catchFormatException(frame, new A.closure2(frame)); + }, + Frame__uriOrPathToUri: function(uriOrPath) { + var t1 = J.getInterceptor$asx(uriOrPath); + if (t1.contains$1(uriOrPath, $.$get$Frame__uriRegExp()) === true) + return P.Uri_parse(uriOrPath, 0, null); + else if (t1.contains$1(uriOrPath, $.$get$Frame__windowsRegExp()) === true) + return P._Uri__Uri$file(uriOrPath, true); + else if (t1.startsWith$1(uriOrPath, "/")) + return P._Uri__Uri$file(uriOrPath, false); + if (C.JSString_methods.contains$1(uriOrPath, "\\")) + return $.$get$windows().toUri$1(uriOrPath); + return P.Uri_parse(uriOrPath, 0, null); + }, + Frame__catchFormatException: function(text, body) { + var t1, exception; + try { + t1 = body.call$0(); + return t1; + } catch (exception) { + if (H.unwrapException(exception) instanceof P.FormatException) + return new N.UnparsedFrame(P._Uri__Uri(null, null, "unparsed", null, null, null, null, null, null), null, null, false, "unparsed", null, "unparsed", text); else - t5 = false; - if (t5) - return true; + throw exception; } } - if (previous == null) - return true; - if (t1.isSeparator$1(previous)) - return true; - if (previous === 46) - t1 = previousPrevious == null || previousPrevious === 47 || previousPrevious === 46; - else - t1 = false; - if (t1) - return true; - return false; - }, - relative$2$from: function(path, from) { - var t1, fromParsed, pathParsed, t2, t3; - if (!J.$gt$n(this.style.rootLength$1(path), 0)) - return this.normalize$1(path); - t1 = this._context$_current; - from = t1 != null ? t1 : B.current(); - t1 = this.style; - if (!J.$gt$n(t1.rootLength$1(from), 0) && J.$gt$n(t1.rootLength$1(path), 0)) - return this.normalize$1(path); - if (!J.$gt$n(t1.rootLength$1(path), 0) || t1.isRootRelative$1(path)) - path = this.absolute$1(0, path); - if (!J.$gt$n(t1.rootLength$1(path), 0) && J.$gt$n(t1.rootLength$1(from), 0)) - throw H.wrapException(new E.PathException('Unable to find a path to "' + path + '" from "' + H.S(from) + '".')); - fromParsed = Q.ParsedPath_ParsedPath$parse(from, t1); - fromParsed.normalize$0(); - pathParsed = Q.ParsedPath_ParsedPath$parse(path, t1); - pathParsed.normalize$0(); - t2 = fromParsed.parts; - if (t2.length > 0 && J.$eq$(t2[0], ".")) - return pathParsed.toString$0(0); - if (!J.$eq$(fromParsed.root, pathParsed.root)) { - t2 = fromParsed.root; - if (!(t2 == null || pathParsed.root == null)) { - t2 = J.toLowerCase$0$s(t2); - H.checkString("\\"); - t2 = H.stringReplaceAllUnchecked(t2, "/", "\\"); - t3 = J.toLowerCase$0$s(pathParsed.root); - H.checkString("\\"); - t3 = t2 !== H.stringReplaceAllUnchecked(t3, "/", "\\"); - t2 = t3; - } else - t2 = true; - } else - t2 = false; - if (t2) - return pathParsed.toString$0(0); - while (true) { - t2 = fromParsed.parts; - if (t2.length > 0) { - t3 = pathParsed.parts; - t2 = t3.length > 0 && J.$eq$(t2[0], t3[0]); - } else - t2 = false; - if (!t2) - break; - C.JSArray_methods.removeAt$1(fromParsed.parts, 0); - C.JSArray_methods.removeAt$1(fromParsed.separators, 1); - C.JSArray_methods.removeAt$1(pathParsed.parts, 0); - C.JSArray_methods.removeAt$1(pathParsed.separators, 1); + } + }, + closure1: { + "^": "Closure:1;frame", + call$0: function() { + var t1, match, t2, member, uri, lineAndColumn, line; + t1 = this.frame; + if (J.$eq$(t1, "...")) + return new A.Frame(P._Uri__Uri(null, null, null, null, null, null, null, null, null), null, null, "..."); + match = $.$get$_vmFrame().firstMatch$1(t1); + if (match == null) + return new N.UnparsedFrame(P._Uri__Uri(null, null, "unparsed", null, null, null, null, null, null), null, null, false, "unparsed", null, "unparsed", t1); + t1 = match._match; + if (1 >= t1.length) + return H.ioore(t1, 1); + t2 = J.replaceAll$2$s(t1[1], $.$get$_asyncBody(), "<async>"); + H.checkString("<fn>"); + member = H.stringReplaceAllUnchecked(t2, "<anonymous closure>", "<fn>"); + if (2 >= t1.length) + return H.ioore(t1, 2); + uri = P.Uri_parse(t1[2], 0, null); + if (3 >= t1.length) + return H.ioore(t1, 3); + lineAndColumn = J.split$1$s(t1[3], ":"); + line = lineAndColumn.length > 1 ? H.Primitives_parseInt(lineAndColumn[1], null, null) : null; + return new A.Frame(uri, line, lineAndColumn.length > 2 ? H.Primitives_parseInt(lineAndColumn[2], null, null) : null, member); + } + }, + closure5: { + "^": "Closure:1;frame", + call$0: function() { + var t1, match, t2, t3, t4; + t1 = this.frame; + match = $.$get$_v8Frame().firstMatch$1(t1); + if (match == null) + return new N.UnparsedFrame(P._Uri__Uri(null, null, "unparsed", null, null, null, null, null, null), null, null, false, "unparsed", null, "unparsed", t1); + t1 = new A._parseLocation(t1); + t2 = match._match; + t3 = t2.length; + if (2 >= t3) + return H.ioore(t2, 2); + t4 = t2[2]; + if (t4 != null) { + t2 = J.replaceAll$2$s(t2[1], "<anonymous>", "<fn>"); + H.checkString("<fn>"); + return t1.call$2(t4, H.stringReplaceAllUnchecked(t2, "Anonymous function", "<fn>")); + } else { + if (3 >= t3) + return H.ioore(t2, 3); + return t1.call$2(t2[3], "<fn>"); + } + } + }, + _parseLocation: { + "^": "Closure:3;frame", + call$2: function($location, member) { + var t1, evalMatch, t2, urlMatch, t3; + t1 = $.$get$_v8EvalLocation(); + evalMatch = t1.firstMatch$1($location); + for (; evalMatch != null;) { + t2 = evalMatch._match; + if (1 >= t2.length) + return H.ioore(t2, 1); + $location = t2[1]; + evalMatch = t1.firstMatch$1($location); } - t2 = fromParsed.parts; - if (t2.length > 0 && J.$eq$(t2[0], "..")) - throw H.wrapException(new E.PathException('Unable to find a path to "' + path + '" from "' + H.S(from) + '".')); - C.JSArray_methods.insertAll$2(pathParsed.parts, 0, P.List_List$filled(fromParsed.parts.length, "..", false, null)); - t2 = pathParsed.separators; - if (0 >= t2.length) - return H.ioore(t2, 0); - t2[0] = ""; - C.JSArray_methods.insertAll$2(t2, 1, P.List_List$filled(fromParsed.parts.length, t1.get$separator(), false, null)); - t1 = pathParsed.parts; + if (J.$eq$($location, "native")) + return new A.Frame(P.Uri_parse("native", 0, null), null, null, member); + urlMatch = $.$get$_v8UrlLocation().firstMatch$1($location); + if (urlMatch == null) + return new N.UnparsedFrame(P._Uri__Uri(null, null, "unparsed", null, null, null, null, null, null), null, null, false, "unparsed", null, "unparsed", this.frame); + t1 = urlMatch._match; + if (1 >= t1.length) + return H.ioore(t1, 1); + t2 = A.Frame__uriOrPathToUri(t1[1]); + if (2 >= t1.length) + return H.ioore(t1, 2); + t3 = H.Primitives_parseInt(t1[2], null, null); + if (3 >= t1.length) + return H.ioore(t1, 3); + return new A.Frame(t2, t3, H.Primitives_parseInt(t1[3], null, null), member); + } + }, + closure4: { + "^": "Closure:1;frame", + call$0: function() { + var t1, match, uri, t2, t3, member, line, column; + t1 = this.frame; + match = $.$get$_firefoxSafariFrame().firstMatch$1(t1); + if (match == null) + return new N.UnparsedFrame(P._Uri__Uri(null, null, "unparsed", null, null, null, null, null, null), null, null, false, "unparsed", null, "unparsed", t1); + t1 = match._match; + if (3 >= t1.length) + return H.ioore(t1, 3); + uri = A.Frame__uriOrPathToUri(t1[3]); t2 = t1.length; - if (t2 === 0) - return "."; - if (t2 > 1 && J.$eq$(C.JSArray_methods.get$last(t1), ".")) { - C.JSArray_methods.removeLast$0(pathParsed.parts); - t1 = pathParsed.separators; - C.JSArray_methods.removeLast$0(t1); - C.JSArray_methods.removeLast$0(t1); - C.JSArray_methods.add$1(t1, ""); + if (1 >= t2) + return H.ioore(t1, 1); + t3 = t1[1]; + if (t3 != null) { + if (2 >= t2) + return H.ioore(t1, 2); + t2 = C.JSString_methods.allMatches$1("/", t1[2]); + member = J.$add$ns(t3, C.JSArray_methods.join$0(P.List_List$filled(t2.get$length(t2), ".<fn>", false, null))); + if (J.$eq$(member, "")) + member = "<fn>"; + member = J.replaceFirst$2$s(member, $.$get$_initialDot(), ""); + } else + member = "<fn>"; + if (4 >= t1.length) + return H.ioore(t1, 4); + if (J.$eq$(t1[4], "")) + line = null; + else { + if (4 >= t1.length) + return H.ioore(t1, 4); + line = H.Primitives_parseInt(t1[4], null, null); } - pathParsed.root = ""; - pathParsed.removeTrailingSeparators$0(); - return pathParsed.toString$0(0); + if (5 >= t1.length) + return H.ioore(t1, 5); + t2 = t1[5]; + if (t2 == null || J.$eq$(t2, "")) + column = null; + else { + if (5 >= t1.length) + return H.ioore(t1, 5); + column = H.Primitives_parseInt(t1[5], null, null); + } + return new A.Frame(uri, line, column, member); + } + }, + closure2: { + "^": "Closure:1;frame", + call$0: function() { + var t1, match, uri, t2, line, column; + t1 = this.frame; + match = $.$get$_friendlyFrame().firstMatch$1(t1); + if (match == null) + throw H.wrapException(new P.FormatException("Couldn't parse package:stack_trace stack trace line '" + H.S(t1) + "'.", null, null)); + t1 = match._match; + if (1 >= t1.length) + return H.ioore(t1, 1); + uri = P.Uri_parse(t1[1], 0, null); + if (uri.get$scheme() === "") { + t2 = $.$get$context(); + uri = t2.toUri$1(t2.absolute$7(0, t2.fromUri$1(uri), null, null, null, null, null, null)); + } + if (2 >= t1.length) + return H.ioore(t1, 2); + t2 = t1[2]; + line = t2 == null ? null : H.Primitives_parseInt(t2, null, null); + if (3 >= t1.length) + return H.ioore(t1, 3); + t2 = t1[3]; + column = t2 == null ? null : H.Primitives_parseInt(t2, null, null); + if (4 >= t1.length) + return H.ioore(t1, 4); + return new A.Frame(uri, line, column, t1[4]); + } + } + }], ["", "package:stack_trace/src/lazy_trace.dart",, T, { + "^": "", + LazyTrace: { + "^": "Object;_thunk,_inner", + get$_trace: function() { + var t1 = this._inner; + if (t1 == null) { + t1 = this._thunk.call$0(); + this._inner = t1; + } + return t1; }, - relative$1: function(path) { - return this.relative$2$from(path, null); + get$frames: function() { + return this.get$_trace().get$frames(); }, - fromUri$1: function(uri) { - return this.style.pathFromUri$1(uri); + get$terse: function() { + return new T.LazyTrace(new T.LazyTrace_terse_closure(this), null); }, - toUri$1: function(path) { - var t1, t2; - t1 = this.style; - if (!J.$gt$n(t1.rootLength$1(path), 0)) - return t1.relativePathToUri$1(path); - else { - t2 = this._context$_current; - return t1.absolutePathToUri$1(this.join$2(0, t2 != null ? t2 : B.current(), path)); + foldFrames$2$terse: function(predicate, terse) { + return new T.LazyTrace(new T.LazyTrace_foldFrames_closure(this, predicate, true), null); + }, + toString$0: function(_) { + return J.toString$0$(this.get$_trace()); + }, + $isTrace: 1 + }, + LazyTrace_terse_closure: { + "^": "Closure:1;$this", + call$0: function() { + return this.$this.get$_trace().get$terse(); + } + }, + LazyTrace_foldFrames_closure: { + "^": "Closure:1;$this,predicate,terse", + call$0: function() { + return this.$this.get$_trace().foldFrames$2$terse(this.predicate, this.terse); + } + } + }], ["", "package:stack_trace/src/trace.dart",, Y, { + "^": "", + Trace: { + "^": "Object;frames<", + get$terse: function() { + return this.foldFrames$2$terse(new Y.Trace_terse_closure(), true); + }, + foldFrames$2$terse: function(predicate, terse) { + var t1, newFrames, t2, frame; + t1 = {}; + t1.predicate = predicate; + t1.predicate = new Y.Trace_foldFrames_closure(predicate); + newFrames = H.setRuntimeTypeInfo([], [A.Frame]); + for (t2 = this.frames, t2 = H.setRuntimeTypeInfo(new H.ReversedListIterable(t2), [H.getTypeArgumentByIndex(t2, 0)]), t2 = new H.ListIterator(t2, t2.get$length(t2), 0, null); t2.moveNext$0();) { + frame = t2._current; + if (frame instanceof N.UnparsedFrame || t1.predicate.call$1(frame) !== true) + newFrames.push(frame); + else if (newFrames.length === 0 || t1.predicate.call$1(C.JSArray_methods.get$last(newFrames)) !== true) + newFrames.push(new A.Frame(frame.get$uri(), frame.get$line(), frame.get$column(), frame.get$member())); } + newFrames = H.setRuntimeTypeInfo(new H.MappedListIterable(newFrames, new Y.Trace_foldFrames_closure0(t1)), [null, null]).toList$0(0); + if (newFrames.length > 1 && C.JSArray_methods.get$first(newFrames).get$isCore()) + C.JSArray_methods.removeAt$1(newFrames, 0); + return new Y.Trace(P.List_List$unmodifiable(H.setRuntimeTypeInfo(new H.ReversedListIterable(newFrames), [H.getTypeArgumentByIndex(newFrames, 0)]), A.Frame)); }, - prettyUri$1: function(uri) { - var t1, t2, t3, t4, path, rel; - t1 = uri.scheme; - t2 = t1 === "file"; - if (t2) { - t3 = this.style; - t4 = $.$get$Style_url(); - t4 = t3 == null ? t4 == null : t3 === t4; - t3 = t4; - } else - t3 = false; - if (t3) - return uri.toString$0(0); - if (!t2) - if (t1 !== "") { - t1 = this.style; - t2 = $.$get$Style_url(); - t2 = t1 == null ? t2 != null : t1 !== t2; - t1 = t2; - } else - t1 = false; - else - t1 = false; - if (t1) - return uri.toString$0(0); - path = this.normalize$1(this.fromUri$1(uri)); - rel = this.relative$1(path); - return this.split$1(0, rel).length > this.split$1(0, path).length ? path : rel; + toString$0: function(_) { + var t1 = this.frames; + return H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new Y.Trace_toString_closure(H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new Y.Trace_toString_closure0()), [null, null]).fold$2(0, 0, P.math__max$closure()))), [null, null]).join$0(0); }, + $isStackTrace: 1, static: { - Context_Context: function(current, style) { - current = style == null ? B.current() : "."; - if (style == null) - style = $.$get$Style_platform(); - return new F.Context(style, current); + Trace_Trace$from: function(trace) { + var t1; + if (trace == null) + throw H.wrapException(P.ArgumentError$("Cannot create a Trace from null.")); + t1 = J.getInterceptor(trace); + if (!!t1.$isTrace) + return trace; + if (!!t1.$isChain) + return trace.toTrace$0(); + return new T.LazyTrace(new Y.closure0(trace), null); + }, + Trace_Trace$parse: function(trace) { + var error, t1, exception; + try { + if (J.get$isEmpty$asx(trace) === true) { + t1 = P.List_List$unmodifiable(H.setRuntimeTypeInfo([], [A.Frame]), A.Frame); + return new Y.Trace(t1); + } + if (J.contains$1$asx(trace, $.$get$_v8Trace()) === true) { + t1 = Y.Trace$parseV8(trace); + return t1; + } + if (J.contains$1$asx(trace, "\tat ") === true) { + t1 = Y.Trace$parseJSCore(trace); + return t1; + } + if (J.contains$1$asx(trace, $.$get$_firefoxSafariTrace()) === true) { + t1 = Y.Trace$parseFirefox(trace); + return t1; + } + if (J.contains$1$asx(trace, "===== asynchronous gap ===========================\n") === true) { + t1 = U.Chain_Chain$parse(trace).toTrace$0(); + return t1; + } + if (J.contains$1$asx(trace, $.$get$_friendlyTrace()) === true) { + t1 = Y.Trace$parseFriendly(trace); + return t1; + } + t1 = P.List_List$unmodifiable(Y.Trace__parseVM(trace), A.Frame); + return new Y.Trace(t1); + } catch (exception) { + t1 = H.unwrapException(exception); + if (t1 instanceof P.FormatException) { + error = t1; + throw H.wrapException(new P.FormatException(H.S(J.get$message$x(error)) + "\nStack trace:\n" + H.S(trace), null, null)); + } else + throw exception; + } + }, + Trace__parseVM: function(trace) { + var lines, t1, $frames; + lines = J.trim$0$s(trace).split("\n"); + t1 = H.SubListIterable$(lines, 0, lines.length - 1, H.getTypeArgumentByIndex(lines, 0)); + $frames = H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new Y.Trace__parseVM_closure()), [H.getRuntimeTypeArgument(t1, "ListIterable", 0), null]).toList$0(0); + if (!J.endsWith$1$s(C.JSArray_methods.get$last(lines), ".da")) + C.JSArray_methods.add$1($frames, A.Frame_Frame$parseVM(C.JSArray_methods.get$last(lines))); + return $frames; + }, + Trace$parseV8: function(trace) { + var t1 = J.split$1$s(trace, "\n"); + t1 = H.SubListIterable$(t1, 1, null, H.getTypeArgumentByIndex(t1, 0)); + t1 = t1.super$Iterable$skipWhile(t1, new Y.Trace$parseV8_closure()); + return new Y.Trace(P.List_List$unmodifiable(H.MappedIterable_MappedIterable(t1, new Y.Trace$parseV8_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null), A.Frame)); + }, + Trace$parseJSCore: function(trace) { + var t1 = J.split$1$s(trace, "\n"); + t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new Y.Trace$parseJSCore_closure()), [H.getTypeArgumentByIndex(t1, 0)]); + return new Y.Trace(P.List_List$unmodifiable(H.MappedIterable_MappedIterable(t1, new Y.Trace$parseJSCore_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null), A.Frame)); + }, + Trace$parseFirefox: function(trace) { + var t1 = J.trim$0$s(trace).split("\n"); + t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new Y.Trace$parseFirefox_closure()), [H.getTypeArgumentByIndex(t1, 0)]); + return new Y.Trace(P.List_List$unmodifiable(H.MappedIterable_MappedIterable(t1, new Y.Trace$parseFirefox_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null), A.Frame)); + }, + Trace$parseFriendly: function(trace) { + var t1 = J.getInterceptor$asx(trace); + if (t1.get$isEmpty(trace) === true) + t1 = []; + else { + t1 = t1.trim$0(trace).split("\n"); + t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new Y.Trace$parseFriendly_closure()), [H.getTypeArgumentByIndex(t1, 0)]); + t1 = H.MappedIterable_MappedIterable(t1, new Y.Trace$parseFriendly_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null); + } + return new Y.Trace(P.List_List$unmodifiable(t1, A.Frame)); } } }, - Context_join_closure: { + closure0: { + "^": "Closure:1;trace", + call$0: function() { + return Y.Trace_Trace$parse(J.toString$0$(this.trace)); + } + }, + Trace__parseVM_closure: { "^": "Closure:0;", - call$1: function(part) { - return part != null; + call$1: function(line) { + return A.Frame_Frame$parseVM(line); } }, - Context_joinAll_closure: { + Trace$parseV8_closure: { "^": "Closure:0;", - call$1: function(part) { - return !J.$eq$(part, ""); + call$1: function(line) { + return !J.startsWith$1$s(line, $.$get$_v8TraceLine()); } }, - Context_split_closure: { + Trace$parseV8_closure0: { "^": "Closure:0;", - call$1: function(part) { - return J.get$isEmpty$asx(part) !== true; + call$1: function(line) { + return A.Frame_Frame$parseV8(line); } }, - _validateArgList_closure: { + Trace$parseJSCore_closure: { "^": "Closure:0;", - call$1: [function(arg) { - return arg == null ? "null" : '"' + H.S(arg) + '"'; - }, null, null, 2, 0, null, 15, "call"] - } - }], ["path.internal_style", "package:path/src/internal_style.dart",, E, { - "^": "", - InternalStyle: { - "^": "Style;", - getRoot$1: function(path) { - var $length = this.rootLength$1(path); - if (J.$gt$n($length, 0)) - return J.substring$2$s(path, 0, $length); - return this.isRootRelative$1(path) ? J.$index$asx(path, 0) : null; - }, - relativePathToUri$1: function(path) { - var segments, t1; - segments = F.Context_Context(null, this).split$1(0, path); - t1 = J.getInterceptor$asx(path); - if (this.isSeparator$1(t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)))) - C.JSArray_methods.add$1(segments, ""); - return P.Uri_Uri(null, null, null, segments, null, null, null, "", ""); + call$1: function(line) { + return !J.$eq$(line, "\tat "); } - } - }], ["path.parsed_path", "package:path/src/parsed_path.dart",, Q, { - "^": "", - ParsedPath: { - "^": "Object;style,root,isRootRelative,parts,separators", - get$hasTrailingSeparator: function() { - var t1 = this.parts; - if (t1.length !== 0) - t1 = J.$eq$(C.JSArray_methods.get$last(t1), "") || !J.$eq$(C.JSArray_methods.get$last(this.separators), ""); - else - t1 = false; - return t1; - }, - removeTrailingSeparators$0: function() { - var t1, t2; - while (true) { - t1 = this.parts; - if (!(t1.length !== 0 && J.$eq$(C.JSArray_methods.get$last(t1), ""))) - break; - C.JSArray_methods.removeLast$0(this.parts); - C.JSArray_methods.removeLast$0(this.separators); - } - t1 = this.separators; - t2 = t1.length; - if (t2 > 0) - t1[t2 - 1] = ""; - }, - normalize$0: function() { - var newParts, t1, t2, leadingDoubles, _i, part, t3, newSeparators; - newParts = H.setRuntimeTypeInfo([], [P.String]); - for (t1 = this.parts, t2 = t1.length, leadingDoubles = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i) { - part = t1[_i]; - t3 = J.getInterceptor(part); - if (!(t3.$eq(part, ".") || t3.$eq(part, ""))) - if (t3.$eq(part, "..")) - if (newParts.length > 0) - newParts.pop(); - else - ++leadingDoubles; - else - newParts.push(part); - } - if (this.root == null) - C.JSArray_methods.insertAll$2(newParts, 0, P.List_List$filled(leadingDoubles, "..", false, null)); - if (newParts.length === 0 && this.root == null) - newParts.push("."); - newSeparators = P.List_List$generate(newParts.length, new Q.ParsedPath_normalize_closure(this), true, P.String); - t1 = this.root; - C.JSArray_methods.insert$2(newSeparators, 0, t1 != null && newParts.length > 0 && this.style.needsSeparator$1(t1) ? this.style.get$separator() : ""); - this.parts = newParts; - this.separators = newSeparators; - t1 = this.root; - if (t1 != null) { - t2 = this.style; - t3 = $.$get$Style_windows(); - t3 = t2 == null ? t3 == null : t2 === t3; - t2 = t3; - } else - t2 = false; - if (t2) - this.root = J.replaceAll$2$s(t1, "/", "\\"); - this.removeTrailingSeparators$0(); - }, - toString$0: function(_) { - var builder, t1, i; - builder = new P.StringBuffer(""); - t1 = this.root; - if (t1 != null) - builder._contents = H.S(t1); - for (i = 0; i < this.parts.length; ++i) { - t1 = this.separators; - if (i >= t1.length) - return H.ioore(t1, i); - builder._contents += H.S(t1[i]); - t1 = this.parts; - if (i >= t1.length) - return H.ioore(t1, i); - builder._contents += H.S(t1[i]); - } - t1 = builder._contents += H.S(C.JSArray_methods.get$last(this.separators)); - return t1.charCodeAt(0) == 0 ? t1 : t1; - }, - static: { - ParsedPath_ParsedPath$parse: function(path, style) { - var root, isRootRelative, parts, separators, t1, start, i, t2; - root = style.getRoot$1(path); - isRootRelative = style.isRootRelative$1(path); - if (root != null) - path = J.substring$1$s(path, J.get$length$asx(root)); - parts = H.setRuntimeTypeInfo([], [P.String]); - separators = H.setRuntimeTypeInfo([], [P.String]); - t1 = J.getInterceptor$asx(path); - if (t1.get$isNotEmpty(path) && style.isSeparator$1(t1.codeUnitAt$1(path, 0))) { - separators.push(t1.$index(path, 0)); - start = 1; - } else { - separators.push(""); - start = 0; - } - i = start; - while (true) { - t2 = t1.get$length(path); - if (typeof t2 !== "number") - return H.iae(t2); - if (!(i < t2)) - break; - if (style.isSeparator$1(t1.codeUnitAt$1(path, i))) { - parts.push(t1.substring$2(path, start, i)); - separators.push(t1.$index(path, i)); - start = i + 1; - } - ++i; - } - t2 = t1.get$length(path); - if (typeof t2 !== "number") - return H.iae(t2); - if (start < t2) { - parts.push(t1.substring$1(path, start)); - separators.push(""); - } - return new Q.ParsedPath(style, root, isRootRelative, parts, separators); - } + }, + Trace$parseJSCore_closure0: { + "^": "Closure:0;", + call$1: function(line) { + return A.Frame_Frame$parseV8(line); } }, - ParsedPath_normalize_closure: { - "^": "Closure:0;$this", + Trace$parseFirefox_closure: { + "^": "Closure:0;", + call$1: function(line) { + var t1 = J.getInterceptor$asx(line); + return t1.get$isNotEmpty(line) && !t1.$eq(line, "[native code]"); + } + }, + Trace$parseFirefox_closure0: { + "^": "Closure:0;", + call$1: function(line) { + return A.Frame_Frame$parseFirefox(line); + } + }, + Trace$parseFriendly_closure: { + "^": "Closure:0;", + call$1: function(line) { + return !J.startsWith$1$s(line, "====="); + } + }, + Trace$parseFriendly_closure0: { + "^": "Closure:0;", + call$1: function(line) { + return A.Frame_Frame$parseFriendly(line); + } + }, + Trace_terse_closure: { + "^": "Closure:0;", call$1: function(_) { - return this.$this.style.get$separator(); + return false; + } + }, + Trace_foldFrames_closure: { + "^": "Closure:0;oldPredicate", + call$1: function(frame) { + if (this.oldPredicate.call$1(frame) === true) + return true; + if (frame.get$isCore()) + return true; + if (J.$eq$(frame.get$$package(), "stack_trace")) + return true; + if (J.contains$1$asx(frame.get$member(), "<async>") !== true) + return false; + return frame.get$line() == null; + } + }, + Trace_foldFrames_closure0: { + "^": "Closure:0;_box_0", + call$1: function(frame) { + if (frame instanceof N.UnparsedFrame || this._box_0.predicate.call$1(frame) !== true) + return frame; + return new A.Frame(P.Uri_parse(J.replaceAll$2$s(frame.get$library(), $.$get$_terseRegExp(), ""), 0, null), null, null, frame.get$member()); + } + }, + Trace_toString_closure0: { + "^": "Closure:0;", + call$1: function(frame) { + return J.get$length$asx(J.get$location$x(frame)); + } + }, + Trace_toString_closure: { + "^": "Closure:0;longest", + call$1: function(frame) { + var t1 = J.getInterceptor(frame); + if (!!t1.$isUnparsedFrame) + return H.S(frame) + "\n"; + return H.S(B.padRight(t1.get$location(frame), this.longest)) + " " + H.S(frame.get$member()) + "\n"; } } - }], ["path.path_exception", "package:path/src/path_exception.dart",, E, { + }], ["", "package:stack_trace/src/unparsed_frame.dart",, N, { "^": "", - PathException: { - "^": "Object;message>", + UnparsedFrame: { + "^": "Object;uri<,line<,column<,isCore<,library<,$package<,location>,member<", toString$0: function(_) { - return "PathException: " + this.message; + return this.member; } } - }], ["path.style", "package:path/src/style.dart",, S, { + }], ["", "package:stack_trace/src/utils.dart",, B, { "^": "", - Style__getPlatformStyle: function() { - if (P.Uri_base().scheme !== "file") - return $.$get$Style_url(); - if (!C.JSString_methods.endsWith$1(P.Uri_base()._path, "/")) - return $.$get$Style_url(); - if (P.Uri_Uri(null, null, "a/b", null, null, null, null, "", "").toFilePath$0() === "a\\b") - return $.$get$Style_windows(); - return $.$get$Style_posix(); - }, - Style: { - "^": "Object;", - toString$0: function(_) { - return this.get$name(this); + padRight: function(string, $length) { + var t1, result, t2, i, t3; + t1 = J.getInterceptor$asx(string); + if (J.$ge$n(t1.get$length(string), $length)) + return string; + result = new P.StringBuffer(""); + result._contents = H.S(string); + t2 = J.getInterceptor$n($length); + i = 0; + while (true) { + t3 = t2.$sub($length, t1.get$length(string)); + if (typeof t3 !== "number") + return H.iae(t3); + if (!(i < t3)) + break; + result._contents += " "; + ++i; } + t1 = result._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; } - }], ["path.style.posix", "package:path/src/style/posix.dart",, Z, { + }], ["", "package:stream_channel/src/guarantee_channel.dart",, K, { "^": "", - PosixStyle: { - "^": "InternalStyle;name>,separator<,separators,separatorPattern,needsSeparatorPattern,rootPattern,relativeRootPattern", - containsSeparator$1: function(path) { - return J.contains$1$asx(path, "/"); - }, - isSeparator$1: function(codeUnit) { - return codeUnit === 47; - }, - needsSeparator$1: function(path) { - var t1 = J.getInterceptor$asx(path); - return t1.get$isNotEmpty(path) && t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)) !== 47; - }, - rootLength$1: function(path) { - var t1 = J.getInterceptor$asx(path); - if (t1.get$isNotEmpty(path) && t1.codeUnitAt$1(path, 0) === 47) - return 1; - return 0; + GuaranteeChannel: { + "^": "StreamChannelMixin;_sink,_streamController,_guarantee_channel$_subscription,_disconnected", + _onSinkDisconnected$0: function() { + this._disconnected = true; + var t1 = this._guarantee_channel$_subscription; + if (t1 != null) + t1.cancel$0(); + this._streamController.close$0(0); }, - isRootRelative$1: function(path) { - return false; + GuaranteeChannel$3$allowSinkErrors: function(innerSink, allowSinkErrors, _box_0, $T) { + this._sink = H.setRuntimeTypeInfo(new K._GuaranteeSink(innerSink, this, H.setRuntimeTypeInfo(new P._AsyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]), false, false, null, null, true), [$T]); + this._streamController = P.StreamController_StreamController(null, new K.GuaranteeChannel_closure(_box_0, this), null, null, true, $T); }, - pathFromUri$1: function(uri) { - var t1 = uri.scheme; - if (t1 === "" || t1 === "file") { - t1 = uri._path; - return P.Uri__uriDecode(t1, 0, t1.length, C.Utf8Codec_false, false); + static: { + GuaranteeChannel$: function(innerStream, innerSink, allowSinkErrors, $T) { + var t1, t2; + t1 = {}; + t1.innerStream = innerStream; + t2 = H.setRuntimeTypeInfo(new K.GuaranteeChannel(null, null, null, false), [$T]); + t2.GuaranteeChannel$3$allowSinkErrors(innerSink, true, t1, $T); + return t2; } - throw H.wrapException(P.ArgumentError$("Uri " + J.toString$0$(uri) + " must have scheme 'file:'.")); - }, - absolutePathToUri$1: function(path) { - var parsed, t1; - parsed = Q.ParsedPath_ParsedPath$parse(path, this); - t1 = parsed.parts; - if (t1.length === 0) - C.JSArray_methods.addAll$1(t1, ["", ""]); - else if (parsed.get$hasTrailingSeparator()) - C.JSArray_methods.add$1(parsed.parts, ""); - return P.Uri_Uri(null, null, null, parsed.parts, null, null, null, "file", ""); } - } - }], ["path.style.url", "package:path/src/style/url.dart",, E, { - "^": "", - UrlStyle: { - "^": "InternalStyle;name>,separator<,separators,separatorPattern,needsSeparatorPattern,rootPattern,relativeRootPattern", - containsSeparator$1: function(path) { - return J.contains$1$asx(path, "/"); - }, - isSeparator$1: function(codeUnit) { - return codeUnit === 47; - }, - needsSeparator$1: function(path) { - var t1, t2; - t1 = J.getInterceptor$asx(path); - if (t1.get$isEmpty(path) === true) - return false; - if (t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)) !== 47) - return true; - if (t1.endsWith$1(path, "://")) { - t2 = this.rootLength$1(path); - t1 = t1.get$length(path); - t1 = t2 == null ? t1 == null : t2 === t1; - } else - t1 = false; - return t1; + }, + GuaranteeChannel_closure: { + "^": "Closure:1;_box_0,$this", + call$0: function() { + var t1, t2, t3; + t1 = this.$this; + if (t1._disconnected) + return; + t2 = this._box_0.innerStream; + t3 = t1._streamController; + t1._guarantee_channel$_subscription = t2.listen$3$onDone$onError(t3.get$add(t3), new K.GuaranteeChannel__closure(t1), t1._streamController.get$addError()); + } + }, + GuaranteeChannel__closure: { + "^": "Closure:1;$this", + call$0: function() { + var t1 = this.$this; + t1._sink._onStreamDisconnected$0(); + t1._streamController.close$0(0); + } + }, + _GuaranteeSink: { + "^": "Object;_guarantee_channel$_inner,_channel,_doneCompleter,_disconnected,_closed,_addStreamSubscription,_addStreamCompleter,_allowErrors", + add$1: function(_, data) { + var t1; + if (this._closed) + throw H.wrapException(new P.StateError("Cannot add event after closing.")); + if (this._addStreamSubscription != null) + throw H.wrapException(new P.StateError("Cannot add event while adding stream.")); + if (this._disconnected) + return; + t1 = this._guarantee_channel$_inner._async$_target; + if (t1._state >= 4) + H.throwExpression(t1._badEventState$0()); + t1._async$_add$1(data); }, - rootLength$1: function(path) { - var t1, index; - t1 = J.getInterceptor$asx(path); - if (t1.get$isEmpty(path) === true) - return 0; - if (t1.codeUnitAt$1(path, 0) === 47) - return 1; - index = t1.indexOf$1(path, "/"); - if (index > 0 && t1.startsWith$2(path, "://", index - 1)) { - index = t1.indexOf$2(path, "/", index + 2); - if (index > 0) - return index; - return t1.get$length(path); + addError$2: [function(error, stackTrace) { + if (this._closed) + throw H.wrapException(new P.StateError("Cannot add event after closing.")); + if (this._addStreamSubscription != null) + throw H.wrapException(new P.StateError("Cannot add event while adding stream.")); + if (this._disconnected) + return; + this._addError$2(error, stackTrace); + }, function(error) { + return this.addError$2(error, null); + }, "addError$1", "call$2", "call$1", "get$addError", 2, 2, 6, 0], + _addError$2: [function(error, stackTrace) { + this._guarantee_channel$_inner._async$_target.addError$2(error, stackTrace); + return; + }, function(error) { + return this._addError$2(error, null); + }, "_addError$1", "call$2", "call$1", "get$_addError", 2, 2, 6, 0], + addStream$1: function(stream) { + var t1, t2, t3; + if (this._closed) + throw H.wrapException(new P.StateError("Cannot add stream after closing.")); + if (this._addStreamSubscription != null) + throw H.wrapException(new P.StateError("Cannot add stream while adding stream.")); + if (this._disconnected) { + t1 = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); + t1._asyncComplete$1(null); + return t1; } - return 0; - }, - isRootRelative$1: function(path) { - var t1 = J.getInterceptor$asx(path); - return t1.get$isNotEmpty(path) && t1.codeUnitAt$1(path, 0) === 47; - }, - pathFromUri$1: function(uri) { - return J.toString$0$(uri); + this._addStreamCompleter = H.setRuntimeTypeInfo(new P._SyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]); + t1 = this._guarantee_channel$_inner; + t1 = t1.get$add(t1); + t2 = this.get$_addError(); + t3 = this._addStreamCompleter; + this._addStreamSubscription = stream.listen$3$onDone$onError(t1, t3.get$complete(t3), t2); + return this._addStreamCompleter.future.then$1(new K._GuaranteeSink_addStream_closure(this)); }, - relativePathToUri$1: function(path) { - return P.Uri_parse(path, 0, null); + close$0: function(_) { + if (this._addStreamSubscription != null) + throw H.wrapException(new P.StateError("Cannot close sink while adding stream.")); + if (this._closed) + return this._doneCompleter.future; + this._closed = true; + if (!this._disconnected) { + this._channel._onSinkDisconnected$0(); + this._doneCompleter.complete$1(0, this._guarantee_channel$_inner._async$_target.close$0(0)); + } + return this._doneCompleter.future; }, - absolutePathToUri$1: function(path) { - return P.Uri_parse(path, 0, null); + _onStreamDisconnected$0: function() { + this._disconnected = true; + var t1 = this._doneCompleter; + if (t1.future._state === 0) + t1.complete$0(0); + t1 = this._addStreamSubscription; + if (t1 == null) + return; + this._addStreamCompleter.complete$1(0, t1.cancel$0()); + this._addStreamCompleter = null; + this._addStreamSubscription = null; + } + }, + _GuaranteeSink_addStream_closure: { + "^": "Closure:0;$this", + call$1: function(_) { + var t1 = this.$this; + t1._addStreamCompleter = null; + t1._addStreamSubscription = null; } } - }], ["path.style.windows", "package:path/src/style/windows.dart",, T, { + }], ["", "package:stream_channel/src/multi_channel.dart",, D, { "^": "", - WindowsStyle: { - "^": "InternalStyle;name>,separator<,separators,separatorPattern,needsSeparatorPattern,rootPattern,relativeRootPattern", - containsSeparator$1: function(path) { - return J.contains$1$asx(path, "/"); - }, - isSeparator$1: function(codeUnit) { - return codeUnit === 47 || codeUnit === 92; - }, - needsSeparator$1: function(path) { - var t1 = J.getInterceptor$asx(path); - if (t1.get$isEmpty(path) === true) - return false; - t1 = t1.codeUnitAt$1(path, J.$sub$n(t1.get$length(path), 1)); - return !(t1 === 47 || t1 === 92); - }, - rootLength$1: function(path) { - var t1, index, t2; - t1 = J.getInterceptor$asx(path); - if (t1.get$isEmpty(path) === true) - return 0; - if (t1.codeUnitAt$1(path, 0) === 47) - return 1; - if (t1.codeUnitAt$1(path, 0) === 92) { - if (J.$lt$n(t1.get$length(path), 2) || t1.codeUnitAt$1(path, 1) !== 92) - return 1; - index = t1.indexOf$2(path, "\\", 2); - if (index > 0) { - index = t1.indexOf$2(path, "\\", index + 1); - if (index > 0) - return index; - } - return t1.get$length(path); + _MultiChannel: { + "^": "StreamChannelMixin;_multi_channel$_inner,_innerStreamSubscription,_mainController,_controllers,_nextId", + virtualChannel$1: function(id) { + var t1, t2, inputId, t3, controller; + t1 = {}; + t1.inputId = null; + t1.outputId = null; + if (id != null) { + t1.inputId = id; + t1.outputId = H.intTypeCast(id) + 1; + t2 = id; + } else { + t2 = this._nextId; + inputId = t2 + 1; + t1.inputId = inputId; + t1.outputId = t2; + this._nextId = t2 + 2; + t2 = inputId; } - if (J.$lt$n(t1.get$length(path), 3)) - return 0; - t2 = t1.codeUnitAt$1(path, 0); - if (!(t2 >= 65 && t2 <= 90)) - t2 = t2 >= 97 && t2 <= 122; - else - t2 = true; - if (!t2) - return 0; - if (t1.codeUnitAt$1(path, 1) !== 58) - return 0; - t1 = t1.codeUnitAt$1(path, 2); - if (!(t1 === 47 || t1 === 92)) - return 0; - return 3; + if (this._multi_channel$_inner == null) { + t1 = H.setRuntimeTypeInfo(new P._EmptyStream(), [null]); + t3 = H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null]); + t3._asyncComplete$1(null); + return new D.VirtualChannel(this, t2, t1, H.setRuntimeTypeInfo(new S.NullStreamSink(t3, false, false), [null])); + } + t3 = this._controllers; + if (t3.containsKey$1(t2)) + throw H.wrapException(P.ArgumentError$("A virtual channel with id " + H.S(id) + " already exists.")); + controller = B.StreamChannelController$(true, true, null); + t3.$indexSet(0, t2, controller); + t2 = controller._local._streamController; + t2.toString; + H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]).listen$2$onDone(new D._MultiChannel_virtualChannel_closure(t1, this), new D._MultiChannel_virtualChannel_closure0(t1, this)); + t1 = t1.outputId; + t2 = controller._foreign._streamController; + t2.toString; + return new D.VirtualChannel(this, t1, H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]), controller._foreign._sink); }, - isRootRelative$1: function(path) { - return this.rootLength$1(path) === 1; + _closeChannel$2: function(inputId, outputId) { + var t1, t2; + t1 = this._controllers; + t1.remove$1(0, inputId).get$local()._sink.close$0(0); + t2 = this._multi_channel$_inner; + if (t2 == null) + return; + t2._sink.add$1(0, [outputId]); + if (t1.get$isEmpty(t1)) + this._closeInnerChannel$0(); }, - pathFromUri$1: function(uri) { - var t1, path; - t1 = uri.scheme; - if (t1 !== "" && t1 !== "file") - throw H.wrapException(P.ArgumentError$("Uri " + J.toString$0$(uri) + " must have scheme 'file:'.")); - path = uri._path; - if (uri.get$host(uri) === "") { - if (C.JSString_methods.startsWith$1(path, "/")) - path = C.JSString_methods.replaceFirst$2(path, "/", ""); - } else - path = "\\\\" + H.S(uri.get$host(uri)) + path; - H.checkString("\\"); - t1 = H.stringReplaceAllUnchecked(path, "/", "\\"); - return P.Uri__uriDecode(t1, 0, t1.length, C.Utf8Codec_false, false); + _closeInnerChannel$0: [function() { + var t1, t2, t3, _i; + this._multi_channel$_inner._sink.close$0(0); + this._innerStreamSubscription.cancel$0(); + this._multi_channel$_inner = null; + for (t1 = this._controllers, t2 = P.List_List$from(t1.get$values(t1), true, null), t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, H.throwConcurrentModificationError)(t2), ++_i) + t2[_i].get$local()._sink.close$0(0); + t1.clear$0(0); + }, "call$0", "get$_closeInnerChannel", 0, 0, 2], + _MultiChannel$1: function(_inner) { + var t1, t2; + t1 = this._mainController; + this._controllers.$indexSet(0, 0, t1); + t2 = t1._local._streamController; + t2.toString; + H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]).listen$2$onDone(new D._MultiChannel_closure(this), new D._MultiChannel_closure0(this)); + t2 = this._multi_channel$_inner._streamController; + t2.toString; + this._innerStreamSubscription = H.setRuntimeTypeInfo(new P._ControllerStream(t2), [H.getTypeArgumentByIndex(t2, 0)]).listen$3$onDone$onError(new D._MultiChannel_closure1(this), this.get$_closeInnerChannel(), t1._local._sink.get$addError()); }, - absolutePathToUri$1: function(path) { - var parsed, t1, rootParts, t2; - parsed = Q.ParsedPath_ParsedPath$parse(path, this); - if (J.startsWith$1$s(parsed.root, "\\\\")) { - t1 = J.split$1$s(parsed.root, "\\"); - rootParts = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new T.WindowsStyle_absolutePathToUri_closure()), [H.getTypeArgumentByIndex(t1, 0)]); - C.JSArray_methods.insert$2(parsed.parts, 0, rootParts.get$last(rootParts)); - if (parsed.get$hasTrailingSeparator()) - C.JSArray_methods.add$1(parsed.parts, ""); - return P.Uri_Uri(null, rootParts.get$first(rootParts), null, parsed.parts, null, null, null, "file", ""); - } else { - if (parsed.parts.length === 0 || parsed.get$hasTrailingSeparator()) - C.JSArray_methods.add$1(parsed.parts, ""); - t1 = parsed.parts; - t2 = J.replaceAll$2$s(parsed.root, "/", ""); - H.checkString(""); - C.JSArray_methods.insert$2(t1, 0, H.stringReplaceAllUnchecked(t2, "\\", "")); - return P.Uri_Uri(null, null, null, parsed.parts, null, null, null, "file", ""); + static: { + _MultiChannel$: function(_inner) { + var t1 = new D._MultiChannel(_inner, null, B.StreamChannelController$(true, true, null), P.LinkedHashMap_LinkedHashMap$_empty(P.$int, B.StreamChannelController), 1); + t1._MultiChannel$1(_inner); + return t1; } } }, - WindowsStyle_absolutePathToUri_closure: { - "^": "Closure:0;", - call$1: function(part) { - return !J.$eq$(part, ""); + _MultiChannel_closure: { + "^": "Closure:0;$this", + call$1: function(message) { + return this.$this._multi_channel$_inner._sink.add$1(0, [0, message]); } - } - }], ["", "package:stream_channel/stream_channel.dart",, R, { - "^": "", - StreamChannelMixin: { - "^": "Object;" + }, + _MultiChannel_closure0: { + "^": "Closure:1;$this", + call$0: function() { + return this.$this._closeChannel$2(0, 0); + } + }, + _MultiChannel_closure1: { + "^": "Closure:0;$this", + call$1: function(message) { + var t1, controller; + t1 = J.getInterceptor$asx(message); + controller = this.$this._controllers.$index(0, t1.$index(message, 0)); + if (controller == null) + return; + if (J.$gt$n(t1.get$length(message), 1)) { + controller._local._sink.add$1(0, t1.$index(message, 1)); + return; + } + controller._local._sink.close$0(0); + } + }, + _MultiChannel_virtualChannel_closure: { + "^": "Closure:0;_box_0,$this", + call$1: function(message) { + return this.$this._multi_channel$_inner._sink.add$1(0, [this._box_0.outputId, message]); + } + }, + _MultiChannel_virtualChannel_closure0: { + "^": "Closure:1;_box_0,$this", + call$0: function() { + var t1 = this._box_0; + return this.$this._closeChannel$2(t1.inputId, t1.outputId); + } + }, + VirtualChannel: { + "^": "StreamChannelMixin;_parent,id,stream,sink" } }], ["", "package:stream_channel/src/stream_channel_controller.dart",, B, { "^": "", @@ -15053,263 +15010,174 @@ static: { StreamChannelController$: function(allowForeignErrors, sync, $T) { var t1 = H.setRuntimeTypeInfo(new B.StreamChannelController(null, null), [$T]); - t1.StreamChannelController$2$allowForeignErrors$sync(true, true, $T); - return t1; - } - } - } - }], ["", "package:stack_trace/src/trace.dart",, Y, { - "^": "", - Trace: { - "^": "Object;frames<", - get$terse: function() { - return this.foldFrames$2$terse(new Y.Trace_terse_closure(), true); - }, - foldFrames$2$terse: function(predicate, terse) { - var t1, newFrames, t2, frame; - t1 = {}; - t1.predicate = predicate; - t1.predicate = new Y.Trace_foldFrames_closure(predicate); - newFrames = H.setRuntimeTypeInfo([], [A.Frame]); - for (t2 = this.frames, t2 = H.setRuntimeTypeInfo(new H.ReversedListIterable(t2), [H.getTypeArgumentByIndex(t2, 0)]), t2 = new H.ListIterator(t2, t2.get$length(t2), 0, null); t2.moveNext$0();) { - frame = t2._current; - if (frame instanceof N.UnparsedFrame || t1.predicate.call$1(frame) !== true) - newFrames.push(frame); - else if (newFrames.length === 0 || t1.predicate.call$1(C.JSArray_methods.get$last(newFrames)) !== true) - newFrames.push(new A.Frame(frame.get$uri(), frame.get$line(), frame.get$column(), frame.get$member())); - } - newFrames = H.setRuntimeTypeInfo(new H.MappedListIterable(newFrames, new Y.Trace_foldFrames_closure0(t1)), [null, null]).toList$0(0); - if (newFrames.length > 1 && C.JSArray_methods.get$first(newFrames).get$isCore()) - C.JSArray_methods.removeAt$1(newFrames, 0); - return new Y.Trace(P.List_List$unmodifiable(H.setRuntimeTypeInfo(new H.ReversedListIterable(newFrames), [H.getTypeArgumentByIndex(newFrames, 0)]), A.Frame)); - }, - toString$0: function(_) { - var t1 = this.frames; - return H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new Y.Trace_toString_closure(H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new Y.Trace_toString_closure0()), [null, null]).fold$2(0, 0, P.math__max$closure()))), [null, null]).join$0(0); - }, - $isStackTrace: 1, - static: { - Trace_Trace$from: function(trace) { - var t1; - if (trace == null) - throw H.wrapException(P.ArgumentError$("Cannot create a Trace from null.")); - t1 = J.getInterceptor(trace); - if (!!t1.$isTrace) - return trace; - if (!!t1.$isChain) - return trace.toTrace$0(); - return new T.LazyTrace(new Y.closure(trace), null); - }, - Trace_Trace$parse: function(trace) { - var error, t1, exception; - try { - if (J.get$isEmpty$asx(trace) === true) { - t1 = P.List_List$unmodifiable(H.setRuntimeTypeInfo([], [A.Frame]), A.Frame); - return new Y.Trace(t1); - } - if (J.contains$1$asx(trace, $.$get$_v8Trace()) === true) { - t1 = Y.Trace$parseV8(trace); - return t1; - } - if (J.contains$1$asx(trace, "\tat ") === true) { - t1 = Y.Trace$parseJSCore(trace); - return t1; - } - if (J.contains$1$asx(trace, $.$get$_firefoxSafariTrace()) === true) { - t1 = Y.Trace$parseFirefox(trace); - return t1; - } - if (J.contains$1$asx(trace, "===== asynchronous gap ===========================\n") === true) { - t1 = U.Chain_Chain$parse(trace).toTrace$0(); - return t1; - } - if (J.contains$1$asx(trace, $.$get$_friendlyTrace()) === true) { - t1 = Y.Trace$parseFriendly(trace); - return t1; - } - t1 = P.List_List$unmodifiable(Y.Trace__parseVM(trace), A.Frame); - return new Y.Trace(t1); - } catch (exception) { - t1 = H.unwrapException(exception); - if (t1 instanceof P.FormatException) { - error = t1; - throw H.wrapException(new P.FormatException(H.S(J.get$message$x(error)) + "\nStack trace:\n" + H.S(trace), null, null)); - } else - throw exception; - } - }, - Trace__parseVM: function(trace) { - var lines, t1, $frames; - lines = J.trim$0$s(trace).split("\n"); - t1 = H.SubListIterable$(lines, 0, lines.length - 1, H.getTypeArgumentByIndex(lines, 0)); - $frames = H.setRuntimeTypeInfo(new H.MappedListIterable(t1, new Y.Trace__parseVM_closure()), [H.getRuntimeTypeArgument(t1, "ListIterable", 0), null]).toList$0(0); - if (!J.endsWith$1$s(C.JSArray_methods.get$last(lines), ".da")) - C.JSArray_methods.add$1($frames, A.Frame_Frame$parseVM(C.JSArray_methods.get$last(lines))); - return $frames; - }, - Trace$parseV8: function(trace) { - var t1 = J.split$1$s(trace, "\n"); - t1 = H.SubListIterable$(t1, 1, null, H.getTypeArgumentByIndex(t1, 0)); - t1 = t1.super$Iterable$skipWhile(t1, new Y.Trace$parseV8_closure()); - return new Y.Trace(P.List_List$unmodifiable(H.MappedIterable_MappedIterable(t1, new Y.Trace$parseV8_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null), A.Frame)); - }, - Trace$parseJSCore: function(trace) { - var t1 = J.split$1$s(trace, "\n"); - t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new Y.Trace$parseJSCore_closure()), [H.getTypeArgumentByIndex(t1, 0)]); - return new Y.Trace(P.List_List$unmodifiable(H.MappedIterable_MappedIterable(t1, new Y.Trace$parseJSCore_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null), A.Frame)); - }, - Trace$parseFirefox: function(trace) { - var t1 = J.trim$0$s(trace).split("\n"); - t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new Y.Trace$parseFirefox_closure()), [H.getTypeArgumentByIndex(t1, 0)]); - return new Y.Trace(P.List_List$unmodifiable(H.MappedIterable_MappedIterable(t1, new Y.Trace$parseFirefox_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null), A.Frame)); - }, - Trace$parseFriendly: function(trace) { - var t1 = J.getInterceptor$asx(trace); - if (t1.get$isEmpty(trace) === true) - t1 = []; - else { - t1 = t1.trim$0(trace).split("\n"); - t1 = H.setRuntimeTypeInfo(new H.WhereIterable(t1, new Y.Trace$parseFriendly_closure()), [H.getTypeArgumentByIndex(t1, 0)]); - t1 = H.MappedIterable_MappedIterable(t1, new Y.Trace$parseFriendly_closure0(), H.getRuntimeTypeArgument(t1, "Iterable", 0), null); - } - return new Y.Trace(P.List_List$unmodifiable(t1, A.Frame)); + t1.StreamChannelController$2$allowForeignErrors$sync(true, true, $T); + return t1; } } + } + }], ["", "package:stream_channel/stream_channel.dart",, R, { + "^": "", + StreamChannelMixin: { + "^": "Object;" + } + }], ["", "host.dart",, M, { + "^": "", + main: [function() { + var t1 = self.testRunner; + if (!(t1 == null)) + J.waitUntilDone$0$x(t1); + P.runZoned(new M.main_closure(), new M.main_closure0(), null, null); + }, "call$0", "host__main$closure", 0, 0, 2], + _connectToServer: function() { + var webSocket, controller, t1; + webSocket = W.WebSocket_WebSocket(P.Uri_parse(window.location.href, 0, null).get$queryParameters().$index(0, "managerUrl"), null); + controller = B.StreamChannelController$(true, true, null); + t1 = H.setRuntimeTypeInfo(new W._EventStream(webSocket, "message", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_message, 0)]); + H.setRuntimeTypeInfo(new W._EventStreamSubscription(0, t1._html$_target, t1._eventType, W._wrapZone(new M._connectToServer_closure(controller)), false), [H.getTypeArgumentByIndex(t1, 0)])._tryResume$0(); + t1 = controller._local._streamController; + t1.toString; + H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).listen$1(new M._connectToServer_closure0(webSocket)); + return D._MultiChannel$(controller._foreign); }, - closure: { - "^": "Closure:1;trace", - call$0: function() { - return Y.Trace_Trace$parse(J.toString$0$(this.trace)); - } + _connectToIframe: function(url, id) { + var t1, iframe, controller, readyCompleter; + t1 = document; + iframe = t1.createElement("iframe"); + $.$get$_iframes().$indexSet(0, id, iframe); + J.set$src$x(iframe, url); + document.body.appendChild(iframe); + controller = B.StreamChannelController$(true, true, null); + readyCompleter = H.setRuntimeTypeInfo(new P._AsyncCompleter(H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null), [null])), [null]); + t1 = H.setRuntimeTypeInfo(new W._EventStream(window, "message", false), [H.getTypeArgumentByIndex(C.EventStreamProvider_message, 0)]); + H.setRuntimeTypeInfo(new W._EventStreamSubscription(0, t1._html$_target, t1._eventType, W._wrapZone(new M._connectToIframe_closure(iframe, controller, readyCompleter)), false), [H.getTypeArgumentByIndex(t1, 0)])._tryResume$0(); + t1 = controller._local._streamController; + t1.toString; + H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).listen$1(new M._connectToIframe_closure0(iframe, readyCompleter)); + return controller._foreign; }, - Trace__parseVM_closure: { - "^": "Closure:0;", - call$1: [function(line) { - return A.Frame_Frame$parseVM(line); - }, null, null, 2, 0, null, 10, "call"] + _TestRunner: { + "^": "JavaScriptObject;", + "%": "" }, - Trace$parseV8_closure: { - "^": "Closure:0;", - call$1: function(line) { - return !J.startsWith$1$s(line, $.$get$_v8TraceLine()); + main_closure: { + "^": "Closure:1;", + call$0: function() { + var serverChannel, t1; + serverChannel = M._connectToServer(); + t1 = serverChannel._mainController._foreign._streamController; + t1.toString; + H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).listen$1(new M.main__closure(serverChannel)); + P.Timer_Timer$periodic(P.Duration$(0, 0, 0, 0, 0, 1), new M.main__closure0(serverChannel)); + t1 = J.get$onClick$x(document.querySelector("#play")); + H.setRuntimeTypeInfo(new W._EventStreamSubscription(0, t1._html$_target, t1._eventType, W._wrapZone(new M.main__closure1(serverChannel)), false), [H.getTypeArgumentByIndex(t1, 0)])._tryResume$0(); } }, - Trace$parseV8_closure0: { - "^": "Closure:0;", - call$1: [function(line) { - return A.Frame_Frame$parseV8(line); - }, null, null, 2, 0, null, 10, "call"] - }, - Trace$parseJSCore_closure: { - "^": "Closure:0;", - call$1: function(line) { - return !J.$eq$(line, "\tat "); + main__closure: { + "^": "Closure:0;serverChannel", + call$1: function(message) { + var t1, suiteChannel, iframeChannel; + t1 = J.getInterceptor$asx(message); + if (J.$eq$(t1.$index(message, "command"), "loadSuite")) { + suiteChannel = this.serverChannel.virtualChannel$1(t1.$index(message, "channel")); + iframeChannel = M._connectToIframe(t1.$index(message, "url"), t1.$index(message, "id")); + suiteChannel.stream.pipe$1(iframeChannel._sink); + t1 = iframeChannel._streamController; + t1.toString; + H.setRuntimeTypeInfo(new P._ControllerStream(t1), [H.getTypeArgumentByIndex(t1, 0)]).pipe$1(suiteChannel.sink); + } else if (J.$eq$(t1.$index(message, "command"), "displayPause")) { + t1 = document.body; + t1.toString; + W._ElementCssClassSet__add(t1, "paused"); + } else if (J.$eq$(t1.$index(message, "command"), "resume")) { + t1 = document.body; + t1.toString; + W._ElementCssClassSet__remove(t1, "paused"); + } else + J.remove$0$ax($.$get$_iframes().$index(0, t1.$index(message, "id"))); } }, - Trace$parseJSCore_closure0: { - "^": "Closure:0;", - call$1: [function(line) { - return A.Frame_Frame$parseV8(line); - }, null, null, 2, 0, null, 10, "call"] - }, - Trace$parseFirefox_closure: { - "^": "Closure:0;", - call$1: function(line) { - var t1 = J.getInterceptor$asx(line); - return t1.get$isNotEmpty(line) && !t1.$eq(line, "[native code]"); + main__closure0: { + "^": "Closure:0;serverChannel", + call$1: function(_) { + return this.serverChannel._mainController._foreign._sink.add$1(0, P.LinkedHashMap__makeLiteral(["command", "ping"])); } }, - Trace$parseFirefox_closure0: { - "^": "Closure:0;", - call$1: [function(line) { - return A.Frame_Frame$parseFirefox(line); - }, null, null, 2, 0, null, 10, "call"] - }, - Trace$parseFriendly_closure: { - "^": "Closure:0;", - call$1: function(line) { - return !J.startsWith$1$s(line, "====="); + main__closure1: { + "^": "Closure:0;serverChannel", + call$1: function(_) { + var t1 = document.body; + t1.toString; + W._ElementCssClassSet__remove(t1, "paused"); + this.serverChannel._mainController._foreign._sink.add$1(0, P.LinkedHashMap__makeLiteral(["command", "resume"])); } }, - Trace$parseFriendly_closure0: { - "^": "Closure:0;", - call$1: [function(line) { - return A.Frame_Frame$parseFriendly(line); - }, null, null, 2, 0, null, 10, "call"] - }, - Trace_terse_closure: { - "^": "Closure:0;", - call$1: function(_) { - return false; + main_closure0: { + "^": "Closure:3;", + call$2: function(error, stackTrace) { + P.print(H.S(error) + "\n" + H.S(Y.Trace_Trace$from(stackTrace).get$terse())); } }, - Trace_foldFrames_closure: { - "^": "Closure:0;oldPredicate", - call$1: function(frame) { - if (this.oldPredicate.call$1(frame) === true) - return true; - if (frame.get$isCore()) - return true; - if (J.$eq$(frame.get$$package(), "stack_trace")) - return true; - if (J.contains$1$asx(frame.get$member(), "<async>") !== true) - return false; - return frame.get$line() == null; + _connectToServer_closure: { + "^": "Closure:0;controller", + call$1: function(message) { + this.controller._local._sink.add$1(0, C.JsonCodec_null_null.decode$1(J.get$data$x(message))); } }, - Trace_foldFrames_closure0: { - "^": "Closure:0;_box_0", - call$1: [function(frame) { - var t1, t2; - if (frame instanceof N.UnparsedFrame || this._box_0.predicate.call$1(frame) !== true) - return frame; - t1 = frame.get$library(); - t2 = $.$get$_terseRegExp(); - H.checkString(""); - return new A.Frame(P.Uri_parse(H.stringReplaceAllUnchecked(t1, t2, ""), 0, null), null, null, frame.get$member()); - }, null, null, 2, 0, null, 11, "call"] + _connectToServer_closure0: { + "^": "Closure:0;webSocket", + call$1: function(message) { + return this.webSocket.send(C.JsonCodec_null_null.encode$1(message)); + } }, - Trace_toString_closure0: { - "^": "Closure:0;", - call$1: [function(frame) { - return J.get$length$asx(J.get$location$x(frame)); - }, null, null, 2, 0, null, 11, "call"] + _connectToIframe_closure: { + "^": "Closure:0;iframe,controller,readyCompleter", + call$1: function(message) { + var t1, t2, t3; + t1 = J.getInterceptor$x(message); + t2 = t1.get$origin(message); + t3 = window.location; + if (t2 !== (t3 && C.Location_methods).get$origin(t3)) + return; + if (!J.$eq$(J.$index$asx(t1.get$data(message), "href"), J.get$src$x(this.iframe))) + return; + t1.stopPropagation$0(message); + if (J.$eq$(J.$index$asx(t1.get$data(message), "ready"), true)) + this.readyCompleter.complete$0(0); + else + this.controller._local._sink.add$1(0, J.$index$asx(t1.get$data(message), "data")); + } }, - Trace_toString_closure: { - "^": "Closure:0;longest", - call$1: [function(frame) { - var t1 = J.getInterceptor(frame); - if (!!t1.$isUnparsedFrame) - return H.S(frame) + "\n"; - return H.S(B.padRight(t1.get$location(frame), this.longest)) + " " + H.S(frame.get$member()) + "\n"; - }, null, null, 2, 0, null, 11, "call"] - } - }], ["", "package:stack_trace/src/unparsed_frame.dart",, N, { - "^": "", - UnparsedFrame: { - "^": "Object;uri<,line<,column<,isCore<,library<,$package<,location>,member<", - toString$0: function(_) { - return this.member; + _connectToIframe_closure0: { + "^": "Closure:49;iframe,readyCompleter", + call$1: function(message) { + var $async$goto = 0, $async$completer = new P.Completer_Completer$sync(), $async$handler = 1, $async$currentError, $async$self = this, t1, t2; + var $async$call$1 = P._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return P._asyncHelper($async$self.readyCompleter.future, $async$call$1, $async$completer); + case 2: + // returning from await. + t1 = J.get$contentWindow$x($async$self.iframe); + t2 = window.location; + J.postMessage$2$x(t1, message, (t2 && C.Location_methods).get$origin(t2)); + // implicit return + return P._asyncHelper(null, 0, $async$completer, null); + case 1: + // rethrow + return P._asyncHelper($async$currentError, 1, $async$completer); + } + }); + return P._asyncHelper(null, $async$call$1, $async$completer, null); } } - }], ["", "package:stack_trace/src/utils.dart",, B, { - "^": "", - padRight: function(string, $length) { - var t1, t2, result, i; - t1 = J.getInterceptor$asx(string); - t2 = t1.get$length(string); - if (typeof $length !== "number") - return H.iae($length); - if (t2 >= $length) - return string; - result = new P.StringBuffer(""); - result._contents = H.S(string); - for (i = 0; i < $length - t1.get$length(string); ++i) - result._contents += " "; - t1 = result._contents; - return t1.charCodeAt(0) == 0 ? t1 : t1; - } - }]]; + }, 1]]; setupProgram(dart, 0); // getInterceptor methods J.getInterceptor = function(receiver) { @@ -15409,6 +15277,9 @@ J.set$src$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$src(receiver, value); }; + J.get$codeUnits$s = function(receiver) { + return J.getInterceptor$s(receiver).get$codeUnits(receiver); + }; J.get$contentWindow$x = function(receiver) { return J.getInterceptor$x(receiver).get$contentWindow(receiver); }; @@ -15427,9 +15298,6 @@ J.get$iterator$ax = function(receiver) { return J.getInterceptor$ax(receiver).get$iterator(receiver); }; - J.get$last$ax = function(receiver) { - return J.getInterceptor$ax(receiver).get$last(receiver); - }; J.get$length$asx = function(receiver) { return J.getInterceptor$asx(receiver).get$length(receiver); }; @@ -15445,12 +15313,6 @@ J.get$parent$x = function(receiver) { return J.getInterceptor$x(receiver).get$parent(receiver); }; - J.get$print$x = function(receiver) { - return J.getInterceptor$x(receiver).get$print(receiver); - }; - J.get$result$x = function(receiver) { - return J.getInterceptor$x(receiver).get$result(receiver); - }; J.get$src$x = function(receiver) { return J.getInterceptor$x(receiver).get$src(receiver); }; @@ -15459,11 +15321,6 @@ return receiver + a0; return J.getInterceptor$ns(receiver).$add(receiver, a0); }; - J.$and$n = function(receiver, a0) { - if (typeof receiver == "number" && typeof a0 == "number") - return (receiver & a0) >>> 0; - return J.getInterceptor$n(receiver).$and(receiver, a0); - }; J.$ge$n = function(receiver, a0) { if (typeof receiver == "number" && typeof a0 == "number") return receiver >= a0; @@ -15502,28 +15359,17 @@ return receiver * a0; return J.getInterceptor$ns(receiver).$mul(receiver, a0); }; - J.$shl$n = function(receiver, a0) { - return J.getInterceptor$n(receiver).$shl(receiver, a0); - }; J.$sub$n = function(receiver, a0) { if (typeof receiver == "number" && typeof a0 == "number") return receiver - a0; return J.getInterceptor$n(receiver).$sub(receiver, a0); }; - J.$xor$n = function(receiver, a0) { - if (typeof receiver == "number" && typeof a0 == "number") - return (receiver ^ a0) >>> 0; - return J.getInterceptor$n(receiver).$xor(receiver, a0); - }; J._addEventListener$3$x = function(receiver, a0, a1, a2) { return J.getInterceptor$x(receiver)._addEventListener$3(receiver, a0, a1, a2); }; J._removeEventListener$3$x = function(receiver, a0, a1, a2) { return J.getInterceptor$x(receiver)._removeEventListener$3(receiver, a0, a1, a2); }; - J.add$1$ax = function(receiver, a0) { - return J.getInterceptor$ax(receiver).add$1(receiver, a0); - }; J.clear$0$ax = function(receiver) { return J.getInterceptor$ax(receiver).clear$0(receiver); }; @@ -15542,6 +15388,9 @@ J.endsWith$1$s = function(receiver, a0) { return J.getInterceptor$s(receiver).endsWith$1(receiver, a0); }; + J.fillRange$3$ax = function(receiver, a0, a1, a2) { + return J.getInterceptor$ax(receiver).fillRange$3(receiver, a0, a1, a2); + }; J.forEach$1$ax = function(receiver, a0) { return J.getInterceptor$ax(receiver).forEach$1(receiver, a0); }; @@ -15575,6 +15424,9 @@ J.startsWith$1$s = function(receiver, a0) { return J.getInterceptor$s(receiver).startsWith$1(receiver, a0); }; + J.startsWith$2$s = function(receiver, a0, a1) { + return J.getInterceptor$s(receiver).startsWith$2(receiver, a0, a1); + }; J.substring$1$s = function(receiver, a0) { return J.getInterceptor$s(receiver).substring$1(receiver, a0); }; @@ -15590,6 +15442,9 @@ J.trim$0$s = function(receiver) { return J.getInterceptor$s(receiver).trim$0(receiver); }; + J.waitUntilDone$0$x = function(receiver) { + return J.getInterceptor$x(receiver).waitUntilDone$0(receiver); + }; J.get$hashCode$ = function(receiver) { return J.getInterceptor(receiver).get$hashCode(receiver); }; @@ -15600,9 +15455,6 @@ return a0 != null && receiver === a0; return J.getInterceptor(receiver).$eq(receiver, a0); }; - J.noSuchMethod$1$ = function(receiver, a0) { - return J.getInterceptor(receiver).noSuchMethod$1(receiver, a0); - }; J.toString$0$ = function(receiver) { return J.getInterceptor(receiver).toString$0(receiver); }; @@ -15615,7 +15467,6 @@ C.Interceptor_methods = J.Interceptor.prototype; C.JSArray_methods = J.JSArray.prototype; C.JSInt_methods = J.JSInt.prototype; - C.JSNull_methods = J.JSNull.prototype; C.JSNumber_methods = J.JSNumber.prototype; C.JSString_methods = J.JSString.prototype; C.JavaScriptFunction_methods = J.JavaScriptFunction.prototype; @@ -15776,15 +15627,12 @@ C.List_WnV = Isolate.makeConstantList(["/", "\\"]); C.List_cSk = Isolate.makeConstantList(["/"]); C.List_empty = H.setRuntimeTypeInfo(Isolate.makeConstantList([]), [P.String]); - C.List_empty0 = Isolate.makeConstantList([]); C.List_gRj = Isolate.makeConstantList([0, 0, 32722, 12287, 65534, 34815, 65534, 18431]); C.List_nxB = Isolate.makeConstantList([0, 0, 24576, 1023, 65534, 34815, 65534, 18431]); C.List_qNA = Isolate.makeConstantList([0, 0, 32754, 11263, 65534, 34815, 65534, 18431]); C.List_qg40 = Isolate.makeConstantList([0, 0, 32722, 12287, 65535, 34815, 65534, 18431]); C.List_qg4 = Isolate.makeConstantList([0, 0, 65490, 12287, 65535, 34815, 65534, 18431]); - C.List_empty1 = H.setRuntimeTypeInfo(Isolate.makeConstantList([]), [P.Symbol]); - C.Map_empty = H.setRuntimeTypeInfo(new H.ConstantStringMap(0, {}, C.List_empty1), [P.Symbol, null]); - C.Symbol_call = new H.Symbol0("call"); + C.Map_empty = H.setRuntimeTypeInfo(new H.ConstantStringMap(0, {}, C.List_empty), [P.String, P.String]); C.Utf8Codec_false = new P.Utf8Codec(false); C._ZoneFunction_3bB = new P._ZoneFunction(C.C__RootZone, P.async___rootCreatePeriodicTimer$closure()); C._ZoneFunction_7G2 = new P._ZoneFunction(C.C__RootZone, P.async___rootRegisterBinaryCallback$closure()); @@ -15800,6 +15648,7 @@ C._ZoneFunction__RootZone__rootRunUnary = new P._ZoneFunction(C.C__RootZone, P.async___rootRunUnary$closure()); C._ZoneFunction__RootZone__rootScheduleMicrotask = new P._ZoneFunction(C.C__RootZone, P.async___rootScheduleMicrotask$closure()); C._ZoneSpecification_ALf = new P._ZoneSpecification(null, null, null, null, null, null, null, null, null, null, null, null, null); + $.printToZone = null; $.Primitives_mirrorFunctionCacheName = "$cachedFunction"; $.Primitives_mirrorInvokeCacheName = "$cachedInvocation"; $.Closure_functionCounter = 0; @@ -15811,7 +15660,6 @@ $.dispatchRecordsForInstanceTags = null; $.interceptorsForUncacheableTags = null; $.initNativeDispatchFlag = null; - $.printToZone = null; $._nextCallback = null; $._lastCallback = null; $._lastPriorityCallback = null; @@ -15845,7 +15693,7 @@ Isolate.$lazy(fieldName, getterName, lazyValue, staticName); } })(["DART_CLOSURE_PROPERTY_NAME", "$get$DART_CLOSURE_PROPERTY_NAME", function() { - return H.getIsolateAffinityTag("_$dart_dartClosure"); + return init.getIsolateTag("_$dart_dartClosure"); }, "DART_CLOSURE_PROPERTY_NAME", "IsolateNatives_thisScript", "$get$IsolateNatives_thisScript", function() { return H.IsolateNatives_computeThisScript(); }, "IsolateNatives_thisScript", "IsolateNatives_workerIds", "$get$IsolateNatives_workerIds", function() { @@ -15919,17 +15767,23 @@ return P.HashMap_HashMap(null, null, null, null, null); }, "_RootZone__rootMap", "_toStringVisiting", "$get$_toStringVisiting", function() { return []; - }, "_toStringVisiting", "Uri__needsNoEncoding", "$get$Uri__needsNoEncoding", function() { + }, "_toStringVisiting", "_Uri__needsNoEncoding", "$get$_Uri__needsNoEncoding", function() { return P.RegExp_RegExp("^[\\-\\.0-9A-Z_a-z~]*$", true, false); - }, "Uri__needsNoEncoding", "context", "$get$context", function() { - return P._wrapToDart(self); - }, "context", "_DART_OBJECT_PROPERTY_NAME", "$get$_DART_OBJECT_PROPERTY_NAME", function() { - return H.getIsolateAffinityTag("_$dart_dartObject"); - }, "_DART_OBJECT_PROPERTY_NAME", "_dartProxyCtor", "$get$_dartProxyCtor", function() { - return function DartObject(o) { - this.o = o; - }; - }, "_dartProxyCtor", "_vmFrame", "$get$_vmFrame", function() { + }, "_Uri__needsNoEncoding", "_scannerTables", "$get$_scannerTables", function() { + return P._createTables(); + }, "_scannerTables", "windows", "$get$windows", function() { + return F.Context_Context(null, $.$get$Style_windows()); + }, "windows", "context", "$get$context", function() { + return new F.Context($.$get$Style_platform(), null); + }, "context", "Style_posix", "$get$Style_posix", function() { + return new Z.PosixStyle("posix", "/", C.List_cSk, P.RegExp_RegExp("/", true, false), P.RegExp_RegExp("[^/]$", true, false), P.RegExp_RegExp("^/", true, false), null); + }, "Style_posix", "Style_windows", "$get$Style_windows", function() { + return new T.WindowsStyle("windows", "\\", C.List_WnV, P.RegExp_RegExp("[/\\\\]", true, false), P.RegExp_RegExp("[^/\\\\]$", true, false), P.RegExp_RegExp("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])", true, false), P.RegExp_RegExp("^[/\\\\](?![/\\\\])", true, false)); + }, "Style_windows", "Style_url", "$get$Style_url", function() { + return new E.UrlStyle("url", "/", C.List_cSk, P.RegExp_RegExp("/", true, false), P.RegExp_RegExp("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$", true, false), P.RegExp_RegExp("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*", true, false), P.RegExp_RegExp("^/", true, false)); + }, "Style_url", "Style_platform", "$get$Style_platform", function() { + return S.Style__getPlatformStyle(); + }, "Style_platform", "_vmFrame", "$get$_vmFrame", function() { return P.RegExp_RegExp("^#\\d+\\s+(\\S.*) \\((.+?)((?::\\d+){0,2})\\)$", true, false); }, "_vmFrame", "_v8Frame", "$get$_v8Frame", function() { return P.RegExp_RegExp("^\\s*at (?:(\\S.*?)(?: \\[as [^\\]]+\\])? \\((.*)\\)|(.*))$", true, false); @@ -15949,21 +15803,7 @@ return P.RegExp_RegExp("^[a-zA-Z][-+.a-zA-Z\\d]*://", true, false); }, "Frame__uriRegExp", "Frame__windowsRegExp", "$get$Frame__windowsRegExp", function() { return P.RegExp_RegExp("^([a-zA-Z]:[\\\\/]|\\\\\\\\)", true, false); - }, "Frame__windowsRegExp", "_iframes", "$get$_iframes", function() { - return H.JsLinkedHashMap_JsLinkedHashMap$es6(P.$int, W.IFrameElement); - }, "_iframes", "windows", "$get$windows", function() { - return F.Context_Context(null, $.$get$Style_windows()); - }, "windows", "context0", "$get$context0", function() { - return new F.Context($.$get$Style_platform(), null); - }, "context0", "Style_posix", "$get$Style_posix", function() { - return new Z.PosixStyle("posix", "/", C.List_cSk, P.RegExp_RegExp("/", true, false), P.RegExp_RegExp("[^/]$", true, false), P.RegExp_RegExp("^/", true, false), null); - }, "Style_posix", "Style_windows", "$get$Style_windows", function() { - return new T.WindowsStyle("windows", "\\", C.List_WnV, P.RegExp_RegExp("[/\\\\]", true, false), P.RegExp_RegExp("[^/\\\\]$", true, false), P.RegExp_RegExp("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])", true, false), P.RegExp_RegExp("^[/\\\\](?![/\\\\])", true, false)); - }, "Style_windows", "Style_url", "$get$Style_url", function() { - return new E.UrlStyle("url", "/", C.List_cSk, P.RegExp_RegExp("/", true, false), P.RegExp_RegExp("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$", true, false), P.RegExp_RegExp("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*", true, false), P.RegExp_RegExp("^/", true, false)); - }, "Style_url", "Style_platform", "$get$Style_platform", function() { - return S.Style__getPlatformStyle(); - }, "Style_platform", "_terseRegExp", "$get$_terseRegExp", function() { + }, "Frame__windowsRegExp", "_terseRegExp", "$get$_terseRegExp", function() { return P.RegExp_RegExp("(-patch)?([/\\\\].*)?$", true, false); }, "_terseRegExp", "_v8Trace", "$get$_v8Trace", function() { return P.RegExp_RegExp("\\n ?at ", true, false); @@ -15973,11 +15813,13 @@ return P.RegExp_RegExp("^(([.0-9A-Za-z_$/<]|\\(.*\\))*@)?[^\\s]*:\\d*$", true, true); }, "_firefoxSafariTrace", "_friendlyTrace", "$get$_friendlyTrace", function() { return P.RegExp_RegExp("^[^\\s]+( \\d+(:\\d+)?)?[ \\t]+[^\\s]+$", true, true); - }, "_friendlyTrace"]); + }, "_friendlyTrace", "_iframes", "$get$_iframes", function() { + return H.JsLinkedHashMap_JsLinkedHashMap$es6(P.$int, W.IFrameElement); + }, "_iframes"]); Isolate = Isolate.$finishIsolateConstructor(Isolate); $ = new Isolate(); - init.metadata = ["self", "zone", "parent", "error", "stackTrace", null, "_", "value", "message", "f", "line", "frame", "data", "result", "trace", "arg", "callback", "key", "each", "arg2", "duration", "x", "element", "arg1", "o", "object", "arg4", "arg3", "numberOfArguments", "isolate", "closure", "specification", "zoneValues", "e", "errorCode", "sender", "k", "v", 0, "encodedComponent", "s", "byteString", "captureThis", "arguments"]; - init.types = [{func: 1, args: [,]}, {func: 1}, {func: 1, v: true}, {func: 1, args: [,,]}, {func: 1, v: true, args: [{func: 1, v: true}]}, {func: 1, args: [, P.StackTrace]}, {func: 1, v: true, args: [,], opt: [P.StackTrace]}, {func: 1, v: true, args: [P.String]}, {func: 1, ret: {func: 1, args: [,]}, args: [{func: 1, args: [,]}]}, {func: 1, v: true, args: [P.Object], opt: [P.StackTrace]}, {func: 1, v: true, args: [, P.StackTrace]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone,, P.StackTrace]}, {func: 1, ret: P.Timer, args: [P.Duration, {func: 1, v: true, args: [P.Timer]}]}, {func: 1, ret: P.Timer, args: [P.Duration, {func: 1, v: true}]}, {func: 1, ret: P.String, args: [P.$int]}, {func: 1, ret: P.AsyncError, args: [P.Object, P.StackTrace]}, {func: 1, ret: {func: 1, args: [,,]}, args: [{func: 1, args: [,,]}]}, {func: 1, ret: {func: 1}, args: [{func: 1}]}, {func: 1, args: [{func: 1, args: [,,]},,,]}, {func: 1, args: [{func: 1, args: [,]},,]}, {func: 1, args: [{func: 1}]}, {func: 1, ret: P.Zone, named: {specification: P.ZoneSpecification, zoneValues: P.Map}}, {func: 1, args: [, P.String]}, {func: 1, v: true, args: [P.Zone, {func: 1}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.Duration, {func: 1, v: true}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.Duration, {func: 1, v: true, args: [P.Timer]}]}, {func: 1, v: true, args: [P.Zone, P.String]}, {func: 1, ret: P.Zone, args: [P.Zone, P.ZoneSpecification, P.Map]}, {func: 1, ret: {func: 1, args: [,,]}, args: [P.Zone, {func: 1, args: [,,]}]}, {func: 1, ret: {func: 1, args: [,]}, args: [P.Zone, {func: 1, args: [,]}]}, {func: 1, ret: {func: 1}, args: [P.Zone, {func: 1}]}, {func: 1, args: [P.Zone, {func: 1, args: [,,]},,,]}, {func: 1, args: [P.Zone, {func: 1, args: [,]},,]}, {func: 1, ret: P.AsyncError, args: [P.Zone, P.Object, P.StackTrace]}, {func: 1, args: [P.Zone, {func: 1}]}, {func: 1, args: [P.Zone,, P.StackTrace]}, {func: 1, args: [P.String]}, {func: 1, args: [P.bool]}, {func: 1, args: [,], opt: [,]}, {func: 1, args: [{func: 1, v: true}]}, {func: 1, args: [P.String,,]}, {func: 1, v: true, opt: [,]}, {func: 1, ret: P.$int, args: [, P.$int]}, {func: 1, v: true, args: [P.$int, P.$int]}, {func: 1, ret: P.num, args: [P.num, P.num]}, {func: 1, args: [P.$int,,]}, {func: 1, v: true, args: [P.String, P.String]}, {func: 1, ret: P.$int, args: [,,]}, {func: 1, v: true, args: [P.String], opt: [,]}, {func: 1, ret: P.$int, args: [P.$int, P.$int]}, {func: 1, ret: P.Future, args: [,]}, {func: 1, v: true, args: [,]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1}]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,]},,]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,,]},,,]}, {func: 1, ret: {func: 1}, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1}]}, {func: 1, ret: {func: 1, args: [,]}, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,]}]}, {func: 1, ret: {func: 1, args: [,,]}, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,,]}]}, {func: 1, ret: P.AsyncError, args: [P.Zone, P.ZoneDelegate, P.Zone, P.Object, P.StackTrace]}, {func: 1, v: true, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.ZoneDelegate, P.Zone, P.Duration, {func: 1, v: true}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.ZoneDelegate, P.Zone, P.Duration, {func: 1, v: true, args: [P.Timer]}]}, {func: 1, v: true, args: [P.Zone, P.ZoneDelegate, P.Zone, P.String]}, {func: 1, ret: P.Zone, args: [P.Zone, P.ZoneDelegate, P.Zone, P.ZoneSpecification, P.Map]}, {func: 1, ret: P.String, args: [P.String]}, {func: 1, ret: P.Object, args: [,]}, {func: 1, args: [P.Symbol,,]}]; + init.metadata = [null, 0]; + init.types = [{func: 1, args: [,]}, {func: 1}, {func: 1, v: true}, {func: 1, args: [,,]}, {func: 1, v: true, args: [{func: 1, v: true}]}, {func: 1, args: [, P.StackTrace]}, {func: 1, v: true, args: [,], opt: [P.StackTrace]}, {func: 1, v: true, args: [P.String]}, {func: 1, v: true, args: [P.Uint8List, P.String, P.$int]}, {func: 1, ret: {func: 1, args: [,]}, args: [{func: 1, args: [,]}]}, {func: 1, v: true, args: [P.Object], opt: [P.StackTrace]}, {func: 1, ret: P.Zone, named: {specification: P.ZoneSpecification, zoneValues: P.Map}}, {func: 1, args: [{func: 1}]}, {func: 1, args: [{func: 1, args: [,]},,]}, {func: 1, args: [{func: 1, args: [,,]},,,]}, {func: 1, ret: {func: 1}, args: [{func: 1}]}, {func: 1, ret: {func: 1, args: [,,]}, args: [{func: 1, args: [,,]}]}, {func: 1, ret: P.AsyncError, args: [P.Object, P.StackTrace]}, {func: 1, ret: P.Timer, args: [P.Duration, {func: 1, v: true}]}, {func: 1, ret: P.Timer, args: [P.Duration, {func: 1, v: true, args: [P.Timer]}]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone,, P.StackTrace]}, {func: 1, ret: P.String, args: [P.$int]}, {func: 1, v: true, args: [P.Zone, {func: 1}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.Duration, {func: 1, v: true}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.Duration, {func: 1, v: true, args: [P.Timer]}]}, {func: 1, v: true, args: [P.Zone, P.String]}, {func: 1, ret: P.Zone, args: [P.Zone, P.ZoneSpecification, P.Map]}, {func: 1, v: true, opt: [,]}, {func: 1, args: [P.String]}, {func: 1, args: [{func: 1, v: true}]}, {func: 1, args: [P.bool]}, {func: 1, args: [, P.String]}, {func: 1, args: [,], opt: [,]}, {func: 1, v: true, args: [, P.StackTrace]}, {func: 1, args: [P.Zone,, P.StackTrace]}, {func: 1, args: [P.Zone, {func: 1}]}, {func: 1, args: [P.Zone, {func: 1, args: [,]},,]}, {func: 1, args: [P.Zone, {func: 1, args: [,,]},,,]}, {func: 1, ret: {func: 1}, args: [P.Zone, {func: 1}]}, {func: 1, ret: {func: 1, args: [,]}, args: [P.Zone, {func: 1, args: [,]}]}, {func: 1, ret: {func: 1, args: [,,]}, args: [P.Zone, {func: 1, args: [,,]}]}, {func: 1, ret: P.$int, args: [, P.$int]}, {func: 1, ret: P.num, args: [P.num, P.num]}, {func: 1, ret: P.AsyncError, args: [P.Zone, P.Object, P.StackTrace]}, {func: 1, v: true, args: [P.String, P.$int]}, {func: 1, v: true, args: [P.String], opt: [,]}, {func: 1, ret: P.$int, args: [P.$int, P.$int]}, {func: 1, ret: P.Uint8List, args: [,,]}, {func: 1, args: [P.$int,,]}, {func: 1, ret: P.Future, args: [,]}, {func: 1, v: true, args: [,]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1}]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,]},,]}, {func: 1, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,,]},,,]}, {func: 1, ret: {func: 1}, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1}]}, {func: 1, ret: {func: 1, args: [,]}, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,]}]}, {func: 1, ret: {func: 1, args: [,,]}, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1, args: [,,]}]}, {func: 1, ret: P.AsyncError, args: [P.Zone, P.ZoneDelegate, P.Zone, P.Object, P.StackTrace]}, {func: 1, v: true, args: [P.Zone, P.ZoneDelegate, P.Zone, {func: 1}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.ZoneDelegate, P.Zone, P.Duration, {func: 1, v: true}]}, {func: 1, ret: P.Timer, args: [P.Zone, P.ZoneDelegate, P.Zone, P.Duration, {func: 1, v: true, args: [P.Timer]}]}, {func: 1, v: true, args: [P.Zone, P.ZoneDelegate, P.Zone, P.String]}, {func: 1, ret: P.Zone, args: [P.Zone, P.ZoneDelegate, P.Zone, P.ZoneSpecification, P.Map]}, {func: 1, ret: P.String, args: [P.String]}, {func: 1, v: true, args: [P.$int, P.$int]}]; function convertToFastObject(properties) { function MyClass() { } diff --git a/pubspec.yaml b/pubspec.yaml index 730808d8..a1203e97 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,4 +36,5 @@ dependencies: matcher: '>=0.12.0 <0.12.1' dev_dependencies: fake_async: '^0.1.2' + js: '^0.6.0' scheduled_test: '^0.12.5' -- GitLab