19202 lines
735 KiB
JavaScript
19202 lines
735 KiB
JavaScript
// Generated by dart2js (, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.9.2.
|
|
// The code supports the following hooks:
|
|
// dartPrint(message):
|
|
// if this function is defined it is called instead of the Dart [print]
|
|
// method.
|
|
//
|
|
// dartMainRunner(main, args):
|
|
// if this function is defined, the Dart [main] method will not be invoked
|
|
// directly. Instead, a closure that will invoke [main], and its arguments
|
|
// [args] is passed to [dartMainRunner].
|
|
//
|
|
// dartDeferredLibraryLoader(uri, successCallback, errorCallback, loadId, loadPriority):
|
|
// if this function is defined, it will be called when a deferred library
|
|
// is loaded. It should load and eval the javascript of `uri`, and call
|
|
// successCallback. If it fails to do so, it should call errorCallback with
|
|
// an error. The loadId argument is the deferred import that resulted in
|
|
// this uri being loaded. The loadPriority argument is an arbitrary argument
|
|
// string forwarded from the 'dart2js:load-priority' pragma option.
|
|
// dartDeferredLibraryMultiLoader(uris, successCallback, errorCallback, loadId, loadPriority):
|
|
// if this function is defined, it will be called when a deferred library
|
|
// is loaded. It should load and eval the javascript of every URI in `uris`,
|
|
// and call successCallback. If it fails to do so, it should call
|
|
// errorCallback with an error. The loadId argument is the deferred import
|
|
// that resulted in this uri being loaded. The loadPriority argument is an
|
|
// arbitrary argument string forwarded from the 'dart2js:load-priority'
|
|
// pragma option.
|
|
//
|
|
// dartCallInstrumentation(id, qualifiedName):
|
|
// if this function is defined, it will be called at each entry of a
|
|
// method or constructor. Used only when compiling programs with
|
|
// --experiment-call-instrumentation.
|
|
(function dartProgram() {
|
|
function copyProperties(from, to) {
|
|
var keys = Object.keys(from);
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
to[key] = from[key];
|
|
}
|
|
}
|
|
function mixinPropertiesHard(from, to) {
|
|
var keys = Object.keys(from);
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
if (!to.hasOwnProperty(key)) {
|
|
to[key] = from[key];
|
|
}
|
|
}
|
|
}
|
|
function mixinPropertiesEasy(from, to) {
|
|
Object.assign(to, from);
|
|
}
|
|
var supportsDirectProtoAccess = function() {
|
|
var cls = function() {
|
|
};
|
|
cls.prototype = {p: {}};
|
|
var object = new cls();
|
|
if (!(Object.getPrototypeOf(object) && Object.getPrototypeOf(object).p === cls.prototype.p))
|
|
return false;
|
|
try {
|
|
if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0)
|
|
return true;
|
|
if (typeof version == "function" && version.length == 0) {
|
|
var v = version();
|
|
if (/^\d+\.\d+\.\d+\.\d+$/.test(v))
|
|
return true;
|
|
}
|
|
} catch (_) {
|
|
}
|
|
return false;
|
|
}();
|
|
function inherit(cls, sup) {
|
|
cls.prototype.constructor = cls;
|
|
cls.prototype["$is" + cls.name] = cls;
|
|
if (sup != null) {
|
|
if (supportsDirectProtoAccess) {
|
|
Object.setPrototypeOf(cls.prototype, sup.prototype);
|
|
return;
|
|
}
|
|
var clsPrototype = Object.create(sup.prototype);
|
|
copyProperties(cls.prototype, clsPrototype);
|
|
cls.prototype = clsPrototype;
|
|
}
|
|
}
|
|
function inheritMany(sup, classes) {
|
|
for (var i = 0; i < classes.length; i++) {
|
|
inherit(classes[i], sup);
|
|
}
|
|
}
|
|
function mixinEasy(cls, mixin) {
|
|
mixinPropertiesEasy(mixin.prototype, cls.prototype);
|
|
cls.prototype.constructor = cls;
|
|
}
|
|
function mixinHard(cls, mixin) {
|
|
mixinPropertiesHard(mixin.prototype, cls.prototype);
|
|
cls.prototype.constructor = cls;
|
|
}
|
|
function lazy(holder, name, getterName, initializer) {
|
|
var uninitializedSentinel = holder;
|
|
holder[name] = uninitializedSentinel;
|
|
holder[getterName] = function() {
|
|
if (holder[name] === uninitializedSentinel) {
|
|
holder[name] = initializer();
|
|
}
|
|
holder[getterName] = function() {
|
|
return this[name];
|
|
};
|
|
return holder[name];
|
|
};
|
|
}
|
|
function lazyFinal(holder, name, getterName, initializer) {
|
|
var uninitializedSentinel = holder;
|
|
holder[name] = uninitializedSentinel;
|
|
holder[getterName] = function() {
|
|
if (holder[name] === uninitializedSentinel) {
|
|
var value = initializer();
|
|
if (holder[name] !== uninitializedSentinel) {
|
|
A.throwLateFieldADI(name);
|
|
}
|
|
holder[name] = value;
|
|
}
|
|
var finalValue = holder[name];
|
|
holder[getterName] = function() {
|
|
return finalValue;
|
|
};
|
|
return finalValue;
|
|
};
|
|
}
|
|
function makeConstList(list, rti) {
|
|
if (rti != null)
|
|
A._setArrayType(list, rti);
|
|
list.$flags = 7;
|
|
return list;
|
|
}
|
|
function convertToFastObject(properties) {
|
|
function t() {
|
|
}
|
|
t.prototype = properties;
|
|
new t();
|
|
return properties;
|
|
}
|
|
function convertAllToFastObject(arrayOfObjects) {
|
|
for (var i = 0; i < arrayOfObjects.length; ++i) {
|
|
convertToFastObject(arrayOfObjects[i]);
|
|
}
|
|
}
|
|
var functionCounter = 0;
|
|
function instanceTearOffGetter(isIntercepted, parameters) {
|
|
var cache = null;
|
|
return isIntercepted ? function(receiver) {
|
|
if (cache === null)
|
|
cache = A.closureFromTearOff(parameters);
|
|
return new cache(receiver, this);
|
|
} : function() {
|
|
if (cache === null)
|
|
cache = A.closureFromTearOff(parameters);
|
|
return new cache(this, null);
|
|
};
|
|
}
|
|
function staticTearOffGetter(parameters) {
|
|
var cache = null;
|
|
return function() {
|
|
if (cache === null)
|
|
cache = A.closureFromTearOff(parameters).prototype;
|
|
return cache;
|
|
};
|
|
}
|
|
var typesOffset = 0;
|
|
function tearOffParameters(container, isStatic, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) {
|
|
if (typeof funType == "number") {
|
|
funType += typesOffset;
|
|
}
|
|
return {co: container, iS: isStatic, iI: isIntercepted, rC: requiredParameterCount, dV: optionalParameterDefaultValues, cs: callNames, fs: funsOrNames, fT: funType, aI: applyIndex || 0, nDA: needsDirectAccess};
|
|
}
|
|
function installStaticTearOff(holder, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) {
|
|
var parameters = tearOffParameters(holder, true, false, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, false);
|
|
var getterFunction = staticTearOffGetter(parameters);
|
|
holder[getterName] = getterFunction;
|
|
}
|
|
function installInstanceTearOff(prototype, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) {
|
|
isIntercepted = !!isIntercepted;
|
|
var parameters = tearOffParameters(prototype, false, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, !!needsDirectAccess);
|
|
var getterFunction = instanceTearOffGetter(isIntercepted, parameters);
|
|
prototype[getterName] = getterFunction;
|
|
}
|
|
function setOrUpdateInterceptorsByTag(newTags) {
|
|
var tags = init.interceptorsByTag;
|
|
if (!tags) {
|
|
init.interceptorsByTag = newTags;
|
|
return;
|
|
}
|
|
copyProperties(newTags, tags);
|
|
}
|
|
function setOrUpdateLeafTags(newTags) {
|
|
var tags = init.leafTags;
|
|
if (!tags) {
|
|
init.leafTags = newTags;
|
|
return;
|
|
}
|
|
copyProperties(newTags, tags);
|
|
}
|
|
function updateTypes(newTypes) {
|
|
var types = init.types;
|
|
var length = types.length;
|
|
types.push.apply(types, newTypes);
|
|
return length;
|
|
}
|
|
function updateHolder(holder, newHolder) {
|
|
copyProperties(newHolder, holder);
|
|
return holder;
|
|
}
|
|
var hunkHelpers = function() {
|
|
var mkInstance = function(isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) {
|
|
return function(container, getterName, name, funType) {
|
|
return installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex, false);
|
|
};
|
|
},
|
|
mkStatic = function(requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) {
|
|
return function(container, getterName, name, funType) {
|
|
return installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex);
|
|
};
|
|
};
|
|
return {inherit: inherit, inheritMany: inheritMany, mixin: mixinEasy, mixinHard: mixinHard, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, _instance_0u: mkInstance(0, 0, null, ["call$0"], 0), _instance_1u: mkInstance(0, 1, null, ["call$1"], 0), _instance_2u: mkInstance(0, 2, null, ["call$2"], 0), _instance_0i: mkInstance(1, 0, null, ["call$0"], 0), _instance_1i: mkInstance(1, 1, null, ["call$1"], 0), _instance_2i: mkInstance(1, 2, null, ["call$2"], 0), _static_0: mkStatic(0, null, ["call$0"], 0), _static_1: mkStatic(1, null, ["call$1"], 0), _static_2: mkStatic(2, null, ["call$2"], 0), makeConstList: makeConstList, lazy: lazy, lazyFinal: lazyFinal, updateHolder: updateHolder, convertToFastObject: convertToFastObject, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags};
|
|
}();
|
|
function initializeDeferredHunk(hunk) {
|
|
typesOffset = init.types.length;
|
|
hunk(hunkHelpers, init, holders, $);
|
|
}
|
|
var J = {
|
|
makeDispatchRecord(interceptor, proto, extension, indexability) {
|
|
return {i: interceptor, p: proto, e: extension, x: indexability};
|
|
},
|
|
getNativeInterceptor(object) {
|
|
var proto, objectProto, $constructor, interceptor, t1,
|
|
record = object[init.dispatchPropertyName];
|
|
if (record == null)
|
|
if ($.initNativeDispatchFlag == null) {
|
|
A.initNativeDispatch();
|
|
record = object[init.dispatchPropertyName];
|
|
}
|
|
if (record != null) {
|
|
proto = record.p;
|
|
if (false === proto)
|
|
return record.i;
|
|
if (true === proto)
|
|
return object;
|
|
objectProto = Object.getPrototypeOf(object);
|
|
if (proto === objectProto)
|
|
return record.i;
|
|
if (record.e === objectProto)
|
|
throw A.wrapException(A.UnimplementedError$("Return interceptor for " + A.S(proto(object, record))));
|
|
}
|
|
$constructor = object.constructor;
|
|
if ($constructor == null)
|
|
interceptor = null;
|
|
else {
|
|
t1 = $._JS_INTEROP_INTERCEPTOR_TAG;
|
|
if (t1 == null)
|
|
t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js");
|
|
interceptor = $constructor[t1];
|
|
}
|
|
if (interceptor != null)
|
|
return interceptor;
|
|
interceptor = A.lookupAndCacheInterceptor(object);
|
|
if (interceptor != null)
|
|
return interceptor;
|
|
if (typeof object == "function")
|
|
return B.JavaScriptFunction_methods;
|
|
proto = Object.getPrototypeOf(object);
|
|
if (proto == null)
|
|
return B.PlainJavaScriptObject_methods;
|
|
if (proto === Object.prototype)
|
|
return B.PlainJavaScriptObject_methods;
|
|
if (typeof $constructor == "function") {
|
|
t1 = $._JS_INTEROP_INTERCEPTOR_TAG;
|
|
if (t1 == null)
|
|
t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js");
|
|
Object.defineProperty($constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true});
|
|
return B.UnknownJavaScriptObject_methods;
|
|
}
|
|
return B.UnknownJavaScriptObject_methods;
|
|
},
|
|
JSArray_JSArray$fixed($length, $E) {
|
|
if ($length < 0 || $length > 4294967295)
|
|
throw A.wrapException(A.RangeError$range($length, 0, 4294967295, "length", null));
|
|
return J.JSArray_JSArray$markFixed(new Array($length), $E);
|
|
},
|
|
JSArray_JSArray$markFixed(allocation, $E) {
|
|
var t1 = A._setArrayType(allocation, $E._eval$1("JSArray<0>"));
|
|
t1.$flags = 1;
|
|
return t1;
|
|
},
|
|
JSString__isWhitespace(codeUnit) {
|
|
if (codeUnit < 256)
|
|
switch (codeUnit) {
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
case 12:
|
|
case 13:
|
|
case 32:
|
|
case 133:
|
|
case 160:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
switch (codeUnit) {
|
|
case 5760:
|
|
case 8192:
|
|
case 8193:
|
|
case 8194:
|
|
case 8195:
|
|
case 8196:
|
|
case 8197:
|
|
case 8198:
|
|
case 8199:
|
|
case 8200:
|
|
case 8201:
|
|
case 8202:
|
|
case 8232:
|
|
case 8233:
|
|
case 8239:
|
|
case 8287:
|
|
case 12288:
|
|
case 65279:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
},
|
|
JSString__skipLeadingWhitespace(string, index) {
|
|
var t1, codeUnit;
|
|
for (t1 = string.length; index < t1;) {
|
|
codeUnit = string.charCodeAt(index);
|
|
if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit))
|
|
break;
|
|
++index;
|
|
}
|
|
return index;
|
|
},
|
|
JSString__skipTrailingWhitespace(string, index) {
|
|
var t1, index0, codeUnit;
|
|
for (t1 = string.length; index > 0; index = index0) {
|
|
index0 = index - 1;
|
|
if (!(index0 < t1))
|
|
return A.ioore(string, index0);
|
|
codeUnit = string.charCodeAt(index0);
|
|
if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit))
|
|
break;
|
|
}
|
|
return index;
|
|
},
|
|
getInterceptor$(receiver) {
|
|
if (typeof receiver == "number") {
|
|
if (Math.floor(receiver) == receiver)
|
|
return J.JSInt.prototype;
|
|
return J.JSNumNotInt.prototype;
|
|
}
|
|
if (typeof receiver == "string")
|
|
return J.JSString.prototype;
|
|
if (receiver == null)
|
|
return J.JSNull.prototype;
|
|
if (typeof receiver == "boolean")
|
|
return J.JSBool.prototype;
|
|
if (Array.isArray(receiver))
|
|
return J.JSArray.prototype;
|
|
if (typeof receiver != "object") {
|
|
if (typeof receiver == "function")
|
|
return J.JavaScriptFunction.prototype;
|
|
if (typeof receiver == "symbol")
|
|
return J.JavaScriptSymbol.prototype;
|
|
if (typeof receiver == "bigint")
|
|
return J.JavaScriptBigInt.prototype;
|
|
return receiver;
|
|
}
|
|
if (receiver instanceof A.Object)
|
|
return receiver;
|
|
return J.getNativeInterceptor(receiver);
|
|
},
|
|
getInterceptor$asx(receiver) {
|
|
if (typeof receiver == "string")
|
|
return J.JSString.prototype;
|
|
if (receiver == null)
|
|
return receiver;
|
|
if (Array.isArray(receiver))
|
|
return J.JSArray.prototype;
|
|
if (typeof receiver != "object") {
|
|
if (typeof receiver == "function")
|
|
return J.JavaScriptFunction.prototype;
|
|
if (typeof receiver == "symbol")
|
|
return J.JavaScriptSymbol.prototype;
|
|
if (typeof receiver == "bigint")
|
|
return J.JavaScriptBigInt.prototype;
|
|
return receiver;
|
|
}
|
|
if (receiver instanceof A.Object)
|
|
return receiver;
|
|
return J.getNativeInterceptor(receiver);
|
|
},
|
|
getInterceptor$ax(receiver) {
|
|
if (receiver == null)
|
|
return receiver;
|
|
if (Array.isArray(receiver))
|
|
return J.JSArray.prototype;
|
|
if (typeof receiver != "object") {
|
|
if (typeof receiver == "function")
|
|
return J.JavaScriptFunction.prototype;
|
|
if (typeof receiver == "symbol")
|
|
return J.JavaScriptSymbol.prototype;
|
|
if (typeof receiver == "bigint")
|
|
return J.JavaScriptBigInt.prototype;
|
|
return receiver;
|
|
}
|
|
if (receiver instanceof A.Object)
|
|
return receiver;
|
|
return J.getNativeInterceptor(receiver);
|
|
},
|
|
getInterceptor$in(receiver) {
|
|
if (typeof receiver == "number") {
|
|
if (Math.floor(receiver) == receiver)
|
|
return J.JSInt.prototype;
|
|
return J.JSNumNotInt.prototype;
|
|
}
|
|
if (receiver == null)
|
|
return receiver;
|
|
if (!(receiver instanceof A.Object))
|
|
return J.UnknownJavaScriptObject.prototype;
|
|
return receiver;
|
|
},
|
|
getInterceptor$s(receiver) {
|
|
if (typeof receiver == "string")
|
|
return J.JSString.prototype;
|
|
if (receiver == null)
|
|
return receiver;
|
|
if (!(receiver instanceof A.Object))
|
|
return J.UnknownJavaScriptObject.prototype;
|
|
return receiver;
|
|
},
|
|
getInterceptor$x(receiver) {
|
|
if (receiver == null)
|
|
return receiver;
|
|
if (typeof receiver != "object") {
|
|
if (typeof receiver == "function")
|
|
return J.JavaScriptFunction.prototype;
|
|
if (typeof receiver == "symbol")
|
|
return J.JavaScriptSymbol.prototype;
|
|
if (typeof receiver == "bigint")
|
|
return J.JavaScriptBigInt.prototype;
|
|
return receiver;
|
|
}
|
|
if (receiver instanceof A.Object)
|
|
return receiver;
|
|
return J.getNativeInterceptor(receiver);
|
|
},
|
|
get$hashCode$(receiver) {
|
|
return J.getInterceptor$(receiver).get$hashCode(receiver);
|
|
},
|
|
get$isEmpty$asx(receiver) {
|
|
return J.getInterceptor$asx(receiver).get$isEmpty(receiver);
|
|
},
|
|
get$iterator$ax(receiver) {
|
|
return J.getInterceptor$ax(receiver).get$iterator(receiver);
|
|
},
|
|
get$length$asx(receiver) {
|
|
return J.getInterceptor$asx(receiver).get$length(receiver);
|
|
},
|
|
get$lengthInBytes$x(receiver) {
|
|
return J.getInterceptor$x(receiver).get$lengthInBytes(receiver);
|
|
},
|
|
get$runtimeType$(receiver) {
|
|
return J.getInterceptor$(receiver).get$runtimeType(receiver);
|
|
},
|
|
$eq$(receiver, a0) {
|
|
if (receiver == null)
|
|
return a0 == null;
|
|
if (typeof receiver != "object")
|
|
return a0 != null && receiver === a0;
|
|
return J.getInterceptor$(receiver).$eq(receiver, a0);
|
|
},
|
|
$index$asx(receiver, a0) {
|
|
if (typeof a0 === "number")
|
|
if (Array.isArray(receiver) || typeof receiver == "string" || A.isJsIndexable(receiver, receiver[init.dispatchPropertyName]))
|
|
if (a0 >>> 0 === a0 && a0 < receiver.length)
|
|
return receiver[a0];
|
|
return J.getInterceptor$asx(receiver).$index(receiver, a0);
|
|
},
|
|
$indexSet$ax(receiver, a0, a1) {
|
|
return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1);
|
|
},
|
|
abs$0$in(receiver) {
|
|
if (typeof receiver === "number")
|
|
return Math.abs(receiver);
|
|
return J.getInterceptor$in(receiver).abs$0(receiver);
|
|
},
|
|
add$1$ax(receiver, a0) {
|
|
return J.getInterceptor$ax(receiver).add$1(receiver, a0);
|
|
},
|
|
asUint8List$2$x(receiver, a0, a1) {
|
|
return J.getInterceptor$x(receiver).asUint8List$2(receiver, a0, a1);
|
|
},
|
|
codeUnitAt$1$s(receiver, a0) {
|
|
return J.getInterceptor$s(receiver).codeUnitAt$1(receiver, a0);
|
|
},
|
|
contains$1$asx(receiver, a0) {
|
|
return J.getInterceptor$asx(receiver).contains$1(receiver, a0);
|
|
},
|
|
elementAt$1$ax(receiver, a0) {
|
|
return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0);
|
|
},
|
|
skip$1$ax(receiver, a0) {
|
|
return J.getInterceptor$ax(receiver).skip$1(receiver, a0);
|
|
},
|
|
take$1$ax(receiver, a0) {
|
|
return J.getInterceptor$ax(receiver).take$1(receiver, a0);
|
|
},
|
|
toString$0$(receiver) {
|
|
return J.getInterceptor$(receiver).toString$0(receiver);
|
|
},
|
|
Interceptor: function Interceptor() {
|
|
},
|
|
JSBool: function JSBool() {
|
|
},
|
|
JSNull: function JSNull() {
|
|
},
|
|
JavaScriptObject: function JavaScriptObject() {
|
|
},
|
|
LegacyJavaScriptObject: function LegacyJavaScriptObject() {
|
|
},
|
|
PlainJavaScriptObject: function PlainJavaScriptObject() {
|
|
},
|
|
UnknownJavaScriptObject: function UnknownJavaScriptObject() {
|
|
},
|
|
JavaScriptFunction: function JavaScriptFunction() {
|
|
},
|
|
JavaScriptBigInt: function JavaScriptBigInt() {
|
|
},
|
|
JavaScriptSymbol: function JavaScriptSymbol() {
|
|
},
|
|
JSArray: function JSArray(t0) {
|
|
this.$ti = t0;
|
|
},
|
|
JSArraySafeToStringHook: function JSArraySafeToStringHook() {
|
|
},
|
|
JSUnmodifiableArray: function JSUnmodifiableArray(t0) {
|
|
this.$ti = t0;
|
|
},
|
|
ArrayIterator: function ArrayIterator(t0, t1, t2) {
|
|
var _ = this;
|
|
_._iterable = t0;
|
|
_._length = t1;
|
|
_._index = 0;
|
|
_._current = null;
|
|
_.$ti = t2;
|
|
},
|
|
JSNumber: function JSNumber() {
|
|
},
|
|
JSInt: function JSInt() {
|
|
},
|
|
JSNumNotInt: function JSNumNotInt() {
|
|
},
|
|
JSString: function JSString() {
|
|
}
|
|
},
|
|
A = {JS_CONST: function JS_CONST() {
|
|
},
|
|
HttpClient_HttpClient() {
|
|
var t1, t2, t3, version, t4;
|
|
A.HttpOverrides_current();
|
|
t1 = A.HashMap_HashMap(type$.String, type$._ConnectionTarget);
|
|
t2 = A._setArrayType([], type$.JSArray__Credentials);
|
|
t3 = A._setArrayType([], type$.JSArray__ProxyCredentials);
|
|
version = $.$get$Platform_version();
|
|
t4 = A.S(version.substring$2(0, 0, version.indexOf$2(0, ".", version.indexOf$1(0, ".").$add(0, 1))));
|
|
return new A._HttpClient(t1, t2, t3, null, "Dart/" + t4 + " (dart:io)");
|
|
},
|
|
HttpClient_findProxyFromEnvironment(url, environment) {
|
|
var t1;
|
|
A.HttpOverrides_current();
|
|
t1 = A._HttpClient__findProxyFromEnvironment(url, environment);
|
|
return t1;
|
|
},
|
|
HttpException$(message, uri) {
|
|
return new A.HttpException(message, uri);
|
|
},
|
|
RedirectException$(message, redirects) {
|
|
return new A.RedirectException(message, redirects);
|
|
},
|
|
HttpDate_format(date) {
|
|
var t2, t3, t4, t5, t6, t7, t8, t9, t10,
|
|
d = date.toUtc$0(),
|
|
t1 = A.Primitives_getWeekday(d) - 1;
|
|
if (!(t1 >= 0 && t1 < 7))
|
|
return A.ioore(B.List_VDu, t1);
|
|
t1 = B.List_VDu[t1];
|
|
t2 = A.Primitives_getDay(d) <= 9 ? "0" : "";
|
|
t3 = B.JSInt_methods.toString$0(A.Primitives_getDay(d));
|
|
t4 = A.Primitives_getMonth(d) - 1;
|
|
if (!(t4 >= 0 && t4 < 12))
|
|
return A.ioore(B.List_2Rn, t4);
|
|
t4 = B.List_2Rn[t4];
|
|
t5 = B.JSInt_methods.toString$0(A.Primitives_getYear(d));
|
|
t6 = A.Primitives_getHours(d) <= 9 ? " 0" : " ";
|
|
t7 = B.JSInt_methods.toString$0(A.Primitives_getHours(d));
|
|
t8 = A.Primitives_getMinutes(d) <= 9 ? ":0" : ":";
|
|
t9 = B.JSInt_methods.toString$0(A.Primitives_getMinutes(d));
|
|
t10 = A.Primitives_getSeconds(d) <= 9 ? ":0" : ":";
|
|
t10 = t1 + ", " + t2 + t3 + " " + t4 + " " + t5 + t6 + t7 + t8 + t9 + t10 + B.JSInt_methods.toString$0(A.Primitives_getSeconds(d)) + " GMT";
|
|
return t10.charCodeAt(0) == 0 ? t10 : t10;
|
|
},
|
|
HttpDate__parseCookieDate(date) {
|
|
var error, isEnd, isDelimiter, isNonDelimiter, isDigit, getMonth, toInt, tokens, t1, t2, start, yearStr, monthStr, dayOfMonthStr, timeStr, _i, token, t3, year, dayOfMonth, month, timeList, hour, minute, second, _null = null, _box_0 = {};
|
|
_box_0.position = 0;
|
|
error = new A.HttpDate__parseCookieDate_error(date);
|
|
isEnd = new A.HttpDate__parseCookieDate_isEnd(_box_0, date);
|
|
isDelimiter = new A.HttpDate__parseCookieDate_isDelimiter();
|
|
isNonDelimiter = new A.HttpDate__parseCookieDate_isNonDelimiter();
|
|
isDigit = new A.HttpDate__parseCookieDate_isDigit();
|
|
getMonth = new A.HttpDate__parseCookieDate_getMonth();
|
|
toInt = new A.HttpDate__parseCookieDate_toInt(isDigit);
|
|
tokens = A._setArrayType([], type$.JSArray_String);
|
|
for (t1 = date.length; !isEnd.call$0();) {
|
|
while (true) {
|
|
if (!isEnd.call$0()) {
|
|
t2 = _box_0.position;
|
|
if (!(t2 < t1))
|
|
return A.ioore(date, t2);
|
|
t2 = isDelimiter.call$1(date[t2]);
|
|
} else
|
|
t2 = false;
|
|
if (!t2)
|
|
break;
|
|
++_box_0.position;
|
|
}
|
|
start = _box_0.position;
|
|
while (true) {
|
|
if (!isEnd.call$0()) {
|
|
t2 = _box_0.position;
|
|
if (!(t2 < t1))
|
|
return A.ioore(date, t2);
|
|
t2 = isNonDelimiter.call$1(date[t2]);
|
|
} else
|
|
t2 = false;
|
|
if (!t2)
|
|
break;
|
|
++_box_0.position;
|
|
}
|
|
B.JSArray_methods.add$1(tokens, B.JSString_methods.substring$2(date, start, _box_0.position).toLowerCase());
|
|
while (true) {
|
|
if (!isEnd.call$0()) {
|
|
t2 = _box_0.position;
|
|
if (!(t2 < t1))
|
|
return A.ioore(date, t2);
|
|
t2 = isDelimiter.call$1(date[t2]);
|
|
} else
|
|
t2 = false;
|
|
if (!t2)
|
|
break;
|
|
++_box_0.position;
|
|
}
|
|
}
|
|
for (t1 = tokens.length, yearStr = _null, monthStr = yearStr, dayOfMonthStr = monthStr, timeStr = dayOfMonthStr, _i = 0; _i < tokens.length; tokens.length === t1 || (0, A.throwConcurrentModificationError)(tokens), ++_i) {
|
|
token = tokens[_i];
|
|
t2 = token.length;
|
|
if (t2 === 0)
|
|
continue;
|
|
t3 = false;
|
|
if (timeStr == null)
|
|
if (t2 >= 5)
|
|
if (isDigit.call$1(token[0])) {
|
|
t3 = token[1];
|
|
if (t3 !== ":")
|
|
t3 = isDigit.call$1(t3) && token[2] === ":";
|
|
else
|
|
t3 = true;
|
|
}
|
|
if (t3)
|
|
timeStr = token;
|
|
else {
|
|
if (dayOfMonthStr == null) {
|
|
if (0 >= t2)
|
|
return A.ioore(token, 0);
|
|
t3 = isDigit.call$1(token[0]);
|
|
} else
|
|
t3 = false;
|
|
if (t3)
|
|
dayOfMonthStr = token;
|
|
else {
|
|
if (monthStr == null) {
|
|
t3 = getMonth.call$1(token);
|
|
if (typeof t3 !== "number")
|
|
return t3.$ge();
|
|
t3 = t3 >= 0;
|
|
} else
|
|
t3 = false;
|
|
if (t3)
|
|
monthStr = token;
|
|
else if (yearStr == null && t2 >= 2 && isDigit.call$1(token[0]) && isDigit.call$1(token[1]))
|
|
yearStr = token;
|
|
}
|
|
}
|
|
}
|
|
if (timeStr == null || dayOfMonthStr == null || monthStr == null || yearStr == null)
|
|
error.call$0();
|
|
year = toInt.call$1(yearStr);
|
|
if (year >= 70 && year <= 99)
|
|
year += 1900;
|
|
else if (year >= 0 && year <= 69)
|
|
year += 2000;
|
|
if (year < 1601)
|
|
error.call$0();
|
|
dayOfMonth = toInt.call$1(dayOfMonthStr);
|
|
if (dayOfMonth < 1 || dayOfMonth > 31)
|
|
error.call$0();
|
|
t1 = getMonth.call$1(monthStr);
|
|
if (typeof t1 !== "number")
|
|
return t1.$add();
|
|
month = t1 + 1;
|
|
timeList = timeStr.split(":");
|
|
t1 = timeList.length;
|
|
if (t1 !== 3)
|
|
error.call$0();
|
|
if (0 >= t1)
|
|
return A.ioore(timeList, 0);
|
|
hour = toInt.call$1(timeList[0]);
|
|
if (1 >= t1)
|
|
return A.ioore(timeList, 1);
|
|
minute = toInt.call$1(timeList[1]);
|
|
if (2 >= t1)
|
|
return A.ioore(timeList, 2);
|
|
second = toInt.call$1(timeList[2]);
|
|
if (hour > 23)
|
|
error.call$0();
|
|
if (minute > 59)
|
|
error.call$0();
|
|
if (second > 59)
|
|
error.call$0();
|
|
t1 = A.Primitives_valueFromDecomposedDate(year, month, dayOfMonth, hour, minute, second, 0, 0, true);
|
|
if (t1 == null)
|
|
t1 = 864e14;
|
|
if (t1 === 864e14)
|
|
A.throwExpression(A.ArgumentError$("(" + year + ", " + A.S(month) + ", " + A.S(dayOfMonth) + ", " + A.S(hour) + ", " + A.S(minute) + ", " + A.S(second) + ", 0, 0)", _null));
|
|
return new A.DateTime(t1, 0, true);
|
|
},
|
|
_HttpHeaders$(protocolVersion, defaultPortForScheme, initialHeaders) {
|
|
var t1 = new A._HttpHeaders(A.HashMap_HashMap(type$.String, type$.List_String), protocolVersion, defaultPortForScheme);
|
|
t1._HttpHeaders$3$defaultPortForScheme$initialHeaders(protocolVersion, defaultPortForScheme, initialHeaders);
|
|
return t1;
|
|
},
|
|
_HttpHeaders__validateField(field) {
|
|
var t1, i, t2;
|
|
for (t1 = field.length, i = 0; i < t1; ++i) {
|
|
t2 = field.charCodeAt(i);
|
|
if (!(t2 > 31 && t2 < 128 && !B.List_H5v[t2]))
|
|
throw A.wrapException(A.FormatException$("Invalid HTTP header field name: " + B.C_JsonCodec.encode$1(field), field, i));
|
|
}
|
|
return field.toLowerCase();
|
|
},
|
|
_HttpHeaders__validateValue(value) {
|
|
var t1, i, t2;
|
|
if (typeof value != "string")
|
|
return value;
|
|
for (t1 = value.length, i = 0; i < t1; ++i) {
|
|
t2 = value.charCodeAt(i);
|
|
if (!(t2 > 31 && t2 < 128 || t2 === 9))
|
|
throw A.wrapException(A.FormatException$("Invalid HTTP header field value: " + B.C_JsonCodec.encode$1(value), value, i));
|
|
}
|
|
return value;
|
|
},
|
|
_HeaderValue$() {
|
|
var t1 = new A._HeaderValue();
|
|
t1._HeaderValue$2("", B.Map_empty);
|
|
return t1;
|
|
},
|
|
_HeaderValue_parse(value, parameterSeparator) {
|
|
var result = A._HeaderValue$();
|
|
result._parse$4(value, parameterSeparator, null, false);
|
|
return result;
|
|
},
|
|
_HeaderValue__isToken(token) {
|
|
var i, codeUnit,
|
|
t1 = token.length;
|
|
if (t1 === 0)
|
|
return false;
|
|
for (i = 0; i < t1; ++i) {
|
|
codeUnit = token.charCodeAt(i);
|
|
if (codeUnit <= 32 || codeUnit >= 127 || B.JSString_methods.contains$1('"(),/:;<=>?@[]{}', token[i]))
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
_Cookie__validateName(newName) {
|
|
var t1, i, codeUnit;
|
|
for (t1 = newName.length, i = 0; i < t1; ++i) {
|
|
codeUnit = newName.charCodeAt(i);
|
|
if (codeUnit <= 32 || codeUnit >= 127 || B.JSArray_methods.contains$1(B.List_bhA, newName[i]))
|
|
throw A.wrapException(A.FormatException$("Invalid character in cookie name, code unit: '" + codeUnit + "'", newName, i));
|
|
}
|
|
return newName;
|
|
},
|
|
_Cookie__validateValue(newValue) {
|
|
var start, i, codeUnit, t1,
|
|
end = newValue.length;
|
|
if (2 <= end && newValue.charCodeAt(0) === 34 && newValue.charCodeAt(end - 1) === 34) {
|
|
--end;
|
|
start = 1;
|
|
} else
|
|
start = 0;
|
|
for (i = start; i < end; ++i) {
|
|
codeUnit = newValue.charCodeAt(i);
|
|
t1 = true;
|
|
if (codeUnit !== 33)
|
|
if (!(codeUnit >= 35 && codeUnit <= 43))
|
|
if (!(codeUnit >= 45 && codeUnit <= 58))
|
|
if (!(codeUnit >= 60 && codeUnit <= 91))
|
|
t1 = codeUnit >= 93 && codeUnit <= 126;
|
|
if (!t1)
|
|
throw A.wrapException(A.FormatException$("Invalid character in cookie value, code unit: '" + codeUnit + "'", newValue, i));
|
|
}
|
|
return newValue;
|
|
},
|
|
_Cookie__validatePath(path) {
|
|
var t1, i, codeUnit;
|
|
for (t1 = path.length, i = 0; i < t1; ++i) {
|
|
codeUnit = path.charCodeAt(i);
|
|
if (codeUnit < 32 || codeUnit >= 127 || codeUnit === 59)
|
|
throw A.wrapException(A.FormatException$("Invalid character in cookie path, code unit: '" + codeUnit + "'", null, null));
|
|
}
|
|
},
|
|
HttpProfiler_startRequest(method, uri, parentRequest) {
|
|
var t5, r, data,
|
|
t1 = parentRequest == null ? null : parentRequest._timeline,
|
|
t2 = type$.JSArray_int,
|
|
t3 = A._setArrayType([], t2),
|
|
t4 = A._setArrayType([], type$.JSArray__HttpProfileEvent);
|
|
t2 = A._setArrayType([], t2);
|
|
t5 = A._setArrayType([], type$.JSArray_nullable__AsyncBlock);
|
|
r = A._getNextTaskId();
|
|
t1 = new A.TimelineTask(t1, "HTTP/client", r, t5);
|
|
data = new A._HttpProfileData(method.toUpperCase(), uri, t3, t4, t2, t1);
|
|
if (t5.length > 0)
|
|
A.throwExpression(A.StateError$("You cannot pass a TimelineTask without finishing all started operations"));
|
|
t2 = B.JSInt_methods.toString$0(r);
|
|
data.___HttpProfileData_id_F = t2;
|
|
data.___HttpProfileData_requestStartTimestamp_F = 1000 * Date.now();
|
|
t3 = type$.dynamic;
|
|
t1.start$2$arguments("HTTP CLIENT " + method, A.LinkedHashMap_LinkedHashMap$_literal(["method", method.toUpperCase(), "uri", uri.toString$0(0)], t3, t3));
|
|
Date.now();
|
|
$.HttpProfiler__profile.$indexSet(0, t2, data);
|
|
return data;
|
|
},
|
|
_CopyingBytesBuilder__pow2roundup(x) {
|
|
--x;
|
|
x |= B.JSInt_methods._shrOtherPositive$1(x, 1);
|
|
x |= x >>> 2;
|
|
x |= x >>> 4;
|
|
x |= x >>> 8;
|
|
return ((x | x >>> 16) >>> 0) + 1;
|
|
},
|
|
_HttpClientResponse__getCompressionState(httpClient, headers) {
|
|
if (headers.value$1("content-encoding") === "gzip")
|
|
return B.HttpClientResponseCompressionState_1;
|
|
else
|
|
return B.HttpClientResponseCompressionState_0;
|
|
},
|
|
_HttpClientRequest$(outgoing, uri, method, _proxy, _httpClient, _httpClientConnection, _profileData) {
|
|
var t1 = A._setArrayType([], type$.JSArray_Cookie),
|
|
t2 = $.Zone__current,
|
|
t3 = A._setArrayType([], type$.JSArray_RedirectInfo);
|
|
t1 = outgoing.outbound = new A._HttpClientRequest(method, uri, t1, _httpClient, _httpClientConnection, new A._AsyncCompleter(new A._Future(t2, type$._Future_HttpClientResponse), type$._AsyncCompleter_HttpClientResponse), _proxy, t3, uri, outgoing, A._HttpHeaders$("1.1", uri.isScheme$1("https") ? 443 : 80, null), B.C_Latin1Codec, _profileData, outgoing, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._AsyncCompleter_void));
|
|
t1._HttpClientRequest$7(outgoing, uri, method, _proxy, _httpClient, _httpClientConnection, _profileData);
|
|
return t1;
|
|
},
|
|
_HttpClientConnection$(key, _socket, _httpClient, _proxyTunnel, _context) {
|
|
var t1 = new A._HttpClientConnection(key, _socket, _proxyTunnel, _context, A._HttpParser$_(false), _httpClient);
|
|
t1._HttpClientConnection$5(key, _socket, _httpClient, _proxyTunnel, _context);
|
|
return t1;
|
|
},
|
|
_HttpClient_shouldCopyHeaderOnRedirect(headerKey, originalUrl, redirectUri) {
|
|
var t1 = false;
|
|
if (redirectUri.isScheme$1(originalUrl.get$scheme()))
|
|
if (redirectUri.get$port() === originalUrl.get$port())
|
|
t1 = redirectUri.get$host() === originalUrl.get$host() || B.JSString_methods.endsWith$1(redirectUri.get$host(), "." + originalUrl.get$host());
|
|
if (t1)
|
|
return true;
|
|
return !B.JSArray_methods.contains$1(B.List_Bn4, headerKey.toLowerCase());
|
|
},
|
|
_HttpClient__findProxyFromEnvironment(url, environment) {
|
|
var t2, noProxy, proxyCfg, proxy,
|
|
t1 = new A._HttpClient__findProxyFromEnvironment_checkProxy();
|
|
environment = $.$get$_HttpClient__platformEnvironmentCache();
|
|
t2 = environment._collection$_map;
|
|
noProxy = t2.$index(0, "no_proxy");
|
|
if (noProxy == null)
|
|
noProxy = t2.$index(0, "NO_PROXY");
|
|
proxyCfg = new A._HttpClient__findProxyFromEnvironment_checkNoProxy(url).call$1(noProxy);
|
|
if (proxyCfg != null)
|
|
return proxyCfg;
|
|
if (url.isScheme$1("http")) {
|
|
proxy = t2.$index(0, "http_proxy");
|
|
proxyCfg = t1.call$1(proxy == null ? t2.$index(0, "HTTP_PROXY") : proxy);
|
|
if (proxyCfg != null)
|
|
return proxyCfg;
|
|
} else if (url.isScheme$1("https")) {
|
|
proxy = t2.$index(0, "https_proxy");
|
|
proxyCfg = t1.call$1(proxy == null ? t2.$index(0, "HTTPS_PROXY") : proxy);
|
|
if (proxyCfg != null)
|
|
return proxyCfg;
|
|
}
|
|
return "DIRECT";
|
|
},
|
|
_HttpConnectionInfo_create(socket) {
|
|
var t1, t2, t3, exception;
|
|
try {
|
|
t1 = socket.get$remoteAddress();
|
|
t2 = socket.get$remotePort();
|
|
t3 = socket.get$port();
|
|
return new A._HttpConnectionInfo(t1, t2, t3);
|
|
} catch (exception) {
|
|
}
|
|
return null;
|
|
},
|
|
_AuthenticationScheme__AuthenticationScheme$fromString(scheme) {
|
|
var t1 = A.IterableExtensions_get_singleOrNull(new A.WhereIterable(B.List_bW6, type$.bool_Function__AuthenticationScheme._as(new A._AuthenticationScheme__AuthenticationScheme$fromString_closure(scheme.toLowerCase())), type$.WhereIterable__AuthenticationScheme), type$._AuthenticationScheme);
|
|
return t1 == null ? B._AuthenticationScheme_0 : t1;
|
|
},
|
|
_HttpParser$_(_requestParser) {
|
|
var t1 = type$.JSArray_int;
|
|
t1 = new A._HttpParser(false, A._setArrayType([], t1), A._setArrayType([], t1), A._setArrayType([], t1), A._setArrayType([], t1), A.StreamController_StreamController(true, type$._HttpIncoming));
|
|
t1._HttpParser$_$1(false);
|
|
return t1;
|
|
},
|
|
_HttpParser__removeTrailingSpaces(value) {
|
|
var t1,
|
|
$length = value.length;
|
|
while (true) {
|
|
if ($length > 0) {
|
|
t1 = value[$length - 1];
|
|
t1 = t1 === 32 || t1 === 9;
|
|
} else
|
|
t1 = false;
|
|
if (!t1)
|
|
break;
|
|
--$length;
|
|
}
|
|
B.JSArray_methods.set$length(value, $length);
|
|
},
|
|
_HttpParser__tokenizeFieldValue(headerValue) {
|
|
var t1, start, index, t2,
|
|
tokens = A._setArrayType([], type$.JSArray_String);
|
|
for (t1 = headerValue.length, start = 0, index = 0; index < t1;) {
|
|
t2 = headerValue[index];
|
|
if (t2 === ",") {
|
|
B.JSArray_methods.add$1(tokens, B.JSString_methods.substring$2(headerValue, start, index));
|
|
start = index + 1;
|
|
} else if (t2 === " " || t2 === "\t")
|
|
++start;
|
|
++index;
|
|
}
|
|
B.JSArray_methods.add$1(tokens, B.JSString_methods.substring$2(headerValue, start, index));
|
|
return tokens;
|
|
},
|
|
_HttpParser__caseInsensitiveCompare(expected, value) {
|
|
var i, t4,
|
|
t1 = expected._string,
|
|
t2 = t1.length,
|
|
t3 = J.getInterceptor$asx(value);
|
|
if (t2 !== t3.get$length(value))
|
|
return false;
|
|
for (i = 0; i < t2; ++i) {
|
|
t4 = t3.$index(value, i);
|
|
if ((t4 - 65 & 127) < 26)
|
|
t4 = (t4 | 32) >>> 0;
|
|
if (t1.charCodeAt(i) !== t4)
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
HttpOverrides_current() {
|
|
$.$get$_httpOverridesToken();
|
|
return null;
|
|
},
|
|
_httpConnectionHook_closure: function _httpConnectionHook_closure() {
|
|
},
|
|
SameSite: function SameSite(t0) {
|
|
this.name = t0;
|
|
},
|
|
HttpClientResponseCompressionState: function HttpClientResponseCompressionState(t0) {
|
|
this._name = t0;
|
|
},
|
|
HttpException: function HttpException(t0, t1) {
|
|
this.message = t0;
|
|
this.uri = t1;
|
|
},
|
|
RedirectException: function RedirectException(t0, t1) {
|
|
this.message = t0;
|
|
this.redirects = t1;
|
|
},
|
|
HttpDate__parseCookieDate_error: function HttpDate__parseCookieDate_error(t0) {
|
|
this.date = t0;
|
|
},
|
|
HttpDate__parseCookieDate_isEnd: function HttpDate__parseCookieDate_isEnd(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.date = t1;
|
|
},
|
|
HttpDate__parseCookieDate_isDelimiter: function HttpDate__parseCookieDate_isDelimiter() {
|
|
},
|
|
HttpDate__parseCookieDate_isNonDelimiter: function HttpDate__parseCookieDate_isNonDelimiter() {
|
|
},
|
|
HttpDate__parseCookieDate_isDigit: function HttpDate__parseCookieDate_isDigit() {
|
|
},
|
|
HttpDate__parseCookieDate_getMonth: function HttpDate__parseCookieDate_getMonth() {
|
|
},
|
|
HttpDate__parseCookieDate_toInt: function HttpDate__parseCookieDate_toInt(t0) {
|
|
this.isDigit = t0;
|
|
},
|
|
_HttpHeaders: function _HttpHeaders(t0, t1, t2) {
|
|
var _ = this;
|
|
_._headers = t0;
|
|
_._originalHeaderNames = null;
|
|
_.protocolVersion = t1;
|
|
_._mutable = true;
|
|
_._contentLength = -1;
|
|
_._persistentConnection = true;
|
|
_._chunkedTransferEncoding = false;
|
|
_._port = _._host = null;
|
|
_._defaultPortForScheme = t2;
|
|
},
|
|
_HttpHeaders_forEach_closure: function _HttpHeaders_forEach_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.action = t1;
|
|
},
|
|
_HttpHeaders__build_closure: function _HttpHeaders__build_closure(t0, t1, t2) {
|
|
this.$this = t0;
|
|
this.ignoreHeader = t1;
|
|
this.builder = t2;
|
|
},
|
|
_HttpHeaders_toString_closure: function _HttpHeaders_toString_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.sb = t1;
|
|
},
|
|
_HeaderValue: function _HeaderValue() {
|
|
this._value = "";
|
|
this._unmodifiableParameters = this._parameters = null;
|
|
},
|
|
_HeaderValue_toString_closure: function _HeaderValue_toString_closure(t0) {
|
|
this.sb = t0;
|
|
},
|
|
_HeaderValue__parse_done: function _HeaderValue__parse_done(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.s = t1;
|
|
},
|
|
_HeaderValue__parse_skipWS: function _HeaderValue__parse_skipWS(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.done = t1;
|
|
this.s = t2;
|
|
},
|
|
_HeaderValue__parse_parseValue: function _HeaderValue__parse_parseValue(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.done = t1;
|
|
_.s = t2;
|
|
_.valueSeparator = t3;
|
|
_.parameterSeparator = t4;
|
|
},
|
|
_HeaderValue__parse_expect: function _HeaderValue__parse_expect(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.done = t1;
|
|
this.s = t2;
|
|
},
|
|
_HeaderValue__parse_maybeExpect: function _HeaderValue__parse_maybeExpect(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.done = t1;
|
|
this.s = t2;
|
|
},
|
|
_HeaderValue__parse_parseParameters: function _HeaderValue__parse_parseParameters(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.$this = t1;
|
|
_.done = t2;
|
|
_.s = t3;
|
|
_.parameterSeparator = t4;
|
|
_.valueSeparator = t5;
|
|
_.preserveBackslash = t6;
|
|
_.parseValue = t7;
|
|
_.skipWS = t8;
|
|
_.maybeExpect = t9;
|
|
_.expect = t10;
|
|
},
|
|
_HeaderValue__parse_parseParameters_parseParameterName: function _HeaderValue__parse_parseParameters_parseParameterName(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.done = t1;
|
|
_.s = t2;
|
|
_.parameterSeparator = t3;
|
|
_.valueSeparator = t4;
|
|
},
|
|
_HeaderValue__parse_parseParameters_parseParameterValue: function _HeaderValue__parse_parseParameters_parseParameterValue(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.done = t1;
|
|
_.s = t2;
|
|
_.preserveBackslash = t3;
|
|
_.parseValue = t4;
|
|
},
|
|
_ContentType: function _ContentType() {
|
|
this._value = "";
|
|
this._unmodifiableParameters = this._parameters = null;
|
|
},
|
|
_Cookie: function _Cookie(t0, t1, t2) {
|
|
var _ = this;
|
|
_.__http$_name = t0;
|
|
_._value = t1;
|
|
_._path = _.domain = _.maxAge = _.expires = null;
|
|
_.httpOnly = t2;
|
|
_.secure = false;
|
|
_.sameSite = null;
|
|
},
|
|
_Cookie__parseSetCookieValue_done: function _Cookie__parseSetCookieValue_done(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.s = t1;
|
|
},
|
|
_Cookie__parseSetCookieValue_parseName: function _Cookie__parseSetCookieValue_parseName(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.done = t1;
|
|
this.s = t2;
|
|
},
|
|
_Cookie__parseSetCookieValue_parseValue: function _Cookie__parseSetCookieValue_parseValue(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.done = t1;
|
|
this.s = t2;
|
|
},
|
|
_Cookie__parseSetCookieValue_parseAttributes: function _Cookie__parseSetCookieValue_parseAttributes(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.$this = t1;
|
|
_.done = t2;
|
|
_.s = t3;
|
|
},
|
|
_Cookie__parseSetCookieValue_parseAttributes_parseAttributeName: function _Cookie__parseSetCookieValue_parseAttributes_parseAttributeName(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.done = t1;
|
|
this.s = t2;
|
|
},
|
|
_Cookie__parseSetCookieValue_parseAttributes_parseAttributeValue: function _Cookie__parseSetCookieValue_parseAttributes_parseAttributeValue(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.done = t1;
|
|
this.s = t2;
|
|
},
|
|
_HttpProfileEvent: function _HttpProfileEvent(t0, t1, t2) {
|
|
this.timestamp = t0;
|
|
this.name = t1;
|
|
this.$arguments = t2;
|
|
},
|
|
_HttpProfileData: function _HttpProfileData(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_.responseInProgress = null;
|
|
_.___HttpProfileData_id_F = $;
|
|
_.method = t0;
|
|
_.uri = t1;
|
|
_.___HttpProfileData_requestEndTimestamp_F = _.___HttpProfileData_requestStartTimestamp_F = $;
|
|
_.proxyDetails = _.requestDetails = null;
|
|
_.requestBody = t2;
|
|
_.requestEvents = t3;
|
|
_.___HttpProfileData_responseEndTimestamp_F = _.___HttpProfileData_responseStartTimestamp_F = $;
|
|
_.responseDetails = null;
|
|
_.responseBody = t4;
|
|
_._timeline = t5;
|
|
_.___HttpProfileData__responseTimeline_A = $;
|
|
},
|
|
_HttpProfileData_formatHeaders_closure: function _HttpProfileData_formatHeaders_closure(t0) {
|
|
this.newHeaders = t0;
|
|
},
|
|
_CopyingBytesBuilder: function _CopyingBytesBuilder(t0) {
|
|
this.__http$_length = 0;
|
|
this.__http$_buffer = t0;
|
|
},
|
|
_HttpIncoming: function _HttpIncoming(t0, t1, t2) {
|
|
var _ = this;
|
|
_._dataCompleter = t0;
|
|
_.__http$_stream = t1;
|
|
_.headers = t2;
|
|
_.upgraded = false;
|
|
_.uri = _.reasonPhrase = _.statusCode = null;
|
|
_.hasSubscriber = false;
|
|
},
|
|
_HttpIncoming_listen_closure: function _HttpIncoming_listen_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpIncoming_listen_closure0: function _HttpIncoming_listen_closure0() {
|
|
},
|
|
_HttpInboundMessageListInt: function _HttpInboundMessageListInt() {
|
|
},
|
|
_HttpClientResponse: function _HttpClientResponse(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._httpClient = t0;
|
|
_._httpRequest = t1;
|
|
_.compressionState = t2;
|
|
_._profileData = t3;
|
|
_._incoming = t4;
|
|
_._cookies = null;
|
|
},
|
|
_HttpClientResponse_redirect_closure: function _HttpClientResponse_redirect_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.$this = t1;
|
|
},
|
|
_HttpClientResponse_listen_closure: function _HttpClientResponse_listen_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientResponse_listen_closure0: function _HttpClientResponse_listen_closure0(t0, t1) {
|
|
this.$this = t0;
|
|
this.onError = t1;
|
|
},
|
|
_HttpClientResponse__authenticate_retry: function _HttpClientResponse__authenticate_retry(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientResponse__authenticate_retry_closure: function _HttpClientResponse__authenticate_retry_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientResponse__authenticate_retry__closure: function _HttpClientResponse__authenticate_retry__closure() {
|
|
},
|
|
_HttpClientResponse__authenticate_authChallenge: function _HttpClientResponse__authenticate_authChallenge(t0, t1) {
|
|
this.$this = t0;
|
|
this.proxyAuth = t1;
|
|
},
|
|
_HttpClientResponse__authenticate_findCredentials: function _HttpClientResponse__authenticate_findCredentials(t0, t1) {
|
|
this.$this = t0;
|
|
this.proxyAuth = t1;
|
|
},
|
|
_HttpClientResponse__authenticate_requestAuthentication: function _HttpClientResponse__authenticate_requestAuthentication(t0, t1) {
|
|
this.$this = t0;
|
|
this.proxyAuth = t1;
|
|
},
|
|
_HttpClientResponse__authenticate_closure: function _HttpClientResponse__authenticate_closure(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.$this = t1;
|
|
_.scheme = t2;
|
|
_.retry = t3;
|
|
},
|
|
_ToUint8List: function _ToUint8List() {
|
|
},
|
|
_Uint8ListConversionSink: function _Uint8ListConversionSink(t0) {
|
|
this._target = t0;
|
|
},
|
|
_StreamSinkImpl: function _StreamSinkImpl() {
|
|
},
|
|
_StreamSinkImpl__controller_closure: function _StreamSinkImpl__controller_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_StreamSinkImpl__controller_closure0: function _StreamSinkImpl__controller_closure0(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_IOSinkImpl: function _IOSinkImpl() {
|
|
},
|
|
_HttpOutboundMessage: function _HttpOutboundMessage() {
|
|
},
|
|
_HttpClientRequest: function _HttpClientRequest(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) {
|
|
var _ = this;
|
|
_.method = t0;
|
|
_.uri = t1;
|
|
_.cookies = t2;
|
|
_._httpClient = t3;
|
|
_._httpClientConnection = t4;
|
|
_._responseCompleter = t5;
|
|
_._proxy = t6;
|
|
_._response = null;
|
|
_._followRedirects = true;
|
|
_._maxRedirects = 5;
|
|
_._responseRedirects = t7;
|
|
_._encodingSet = false;
|
|
_._uri = t8;
|
|
_._outgoing = t9;
|
|
_.headers = t10;
|
|
_._encoding = t11;
|
|
_._profileData = t12;
|
|
_._target = t13;
|
|
_._doneCompleter = t14;
|
|
_._controllerCompleter = _._controllerInstance = null;
|
|
_._hasError = _._isBound = _._isClosed = false;
|
|
},
|
|
_HttpClientRequest_closure: function _HttpClientRequest_closure(t0) {
|
|
this._profileData = t0;
|
|
},
|
|
_HttpClientRequest__closure: function _HttpClientRequest__closure(t0) {
|
|
this._profileData = t0;
|
|
},
|
|
_HttpClientRequest_closure0: function _HttpClientRequest_closure0() {
|
|
},
|
|
_HttpClientRequest_done_closure: function _HttpClientRequest_done_closure() {
|
|
},
|
|
_HttpClientRequest__handleIncoming_closure: function _HttpClientRequest__handleIncoming_closure(t0) {
|
|
this.response = t0;
|
|
},
|
|
_HttpClientRequest__handleIncoming_closure0: function _HttpClientRequest__handleIncoming_closure0(t0) {
|
|
this.response = t0;
|
|
},
|
|
_HttpClientRequest__handleIncoming_closure1: function _HttpClientRequest__handleIncoming_closure1(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientRequest__handleIncoming_closure2: function _HttpClientRequest__handleIncoming_closure2(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientRequest__requestUri_uriStartingFromPath: function _HttpClientRequest__requestUri_uriStartingFromPath(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpOutgoing: function _HttpOutgoing(t0, t1) {
|
|
var _ = this;
|
|
_._doneCompleter = t0;
|
|
_.socket = t1;
|
|
_.headersWritten = false;
|
|
_.__http$_buffer = null;
|
|
_.__http$_length = 0;
|
|
_._closeFuture = null;
|
|
_.chunked = false;
|
|
_._pendingChunkedFooter = 0;
|
|
_.contentLength = null;
|
|
_._bytesWritten = 0;
|
|
_._gzip = false;
|
|
_._gzipBuffer = _._gzipAdd = _._gzipSink = null;
|
|
_._gzipBufferLength = 0;
|
|
_._socketError = false;
|
|
_.outbound = null;
|
|
},
|
|
_HttpOutgoing_addStream_onData: function _HttpOutgoing_addStream_onData(t0, t1) {
|
|
this.$this = t0;
|
|
this.controller = t1;
|
|
},
|
|
_HttpOutgoing_addStream_closure: function _HttpOutgoing_addStream_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpOutgoing_addStream_closure0: function _HttpOutgoing_addStream_closure0(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpOutgoing_close_finalize: function _HttpOutgoing_close_finalize(t0, t1) {
|
|
this.$this = t0;
|
|
this.outbound = t1;
|
|
},
|
|
_HttpOutgoing_close_finalize_closure: function _HttpOutgoing_close_finalize_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.outbound = t1;
|
|
},
|
|
_HttpOutgoing_close_finalize_closure0: function _HttpOutgoing_close_finalize_closure0(t0, t1) {
|
|
this.$this = t0;
|
|
this.outbound = t1;
|
|
},
|
|
_HttpClientConnection: function _HttpClientConnection(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_.key = t0;
|
|
_._socket = t1;
|
|
_._proxyTunnel = t2;
|
|
_._context = t3;
|
|
_._httpParser = t4;
|
|
_.__http$_subscription = null;
|
|
_._httpClient = t5;
|
|
_._dispose = false;
|
|
_._idleTimer = null;
|
|
_.closed = false;
|
|
_._streamFuture = _._nextResponseCompleter = _._currentUri = null;
|
|
},
|
|
_HttpClientConnection_closure: function _HttpClientConnection_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientConnection__closure: function _HttpClientConnection__closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientConnection__closure0: function _HttpClientConnection__closure0(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientConnection__closure1: function _HttpClientConnection__closure1() {
|
|
},
|
|
_HttpClientConnection_closure1: function _HttpClientConnection_closure1(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientConnection_closure0: function _HttpClientConnection_closure0(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientConnection_send_closure: function _HttpClientConnection_send_closure(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.$this = t1;
|
|
_.profileData = t2;
|
|
_.request = t3;
|
|
_.method = t4;
|
|
_.uri = t5;
|
|
},
|
|
_HttpClientConnection_send__closure: function _HttpClientConnection_send__closure(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.$this = t1;
|
|
_.method = t2;
|
|
_.request = t3;
|
|
},
|
|
_HttpClientConnection_send___closure: function _HttpClientConnection_send___closure(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.incoming = t1;
|
|
_.method = t2;
|
|
_.request = t3;
|
|
},
|
|
_HttpClientConnection_send__closure0: function _HttpClientConnection_send__closure0(t0) {
|
|
this.uri = t0;
|
|
},
|
|
_HttpClientConnection_send__closure1: function _HttpClientConnection_send__closure1() {
|
|
},
|
|
_HttpClientConnection_send__closure2: function _HttpClientConnection_send__closure2(t0, t1) {
|
|
this.$this = t0;
|
|
this.request = t1;
|
|
},
|
|
_HttpClientConnection_send_closure0: function _HttpClientConnection_send_closure0(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientConnection__close_closure: function _HttpClientConnection__close_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClientConnection_createProxyTunnel_closure: function _HttpClientConnection_createProxyTunnel_closure(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.profileData = t1;
|
|
_.request = t2;
|
|
_.host = t3;
|
|
_.callback = t4;
|
|
},
|
|
_HttpClientConnection_createProxyTunnel_closure0: function _HttpClientConnection_createProxyTunnel_closure0(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_.host = t0;
|
|
_.port = t1;
|
|
_.profileData = t2;
|
|
_.request = t3;
|
|
},
|
|
_HttpClientConnection_startTimer_closure: function _HttpClientConnection_startTimer_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_ConnectionInfo: function _ConnectionInfo(t0, t1) {
|
|
this.connection = t0;
|
|
this.proxy = t1;
|
|
},
|
|
_ConnectionTarget: function _ConnectionTarget(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) {
|
|
var _ = this;
|
|
_.key = t0;
|
|
_.host = t1;
|
|
_.port = t2;
|
|
_.isSecure = t3;
|
|
_.context = t4;
|
|
_.connectionFactory = t5;
|
|
_._idle = t6;
|
|
_._active = t7;
|
|
_._socketTasks = t8;
|
|
_.__http$_pending = t9;
|
|
_._connecting = 0;
|
|
},
|
|
_ConnectionTarget_connect_callback: function _ConnectionTarget_connect_callback(t0, t1, t2) {
|
|
this.currentBadCertificateCallback = t0;
|
|
this.uriHost = t1;
|
|
this.uriPort = t2;
|
|
},
|
|
_ConnectionTarget_connect_closure: function _ConnectionTarget_connect_closure(t0, t1, t2, t3, t4, t5, t6) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.client = t1;
|
|
_.proxy = t2;
|
|
_.uriHost = t3;
|
|
_.uriPort = t4;
|
|
_.callback = t5;
|
|
_.profileData = t6;
|
|
},
|
|
_ConnectionTarget_connect__closure: function _ConnectionTarget_connect__closure(t0, t1, t2, t3, t4, t5, t6, t7) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.client = t1;
|
|
_.proxy = t2;
|
|
_.uriHost = t3;
|
|
_.uriPort = t4;
|
|
_.callback = t5;
|
|
_.profileData = t6;
|
|
_.task = t7;
|
|
},
|
|
_ConnectionTarget_connect___closure: function _ConnectionTarget_connect___closure(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.client = t1;
|
|
_.uriHost = t2;
|
|
_.uriPort = t3;
|
|
_.task = t4;
|
|
_.proxy = t5;
|
|
},
|
|
_ConnectionTarget_connect__closure0: function _ConnectionTarget_connect__closure0(t0, t1, t2) {
|
|
this.$this = t0;
|
|
this.task = t1;
|
|
this.connectionTimeout = t2;
|
|
},
|
|
_ConnectionTarget_connect_closure0: function _ConnectionTarget_connect_closure0(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpClient: function _HttpClient(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._connectionTargets = t0;
|
|
_._credentials = t1;
|
|
_._proxyCredentials = t2;
|
|
_._context = t3;
|
|
_.userAgent = t4;
|
|
},
|
|
_HttpClient__openUrl_closure: function _HttpClient__openUrl_closure(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.$this = t1;
|
|
_.method = t2;
|
|
_.isSecure = t3;
|
|
},
|
|
_HttpClient__openUrl_closure_send: function _HttpClient__openUrl_closure_send(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.method = t1;
|
|
},
|
|
_HttpClient__openUrl_closure0: function _HttpClient__openUrl_closure0(t0) {
|
|
this._box_0 = t0;
|
|
},
|
|
_HttpClient__openUrlFromRequest_closure: function _HttpClient__openUrlFromRequest_closure(t0, t1, t2) {
|
|
this.previous = t0;
|
|
this.isRedirect = t1;
|
|
this.resolved = t2;
|
|
},
|
|
_HttpClient__getConnectionTarget_closure: function _HttpClient__getConnectionTarget_closure(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.key = t1;
|
|
_.host = t2;
|
|
_.port = t3;
|
|
_.isSecure = t4;
|
|
},
|
|
_HttpClient__getConnection_connect: function _HttpClient__getConnection_connect(t0, t1, t2, t3, t4, t5, t6) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.proxies = t1;
|
|
_.uriHost = t2;
|
|
_.uriPort = t3;
|
|
_.isSecure = t4;
|
|
_.uri = t5;
|
|
_.profileData = t6;
|
|
},
|
|
_HttpClient__findCredentials_closure: function _HttpClient__findCredentials_closure(t0, t1) {
|
|
this.url = t0;
|
|
this.scheme = t1;
|
|
},
|
|
_HttpClient__findProxyFromEnvironment_checkNoProxy: function _HttpClient__findProxyFromEnvironment_checkNoProxy(t0) {
|
|
this.url = t0;
|
|
},
|
|
_HttpClient__findProxyFromEnvironment_checkNoProxy_closure: function _HttpClient__findProxyFromEnvironment_checkNoProxy_closure() {
|
|
},
|
|
_HttpClient__findProxyFromEnvironment_checkProxy: function _HttpClient__findProxyFromEnvironment_checkProxy() {
|
|
},
|
|
_ProxyConfiguration: function _ProxyConfiguration(t0) {
|
|
this.proxies = t0;
|
|
},
|
|
_Proxy: function _Proxy(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_.host = t0;
|
|
_.port = t1;
|
|
_.username = t2;
|
|
_.password = t3;
|
|
_.isDirect = t4;
|
|
},
|
|
_HttpConnectionInfo: function _HttpConnectionInfo(t0, t1, t2) {
|
|
this.remoteAddress = t0;
|
|
this.remotePort = t1;
|
|
this.localPort = t2;
|
|
},
|
|
_AuthenticationScheme: function _AuthenticationScheme(t0) {
|
|
this._name = t0;
|
|
},
|
|
_AuthenticationScheme__AuthenticationScheme$fromString_closure: function _AuthenticationScheme__AuthenticationScheme$fromString_closure(t0) {
|
|
this.lower = t0;
|
|
},
|
|
_RedirectInfo: function _RedirectInfo(t0, t1, t2) {
|
|
this.statusCode = t0;
|
|
this.method = t1;
|
|
this.location = t2;
|
|
},
|
|
_HttpParser: function _HttpParser(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_._parserCalled = false;
|
|
_.__http$_buffer = null;
|
|
_.__http$_index = -1;
|
|
_._requestParser = t0;
|
|
_.__http$_state = 0;
|
|
_._httpVersionIndex = null;
|
|
_._statusCodeLength = _._statusCode = _._messageType = 0;
|
|
_.__http$_method = t1;
|
|
_._uriOrReasonPhrase = t2;
|
|
_._headerField = t3;
|
|
_._headerValue = t4;
|
|
_._httpVersion = _._headersReceivedSize = 0;
|
|
_._transferLength = -1;
|
|
_._noMessageBody = _._chunked = _._connectionUpgrade = false;
|
|
_._remainingContent = -1;
|
|
_.connectMethod = _._transferEncoding = _._contentLength = false;
|
|
_.__http$_socketSubscription = _._incoming = _._headers = null;
|
|
_._paused = true;
|
|
_._bodyPaused = false;
|
|
_._controller = t5;
|
|
_._bodyController = null;
|
|
},
|
|
_HttpParser$__closure: function _HttpParser$__closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpParser$__closure0: function _HttpParser$__closure0(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpParser$__closure1: function _HttpParser$__closure1(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpParser$__closure2: function _HttpParser$__closure2(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_HttpParser__createIncoming_closure: function _HttpParser__createIncoming_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.incoming = t1;
|
|
},
|
|
_HttpParser__createIncoming_closure0: function _HttpParser__createIncoming_closure0(t0, t1) {
|
|
this.$this = t0;
|
|
this.incoming = t1;
|
|
},
|
|
_HttpParser__createIncoming_closure1: function _HttpParser__createIncoming_closure1(t0, t1) {
|
|
this.$this = t0;
|
|
this.incoming = t1;
|
|
},
|
|
_HttpParser__createIncoming_closure2: function _HttpParser__createIncoming_closure2(t0, t1) {
|
|
this.$this = t0;
|
|
this.incoming = t1;
|
|
},
|
|
LateError$fieldADI(fieldName) {
|
|
return new A.LateError("Field '" + fieldName + "' has been assigned during initialization.");
|
|
},
|
|
LateError$fieldNI(fieldName) {
|
|
return new A.LateError("Field '" + fieldName + "' has not been initialized.");
|
|
},
|
|
LateError$fieldAI(fieldName) {
|
|
return new A.LateError("Field '" + fieldName + "' has already been initialized.");
|
|
},
|
|
hexDigitValue(char) {
|
|
var letter,
|
|
digit = char ^ 48;
|
|
if (digit <= 9)
|
|
return digit;
|
|
letter = char | 32;
|
|
if (97 <= letter && letter <= 102)
|
|
return letter - 87;
|
|
return -1;
|
|
},
|
|
SystemHash_combine(hash, value) {
|
|
hash = hash + value & 536870911;
|
|
hash = hash + ((hash & 524287) << 10) & 536870911;
|
|
return hash ^ hash >>> 6;
|
|
},
|
|
SystemHash_finish(hash) {
|
|
hash = hash + ((hash & 67108863) << 3) & 536870911;
|
|
hash ^= hash >>> 11;
|
|
return hash + ((hash & 16383) << 15) & 536870911;
|
|
},
|
|
checkNotNullable(value, $name, $T) {
|
|
return value;
|
|
},
|
|
valueOfNonNullableParamWithDefault(value, defaultVal, $T) {
|
|
return value;
|
|
},
|
|
isToStringVisiting(object) {
|
|
var t1, i;
|
|
for (t1 = $.toStringVisiting.length, i = 0; i < t1; ++i)
|
|
if (object === $.toStringVisiting[i])
|
|
return true;
|
|
return false;
|
|
},
|
|
SubListIterable$(_iterable, _start, _endOrLength, $E) {
|
|
A.RangeError_checkNotNegative(_start, "start");
|
|
if (_endOrLength != null) {
|
|
A.RangeError_checkNotNegative(_endOrLength, "end");
|
|
if (_start > _endOrLength)
|
|
A.throwExpression(A.RangeError$range(_start, 0, _endOrLength, "start", null));
|
|
}
|
|
return new A.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>"));
|
|
},
|
|
IterableElementError_noElement() {
|
|
return new A.StateError("No element");
|
|
},
|
|
IterableElementError_tooFew() {
|
|
return new A.StateError("Too few elements");
|
|
},
|
|
CastStream: function CastStream(t0, t1) {
|
|
this._source = t0;
|
|
this.$ti = t1;
|
|
},
|
|
CastStreamSubscription: function CastStreamSubscription(t0, t1, t2) {
|
|
var _ = this;
|
|
_._source = t0;
|
|
_.__internal$_zone = t1;
|
|
_.__internal$_handleError = _.__internal$_handleData = null;
|
|
_.$ti = t2;
|
|
},
|
|
_BytesBuilder: function _BytesBuilder(t0) {
|
|
this.__internal$_length = 0;
|
|
this._chunks = t0;
|
|
},
|
|
LateError: function LateError(t0) {
|
|
this._message = t0;
|
|
},
|
|
CodeUnits: function CodeUnits(t0) {
|
|
this._string = t0;
|
|
},
|
|
nullFuture_closure: function nullFuture_closure() {
|
|
},
|
|
SentinelValue: function SentinelValue() {
|
|
},
|
|
EfficientLengthIterable: function EfficientLengthIterable() {
|
|
},
|
|
ListIterable: function ListIterable() {
|
|
},
|
|
SubListIterable: function SubListIterable(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_.__internal$_iterable = t0;
|
|
_._start = t1;
|
|
_._endOrLength = t2;
|
|
_.$ti = t3;
|
|
},
|
|
ListIterator: function ListIterator(t0, t1, t2) {
|
|
var _ = this;
|
|
_.__internal$_iterable = t0;
|
|
_.__internal$_length = t1;
|
|
_.__internal$_index = 0;
|
|
_.__internal$_current = null;
|
|
_.$ti = t2;
|
|
},
|
|
MappedListIterable: function MappedListIterable(t0, t1, t2) {
|
|
this._source = t0;
|
|
this._f = t1;
|
|
this.$ti = t2;
|
|
},
|
|
WhereIterable: function WhereIterable(t0, t1, t2) {
|
|
this.__internal$_iterable = t0;
|
|
this._f = t1;
|
|
this.$ti = t2;
|
|
},
|
|
WhereIterator: function WhereIterator(t0, t1, t2) {
|
|
this._iterator = t0;
|
|
this._f = t1;
|
|
this.$ti = t2;
|
|
},
|
|
EmptyIterable: function EmptyIterable(t0) {
|
|
this.$ti = t0;
|
|
},
|
|
EmptyIterator: function EmptyIterator(t0) {
|
|
this.$ti = t0;
|
|
},
|
|
FixedLengthListMixin: function FixedLengthListMixin() {
|
|
},
|
|
UnmodifiableListMixin: function UnmodifiableListMixin() {
|
|
},
|
|
UnmodifiableListBase: function UnmodifiableListBase() {
|
|
},
|
|
unminifyOrTag(rawClassName) {
|
|
var preserved = init.mangledGlobalNames[rawClassName];
|
|
if (preserved != null)
|
|
return preserved;
|
|
return rawClassName;
|
|
},
|
|
isJsIndexable(object, record) {
|
|
var result;
|
|
if (record != null) {
|
|
result = record.x;
|
|
if (result != null)
|
|
return result;
|
|
}
|
|
return type$.JavaScriptIndexingBehavior_dynamic._is(object);
|
|
},
|
|
S(value) {
|
|
var result;
|
|
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";
|
|
result = J.toString$0$(value);
|
|
return result;
|
|
},
|
|
Primitives_objectHashCode(object) {
|
|
var hash,
|
|
property = $.Primitives__identityHashCodeProperty;
|
|
if (property == null)
|
|
property = $.Primitives__identityHashCodeProperty = Symbol("identityHashCode");
|
|
hash = object[property];
|
|
if (hash == null) {
|
|
hash = Math.random() * 0x3fffffff | 0;
|
|
object[property] = hash;
|
|
}
|
|
return hash;
|
|
},
|
|
Primitives_parseInt(source, radix) {
|
|
var decimalMatch, maxCharCode, digitsPart, t1, i, _null = null,
|
|
match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source);
|
|
if (match == null)
|
|
return _null;
|
|
if (3 >= match.length)
|
|
return A.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 _null;
|
|
}
|
|
if (radix < 2 || radix > 36)
|
|
throw A.wrapException(A.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 ((digitsPart.charCodeAt(i) | 32) > maxCharCode)
|
|
return _null;
|
|
}
|
|
return parseInt(source, radix);
|
|
},
|
|
Primitives_objectTypeName(object) {
|
|
var interceptor, dispatchName, $constructor, constructorName;
|
|
if (object instanceof A.Object)
|
|
return A._rtiToString(A.instanceType(object), null);
|
|
interceptor = J.getInterceptor$(object);
|
|
if (interceptor === B.Interceptor_methods || interceptor === B.JavaScriptObject_methods || type$.UnknownJavaScriptObject._is(object)) {
|
|
dispatchName = B.C_JS_CONST(object);
|
|
if (dispatchName !== "Object" && dispatchName !== "")
|
|
return dispatchName;
|
|
$constructor = object.constructor;
|
|
if (typeof $constructor == "function") {
|
|
constructorName = $constructor.name;
|
|
if (typeof constructorName == "string" && constructorName !== "Object" && constructorName !== "")
|
|
return constructorName;
|
|
}
|
|
}
|
|
return A._rtiToString(A.instanceType(object), null);
|
|
},
|
|
Primitives_safeToString(object) {
|
|
var hooks, i, hookResult;
|
|
if (typeof object == "number" || A._isBool(object))
|
|
return J.toString$0$(object);
|
|
if (typeof object == "string")
|
|
return JSON.stringify(object);
|
|
if (object instanceof A.Closure)
|
|
return object.toString$0(0);
|
|
hooks = $.$get$_safeToStringHooks();
|
|
for (i = 0; i < 1; ++i) {
|
|
hookResult = hooks[i].tryFormat$1(object);
|
|
if (hookResult != null)
|
|
return hookResult;
|
|
}
|
|
return "Instance of '" + A.Primitives_objectTypeName(object) + "'";
|
|
},
|
|
Primitives_dateNow() {
|
|
return Date.now();
|
|
},
|
|
Primitives_initTicker() {
|
|
var $window, performance;
|
|
if ($.Primitives_timerFrequency !== 0)
|
|
return;
|
|
$.Primitives_timerFrequency = 1000;
|
|
if (typeof window == "undefined")
|
|
return;
|
|
$window = window;
|
|
if ($window == null)
|
|
return;
|
|
if (!!$window.dartUseDateNowForTicks)
|
|
return;
|
|
performance = $window.performance;
|
|
if (performance == null)
|
|
return;
|
|
if (typeof performance.now != "function")
|
|
return;
|
|
$.Primitives_timerFrequency = 1000000;
|
|
$.Primitives_timerTicks = new A.Primitives_initTicker_closure(performance);
|
|
},
|
|
Primitives__fromCharCodeApply(array) {
|
|
var 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;
|
|
},
|
|
Primitives_stringFromCodePoints(codePoints) {
|
|
var t1, _i, i,
|
|
a = A._setArrayType([], type$.JSArray_int);
|
|
for (t1 = codePoints.length, _i = 0; _i < codePoints.length; codePoints.length === t1 || (0, A.throwConcurrentModificationError)(codePoints), ++_i) {
|
|
i = codePoints[_i];
|
|
if (!A._isInt(i))
|
|
throw A.wrapException(A.argumentErrorValue(i));
|
|
if (i <= 65535)
|
|
B.JSArray_methods.add$1(a, i);
|
|
else if (i <= 1114111) {
|
|
B.JSArray_methods.add$1(a, 55296 + (B.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023));
|
|
B.JSArray_methods.add$1(a, 56320 + (i & 1023));
|
|
} else
|
|
throw A.wrapException(A.argumentErrorValue(i));
|
|
}
|
|
return A.Primitives__fromCharCodeApply(a);
|
|
},
|
|
Primitives_stringFromCharCodes(charCodes) {
|
|
var t1, _i, i;
|
|
for (t1 = charCodes.length, _i = 0; _i < t1; ++_i) {
|
|
i = charCodes[_i];
|
|
if (!A._isInt(i))
|
|
throw A.wrapException(A.argumentErrorValue(i));
|
|
if (i < 0)
|
|
throw A.wrapException(A.argumentErrorValue(i));
|
|
if (i > 65535)
|
|
return A.Primitives_stringFromCodePoints(charCodes);
|
|
}
|
|
return A.Primitives__fromCharCodeApply(charCodes);
|
|
},
|
|
Primitives_stringFromNativeUint8List(charCodes, start, end) {
|
|
var i, result, i0, chunkEnd;
|
|
if (end <= 500 && start === 0 && end === charCodes.length)
|
|
return String.fromCharCode.apply(null, charCodes);
|
|
for (i = start, result = ""; i < end; i = i0) {
|
|
i0 = i + 500;
|
|
chunkEnd = i0 < end ? i0 : end;
|
|
result += String.fromCharCode.apply(null, charCodes.subarray(i, chunkEnd));
|
|
}
|
|
return result;
|
|
},
|
|
Primitives_stringFromCharCode(charCode) {
|
|
var bits;
|
|
if (0 <= charCode) {
|
|
if (charCode <= 65535)
|
|
return String.fromCharCode(charCode);
|
|
if (charCode <= 1114111) {
|
|
bits = charCode - 65536;
|
|
return String.fromCharCode((B.JSInt_methods._shrOtherPositive$1(bits, 10) | 55296) >>> 0, bits & 1023 | 56320);
|
|
}
|
|
}
|
|
throw A.wrapException(A.RangeError$range(charCode, 0, 1114111, null, null));
|
|
},
|
|
Primitives_valueFromDecomposedDate(years, month, day, hours, minutes, seconds, milliseconds, microseconds, isUtc) {
|
|
var remainder, value, t1,
|
|
jsMonth = month - 1;
|
|
if (0 <= years && years < 100) {
|
|
years += 400;
|
|
jsMonth -= 4800;
|
|
}
|
|
remainder = B.JSInt_methods.$mod(microseconds, 1000);
|
|
value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseconds + B.JSInt_methods._tdivFast$1(microseconds - remainder, 1000));
|
|
t1 = true;
|
|
if (!isNaN(value))
|
|
if (!(value < -864e13))
|
|
if (!(value > 864e13))
|
|
t1 = value === 864e13 && remainder !== 0;
|
|
if (t1)
|
|
return null;
|
|
return value;
|
|
},
|
|
Primitives_lazyAsJsDate(receiver) {
|
|
if (receiver.date === void 0)
|
|
receiver.date = new Date(receiver._core$_value);
|
|
return receiver.date;
|
|
},
|
|
Primitives_getYear(receiver) {
|
|
return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCFullYear() + 0 : A.Primitives_lazyAsJsDate(receiver).getFullYear() + 0;
|
|
},
|
|
Primitives_getMonth(receiver) {
|
|
return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCMonth() + 1 : A.Primitives_lazyAsJsDate(receiver).getMonth() + 1;
|
|
},
|
|
Primitives_getDay(receiver) {
|
|
return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCDate() + 0 : A.Primitives_lazyAsJsDate(receiver).getDate() + 0;
|
|
},
|
|
Primitives_getHours(receiver) {
|
|
return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCHours() + 0 : A.Primitives_lazyAsJsDate(receiver).getHours() + 0;
|
|
},
|
|
Primitives_getMinutes(receiver) {
|
|
return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCMinutes() + 0 : A.Primitives_lazyAsJsDate(receiver).getMinutes() + 0;
|
|
},
|
|
Primitives_getSeconds(receiver) {
|
|
return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCSeconds() + 0 : A.Primitives_lazyAsJsDate(receiver).getSeconds() + 0;
|
|
},
|
|
Primitives_getMilliseconds(receiver) {
|
|
return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCMilliseconds() + 0 : A.Primitives_lazyAsJsDate(receiver).getMilliseconds() + 0;
|
|
},
|
|
Primitives_getWeekday(receiver) {
|
|
return B.JSInt_methods.$mod((receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCDay() + 0 : A.Primitives_lazyAsJsDate(receiver).getDay() + 0) + 6, 7) + 1;
|
|
},
|
|
Primitives_extractStackTrace(error) {
|
|
var jsError = error.$thrownJsError;
|
|
if (jsError == null)
|
|
return null;
|
|
return A.getTraceFromException(jsError);
|
|
},
|
|
Primitives_trySetStackTrace(error, stackTrace) {
|
|
var jsError;
|
|
if (error.$thrownJsError == null) {
|
|
jsError = new Error();
|
|
A.initializeExceptionWrapper(error, jsError);
|
|
error.$thrownJsError = jsError;
|
|
jsError.stack = stackTrace.toString$0(0);
|
|
}
|
|
},
|
|
iae(argument) {
|
|
throw A.wrapException(A.argumentErrorValue(argument));
|
|
},
|
|
ioore(receiver, index) {
|
|
if (receiver == null)
|
|
J.get$length$asx(receiver);
|
|
throw A.wrapException(A.diagnoseIndexError(receiver, index));
|
|
},
|
|
diagnoseIndexError(indexable, index) {
|
|
var $length, _s5_ = "index";
|
|
if (!A._isInt(index))
|
|
return new A.ArgumentError(true, index, _s5_, null);
|
|
$length = A._asInt(J.get$length$asx(indexable));
|
|
if (index < 0 || index >= $length)
|
|
return A.IndexError$withLength(index, $length, indexable, null, _s5_);
|
|
return A.RangeError$value(index, _s5_);
|
|
},
|
|
diagnoseRangeError(start, end, $length) {
|
|
if (start > $length)
|
|
return A.RangeError$range(start, 0, $length, "start", null);
|
|
if (end != null)
|
|
if (end < start || end > $length)
|
|
return A.RangeError$range(end, start, $length, "end", null);
|
|
return new A.ArgumentError(true, end, "end", null);
|
|
},
|
|
argumentErrorValue(object) {
|
|
return new A.ArgumentError(true, object, null, null);
|
|
},
|
|
wrapException(ex) {
|
|
return A.initializeExceptionWrapper(ex, new Error());
|
|
},
|
|
initializeExceptionWrapper(ex, wrapper) {
|
|
var t1;
|
|
if (ex == null)
|
|
ex = new A.TypeError();
|
|
wrapper.dartException = ex;
|
|
t1 = A.toStringWrapper;
|
|
if ("defineProperty" in Object) {
|
|
Object.defineProperty(wrapper, "message", {get: t1});
|
|
wrapper.name = "";
|
|
} else
|
|
wrapper.toString = t1;
|
|
return wrapper;
|
|
},
|
|
toStringWrapper() {
|
|
return J.toString$0$(this.dartException);
|
|
},
|
|
throwExpression(ex, wrapper) {
|
|
throw A.initializeExceptionWrapper(ex, wrapper == null ? new Error() : wrapper);
|
|
},
|
|
throwUnsupportedOperation(o, operation, verb) {
|
|
var wrapper;
|
|
if (operation == null)
|
|
operation = 0;
|
|
if (verb == null)
|
|
verb = 0;
|
|
wrapper = Error();
|
|
A.throwExpression(A._diagnoseUnsupportedOperation(o, operation, verb), wrapper);
|
|
},
|
|
_diagnoseUnsupportedOperation(o, encodedOperation, encodedVerb) {
|
|
var operation, table, tableLength, index, verb, object, flags, article, adjective;
|
|
if (typeof encodedOperation == "string")
|
|
operation = encodedOperation;
|
|
else {
|
|
table = "[]=;add;removeWhere;retainWhere;removeRange;setRange;setInt8;setInt16;setInt32;setUint8;setUint16;setUint32;setFloat32;setFloat64".split(";");
|
|
tableLength = table.length;
|
|
index = encodedOperation;
|
|
if (index > tableLength) {
|
|
encodedVerb = index / tableLength | 0;
|
|
index %= tableLength;
|
|
}
|
|
operation = table[index];
|
|
}
|
|
verb = typeof encodedVerb == "string" ? encodedVerb : "modify;remove from;add to".split(";")[encodedVerb];
|
|
object = type$.List_dynamic._is(o) ? "list" : "ByteData";
|
|
flags = o.$flags | 0;
|
|
article = "a ";
|
|
if ((flags & 4) !== 0)
|
|
adjective = "constant ";
|
|
else if ((flags & 2) !== 0) {
|
|
adjective = "unmodifiable ";
|
|
article = "an ";
|
|
} else
|
|
adjective = (flags & 1) !== 0 ? "fixed-length " : "";
|
|
return new A.UnsupportedError("'" + operation + "': Cannot " + verb + " " + article + adjective + object);
|
|
},
|
|
throwConcurrentModificationError(collection) {
|
|
throw A.wrapException(A.ConcurrentModificationError$(collection));
|
|
},
|
|
TypeErrorDecoder_extractPattern(message) {
|
|
var match, $arguments, argumentsExpr, expr, method, receiver;
|
|
message = A.quoteStringForRegExp(message.replace(String({}), "$receiver$"));
|
|
match = message.match(/\\\$[a-zA-Z]+\\\$/g);
|
|
if (match == null)
|
|
match = A._setArrayType([], type$.JSArray_String);
|
|
$arguments = match.indexOf("\\$arguments\\$");
|
|
argumentsExpr = match.indexOf("\\$argumentsExpr\\$");
|
|
expr = match.indexOf("\\$expr\\$");
|
|
method = match.indexOf("\\$method\\$");
|
|
receiver = match.indexOf("\\$receiver\\$");
|
|
return new A.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(expression) {
|
|
return function($expr$) {
|
|
var $argumentsExpr$ = "$arguments$";
|
|
try {
|
|
$expr$.$method$($argumentsExpr$);
|
|
} catch (e) {
|
|
return e.message;
|
|
}
|
|
}(expression);
|
|
},
|
|
TypeErrorDecoder_provokePropertyErrorOn(expression) {
|
|
return function($expr$) {
|
|
try {
|
|
$expr$.$method$;
|
|
} catch (e) {
|
|
return e.message;
|
|
}
|
|
}(expression);
|
|
},
|
|
JsNoSuchMethodError$(_message, match) {
|
|
var t1 = match == null,
|
|
t2 = t1 ? null : match.method;
|
|
return new A.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver);
|
|
},
|
|
unwrapException(ex) {
|
|
var t1;
|
|
if (ex == null)
|
|
return new A.NullThrownFromJavaScriptException(ex);
|
|
if (ex instanceof A.ExceptionAndStackTrace) {
|
|
t1 = ex.dartException;
|
|
return A.saveStackTrace(ex, t1 == null ? A._asObject(t1) : t1);
|
|
}
|
|
if (typeof ex !== "object")
|
|
return ex;
|
|
if ("dartException" in ex)
|
|
return A.saveStackTrace(ex, ex.dartException);
|
|
return A._unwrapNonDartException(ex);
|
|
},
|
|
saveStackTrace(ex, error) {
|
|
if (type$.Error._is(error))
|
|
if (error.$thrownJsError == null)
|
|
error.$thrownJsError = ex;
|
|
return error;
|
|
},
|
|
_unwrapNonDartException(ex) {
|
|
var message, number, ieErrorCode, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match;
|
|
if (!("message" in ex))
|
|
return ex;
|
|
message = ex.message;
|
|
if ("number" in ex && typeof ex.number == "number") {
|
|
number = ex.number;
|
|
ieErrorCode = number & 65535;
|
|
if ((B.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10)
|
|
switch (ieErrorCode) {
|
|
case 438:
|
|
return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A.S(message) + " (Error " + ieErrorCode + ")", null));
|
|
case 445:
|
|
case 5007:
|
|
A.S(message);
|
|
return A.saveStackTrace(ex, new A.NullError());
|
|
}
|
|
}
|
|
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 A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match));
|
|
else {
|
|
match = notClosure.matchTypeError$1(message);
|
|
if (match != null) {
|
|
match.method = "call";
|
|
return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match));
|
|
} else if (nullCall.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefCall.matchTypeError$1(message) != null || undefLiteralCall.matchTypeError$1(message) != null || nullProperty.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefProperty.matchTypeError$1(message) != null || undefLiteralProperty.matchTypeError$1(message) != null) {
|
|
A._asString(message);
|
|
return A.saveStackTrace(ex, new A.NullError());
|
|
}
|
|
}
|
|
return A.saveStackTrace(ex, new A.UnknownJsTypeError(typeof message == "string" ? message : ""));
|
|
}
|
|
if (ex instanceof RangeError) {
|
|
if (typeof message == "string" && message.indexOf("call stack") !== -1)
|
|
return new A.StackOverflowError();
|
|
message = function(ex) {
|
|
try {
|
|
return String(ex);
|
|
} catch (e) {
|
|
}
|
|
return null;
|
|
}(ex);
|
|
return A.saveStackTrace(ex, new A.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 A.StackOverflowError();
|
|
return ex;
|
|
},
|
|
getTraceFromException(exception) {
|
|
var trace;
|
|
if (exception instanceof A.ExceptionAndStackTrace)
|
|
return exception.stackTrace;
|
|
if (exception == null)
|
|
return new A._StackTrace(exception);
|
|
trace = exception.$cachedTrace;
|
|
if (trace != null)
|
|
return trace;
|
|
trace = new A._StackTrace(exception);
|
|
if (typeof exception === "object")
|
|
exception.$cachedTrace = trace;
|
|
return trace;
|
|
},
|
|
objectHashCode(object) {
|
|
if (object == null)
|
|
return J.get$hashCode$(object);
|
|
if (typeof object == "object")
|
|
return A.Primitives_objectHashCode(object);
|
|
return J.get$hashCode$(object);
|
|
},
|
|
fillLiteralMap(keyValuePairs, result) {
|
|
var 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(closure, numberOfArguments, arg1, arg2, arg3, arg4) {
|
|
type$.Function._as(closure);
|
|
switch (A._asInt(numberOfArguments)) {
|
|
case 0:
|
|
return closure.call$0();
|
|
case 1:
|
|
return closure.call$1(arg1);
|
|
case 2:
|
|
return closure.call$2(arg1, arg2);
|
|
case 3:
|
|
return closure.call$3(arg1, arg2, arg3);
|
|
case 4:
|
|
return closure.call$4(arg1, arg2, arg3, arg4);
|
|
}
|
|
throw A.wrapException(new A._Exception("Unsupported number of arguments for wrapped closure"));
|
|
},
|
|
convertDartClosureToJS(closure, arity) {
|
|
var $function = closure.$identity;
|
|
if (!!$function)
|
|
return $function;
|
|
$function = A.convertDartClosureToJSUncached(closure, arity);
|
|
closure.$identity = $function;
|
|
return $function;
|
|
},
|
|
convertDartClosureToJSUncached(closure, arity) {
|
|
var entry;
|
|
switch (arity) {
|
|
case 0:
|
|
entry = closure.call$0;
|
|
break;
|
|
case 1:
|
|
entry = closure.call$1;
|
|
break;
|
|
case 2:
|
|
entry = closure.call$2;
|
|
break;
|
|
case 3:
|
|
entry = closure.call$3;
|
|
break;
|
|
case 4:
|
|
entry = closure.call$4;
|
|
break;
|
|
default:
|
|
entry = null;
|
|
}
|
|
if (entry != null)
|
|
return entry.bind(closure);
|
|
return function(closure, arity, invoke) {
|
|
return function(a1, a2, a3, a4) {
|
|
return invoke(closure, arity, a1, a2, a3, a4);
|
|
};
|
|
}(closure, arity, A._invokeClosure);
|
|
},
|
|
Closure_fromTearOff(parameters) {
|
|
var $prototype, $constructor, t2, trampoline, applyTrampoline, i, stub, stub0, stubName, stubCallName,
|
|
container = parameters.co,
|
|
isStatic = parameters.iS,
|
|
isIntercepted = parameters.iI,
|
|
needsDirectAccess = parameters.nDA,
|
|
applyTrampolineIndex = parameters.aI,
|
|
funsOrNames = parameters.fs,
|
|
callNames = parameters.cs,
|
|
$name = funsOrNames[0],
|
|
callName = callNames[0],
|
|
$function = container[$name],
|
|
t1 = parameters.fT;
|
|
t1.toString;
|
|
$prototype = isStatic ? Object.create(new A.StaticClosure().constructor.prototype) : Object.create(new A.BoundClosure(null, null).constructor.prototype);
|
|
$prototype.$initialize = $prototype.constructor;
|
|
$constructor = isStatic ? function static_tear_off() {
|
|
this.$initialize();
|
|
} : function tear_off(a, b) {
|
|
this.$initialize(a, b);
|
|
};
|
|
$prototype.constructor = $constructor;
|
|
$constructor.prototype = $prototype;
|
|
$prototype.$_name = $name;
|
|
$prototype.$_target = $function;
|
|
t2 = !isStatic;
|
|
if (t2)
|
|
trampoline = A.Closure_forwardCallTo($name, $function, isIntercepted, needsDirectAccess);
|
|
else {
|
|
$prototype.$static_name = $name;
|
|
trampoline = $function;
|
|
}
|
|
$prototype.$signature = A.Closure__computeSignatureFunction(t1, isStatic, isIntercepted);
|
|
$prototype[callName] = trampoline;
|
|
for (applyTrampoline = trampoline, i = 1; i < funsOrNames.length; ++i) {
|
|
stub = funsOrNames[i];
|
|
if (typeof stub == "string") {
|
|
stub0 = container[stub];
|
|
stubName = stub;
|
|
stub = stub0;
|
|
} else
|
|
stubName = "";
|
|
stubCallName = callNames[i];
|
|
if (stubCallName != null) {
|
|
if (t2)
|
|
stub = A.Closure_forwardCallTo(stubName, stub, isIntercepted, needsDirectAccess);
|
|
$prototype[stubCallName] = stub;
|
|
}
|
|
if (i === applyTrampolineIndex)
|
|
applyTrampoline = stub;
|
|
}
|
|
$prototype["call*"] = applyTrampoline;
|
|
$prototype.$requiredArgCount = parameters.rC;
|
|
$prototype.$defaultValues = parameters.dV;
|
|
return $constructor;
|
|
},
|
|
Closure__computeSignatureFunction(functionType, isStatic, isIntercepted) {
|
|
if (typeof functionType == "number")
|
|
return functionType;
|
|
if (typeof functionType == "string") {
|
|
if (isStatic)
|
|
throw A.wrapException("Cannot compute signature for static tearoff.");
|
|
return function(recipe, evalOnReceiver) {
|
|
return function() {
|
|
return evalOnReceiver(this, recipe);
|
|
};
|
|
}(functionType, A.BoundClosure_evalRecipe);
|
|
}
|
|
throw A.wrapException("Error in functionType of tearoff");
|
|
},
|
|
Closure_cspForwardCall(arity, needsDirectAccess, stubName, $function) {
|
|
var getReceiver = A.BoundClosure_receiverOf;
|
|
switch (needsDirectAccess ? -1 : arity) {
|
|
case 0:
|
|
return function(entry, receiverOf) {
|
|
return function() {
|
|
return receiverOf(this)[entry]();
|
|
};
|
|
}(stubName, getReceiver);
|
|
case 1:
|
|
return function(entry, receiverOf) {
|
|
return function(a) {
|
|
return receiverOf(this)[entry](a);
|
|
};
|
|
}(stubName, getReceiver);
|
|
case 2:
|
|
return function(entry, receiverOf) {
|
|
return function(a, b) {
|
|
return receiverOf(this)[entry](a, b);
|
|
};
|
|
}(stubName, getReceiver);
|
|
case 3:
|
|
return function(entry, receiverOf) {
|
|
return function(a, b, c) {
|
|
return receiverOf(this)[entry](a, b, c);
|
|
};
|
|
}(stubName, getReceiver);
|
|
case 4:
|
|
return function(entry, receiverOf) {
|
|
return function(a, b, c, d) {
|
|
return receiverOf(this)[entry](a, b, c, d);
|
|
};
|
|
}(stubName, getReceiver);
|
|
case 5:
|
|
return function(entry, receiverOf) {
|
|
return function(a, b, c, d, e) {
|
|
return receiverOf(this)[entry](a, b, c, d, e);
|
|
};
|
|
}(stubName, getReceiver);
|
|
default:
|
|
return function(f, receiverOf) {
|
|
return function() {
|
|
return f.apply(receiverOf(this), arguments);
|
|
};
|
|
}($function, getReceiver);
|
|
}
|
|
},
|
|
Closure_forwardCallTo(stubName, $function, isIntercepted, needsDirectAccess) {
|
|
if (isIntercepted)
|
|
return A.Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess);
|
|
return A.Closure_cspForwardCall($function.length, needsDirectAccess, stubName, $function);
|
|
},
|
|
Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function) {
|
|
var getReceiver = A.BoundClosure_receiverOf,
|
|
getInterceptor = A.BoundClosure_interceptorOf;
|
|
switch (needsDirectAccess ? -1 : arity) {
|
|
case 0:
|
|
throw A.wrapException(new A.RuntimeError("Intercepted function with no arguments."));
|
|
case 1:
|
|
return function(entry, interceptorOf, receiverOf) {
|
|
return function() {
|
|
return interceptorOf(this)[entry](receiverOf(this));
|
|
};
|
|
}(stubName, getInterceptor, getReceiver);
|
|
case 2:
|
|
return function(entry, interceptorOf, receiverOf) {
|
|
return function(a) {
|
|
return interceptorOf(this)[entry](receiverOf(this), a);
|
|
};
|
|
}(stubName, getInterceptor, getReceiver);
|
|
case 3:
|
|
return function(entry, interceptorOf, receiverOf) {
|
|
return function(a, b) {
|
|
return interceptorOf(this)[entry](receiverOf(this), a, b);
|
|
};
|
|
}(stubName, getInterceptor, getReceiver);
|
|
case 4:
|
|
return function(entry, interceptorOf, receiverOf) {
|
|
return function(a, b, c) {
|
|
return interceptorOf(this)[entry](receiverOf(this), a, b, c);
|
|
};
|
|
}(stubName, getInterceptor, getReceiver);
|
|
case 5:
|
|
return function(entry, interceptorOf, receiverOf) {
|
|
return function(a, b, c, d) {
|
|
return interceptorOf(this)[entry](receiverOf(this), a, b, c, d);
|
|
};
|
|
}(stubName, getInterceptor, getReceiver);
|
|
case 6:
|
|
return function(entry, interceptorOf, receiverOf) {
|
|
return function(a, b, c, d, e) {
|
|
return interceptorOf(this)[entry](receiverOf(this), a, b, c, d, e);
|
|
};
|
|
}(stubName, getInterceptor, getReceiver);
|
|
default:
|
|
return function(f, interceptorOf, receiverOf) {
|
|
return function() {
|
|
var a = [receiverOf(this)];
|
|
Array.prototype.push.apply(a, arguments);
|
|
return f.apply(interceptorOf(this), a);
|
|
};
|
|
}($function, getInterceptor, getReceiver);
|
|
}
|
|
},
|
|
Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess) {
|
|
var arity, t1;
|
|
if ($.BoundClosure__interceptorFieldNameCache == null)
|
|
$.BoundClosure__interceptorFieldNameCache = A.BoundClosure__computeFieldNamed("interceptor");
|
|
if ($.BoundClosure__receiverFieldNameCache == null)
|
|
$.BoundClosure__receiverFieldNameCache = A.BoundClosure__computeFieldNamed("receiver");
|
|
arity = $function.length;
|
|
t1 = A.Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function);
|
|
return t1;
|
|
},
|
|
closureFromTearOff(parameters) {
|
|
return A.Closure_fromTearOff(parameters);
|
|
},
|
|
BoundClosure_evalRecipe(closure, recipe) {
|
|
return A._Universe_evalInEnvironment(init.typeUniverse, A.instanceType(closure._receiver), recipe);
|
|
},
|
|
BoundClosure_receiverOf(closure) {
|
|
return closure._receiver;
|
|
},
|
|
BoundClosure_interceptorOf(closure) {
|
|
return closure._interceptor;
|
|
},
|
|
BoundClosure__computeFieldNamed(fieldName) {
|
|
var names, i, $name,
|
|
template = new A.BoundClosure("receiver", "interceptor"),
|
|
t1 = Object.getOwnPropertyNames(template);
|
|
t1.$flags = 1;
|
|
names = t1;
|
|
for (t1 = names.length, i = 0; i < t1; ++i) {
|
|
$name = names[i];
|
|
if (template[$name] === fieldName)
|
|
return $name;
|
|
}
|
|
throw A.wrapException(A.ArgumentError$("Field name " + fieldName + " not found.", null));
|
|
},
|
|
getIsolateAffinityTag($name) {
|
|
return init.getIsolateTag($name);
|
|
},
|
|
defineProperty(obj, property, value) {
|
|
Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true});
|
|
},
|
|
lookupAndCacheInterceptor(obj) {
|
|
var interceptor, interceptorClass, altTag, mark, t1,
|
|
tag = A._asString($.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) {
|
|
altTag = A._asStringQ($.alternateTagFunction.call$2(obj, tag));
|
|
if (altTag != null) {
|
|
record = $.dispatchRecordsForInstanceTags[altTag];
|
|
if (record != null) {
|
|
Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true});
|
|
return record.i;
|
|
}
|
|
interceptor = $.interceptorsForUncacheableTags[altTag];
|
|
if (interceptor != null)
|
|
return interceptor;
|
|
interceptorClass = init.interceptorsByTag[altTag];
|
|
tag = altTag;
|
|
}
|
|
}
|
|
if (interceptorClass == null)
|
|
return null;
|
|
interceptor = interceptorClass.prototype;
|
|
mark = tag[0];
|
|
if (mark === "!") {
|
|
record = A.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 = A.makeLeafDispatchRecord(interceptor);
|
|
Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true});
|
|
return t1.i;
|
|
}
|
|
if (mark === "+")
|
|
return A.patchInteriorProto(obj, interceptor);
|
|
if (mark === "*")
|
|
throw A.wrapException(A.UnimplementedError$(tag));
|
|
if (init.leafTags[tag] === true) {
|
|
t1 = A.makeLeafDispatchRecord(interceptor);
|
|
Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true});
|
|
return t1.i;
|
|
} else
|
|
return A.patchInteriorProto(obj, interceptor);
|
|
},
|
|
patchInteriorProto(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(interceptor) {
|
|
return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior);
|
|
},
|
|
makeDefaultDispatchRecord(tag, interceptorClass, proto) {
|
|
var interceptor = interceptorClass.prototype;
|
|
if (init.leafTags[tag] === true)
|
|
return A.makeLeafDispatchRecord(interceptor);
|
|
else
|
|
return J.makeDispatchRecord(interceptor, proto, null, null);
|
|
},
|
|
initNativeDispatch() {
|
|
if (true === $.initNativeDispatchFlag)
|
|
return;
|
|
$.initNativeDispatchFlag = true;
|
|
A.initNativeDispatchContinue();
|
|
},
|
|
initNativeDispatchContinue() {
|
|
var map, tags, fun, i, tag, proto, record, interceptorClass;
|
|
$.dispatchRecordsForInstanceTags = Object.create(null);
|
|
$.interceptorsForUncacheableTags = Object.create(null);
|
|
A.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 = A.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;
|
|
}
|
|
}
|
|
},
|
|
initHooks() {
|
|
var transformers, i, transformer, getTag, getUnknownTag, prototypeForTag,
|
|
hooks = B.C_JS_CONST0();
|
|
hooks = A.applyHooksTransformer(B.C_JS_CONST1, A.applyHooksTransformer(B.C_JS_CONST2, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST4, A.applyHooksTransformer(B.C_JS_CONST5, A.applyHooksTransformer(B.C_JS_CONST6(B.C_JS_CONST), hooks)))))));
|
|
if (typeof dartNativeDispatchHooksTransformer != "undefined") {
|
|
transformers = dartNativeDispatchHooksTransformer;
|
|
if (typeof transformers == "function")
|
|
transformers = [transformers];
|
|
if (Array.isArray(transformers))
|
|
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 A.initHooks_closure(getTag);
|
|
$.alternateTagFunction = new A.initHooks_closure0(getUnknownTag);
|
|
$.prototypeForTagFunction = new A.initHooks_closure1(prototypeForTag);
|
|
},
|
|
applyHooksTransformer(transformer, hooks) {
|
|
return transformer(hooks) || hooks;
|
|
},
|
|
createRecordTypePredicate(shape, fieldRtis) {
|
|
var $length = fieldRtis.length,
|
|
$function = init.rttc["" + $length + ";" + shape];
|
|
if ($function == null)
|
|
return null;
|
|
if ($length === 0)
|
|
return $function;
|
|
if ($length === $function.length)
|
|
return $function.apply(null, fieldRtis);
|
|
return $function(fieldRtis);
|
|
},
|
|
JSSyntaxRegExp_makeNative(source, multiLine, caseSensitive, unicode, dotAll, extraFlags) {
|
|
var m = multiLine ? "m" : "",
|
|
i = caseSensitive ? "" : "i",
|
|
u = unicode ? "u" : "",
|
|
s = dotAll ? "s" : "",
|
|
regexp = function(source, modifiers) {
|
|
try {
|
|
return new RegExp(source, modifiers);
|
|
} catch (e) {
|
|
return e;
|
|
}
|
|
}(source, m + i + u + s + extraFlags);
|
|
if (regexp instanceof RegExp)
|
|
return regexp;
|
|
throw A.wrapException(A.FormatException$("Illegal RegExp pattern (" + String(regexp) + ")", source, null));
|
|
},
|
|
stringContainsUnchecked(receiver, other, startIndex) {
|
|
var t1 = receiver.indexOf(other, startIndex);
|
|
return t1 >= 0;
|
|
},
|
|
escapeReplacement(replacement) {
|
|
if (replacement.indexOf("$", 0) >= 0)
|
|
return replacement.replace(/\$/g, "$$$$");
|
|
return replacement;
|
|
},
|
|
quoteStringForRegExp(string) {
|
|
if (/[[\]{}()*+?.\\^$|]/.test(string))
|
|
return string.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&");
|
|
return string;
|
|
},
|
|
stringReplaceAllUnchecked(receiver, pattern, replacement) {
|
|
var t1 = A.stringReplaceAllUncheckedString(receiver, pattern, replacement);
|
|
return t1;
|
|
},
|
|
stringReplaceAllUncheckedString(receiver, pattern, replacement) {
|
|
var $length, t1, i;
|
|
if (pattern === "") {
|
|
if (receiver === "")
|
|
return replacement;
|
|
$length = receiver.length;
|
|
for (t1 = replacement, i = 0; i < $length; ++i)
|
|
t1 = t1 + receiver[i] + replacement;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
}
|
|
if (receiver.indexOf(pattern, 0) < 0)
|
|
return receiver;
|
|
if (receiver.length < 500 || replacement.indexOf("$", 0) >= 0)
|
|
return receiver.split(pattern).join(replacement);
|
|
return receiver.replace(new RegExp(A.quoteStringForRegExp(pattern), "g"), A.escapeReplacement(replacement));
|
|
},
|
|
ConstantMap: function ConstantMap() {
|
|
},
|
|
ConstantStringMap: function ConstantStringMap(t0, t1, t2) {
|
|
this._jsIndex = t0;
|
|
this._values = t1;
|
|
this.$ti = t2;
|
|
},
|
|
Primitives_initTicker_closure: function Primitives_initTicker_closure(t0) {
|
|
this.performance = t0;
|
|
},
|
|
SafeToStringHook: function SafeToStringHook() {
|
|
},
|
|
TypeErrorDecoder: function TypeErrorDecoder(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_._pattern = t0;
|
|
_._arguments = t1;
|
|
_._argumentsExpr = t2;
|
|
_._expr = t3;
|
|
_._method = t4;
|
|
_._receiver = t5;
|
|
},
|
|
NullError: function NullError() {
|
|
},
|
|
JsNoSuchMethodError: function JsNoSuchMethodError(t0, t1, t2) {
|
|
this.__js_helper$_message = t0;
|
|
this._method = t1;
|
|
this._receiver = t2;
|
|
},
|
|
UnknownJsTypeError: function UnknownJsTypeError(t0) {
|
|
this.__js_helper$_message = t0;
|
|
},
|
|
NullThrownFromJavaScriptException: function NullThrownFromJavaScriptException(t0) {
|
|
this._irritant = t0;
|
|
},
|
|
ExceptionAndStackTrace: function ExceptionAndStackTrace(t0, t1) {
|
|
this.dartException = t0;
|
|
this.stackTrace = t1;
|
|
},
|
|
_StackTrace: function _StackTrace(t0) {
|
|
this._exception = t0;
|
|
this._trace = null;
|
|
},
|
|
Closure: function Closure() {
|
|
},
|
|
Closure0Args: function Closure0Args() {
|
|
},
|
|
Closure2Args: function Closure2Args() {
|
|
},
|
|
TearOffClosure: function TearOffClosure() {
|
|
},
|
|
StaticClosure: function StaticClosure() {
|
|
},
|
|
BoundClosure: function BoundClosure(t0, t1) {
|
|
this._receiver = t0;
|
|
this._interceptor = t1;
|
|
},
|
|
RuntimeError: function RuntimeError(t0) {
|
|
this.message = t0;
|
|
},
|
|
JsLinkedHashMap: function JsLinkedHashMap(t0) {
|
|
var _ = this;
|
|
_.__js_helper$_length = 0;
|
|
_._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null;
|
|
_._modifications = 0;
|
|
_.$ti = t0;
|
|
},
|
|
JsLinkedHashMap_addAll_closure: function JsLinkedHashMap_addAll_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
LinkedHashMapCell: function LinkedHashMapCell(t0, t1) {
|
|
var _ = this;
|
|
_.hashMapCellKey = t0;
|
|
_.hashMapCellValue = t1;
|
|
_._previous = _._next = null;
|
|
},
|
|
LinkedHashMapKeysIterable: function LinkedHashMapKeysIterable(t0, t1) {
|
|
this._map = t0;
|
|
this.$ti = t1;
|
|
},
|
|
LinkedHashMapKeyIterator: function LinkedHashMapKeyIterator(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._map = t0;
|
|
_._modifications = t1;
|
|
_._cell = t2;
|
|
_.__js_helper$_current = null;
|
|
_.$ti = t3;
|
|
},
|
|
initHooks_closure: function initHooks_closure(t0) {
|
|
this.getTag = t0;
|
|
},
|
|
initHooks_closure0: function initHooks_closure0(t0) {
|
|
this.getUnknownTag = t0;
|
|
},
|
|
initHooks_closure1: function initHooks_closure1(t0) {
|
|
this.prototypeForTag = t0;
|
|
},
|
|
JSSyntaxRegExp: function JSSyntaxRegExp(t0, t1) {
|
|
var _ = this;
|
|
_.pattern = t0;
|
|
_._nativeRegExp = t1;
|
|
_._hasCapturesCache = _._nativeAnchoredRegExp = _._nativeGlobalRegExp = null;
|
|
},
|
|
_ensureNativeList(list) {
|
|
var t1, result, i;
|
|
if (type$.JSIndexable_dynamic._is(list))
|
|
return list;
|
|
t1 = J.getInterceptor$asx(list);
|
|
result = A.List_List$filled(t1.get$length(list), null, false, type$.dynamic);
|
|
for (i = 0; i < t1.get$length(list); ++i)
|
|
B.JSArray_methods.$indexSet(result, i, t1.$index(list, i));
|
|
return result;
|
|
},
|
|
NativeInt8List__create1(arg) {
|
|
return new Int8Array(arg);
|
|
},
|
|
NativeUint8List_NativeUint8List($length) {
|
|
return new Uint8Array($length);
|
|
},
|
|
NativeUint8List_NativeUint8List$view(buffer, offsetInBytes, $length) {
|
|
var t1 = new Uint8Array(buffer, offsetInBytes, $length);
|
|
return t1;
|
|
},
|
|
_checkValidIndex(index, list, $length) {
|
|
if (index >>> 0 !== index || index >= $length)
|
|
throw A.wrapException(A.diagnoseIndexError(list, index));
|
|
},
|
|
_checkValidRange(start, end, $length) {
|
|
var t1;
|
|
if (!(start >>> 0 !== start))
|
|
t1 = end >>> 0 !== end || start > end || end > $length;
|
|
else
|
|
t1 = true;
|
|
if (t1)
|
|
throw A.wrapException(A.diagnoseRangeError(start, end, $length));
|
|
return end;
|
|
},
|
|
NativeByteBuffer: function NativeByteBuffer() {
|
|
},
|
|
NativeTypedData: function NativeTypedData() {
|
|
},
|
|
_UnmodifiableNativeByteBufferView: function _UnmodifiableNativeByteBufferView(t0) {
|
|
this.__native_typed_data$_data = t0;
|
|
},
|
|
NativeByteData: function NativeByteData() {
|
|
},
|
|
NativeTypedArray: function NativeTypedArray() {
|
|
},
|
|
NativeTypedArrayOfDouble: function NativeTypedArrayOfDouble() {
|
|
},
|
|
NativeTypedArrayOfInt: function NativeTypedArrayOfInt() {
|
|
},
|
|
NativeFloat32List: function NativeFloat32List() {
|
|
},
|
|
NativeFloat64List: function NativeFloat64List() {
|
|
},
|
|
NativeInt16List: function NativeInt16List() {
|
|
},
|
|
NativeInt32List: function NativeInt32List() {
|
|
},
|
|
NativeInt8List: function NativeInt8List() {
|
|
},
|
|
NativeUint16List: function NativeUint16List() {
|
|
},
|
|
NativeUint32List: function NativeUint32List() {
|
|
},
|
|
NativeUint8ClampedList: function NativeUint8ClampedList() {
|
|
},
|
|
NativeUint8List: function NativeUint8List() {
|
|
},
|
|
_NativeTypedArrayOfDouble_NativeTypedArray_ListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin() {
|
|
},
|
|
_NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin() {
|
|
},
|
|
_NativeTypedArrayOfInt_NativeTypedArray_ListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin() {
|
|
},
|
|
_NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin() {
|
|
},
|
|
Rti__getFutureFromFutureOr(universe, rti) {
|
|
var future = rti._precomputed1;
|
|
return future == null ? rti._precomputed1 = A._Universe__lookupInterfaceRti(universe, "Future", [rti._primary]) : future;
|
|
},
|
|
Rti__isUnionOfFunctionType(rti) {
|
|
var kind = rti._kind;
|
|
if (kind === 6 || kind === 7)
|
|
return A.Rti__isUnionOfFunctionType(rti._primary);
|
|
return kind === 11 || kind === 12;
|
|
},
|
|
Rti__getCanonicalRecipe(rti) {
|
|
return rti._canonicalRecipe;
|
|
},
|
|
findType(recipe) {
|
|
return A._Universe_eval(init.typeUniverse, recipe, false);
|
|
},
|
|
_substitute(universe, rti, typeArguments, depth) {
|
|
var baseType, substitutedBaseType, interfaceTypeArguments, substitutedInterfaceTypeArguments, base, substitutedBase, $arguments, substitutedArguments, t1, fields, substitutedFields, returnType, substitutedReturnType, functionParameters, substitutedFunctionParameters, bounds, substitutedBounds, index, argument,
|
|
kind = rti._kind;
|
|
switch (kind) {
|
|
case 5:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
return rti;
|
|
case 6:
|
|
baseType = rti._primary;
|
|
substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth);
|
|
if (substitutedBaseType === baseType)
|
|
return rti;
|
|
return A._Universe__lookupQuestionRti(universe, substitutedBaseType, true);
|
|
case 7:
|
|
baseType = rti._primary;
|
|
substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth);
|
|
if (substitutedBaseType === baseType)
|
|
return rti;
|
|
return A._Universe__lookupFutureOrRti(universe, substitutedBaseType, true);
|
|
case 8:
|
|
interfaceTypeArguments = rti._rest;
|
|
substitutedInterfaceTypeArguments = A._substituteArray(universe, interfaceTypeArguments, typeArguments, depth);
|
|
if (substitutedInterfaceTypeArguments === interfaceTypeArguments)
|
|
return rti;
|
|
return A._Universe__lookupInterfaceRti(universe, rti._primary, substitutedInterfaceTypeArguments);
|
|
case 9:
|
|
base = rti._primary;
|
|
substitutedBase = A._substitute(universe, base, typeArguments, depth);
|
|
$arguments = rti._rest;
|
|
substitutedArguments = A._substituteArray(universe, $arguments, typeArguments, depth);
|
|
if (substitutedBase === base && substitutedArguments === $arguments)
|
|
return rti;
|
|
return A._Universe__lookupBindingRti(universe, substitutedBase, substitutedArguments);
|
|
case 10:
|
|
t1 = rti._primary;
|
|
fields = rti._rest;
|
|
substitutedFields = A._substituteArray(universe, fields, typeArguments, depth);
|
|
if (substitutedFields === fields)
|
|
return rti;
|
|
return A._Universe__lookupRecordRti(universe, t1, substitutedFields);
|
|
case 11:
|
|
returnType = rti._primary;
|
|
substitutedReturnType = A._substitute(universe, returnType, typeArguments, depth);
|
|
functionParameters = rti._rest;
|
|
substitutedFunctionParameters = A._substituteFunctionParameters(universe, functionParameters, typeArguments, depth);
|
|
if (substitutedReturnType === returnType && substitutedFunctionParameters === functionParameters)
|
|
return rti;
|
|
return A._Universe__lookupFunctionRti(universe, substitutedReturnType, substitutedFunctionParameters);
|
|
case 12:
|
|
bounds = rti._rest;
|
|
depth += bounds.length;
|
|
substitutedBounds = A._substituteArray(universe, bounds, typeArguments, depth);
|
|
base = rti._primary;
|
|
substitutedBase = A._substitute(universe, base, typeArguments, depth);
|
|
if (substitutedBounds === bounds && substitutedBase === base)
|
|
return rti;
|
|
return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, true);
|
|
case 13:
|
|
index = rti._primary;
|
|
if (index < depth)
|
|
return rti;
|
|
argument = typeArguments[index - depth];
|
|
if (argument == null)
|
|
return rti;
|
|
return argument;
|
|
default:
|
|
throw A.wrapException(A.AssertionError$("Attempted to substitute unexpected RTI kind " + kind));
|
|
}
|
|
},
|
|
_substituteArray(universe, rtiArray, typeArguments, depth) {
|
|
var changed, i, rti, substitutedRti,
|
|
$length = rtiArray.length,
|
|
result = A._Utils_newArrayOrEmpty($length);
|
|
for (changed = false, i = 0; i < $length; ++i) {
|
|
rti = rtiArray[i];
|
|
substitutedRti = A._substitute(universe, rti, typeArguments, depth);
|
|
if (substitutedRti !== rti)
|
|
changed = true;
|
|
result[i] = substitutedRti;
|
|
}
|
|
return changed ? result : rtiArray;
|
|
},
|
|
_substituteNamed(universe, namedArray, typeArguments, depth) {
|
|
var changed, i, t1, t2, rti, substitutedRti,
|
|
$length = namedArray.length,
|
|
result = A._Utils_newArrayOrEmpty($length);
|
|
for (changed = false, i = 0; i < $length; i += 3) {
|
|
t1 = namedArray[i];
|
|
t2 = namedArray[i + 1];
|
|
rti = namedArray[i + 2];
|
|
substitutedRti = A._substitute(universe, rti, typeArguments, depth);
|
|
if (substitutedRti !== rti)
|
|
changed = true;
|
|
result.splice(i, 3, t1, t2, substitutedRti);
|
|
}
|
|
return changed ? result : namedArray;
|
|
},
|
|
_substituteFunctionParameters(universe, functionParameters, typeArguments, depth) {
|
|
var result,
|
|
requiredPositional = functionParameters._requiredPositional,
|
|
substitutedRequiredPositional = A._substituteArray(universe, requiredPositional, typeArguments, depth),
|
|
optionalPositional = functionParameters._optionalPositional,
|
|
substitutedOptionalPositional = A._substituteArray(universe, optionalPositional, typeArguments, depth),
|
|
named = functionParameters._named,
|
|
substitutedNamed = A._substituteNamed(universe, named, typeArguments, depth);
|
|
if (substitutedRequiredPositional === requiredPositional && substitutedOptionalPositional === optionalPositional && substitutedNamed === named)
|
|
return functionParameters;
|
|
result = new A._FunctionParameters();
|
|
result._requiredPositional = substitutedRequiredPositional;
|
|
result._optionalPositional = substitutedOptionalPositional;
|
|
result._named = substitutedNamed;
|
|
return result;
|
|
},
|
|
_setArrayType(target, rti) {
|
|
target[init.arrayRti] = rti;
|
|
return target;
|
|
},
|
|
closureFunctionType(closure) {
|
|
var signature = closure.$signature;
|
|
if (signature != null) {
|
|
if (typeof signature == "number")
|
|
return A.getTypeFromTypesTable(signature);
|
|
return closure.$signature();
|
|
}
|
|
return null;
|
|
},
|
|
instanceOrFunctionType(object, testRti) {
|
|
var rti;
|
|
if (A.Rti__isUnionOfFunctionType(testRti))
|
|
if (object instanceof A.Closure) {
|
|
rti = A.closureFunctionType(object);
|
|
if (rti != null)
|
|
return rti;
|
|
}
|
|
return A.instanceType(object);
|
|
},
|
|
instanceType(object) {
|
|
if (object instanceof A.Object)
|
|
return A._instanceType(object);
|
|
if (Array.isArray(object))
|
|
return A._arrayInstanceType(object);
|
|
return A._instanceTypeFromConstructor(J.getInterceptor$(object));
|
|
},
|
|
_arrayInstanceType(object) {
|
|
var rti = object[init.arrayRti],
|
|
defaultRti = type$.JSArray_dynamic;
|
|
if (rti == null)
|
|
return defaultRti;
|
|
if (rti.constructor !== defaultRti.constructor)
|
|
return defaultRti;
|
|
return rti;
|
|
},
|
|
_instanceType(object) {
|
|
var rti = object.$ti;
|
|
return rti != null ? rti : A._instanceTypeFromConstructor(object);
|
|
},
|
|
_instanceTypeFromConstructor(instance) {
|
|
var $constructor = instance.constructor,
|
|
probe = $constructor.$ccache;
|
|
if (probe != null)
|
|
return probe;
|
|
return A._instanceTypeFromConstructorMiss(instance, $constructor);
|
|
},
|
|
_instanceTypeFromConstructorMiss(instance, $constructor) {
|
|
var effectiveConstructor = instance instanceof A.Closure ? Object.getPrototypeOf(Object.getPrototypeOf(instance)).constructor : $constructor,
|
|
rti = A._Universe_findErasedType(init.typeUniverse, effectiveConstructor.name);
|
|
$constructor.$ccache = rti;
|
|
return rti;
|
|
},
|
|
getTypeFromTypesTable(index) {
|
|
var rti,
|
|
table = init.types,
|
|
type = table[index];
|
|
if (typeof type == "string") {
|
|
rti = A._Universe_eval(init.typeUniverse, type, false);
|
|
table[index] = rti;
|
|
return rti;
|
|
}
|
|
return type;
|
|
},
|
|
getRuntimeTypeOfDartObject(object) {
|
|
return A.createRuntimeType(A._instanceType(object));
|
|
},
|
|
_structuralTypeOf(object) {
|
|
var functionRti = object instanceof A.Closure ? A.closureFunctionType(object) : null;
|
|
if (functionRti != null)
|
|
return functionRti;
|
|
if (type$.TrustedGetRuntimeType._is(object))
|
|
return J.get$runtimeType$(object)._rti;
|
|
if (Array.isArray(object))
|
|
return A._arrayInstanceType(object);
|
|
return A.instanceType(object);
|
|
},
|
|
createRuntimeType(rti) {
|
|
var t1 = rti._cachedRuntimeType;
|
|
return t1 == null ? rti._cachedRuntimeType = new A._Type(rti) : t1;
|
|
},
|
|
typeLiteral(recipe) {
|
|
return A.createRuntimeType(A._Universe_eval(init.typeUniverse, recipe, false));
|
|
},
|
|
_installSpecializedIsTest(object) {
|
|
var testRti = this;
|
|
testRti._is = A._specializedIsTest(testRti);
|
|
return testRti._is(object);
|
|
},
|
|
_specializedIsTest(testRti) {
|
|
var kind, simpleIsFn, $name, predicate, t1;
|
|
if (testRti === type$.Object)
|
|
return A._isObject;
|
|
if (A.isTopType(testRti))
|
|
return A._isTop;
|
|
kind = testRti._kind;
|
|
if (kind === 6)
|
|
return A._generalNullableIsTestImplementation;
|
|
if (kind === 1)
|
|
return A._isNever;
|
|
if (kind === 7)
|
|
return A._isFutureOr;
|
|
simpleIsFn = A._simpleSpecializedIsTest(testRti);
|
|
if (simpleIsFn != null)
|
|
return simpleIsFn;
|
|
if (kind === 8) {
|
|
$name = testRti._primary;
|
|
if (testRti._rest.every(A.isTopType)) {
|
|
testRti._specializedTestResource = "$is" + $name;
|
|
if ($name === "List")
|
|
return A._isListTestViaProperty;
|
|
if (testRti === type$.JSObject)
|
|
return A._isJSObject;
|
|
return A._isTestViaProperty;
|
|
}
|
|
} else if (kind === 10) {
|
|
predicate = A.createRecordTypePredicate(testRti._primary, testRti._rest);
|
|
t1 = predicate == null ? A._isNever : predicate;
|
|
return t1 == null ? A._asObject(t1) : t1;
|
|
}
|
|
return A._generalIsTestImplementation;
|
|
},
|
|
_simpleSpecializedIsTest(testRti) {
|
|
if (testRti._kind === 8) {
|
|
if (testRti === type$.int)
|
|
return A._isInt;
|
|
if (testRti === type$.double || testRti === type$.num)
|
|
return A._isNum;
|
|
if (testRti === type$.String)
|
|
return A._isString;
|
|
if (testRti === type$.bool)
|
|
return A._isBool;
|
|
}
|
|
return null;
|
|
},
|
|
_installSpecializedAsCheck(object) {
|
|
var testRti = this,
|
|
asFn = A._generalAsCheckImplementation;
|
|
if (A.isTopType(testRti))
|
|
asFn = A._asTop;
|
|
else if (testRti === type$.Object)
|
|
asFn = A._asObject;
|
|
else if (A.isNullable(testRti)) {
|
|
asFn = A._generalNullableAsCheckImplementation;
|
|
if (testRti === type$.nullable_int)
|
|
asFn = A._asIntQ;
|
|
else if (testRti === type$.nullable_String)
|
|
asFn = A._asStringQ;
|
|
else if (testRti === type$.nullable_bool)
|
|
asFn = A._asBoolQ;
|
|
else if (testRti === type$.nullable_num)
|
|
asFn = A._asNumQ;
|
|
else if (testRti === type$.nullable_double)
|
|
asFn = A._asDoubleQ;
|
|
else if (testRti === type$.nullable_JSObject)
|
|
asFn = A._asJSObjectQ;
|
|
} else if (testRti === type$.int)
|
|
asFn = A._asInt;
|
|
else if (testRti === type$.String)
|
|
asFn = A._asString;
|
|
else if (testRti === type$.bool)
|
|
asFn = A._asBool;
|
|
else if (testRti === type$.num)
|
|
asFn = A._asNum;
|
|
else if (testRti === type$.double)
|
|
asFn = A._asDouble;
|
|
else if (testRti === type$.JSObject)
|
|
asFn = A._asJSObject;
|
|
testRti._as = asFn;
|
|
return testRti._as(object);
|
|
},
|
|
_generalIsTestImplementation(object) {
|
|
var testRti = this;
|
|
if (object == null)
|
|
return A.isNullable(testRti);
|
|
return A.isSubtype(init.typeUniverse, A.instanceOrFunctionType(object, testRti), testRti);
|
|
},
|
|
_generalNullableIsTestImplementation(object) {
|
|
if (object == null)
|
|
return true;
|
|
return this._primary._is(object);
|
|
},
|
|
_isTestViaProperty(object) {
|
|
var tag, testRti = this;
|
|
if (object == null)
|
|
return A.isNullable(testRti);
|
|
tag = testRti._specializedTestResource;
|
|
if (object instanceof A.Object)
|
|
return !!object[tag];
|
|
return !!J.getInterceptor$(object)[tag];
|
|
},
|
|
_isListTestViaProperty(object) {
|
|
var tag, testRti = this;
|
|
if (object == null)
|
|
return A.isNullable(testRti);
|
|
if (typeof object != "object")
|
|
return false;
|
|
if (Array.isArray(object))
|
|
return true;
|
|
tag = testRti._specializedTestResource;
|
|
if (object instanceof A.Object)
|
|
return !!object[tag];
|
|
return !!J.getInterceptor$(object)[tag];
|
|
},
|
|
_isJSObject(object) {
|
|
var t1 = this;
|
|
if (object == null)
|
|
return false;
|
|
if (typeof object == "object") {
|
|
if (object instanceof A.Object)
|
|
return !!object[t1._specializedTestResource];
|
|
return true;
|
|
}
|
|
if (typeof object == "function")
|
|
return true;
|
|
return false;
|
|
},
|
|
_isJSObjectStandalone(object) {
|
|
if (typeof object == "object") {
|
|
if (object instanceof A.Object)
|
|
return type$.JSObject._is(object);
|
|
return true;
|
|
}
|
|
if (typeof object == "function")
|
|
return true;
|
|
return false;
|
|
},
|
|
_generalAsCheckImplementation(object) {
|
|
var testRti = this;
|
|
if (object == null) {
|
|
if (A.isNullable(testRti))
|
|
return object;
|
|
} else if (testRti._is(object))
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._errorForAsCheck(object, testRti), new Error());
|
|
},
|
|
_generalNullableAsCheckImplementation(object) {
|
|
var testRti = this;
|
|
if (object == null || testRti._is(object))
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._errorForAsCheck(object, testRti), new Error());
|
|
},
|
|
_errorForAsCheck(object, testRti) {
|
|
return new A._TypeError("TypeError: " + A._Error_compose(object, A._rtiToString(testRti, null)));
|
|
},
|
|
_Error_compose(object, checkedTypeDescription) {
|
|
return A.Error_safeToString(object) + ": type '" + A._rtiToString(A._structuralTypeOf(object), null) + "' is not a subtype of type '" + checkedTypeDescription + "'";
|
|
},
|
|
_TypeError__TypeError$forType(object, type) {
|
|
return new A._TypeError("TypeError: " + A._Error_compose(object, type));
|
|
},
|
|
_isFutureOr(object) {
|
|
var testRti = this;
|
|
return testRti._primary._is(object) || A.Rti__getFutureFromFutureOr(init.typeUniverse, testRti)._is(object);
|
|
},
|
|
_isObject(object) {
|
|
return object != null;
|
|
},
|
|
_asObject(object) {
|
|
if (object != null)
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "Object"), new Error());
|
|
},
|
|
_isTop(object) {
|
|
return true;
|
|
},
|
|
_asTop(object) {
|
|
return object;
|
|
},
|
|
_isNever(object) {
|
|
return false;
|
|
},
|
|
_isBool(object) {
|
|
return true === object || false === object;
|
|
},
|
|
_asBool(object) {
|
|
if (true === object)
|
|
return true;
|
|
if (false === object)
|
|
return false;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "bool"), new Error());
|
|
},
|
|
_asBoolQ(object) {
|
|
if (true === object)
|
|
return true;
|
|
if (false === object)
|
|
return false;
|
|
if (object == null)
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "bool?"), new Error());
|
|
},
|
|
_asDouble(object) {
|
|
if (typeof object == "number")
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "double"), new Error());
|
|
},
|
|
_asDoubleQ(object) {
|
|
if (typeof object == "number")
|
|
return object;
|
|
if (object == null)
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "double?"), new Error());
|
|
},
|
|
_isInt(object) {
|
|
return typeof object == "number" && Math.floor(object) === object;
|
|
},
|
|
_asInt(object) {
|
|
if (typeof object == "number" && Math.floor(object) === object)
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "int"), new Error());
|
|
},
|
|
_asIntQ(object) {
|
|
if (typeof object == "number" && Math.floor(object) === object)
|
|
return object;
|
|
if (object == null)
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "int?"), new Error());
|
|
},
|
|
_isNum(object) {
|
|
return typeof object == "number";
|
|
},
|
|
_asNum(object) {
|
|
if (typeof object == "number")
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "num"), new Error());
|
|
},
|
|
_asNumQ(object) {
|
|
if (typeof object == "number")
|
|
return object;
|
|
if (object == null)
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "num?"), new Error());
|
|
},
|
|
_isString(object) {
|
|
return typeof object == "string";
|
|
},
|
|
_asString(object) {
|
|
if (typeof object == "string")
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "String"), new Error());
|
|
},
|
|
_asStringQ(object) {
|
|
if (typeof object == "string")
|
|
return object;
|
|
if (object == null)
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "String?"), new Error());
|
|
},
|
|
_asJSObject(object) {
|
|
if (A._isJSObjectStandalone(object))
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "JSObject"), new Error());
|
|
},
|
|
_asJSObjectQ(object) {
|
|
if (object == null)
|
|
return object;
|
|
if (A._isJSObjectStandalone(object))
|
|
return object;
|
|
throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "JSObject?"), new Error());
|
|
},
|
|
_rtiArrayToString(array, genericContext) {
|
|
var s, sep, i;
|
|
for (s = "", sep = "", i = 0; i < array.length; ++i, sep = ", ")
|
|
s += sep + A._rtiToString(array[i], genericContext);
|
|
return s;
|
|
},
|
|
_recordRtiToString(recordType, genericContext) {
|
|
var fieldCount, names, namesIndex, s, comma, i,
|
|
partialShape = recordType._primary,
|
|
fields = recordType._rest;
|
|
if ("" === partialShape)
|
|
return "(" + A._rtiArrayToString(fields, genericContext) + ")";
|
|
fieldCount = fields.length;
|
|
names = partialShape.split(",");
|
|
namesIndex = names.length - fieldCount;
|
|
for (s = "(", comma = "", i = 0; i < fieldCount; ++i, comma = ", ") {
|
|
s += comma;
|
|
if (namesIndex === 0)
|
|
s += "{";
|
|
s += A._rtiToString(fields[i], genericContext);
|
|
if (namesIndex >= 0)
|
|
s += " " + names[namesIndex];
|
|
++namesIndex;
|
|
}
|
|
return s + "})";
|
|
},
|
|
_functionRtiToString(functionType, genericContext, bounds) {
|
|
var boundsLength, offset, i, t1, typeParametersText, typeSep, t2, t3, boundRti, kind, parameters, requiredPositional, requiredPositionalLength, optionalPositional, optionalPositionalLength, named, namedLength, returnTypeText, argumentsText, sep, _s2_ = ", ", outerContextLength = null;
|
|
if (bounds != null) {
|
|
boundsLength = bounds.length;
|
|
if (genericContext == null)
|
|
genericContext = A._setArrayType([], type$.JSArray_String);
|
|
else
|
|
outerContextLength = genericContext.length;
|
|
offset = genericContext.length;
|
|
for (i = boundsLength; i > 0; --i)
|
|
B.JSArray_methods.add$1(genericContext, "T" + (offset + i));
|
|
for (t1 = type$.nullable_Object, typeParametersText = "<", typeSep = "", i = 0; i < boundsLength; ++i, typeSep = _s2_) {
|
|
t2 = genericContext.length;
|
|
t3 = t2 - 1 - i;
|
|
if (!(t3 >= 0))
|
|
return A.ioore(genericContext, t3);
|
|
typeParametersText = typeParametersText + typeSep + genericContext[t3];
|
|
boundRti = bounds[i];
|
|
kind = boundRti._kind;
|
|
if (!(kind === 2 || kind === 3 || kind === 4 || kind === 5 || boundRti === t1))
|
|
typeParametersText += " extends " + A._rtiToString(boundRti, genericContext);
|
|
}
|
|
typeParametersText += ">";
|
|
} else
|
|
typeParametersText = "";
|
|
t1 = functionType._primary;
|
|
parameters = functionType._rest;
|
|
requiredPositional = parameters._requiredPositional;
|
|
requiredPositionalLength = requiredPositional.length;
|
|
optionalPositional = parameters._optionalPositional;
|
|
optionalPositionalLength = optionalPositional.length;
|
|
named = parameters._named;
|
|
namedLength = named.length;
|
|
returnTypeText = A._rtiToString(t1, genericContext);
|
|
for (argumentsText = "", sep = "", i = 0; i < requiredPositionalLength; ++i, sep = _s2_)
|
|
argumentsText += sep + A._rtiToString(requiredPositional[i], genericContext);
|
|
if (optionalPositionalLength > 0) {
|
|
argumentsText += sep + "[";
|
|
for (sep = "", i = 0; i < optionalPositionalLength; ++i, sep = _s2_)
|
|
argumentsText += sep + A._rtiToString(optionalPositional[i], genericContext);
|
|
argumentsText += "]";
|
|
}
|
|
if (namedLength > 0) {
|
|
argumentsText += sep + "{";
|
|
for (sep = "", i = 0; i < namedLength; i += 3, sep = _s2_) {
|
|
argumentsText += sep;
|
|
if (named[i + 1])
|
|
argumentsText += "required ";
|
|
argumentsText += A._rtiToString(named[i + 2], genericContext) + " " + named[i];
|
|
}
|
|
argumentsText += "}";
|
|
}
|
|
if (outerContextLength != null) {
|
|
genericContext.toString;
|
|
genericContext.length = outerContextLength;
|
|
}
|
|
return typeParametersText + "(" + argumentsText + ") => " + returnTypeText;
|
|
},
|
|
_rtiToString(rti, genericContext) {
|
|
var questionArgument, s, argumentKind, $name, $arguments, t1, t2,
|
|
kind = rti._kind;
|
|
if (kind === 5)
|
|
return "erased";
|
|
if (kind === 2)
|
|
return "dynamic";
|
|
if (kind === 3)
|
|
return "void";
|
|
if (kind === 1)
|
|
return "Never";
|
|
if (kind === 4)
|
|
return "any";
|
|
if (kind === 6) {
|
|
questionArgument = rti._primary;
|
|
s = A._rtiToString(questionArgument, genericContext);
|
|
argumentKind = questionArgument._kind;
|
|
return (argumentKind === 11 || argumentKind === 12 ? "(" + s + ")" : s) + "?";
|
|
}
|
|
if (kind === 7)
|
|
return "FutureOr<" + A._rtiToString(rti._primary, genericContext) + ">";
|
|
if (kind === 8) {
|
|
$name = A._unminifyOrTag(rti._primary);
|
|
$arguments = rti._rest;
|
|
return $arguments.length > 0 ? $name + ("<" + A._rtiArrayToString($arguments, genericContext) + ">") : $name;
|
|
}
|
|
if (kind === 10)
|
|
return A._recordRtiToString(rti, genericContext);
|
|
if (kind === 11)
|
|
return A._functionRtiToString(rti, genericContext, null);
|
|
if (kind === 12)
|
|
return A._functionRtiToString(rti._primary, genericContext, rti._rest);
|
|
if (kind === 13) {
|
|
t1 = rti._primary;
|
|
t2 = genericContext.length;
|
|
t1 = t2 - 1 - t1;
|
|
if (!(t1 >= 0 && t1 < t2))
|
|
return A.ioore(genericContext, t1);
|
|
return genericContext[t1];
|
|
}
|
|
return "?";
|
|
},
|
|
_unminifyOrTag(rawClassName) {
|
|
var preserved = init.mangledGlobalNames[rawClassName];
|
|
if (preserved != null)
|
|
return preserved;
|
|
return rawClassName;
|
|
},
|
|
_Universe_findRule(universe, targetType) {
|
|
var rule = universe.tR[targetType];
|
|
for (; typeof rule == "string";)
|
|
rule = universe.tR[rule];
|
|
return rule;
|
|
},
|
|
_Universe_findErasedType(universe, cls) {
|
|
var $length, erased, $arguments, i, $interface,
|
|
metadata = universe.eT,
|
|
probe = metadata[cls];
|
|
if (probe == null)
|
|
return A._Universe_eval(universe, cls, false);
|
|
else if (typeof probe == "number") {
|
|
$length = probe;
|
|
erased = A._Universe__lookupTerminalRti(universe, 5, "#");
|
|
$arguments = A._Utils_newArrayOrEmpty($length);
|
|
for (i = 0; i < $length; ++i)
|
|
$arguments[i] = erased;
|
|
$interface = A._Universe__lookupInterfaceRti(universe, cls, $arguments);
|
|
metadata[cls] = $interface;
|
|
return $interface;
|
|
} else
|
|
return probe;
|
|
},
|
|
_Universe_addRules(universe, rules) {
|
|
return A._Utils_objectAssign(universe.tR, rules);
|
|
},
|
|
_Universe_addErasedTypes(universe, types) {
|
|
return A._Utils_objectAssign(universe.eT, types);
|
|
},
|
|
_Universe_eval(universe, recipe, normalize) {
|
|
var rti,
|
|
cache = universe.eC,
|
|
probe = cache.get(recipe);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = A._Parser_parse(A._Parser_create(universe, null, recipe, false));
|
|
cache.set(recipe, rti);
|
|
return rti;
|
|
},
|
|
_Universe_evalInEnvironment(universe, environment, recipe) {
|
|
var probe, rti,
|
|
cache = environment._evalCache;
|
|
if (cache == null)
|
|
cache = environment._evalCache = new Map();
|
|
probe = cache.get(recipe);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = A._Parser_parse(A._Parser_create(universe, environment, recipe, true));
|
|
cache.set(recipe, rti);
|
|
return rti;
|
|
},
|
|
_Universe_bind(universe, environment, argumentsRti) {
|
|
var argumentsRecipe, probe, rti,
|
|
cache = environment._bindCache;
|
|
if (cache == null)
|
|
cache = environment._bindCache = new Map();
|
|
argumentsRecipe = argumentsRti._canonicalRecipe;
|
|
probe = cache.get(argumentsRecipe);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = A._Universe__lookupBindingRti(universe, environment, argumentsRti._kind === 9 ? argumentsRti._rest : [argumentsRti]);
|
|
cache.set(argumentsRecipe, rti);
|
|
return rti;
|
|
},
|
|
_Universe__installTypeTests(universe, rti) {
|
|
rti._as = A._installSpecializedAsCheck;
|
|
rti._is = A._installSpecializedIsTest;
|
|
return rti;
|
|
},
|
|
_Universe__lookupTerminalRti(universe, kind, key) {
|
|
var rti, t1,
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = kind;
|
|
rti._canonicalRecipe = key;
|
|
t1 = A._Universe__installTypeTests(universe, rti);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__lookupQuestionRti(universe, baseType, normalize) {
|
|
var t1,
|
|
key = baseType._canonicalRecipe + "?",
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
t1 = A._Universe__createQuestionRti(universe, baseType, key, normalize);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__createQuestionRti(universe, baseType, key, normalize) {
|
|
var baseKind, t1, rti;
|
|
if (normalize) {
|
|
baseKind = baseType._kind;
|
|
t1 = true;
|
|
if (!A.isTopType(baseType))
|
|
if (!(baseType === type$.Null || baseType === type$.JSNull))
|
|
if (baseKind !== 6)
|
|
t1 = baseKind === 7 && A.isNullable(baseType._primary);
|
|
if (t1)
|
|
return baseType;
|
|
else if (baseKind === 1)
|
|
return type$.Null;
|
|
}
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 6;
|
|
rti._primary = baseType;
|
|
rti._canonicalRecipe = key;
|
|
return A._Universe__installTypeTests(universe, rti);
|
|
},
|
|
_Universe__lookupFutureOrRti(universe, baseType, normalize) {
|
|
var t1,
|
|
key = baseType._canonicalRecipe + "/",
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
t1 = A._Universe__createFutureOrRti(universe, baseType, key, normalize);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__createFutureOrRti(universe, baseType, key, normalize) {
|
|
var t1, rti;
|
|
if (normalize) {
|
|
t1 = baseType._kind;
|
|
if (A.isTopType(baseType) || baseType === type$.Object)
|
|
return baseType;
|
|
else if (t1 === 1)
|
|
return A._Universe__lookupInterfaceRti(universe, "Future", [baseType]);
|
|
else if (baseType === type$.Null || baseType === type$.JSNull)
|
|
return type$.nullable_Future_Null;
|
|
}
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 7;
|
|
rti._primary = baseType;
|
|
rti._canonicalRecipe = key;
|
|
return A._Universe__installTypeTests(universe, rti);
|
|
},
|
|
_Universe__lookupGenericFunctionParameterRti(universe, index) {
|
|
var rti, t1,
|
|
key = "" + index + "^",
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 13;
|
|
rti._primary = index;
|
|
rti._canonicalRecipe = key;
|
|
t1 = A._Universe__installTypeTests(universe, rti);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__canonicalRecipeJoin($arguments) {
|
|
var s, sep, i,
|
|
$length = $arguments.length;
|
|
for (s = "", sep = "", i = 0; i < $length; ++i, sep = ",")
|
|
s += sep + $arguments[i]._canonicalRecipe;
|
|
return s;
|
|
},
|
|
_Universe__canonicalRecipeJoinNamed($arguments) {
|
|
var s, sep, i, t1, nameSep,
|
|
$length = $arguments.length;
|
|
for (s = "", sep = "", i = 0; i < $length; i += 3, sep = ",") {
|
|
t1 = $arguments[i];
|
|
nameSep = $arguments[i + 1] ? "!" : ":";
|
|
s += sep + t1 + nameSep + $arguments[i + 2]._canonicalRecipe;
|
|
}
|
|
return s;
|
|
},
|
|
_Universe__lookupInterfaceRti(universe, $name, $arguments) {
|
|
var probe, rti, t1,
|
|
s = $name;
|
|
if ($arguments.length > 0)
|
|
s += "<" + A._Universe__canonicalRecipeJoin($arguments) + ">";
|
|
probe = universe.eC.get(s);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 8;
|
|
rti._primary = $name;
|
|
rti._rest = $arguments;
|
|
if ($arguments.length > 0)
|
|
rti._precomputed1 = $arguments[0];
|
|
rti._canonicalRecipe = s;
|
|
t1 = A._Universe__installTypeTests(universe, rti);
|
|
universe.eC.set(s, t1);
|
|
return t1;
|
|
},
|
|
_Universe__lookupBindingRti(universe, base, $arguments) {
|
|
var newBase, newArguments, key, probe, rti, t1;
|
|
if (base._kind === 9) {
|
|
newBase = base._primary;
|
|
newArguments = base._rest.concat($arguments);
|
|
} else {
|
|
newArguments = $arguments;
|
|
newBase = base;
|
|
}
|
|
key = newBase._canonicalRecipe + (";<" + A._Universe__canonicalRecipeJoin(newArguments) + ">");
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 9;
|
|
rti._primary = newBase;
|
|
rti._rest = newArguments;
|
|
rti._canonicalRecipe = key;
|
|
t1 = A._Universe__installTypeTests(universe, rti);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__lookupRecordRti(universe, partialShapeTag, fields) {
|
|
var rti, t1,
|
|
key = "+" + (partialShapeTag + "(" + A._Universe__canonicalRecipeJoin(fields) + ")"),
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 10;
|
|
rti._primary = partialShapeTag;
|
|
rti._rest = fields;
|
|
rti._canonicalRecipe = key;
|
|
t1 = A._Universe__installTypeTests(universe, rti);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__lookupFunctionRti(universe, returnType, parameters) {
|
|
var sep, key, probe, rti, t1,
|
|
s = returnType._canonicalRecipe,
|
|
requiredPositional = parameters._requiredPositional,
|
|
requiredPositionalLength = requiredPositional.length,
|
|
optionalPositional = parameters._optionalPositional,
|
|
optionalPositionalLength = optionalPositional.length,
|
|
named = parameters._named,
|
|
namedLength = named.length,
|
|
recipe = "(" + A._Universe__canonicalRecipeJoin(requiredPositional);
|
|
if (optionalPositionalLength > 0) {
|
|
sep = requiredPositionalLength > 0 ? "," : "";
|
|
recipe += sep + "[" + A._Universe__canonicalRecipeJoin(optionalPositional) + "]";
|
|
}
|
|
if (namedLength > 0) {
|
|
sep = requiredPositionalLength > 0 ? "," : "";
|
|
recipe += sep + "{" + A._Universe__canonicalRecipeJoinNamed(named) + "}";
|
|
}
|
|
key = s + (recipe + ")");
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 11;
|
|
rti._primary = returnType;
|
|
rti._rest = parameters;
|
|
rti._canonicalRecipe = key;
|
|
t1 = A._Universe__installTypeTests(universe, rti);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__lookupGenericFunctionRti(universe, baseFunctionType, bounds, normalize) {
|
|
var t1,
|
|
key = baseFunctionType._canonicalRecipe + ("<" + A._Universe__canonicalRecipeJoin(bounds) + ">"),
|
|
probe = universe.eC.get(key);
|
|
if (probe != null)
|
|
return probe;
|
|
t1 = A._Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize);
|
|
universe.eC.set(key, t1);
|
|
return t1;
|
|
},
|
|
_Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize) {
|
|
var $length, typeArguments, count, i, bound, substitutedBase, substitutedBounds, rti;
|
|
if (normalize) {
|
|
$length = bounds.length;
|
|
typeArguments = A._Utils_newArrayOrEmpty($length);
|
|
for (count = 0, i = 0; i < $length; ++i) {
|
|
bound = bounds[i];
|
|
if (bound._kind === 1) {
|
|
typeArguments[i] = bound;
|
|
++count;
|
|
}
|
|
}
|
|
if (count > 0) {
|
|
substitutedBase = A._substitute(universe, baseFunctionType, typeArguments, 0);
|
|
substitutedBounds = A._substituteArray(universe, bounds, typeArguments, 0);
|
|
return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, bounds !== substitutedBounds);
|
|
}
|
|
}
|
|
rti = new A.Rti(null, null);
|
|
rti._kind = 12;
|
|
rti._primary = baseFunctionType;
|
|
rti._rest = bounds;
|
|
rti._canonicalRecipe = key;
|
|
return A._Universe__installTypeTests(universe, rti);
|
|
},
|
|
_Parser_create(universe, environment, recipe, normalize) {
|
|
return {u: universe, e: environment, r: recipe, s: [], p: 0, n: normalize};
|
|
},
|
|
_Parser_parse(parser) {
|
|
var t1, i, ch, u, array, end, item,
|
|
source = parser.r,
|
|
stack = parser.s;
|
|
for (t1 = source.length, i = 0; i < t1;) {
|
|
ch = source.charCodeAt(i);
|
|
if (ch >= 48 && ch <= 57)
|
|
i = A._Parser_handleDigit(i + 1, ch, source, stack);
|
|
else if ((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124)
|
|
i = A._Parser_handleIdentifier(parser, i, source, stack, false);
|
|
else if (ch === 46)
|
|
i = A._Parser_handleIdentifier(parser, i, source, stack, true);
|
|
else {
|
|
++i;
|
|
switch (ch) {
|
|
case 44:
|
|
break;
|
|
case 58:
|
|
stack.push(false);
|
|
break;
|
|
case 33:
|
|
stack.push(true);
|
|
break;
|
|
case 59:
|
|
stack.push(A._Parser_toType(parser.u, parser.e, stack.pop()));
|
|
break;
|
|
case 94:
|
|
stack.push(A._Universe__lookupGenericFunctionParameterRti(parser.u, stack.pop()));
|
|
break;
|
|
case 35:
|
|
stack.push(A._Universe__lookupTerminalRti(parser.u, 5, "#"));
|
|
break;
|
|
case 64:
|
|
stack.push(A._Universe__lookupTerminalRti(parser.u, 2, "@"));
|
|
break;
|
|
case 126:
|
|
stack.push(A._Universe__lookupTerminalRti(parser.u, 3, "~"));
|
|
break;
|
|
case 60:
|
|
stack.push(parser.p);
|
|
parser.p = stack.length;
|
|
break;
|
|
case 62:
|
|
A._Parser_handleTypeArguments(parser, stack);
|
|
break;
|
|
case 38:
|
|
A._Parser_handleExtendedOperations(parser, stack);
|
|
break;
|
|
case 63:
|
|
u = parser.u;
|
|
stack.push(A._Universe__lookupQuestionRti(u, A._Parser_toType(u, parser.e, stack.pop()), parser.n));
|
|
break;
|
|
case 47:
|
|
u = parser.u;
|
|
stack.push(A._Universe__lookupFutureOrRti(u, A._Parser_toType(u, parser.e, stack.pop()), parser.n));
|
|
break;
|
|
case 40:
|
|
stack.push(-3);
|
|
stack.push(parser.p);
|
|
parser.p = stack.length;
|
|
break;
|
|
case 41:
|
|
A._Parser_handleArguments(parser, stack);
|
|
break;
|
|
case 91:
|
|
stack.push(parser.p);
|
|
parser.p = stack.length;
|
|
break;
|
|
case 93:
|
|
array = stack.splice(parser.p);
|
|
A._Parser_toTypes(parser.u, parser.e, array);
|
|
parser.p = stack.pop();
|
|
stack.push(array);
|
|
stack.push(-1);
|
|
break;
|
|
case 123:
|
|
stack.push(parser.p);
|
|
parser.p = stack.length;
|
|
break;
|
|
case 125:
|
|
array = stack.splice(parser.p);
|
|
A._Parser_toTypesNamed(parser.u, parser.e, array);
|
|
parser.p = stack.pop();
|
|
stack.push(array);
|
|
stack.push(-2);
|
|
break;
|
|
case 43:
|
|
end = source.indexOf("(", i);
|
|
stack.push(source.substring(i, end));
|
|
stack.push(-4);
|
|
stack.push(parser.p);
|
|
parser.p = stack.length;
|
|
i = end + 1;
|
|
break;
|
|
default:
|
|
throw "Bad character " + ch;
|
|
}
|
|
}
|
|
}
|
|
item = stack.pop();
|
|
return A._Parser_toType(parser.u, parser.e, item);
|
|
},
|
|
_Parser_handleDigit(i, digit, source, stack) {
|
|
var t1, ch,
|
|
value = digit - 48;
|
|
for (t1 = source.length; i < t1; ++i) {
|
|
ch = source.charCodeAt(i);
|
|
if (!(ch >= 48 && ch <= 57))
|
|
break;
|
|
value = value * 10 + (ch - 48);
|
|
}
|
|
stack.push(value);
|
|
return i;
|
|
},
|
|
_Parser_handleIdentifier(parser, start, source, stack, hasPeriod) {
|
|
var t1, ch, t2, string, environment, recipe,
|
|
i = start + 1;
|
|
for (t1 = source.length; i < t1; ++i) {
|
|
ch = source.charCodeAt(i);
|
|
if (ch === 46) {
|
|
if (hasPeriod)
|
|
break;
|
|
hasPeriod = true;
|
|
} else {
|
|
if (!((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124))
|
|
t2 = ch >= 48 && ch <= 57;
|
|
else
|
|
t2 = true;
|
|
if (!t2)
|
|
break;
|
|
}
|
|
}
|
|
string = source.substring(start, i);
|
|
if (hasPeriod) {
|
|
t1 = parser.u;
|
|
environment = parser.e;
|
|
if (environment._kind === 9)
|
|
environment = environment._primary;
|
|
recipe = A._Universe_findRule(t1, environment._primary)[string];
|
|
if (recipe == null)
|
|
A.throwExpression('No "' + string + '" in "' + A.Rti__getCanonicalRecipe(environment) + '"');
|
|
stack.push(A._Universe_evalInEnvironment(t1, environment, recipe));
|
|
} else
|
|
stack.push(string);
|
|
return i;
|
|
},
|
|
_Parser_handleTypeArguments(parser, stack) {
|
|
var base,
|
|
universe = parser.u,
|
|
$arguments = A._Parser_collectArray(parser, stack),
|
|
head = stack.pop();
|
|
if (typeof head == "string")
|
|
stack.push(A._Universe__lookupInterfaceRti(universe, head, $arguments));
|
|
else {
|
|
base = A._Parser_toType(universe, parser.e, head);
|
|
switch (base._kind) {
|
|
case 11:
|
|
stack.push(A._Universe__lookupGenericFunctionRti(universe, base, $arguments, parser.n));
|
|
break;
|
|
default:
|
|
stack.push(A._Universe__lookupBindingRti(universe, base, $arguments));
|
|
break;
|
|
}
|
|
}
|
|
},
|
|
_Parser_handleArguments(parser, stack) {
|
|
var requiredPositional, returnType, parameters,
|
|
universe = parser.u,
|
|
head = stack.pop(),
|
|
optionalPositional = null, named = null;
|
|
if (typeof head == "number")
|
|
switch (head) {
|
|
case -1:
|
|
optionalPositional = stack.pop();
|
|
break;
|
|
case -2:
|
|
named = stack.pop();
|
|
break;
|
|
default:
|
|
stack.push(head);
|
|
break;
|
|
}
|
|
else
|
|
stack.push(head);
|
|
requiredPositional = A._Parser_collectArray(parser, stack);
|
|
head = stack.pop();
|
|
switch (head) {
|
|
case -3:
|
|
head = stack.pop();
|
|
if (optionalPositional == null)
|
|
optionalPositional = universe.sEA;
|
|
if (named == null)
|
|
named = universe.sEA;
|
|
returnType = A._Parser_toType(universe, parser.e, head);
|
|
parameters = new A._FunctionParameters();
|
|
parameters._requiredPositional = requiredPositional;
|
|
parameters._optionalPositional = optionalPositional;
|
|
parameters._named = named;
|
|
stack.push(A._Universe__lookupFunctionRti(universe, returnType, parameters));
|
|
return;
|
|
case -4:
|
|
stack.push(A._Universe__lookupRecordRti(universe, stack.pop(), requiredPositional));
|
|
return;
|
|
default:
|
|
throw A.wrapException(A.AssertionError$("Unexpected state under `()`: " + A.S(head)));
|
|
}
|
|
},
|
|
_Parser_handleExtendedOperations(parser, stack) {
|
|
var $top = stack.pop();
|
|
if (0 === $top) {
|
|
stack.push(A._Universe__lookupTerminalRti(parser.u, 1, "0&"));
|
|
return;
|
|
}
|
|
if (1 === $top) {
|
|
stack.push(A._Universe__lookupTerminalRti(parser.u, 4, "1&"));
|
|
return;
|
|
}
|
|
throw A.wrapException(A.AssertionError$("Unexpected extended operation " + A.S($top)));
|
|
},
|
|
_Parser_collectArray(parser, stack) {
|
|
var array = stack.splice(parser.p);
|
|
A._Parser_toTypes(parser.u, parser.e, array);
|
|
parser.p = stack.pop();
|
|
return array;
|
|
},
|
|
_Parser_toType(universe, environment, item) {
|
|
if (typeof item == "string")
|
|
return A._Universe__lookupInterfaceRti(universe, item, universe.sEA);
|
|
else if (typeof item == "number") {
|
|
environment.toString;
|
|
return A._Parser_indexToType(universe, environment, item);
|
|
} else
|
|
return item;
|
|
},
|
|
_Parser_toTypes(universe, environment, items) {
|
|
var i,
|
|
$length = items.length;
|
|
for (i = 0; i < $length; ++i)
|
|
items[i] = A._Parser_toType(universe, environment, items[i]);
|
|
},
|
|
_Parser_toTypesNamed(universe, environment, items) {
|
|
var i,
|
|
$length = items.length;
|
|
for (i = 2; i < $length; i += 3)
|
|
items[i] = A._Parser_toType(universe, environment, items[i]);
|
|
},
|
|
_Parser_indexToType(universe, environment, index) {
|
|
var typeArguments, len,
|
|
kind = environment._kind;
|
|
if (kind === 9) {
|
|
if (index === 0)
|
|
return environment._primary;
|
|
typeArguments = environment._rest;
|
|
len = typeArguments.length;
|
|
if (index <= len)
|
|
return typeArguments[index - 1];
|
|
index -= len;
|
|
environment = environment._primary;
|
|
kind = environment._kind;
|
|
} else if (index === 0)
|
|
return environment;
|
|
if (kind !== 8)
|
|
throw A.wrapException(A.AssertionError$("Indexed base must be an interface type"));
|
|
typeArguments = environment._rest;
|
|
if (index <= typeArguments.length)
|
|
return typeArguments[index - 1];
|
|
throw A.wrapException(A.AssertionError$("Bad index " + index + " for " + environment.toString$0(0)));
|
|
},
|
|
isSubtype(universe, s, t) {
|
|
var result,
|
|
sCache = s._isSubtypeCache;
|
|
if (sCache == null)
|
|
sCache = s._isSubtypeCache = new Map();
|
|
result = sCache.get(t);
|
|
if (result == null) {
|
|
result = A._isSubtype(universe, s, null, t, null);
|
|
sCache.set(t, result);
|
|
}
|
|
return result;
|
|
},
|
|
_isSubtype(universe, s, sEnv, t, tEnv) {
|
|
var sKind, leftTypeVariable, tKind, t1, t2, sBounds, tBounds, sLength, i, sBound, tBound;
|
|
if (s === t)
|
|
return true;
|
|
if (A.isTopType(t))
|
|
return true;
|
|
sKind = s._kind;
|
|
if (sKind === 4)
|
|
return true;
|
|
if (A.isTopType(s))
|
|
return false;
|
|
if (s._kind === 1)
|
|
return true;
|
|
leftTypeVariable = sKind === 13;
|
|
if (leftTypeVariable)
|
|
if (A._isSubtype(universe, sEnv[s._primary], sEnv, t, tEnv))
|
|
return true;
|
|
tKind = t._kind;
|
|
t1 = type$.Null;
|
|
if (s === t1 || s === type$.JSNull) {
|
|
if (tKind === 7)
|
|
return A._isSubtype(universe, s, sEnv, t._primary, tEnv);
|
|
return t === t1 || t === type$.JSNull || tKind === 6;
|
|
}
|
|
if (t === type$.Object) {
|
|
if (sKind === 7)
|
|
return A._isSubtype(universe, s._primary, sEnv, t, tEnv);
|
|
return sKind !== 6;
|
|
}
|
|
if (sKind === 7) {
|
|
if (!A._isSubtype(universe, s._primary, sEnv, t, tEnv))
|
|
return false;
|
|
return A._isSubtype(universe, A.Rti__getFutureFromFutureOr(universe, s), sEnv, t, tEnv);
|
|
}
|
|
if (sKind === 6)
|
|
return A._isSubtype(universe, t1, sEnv, t, tEnv) && A._isSubtype(universe, s._primary, sEnv, t, tEnv);
|
|
if (tKind === 7) {
|
|
if (A._isSubtype(universe, s, sEnv, t._primary, tEnv))
|
|
return true;
|
|
return A._isSubtype(universe, s, sEnv, A.Rti__getFutureFromFutureOr(universe, t), tEnv);
|
|
}
|
|
if (tKind === 6)
|
|
return A._isSubtype(universe, s, sEnv, t1, tEnv) || A._isSubtype(universe, s, sEnv, t._primary, tEnv);
|
|
if (leftTypeVariable)
|
|
return false;
|
|
t1 = sKind !== 11;
|
|
if ((!t1 || sKind === 12) && t === type$.Function)
|
|
return true;
|
|
t2 = sKind === 10;
|
|
if (t2 && t === type$.Record)
|
|
return true;
|
|
if (tKind === 12) {
|
|
if (s === type$.JavaScriptFunction)
|
|
return true;
|
|
if (sKind !== 12)
|
|
return false;
|
|
sBounds = s._rest;
|
|
tBounds = t._rest;
|
|
sLength = sBounds.length;
|
|
if (sLength !== tBounds.length)
|
|
return false;
|
|
sEnv = sEnv == null ? sBounds : sBounds.concat(sEnv);
|
|
tEnv = tEnv == null ? tBounds : tBounds.concat(tEnv);
|
|
for (i = 0; i < sLength; ++i) {
|
|
sBound = sBounds[i];
|
|
tBound = tBounds[i];
|
|
if (!A._isSubtype(universe, sBound, sEnv, tBound, tEnv) || !A._isSubtype(universe, tBound, tEnv, sBound, sEnv))
|
|
return false;
|
|
}
|
|
return A._isFunctionSubtype(universe, s._primary, sEnv, t._primary, tEnv);
|
|
}
|
|
if (tKind === 11) {
|
|
if (s === type$.JavaScriptFunction)
|
|
return true;
|
|
if (t1)
|
|
return false;
|
|
return A._isFunctionSubtype(universe, s, sEnv, t, tEnv);
|
|
}
|
|
if (sKind === 8) {
|
|
if (tKind !== 8)
|
|
return false;
|
|
return A._isInterfaceSubtype(universe, s, sEnv, t, tEnv);
|
|
}
|
|
if (t2 && tKind === 10)
|
|
return A._isRecordSubtype(universe, s, sEnv, t, tEnv);
|
|
return false;
|
|
},
|
|
_isFunctionSubtype(universe, s, sEnv, t, tEnv) {
|
|
var sParameters, tParameters, sRequiredPositional, tRequiredPositional, sRequiredPositionalLength, tRequiredPositionalLength, requiredPositionalDelta, sOptionalPositional, tOptionalPositional, sOptionalPositionalLength, tOptionalPositionalLength, i, t1, sNamed, tNamed, sNamedLength, tNamedLength, sIndex, tIndex, tName, sName, sIsRequired;
|
|
if (!A._isSubtype(universe, s._primary, sEnv, t._primary, tEnv))
|
|
return false;
|
|
sParameters = s._rest;
|
|
tParameters = t._rest;
|
|
sRequiredPositional = sParameters._requiredPositional;
|
|
tRequiredPositional = tParameters._requiredPositional;
|
|
sRequiredPositionalLength = sRequiredPositional.length;
|
|
tRequiredPositionalLength = tRequiredPositional.length;
|
|
if (sRequiredPositionalLength > tRequiredPositionalLength)
|
|
return false;
|
|
requiredPositionalDelta = tRequiredPositionalLength - sRequiredPositionalLength;
|
|
sOptionalPositional = sParameters._optionalPositional;
|
|
tOptionalPositional = tParameters._optionalPositional;
|
|
sOptionalPositionalLength = sOptionalPositional.length;
|
|
tOptionalPositionalLength = tOptionalPositional.length;
|
|
if (sRequiredPositionalLength + sOptionalPositionalLength < tRequiredPositionalLength + tOptionalPositionalLength)
|
|
return false;
|
|
for (i = 0; i < sRequiredPositionalLength; ++i) {
|
|
t1 = sRequiredPositional[i];
|
|
if (!A._isSubtype(universe, tRequiredPositional[i], tEnv, t1, sEnv))
|
|
return false;
|
|
}
|
|
for (i = 0; i < requiredPositionalDelta; ++i) {
|
|
t1 = sOptionalPositional[i];
|
|
if (!A._isSubtype(universe, tRequiredPositional[sRequiredPositionalLength + i], tEnv, t1, sEnv))
|
|
return false;
|
|
}
|
|
for (i = 0; i < tOptionalPositionalLength; ++i) {
|
|
t1 = sOptionalPositional[requiredPositionalDelta + i];
|
|
if (!A._isSubtype(universe, tOptionalPositional[i], tEnv, t1, sEnv))
|
|
return false;
|
|
}
|
|
sNamed = sParameters._named;
|
|
tNamed = tParameters._named;
|
|
sNamedLength = sNamed.length;
|
|
tNamedLength = tNamed.length;
|
|
for (sIndex = 0, tIndex = 0; tIndex < tNamedLength; tIndex += 3) {
|
|
tName = tNamed[tIndex];
|
|
for (; true;) {
|
|
if (sIndex >= sNamedLength)
|
|
return false;
|
|
sName = sNamed[sIndex];
|
|
sIndex += 3;
|
|
if (tName < sName)
|
|
return false;
|
|
sIsRequired = sNamed[sIndex - 2];
|
|
if (sName < tName) {
|
|
if (sIsRequired)
|
|
return false;
|
|
continue;
|
|
}
|
|
t1 = tNamed[tIndex + 1];
|
|
if (sIsRequired && !t1)
|
|
return false;
|
|
t1 = sNamed[sIndex - 1];
|
|
if (!A._isSubtype(universe, tNamed[tIndex + 2], tEnv, t1, sEnv))
|
|
return false;
|
|
break;
|
|
}
|
|
}
|
|
for (; sIndex < sNamedLength;) {
|
|
if (sNamed[sIndex + 1])
|
|
return false;
|
|
sIndex += 3;
|
|
}
|
|
return true;
|
|
},
|
|
_isInterfaceSubtype(universe, s, sEnv, t, tEnv) {
|
|
var rule, recipes, $length, supertypeArgs, i,
|
|
sName = s._primary,
|
|
tName = t._primary;
|
|
for (; sName !== tName;) {
|
|
rule = universe.tR[sName];
|
|
if (rule == null)
|
|
return false;
|
|
if (typeof rule == "string") {
|
|
sName = rule;
|
|
continue;
|
|
}
|
|
recipes = rule[tName];
|
|
if (recipes == null)
|
|
return false;
|
|
$length = recipes.length;
|
|
supertypeArgs = $length > 0 ? new Array($length) : init.typeUniverse.sEA;
|
|
for (i = 0; i < $length; ++i)
|
|
supertypeArgs[i] = A._Universe_evalInEnvironment(universe, s, recipes[i]);
|
|
return A._areArgumentsSubtypes(universe, supertypeArgs, null, sEnv, t._rest, tEnv);
|
|
}
|
|
return A._areArgumentsSubtypes(universe, s._rest, null, sEnv, t._rest, tEnv);
|
|
},
|
|
_areArgumentsSubtypes(universe, sArgs, sVariances, sEnv, tArgs, tEnv) {
|
|
var i,
|
|
$length = sArgs.length;
|
|
for (i = 0; i < $length; ++i)
|
|
if (!A._isSubtype(universe, sArgs[i], sEnv, tArgs[i], tEnv))
|
|
return false;
|
|
return true;
|
|
},
|
|
_isRecordSubtype(universe, s, sEnv, t, tEnv) {
|
|
var i,
|
|
sFields = s._rest,
|
|
tFields = t._rest,
|
|
sCount = sFields.length;
|
|
if (sCount !== tFields.length)
|
|
return false;
|
|
if (s._primary !== t._primary)
|
|
return false;
|
|
for (i = 0; i < sCount; ++i)
|
|
if (!A._isSubtype(universe, sFields[i], sEnv, tFields[i], tEnv))
|
|
return false;
|
|
return true;
|
|
},
|
|
isNullable(t) {
|
|
var kind = t._kind,
|
|
t1 = true;
|
|
if (!(t === type$.Null || t === type$.JSNull))
|
|
if (!A.isTopType(t))
|
|
if (kind !== 6)
|
|
t1 = kind === 7 && A.isNullable(t._primary);
|
|
return t1;
|
|
},
|
|
isTopType(t) {
|
|
var kind = t._kind;
|
|
return kind === 2 || kind === 3 || kind === 4 || kind === 5 || t === type$.nullable_Object;
|
|
},
|
|
_Utils_objectAssign(o, other) {
|
|
var i, key,
|
|
keys = Object.keys(other),
|
|
$length = keys.length;
|
|
for (i = 0; i < $length; ++i) {
|
|
key = keys[i];
|
|
o[key] = other[key];
|
|
}
|
|
},
|
|
_Utils_newArrayOrEmpty($length) {
|
|
return $length > 0 ? new Array($length) : init.typeUniverse.sEA;
|
|
},
|
|
Rti: function Rti(t0, t1) {
|
|
var _ = this;
|
|
_._as = t0;
|
|
_._is = t1;
|
|
_._cachedRuntimeType = _._specializedTestResource = _._isSubtypeCache = _._precomputed1 = null;
|
|
_._kind = 0;
|
|
_._canonicalRecipe = _._bindCache = _._evalCache = _._rest = _._primary = null;
|
|
},
|
|
_FunctionParameters: function _FunctionParameters() {
|
|
this._named = this._optionalPositional = this._requiredPositional = null;
|
|
},
|
|
_Type: function _Type(t0) {
|
|
this._rti = t0;
|
|
},
|
|
_Error: function _Error() {
|
|
},
|
|
_TypeError: function _TypeError(t0) {
|
|
this.__rti$_message = t0;
|
|
},
|
|
_AsyncRun__initializeScheduleImmediate() {
|
|
var t1, div, span;
|
|
if (self.scheduleImmediate != null)
|
|
return A.async__AsyncRun__scheduleImmediateJsOverride$closure();
|
|
if (self.MutationObserver != null && self.document != null) {
|
|
t1 = {};
|
|
div = self.document.createElement("div");
|
|
span = self.document.createElement("span");
|
|
t1.storedCallback = null;
|
|
new self.MutationObserver(A.convertDartClosureToJS(new A._AsyncRun__initializeScheduleImmediate_internalCallback(t1), 1)).observe(div, {childList: true});
|
|
return new A._AsyncRun__initializeScheduleImmediate_closure(t1, div, span);
|
|
} else if (self.setImmediate != null)
|
|
return A.async__AsyncRun__scheduleImmediateWithSetImmediate$closure();
|
|
return A.async__AsyncRun__scheduleImmediateWithTimer$closure();
|
|
},
|
|
_AsyncRun__scheduleImmediateJsOverride(callback) {
|
|
self.scheduleImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateJsOverride_internalCallback(type$.void_Function._as(callback)), 0));
|
|
},
|
|
_AsyncRun__scheduleImmediateWithSetImmediate(callback) {
|
|
self.setImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(type$.void_Function._as(callback)), 0));
|
|
},
|
|
_AsyncRun__scheduleImmediateWithTimer(callback) {
|
|
A.Timer__createTimer(B.Duration_0, type$.void_Function._as(callback));
|
|
},
|
|
Timer__createTimer(duration, callback) {
|
|
return A._TimerImpl$(duration._duration / 1000 | 0, callback);
|
|
},
|
|
_TimerImpl$(milliseconds, callback) {
|
|
var t1 = new A._TimerImpl();
|
|
t1._TimerImpl$2(milliseconds, callback);
|
|
return t1;
|
|
},
|
|
_makeAsyncAwaitCompleter($T) {
|
|
return new A._AsyncAwaitCompleter(new A._Future($.Zone__current, $T._eval$1("_Future<0>")), $T._eval$1("_AsyncAwaitCompleter<0>"));
|
|
},
|
|
_asyncStartSync(bodyFunction, completer) {
|
|
bodyFunction.call$2(0, null);
|
|
completer.isSync = true;
|
|
return completer._future;
|
|
},
|
|
_asyncAwait(object, bodyFunction) {
|
|
A._awaitOnObject(object, bodyFunction);
|
|
},
|
|
_asyncReturn(object, completer) {
|
|
completer.complete$1(object);
|
|
},
|
|
_asyncRethrow(object, completer) {
|
|
completer.completeError$2(A.unwrapException(object), A.getTraceFromException(object));
|
|
},
|
|
_awaitOnObject(object, bodyFunction) {
|
|
var t1, future,
|
|
thenCallback = new A._awaitOnObject_closure(bodyFunction),
|
|
errorCallback = new A._awaitOnObject_closure0(bodyFunction);
|
|
if (object instanceof A._Future)
|
|
object._thenAwait$1$2(thenCallback, errorCallback, type$.dynamic);
|
|
else {
|
|
t1 = type$.dynamic;
|
|
if (object instanceof A._Future)
|
|
object.then$1$2$onError(thenCallback, errorCallback, t1);
|
|
else {
|
|
future = new A._Future($.Zone__current, type$._Future_dynamic);
|
|
future._state = 8;
|
|
future._resultOrListeners = object;
|
|
future._thenAwait$1$2(thenCallback, errorCallback, t1);
|
|
}
|
|
}
|
|
},
|
|
_wrapJsFunctionForAsync($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$3$1(new A._wrapJsFunctionForAsync_closure($protected), type$.void, type$.int, type$.dynamic);
|
|
},
|
|
AsyncError_defaultStackTrace(error) {
|
|
var stackTrace;
|
|
if (type$.Error._is(error)) {
|
|
stackTrace = error.get$stackTrace();
|
|
if (stackTrace != null)
|
|
return stackTrace;
|
|
}
|
|
return B.C__StringStackTrace;
|
|
},
|
|
Future_Future$value(value, $T) {
|
|
var t1 = value == null ? $T._as(value) : value,
|
|
t2 = new A._Future($.Zone__current, $T._eval$1("_Future<0>"));
|
|
t2._asyncComplete$1(t1);
|
|
return t2;
|
|
},
|
|
Future_wait(futures, eagerError, $T) {
|
|
var handleError, future, pos, e, s, t1, _i, t2, exception, t3, t4, _box_0 = {}, cleanUp = null,
|
|
_future = new A._Future($.Zone__current, $T._eval$1("_Future<List<0>>"));
|
|
_box_0.values = null;
|
|
_box_0.remaining = 0;
|
|
_box_0.stackTrace = _box_0.error = null;
|
|
handleError = new A.Future_wait_handleError(_box_0, cleanUp, true, _future);
|
|
try {
|
|
for (t1 = type$.Null, _i = 0, t2 = 0; _i < 2; ++_i) {
|
|
future = futures[_i];
|
|
pos = t2;
|
|
future.then$1$2$onError(new A.Future_wait_closure(_box_0, pos, _future, $T, cleanUp, true), handleError, t1);
|
|
t2 = ++_box_0.remaining;
|
|
}
|
|
if (t2 === 0) {
|
|
t1 = _future;
|
|
t1._completeWithValue$1(A._setArrayType([], $T._eval$1("JSArray<0>")));
|
|
return t1;
|
|
}
|
|
_box_0.values = A.List_List$filled(t2, null, false, $T._eval$1("0?"));
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
t1 = _future;
|
|
t2 = e;
|
|
t3 = s;
|
|
t4 = A._interceptError(t2, t3);
|
|
t2 = new A.AsyncError(t2, t3 == null ? A.AsyncError_defaultStackTrace(t2) : t3);
|
|
t1._asyncCompleteErrorObject$1(t2);
|
|
return t1;
|
|
}
|
|
return _future;
|
|
},
|
|
_interceptError(error, stackTrace) {
|
|
if ($.Zone__current === B.C__RootZone)
|
|
return null;
|
|
return null;
|
|
},
|
|
_interceptUserError(error, stackTrace) {
|
|
if ($.Zone__current !== B.C__RootZone)
|
|
A._interceptError(error, stackTrace);
|
|
if (stackTrace == null)
|
|
if (type$.Error._is(error)) {
|
|
stackTrace = error.get$stackTrace();
|
|
if (stackTrace == null) {
|
|
A.Primitives_trySetStackTrace(error, B.C__StringStackTrace);
|
|
stackTrace = B.C__StringStackTrace;
|
|
}
|
|
} else
|
|
stackTrace = B.C__StringStackTrace;
|
|
else if (type$.Error._is(error))
|
|
A.Primitives_trySetStackTrace(error, stackTrace);
|
|
return new A.AsyncError(error, stackTrace);
|
|
},
|
|
_Future__chainCoreFuture(source, target, sync) {
|
|
var t2, t3, ignoreError, listeners, _box_0 = {},
|
|
t1 = _box_0.source = source;
|
|
for (t2 = type$._Future_dynamic; t3 = t1._state, (t3 & 4) !== 0; t1 = source) {
|
|
source = t2._as(t1._resultOrListeners);
|
|
_box_0.source = source;
|
|
}
|
|
if (t1 === target) {
|
|
t2 = A.StackTrace_current();
|
|
target._asyncCompleteErrorObject$1(new A.AsyncError(new A.ArgumentError(true, t1, null, "Cannot complete a future with itself"), t2));
|
|
return;
|
|
}
|
|
ignoreError = target._state & 1;
|
|
t2 = t1._state = t3 | ignoreError;
|
|
if ((t2 & 24) === 0) {
|
|
listeners = type$.nullable__FutureListener_dynamic_dynamic._as(target._resultOrListeners);
|
|
target._state = target._state & 1 | 4;
|
|
target._resultOrListeners = t1;
|
|
t1._prependListeners$1(listeners);
|
|
return;
|
|
}
|
|
if (!sync)
|
|
if (target._resultOrListeners == null)
|
|
t1 = (t2 & 16) === 0 || ignoreError !== 0;
|
|
else
|
|
t1 = false;
|
|
else
|
|
t1 = true;
|
|
if (t1) {
|
|
listeners = target._removeListeners$0();
|
|
target._cloneResult$1(_box_0.source);
|
|
A._Future__propagateToListeners(target, listeners);
|
|
return;
|
|
}
|
|
target._state ^= 2;
|
|
A._rootScheduleMicrotask(null, null, target._zone, type$.void_Function._as(new A._Future__chainCoreFuture_closure(_box_0, target)));
|
|
},
|
|
_Future__propagateToListeners(source, listeners) {
|
|
var t2, t3, _box_0, t4, t5, hasError, asyncError, nextListener, nextListener0, sourceResult, t6, zone, oldZone, result, current, _box_1 = {},
|
|
t1 = _box_1.source = source;
|
|
for (t2 = type$.AsyncError, t3 = type$.nullable__FutureListener_dynamic_dynamic; true;) {
|
|
_box_0 = {};
|
|
t4 = t1._state;
|
|
t5 = (t4 & 16) === 0;
|
|
hasError = !t5;
|
|
if (listeners == null) {
|
|
if (hasError && (t4 & 1) === 0) {
|
|
asyncError = t2._as(t1._resultOrListeners);
|
|
A._rootHandleError(asyncError.error, asyncError.stackTrace);
|
|
}
|
|
return;
|
|
}
|
|
_box_0.listener = listeners;
|
|
nextListener = listeners._nextListener;
|
|
for (t1 = listeners; nextListener != null; t1 = nextListener, nextListener = nextListener0) {
|
|
t1._nextListener = null;
|
|
A._Future__propagateToListeners(_box_1.source, t1);
|
|
_box_0.listener = nextListener;
|
|
nextListener0 = nextListener._nextListener;
|
|
}
|
|
t4 = _box_1.source;
|
|
sourceResult = t4._resultOrListeners;
|
|
_box_0.listenerHasError = hasError;
|
|
_box_0.listenerValueOrError = sourceResult;
|
|
if (t5) {
|
|
t6 = t1.state;
|
|
t6 = (t6 & 1) !== 0 || (t6 & 15) === 8;
|
|
} else
|
|
t6 = true;
|
|
if (t6) {
|
|
zone = t1.result._zone;
|
|
if (hasError) {
|
|
t4 = t4._zone === zone;
|
|
t4 = !(t4 || t4);
|
|
} else
|
|
t4 = false;
|
|
if (t4) {
|
|
t2._as(sourceResult);
|
|
A._rootHandleError(sourceResult.error, sourceResult.stackTrace);
|
|
return;
|
|
}
|
|
oldZone = $.Zone__current;
|
|
if (oldZone !== zone)
|
|
$.Zone__current = zone;
|
|
else
|
|
oldZone = null;
|
|
t1 = t1.state;
|
|
if ((t1 & 15) === 8)
|
|
new A._Future__propagateToListeners_handleWhenCompleteCallback(_box_0, _box_1, hasError).call$0();
|
|
else if (t5) {
|
|
if ((t1 & 1) !== 0)
|
|
new A._Future__propagateToListeners_handleValueCallback(_box_0, sourceResult).call$0();
|
|
} else if ((t1 & 2) !== 0)
|
|
new A._Future__propagateToListeners_handleError(_box_1, _box_0).call$0();
|
|
if (oldZone != null)
|
|
$.Zone__current = oldZone;
|
|
t1 = _box_0.listenerValueOrError;
|
|
if (t1 instanceof A._Future) {
|
|
t4 = _box_0.listener.$ti;
|
|
t4 = t4._eval$1("Future<2>")._is(t1) || !t4._rest[1]._is(t1);
|
|
} else
|
|
t4 = false;
|
|
if (t4) {
|
|
result = _box_0.listener.result;
|
|
if ((t1._state & 24) !== 0) {
|
|
current = t3._as(result._resultOrListeners);
|
|
result._resultOrListeners = null;
|
|
listeners = result._reverseListeners$1(current);
|
|
result._state = t1._state & 30 | result._state & 1;
|
|
result._resultOrListeners = t1._resultOrListeners;
|
|
_box_1.source = t1;
|
|
continue;
|
|
} else
|
|
A._Future__chainCoreFuture(t1, result, true);
|
|
return;
|
|
}
|
|
}
|
|
result = _box_0.listener.result;
|
|
current = t3._as(result._resultOrListeners);
|
|
result._resultOrListeners = null;
|
|
listeners = result._reverseListeners$1(current);
|
|
t1 = _box_0.listenerHasError;
|
|
t4 = _box_0.listenerValueOrError;
|
|
if (!t1) {
|
|
result.$ti._precomputed1._as(t4);
|
|
result._state = 8;
|
|
result._resultOrListeners = t4;
|
|
} else {
|
|
t2._as(t4);
|
|
result._state = result._state & 1 | 16;
|
|
result._resultOrListeners = t4;
|
|
}
|
|
_box_1.source = result;
|
|
t1 = result;
|
|
}
|
|
},
|
|
_registerErrorHandler(errorHandler, zone) {
|
|
var t1;
|
|
if (type$.dynamic_Function_Object_StackTrace._is(errorHandler))
|
|
return zone.registerBinaryCallback$3$1(errorHandler, type$.dynamic, type$.Object, type$.StackTrace);
|
|
t1 = type$.dynamic_Function_Object;
|
|
if (t1._is(errorHandler))
|
|
return t1._as(errorHandler);
|
|
throw A.wrapException(A.ArgumentError$value(errorHandler, "onError", string$.Error_));
|
|
},
|
|
_microtaskLoop() {
|
|
var entry, next;
|
|
for (entry = $._nextCallback; entry != null; entry = $._nextCallback) {
|
|
$._lastPriorityCallback = null;
|
|
next = entry.next;
|
|
$._nextCallback = next;
|
|
if (next == null)
|
|
$._lastCallback = null;
|
|
entry.callback.call$0();
|
|
}
|
|
},
|
|
_startMicrotaskLoop() {
|
|
$._isInCallbackLoop = true;
|
|
try {
|
|
A._microtaskLoop();
|
|
} finally {
|
|
$._lastPriorityCallback = null;
|
|
$._isInCallbackLoop = false;
|
|
if ($._nextCallback != null)
|
|
$.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure());
|
|
}
|
|
},
|
|
_scheduleAsyncCallback(callback) {
|
|
var newEntry = new A._AsyncCallbackEntry(callback),
|
|
lastCallback = $._lastCallback;
|
|
if (lastCallback == null) {
|
|
$._nextCallback = $._lastCallback = newEntry;
|
|
if (!$._isInCallbackLoop)
|
|
$.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure());
|
|
} else
|
|
$._lastCallback = lastCallback.next = newEntry;
|
|
},
|
|
_schedulePriorityAsyncCallback(callback) {
|
|
var entry, lastPriorityCallback, next,
|
|
t1 = $._nextCallback;
|
|
if (t1 == null) {
|
|
A._scheduleAsyncCallback(callback);
|
|
$._lastPriorityCallback = $._lastCallback;
|
|
return;
|
|
}
|
|
entry = new A._AsyncCallbackEntry(callback);
|
|
lastPriorityCallback = $._lastPriorityCallback;
|
|
if (lastPriorityCallback == null) {
|
|
entry.next = t1;
|
|
$._nextCallback = $._lastPriorityCallback = entry;
|
|
} else {
|
|
next = lastPriorityCallback.next;
|
|
entry.next = next;
|
|
$._lastPriorityCallback = lastPriorityCallback.next = entry;
|
|
if (next == null)
|
|
$._lastCallback = entry;
|
|
}
|
|
},
|
|
scheduleMicrotask(callback) {
|
|
var _null = null,
|
|
currentZone = $.Zone__current;
|
|
if (B.C__RootZone === currentZone) {
|
|
A._rootScheduleMicrotask(_null, _null, B.C__RootZone, callback);
|
|
return;
|
|
}
|
|
A._rootScheduleMicrotask(_null, _null, currentZone, type$.void_Function._as(currentZone.bindCallbackGuarded$1(callback)));
|
|
},
|
|
StreamIterator_StreamIterator(stream, $T) {
|
|
A.checkNotNullable(stream, "stream", type$.Object);
|
|
return new A._StreamIterator($T._eval$1("_StreamIterator<0>"));
|
|
},
|
|
StreamController_StreamController(sync, $T) {
|
|
var _null = null;
|
|
return new A._SyncStreamController(_null, _null, _null, _null, $T._eval$1("_SyncStreamController<0>"));
|
|
},
|
|
_runGuarded(notificationHandler) {
|
|
var e, s, exception;
|
|
if (notificationHandler == null)
|
|
return;
|
|
try {
|
|
notificationHandler.call$0();
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
A._rootHandleError(A._asObject(e), type$.StackTrace._as(s));
|
|
}
|
|
},
|
|
_BufferingStreamSubscription__registerDataHandler(zone, handleData, $T) {
|
|
var t1 = handleData == null ? A.async___nullDataHandler$closure() : handleData;
|
|
return type$.$env_1_1_void._bind$1($T)._eval$1("1(2)")._as(t1);
|
|
},
|
|
_BufferingStreamSubscription__registerErrorHandler(zone, handleError) {
|
|
if (handleError == null)
|
|
handleError = A.async___nullErrorHandler$closure();
|
|
if (type$.void_Function_Object_StackTrace._is(handleError))
|
|
return zone.registerBinaryCallback$3$1(handleError, type$.dynamic, type$.Object, type$.StackTrace);
|
|
if (type$.void_Function_Object._is(handleError))
|
|
return type$.dynamic_Function_Object._as(handleError);
|
|
throw A.wrapException(A.ArgumentError$(string$.handle, null));
|
|
},
|
|
_BufferingStreamSubscription__registerDoneHandler(zone, handleDone) {
|
|
var t1 = handleDone == null ? A.async___nullDoneHandler$closure() : handleDone;
|
|
return type$.void_Function._as(t1);
|
|
},
|
|
_nullDataHandler(value) {
|
|
},
|
|
_nullErrorHandler(error, stackTrace) {
|
|
A._rootHandleError(A._asObject(error), type$.StackTrace._as(stackTrace));
|
|
},
|
|
_nullDoneHandler() {
|
|
},
|
|
_DoneStreamSubscription$(onDone, $T) {
|
|
var t1 = new A._DoneStreamSubscription($.Zone__current, $T._eval$1("_DoneStreamSubscription<0>"));
|
|
A.scheduleMicrotask(t1.get$_onMicrotask());
|
|
if (onDone != null)
|
|
t1._onDone = type$.void_Function._as(onDone);
|
|
return t1;
|
|
},
|
|
_cancelAndError(subscription, future, error) {
|
|
var cancelFuture = subscription.cancel$0();
|
|
if (cancelFuture !== $.$get$Future__nullFuture())
|
|
cancelFuture.whenComplete$1(new A._cancelAndError_closure(future, error));
|
|
else
|
|
future._completeErrorObject$1(error);
|
|
},
|
|
_addErrorWithReplacement(sink, error, stackTrace) {
|
|
A._interceptError(error, stackTrace);
|
|
sink._addError$2(error, stackTrace);
|
|
},
|
|
Timer_Timer(duration, callback) {
|
|
var t1 = $.Zone__current;
|
|
if (t1 === B.C__RootZone)
|
|
return A.Timer__createTimer(duration, type$.void_Function._as(callback));
|
|
return A.Timer__createTimer(duration, type$.void_Function._as(t1.bindCallbackGuarded$1(callback)));
|
|
},
|
|
_rootHandleError(error, stackTrace) {
|
|
A._schedulePriorityAsyncCallback(new A._rootHandleError_closure(error, stackTrace));
|
|
},
|
|
_rootRun($self, $parent, zone, f, $R) {
|
|
var old,
|
|
t1 = $.Zone__current;
|
|
if (t1 === zone)
|
|
return f.call$0();
|
|
$.Zone__current = zone;
|
|
old = t1;
|
|
try {
|
|
t1 = f.call$0();
|
|
return t1;
|
|
} finally {
|
|
$.Zone__current = old;
|
|
}
|
|
},
|
|
_rootRunUnary($self, $parent, zone, f, arg, $R, $T) {
|
|
var old,
|
|
t1 = $.Zone__current;
|
|
if (t1 === zone)
|
|
return f.call$1(arg);
|
|
$.Zone__current = zone;
|
|
old = t1;
|
|
try {
|
|
t1 = f.call$1(arg);
|
|
return t1;
|
|
} finally {
|
|
$.Zone__current = old;
|
|
}
|
|
},
|
|
_rootRunBinary($self, $parent, zone, f, arg1, arg2, $R, $T1, $T2) {
|
|
var old,
|
|
t1 = $.Zone__current;
|
|
if (t1 === zone)
|
|
return f.call$2(arg1, arg2);
|
|
$.Zone__current = zone;
|
|
old = t1;
|
|
try {
|
|
t1 = f.call$2(arg1, arg2);
|
|
return t1;
|
|
} finally {
|
|
$.Zone__current = old;
|
|
}
|
|
},
|
|
_rootScheduleMicrotask($self, $parent, zone, f) {
|
|
type$.void_Function._as(f);
|
|
if (B.C__RootZone !== zone) {
|
|
f = zone.bindCallbackGuarded$1(f);
|
|
f = f;
|
|
}
|
|
A._scheduleAsyncCallback(f);
|
|
},
|
|
_AsyncRun__initializeScheduleImmediate_internalCallback: function _AsyncRun__initializeScheduleImmediate_internalCallback(t0) {
|
|
this._box_0 = t0;
|
|
},
|
|
_AsyncRun__initializeScheduleImmediate_closure: function _AsyncRun__initializeScheduleImmediate_closure(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.div = t1;
|
|
this.span = t2;
|
|
},
|
|
_AsyncRun__scheduleImmediateJsOverride_internalCallback: function _AsyncRun__scheduleImmediateJsOverride_internalCallback(t0) {
|
|
this.callback = t0;
|
|
},
|
|
_AsyncRun__scheduleImmediateWithSetImmediate_internalCallback: function _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(t0) {
|
|
this.callback = t0;
|
|
},
|
|
_TimerImpl: function _TimerImpl() {
|
|
this._handle = null;
|
|
},
|
|
_TimerImpl_internalCallback: function _TimerImpl_internalCallback(t0, t1) {
|
|
this.$this = t0;
|
|
this.callback = t1;
|
|
},
|
|
_AsyncAwaitCompleter: function _AsyncAwaitCompleter(t0, t1) {
|
|
this._future = t0;
|
|
this.isSync = false;
|
|
this.$ti = t1;
|
|
},
|
|
_awaitOnObject_closure: function _awaitOnObject_closure(t0) {
|
|
this.bodyFunction = t0;
|
|
},
|
|
_awaitOnObject_closure0: function _awaitOnObject_closure0(t0) {
|
|
this.bodyFunction = t0;
|
|
},
|
|
_wrapJsFunctionForAsync_closure: function _wrapJsFunctionForAsync_closure(t0) {
|
|
this.$protected = t0;
|
|
},
|
|
AsyncError: function AsyncError(t0, t1) {
|
|
this.error = t0;
|
|
this.stackTrace = t1;
|
|
},
|
|
Future_wait_handleError: function Future_wait_handleError(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.cleanUp = t1;
|
|
_.eagerError = t2;
|
|
_._future = t3;
|
|
},
|
|
Future_wait_closure: function Future_wait_closure(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.pos = t1;
|
|
_._future = t2;
|
|
_.T = t3;
|
|
_.cleanUp = t4;
|
|
_.eagerError = t5;
|
|
},
|
|
TimeoutException: function TimeoutException(t0, t1) {
|
|
this.message = t0;
|
|
this.duration = t1;
|
|
},
|
|
_Completer: function _Completer() {
|
|
},
|
|
_AsyncCompleter: function _AsyncCompleter(t0, t1) {
|
|
this.future = t0;
|
|
this.$ti = t1;
|
|
},
|
|
_FutureListener: function _FutureListener(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._nextListener = null;
|
|
_.result = t0;
|
|
_.state = t1;
|
|
_.callback = t2;
|
|
_.errorCallback = t3;
|
|
_.$ti = t4;
|
|
},
|
|
_Future: function _Future(t0, t1) {
|
|
var _ = this;
|
|
_._state = 0;
|
|
_._zone = t0;
|
|
_._resultOrListeners = null;
|
|
_.$ti = t1;
|
|
},
|
|
_Future__addListener_closure: function _Future__addListener_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.listener = t1;
|
|
},
|
|
_Future__prependListeners_closure: function _Future__prependListeners_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.$this = t1;
|
|
},
|
|
_Future__chainCoreFuture_closure: function _Future__chainCoreFuture_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.target = t1;
|
|
},
|
|
_Future__asyncCompleteWithValue_closure: function _Future__asyncCompleteWithValue_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.value = t1;
|
|
},
|
|
_Future__asyncCompleteErrorObject_closure: function _Future__asyncCompleteErrorObject_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.error = t1;
|
|
},
|
|
_Future__propagateToListeners_handleWhenCompleteCallback: function _Future__propagateToListeners_handleWhenCompleteCallback(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this._box_1 = t1;
|
|
this.hasError = t2;
|
|
},
|
|
_Future__propagateToListeners_handleWhenCompleteCallback_closure: function _Future__propagateToListeners_handleWhenCompleteCallback_closure(t0, t1) {
|
|
this.joinedResult = t0;
|
|
this.originalSource = t1;
|
|
},
|
|
_Future__propagateToListeners_handleWhenCompleteCallback_closure0: function _Future__propagateToListeners_handleWhenCompleteCallback_closure0(t0) {
|
|
this.joinedResult = t0;
|
|
},
|
|
_Future__propagateToListeners_handleValueCallback: function _Future__propagateToListeners_handleValueCallback(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.sourceResult = t1;
|
|
},
|
|
_Future__propagateToListeners_handleError: function _Future__propagateToListeners_handleError(t0, t1) {
|
|
this._box_1 = t0;
|
|
this._box_0 = t1;
|
|
},
|
|
_Future_timeout_closure: function _Future_timeout_closure(t0, t1) {
|
|
this._future = t0;
|
|
this.timeLimit = t1;
|
|
},
|
|
_Future_timeout_closure0: function _Future_timeout_closure0(t0, t1, t2) {
|
|
this._box_0 = t0;
|
|
this.$this = t1;
|
|
this._future = t2;
|
|
},
|
|
_Future_timeout_closure1: function _Future_timeout_closure1(t0, t1) {
|
|
this._box_0 = t0;
|
|
this._future = t1;
|
|
},
|
|
_AsyncCallbackEntry: function _AsyncCallbackEntry(t0) {
|
|
this.callback = t0;
|
|
this.next = null;
|
|
},
|
|
Stream: function Stream() {
|
|
},
|
|
Stream_handleError_closure: function Stream_handleError_closure(t0) {
|
|
this.onError = t0;
|
|
},
|
|
Stream_join_closure: function Stream_join_closure(t0, t1) {
|
|
this.result = t0;
|
|
this.buffer = t1;
|
|
},
|
|
Stream_join_closure0: function Stream_join_closure0(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_.$this = t0;
|
|
_.buffer = t1;
|
|
_.subscription = t2;
|
|
_.result = t3;
|
|
},
|
|
Stream_length_closure: function Stream_length_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.$this = t1;
|
|
},
|
|
Stream_length_closure0: function Stream_length_closure0(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.future = t1;
|
|
},
|
|
StreamTransformerBase: function StreamTransformerBase() {
|
|
},
|
|
_StreamController: function _StreamController() {
|
|
},
|
|
_StreamController__subscribe_closure: function _StreamController__subscribe_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_StreamController__recordCancel_complete: function _StreamController__recordCancel_complete(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_SyncStreamControllerDispatch: function _SyncStreamControllerDispatch() {
|
|
},
|
|
_SyncStreamController: function _SyncStreamController(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._varData = null;
|
|
_._state = 0;
|
|
_._doneFuture = null;
|
|
_.onListen = t0;
|
|
_.onPause = t1;
|
|
_.onResume = t2;
|
|
_.onCancel = t3;
|
|
_.$ti = t4;
|
|
},
|
|
_ControllerStream: function _ControllerStream(t0, t1) {
|
|
this._async$_controller = t0;
|
|
this.$ti = t1;
|
|
},
|
|
_ControllerSubscription: function _ControllerSubscription(t0, t1, t2, t3, t4, t5, t6) {
|
|
var _ = this;
|
|
_._async$_controller = t0;
|
|
_._onData = t1;
|
|
_._onError = t2;
|
|
_._onDone = t3;
|
|
_._zone = t4;
|
|
_._state = t5;
|
|
_._pending = _._cancelFuture = null;
|
|
_.$ti = t6;
|
|
},
|
|
_AddStreamState_cancel_closure: function _AddStreamState_cancel_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_BufferingStreamSubscription: function _BufferingStreamSubscription() {
|
|
},
|
|
_BufferingStreamSubscription_asFuture_closure: function _BufferingStreamSubscription_asFuture_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.result = t1;
|
|
},
|
|
_BufferingStreamSubscription_asFuture_closure0: function _BufferingStreamSubscription_asFuture_closure0(t0, t1) {
|
|
this.$this = t0;
|
|
this.result = t1;
|
|
},
|
|
_BufferingStreamSubscription_asFuture__closure: function _BufferingStreamSubscription_asFuture__closure(t0, t1, t2) {
|
|
this.result = t0;
|
|
this.error = t1;
|
|
this.stackTrace = t2;
|
|
},
|
|
_BufferingStreamSubscription__sendError_sendError: function _BufferingStreamSubscription__sendError_sendError(t0, t1, t2) {
|
|
this.$this = t0;
|
|
this.error = t1;
|
|
this.stackTrace = t2;
|
|
},
|
|
_BufferingStreamSubscription__sendDone_sendDone: function _BufferingStreamSubscription__sendDone_sendDone(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_StreamImpl: function _StreamImpl() {
|
|
},
|
|
_DelayedEvent: function _DelayedEvent() {
|
|
},
|
|
_DelayedData: function _DelayedData(t0, t1) {
|
|
this.value = t0;
|
|
this.next = null;
|
|
this.$ti = t1;
|
|
},
|
|
_DelayedError: function _DelayedError(t0, t1) {
|
|
this.error = t0;
|
|
this.stackTrace = t1;
|
|
this.next = null;
|
|
},
|
|
_DelayedDone: function _DelayedDone() {
|
|
},
|
|
_PendingEvents: function _PendingEvents(t0) {
|
|
var _ = this;
|
|
_._state = 0;
|
|
_.lastPendingEvent = _.firstPendingEvent = null;
|
|
_.$ti = t0;
|
|
},
|
|
_PendingEvents_schedule_closure: function _PendingEvents_schedule_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.dispatch = t1;
|
|
},
|
|
_DoneStreamSubscription: function _DoneStreamSubscription(t0, t1) {
|
|
var _ = this;
|
|
_._state = 1;
|
|
_._zone = t0;
|
|
_._onDone = null;
|
|
_.$ti = t1;
|
|
},
|
|
_DoneStreamSubscription_asFuture_closure: function _DoneStreamSubscription_asFuture_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.result = t1;
|
|
},
|
|
_StreamIterator: function _StreamIterator(t0) {
|
|
this.$ti = t0;
|
|
},
|
|
_EmptyStream: function _EmptyStream(t0) {
|
|
this.$ti = t0;
|
|
},
|
|
_cancelAndError_closure: function _cancelAndError_closure(t0, t1) {
|
|
this.future = t0;
|
|
this.error = t1;
|
|
},
|
|
_ForwardingStream: function _ForwardingStream() {
|
|
},
|
|
_ForwardingStreamSubscription: function _ForwardingStreamSubscription(t0, t1, t2, t3, t4, t5, t6) {
|
|
var _ = this;
|
|
_._stream = t0;
|
|
_._subscription = null;
|
|
_._onData = t1;
|
|
_._onError = t2;
|
|
_._onDone = t3;
|
|
_._zone = t4;
|
|
_._state = t5;
|
|
_._pending = _._cancelFuture = null;
|
|
_.$ti = t6;
|
|
},
|
|
_MapStream: function _MapStream(t0, t1, t2) {
|
|
this._transform = t0;
|
|
this._async$_source = t1;
|
|
this.$ti = t2;
|
|
},
|
|
_HandleErrorStream: function _HandleErrorStream(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._onError = t0;
|
|
_._test = t1;
|
|
_._async$_source = t2;
|
|
_.$ti = t3;
|
|
},
|
|
_EventSinkWrapper: function _EventSinkWrapper(t0, t1) {
|
|
this._sink = t0;
|
|
this.$ti = t1;
|
|
},
|
|
_SinkTransformerStreamSubscription: function _SinkTransformerStreamSubscription(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_.___SinkTransformerStreamSubscription__transformerSink_A = $;
|
|
_._subscription = null;
|
|
_._onData = t0;
|
|
_._onError = t1;
|
|
_._onDone = t2;
|
|
_._zone = t3;
|
|
_._state = t4;
|
|
_._pending = _._cancelFuture = null;
|
|
_.$ti = t5;
|
|
},
|
|
_BoundSinkStream: function _BoundSinkStream(t0, t1, t2) {
|
|
this._sinkMapper = t0;
|
|
this._stream = t1;
|
|
this.$ti = t2;
|
|
},
|
|
_Zone: function _Zone() {
|
|
},
|
|
_rootHandleError_closure: function _rootHandleError_closure(t0, t1) {
|
|
this.error = t0;
|
|
this.stackTrace = t1;
|
|
},
|
|
_RootZone: function _RootZone() {
|
|
},
|
|
_RootZone_bindCallbackGuarded_closure: function _RootZone_bindCallbackGuarded_closure(t0, t1) {
|
|
this.$this = t0;
|
|
this.f = t1;
|
|
},
|
|
HashMap_HashMap($K, $V) {
|
|
return new A._HashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("_HashMap<1,2>"));
|
|
},
|
|
_HashMap__getTableEntry(table, key) {
|
|
var entry = table[key];
|
|
return entry === table ? null : entry;
|
|
},
|
|
_HashMap__setTableEntry(table, key, value) {
|
|
if (value == null)
|
|
table[key] = table;
|
|
else
|
|
table[key] = value;
|
|
},
|
|
_HashMap__newHashTable() {
|
|
var table = Object.create(null);
|
|
A._HashMap__setTableEntry(table, "<non-identifier-key>", table);
|
|
delete table["<non-identifier-key>"];
|
|
return table;
|
|
},
|
|
LinkedHashMap_LinkedHashMap$_literal(keyValuePairs, $K, $V) {
|
|
return $K._eval$1("@<0>")._bind$1($V)._eval$1("LinkedHashMap<1,2>")._as(A.fillLiteralMap(keyValuePairs, new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>"))));
|
|
},
|
|
LinkedHashMap_LinkedHashMap$_empty($K, $V) {
|
|
return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>"));
|
|
},
|
|
HashSet_HashSet($E) {
|
|
return new A._HashSet($E._eval$1("_HashSet<0>"));
|
|
},
|
|
_HashSet__newHashTable() {
|
|
var table = Object.create(null);
|
|
table["<non-identifier-key>"] = table;
|
|
delete table["<non-identifier-key>"];
|
|
return table;
|
|
},
|
|
HashMap_HashMap$from(other, $K, $V) {
|
|
var result = A.HashMap_HashMap($K, $V);
|
|
other.forEach$1(0, new A.HashMap_HashMap$from_closure(result, $K, $V));
|
|
return result;
|
|
},
|
|
IterableExtensions_get_singleOrNull(_this, $T) {
|
|
var result,
|
|
t1 = J.get$iterator$ax(_this.__internal$_iterable),
|
|
iterator = new A.WhereIterator(t1, _this._f, _this.$ti._eval$1("WhereIterator<1>"));
|
|
if (iterator.moveNext$0()) {
|
|
result = t1.get$current();
|
|
if (!iterator.moveNext$0())
|
|
return result;
|
|
}
|
|
return null;
|
|
},
|
|
MapBase_mapToString(m) {
|
|
var result, t1;
|
|
if (A.isToStringVisiting(m))
|
|
return "{...}";
|
|
result = new A.StringBuffer("");
|
|
try {
|
|
t1 = {};
|
|
B.JSArray_methods.add$1($.toStringVisiting, m);
|
|
result._contents += "{";
|
|
t1.first = true;
|
|
m.forEach$1(0, new A.MapBase_mapToString_closure(t1, result));
|
|
result._contents += "}";
|
|
} finally {
|
|
if (0 >= $.toStringVisiting.length)
|
|
return A.ioore($.toStringVisiting, -1);
|
|
$.toStringVisiting.pop();
|
|
}
|
|
t1 = result._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
ListQueue__calculateCapacity(initialCapacity) {
|
|
return 8;
|
|
},
|
|
_HashMap: function _HashMap(t0) {
|
|
var _ = this;
|
|
_._collection$_length = 0;
|
|
_._keys = _._collection$_rest = _._collection$_nums = _._collection$_strings = null;
|
|
_.$ti = t0;
|
|
},
|
|
_HashMapKeyIterable: function _HashMapKeyIterable(t0, t1) {
|
|
this._collection$_map = t0;
|
|
this.$ti = t1;
|
|
},
|
|
_HashMapKeyIterator: function _HashMapKeyIterator(t0, t1, t2) {
|
|
var _ = this;
|
|
_._collection$_map = t0;
|
|
_._keys = t1;
|
|
_._offset = 0;
|
|
_._collection$_current = null;
|
|
_.$ti = t2;
|
|
},
|
|
_HashSet: function _HashSet(t0) {
|
|
var _ = this;
|
|
_._collection$_length = 0;
|
|
_._elements = _._collection$_rest = _._collection$_nums = _._collection$_strings = null;
|
|
_.$ti = t0;
|
|
},
|
|
_HashSetIterator: function _HashSetIterator(t0, t1, t2) {
|
|
var _ = this;
|
|
_._set = t0;
|
|
_._elements = t1;
|
|
_._offset = 0;
|
|
_._collection$_current = null;
|
|
_.$ti = t2;
|
|
},
|
|
HashMap_HashMap$from_closure: function HashMap_HashMap$from_closure(t0, t1, t2) {
|
|
this.result = t0;
|
|
this.K = t1;
|
|
this.V = t2;
|
|
},
|
|
ListBase: function ListBase() {
|
|
},
|
|
MapBase: function MapBase() {
|
|
},
|
|
MapBase_mapToString_closure: function MapBase_mapToString_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.result = t1;
|
|
},
|
|
_UnmodifiableMapMixin: function _UnmodifiableMapMixin() {
|
|
},
|
|
MapView: function MapView() {
|
|
},
|
|
UnmodifiableMapView: function UnmodifiableMapView(t0, t1) {
|
|
this._collection$_map = t0;
|
|
this.$ti = t1;
|
|
},
|
|
ListQueue: function ListQueue(t0, t1) {
|
|
var _ = this;
|
|
_._table = t0;
|
|
_._modificationCount = _._tail = _._head = 0;
|
|
_.$ti = t1;
|
|
},
|
|
_ListQueueIterator: function _ListQueueIterator(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_._queue = t0;
|
|
_._end = t1;
|
|
_._modificationCount = t2;
|
|
_._position = t3;
|
|
_._collection$_current = null;
|
|
_.$ti = t4;
|
|
},
|
|
SetBase: function SetBase() {
|
|
},
|
|
_SetBase: function _SetBase() {
|
|
},
|
|
_UnmodifiableMapView_MapView__UnmodifiableMapMixin: function _UnmodifiableMapView_MapView__UnmodifiableMapMixin() {
|
|
},
|
|
_parseJson(source, reviver) {
|
|
var e, exception, t1, parsed = null;
|
|
try {
|
|
parsed = JSON.parse(source);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
t1 = A.FormatException$(String(e), null, null);
|
|
throw A.wrapException(t1);
|
|
}
|
|
t1 = A._convertJsonToDartLazy(parsed);
|
|
return t1;
|
|
},
|
|
_convertJsonToDartLazy(object) {
|
|
var i;
|
|
if (object == null)
|
|
return null;
|
|
if (typeof object != "object")
|
|
return object;
|
|
if (!Array.isArray(object))
|
|
return new A._JsonMap(object, Object.create(null));
|
|
for (i = 0; i < object.length; ++i)
|
|
object[i] = A._convertJsonToDartLazy(object[i]);
|
|
return object;
|
|
},
|
|
_Utf8Decoder__makeNativeUint8List(codeUnits, start, end) {
|
|
var bytes, t1, i, b,
|
|
$length = end - start;
|
|
if ($length <= 4096)
|
|
bytes = $.$get$_Utf8Decoder__reusableBuffer();
|
|
else
|
|
bytes = new Uint8Array($length);
|
|
for (t1 = J.getInterceptor$asx(codeUnits), i = 0; i < $length; ++i) {
|
|
b = t1.$index(codeUnits, start + i);
|
|
if ((b & 255) !== b)
|
|
b = 255;
|
|
bytes[i] = b;
|
|
}
|
|
return bytes;
|
|
},
|
|
_Utf8Decoder__convertInterceptedUint8List(allowMalformed, codeUnits, start, end) {
|
|
var decoder = allowMalformed ? $.$get$_Utf8Decoder__decoderNonfatal() : $.$get$_Utf8Decoder__decoder();
|
|
if (decoder == null)
|
|
return null;
|
|
if (0 === start && end === codeUnits.length)
|
|
return A._Utf8Decoder__useTextDecoder(decoder, codeUnits);
|
|
return A._Utf8Decoder__useTextDecoder(decoder, codeUnits.subarray(start, end));
|
|
},
|
|
_Utf8Decoder__useTextDecoder(decoder, codeUnits) {
|
|
var t1, exception;
|
|
try {
|
|
t1 = decoder.decode(codeUnits);
|
|
return t1;
|
|
} catch (exception) {
|
|
}
|
|
return null;
|
|
},
|
|
Base64Codec__checkPadding(source, sourceIndex, sourceEnd, firstPadding, paddingCount, $length) {
|
|
if (B.JSInt_methods.$mod($length, 4) !== 0)
|
|
throw A.wrapException(A.FormatException$("Invalid base64 padding, padded length must be multiple of four, is " + $length, source, sourceEnd));
|
|
if (firstPadding + paddingCount !== $length)
|
|
throw A.wrapException(A.FormatException$("Invalid base64 padding, '=' not at the end", source, sourceIndex));
|
|
if (paddingCount > 2)
|
|
throw A.wrapException(A.FormatException$("Invalid base64 padding, more than two '=' characters", source, sourceIndex));
|
|
},
|
|
_Base64Encoder_encodeChunk(alphabet, bytes, start, end, isLast, output, outputIndex, state) {
|
|
var t1, t2, t3, i, byteOr, byte, outputIndex0, t4, t5, outputIndex1,
|
|
bits = state >>> 2,
|
|
expectedChars = 3 - (state & 3);
|
|
for (t1 = J.getInterceptor$asx(bytes), t2 = alphabet.length, t3 = output.$flags | 0, i = start, byteOr = 0; i < end; ++i) {
|
|
byte = t1.$index(bytes, i);
|
|
byteOr = (byteOr | byte) >>> 0;
|
|
bits = (bits << 8 | byte) & 16777215;
|
|
--expectedChars;
|
|
if (expectedChars === 0) {
|
|
outputIndex0 = outputIndex + 1;
|
|
t4 = bits >>> 18 & 63;
|
|
if (!(t4 < t2))
|
|
return A.ioore(alphabet, t4);
|
|
t3 & 2 && A.throwUnsupportedOperation(output);
|
|
t5 = output.length;
|
|
if (!(outputIndex < t5))
|
|
return A.ioore(output, outputIndex);
|
|
output[outputIndex] = alphabet.charCodeAt(t4);
|
|
outputIndex = outputIndex0 + 1;
|
|
t4 = bits >>> 12 & 63;
|
|
if (!(t4 < t2))
|
|
return A.ioore(alphabet, t4);
|
|
if (!(outputIndex0 < t5))
|
|
return A.ioore(output, outputIndex0);
|
|
output[outputIndex0] = alphabet.charCodeAt(t4);
|
|
outputIndex0 = outputIndex + 1;
|
|
t4 = bits >>> 6 & 63;
|
|
if (!(t4 < t2))
|
|
return A.ioore(alphabet, t4);
|
|
if (!(outputIndex < t5))
|
|
return A.ioore(output, outputIndex);
|
|
output[outputIndex] = alphabet.charCodeAt(t4);
|
|
outputIndex = outputIndex0 + 1;
|
|
t4 = bits & 63;
|
|
if (!(t4 < t2))
|
|
return A.ioore(alphabet, t4);
|
|
if (!(outputIndex0 < t5))
|
|
return A.ioore(output, outputIndex0);
|
|
output[outputIndex0] = alphabet.charCodeAt(t4);
|
|
bits = 0;
|
|
expectedChars = 3;
|
|
}
|
|
}
|
|
if (byteOr >= 0 && byteOr <= 255) {
|
|
if (isLast && expectedChars < 3) {
|
|
outputIndex0 = outputIndex + 1;
|
|
outputIndex1 = outputIndex0 + 1;
|
|
if (3 - expectedChars === 1) {
|
|
t1 = bits >>> 2 & 63;
|
|
if (!(t1 < t2))
|
|
return A.ioore(alphabet, t1);
|
|
t3 & 2 && A.throwUnsupportedOperation(output);
|
|
t3 = output.length;
|
|
if (!(outputIndex < t3))
|
|
return A.ioore(output, outputIndex);
|
|
output[outputIndex] = alphabet.charCodeAt(t1);
|
|
t1 = bits << 4 & 63;
|
|
if (!(t1 < t2))
|
|
return A.ioore(alphabet, t1);
|
|
if (!(outputIndex0 < t3))
|
|
return A.ioore(output, outputIndex0);
|
|
output[outputIndex0] = alphabet.charCodeAt(t1);
|
|
outputIndex = outputIndex1 + 1;
|
|
if (!(outputIndex1 < t3))
|
|
return A.ioore(output, outputIndex1);
|
|
output[outputIndex1] = 61;
|
|
if (!(outputIndex < t3))
|
|
return A.ioore(output, outputIndex);
|
|
output[outputIndex] = 61;
|
|
} else {
|
|
t1 = bits >>> 10 & 63;
|
|
if (!(t1 < t2))
|
|
return A.ioore(alphabet, t1);
|
|
t3 & 2 && A.throwUnsupportedOperation(output);
|
|
t3 = output.length;
|
|
if (!(outputIndex < t3))
|
|
return A.ioore(output, outputIndex);
|
|
output[outputIndex] = alphabet.charCodeAt(t1);
|
|
t1 = bits >>> 4 & 63;
|
|
if (!(t1 < t2))
|
|
return A.ioore(alphabet, t1);
|
|
if (!(outputIndex0 < t3))
|
|
return A.ioore(output, outputIndex0);
|
|
output[outputIndex0] = alphabet.charCodeAt(t1);
|
|
outputIndex = outputIndex1 + 1;
|
|
t1 = bits << 2 & 63;
|
|
if (!(t1 < t2))
|
|
return A.ioore(alphabet, t1);
|
|
if (!(outputIndex1 < t3))
|
|
return A.ioore(output, outputIndex1);
|
|
output[outputIndex1] = alphabet.charCodeAt(t1);
|
|
if (!(outputIndex < t3))
|
|
return A.ioore(output, outputIndex);
|
|
output[outputIndex] = 61;
|
|
}
|
|
return 0;
|
|
}
|
|
return (bits << 2 | 3 - expectedChars) >>> 0;
|
|
}
|
|
for (i = start; i < end;) {
|
|
byte = t1.$index(bytes, i);
|
|
if (byte < 0 || byte > 255)
|
|
break;
|
|
++i;
|
|
}
|
|
throw A.wrapException(A.ArgumentError$value(bytes, "Not a byte value at index " + i + ": 0x" + B.JSInt_methods.toRadixString$1(t1.$index(bytes, i), 16), null));
|
|
},
|
|
Encoding_getByName($name) {
|
|
return $.$get$Encoding__nameToEncoding().$index(0, $name.toLowerCase());
|
|
},
|
|
JsonUnsupportedObjectError$(unsupportedObject, cause, partialResult) {
|
|
return new A.JsonUnsupportedObjectError(unsupportedObject, cause);
|
|
},
|
|
_defaultToEncodable(object) {
|
|
return object.toJson$0();
|
|
},
|
|
_JsonStringStringifier$(_sink, _toEncodable) {
|
|
return new A._JsonStringStringifier(_sink, [], A.convert___defaultToEncodable$closure());
|
|
},
|
|
_JsonStringStringifier_stringify(object, toEncodable, indent) {
|
|
var t1,
|
|
output = new A.StringBuffer("");
|
|
A._JsonStringStringifier_printOn(object, output, toEncodable, indent);
|
|
t1 = output._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
_JsonStringStringifier_printOn(object, output, toEncodable, indent) {
|
|
var stringifier = A._JsonStringStringifier$(output, toEncodable);
|
|
stringifier.writeObject$1(object);
|
|
},
|
|
_Utf8Decoder_errorDescription(state) {
|
|
switch (state) {
|
|
case 65:
|
|
return "Missing extension byte";
|
|
case 67:
|
|
return "Unexpected extension byte";
|
|
case 69:
|
|
return "Invalid UTF-8 byte";
|
|
case 71:
|
|
return "Overlong encoding";
|
|
case 73:
|
|
return "Out of unicode range";
|
|
case 75:
|
|
return "Encoded surrogate";
|
|
case 77:
|
|
return "Unfinished UTF-8 octet sequence";
|
|
default:
|
|
return "";
|
|
}
|
|
},
|
|
_JsonMap: function _JsonMap(t0, t1) {
|
|
this._original = t0;
|
|
this._processed = t1;
|
|
this._data = null;
|
|
},
|
|
_JsonMapKeyIterable: function _JsonMapKeyIterable(t0) {
|
|
this._parent = t0;
|
|
},
|
|
_JsonDecoderSink: function _JsonDecoderSink(t0, t1, t2) {
|
|
this._reviver = t0;
|
|
this._convert$_sink = t1;
|
|
this._stringSink = t2;
|
|
},
|
|
_Utf8Decoder__decoder_closure: function _Utf8Decoder__decoder_closure() {
|
|
},
|
|
_Utf8Decoder__decoderNonfatal_closure: function _Utf8Decoder__decoderNonfatal_closure() {
|
|
},
|
|
AsciiCodec: function AsciiCodec() {
|
|
},
|
|
_UnicodeSubsetEncoder: function _UnicodeSubsetEncoder() {
|
|
},
|
|
AsciiEncoder: function AsciiEncoder(t0) {
|
|
this._subsetMask = t0;
|
|
},
|
|
_UnicodeSubsetEncoderSink: function _UnicodeSubsetEncoderSink(t0, t1) {
|
|
this._convert$_sink = t0;
|
|
this._subsetMask = t1;
|
|
},
|
|
Base64Codec: function Base64Codec() {
|
|
},
|
|
Base64Encoder: function Base64Encoder() {
|
|
},
|
|
_Base64Encoder: function _Base64Encoder(t0) {
|
|
this._convert$_state = 0;
|
|
this._alphabet = t0;
|
|
},
|
|
_BufferCachingBase64Encoder: function _BufferCachingBase64Encoder(t0) {
|
|
this.bufferCache = null;
|
|
this._convert$_state = 0;
|
|
this._alphabet = t0;
|
|
},
|
|
_Base64EncoderSink: function _Base64EncoderSink() {
|
|
},
|
|
_AsciiBase64EncoderSink: function _AsciiBase64EncoderSink(t0, t1) {
|
|
this._convert$_sink = t0;
|
|
this._encoder = t1;
|
|
},
|
|
ByteConversionSink: function ByteConversionSink() {
|
|
},
|
|
_ByteAdapterSink: function _ByteAdapterSink(t0) {
|
|
this._convert$_sink = t0;
|
|
},
|
|
ChunkedConversionSink: function ChunkedConversionSink() {
|
|
},
|
|
_ConverterStreamEventSink: function _ConverterStreamEventSink(t0, t1, t2) {
|
|
this._eventSink = t0;
|
|
this._chunkedSink = t1;
|
|
this.$ti = t2;
|
|
},
|
|
Codec: function Codec() {
|
|
},
|
|
Converter: function Converter() {
|
|
},
|
|
Converter_bind_closure: function Converter_bind_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
Encoding: function Encoding() {
|
|
},
|
|
JsonUnsupportedObjectError: function JsonUnsupportedObjectError(t0, t1) {
|
|
this.unsupportedObject = t0;
|
|
this.cause = t1;
|
|
},
|
|
JsonCyclicError: function JsonCyclicError(t0, t1) {
|
|
this.unsupportedObject = t0;
|
|
this.cause = t1;
|
|
},
|
|
JsonCodec: function JsonCodec() {
|
|
},
|
|
JsonEncoder: function JsonEncoder(t0) {
|
|
this._toEncodable = t0;
|
|
},
|
|
_JsonEncoderSink: function _JsonEncoderSink(t0, t1, t2) {
|
|
var _ = this;
|
|
_._indent = t0;
|
|
_._toEncodable = t1;
|
|
_._convert$_sink = t2;
|
|
_._isDone = false;
|
|
},
|
|
JsonDecoder: function JsonDecoder(t0) {
|
|
this._reviver = t0;
|
|
},
|
|
_JsonStringifier: function _JsonStringifier() {
|
|
},
|
|
_JsonStringifier_writeMap_closure: function _JsonStringifier_writeMap_closure(t0, t1) {
|
|
this._box_0 = t0;
|
|
this.keyValueList = t1;
|
|
},
|
|
_JsonStringStringifier: function _JsonStringStringifier(t0, t1, t2) {
|
|
this._convert$_sink = t0;
|
|
this._seen = t1;
|
|
this._toEncodable = t2;
|
|
},
|
|
Latin1Codec: function Latin1Codec() {
|
|
},
|
|
Latin1Encoder: function Latin1Encoder(t0) {
|
|
this._subsetMask = t0;
|
|
},
|
|
LineSplitter: function LineSplitter() {
|
|
},
|
|
StringConversionSink: function StringConversionSink() {
|
|
},
|
|
_StringConversionSinkAsStringSinkAdapter: function _StringConversionSinkAsStringSinkAdapter(t0, t1) {
|
|
this._buffer = t0;
|
|
this._chunkedSink = t1;
|
|
},
|
|
_StringSinkConversionSink: function _StringSinkConversionSink() {
|
|
},
|
|
_StringAdapterSink: function _StringAdapterSink(t0) {
|
|
this._convert$_sink = t0;
|
|
},
|
|
_Utf8ConversionSink: function _Utf8ConversionSink(t0, t1, t2) {
|
|
this._decoder = t0;
|
|
this._chunkedSink = t1;
|
|
this._buffer = t2;
|
|
},
|
|
Utf8Codec: function Utf8Codec() {
|
|
},
|
|
Utf8Encoder: function Utf8Encoder() {
|
|
},
|
|
_Utf8Encoder: function _Utf8Encoder(t0) {
|
|
this._bufferIndex = this._carry = 0;
|
|
this._buffer = t0;
|
|
},
|
|
_Utf8EncoderSink: function _Utf8EncoderSink(t0, t1) {
|
|
var _ = this;
|
|
_._convert$_sink = t0;
|
|
_._bufferIndex = _._carry = 0;
|
|
_._buffer = t1;
|
|
},
|
|
Utf8Decoder: function Utf8Decoder(t0) {
|
|
this._allowMalformed = t0;
|
|
},
|
|
_Utf8Decoder: function _Utf8Decoder(t0) {
|
|
this.allowMalformed = t0;
|
|
this._convert$_state = 16;
|
|
this._charOrIndex = 0;
|
|
},
|
|
__Utf8EncoderSink__Utf8Encoder_StringConversionSink: function __Utf8EncoderSink__Utf8Encoder_StringConversionSink() {
|
|
},
|
|
int_parse(source, radix) {
|
|
var value = A.Primitives_parseInt(source, radix);
|
|
if (value != null)
|
|
return value;
|
|
throw A.wrapException(A.FormatException$(source, null, null));
|
|
},
|
|
Error__throw(error, stackTrace) {
|
|
error = A.initializeExceptionWrapper(error, new Error());
|
|
if (error == null)
|
|
error = A._asObject(error);
|
|
error.stack = stackTrace.toString$0(0);
|
|
throw error;
|
|
},
|
|
Stopwatch__now() {
|
|
return $.Primitives_timerTicks.call$0();
|
|
},
|
|
List_List$filled($length, fill, growable, $E) {
|
|
var i,
|
|
result = J.JSArray_JSArray$fixed($length, $E);
|
|
if ($length !== 0 && fill != null)
|
|
for (i = 0; i < $length; ++i)
|
|
result[i] = fill;
|
|
return result;
|
|
},
|
|
List_List$_of(elements, $E) {
|
|
var list, t1;
|
|
if (Array.isArray(elements))
|
|
return A._setArrayType(elements.slice(0), $E._eval$1("JSArray<0>"));
|
|
list = A._setArrayType([], $E._eval$1("JSArray<0>"));
|
|
for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();)
|
|
B.JSArray_methods.add$1(list, t1.get$current());
|
|
return list;
|
|
},
|
|
String_String$fromCharCodes(charCodes, start, end) {
|
|
var t1, t2, maxLength, array, len;
|
|
A.RangeError_checkNotNegative(start, "start");
|
|
t1 = end == null;
|
|
t2 = !t1;
|
|
if (t2) {
|
|
maxLength = end - start;
|
|
if (maxLength < 0)
|
|
throw A.wrapException(A.RangeError$range(end, start, null, "end", null));
|
|
if (maxLength === 0)
|
|
return "";
|
|
}
|
|
if (Array.isArray(charCodes)) {
|
|
array = charCodes;
|
|
len = array.length;
|
|
if (t1)
|
|
end = len;
|
|
return A.Primitives_stringFromCharCodes(start > 0 || end < len ? array.slice(start, end) : array);
|
|
}
|
|
if (type$.NativeUint8List._is(charCodes))
|
|
return A.String__stringFromUint8List(charCodes, start, end);
|
|
if (t2)
|
|
charCodes = J.take$1$ax(charCodes, end);
|
|
if (start > 0)
|
|
charCodes = J.skip$1$ax(charCodes, start);
|
|
t1 = A.List_List$_of(charCodes, type$.int);
|
|
return A.Primitives_stringFromCharCodes(t1);
|
|
},
|
|
String__stringFromUint8List(charCodes, start, endOrNull) {
|
|
var len = charCodes.length;
|
|
if (start >= len)
|
|
return "";
|
|
return A.Primitives_stringFromNativeUint8List(charCodes, start, endOrNull == null || endOrNull > len ? len : endOrNull);
|
|
},
|
|
RegExp_RegExp(source) {
|
|
return new A.JSSyntaxRegExp(source, A.JSSyntaxRegExp_makeNative(source, false, true, false, false, ""));
|
|
},
|
|
StringBuffer__writeAll(string, objects, separator) {
|
|
var iterator = J.get$iterator$ax(objects);
|
|
if (!iterator.moveNext$0())
|
|
return string;
|
|
if (separator.length === 0) {
|
|
do
|
|
string += A.S(iterator.get$current());
|
|
while (iterator.moveNext$0());
|
|
} else {
|
|
string += A.S(iterator.get$current());
|
|
for (; iterator.moveNext$0();)
|
|
string = string + separator + A.S(iterator.get$current());
|
|
}
|
|
return string;
|
|
},
|
|
StackTrace_current() {
|
|
return A.getTraceFromException(new Error());
|
|
},
|
|
DateTime$now() {
|
|
return new A.DateTime(Date.now(), 0, false);
|
|
},
|
|
DateTime__fourDigits(n) {
|
|
var absN = Math.abs(n),
|
|
sign = n < 0 ? "-" : "";
|
|
if (absN >= 1000)
|
|
return "" + n;
|
|
if (absN >= 100)
|
|
return sign + "0" + absN;
|
|
if (absN >= 10)
|
|
return sign + "00" + absN;
|
|
return sign + "000" + absN;
|
|
},
|
|
DateTime__threeDigits(n) {
|
|
if (n >= 100)
|
|
return "" + n;
|
|
if (n >= 10)
|
|
return "0" + n;
|
|
return "00" + n;
|
|
},
|
|
DateTime__twoDigits(n) {
|
|
if (n >= 10)
|
|
return "" + n;
|
|
return "0" + n;
|
|
},
|
|
Error_safeToString(object) {
|
|
if (typeof object == "number" || A._isBool(object) || object == null)
|
|
return J.toString$0$(object);
|
|
if (typeof object == "string")
|
|
return JSON.stringify(object);
|
|
return A.Primitives_safeToString(object);
|
|
},
|
|
Error_throwWithStackTrace(error, stackTrace) {
|
|
A.checkNotNullable(error, "error", type$.Object);
|
|
A.checkNotNullable(stackTrace, "stackTrace", type$.StackTrace);
|
|
A.Error__throw(error, stackTrace);
|
|
},
|
|
AssertionError$(message) {
|
|
return new A.AssertionError(message);
|
|
},
|
|
ArgumentError$(message, $name) {
|
|
return new A.ArgumentError(false, null, $name, message);
|
|
},
|
|
ArgumentError$value(value, $name, message) {
|
|
return new A.ArgumentError(true, value, $name, message);
|
|
},
|
|
ArgumentError$notNull($name) {
|
|
return new A.ArgumentError(false, null, $name, "Must not be null");
|
|
},
|
|
ArgumentError_checkNotNull(argument, $name, $T) {
|
|
return argument;
|
|
},
|
|
RangeError$value(value, $name) {
|
|
return new A.RangeError(null, null, true, value, $name, "Value not in range");
|
|
},
|
|
RangeError$range(invalidValue, minValue, maxValue, $name, message) {
|
|
return new A.RangeError(minValue, maxValue, true, invalidValue, $name, "Invalid value");
|
|
},
|
|
RangeError_checkValidRange(start, end, $length) {
|
|
if (0 > start || start > $length)
|
|
throw A.wrapException(A.RangeError$range(start, 0, $length, "start", null));
|
|
if (end != null) {
|
|
if (start > end || end > $length)
|
|
throw A.wrapException(A.RangeError$range(end, start, $length, "end", null));
|
|
return end;
|
|
}
|
|
return $length;
|
|
},
|
|
RangeError_checkNotNegative(value, $name) {
|
|
if (value < 0)
|
|
throw A.wrapException(A.RangeError$range(value, 0, null, $name, null));
|
|
return value;
|
|
},
|
|
IndexError$withLength(invalidValue, $length, indexable, message, $name) {
|
|
return new A.IndexError($length, true, invalidValue, $name, "Index out of range");
|
|
},
|
|
UnsupportedError$(message) {
|
|
return new A.UnsupportedError(message);
|
|
},
|
|
UnimplementedError$(message) {
|
|
return new A.UnimplementedError(message);
|
|
},
|
|
StateError$(message) {
|
|
return new A.StateError(message);
|
|
},
|
|
ConcurrentModificationError$(modifiedObject) {
|
|
return new A.ConcurrentModificationError(modifiedObject);
|
|
},
|
|
FormatException$(message, source, offset) {
|
|
return new A.FormatException(message, source, offset);
|
|
},
|
|
Iterable_iterableToShortString(iterable, leftDelimiter, rightDelimiter) {
|
|
var parts, t1;
|
|
if (A.isToStringVisiting(iterable)) {
|
|
if (leftDelimiter === "(" && rightDelimiter === ")")
|
|
return "(...)";
|
|
return leftDelimiter + "..." + rightDelimiter;
|
|
}
|
|
parts = A._setArrayType([], type$.JSArray_String);
|
|
B.JSArray_methods.add$1($.toStringVisiting, iterable);
|
|
try {
|
|
A._iterablePartsToStrings(iterable, parts);
|
|
} finally {
|
|
if (0 >= $.toStringVisiting.length)
|
|
return A.ioore($.toStringVisiting, -1);
|
|
$.toStringVisiting.pop();
|
|
}
|
|
t1 = A.StringBuffer__writeAll(leftDelimiter, type$.Iterable_dynamic._as(parts), ", ") + rightDelimiter;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
Iterable_iterableToFullString(iterable, leftDelimiter, rightDelimiter) {
|
|
var buffer, t1;
|
|
if (A.isToStringVisiting(iterable))
|
|
return leftDelimiter + "..." + rightDelimiter;
|
|
buffer = new A.StringBuffer(leftDelimiter);
|
|
B.JSArray_methods.add$1($.toStringVisiting, iterable);
|
|
try {
|
|
t1 = buffer;
|
|
t1._contents = A.StringBuffer__writeAll(t1._contents, iterable, ", ");
|
|
} finally {
|
|
if (0 >= $.toStringVisiting.length)
|
|
return A.ioore($.toStringVisiting, -1);
|
|
$.toStringVisiting.pop();
|
|
}
|
|
buffer._contents += rightDelimiter;
|
|
t1 = buffer._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
_iterablePartsToStrings(iterable, parts) {
|
|
var next, ultimateString, penultimateString, penultimate, ultimate, ultimate0, elision,
|
|
it = iterable.get$iterator(iterable),
|
|
$length = 0, count = 0;
|
|
while (true) {
|
|
if (!($length < 80 || count < 3))
|
|
break;
|
|
if (!it.moveNext$0())
|
|
return;
|
|
next = A.S(it.get$current());
|
|
B.JSArray_methods.add$1(parts, next);
|
|
$length += next.length + 2;
|
|
++count;
|
|
}
|
|
if (!it.moveNext$0()) {
|
|
if (count <= 5)
|
|
return;
|
|
if (0 >= parts.length)
|
|
return A.ioore(parts, -1);
|
|
ultimateString = parts.pop();
|
|
if (0 >= parts.length)
|
|
return A.ioore(parts, -1);
|
|
penultimateString = parts.pop();
|
|
} else {
|
|
penultimate = it.get$current();
|
|
++count;
|
|
if (!it.moveNext$0()) {
|
|
if (count <= 4) {
|
|
B.JSArray_methods.add$1(parts, A.S(penultimate));
|
|
return;
|
|
}
|
|
ultimateString = A.S(penultimate);
|
|
if (0 >= parts.length)
|
|
return A.ioore(parts, -1);
|
|
penultimateString = parts.pop();
|
|
$length += ultimateString.length + 2;
|
|
} else {
|
|
ultimate = it.get$current();
|
|
++count;
|
|
for (; it.moveNext$0(); penultimate = ultimate, ultimate = ultimate0) {
|
|
ultimate0 = it.get$current();
|
|
++count;
|
|
if (count > 100) {
|
|
while (true) {
|
|
if (!($length > 75 && count > 3))
|
|
break;
|
|
if (0 >= parts.length)
|
|
return A.ioore(parts, -1);
|
|
$length -= parts.pop().length + 2;
|
|
--count;
|
|
}
|
|
B.JSArray_methods.add$1(parts, "...");
|
|
return;
|
|
}
|
|
}
|
|
penultimateString = A.S(penultimate);
|
|
ultimateString = A.S(ultimate);
|
|
$length += ultimateString.length + penultimateString.length + 4;
|
|
}
|
|
}
|
|
if (count > parts.length + 2) {
|
|
$length += 5;
|
|
elision = "...";
|
|
} else
|
|
elision = null;
|
|
while (true) {
|
|
if (!($length > 80 && parts.length > 3))
|
|
break;
|
|
if (0 >= parts.length)
|
|
return A.ioore(parts, -1);
|
|
$length -= parts.pop().length + 2;
|
|
if (elision == null) {
|
|
$length += 5;
|
|
elision = "...";
|
|
}
|
|
}
|
|
if (elision != null)
|
|
B.JSArray_methods.add$1(parts, elision);
|
|
B.JSArray_methods.add$1(parts, penultimateString);
|
|
B.JSArray_methods.add$1(parts, ultimateString);
|
|
},
|
|
Object_hash(object1, object2) {
|
|
var t1 = B.JSInt_methods.get$hashCode(object1);
|
|
object2 = B.JSInt_methods.get$hashCode(object2);
|
|
object2 = A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2));
|
|
return object2;
|
|
},
|
|
print(object) {
|
|
A.printString(A.S(object));
|
|
},
|
|
Uri_parse(uri) {
|
|
var delta, indices, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, isSimple, scheme, t1, t2, schemeAuth, queryStart0, pathStart0, port, userInfoStart, userInfo, host, portNumber, path, query, _null = null,
|
|
end = uri.length;
|
|
if (end >= 5) {
|
|
if (4 >= end)
|
|
return A.ioore(uri, 4);
|
|
delta = ((uri.charCodeAt(4) ^ 58) * 3 | uri.charCodeAt(0) ^ 100 | uri.charCodeAt(1) ^ 97 | uri.charCodeAt(2) ^ 116 | uri.charCodeAt(3) ^ 97) >>> 0;
|
|
if (delta === 0)
|
|
return A.UriData__parse(end < end ? B.JSString_methods.substring$2(uri, 0, end) : uri, 5, _null).get$uri();
|
|
else if (delta === 32)
|
|
return A.UriData__parse(B.JSString_methods.substring$2(uri, 5, end), 0, _null).get$uri();
|
|
}
|
|
indices = A.List_List$filled(8, 0, false, type$.int);
|
|
B.JSArray_methods.$indexSet(indices, 0, 0);
|
|
B.JSArray_methods.$indexSet(indices, 1, -1);
|
|
B.JSArray_methods.$indexSet(indices, 2, -1);
|
|
B.JSArray_methods.$indexSet(indices, 7, -1);
|
|
B.JSArray_methods.$indexSet(indices, 3, 0);
|
|
B.JSArray_methods.$indexSet(indices, 4, 0);
|
|
B.JSArray_methods.$indexSet(indices, 5, end);
|
|
B.JSArray_methods.$indexSet(indices, 6, end);
|
|
if (A._scan(uri, 0, end, 0, indices) >= 14)
|
|
B.JSArray_methods.$indexSet(indices, 7, end);
|
|
schemeEnd = indices[1];
|
|
if (schemeEnd >= 0)
|
|
if (A._scan(uri, 0, schemeEnd, 20, indices) === 20)
|
|
indices[7] = schemeEnd;
|
|
hostStart = indices[2] + 1;
|
|
portStart = indices[3];
|
|
pathStart = indices[4];
|
|
queryStart = indices[5];
|
|
fragmentStart = indices[6];
|
|
if (fragmentStart < queryStart)
|
|
queryStart = fragmentStart;
|
|
if (pathStart < hostStart)
|
|
pathStart = queryStart;
|
|
else if (pathStart <= schemeEnd)
|
|
pathStart = schemeEnd + 1;
|
|
if (portStart < hostStart)
|
|
portStart = pathStart;
|
|
isSimple = indices[7] < 0;
|
|
scheme = _null;
|
|
if (isSimple) {
|
|
isSimple = false;
|
|
if (!(hostStart > schemeEnd + 3)) {
|
|
t1 = portStart > 0;
|
|
if (!(t1 && portStart + 1 === pathStart)) {
|
|
if (!B.JSString_methods.startsWith$2(uri, "\\", pathStart))
|
|
if (hostStart > 0)
|
|
t2 = B.JSString_methods.startsWith$2(uri, "\\", hostStart - 1) || B.JSString_methods.startsWith$2(uri, "\\", hostStart - 2);
|
|
else
|
|
t2 = false;
|
|
else
|
|
t2 = true;
|
|
if (!t2) {
|
|
if (!(queryStart < end && queryStart === pathStart + 2 && B.JSString_methods.startsWith$2(uri, "..", pathStart)))
|
|
t2 = queryStart > pathStart + 2 && B.JSString_methods.startsWith$2(uri, "/..", queryStart - 3);
|
|
else
|
|
t2 = true;
|
|
if (!t2)
|
|
if (schemeEnd === 4) {
|
|
if (B.JSString_methods.startsWith$2(uri, "file", 0)) {
|
|
if (hostStart <= 0) {
|
|
if (!B.JSString_methods.startsWith$2(uri, "/", pathStart)) {
|
|
schemeAuth = "file:///";
|
|
delta = 3;
|
|
} else {
|
|
schemeAuth = "file://";
|
|
delta = 2;
|
|
}
|
|
uri = schemeAuth + B.JSString_methods.substring$2(uri, pathStart, end);
|
|
queryStart += delta;
|
|
fragmentStart += delta;
|
|
end = uri.length;
|
|
hostStart = 7;
|
|
portStart = 7;
|
|
pathStart = 7;
|
|
} else if (pathStart === queryStart) {
|
|
++fragmentStart;
|
|
queryStart0 = queryStart + 1;
|
|
uri = B.JSString_methods.replaceRange$3(uri, pathStart, queryStart, "/");
|
|
++end;
|
|
queryStart = queryStart0;
|
|
}
|
|
scheme = "file";
|
|
} else if (B.JSString_methods.startsWith$2(uri, "http", 0)) {
|
|
if (t1 && portStart + 3 === pathStart && B.JSString_methods.startsWith$2(uri, "80", portStart + 1)) {
|
|
fragmentStart -= 3;
|
|
pathStart0 = pathStart - 3;
|
|
queryStart -= 3;
|
|
uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, "");
|
|
end -= 3;
|
|
pathStart = pathStart0;
|
|
}
|
|
scheme = "http";
|
|
}
|
|
} else if (schemeEnd === 5 && B.JSString_methods.startsWith$2(uri, "https", 0)) {
|
|
if (t1 && portStart + 4 === pathStart && B.JSString_methods.startsWith$2(uri, "443", portStart + 1)) {
|
|
fragmentStart -= 4;
|
|
pathStart0 = pathStart - 4;
|
|
queryStart -= 4;
|
|
uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, "");
|
|
end -= 3;
|
|
pathStart = pathStart0;
|
|
}
|
|
scheme = "https";
|
|
}
|
|
isSimple = !t2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isSimple)
|
|
return new A._SimpleUri(end < uri.length ? B.JSString_methods.substring$2(uri, 0, end) : uri, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, scheme);
|
|
if (scheme == null)
|
|
if (schemeEnd > 0)
|
|
scheme = A._Uri__makeScheme(uri, 0, schemeEnd);
|
|
else {
|
|
if (schemeEnd === 0)
|
|
A._Uri__fail(uri, 0, "Invalid empty scheme");
|
|
scheme = "";
|
|
}
|
|
port = _null;
|
|
if (hostStart > 0) {
|
|
userInfoStart = schemeEnd + 3;
|
|
userInfo = userInfoStart < hostStart ? A._Uri__makeUserInfo(uri, userInfoStart, hostStart - 1) : "";
|
|
host = A._Uri__makeHost(uri, hostStart, portStart, false);
|
|
t1 = portStart + 1;
|
|
if (t1 < pathStart) {
|
|
portNumber = A.Primitives_parseInt(B.JSString_methods.substring$2(uri, t1, pathStart), _null);
|
|
port = A._Uri__makePort(portNumber == null ? A.throwExpression(A.FormatException$("Invalid port", uri, t1)) : portNumber, scheme);
|
|
}
|
|
} else {
|
|
host = _null;
|
|
userInfo = "";
|
|
}
|
|
path = A._Uri__makePath(uri, pathStart, queryStart, _null, scheme, host != null);
|
|
query = queryStart < fragmentStart ? A._Uri__makeQuery(uri, queryStart + 1, fragmentStart, _null) : _null;
|
|
return A._Uri$_internal(scheme, userInfo, host, port, path, query, fragmentStart < end ? A._Uri__makeFragment(uri, fragmentStart + 1, end) : _null);
|
|
},
|
|
Uri__parseIPv4Address(host, start, end) {
|
|
var t1, i, partStart, partIndex, char, part, partIndex0,
|
|
_s43_ = "IPv4 address should contain exactly 4 parts",
|
|
_s37_ = "each part must be in the range 0..255",
|
|
error = new A.Uri__parseIPv4Address_error(host),
|
|
result = new Uint8Array(4);
|
|
for (t1 = host.length, i = start, partStart = i, partIndex = 0; i < end; ++i) {
|
|
if (!(i >= 0 && i < t1))
|
|
return A.ioore(host, i);
|
|
char = host.charCodeAt(i);
|
|
if (char !== 46) {
|
|
if ((char ^ 48) > 9)
|
|
error.call$2("invalid character", i);
|
|
} else {
|
|
if (partIndex === 3)
|
|
error.call$2(_s43_, i);
|
|
part = A.int_parse(B.JSString_methods.substring$2(host, partStart, i), null);
|
|
if (part > 255)
|
|
error.call$2(_s37_, partStart);
|
|
partIndex0 = partIndex + 1;
|
|
if (!(partIndex < 4))
|
|
return A.ioore(result, partIndex);
|
|
result[partIndex] = part;
|
|
partStart = i + 1;
|
|
partIndex = partIndex0;
|
|
}
|
|
}
|
|
if (partIndex !== 3)
|
|
error.call$2(_s43_, end);
|
|
part = A.int_parse(B.JSString_methods.substring$2(host, partStart, end), null);
|
|
if (part > 255)
|
|
error.call$2(_s37_, partStart);
|
|
if (!(partIndex < 4))
|
|
return A.ioore(result, partIndex);
|
|
result[partIndex] = part;
|
|
return result;
|
|
},
|
|
Uri__validateIPvAddress(host, start, end) {
|
|
var error;
|
|
if (start === end)
|
|
throw A.wrapException(A.FormatException$("Empty IP address", host, start));
|
|
if (!(start >= 0 && start < host.length))
|
|
return A.ioore(host, start);
|
|
if (host.charCodeAt(start) === 118) {
|
|
error = A.Uri__validateIPvFutureAddress(host, start, end);
|
|
if (error != null)
|
|
throw A.wrapException(error);
|
|
return false;
|
|
}
|
|
A.Uri_parseIPv6Address(host, start, end);
|
|
return true;
|
|
},
|
|
Uri__validateIPvFutureAddress(host, start, end) {
|
|
var t1, cursor, cursor0, char, ucChar,
|
|
_s38_ = "Missing hex-digit in IPvFuture address",
|
|
_s128_ = string$.______;
|
|
++start;
|
|
for (t1 = host.length, cursor = start; true; cursor = cursor0) {
|
|
if (cursor < end) {
|
|
cursor0 = cursor + 1;
|
|
if (!(cursor >= 0 && cursor < t1))
|
|
return A.ioore(host, cursor);
|
|
char = host.charCodeAt(cursor);
|
|
if ((char ^ 48) <= 9)
|
|
continue;
|
|
ucChar = char | 32;
|
|
if (ucChar >= 97 && ucChar <= 102)
|
|
continue;
|
|
if (char === 46) {
|
|
if (cursor0 - 1 === start)
|
|
return new A.FormatException(_s38_, host, cursor0);
|
|
cursor = cursor0;
|
|
break;
|
|
}
|
|
return new A.FormatException("Unexpected character", host, cursor0 - 1);
|
|
}
|
|
if (cursor - 1 === start)
|
|
return new A.FormatException(_s38_, host, cursor);
|
|
return new A.FormatException("Missing '.' in IPvFuture address", host, cursor);
|
|
}
|
|
if (cursor === end)
|
|
return new A.FormatException("Missing address in IPvFuture address, host, cursor", null, null);
|
|
for (; true;) {
|
|
if (!(cursor >= 0 && cursor < t1))
|
|
return A.ioore(host, cursor);
|
|
char = host.charCodeAt(cursor);
|
|
if (!(char < 128))
|
|
return A.ioore(_s128_, char);
|
|
if ((_s128_.charCodeAt(char) & 16) !== 0) {
|
|
++cursor;
|
|
if (cursor < end)
|
|
continue;
|
|
return null;
|
|
}
|
|
return new A.FormatException("Invalid IPvFuture address character", host, cursor);
|
|
}
|
|
},
|
|
Uri_parseIPv6Address(host, start, end) {
|
|
var parts, i, partStart, wildcardSeen, seenDot, char, atEnd, last, bytes, wildCardLength, index, value, j, t2, _null = null,
|
|
error = new A.Uri_parseIPv6Address_error(host),
|
|
parseHex = new A.Uri_parseIPv6Address_parseHex(error, host),
|
|
t1 = host.length;
|
|
if (t1 < 2)
|
|
error.call$2("address is too short", _null);
|
|
parts = A._setArrayType([], type$.JSArray_int);
|
|
for (i = start, partStart = i, wildcardSeen = false, seenDot = false; i < end; ++i) {
|
|
if (!(i >= 0 && i < t1))
|
|
return A.ioore(host, i);
|
|
char = host.charCodeAt(i);
|
|
if (char === 58) {
|
|
if (i === start) {
|
|
++i;
|
|
if (!(i < t1))
|
|
return A.ioore(host, i);
|
|
if (host.charCodeAt(i) !== 58)
|
|
error.call$2("invalid start colon.", i);
|
|
partStart = i;
|
|
}
|
|
if (i === partStart) {
|
|
if (wildcardSeen)
|
|
error.call$2("only one wildcard `::` is allowed", i);
|
|
B.JSArray_methods.add$1(parts, -1);
|
|
wildcardSeen = true;
|
|
} else
|
|
B.JSArray_methods.add$1(parts, parseHex.call$2(partStart, i));
|
|
partStart = i + 1;
|
|
} else if (char === 46)
|
|
seenDot = true;
|
|
}
|
|
if (parts.length === 0)
|
|
error.call$2("too few parts", _null);
|
|
atEnd = partStart === end;
|
|
t1 = B.JSArray_methods.get$last(parts);
|
|
if (atEnd && t1 !== -1)
|
|
error.call$2("expected a part after last `:`", end);
|
|
if (!atEnd)
|
|
if (!seenDot)
|
|
B.JSArray_methods.add$1(parts, parseHex.call$2(partStart, end));
|
|
else {
|
|
last = A.Uri__parseIPv4Address(host, partStart, end);
|
|
B.JSArray_methods.add$1(parts, (last[0] << 8 | last[1]) >>> 0);
|
|
B.JSArray_methods.add$1(parts, (last[2] << 8 | last[3]) >>> 0);
|
|
}
|
|
if (wildcardSeen) {
|
|
if (parts.length > 7)
|
|
error.call$2("an address with a wildcard must have less than 7 parts", _null);
|
|
} else if (parts.length !== 8)
|
|
error.call$2("an address without a wildcard must contain exactly 8 parts", _null);
|
|
bytes = new Uint8Array(16);
|
|
for (t1 = parts.length, wildCardLength = 9 - t1, i = 0, index = 0; i < t1; ++i) {
|
|
value = parts[i];
|
|
if (value === -1)
|
|
for (j = 0; j < wildCardLength; ++j) {
|
|
if (!(index >= 0 && index < 16))
|
|
return A.ioore(bytes, index);
|
|
bytes[index] = 0;
|
|
t2 = index + 1;
|
|
if (!(t2 < 16))
|
|
return A.ioore(bytes, t2);
|
|
bytes[t2] = 0;
|
|
index += 2;
|
|
}
|
|
else {
|
|
t2 = B.JSInt_methods._shrOtherPositive$1(value, 8);
|
|
if (!(index >= 0 && index < 16))
|
|
return A.ioore(bytes, index);
|
|
bytes[index] = t2;
|
|
t2 = index + 1;
|
|
if (!(t2 < 16))
|
|
return A.ioore(bytes, t2);
|
|
bytes[t2] = value & 255;
|
|
index += 2;
|
|
}
|
|
}
|
|
return bytes;
|
|
},
|
|
_Uri$_internal(scheme, _userInfo, _host, _port, path, _query, _fragment) {
|
|
return new A._Uri(scheme, _userInfo, _host, _port, path, _query, _fragment);
|
|
},
|
|
_Uri__Uri(host, port) {
|
|
var query, fragment, t1, hasAuthority, path, _null = null,
|
|
userInfo = A._Uri__makeUserInfo(_null, 0, 0);
|
|
host = A._Uri__makeHost(host, 0, host.length, false);
|
|
query = A._Uri__makeQuery(_null, 0, 0, _null);
|
|
fragment = A._Uri__makeFragment(_null, 0, 0);
|
|
port = A._Uri__makePort(port, "");
|
|
if (host == null)
|
|
if (userInfo.length === 0)
|
|
t1 = port != null;
|
|
else
|
|
t1 = true;
|
|
else
|
|
t1 = false;
|
|
if (t1)
|
|
host = "";
|
|
t1 = host == null;
|
|
hasAuthority = !t1;
|
|
path = A._Uri__makePath(_null, 0, 0, _null, "", hasAuthority);
|
|
if (t1 && !B.JSString_methods.startsWith$1(path, "/"))
|
|
path = A._Uri__normalizeRelativePath(path, hasAuthority);
|
|
else
|
|
path = A._Uri__removeDotSegments(path);
|
|
return A._Uri$_internal("", userInfo, t1 && B.JSString_methods.startsWith$1(path, "//") ? "" : host, port, path, query, fragment);
|
|
},
|
|
_Uri__defaultPort(scheme) {
|
|
if (scheme === "http")
|
|
return 80;
|
|
if (scheme === "https")
|
|
return 443;
|
|
return 0;
|
|
},
|
|
_Uri__fail(uri, index, message) {
|
|
throw A.wrapException(A.FormatException$(message, uri, index));
|
|
},
|
|
_Uri__makePort(port, scheme) {
|
|
if (port != null && port === A._Uri__defaultPort(scheme))
|
|
return null;
|
|
return port;
|
|
},
|
|
_Uri__makeHost(host, start, end, strictIPv6) {
|
|
var t1, t2, t3, zoneID, index, zoneIDstart, isIPv6, hostChars, i;
|
|
if (start === end)
|
|
return "";
|
|
t1 = host.length;
|
|
if (!(start >= 0 && start < t1))
|
|
return A.ioore(host, start);
|
|
if (host.charCodeAt(start) === 91) {
|
|
t2 = end - 1;
|
|
if (!(t2 >= 0 && t2 < t1))
|
|
return A.ioore(host, t2);
|
|
if (host.charCodeAt(t2) !== 93)
|
|
A._Uri__fail(host, start, "Missing end `]` to match `[` in host");
|
|
t3 = start + 1;
|
|
if (!(t3 < t1))
|
|
return A.ioore(host, t3);
|
|
zoneID = "";
|
|
if (host.charCodeAt(t3) !== 118) {
|
|
index = A._Uri__checkZoneID(host, t3, t2);
|
|
if (index < t2) {
|
|
zoneIDstart = index + 1;
|
|
zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, t2, "%25");
|
|
}
|
|
} else
|
|
index = t2;
|
|
isIPv6 = A.Uri__validateIPvAddress(host, t3, index);
|
|
hostChars = B.JSString_methods.substring$2(host, t3, index);
|
|
return "[" + (isIPv6 ? hostChars.toLowerCase() : hostChars) + zoneID + "]";
|
|
}
|
|
for (i = start; i < end; ++i) {
|
|
if (!(i < t1))
|
|
return A.ioore(host, i);
|
|
if (host.charCodeAt(i) === 58) {
|
|
index = B.JSString_methods.indexOf$2(host, "%", start);
|
|
index = index >= start && index < end ? index : end;
|
|
if (index < end) {
|
|
zoneIDstart = index + 1;
|
|
zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, end, "%25");
|
|
} else
|
|
zoneID = "";
|
|
A.Uri_parseIPv6Address(host, start, index);
|
|
return "[" + B.JSString_methods.substring$2(host, start, index) + zoneID + "]";
|
|
}
|
|
}
|
|
return A._Uri__normalizeRegName(host, start, end);
|
|
},
|
|
_Uri__checkZoneID(host, start, end) {
|
|
var index = B.JSString_methods.indexOf$2(host, "%", start);
|
|
return index >= start && index < end ? index : end;
|
|
},
|
|
_Uri__normalizeZoneID(host, start, end, prefix) {
|
|
var t1, index, sectionStart, isNormalized, char, replacement, t2, t3, sourceLength, tail, slice,
|
|
buffer = prefix !== "" ? new A.StringBuffer(prefix) : null;
|
|
for (t1 = host.length, index = start, sectionStart = index, isNormalized = true; index < end;) {
|
|
if (!(index >= 0 && index < t1))
|
|
return A.ioore(host, index);
|
|
char = host.charCodeAt(index);
|
|
if (char === 37) {
|
|
replacement = A._Uri__normalizeEscape(host, index, true);
|
|
t2 = replacement == null;
|
|
if (t2 && isNormalized) {
|
|
index += 3;
|
|
continue;
|
|
}
|
|
if (buffer == null)
|
|
buffer = new A.StringBuffer("");
|
|
t3 = buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index);
|
|
if (t2)
|
|
replacement = B.JSString_methods.substring$2(host, index, index + 3);
|
|
else if (replacement === "%")
|
|
A._Uri__fail(host, index, "ZoneID should not contain % anymore");
|
|
buffer._contents = t3 + replacement;
|
|
index += 3;
|
|
sectionStart = index;
|
|
isNormalized = true;
|
|
} else if (char < 127 && (string$.______.charCodeAt(char) & 1) !== 0) {
|
|
if (isNormalized && 65 <= char && 90 >= char) {
|
|
if (buffer == null)
|
|
buffer = new A.StringBuffer("");
|
|
if (sectionStart < index) {
|
|
buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index);
|
|
sectionStart = index;
|
|
}
|
|
isNormalized = false;
|
|
}
|
|
++index;
|
|
} else {
|
|
sourceLength = 1;
|
|
if ((char & 64512) === 55296 && index + 1 < end) {
|
|
t2 = index + 1;
|
|
if (!(t2 < t1))
|
|
return A.ioore(host, t2);
|
|
tail = host.charCodeAt(t2);
|
|
if ((tail & 64512) === 56320) {
|
|
char = 65536 + ((char & 1023) << 10) + (tail & 1023);
|
|
sourceLength = 2;
|
|
}
|
|
}
|
|
slice = B.JSString_methods.substring$2(host, sectionStart, index);
|
|
if (buffer == null) {
|
|
buffer = new A.StringBuffer("");
|
|
t2 = buffer;
|
|
} else
|
|
t2 = buffer;
|
|
t2._contents += slice;
|
|
t3 = A._Uri__escapeChar(char);
|
|
t2._contents += t3;
|
|
index += sourceLength;
|
|
sectionStart = index;
|
|
}
|
|
}
|
|
if (buffer == null)
|
|
return B.JSString_methods.substring$2(host, start, end);
|
|
if (sectionStart < end) {
|
|
slice = B.JSString_methods.substring$2(host, sectionStart, end);
|
|
buffer._contents += slice;
|
|
}
|
|
t1 = buffer._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
_Uri__normalizeRegName(host, start, end) {
|
|
var t1, index, sectionStart, buffer, isNormalized, char, replacement, t2, slice, t3, sourceLength, tail,
|
|
_s128_ = string$.______;
|
|
for (t1 = host.length, index = start, sectionStart = index, buffer = null, isNormalized = true; index < end;) {
|
|
if (!(index >= 0 && index < t1))
|
|
return A.ioore(host, index);
|
|
char = host.charCodeAt(index);
|
|
if (char === 37) {
|
|
replacement = A._Uri__normalizeEscape(host, index, true);
|
|
t2 = replacement == null;
|
|
if (t2 && isNormalized) {
|
|
index += 3;
|
|
continue;
|
|
}
|
|
if (buffer == null)
|
|
buffer = new A.StringBuffer("");
|
|
slice = B.JSString_methods.substring$2(host, sectionStart, index);
|
|
if (!isNormalized)
|
|
slice = slice.toLowerCase();
|
|
t3 = buffer._contents += slice;
|
|
sourceLength = 3;
|
|
if (t2)
|
|
replacement = B.JSString_methods.substring$2(host, index, index + 3);
|
|
else if (replacement === "%") {
|
|
replacement = "%25";
|
|
sourceLength = 1;
|
|
}
|
|
buffer._contents = t3 + replacement;
|
|
index += sourceLength;
|
|
sectionStart = index;
|
|
isNormalized = true;
|
|
} else if (char < 127 && (_s128_.charCodeAt(char) & 32) !== 0) {
|
|
if (isNormalized && 65 <= char && 90 >= char) {
|
|
if (buffer == null)
|
|
buffer = new A.StringBuffer("");
|
|
if (sectionStart < index) {
|
|
buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index);
|
|
sectionStart = index;
|
|
}
|
|
isNormalized = false;
|
|
}
|
|
++index;
|
|
} else if (char <= 93 && (_s128_.charCodeAt(char) & 1024) !== 0)
|
|
A._Uri__fail(host, index, "Invalid character");
|
|
else {
|
|
sourceLength = 1;
|
|
if ((char & 64512) === 55296 && index + 1 < end) {
|
|
t2 = index + 1;
|
|
if (!(t2 < t1))
|
|
return A.ioore(host, t2);
|
|
tail = host.charCodeAt(t2);
|
|
if ((tail & 64512) === 56320) {
|
|
char = 65536 + ((char & 1023) << 10) + (tail & 1023);
|
|
sourceLength = 2;
|
|
}
|
|
}
|
|
slice = B.JSString_methods.substring$2(host, sectionStart, index);
|
|
if (!isNormalized)
|
|
slice = slice.toLowerCase();
|
|
if (buffer == null) {
|
|
buffer = new A.StringBuffer("");
|
|
t2 = buffer;
|
|
} else
|
|
t2 = buffer;
|
|
t2._contents += slice;
|
|
t3 = A._Uri__escapeChar(char);
|
|
t2._contents += t3;
|
|
index += sourceLength;
|
|
sectionStart = index;
|
|
}
|
|
}
|
|
if (buffer == null)
|
|
return B.JSString_methods.substring$2(host, start, end);
|
|
if (sectionStart < end) {
|
|
slice = B.JSString_methods.substring$2(host, sectionStart, end);
|
|
if (!isNormalized)
|
|
slice = slice.toLowerCase();
|
|
buffer._contents += slice;
|
|
}
|
|
t1 = buffer._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
_Uri__makeScheme(scheme, start, end) {
|
|
var t1, i, containsUpperCase, codeUnit;
|
|
if (start === end)
|
|
return "";
|
|
t1 = scheme.length;
|
|
if (!(start < t1))
|
|
return A.ioore(scheme, start);
|
|
if (!A._Uri__isAlphabeticCharacter(scheme.charCodeAt(start)))
|
|
A._Uri__fail(scheme, start, "Scheme not starting with alphabetic character");
|
|
for (i = start, containsUpperCase = false; i < end; ++i) {
|
|
if (!(i < t1))
|
|
return A.ioore(scheme, i);
|
|
codeUnit = scheme.charCodeAt(i);
|
|
if (!(codeUnit < 128 && (string$.______.charCodeAt(codeUnit) & 8) !== 0))
|
|
A._Uri__fail(scheme, i, "Illegal scheme character");
|
|
if (65 <= codeUnit && codeUnit <= 90)
|
|
containsUpperCase = true;
|
|
}
|
|
scheme = B.JSString_methods.substring$2(scheme, start, end);
|
|
return A._Uri__canonicalizeScheme(containsUpperCase ? scheme.toLowerCase() : scheme);
|
|
},
|
|
_Uri__canonicalizeScheme(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(userInfo, start, end) {
|
|
if (userInfo == null)
|
|
return "";
|
|
return A._Uri__normalizeOrSubstring(userInfo, start, end, 16, false, false);
|
|
},
|
|
_Uri__makePath(path, start, end, pathSegments, scheme, hasAuthority) {
|
|
var result,
|
|
isFile = scheme === "file",
|
|
ensureLeadingSlash = isFile || hasAuthority;
|
|
if (path == null)
|
|
return isFile ? "/" : "";
|
|
else
|
|
result = A._Uri__normalizeOrSubstring(path, start, end, 128, true, true);
|
|
if (result.length === 0) {
|
|
if (isFile)
|
|
return "/";
|
|
} else if (ensureLeadingSlash && !B.JSString_methods.startsWith$1(result, "/"))
|
|
result = "/" + result;
|
|
return A._Uri__normalizePath(result, scheme, hasAuthority);
|
|
},
|
|
_Uri__normalizePath(path, scheme, hasAuthority) {
|
|
var t1 = scheme.length === 0;
|
|
if (t1 && !hasAuthority && !B.JSString_methods.startsWith$1(path, "/") && !B.JSString_methods.startsWith$1(path, "\\"))
|
|
return A._Uri__normalizeRelativePath(path, !t1 || hasAuthority);
|
|
return A._Uri__removeDotSegments(path);
|
|
},
|
|
_Uri__makeQuery(query, start, end, queryParameters) {
|
|
if (query != null)
|
|
return A._Uri__normalizeOrSubstring(query, start, end, 256, true, false);
|
|
return null;
|
|
},
|
|
_Uri__makeFragment(fragment, start, end) {
|
|
if (fragment == null)
|
|
return null;
|
|
return A._Uri__normalizeOrSubstring(fragment, start, end, 256, true, false);
|
|
},
|
|
_Uri__normalizeEscape(source, index, lowerCase) {
|
|
var t3, firstDigit, secondDigit, firstDigitValue, secondDigitValue, value,
|
|
_s128_ = string$.______,
|
|
t1 = index + 2,
|
|
t2 = source.length;
|
|
if (t1 >= t2)
|
|
return "%";
|
|
t3 = index + 1;
|
|
if (!(t3 >= 0 && t3 < t2))
|
|
return A.ioore(source, t3);
|
|
firstDigit = source.charCodeAt(t3);
|
|
if (!(t1 >= 0))
|
|
return A.ioore(source, t1);
|
|
secondDigit = source.charCodeAt(t1);
|
|
firstDigitValue = A.hexDigitValue(firstDigit);
|
|
secondDigitValue = A.hexDigitValue(secondDigit);
|
|
if (firstDigitValue < 0 || secondDigitValue < 0)
|
|
return "%";
|
|
value = firstDigitValue * 16 + secondDigitValue;
|
|
if (value < 127) {
|
|
if (!(value >= 0))
|
|
return A.ioore(_s128_, value);
|
|
t1 = (_s128_.charCodeAt(value) & 1) !== 0;
|
|
} else
|
|
t1 = false;
|
|
if (t1)
|
|
return A.Primitives_stringFromCharCode(lowerCase && 65 <= value && 90 >= value ? (value | 32) >>> 0 : value);
|
|
if (firstDigit >= 97 || secondDigit >= 97)
|
|
return B.JSString_methods.substring$2(source, index, index + 3).toUpperCase();
|
|
return null;
|
|
},
|
|
_Uri__escapeChar(char) {
|
|
var codeUnits, t1, flag, encodedBytes, index, byte, t2, t3,
|
|
_s16_ = "0123456789ABCDEF";
|
|
if (char <= 127) {
|
|
codeUnits = new Uint8Array(3);
|
|
codeUnits[0] = 37;
|
|
t1 = char >>> 4;
|
|
if (!(t1 < 16))
|
|
return A.ioore(_s16_, t1);
|
|
codeUnits[1] = _s16_.charCodeAt(t1);
|
|
codeUnits[2] = _s16_.charCodeAt(char & 15);
|
|
} else {
|
|
if (char > 2047)
|
|
if (char > 65535) {
|
|
flag = 240;
|
|
encodedBytes = 4;
|
|
} else {
|
|
flag = 224;
|
|
encodedBytes = 3;
|
|
}
|
|
else {
|
|
flag = 192;
|
|
encodedBytes = 2;
|
|
}
|
|
t1 = 3 * encodedBytes;
|
|
codeUnits = new Uint8Array(t1);
|
|
for (index = 0; --encodedBytes, encodedBytes >= 0; flag = 128) {
|
|
byte = B.JSInt_methods._shrReceiverPositive$1(char, 6 * encodedBytes) & 63 | flag;
|
|
if (!(index < t1))
|
|
return A.ioore(codeUnits, index);
|
|
codeUnits[index] = 37;
|
|
t2 = index + 1;
|
|
t3 = byte >>> 4;
|
|
if (!(t3 < 16))
|
|
return A.ioore(_s16_, t3);
|
|
if (!(t2 < t1))
|
|
return A.ioore(codeUnits, t2);
|
|
codeUnits[t2] = _s16_.charCodeAt(t3);
|
|
t3 = index + 2;
|
|
if (!(t3 < t1))
|
|
return A.ioore(codeUnits, t3);
|
|
codeUnits[t3] = _s16_.charCodeAt(byte & 15);
|
|
index += 3;
|
|
}
|
|
}
|
|
return A.String_String$fromCharCodes(codeUnits, 0, null);
|
|
},
|
|
_Uri__normalizeOrSubstring(component, start, end, charMask, escapeDelimiters, replaceBackslash) {
|
|
var t1 = A._Uri__normalize(component, start, end, charMask, escapeDelimiters, replaceBackslash);
|
|
return t1 == null ? B.JSString_methods.substring$2(component, start, end) : t1;
|
|
},
|
|
_Uri__normalize(component, start, end, charMask, escapeDelimiters, replaceBackslash) {
|
|
var t1, t2, index, sectionStart, buffer, char, sourceLength, replacement, t3, tail, _null = null,
|
|
_s128_ = string$.______;
|
|
for (t1 = !escapeDelimiters, t2 = component.length, index = start, sectionStart = index, buffer = _null; index < end;) {
|
|
if (!(index >= 0 && index < t2))
|
|
return A.ioore(component, index);
|
|
char = component.charCodeAt(index);
|
|
if (char < 127 && (_s128_.charCodeAt(char) & charMask) !== 0)
|
|
++index;
|
|
else {
|
|
sourceLength = 1;
|
|
if (char === 37) {
|
|
replacement = A._Uri__normalizeEscape(component, index, false);
|
|
if (replacement == null) {
|
|
index += 3;
|
|
continue;
|
|
}
|
|
if ("%" === replacement)
|
|
replacement = "%25";
|
|
else
|
|
sourceLength = 3;
|
|
} else if (char === 92 && replaceBackslash)
|
|
replacement = "/";
|
|
else if (t1 && char <= 93 && (_s128_.charCodeAt(char) & 1024) !== 0) {
|
|
A._Uri__fail(component, index, "Invalid character");
|
|
sourceLength = _null;
|
|
replacement = sourceLength;
|
|
} else {
|
|
if ((char & 64512) === 55296) {
|
|
t3 = index + 1;
|
|
if (t3 < end) {
|
|
if (!(t3 < t2))
|
|
return A.ioore(component, t3);
|
|
tail = component.charCodeAt(t3);
|
|
if ((tail & 64512) === 56320) {
|
|
char = 65536 + ((char & 1023) << 10) + (tail & 1023);
|
|
sourceLength = 2;
|
|
}
|
|
}
|
|
}
|
|
replacement = A._Uri__escapeChar(char);
|
|
}
|
|
if (buffer == null) {
|
|
buffer = new A.StringBuffer("");
|
|
t3 = buffer;
|
|
} else
|
|
t3 = buffer;
|
|
t3._contents = (t3._contents += B.JSString_methods.substring$2(component, sectionStart, index)) + replacement;
|
|
if (typeof sourceLength !== "number")
|
|
return A.iae(sourceLength);
|
|
index += sourceLength;
|
|
sectionStart = index;
|
|
}
|
|
}
|
|
if (buffer == null)
|
|
return _null;
|
|
if (sectionStart < end) {
|
|
t1 = B.JSString_methods.substring$2(component, sectionStart, end);
|
|
buffer._contents += t1;
|
|
}
|
|
t1 = buffer._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
_Uri__mayContainDotSegments(path) {
|
|
if (B.JSString_methods.startsWith$1(path, "."))
|
|
return true;
|
|
return B.JSString_methods.indexOf$1(path, "/.") !== -1;
|
|
},
|
|
_Uri__removeDotSegments(path) {
|
|
var output, t1, t2, appendSlash, _i, segment, t3;
|
|
if (!A._Uri__mayContainDotSegments(path))
|
|
return path;
|
|
output = A._setArrayType([], type$.JSArray_String);
|
|
for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) {
|
|
segment = t1[_i];
|
|
if (segment === "..") {
|
|
t3 = output.length;
|
|
if (t3 !== 0) {
|
|
if (0 >= t3)
|
|
return A.ioore(output, -1);
|
|
output.pop();
|
|
if (output.length === 0)
|
|
B.JSArray_methods.add$1(output, "");
|
|
}
|
|
appendSlash = true;
|
|
} else {
|
|
appendSlash = "." === segment;
|
|
if (!appendSlash)
|
|
B.JSArray_methods.add$1(output, segment);
|
|
}
|
|
}
|
|
if (appendSlash)
|
|
B.JSArray_methods.add$1(output, "");
|
|
return B.JSArray_methods.join$1(output, "/");
|
|
},
|
|
_Uri__normalizeRelativePath(path, allowScheme) {
|
|
var output, t1, t2, appendSlash, _i, segment;
|
|
if (!A._Uri__mayContainDotSegments(path))
|
|
return !allowScheme ? A._Uri__escapeScheme(path) : path;
|
|
output = A._setArrayType([], type$.JSArray_String);
|
|
for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) {
|
|
segment = t1[_i];
|
|
if (".." === segment) {
|
|
appendSlash = output.length !== 0 && B.JSArray_methods.get$last(output) !== "..";
|
|
if (appendSlash) {
|
|
if (0 >= output.length)
|
|
return A.ioore(output, -1);
|
|
output.pop();
|
|
} else
|
|
B.JSArray_methods.add$1(output, "..");
|
|
} else {
|
|
appendSlash = "." === segment;
|
|
if (!appendSlash)
|
|
B.JSArray_methods.add$1(output, segment);
|
|
}
|
|
}
|
|
t1 = output.length;
|
|
if (t1 !== 0)
|
|
if (t1 === 1) {
|
|
if (0 >= t1)
|
|
return A.ioore(output, 0);
|
|
t1 = output[0].length === 0;
|
|
} else
|
|
t1 = false;
|
|
else
|
|
t1 = true;
|
|
if (t1)
|
|
return "./";
|
|
if (appendSlash || B.JSArray_methods.get$last(output) === "..")
|
|
B.JSArray_methods.add$1(output, "");
|
|
if (!allowScheme) {
|
|
if (0 >= output.length)
|
|
return A.ioore(output, 0);
|
|
B.JSArray_methods.$indexSet(output, 0, A._Uri__escapeScheme(output[0]));
|
|
}
|
|
return B.JSArray_methods.join$1(output, "/");
|
|
},
|
|
_Uri__escapeScheme(path) {
|
|
var i, char, t2,
|
|
_s128_ = string$.______,
|
|
t1 = path.length;
|
|
if (t1 >= 2 && A._Uri__isAlphabeticCharacter(path.charCodeAt(0)))
|
|
for (i = 1; i < t1; ++i) {
|
|
char = path.charCodeAt(i);
|
|
if (char === 58)
|
|
return B.JSString_methods.substring$2(path, 0, i) + "%3A" + B.JSString_methods.substring$1(path, i + 1);
|
|
if (char <= 127) {
|
|
if (!(char < 128))
|
|
return A.ioore(_s128_, char);
|
|
t2 = (_s128_.charCodeAt(char) & 8) === 0;
|
|
} else
|
|
t2 = true;
|
|
if (t2)
|
|
break;
|
|
}
|
|
return path;
|
|
},
|
|
_Uri__packageNameEnd(uri, path) {
|
|
if (uri.isScheme$1("package") && uri._core$_host == null)
|
|
return A._skipPackageNameChars(path, 0, path.length);
|
|
return -1;
|
|
},
|
|
_Uri__isAlphabeticCharacter(codeUnit) {
|
|
var lowerCase = codeUnit | 32;
|
|
return 97 <= lowerCase && lowerCase <= 122;
|
|
},
|
|
UriData__parse(text, start, sourceUri) {
|
|
var t1, i, slashIndex, char, equalsIndex, lastSeparator, t2, data,
|
|
_s17_ = "Invalid MIME type",
|
|
indices = A._setArrayType([start - 1], type$.JSArray_int);
|
|
for (t1 = text.length, i = start, slashIndex = -1, char = null; i < t1; ++i) {
|
|
char = text.charCodeAt(i);
|
|
if (char === 44 || char === 59)
|
|
break;
|
|
if (char === 47) {
|
|
if (slashIndex < 0) {
|
|
slashIndex = i;
|
|
continue;
|
|
}
|
|
throw A.wrapException(A.FormatException$(_s17_, text, i));
|
|
}
|
|
}
|
|
if (slashIndex < 0 && i > start)
|
|
throw A.wrapException(A.FormatException$(_s17_, text, i));
|
|
for (; char !== 44;) {
|
|
B.JSArray_methods.add$1(indices, i);
|
|
++i;
|
|
for (equalsIndex = -1; i < t1; ++i) {
|
|
if (!(i >= 0))
|
|
return A.ioore(text, i);
|
|
char = text.charCodeAt(i);
|
|
if (char === 61) {
|
|
if (equalsIndex < 0)
|
|
equalsIndex = i;
|
|
} else if (char === 59 || char === 44)
|
|
break;
|
|
}
|
|
if (equalsIndex >= 0)
|
|
B.JSArray_methods.add$1(indices, equalsIndex);
|
|
else {
|
|
lastSeparator = B.JSArray_methods.get$last(indices);
|
|
if (char !== 44 || i !== lastSeparator + 7 || !B.JSString_methods.startsWith$2(text, "base64", lastSeparator + 1))
|
|
throw A.wrapException(A.FormatException$("Expecting '='", text, i));
|
|
break;
|
|
}
|
|
}
|
|
B.JSArray_methods.add$1(indices, i);
|
|
t2 = i + 1;
|
|
if ((indices.length & 1) === 1)
|
|
text = B.C_Base64Codec.normalize$3(text, t2, t1);
|
|
else {
|
|
data = A._Uri__normalize(text, t2, t1, 256, true, false);
|
|
if (data != null)
|
|
text = B.JSString_methods.replaceRange$3(text, t2, t1, data);
|
|
}
|
|
return new A.UriData(text, indices, sourceUri);
|
|
},
|
|
_scan(uri, start, end, state, indices) {
|
|
var t1, i, char, t2, transition,
|
|
_s2112_ = '\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xe1\xe1\x01\xe1\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xe3\xe1\xe1\x01\xe1\x01\xe1\xcd\x01\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x0e\x03\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"\x01\xe1\x01\xe1\xac\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xe1\xe1\x01\xe1\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xea\xe1\xe1\x01\xe1\x01\xe1\xcd\x01\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\n\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"\x01\xe1\x01\xe1\xac\xeb\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\xeb\xeb\xeb\x8b\xeb\xeb\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\xeb\x83\xeb\xeb\x8b\xeb\x8b\xeb\xcd\x8b\xeb\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x92\x83\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\x8b\xeb\x8b\xeb\x8b\xeb\xac\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xebD\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\x12D\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xe5\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\xe5\xe5\xe5\x05\xe5D\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe8\x8a\xe5\xe5\x05\xe5\x05\xe5\xcd\x05\xe5\x05\x05\x05\x05\x05\x05\x05\x05\x05\x8a\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05f\x05\xe5\x05\xe5\xac\xe5\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\xe5\xe5\xe5\x05\xe5D\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\xe5\x8a\xe5\xe5\x05\xe5\x05\xe5\xcd\x05\xe5\x05\x05\x05\x05\x05\x05\x05\x05\x05\x8a\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05f\x05\xe5\x05\xe5\xac\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7D\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\x8a\xe7\xe7\xe7\xe7\xe7\xe7\xcd\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\x8a\xe7\x07\x07\x07\x07\x07\x07\x07\x07\x07\xe7\xe7\xe7\xe7\xe7\xac\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7D\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\x8a\xe7\xe7\xe7\xe7\xe7\xe7\xcd\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\xe7\x8a\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\xe7\xe7\xe7\xe7\xe7\xac\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\x05\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xea\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\x10\xea\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xea\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\x12\n\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xea\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\v\n\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xec\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\xec\xec\xec\f\xec\xec\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\xec\xec\xec\xec\f\xec\f\xec\xcd\f\xec\f\f\f\f\f\f\f\f\f\xec\f\f\f\f\f\f\f\f\f\f\xec\f\xec\f\xec\f\xed\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\xed\xed\xed\r\xed\xed\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\xed\xed\xed\xed\r\xed\r\xed\xed\r\xed\r\r\r\r\r\r\r\r\r\xed\r\r\r\r\r\r\r\r\r\r\xed\r\xed\r\xed\r\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xe1\xe1\x01\xe1\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xea\xe1\xe1\x01\xe1\x01\xe1\xcd\x01\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x0f\xea\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"\x01\xe1\x01\xe1\xac\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xe1\xe1\x01\xe1\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xe1\xe9\xe1\xe1\x01\xe1\x01\xe1\xcd\x01\xe1\x01\x01\x01\x01\x01\x01\x01\x01\x01\t\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"\x01\xe1\x01\xe1\xac\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xea\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\x11\xea\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xe9\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\v\t\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xea\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\x13\xea\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xeb\xeb\v\xeb\xeb\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\xeb\xea\xeb\xeb\v\xeb\v\xeb\xcd\v\xeb\v\v\v\v\v\v\v\v\v\xea\v\v\v\v\v\v\v\v\v\v\xeb\v\xeb\v\xeb\xac\xf5\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\x15\xf5\x15\x15\xf5\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\xf5\xf5\xf5\xf5\xf5\xf5';
|
|
for (t1 = uri.length, i = start; i < end; ++i) {
|
|
if (!(i < t1))
|
|
return A.ioore(uri, i);
|
|
char = uri.charCodeAt(i) ^ 96;
|
|
if (char > 95)
|
|
char = 31;
|
|
t2 = state * 96 + char;
|
|
if (!(t2 < 2112))
|
|
return A.ioore(_s2112_, t2);
|
|
transition = _s2112_.charCodeAt(t2);
|
|
state = transition & 31;
|
|
B.JSArray_methods.$indexSet(indices, transition >>> 5, i);
|
|
}
|
|
return state;
|
|
},
|
|
_SimpleUri__packageNameEnd(uri) {
|
|
if (uri._schemeEnd === 7 && B.JSString_methods.startsWith$1(uri._core$_uri, "package") && uri._hostStart <= 0)
|
|
return A._skipPackageNameChars(uri._core$_uri, uri._pathStart, uri._queryStart);
|
|
return -1;
|
|
},
|
|
_skipPackageNameChars(source, start, end) {
|
|
var t1, i, dots, char;
|
|
for (t1 = source.length, i = start, dots = 0; i < end; ++i) {
|
|
if (!(i >= 0 && i < t1))
|
|
return A.ioore(source, i);
|
|
char = source.charCodeAt(i);
|
|
if (char === 47)
|
|
return dots !== 0 ? i : -1;
|
|
if (char === 37 || char === 58)
|
|
return -1;
|
|
dots |= char ^ 46;
|
|
}
|
|
return -1;
|
|
},
|
|
_caseInsensitiveCompareStart(prefix, string, start) {
|
|
var t1, t2, result, i, t3, stringChar, delta, lowerChar;
|
|
for (t1 = prefix.length, t2 = string.length, result = 0, i = 0; i < t1; ++i) {
|
|
t3 = start + i;
|
|
if (!(t3 < t2))
|
|
return A.ioore(string, t3);
|
|
stringChar = string.charCodeAt(t3);
|
|
delta = prefix.charCodeAt(i) ^ stringChar;
|
|
if (delta !== 0) {
|
|
if (delta === 32) {
|
|
lowerChar = stringChar | delta;
|
|
if (97 <= lowerChar && lowerChar <= 122) {
|
|
result = 32;
|
|
continue;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
}
|
|
return result;
|
|
},
|
|
DateTime: function DateTime(t0, t1, t2) {
|
|
this._core$_value = t0;
|
|
this._microsecond = t1;
|
|
this.isUtc = t2;
|
|
},
|
|
Duration: function Duration(t0) {
|
|
this._duration = t0;
|
|
},
|
|
_Enum: function _Enum() {
|
|
},
|
|
Error: function Error() {
|
|
},
|
|
AssertionError: function AssertionError(t0) {
|
|
this.message = t0;
|
|
},
|
|
TypeError: function TypeError() {
|
|
},
|
|
ArgumentError: function ArgumentError(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._hasValue = t0;
|
|
_.invalidValue = t1;
|
|
_.name = t2;
|
|
_.message = t3;
|
|
},
|
|
RangeError: function RangeError(t0, t1, t2, t3, t4, t5) {
|
|
var _ = this;
|
|
_.start = t0;
|
|
_.end = t1;
|
|
_._hasValue = t2;
|
|
_.invalidValue = t3;
|
|
_.name = t4;
|
|
_.message = t5;
|
|
},
|
|
IndexError: function IndexError(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_.length = t0;
|
|
_._hasValue = t1;
|
|
_.invalidValue = t2;
|
|
_.name = t3;
|
|
_.message = t4;
|
|
},
|
|
UnsupportedError: function UnsupportedError(t0) {
|
|
this.message = t0;
|
|
},
|
|
UnimplementedError: function UnimplementedError(t0) {
|
|
this.message = t0;
|
|
},
|
|
StateError: function StateError(t0) {
|
|
this.message = t0;
|
|
},
|
|
ConcurrentModificationError: function ConcurrentModificationError(t0) {
|
|
this.modifiedObject = t0;
|
|
},
|
|
OutOfMemoryError: function OutOfMemoryError() {
|
|
},
|
|
StackOverflowError: function StackOverflowError() {
|
|
},
|
|
_Exception: function _Exception(t0) {
|
|
this.message = t0;
|
|
},
|
|
FormatException: function FormatException(t0, t1, t2) {
|
|
this.message = t0;
|
|
this.source = t1;
|
|
this.offset = t2;
|
|
},
|
|
Iterable: function Iterable() {
|
|
},
|
|
Null: function Null() {
|
|
},
|
|
Object: function Object() {
|
|
},
|
|
_StringStackTrace: function _StringStackTrace() {
|
|
},
|
|
Stopwatch: function Stopwatch() {
|
|
this._stop = this._core$_start = 0;
|
|
},
|
|
StringBuffer: function StringBuffer(t0) {
|
|
this._contents = t0;
|
|
},
|
|
Uri__parseIPv4Address_error: function Uri__parseIPv4Address_error(t0) {
|
|
this.host = t0;
|
|
},
|
|
Uri_parseIPv6Address_error: function Uri_parseIPv6Address_error(t0) {
|
|
this.host = t0;
|
|
},
|
|
Uri_parseIPv6Address_parseHex: function Uri_parseIPv6Address_parseHex(t0, t1) {
|
|
this.error = t0;
|
|
this.host = t1;
|
|
},
|
|
_Uri: function _Uri(t0, t1, t2, t3, t4, t5, t6) {
|
|
var _ = this;
|
|
_.scheme = t0;
|
|
_._userInfo = t1;
|
|
_._core$_host = t2;
|
|
_._core$_port = t3;
|
|
_.path = t4;
|
|
_._query = t5;
|
|
_._fragment = t6;
|
|
_.___Uri_hashCode_FI = _.___Uri__text_FI = $;
|
|
},
|
|
UriData: function UriData(t0, t1, t2) {
|
|
this._text = t0;
|
|
this._separatorIndices = t1;
|
|
this._uriCache = t2;
|
|
},
|
|
_SimpleUri: function _SimpleUri(t0, t1, t2, t3, t4, t5, t6, t7) {
|
|
var _ = this;
|
|
_._core$_uri = t0;
|
|
_._schemeEnd = t1;
|
|
_._hostStart = t2;
|
|
_._portStart = t3;
|
|
_._pathStart = t4;
|
|
_._queryStart = t5;
|
|
_._fragmentStart = t6;
|
|
_._schemeCache = t7;
|
|
_._hashCodeCache = null;
|
|
},
|
|
_DataUri: function _DataUri(t0, t1, t2, t3, t4, t5, t6) {
|
|
var _ = this;
|
|
_.scheme = t0;
|
|
_._userInfo = t1;
|
|
_._core$_host = t2;
|
|
_._core$_port = t3;
|
|
_.path = t4;
|
|
_._query = t5;
|
|
_._fragment = t6;
|
|
_.___Uri_hashCode_FI = _.___Uri__text_FI = $;
|
|
},
|
|
_getNextTaskId() {
|
|
var t1 = $._taskId;
|
|
$._taskId = t1 + 1;
|
|
return t1;
|
|
},
|
|
_createEventName(isBeginEvent, isEndEvent, $name, taskId) {
|
|
if (isBeginEvent)
|
|
return "" + taskId + "-" + $name + "-begin";
|
|
if (isEndEvent)
|
|
return "" + taskId + "-" + $name + "-end";
|
|
return $name;
|
|
},
|
|
_postfixWithCount(eventName) {
|
|
var count = $._eventNameToCount.$index(0, eventName);
|
|
if (count == null)
|
|
return eventName;
|
|
return eventName + "-" + A.S(count);
|
|
},
|
|
_decrementEventCount(eventName) {
|
|
var t1, newCount;
|
|
if (!$._eventNameToCount.containsKey$1(eventName))
|
|
return;
|
|
t1 = $._eventNameToCount.$index(0, eventName);
|
|
t1.toString;
|
|
newCount = t1 - 1;
|
|
t1 = $._eventNameToCount;
|
|
if (newCount <= 0)
|
|
t1.remove$1(0, eventName);
|
|
else
|
|
t1.$indexSet(0, eventName, newCount);
|
|
},
|
|
_reportTaskEvent(taskId, flowId, type, $name, argumentsAsJson) {
|
|
var isBeginEvent, isEndEvent, currentEventName, currentCount, t1, beginEventName;
|
|
if (type === 9 || type === 11 || type === 10)
|
|
return;
|
|
if ($._markAndMeasureEntryCount > 10000 && $._eventNameToCount.__js_helper$_length === 0) {
|
|
$.$get$_performance().clearMarks();
|
|
$.$get$_performance().clearMeasures();
|
|
$._markAndMeasureEntryCount = 0;
|
|
}
|
|
isBeginEvent = type === 1 || type === 5;
|
|
isEndEvent = type === 2 || type === 7;
|
|
currentEventName = A._createEventName(isBeginEvent, isEndEvent, $name, taskId);
|
|
if (isBeginEvent) {
|
|
currentCount = $._eventNameToCount.$index(0, currentEventName);
|
|
if (currentCount == null)
|
|
currentCount = 0;
|
|
$._eventNameToCount.$indexSet(0, currentEventName, currentCount + 1);
|
|
currentEventName = A._postfixWithCount(currentEventName);
|
|
}
|
|
t1 = $.$get$_performance();
|
|
t1.toString;
|
|
t1.mark(currentEventName, A._asJSObject($.$get$_json().parse(argumentsAsJson)));
|
|
$._markAndMeasureEntryCount = $._markAndMeasureEntryCount + 1;
|
|
if (isEndEvent) {
|
|
beginEventName = A._createEventName(true, false, $name, taskId);
|
|
t1 = $.$get$_performance();
|
|
t1.toString;
|
|
t1.measure($name, A._postfixWithCount(beginEventName), currentEventName);
|
|
$._markAndMeasureEntryCount = $._markAndMeasureEntryCount + 1;
|
|
A._decrementEventCount(beginEventName);
|
|
}
|
|
B.JSInt_methods.clamp$2($._markAndMeasureEntryCount, 0, 10001);
|
|
},
|
|
_argumentsAsJson($arguments) {
|
|
if ($arguments == null || $arguments.__js_helper$_length === 0)
|
|
return "{}";
|
|
return B.C_JsonCodec.encode$1($arguments);
|
|
},
|
|
_performance_closure: function _performance_closure() {
|
|
},
|
|
_json_closure: function _json_closure() {
|
|
},
|
|
TimelineTask: function TimelineTask(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._developer$_parent = t0;
|
|
_._filterKey = t1;
|
|
_._taskId = t2;
|
|
_._stack = t3;
|
|
},
|
|
_AsyncBlock: function _AsyncBlock(t0, t1) {
|
|
this.name = t0;
|
|
this._taskId = t1;
|
|
},
|
|
_Namespace__namespacePointer() {
|
|
throw A.wrapException(A.UnsupportedError$("_Namespace"));
|
|
},
|
|
_RandomAccessFileOps__RandomAccessFileOps$_(pointer) {
|
|
throw A.wrapException(A.UnsupportedError$("RandomAccessFile"));
|
|
},
|
|
_Platform__operatingSystem() {
|
|
throw A.wrapException(A.UnsupportedError$("Platform._operatingSystem"));
|
|
},
|
|
_Platform__environment() {
|
|
throw A.wrapException(A.UnsupportedError$("Platform._environment"));
|
|
},
|
|
_Platform__version() {
|
|
throw A.wrapException(A.UnsupportedError$("Platform._version"));
|
|
},
|
|
InternetAddress__cloneWithNewHost(address, host) {
|
|
throw A.wrapException(A.UnsupportedError$("InternetAddress._cloneWithNewHost"));
|
|
},
|
|
RawSocket_startConnect(host, port) {
|
|
throw A.wrapException(A.UnsupportedError$("RawSocket constructor"));
|
|
},
|
|
Socket__startConnect(host, port, sourceAddress, sourcePort) {
|
|
throw A.wrapException(A.UnsupportedError$("Socket constructor"));
|
|
},
|
|
SecureSocket_SecureSocket$_(rawSocket) {
|
|
throw A.wrapException(A.UnsupportedError$("SecureSocket constructor"));
|
|
},
|
|
SecurityContext_defaultContext() {
|
|
throw A.wrapException(A.UnsupportedError$("default SecurityContext getter"));
|
|
},
|
|
_SecureFilter__SecureFilter$_() {
|
|
throw A.wrapException(A.UnsupportedError$("_SecureFilter._SecureFilter"));
|
|
},
|
|
RawZLibFilter__makeZLibInflateFilter(gzip, windowBits, dictionary, raw) {
|
|
throw A.wrapException(A.UnsupportedError$("_newZLibInflateFilter"));
|
|
},
|
|
_IOService__dispatch(request, data) {
|
|
throw A.wrapException(A.UnsupportedError$("_IOService._dispatch"));
|
|
},
|
|
_checkForErrorResponse(response, message, path) {
|
|
var t1;
|
|
if (type$.List_dynamic._is(response) && !J.$eq$(J.$index$asx(response, 0), 0)) {
|
|
t1 = J.getInterceptor$asx(response);
|
|
switch (t1.$index(response, 0)) {
|
|
case 1:
|
|
throw A.wrapException(A.ArgumentError$(message + ": " + path, null));
|
|
case 2:
|
|
throw A.wrapException(A.FileSystemException_FileSystemException$_fromOSError(new A.OSError(A._asString(t1.$index(response, 2)), A._asInt(t1.$index(response, 1))), message, path));
|
|
case 3:
|
|
throw A.wrapException(A.FileSystemException$("File closed", path, null));
|
|
default:
|
|
throw A.wrapException(A.AssertionError$("Unknown error"));
|
|
}
|
|
}
|
|
},
|
|
_ensureFastAndSerializableByteData(buffer, start, end) {
|
|
var $length, newBuffer;
|
|
if (type$.Uint8List._is(buffer) && J.get$lengthInBytes$x(B.NativeUint8List_methods.get$buffer(buffer)) === buffer.length)
|
|
return new A._BufferAndStart(buffer, start);
|
|
$length = end - start;
|
|
newBuffer = new Uint8Array($length);
|
|
B.NativeUint8List_methods.setRange$4(newBuffer, 0, $length, buffer, start);
|
|
return new A._BufferAndStart(newBuffer, 0);
|
|
},
|
|
_validateZLibWindowBits(windowBits) {
|
|
if (8 > windowBits || 15 < windowBits)
|
|
throw A.wrapException(A.RangeError$range(windowBits, 8, 15, null, null));
|
|
},
|
|
File_File(path) {
|
|
var t1;
|
|
A.IOOverrides_current();
|
|
A.ArgumentError_checkNotNull(path, "path", type$.String);
|
|
t1 = A.FileSystemEntity__toNullTerminatedUtf8Array(B.C_Utf8Encoder.convert$1(path));
|
|
return new A._File(path, t1);
|
|
},
|
|
FileSystemException$(message, path, osError) {
|
|
return new A.FileSystemException(message, path, osError);
|
|
},
|
|
FileSystemException_FileSystemException$_fromOSError(err, message, path) {
|
|
if ($.$get$Platform_isWindows())
|
|
switch (err.errorCode) {
|
|
case 5:
|
|
case 16:
|
|
case 19:
|
|
case 24:
|
|
case 32:
|
|
case 33:
|
|
case 65:
|
|
case 108:
|
|
return new A.PathAccessException(message, path, err);
|
|
case 80:
|
|
case 183:
|
|
return new A.PathExistsException(message, path, err);
|
|
case 2:
|
|
case 3:
|
|
case 15:
|
|
case 123:
|
|
case 18:
|
|
case 53:
|
|
case 67:
|
|
case 161:
|
|
case 206:
|
|
return new A.PathNotFoundException(message, path, err);
|
|
default:
|
|
return new A.FileSystemException(message, path, err);
|
|
}
|
|
else
|
|
switch (err.errorCode) {
|
|
case 1:
|
|
case 13:
|
|
return new A.PathAccessException(message, path, err);
|
|
case 17:
|
|
return new A.PathExistsException(message, path, err);
|
|
case 2:
|
|
return new A.PathNotFoundException(message, path, err);
|
|
default:
|
|
return new A.FileSystemException(message, path, err);
|
|
}
|
|
},
|
|
_File__namespacePointer() {
|
|
return A._Namespace__namespacePointer();
|
|
},
|
|
_File__dispatchWithNamespace(request, data) {
|
|
B.JSArray_methods.$indexSet(data, 0, A._File__namespacePointer());
|
|
},
|
|
FileSystemEntity__toNullTerminatedUtf8Array(l) {
|
|
var t2, tmp,
|
|
t1 = l.length;
|
|
if (t1 !== 0) {
|
|
t2 = t1 - 1;
|
|
if (!(t2 >= 0))
|
|
return A.ioore(l, t2);
|
|
t2 = l[t2] !== 0;
|
|
} else
|
|
t2 = true;
|
|
if (t2) {
|
|
tmp = new Uint8Array(t1 + 1);
|
|
B.NativeUint8List_methods.setRange$3(tmp, 0, t1, l);
|
|
return tmp;
|
|
} else
|
|
return l;
|
|
},
|
|
IOOverrides_current() {
|
|
$.$get$_ioOverridesToken();
|
|
return null;
|
|
},
|
|
_Platform_operatingSystem() {
|
|
return A._Platform__operatingSystem();
|
|
},
|
|
_Platform_environment() {
|
|
var t1 = $._Platform__environmentCache;
|
|
if (t1 == null)
|
|
A._Platform__environment();
|
|
t1.toString;
|
|
type$.Map_String_String._as(t1);
|
|
return t1;
|
|
},
|
|
_Platform_version() {
|
|
return A._Platform__version();
|
|
},
|
|
SecureSocket_startConnect(host, port, context, keyLog, onBadCertificate) {
|
|
return A.RawSecureSocket_startConnect(host, port, context, keyLog, onBadCertificate, null).then$1$1(new A.SecureSocket_startConnect_closure(), type$.ConnectionTask_SecureSocket);
|
|
},
|
|
SecureSocket_secure(socket, context, host, onBadCertificate) {
|
|
return socket._detachRaw$0().then$1$1(new A.SecureSocket_secure_closure(host, context, onBadCertificate, null, null), type$.RawSecureSocket).then$1$1(new A.SecureSocket_secure_closure0(), type$.SecureSocket);
|
|
},
|
|
RawSecureSocket_startConnect(host, port, context, keyLog, onBadCertificate, supportedProtocols) {
|
|
return A.RawSocket_startConnect(host, port).then$1$1(new A.RawSecureSocket_startConnect_closure(context, onBadCertificate, keyLog, supportedProtocols), type$.ConnectionTask_RawSecureSocket);
|
|
},
|
|
RawSecureSocket_secure(socket, context, host, keyLog, onBadCertificate, subscription, supportedProtocols) {
|
|
var t1, t2, address;
|
|
socket.set$readEventsEnabled(false);
|
|
socket.set$writeEventsEnabled(false);
|
|
host = host != null ? host : socket.get$address().get$host();
|
|
t1 = socket.get$port();
|
|
A.ArgumentError_checkNotNull(t1, "requestedPort", type$.int);
|
|
if (t1.$lt(0, 0) || t1.$gt(0, 65535))
|
|
A.throwExpression(A.ArgumentError$("requestedPort is not in the range 0..65535", null));
|
|
t2 = type$.bool;
|
|
A.ArgumentError_checkNotNull(false, "requestClientCertificate", t2);
|
|
A.ArgumentError_checkNotNull(false, "requireClientCertificate", t2);
|
|
address = A.InternetAddress__cloneWithNewHost(socket.get$address(), host);
|
|
t2 = A.SecurityContext_defaultContext();
|
|
return A._RawSecureSocket$(address, t1, false, t2, socket, subscription, null, false, false, onBadCertificate, keyLog, supportedProtocols)._handshakeComplete.future;
|
|
},
|
|
_RawSecureSocket$(address, requestedPort, isServer, context, _socket, subscription, _bufferedData, requestClientCertificate, requireClientCertificate, onBadCertificate, keyLog, supportedProtocols) {
|
|
var t1 = $.Zone__current;
|
|
t1 = new A._RawSecureSocket(_socket, new A._AsyncCompleter(new A._Future(t1, type$._Future__RawSecureSocket), type$._AsyncCompleter__RawSecureSocket), A.StreamController_StreamController(true, type$.RawSocketEvent), _bufferedData, address, false, context, false, false, onBadCertificate, keyLog, new A._AsyncCompleter(new A._Future(t1, type$._Future_RawSecureSocket), type$._AsyncCompleter_RawSecureSocket), new A._FilterStatus(), A._SecureFilter__SecureFilter$_());
|
|
t1._RawSecureSocket$12(address, requestedPort, false, context, _socket, subscription, _bufferedData, false, false, onBadCertificate, keyLog, supportedProtocols);
|
|
return t1;
|
|
},
|
|
HandshakeException$(message) {
|
|
return new A.HandshakeException("HandshakeException", message, null);
|
|
},
|
|
SecurityContext__protocolsToLengthEncoding(protocols) {
|
|
return new Uint8Array(0);
|
|
},
|
|
Socket_startConnect(host, port) {
|
|
var t1;
|
|
A.IOOverrides_current();
|
|
t1 = A.Socket__startConnect(host, port, null, 0);
|
|
return t1;
|
|
},
|
|
SocketException$(message) {
|
|
return new A.SocketException(message);
|
|
},
|
|
OSError: function OSError(t0, t1) {
|
|
this.message = t0;
|
|
this.errorCode = t1;
|
|
},
|
|
_BufferAndStart: function _BufferAndStart(t0, t1) {
|
|
this.buffer = t0;
|
|
this.start = t1;
|
|
},
|
|
GZipCodec: function GZipCodec() {
|
|
},
|
|
ZLibDecoder: function ZLibDecoder(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_.gzip = t0;
|
|
_.windowBits = t1;
|
|
_.dictionary = t2;
|
|
_.raw = t3;
|
|
},
|
|
_ZLibDecoderSink: function _ZLibDecoderSink(t0, t1) {
|
|
var _ = this;
|
|
_._filter = t0;
|
|
_._io$_sink = t1;
|
|
_._closed = false;
|
|
_._empty = true;
|
|
},
|
|
_FilterSink: function _FilterSink() {
|
|
},
|
|
FileMode: function FileMode(t0) {
|
|
this._mode = t0;
|
|
},
|
|
FileSystemException: function FileSystemException(t0, t1, t2) {
|
|
this.message = t0;
|
|
this.path = t1;
|
|
this.osError = t2;
|
|
},
|
|
PathAccessException: function PathAccessException(t0, t1, t2) {
|
|
this.message = t0;
|
|
this.path = t1;
|
|
this.osError = t2;
|
|
},
|
|
PathExistsException: function PathExistsException(t0, t1, t2) {
|
|
this.message = t0;
|
|
this.path = t1;
|
|
this.osError = t2;
|
|
},
|
|
PathNotFoundException: function PathNotFoundException(t0, t1, t2) {
|
|
this.message = t0;
|
|
this.path = t1;
|
|
this.osError = t2;
|
|
},
|
|
_File: function _File(t0, t1) {
|
|
this._io$_path = t0;
|
|
this._rawPath = t1;
|
|
},
|
|
_File_open_closure: function _File_open_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_File_length_closure: function _File_length_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_File_readAsBytes_readUnsized: function _File_readAsBytes_readUnsized() {
|
|
},
|
|
_File_readAsBytes_readUnsized_read: function _File_readAsBytes_readUnsized_read(t0, t1, t2) {
|
|
this.file = t0;
|
|
this.builder = t1;
|
|
this.completer = t2;
|
|
},
|
|
_File_readAsBytes_readUnsized_read_closure: function _File_readAsBytes_readUnsized_read_closure(t0, t1, t2) {
|
|
this.builder = t0;
|
|
this.read = t1;
|
|
this.completer = t2;
|
|
},
|
|
_File_readAsBytes_readSized: function _File_readAsBytes_readSized() {
|
|
},
|
|
_File_readAsBytes_readSized_read: function _File_readAsBytes_readSized_read(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.file = t1;
|
|
_.length = t2;
|
|
_.completer = t3;
|
|
},
|
|
_File_readAsBytes_readSized_read_closure: function _File_readAsBytes_readSized_read_closure(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_._box_0 = t0;
|
|
_.read = t1;
|
|
_.length = t2;
|
|
_.completer = t3;
|
|
},
|
|
_File_readAsBytes_closure: function _File_readAsBytes_closure(t0, t1) {
|
|
this.readUnsized = t0;
|
|
this.readSized = t1;
|
|
},
|
|
_File_readAsBytes__closure: function _File_readAsBytes__closure(t0, t1, t2) {
|
|
this.readUnsized = t0;
|
|
this.file = t1;
|
|
this.readSized = t2;
|
|
},
|
|
_RandomAccessFile: function _RandomAccessFile(t0, t1) {
|
|
var _ = this;
|
|
_.path = t0;
|
|
_._asyncDispatched = false;
|
|
_.___RandomAccessFile__resourceInfo_A = $;
|
|
_._ops = t1;
|
|
_.closed = false;
|
|
},
|
|
_RandomAccessFile_close_closure: function _RandomAccessFile_close_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_RandomAccessFile_read_closure: function _RandomAccessFile_read_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
_RandomAccessFile_readInto_closure: function _RandomAccessFile_readInto_closure(t0, t1, t2) {
|
|
this.$this = t0;
|
|
this.buffer = t1;
|
|
this.start = t2;
|
|
},
|
|
_RandomAccessFile_length_closure: function _RandomAccessFile_length_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
FileSystemEntity: function FileSystemEntity() {
|
|
},
|
|
SecureSocket_startConnect_closure: function SecureSocket_startConnect_closure() {
|
|
},
|
|
SecureSocket_startConnect__closure: function SecureSocket_startConnect__closure() {
|
|
},
|
|
SecureSocket_secure_closure: function SecureSocket_secure_closure(t0, t1, t2, t3, t4) {
|
|
var _ = this;
|
|
_.host = t0;
|
|
_.context = t1;
|
|
_.onBadCertificate = t2;
|
|
_.keyLog = t3;
|
|
_.supportedProtocols = t4;
|
|
},
|
|
SecureSocket_secure_closure0: function SecureSocket_secure_closure0() {
|
|
},
|
|
RawSecureSocket_startConnect_closure: function RawSecureSocket_startConnect_closure(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_.context = t0;
|
|
_.onBadCertificate = t1;
|
|
_.keyLog = t2;
|
|
_.supportedProtocols = t3;
|
|
},
|
|
RawSecureSocket_startConnect__closure: function RawSecureSocket_startConnect__closure(t0, t1, t2, t3) {
|
|
var _ = this;
|
|
_.context = t0;
|
|
_.onBadCertificate = t1;
|
|
_.keyLog = t2;
|
|
_.supportedProtocols = t3;
|
|
},
|
|
_FilterStatus: function _FilterStatus() {
|
|
var _ = this;
|
|
_.progress = false;
|
|
_.writeEmpty = _.readEmpty = true;
|
|
_.writeEncryptedNoLongerEmpty = _.readEncryptedNoLongerFull = _.writePlaintextNoLongerFull = _.readPlaintextNoLongerEmpty = false;
|
|
},
|
|
_RawSecureSocket: function _RawSecureSocket(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) {
|
|
var _ = this;
|
|
_._io$_socket = t0;
|
|
_._handshakeComplete = t1;
|
|
_._io$_controller = t2;
|
|
_.___RawSecureSocket__socketSubscription_F = $;
|
|
_._bufferedData = t3;
|
|
_._bufferedDataIndex = 0;
|
|
_.address = t4;
|
|
_.isServer = t5;
|
|
_.context = t6;
|
|
_.requestClientCertificate = t7;
|
|
_.requireClientCertificate = t8;
|
|
_.onBadCertificate = t9;
|
|
_.keyLog = t10;
|
|
_.keyLogPort = null;
|
|
_._status = 201;
|
|
_._readEventsEnabled = _._writeEventsEnabled = true;
|
|
_._pauseCount = 0;
|
|
_._closedWrite = _._closedRead = _._socketClosedWrite = _._socketClosedRead = _._pendingReadEvent = false;
|
|
_._closeCompleter = t11;
|
|
_._filterStatus = t12;
|
|
_._connectPending = true;
|
|
_._filterActive = _._filterPending = false;
|
|
_._secureFilter = t13;
|
|
},
|
|
_RawSecureSocket__secureHandshakeCompleteHandler_closure: function _RawSecureSocket__secureHandshakeCompleteHandler_closure(t0) {
|
|
this.$this = t0;
|
|
},
|
|
TlsException: function TlsException() {
|
|
},
|
|
HandshakeException: function HandshakeException(t0, t1, t2) {
|
|
this.type = t0;
|
|
this.message = t1;
|
|
this.osError = t2;
|
|
},
|
|
SocketDirection: function SocketDirection() {
|
|
},
|
|
SocketOption: function SocketOption() {
|
|
},
|
|
RawSocketEvent: function RawSocketEvent(t0) {
|
|
this._io$_value = t0;
|
|
},
|
|
ConnectionTask: function ConnectionTask(t0, t1, t2) {
|
|
this.socket = t0;
|
|
this._io$_onCancel = t1;
|
|
this.$ti = t2;
|
|
},
|
|
SocketException: function SocketException(t0) {
|
|
this.message = t0;
|
|
},
|
|
printString(string) {
|
|
if (typeof dartPrint == "function") {
|
|
dartPrint(string);
|
|
return;
|
|
}
|
|
if (typeof console == "object" && typeof console.log != "undefined") {
|
|
console.log(string);
|
|
return;
|
|
}
|
|
if (typeof print == "function") {
|
|
print(string);
|
|
return;
|
|
}
|
|
throw "Unable to print message: " + String(string);
|
|
},
|
|
throwLateFieldNI(fieldName) {
|
|
throw A.initializeExceptionWrapper(A.LateError$fieldNI(fieldName), new Error());
|
|
},
|
|
throwLateFieldAI(fieldName) {
|
|
throw A.initializeExceptionWrapper(A.LateError$fieldAI(fieldName), new Error());
|
|
},
|
|
throwLateFieldADI(fieldName) {
|
|
throw A.initializeExceptionWrapper(A.LateError$fieldADI(fieldName), new Error());
|
|
},
|
|
JSAnyUtilityExtension_instanceOfString(_this, constructorName) {
|
|
var parts, $constructor, t1, _i, t2;
|
|
if (constructorName.length === 0)
|
|
return false;
|
|
parts = constructorName.split(".");
|
|
$constructor = init.G;
|
|
for (t1 = parts.length, _i = 0; _i < t1; ++_i, $constructor = t2) {
|
|
t2 = $constructor[parts[_i]];
|
|
A._asJSObjectQ(t2);
|
|
if (t2 == null)
|
|
return false;
|
|
}
|
|
return _this instanceof type$.JavaScriptFunction._as($constructor);
|
|
},
|
|
main() {
|
|
var $async$goto = 0,
|
|
$async$completer = A._makeAsyncAwaitCompleter(type$.void),
|
|
$async$returnValue, responseBody, json, routes, polyStr, index, len, lat, lng, poly, b, shift, result, dlat, dlng, finalLat, finalLng, pt, e, t1, apiKey, t2, request, response, t3, t4, dlat0, dlng0, _i, exception, $async$temp1;
|
|
var $async$main = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
|
|
if ($async$errorCode === 1)
|
|
return A._asyncRethrow($async$result, $async$completer);
|
|
while (true)
|
|
$async$outer:
|
|
switch ($async$goto) {
|
|
case 0:
|
|
// Function start
|
|
$async$temp1 = J;
|
|
$async$goto = 3;
|
|
return A._asyncAwait(A.File_File("functions/.env").readAsString$1$encoding(B.C_Utf8Codec).then$1$1(B.C_LineSplitter.get$convert(), type$.List_String), $async$main);
|
|
case 3:
|
|
// returning from await.
|
|
t1 = $async$temp1.get$iterator$ax($async$result), apiKey = "";
|
|
case 4:
|
|
// for condition
|
|
if (!t1.moveNext$0()) {
|
|
// goto after for
|
|
$async$goto = 5;
|
|
break;
|
|
}
|
|
t2 = t1.get$current();
|
|
if (B.JSString_methods.startsWith$1(t2, "API_MAPS=")) {
|
|
t2 = t2.split("=");
|
|
if (1 >= t2.length) {
|
|
$async$returnValue = A.ioore(t2, 1);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
}
|
|
t2 = t2[1];
|
|
apiKey = A.stringReplaceAllUnchecked(t2, '"', "");
|
|
}
|
|
// goto for condition
|
|
$async$goto = 4;
|
|
break;
|
|
case 5:
|
|
// after for
|
|
$async$goto = 6;
|
|
return A._asyncAwait(A.HttpClient_HttpClient()._openUrl$2("post", A.Uri_parse("https://routes.googleapis.com/directions/v2:computeRoutes")), $async$main);
|
|
case 6:
|
|
// returning from await.
|
|
request = $async$result;
|
|
t1 = request.headers;
|
|
t1.$set$2("Content-Type", "application/json");
|
|
t1.$set$2("X-Goog-Api-Key", apiKey);
|
|
t1.$set$2("X-Goog-FieldMask", "routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline");
|
|
t1 = type$.String;
|
|
request.write$1(B.C_JsonCodec.encode$2$toEncodable(A.LinkedHashMap_LinkedHashMap$_literal(["travelMode", "DRIVE", "routingPreference", "TRAFFIC_AWARE", "origin", A.LinkedHashMap_LinkedHashMap$_literal(["address", "401 route du camping, 69850 Saint Martin en haut"], t1, t1), "destination", A.LinkedHashMap_LinkedHashMap$_literal(["address", "25 Imp. du Puits du Suc, Saint-Martin-en-Haut, France"], t1, t1)], t1, type$.Object), null));
|
|
$async$goto = 7;
|
|
return A._asyncAwait(request.close$0(), $async$main);
|
|
case 7:
|
|
// returning from await.
|
|
response = $async$result;
|
|
$async$goto = 8;
|
|
return A._asyncAwait(A._instanceType(response)._eval$1("StreamTransformer<Stream.T,String>")._as(B.Utf8Decoder_false).bind$1(response).join$0(0), $async$main);
|
|
case 8:
|
|
// returning from await.
|
|
responseBody = $async$result;
|
|
try {
|
|
json = B.C_JsonCodec.decode$2$reviver(responseBody, null);
|
|
routes = type$.List_dynamic._as(J.$index$asx(json, "routes"));
|
|
polyStr = A._asString(J.$index$asx(J.$index$asx(J.$index$asx(routes, 0), "polyline"), "encodedPolyline"));
|
|
A.print("Polyline found. Length: " + J.get$length$asx(polyStr));
|
|
A.print("String: " + A.S(polyStr));
|
|
index = 0;
|
|
len = J.get$length$asx(polyStr);
|
|
lat = 0;
|
|
lng = 0;
|
|
poly = [];
|
|
t1 = type$.JSArray_double;
|
|
while (true) {
|
|
t2 = index;
|
|
t3 = len;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$lt();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
if (typeof t3 !== "number") {
|
|
$async$returnValue = A.iae(t3);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
if (!(t2 < t3))
|
|
break;
|
|
b = null;
|
|
shift = 0;
|
|
result = 0;
|
|
do {
|
|
t2 = index;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$add();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
index = t2 + 1;
|
|
b = J.codeUnitAt$1$s(polyStr, t2) - 63;
|
|
t2 = result;
|
|
t3 = b;
|
|
if (typeof t3 !== "number") {
|
|
$async$returnValue = t3.$and();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
t4 = shift;
|
|
if (typeof t4 !== "number") {
|
|
$async$returnValue = A.iae(t4);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
t4 = B.JSInt_methods.$shl(t3 & 31, t4);
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$or();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
result = (t2 | t4) >>> 0;
|
|
t4 = shift;
|
|
if (typeof t4 !== "number") {
|
|
$async$returnValue = t4.$add();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
shift = t4 + 5;
|
|
t2 = b;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$ge();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
} while (t2 >= 32);
|
|
t2 = result;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$and();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
if ((t2 & 1) !== 0) {
|
|
t2 = result;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$shr();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
dlat0 = ~B.JSNumber_methods._shrOtherPositive$1(t2, 1) >>> 0;
|
|
} else {
|
|
t2 = result;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$shr();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
dlat0 = B.JSNumber_methods._shrOtherPositive$1(t2, 1);
|
|
}
|
|
dlat = dlat0;
|
|
t2 = lat;
|
|
t3 = dlat;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$add();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
if (typeof t3 !== "number") {
|
|
$async$returnValue = A.iae(t3);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
lat = t2 + t3;
|
|
shift = 0;
|
|
result = 0;
|
|
do {
|
|
t2 = index;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$add();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
index = t2 + 1;
|
|
b = J.codeUnitAt$1$s(polyStr, t2) - 63;
|
|
t2 = result;
|
|
t3 = b;
|
|
if (typeof t3 !== "number") {
|
|
$async$returnValue = t3.$and();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
t4 = shift;
|
|
if (typeof t4 !== "number") {
|
|
$async$returnValue = A.iae(t4);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
t4 = B.JSInt_methods.$shl(t3 & 31, t4);
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$or();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
result = (t2 | t4) >>> 0;
|
|
t4 = shift;
|
|
if (typeof t4 !== "number") {
|
|
$async$returnValue = t4.$add();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
shift = t4 + 5;
|
|
t2 = b;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$ge();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
} while (t2 >= 32);
|
|
t2 = result;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$and();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
if ((t2 & 1) !== 0) {
|
|
t2 = result;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$shr();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
dlng0 = ~B.JSNumber_methods._shrOtherPositive$1(t2, 1) >>> 0;
|
|
} else {
|
|
t2 = result;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$shr();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
dlng0 = B.JSNumber_methods._shrOtherPositive$1(t2, 1);
|
|
}
|
|
dlng = dlng0;
|
|
t2 = lng;
|
|
t3 = dlng;
|
|
if (typeof t2 !== "number") {
|
|
$async$returnValue = t2.$add();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
if (typeof t3 !== "number") {
|
|
$async$returnValue = A.iae(t3);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
lng = t2 + t3;
|
|
t3 = lat;
|
|
if (typeof t3 !== "number") {
|
|
$async$returnValue = t3.$div();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
finalLat = t3 / 100000;
|
|
t3 = lng;
|
|
if (typeof t3 !== "number") {
|
|
$async$returnValue = t3.$div();
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
finalLng = t3 / 100000;
|
|
if (J.abs$0$in(finalLat) > 90 || J.abs$0$in(finalLng) > 180) {
|
|
A.printString("EXPLODED at index " + A.S(index) + ": " + A.S(finalLat) + ", " + A.S(finalLng));
|
|
break;
|
|
}
|
|
J.add$1$ax(poly, A._setArrayType([finalLat, finalLng], t1));
|
|
}
|
|
A.print("Decode complete. Points:");
|
|
for (t1 = poly, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) {
|
|
pt = t1[_i];
|
|
A.printString(A.S(pt));
|
|
}
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
A.print("Error: " + A.S(e));
|
|
}
|
|
case 1:
|
|
// return
|
|
return A._asyncReturn($async$returnValue, $async$completer);
|
|
}
|
|
});
|
|
return A._asyncStartSync($async$main, $async$completer);
|
|
}
|
|
},
|
|
B = {};
|
|
var holders = [A, J, B];
|
|
var $ = {};
|
|
A.JS_CONST.prototype = {};
|
|
A._httpConnectionHook_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
},
|
|
$signature: 90
|
|
};
|
|
A.SameSite.prototype = {
|
|
toString$0(_) {
|
|
return "SameSite=" + this.name;
|
|
}
|
|
};
|
|
A.HttpClientResponseCompressionState.prototype = {
|
|
_enumToString$0() {
|
|
return "HttpClientResponseCompressionState." + this._name;
|
|
}
|
|
};
|
|
A.HttpException.prototype = {
|
|
toString$0(_) {
|
|
var t1 = "HttpException: " + this.message,
|
|
uri = this.uri;
|
|
if (uri != null)
|
|
t1 += ", uri = " + uri.toString$0(0);
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
get$message() {
|
|
return this.message;
|
|
}
|
|
};
|
|
A.RedirectException.prototype = {
|
|
toString$0(_) {
|
|
return "RedirectException: " + this.message;
|
|
},
|
|
$isHttpException: 1,
|
|
get$message() {
|
|
return this.message;
|
|
}
|
|
};
|
|
A.HttpDate__parseCookieDate_error.prototype = {
|
|
call$0() {
|
|
throw A.wrapException(A.HttpException$("Invalid cookie date " + this.date, null));
|
|
},
|
|
$signature: 81
|
|
};
|
|
A.HttpDate__parseCookieDate_isEnd.prototype = {
|
|
call$0() {
|
|
return this._box_0.position === this.date.length;
|
|
},
|
|
$signature: 10
|
|
};
|
|
A.HttpDate__parseCookieDate_isDelimiter.prototype = {
|
|
call$1(s) {
|
|
var char;
|
|
if (0 >= s.length)
|
|
return A.ioore(s, 0);
|
|
char = s.charCodeAt(0);
|
|
if (char === 9)
|
|
return true;
|
|
if (char >= 32 && char <= 47)
|
|
return true;
|
|
if (char >= 59 && char <= 64)
|
|
return true;
|
|
if (char >= 91 && char <= 96)
|
|
return true;
|
|
if (char >= 123 && char <= 126)
|
|
return true;
|
|
return false;
|
|
},
|
|
$signature: 7
|
|
};
|
|
A.HttpDate__parseCookieDate_isNonDelimiter.prototype = {
|
|
call$1(s) {
|
|
var char;
|
|
if (0 >= s.length)
|
|
return A.ioore(s, 0);
|
|
char = s.charCodeAt(0);
|
|
if (char <= 8)
|
|
return true;
|
|
if (char >= 10 && char <= 31)
|
|
return true;
|
|
if (char >= 48 && char <= 57)
|
|
return true;
|
|
if (char === 58)
|
|
return true;
|
|
if (char >= 65 && char <= 90)
|
|
return true;
|
|
if (char >= 97 && char <= 122)
|
|
return true;
|
|
if (char >= 127 && char <= 255)
|
|
return true;
|
|
return false;
|
|
},
|
|
$signature: 7
|
|
};
|
|
A.HttpDate__parseCookieDate_isDigit.prototype = {
|
|
call$1(s) {
|
|
var char;
|
|
if (0 >= s.length)
|
|
return A.ioore(s, 0);
|
|
char = s.charCodeAt(0);
|
|
if (char > 47 && char < 58)
|
|
return true;
|
|
return false;
|
|
},
|
|
$signature: 7
|
|
};
|
|
A.HttpDate__parseCookieDate_getMonth.prototype = {
|
|
call$1(month) {
|
|
A._asString(month);
|
|
if (month.length < 3)
|
|
return -1;
|
|
return B.JSArray_methods.indexOf$1(B.List_OZ7, B.JSString_methods.substring$2(month, 0, 3));
|
|
},
|
|
$signature: 19
|
|
};
|
|
A.HttpDate__parseCookieDate_toInt.prototype = {
|
|
call$1(s) {
|
|
var t1, t2, index;
|
|
A._asString(s);
|
|
t1 = s.length;
|
|
t2 = this.isDigit;
|
|
index = 0;
|
|
while (true) {
|
|
if (!(index < t1 && t2.call$1(s[index])))
|
|
break;
|
|
++index;
|
|
}
|
|
return A.int_parse(B.JSString_methods.substring$2(s, 0, index), null);
|
|
},
|
|
$signature: 19
|
|
};
|
|
A._HttpHeaders.prototype = {
|
|
_HttpHeaders$3$defaultPortForScheme$initialHeaders(protocolVersion, defaultPortForScheme, initialHeaders) {
|
|
if (this.protocolVersion === "1.0")
|
|
this._chunkedTransferEncoding = this._persistentConnection = false;
|
|
},
|
|
$index(_, $name) {
|
|
return this._headers.$index(0, A._HttpHeaders__validateField($name));
|
|
},
|
|
value$1($name) {
|
|
var values, t1;
|
|
$name = A._HttpHeaders__validateField($name);
|
|
values = this._headers.$index(0, $name);
|
|
if (values == null)
|
|
return null;
|
|
t1 = J.getInterceptor$asx(values);
|
|
if (t1.get$length(values) > 1)
|
|
throw A.wrapException(A.HttpException$("More than one value for header " + $name, null));
|
|
return t1.$index(values, 0);
|
|
},
|
|
add$2(_, $name, value) {
|
|
var lowercaseName, t1;
|
|
if (!this._mutable)
|
|
A.throwExpression(A.HttpException$("HTTP headers are not mutable", null));
|
|
lowercaseName = A._HttpHeaders__validateField($name);
|
|
t1 = this._originalHeaderNames;
|
|
if (t1 != null)
|
|
t1.remove$1(0, lowercaseName);
|
|
this._addAll$2(lowercaseName, value);
|
|
},
|
|
_addAll$2($name, value) {
|
|
var t1, v;
|
|
if (type$.Iterable_dynamic._is(value))
|
|
for (t1 = J.get$iterator$ax(value); t1.moveNext$0();) {
|
|
v = t1.get$current();
|
|
this.__http$_add$2($name, A._HttpHeaders__validateValue(v == null ? A._asObject(v) : v));
|
|
}
|
|
else
|
|
this.__http$_add$2($name, A._HttpHeaders__validateValue(value));
|
|
},
|
|
$set$2($name, value) {
|
|
var lowercaseName, t1, _this = this;
|
|
if (!_this._mutable)
|
|
A.throwExpression(A.HttpException$("HTTP headers are not mutable", null));
|
|
lowercaseName = A._HttpHeaders__validateField($name);
|
|
_this._headers.remove$1(0, lowercaseName);
|
|
t1 = _this._originalHeaderNames;
|
|
if (t1 != null)
|
|
t1.remove$1(0, lowercaseName);
|
|
if (lowercaseName === "content-length")
|
|
_this._contentLength = -1;
|
|
if (lowercaseName === "transfer-encoding")
|
|
_this._chunkedTransferEncoding = false;
|
|
_this._addAll$2(lowercaseName, value);
|
|
},
|
|
removeAll$1($name) {
|
|
var t1;
|
|
if (!this._mutable)
|
|
A.throwExpression(A.HttpException$("HTTP headers are not mutable", null));
|
|
$name = A._HttpHeaders__validateField($name);
|
|
this._headers.remove$1(0, $name);
|
|
t1 = this._originalHeaderNames;
|
|
if (t1 != null)
|
|
t1.remove$1(0, $name);
|
|
},
|
|
forEach$1(_, action) {
|
|
this._headers.forEach$1(0, new A._HttpHeaders_forEach_closure(this, type$.void_Function_2_String_and_List_String._as(action)));
|
|
},
|
|
set$contentLength(contentLength) {
|
|
var t1, _this = this,
|
|
_s14_ = "content-length";
|
|
if (!_this._mutable)
|
|
A.throwExpression(A.HttpException$("HTTP headers are not mutable", null));
|
|
t1 = _this.protocolVersion;
|
|
if (t1 === "1.0" && _this._persistentConnection && contentLength === -1)
|
|
throw A.wrapException(A.HttpException$("Trying to clear ContentLength on HTTP 1.0 headers with 'Connection: Keep-Alive' set", null));
|
|
if (_this._contentLength === contentLength)
|
|
return;
|
|
_this._contentLength = contentLength;
|
|
if (contentLength >= 0) {
|
|
if (_this._chunkedTransferEncoding)
|
|
_this.set$chunkedTransferEncoding(false);
|
|
_this._headers.$indexSet(0, _s14_, A._setArrayType([B.JSInt_methods.toString$0(contentLength)], type$.JSArray_String));
|
|
} else {
|
|
_this._headers.remove$1(0, _s14_);
|
|
if (t1 === "1.1")
|
|
_this.set$chunkedTransferEncoding(true);
|
|
}
|
|
},
|
|
set$chunkedTransferEncoding(chunkedTransferEncoding) {
|
|
var values, $name, value, t1, t2, _this = this,
|
|
_s17_ = "transfer-encoding",
|
|
_s7_ = "chunked";
|
|
if (!_this._mutable)
|
|
A.throwExpression(A.HttpException$("HTTP headers are not mutable", null));
|
|
if (chunkedTransferEncoding && _this.protocolVersion === "1.0")
|
|
throw A.wrapException(A.HttpException$("Trying to set 'Transfer-Encoding: Chunked' on HTTP 1.0 headers", null));
|
|
if (chunkedTransferEncoding === _this._chunkedTransferEncoding)
|
|
return;
|
|
if (chunkedTransferEncoding) {
|
|
values = _this._headers.$index(0, _s17_);
|
|
if (values == null || !J.contains$1$asx(values, _s7_))
|
|
_this._addValue$2(_s17_, _s7_);
|
|
_this.set$contentLength(-1);
|
|
} else {
|
|
$name = A._HttpHeaders__validateField(_s17_);
|
|
value = A._HttpHeaders__validateValue(_s7_);
|
|
t1 = _this._headers;
|
|
values = t1.$index(0, $name);
|
|
if (values != null) {
|
|
t2 = J.getInterceptor$ax(values);
|
|
t2.remove$1(values, _this._valueToString$1(value));
|
|
if (t2.get$isEmpty(values)) {
|
|
t1.remove$1(0, $name);
|
|
t1 = _this._originalHeaderNames;
|
|
if (t1 != null)
|
|
t1.remove$1(0, $name);
|
|
}
|
|
}
|
|
if ($name === _s17_ && J.$eq$(value, _s7_))
|
|
_this._chunkedTransferEncoding = false;
|
|
}
|
|
_this._chunkedTransferEncoding = chunkedTransferEncoding;
|
|
},
|
|
get$contentType() {
|
|
var t1, result, index,
|
|
values = this._headers.$index(0, "content-type");
|
|
if (values != null) {
|
|
t1 = J.$index$asx(values, 0);
|
|
result = new A._ContentType();
|
|
result._HeaderValue$2("", B.Map_empty);
|
|
result._parse$4(t1, ";", null, false);
|
|
t1 = result._value;
|
|
index = B.JSString_methods.indexOf$1(t1, "/");
|
|
if (index === -1 || index === t1.length - 1)
|
|
B.JSString_methods.trim$0(t1);
|
|
else {
|
|
B.JSString_methods.trim$0(B.JSString_methods.substring$2(t1, 0, index));
|
|
B.JSString_methods.trim$0(B.JSString_methods.substring$1(t1, index + 1));
|
|
}
|
|
return result;
|
|
} else
|
|
return null;
|
|
},
|
|
__http$_add$2($name, value) {
|
|
var t1, _this = this, _null = null,
|
|
_s28_ = "HTTP headers are not mutable",
|
|
_s33_ = "Unexpected type for header named ",
|
|
_s39_ = "Content-Length must contain only digits",
|
|
_s17_ = "transfer-encoding",
|
|
_s17_0 = "if-modified-since";
|
|
switch ($name.length) {
|
|
case 4:
|
|
if ("date" === $name) {
|
|
if (value instanceof A.DateTime) {
|
|
if (!_this._mutable)
|
|
A.throwExpression(A.HttpException$(_s28_, _null));
|
|
_this._headers.$indexSet(0, "date", A._setArrayType([A.HttpDate_format(value.toUtc$0())], type$.JSArray_String));
|
|
} else if (typeof value == "string")
|
|
_this._headers.$indexSet(0, "date", A._setArrayType([value], type$.JSArray_String));
|
|
else
|
|
A.throwExpression(A.HttpException$(_s33_ + $name, _null));
|
|
return;
|
|
}
|
|
if ("host" === $name) {
|
|
_this._addHost$2($name, value);
|
|
return;
|
|
}
|
|
break;
|
|
case 7:
|
|
if ("expires" === $name) {
|
|
if (value instanceof A.DateTime) {
|
|
if (!_this._mutable)
|
|
A.throwExpression(A.HttpException$(_s28_, _null));
|
|
_this._headers.$indexSet(0, "expires", A._setArrayType([A.HttpDate_format(value.toUtc$0())], type$.JSArray_String));
|
|
} else if (typeof value == "string")
|
|
_this._headers.$indexSet(0, "expires", A._setArrayType([value], type$.JSArray_String));
|
|
else
|
|
A.throwExpression(A.HttpException$(_s33_ + $name, _null));
|
|
return;
|
|
}
|
|
break;
|
|
case 10:
|
|
if ("connection" === $name) {
|
|
_this._addConnection$2($name, A._asString(value));
|
|
return;
|
|
}
|
|
break;
|
|
case 12:
|
|
if ("content-type" === $name) {
|
|
_this._headers.$indexSet(0, "content-type", A._setArrayType([A._asString(value)], type$.JSArray_String));
|
|
return;
|
|
}
|
|
break;
|
|
case 14:
|
|
if ("content-length" === $name) {
|
|
if (A._isInt(value)) {
|
|
if (value < 0)
|
|
A.throwExpression(A.HttpException$(_s39_, _null));
|
|
} else if (typeof value == "string") {
|
|
t1 = $.$get$_digitsValidator();
|
|
if (!t1._nativeRegExp.test(value))
|
|
A.throwExpression(A.HttpException$(_s39_, _null));
|
|
value = A.int_parse(value, _null);
|
|
} else
|
|
A.throwExpression(A.HttpException$(_s33_ + $name, _null));
|
|
_this.set$contentLength(value);
|
|
return;
|
|
}
|
|
break;
|
|
case 17:
|
|
if (_s17_ === $name) {
|
|
if (J.$eq$(value, "chunked"))
|
|
_this.set$chunkedTransferEncoding(true);
|
|
else
|
|
_this._addValue$2(_s17_, value);
|
|
return;
|
|
}
|
|
if (_s17_0 === $name) {
|
|
if (value instanceof A.DateTime) {
|
|
if (!_this._mutable)
|
|
A.throwExpression(A.HttpException$(_s28_, _null));
|
|
_this._headers.$indexSet(0, _s17_0, A._setArrayType([A.HttpDate_format(value.toUtc$0())], type$.JSArray_String));
|
|
} else if (typeof value == "string")
|
|
_this._headers.$indexSet(0, _s17_0, A._setArrayType([value], type$.JSArray_String));
|
|
else
|
|
A.throwExpression(A.HttpException$(_s33_ + $name, _null));
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
_this._addValue$2($name, value);
|
|
},
|
|
_addHost$2($name, value) {
|
|
var pos, t1, exception, _this = this;
|
|
if (typeof value == "string") {
|
|
pos = B.JSString_methods.lastIndexOf$1(value, ":");
|
|
if (!J.$eq$(pos, -1))
|
|
t1 = B.JSString_methods.startsWith$1(value, "[") && B.JSString_methods.endsWith$1(value, "]");
|
|
else
|
|
t1 = true;
|
|
if (t1) {
|
|
_this._host = value;
|
|
_this._port = 80;
|
|
} else {
|
|
t1 = pos;
|
|
if (typeof t1 !== "number")
|
|
return t1.$gt();
|
|
if (t1 > 0)
|
|
_this._host = B.JSString_methods.substring$2(value, 0, pos);
|
|
else
|
|
_this._host = null;
|
|
t1 = pos;
|
|
if (typeof t1 !== "number")
|
|
return t1.$add();
|
|
if (t1 + 1 === value.length)
|
|
_this._port = 80;
|
|
else
|
|
try {
|
|
t1 = pos;
|
|
if (typeof t1 !== "number")
|
|
return t1.$add();
|
|
_this._port = A.int_parse(B.JSString_methods.substring$1(value, t1 + 1), null);
|
|
} catch (exception) {
|
|
if (A.unwrapException(exception) instanceof A.FormatException)
|
|
_this._port = null;
|
|
else
|
|
throw exception;
|
|
}
|
|
}
|
|
_this._headers.$indexSet(0, "host", A._setArrayType([value], type$.JSArray_String));
|
|
} else
|
|
throw A.wrapException(A.HttpException$("Unexpected type for header named " + $name, null));
|
|
},
|
|
_addConnection$2($name, value) {
|
|
var lowerCaseValue = value.toLowerCase();
|
|
if (lowerCaseValue === "close")
|
|
this._persistentConnection = false;
|
|
else if (lowerCaseValue === "keep-alive")
|
|
this._persistentConnection = true;
|
|
this._addValue$2($name, value);
|
|
},
|
|
_addValue$2($name, value) {
|
|
var t1 = this._headers,
|
|
values = t1.$index(0, $name);
|
|
if (values == null) {
|
|
values = A._setArrayType([], type$.JSArray_String);
|
|
t1.$indexSet(0, $name, values);
|
|
}
|
|
J.add$1$ax(values, this._valueToString$1(value));
|
|
},
|
|
_valueToString$1(value) {
|
|
if (value instanceof A.DateTime)
|
|
return A.HttpDate_format(value);
|
|
else if (typeof value == "string")
|
|
return value;
|
|
else
|
|
return A._asString(A._HttpHeaders__validateValue(J.toString$0$(value)));
|
|
},
|
|
_updateHostHeader$0() {
|
|
var t1, _this = this,
|
|
host = _this._host;
|
|
if (host != null) {
|
|
t1 = _this._port;
|
|
_this._headers.$indexSet(0, "host", A._setArrayType([t1 == null || t1 === _this._defaultPortForScheme ? host : host + ":" + A.S(t1)], type$.JSArray_String));
|
|
}
|
|
},
|
|
_foldHeader$1($name) {
|
|
if ($name === "set-cookie")
|
|
return false;
|
|
return true;
|
|
},
|
|
_build$2$skipZeroContentLength(builder, skipZeroContentLength) {
|
|
var ignoreHeader = this._contentLength === 0 && skipZeroContentLength ? "content-length" : null;
|
|
this._headers.forEach$1(0, new A._HttpHeaders__build_closure(this, ignoreHeader, builder));
|
|
},
|
|
toString$0(_) {
|
|
var t1,
|
|
sb = new A.StringBuffer("");
|
|
this._headers.forEach$1(0, new A._HttpHeaders_toString_closure(this, sb));
|
|
t1 = sb._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
_originalHeaderName$1($name) {
|
|
var t1 = this._originalHeaderNames;
|
|
t1 = t1 == null ? null : t1.$index(0, $name);
|
|
return t1 == null ? $name : t1;
|
|
},
|
|
$isHttpHeaders: 1
|
|
};
|
|
A._HttpHeaders_forEach_closure.prototype = {
|
|
call$2($name, values) {
|
|
A._asString($name);
|
|
type$.List_String._as(values);
|
|
this.action.call$2(this.$this._originalHeaderName$1($name), values);
|
|
},
|
|
$signature: 8
|
|
};
|
|
A._HttpHeaders__build_closure.prototype = {
|
|
call$2($name, values) {
|
|
var t1, originalName, fold, nameData, t2, i;
|
|
A._asString($name);
|
|
type$.List_String._as(values);
|
|
if (this.ignoreHeader === $name)
|
|
return;
|
|
t1 = this.$this;
|
|
originalName = t1._originalHeaderName$1($name);
|
|
fold = t1._foldHeader$1($name);
|
|
nameData = new A.CodeUnits(originalName);
|
|
t1 = this.builder;
|
|
t1.add$1(0, nameData);
|
|
t1.addByte$1(58);
|
|
t1.addByte$1(32);
|
|
for (t2 = J.getInterceptor$asx(values), i = 0; i < t2.get$length(values); ++i) {
|
|
if (i > 0)
|
|
if (fold) {
|
|
t1.addByte$1(44);
|
|
t1.addByte$1(32);
|
|
} else {
|
|
t1.addByte$1(13);
|
|
t1.addByte$1(10);
|
|
t1.add$1(0, nameData);
|
|
t1.addByte$1(58);
|
|
t1.addByte$1(32);
|
|
}
|
|
t1.add$1(0, new A.CodeUnits(t2.$index(values, i)));
|
|
}
|
|
t1.addByte$1(13);
|
|
t1.addByte$1(10);
|
|
},
|
|
$signature: 8
|
|
};
|
|
A._HttpHeaders_toString_closure.prototype = {
|
|
call$2($name, values) {
|
|
var t1, originalName, t2, fold, i, t3;
|
|
A._asString($name);
|
|
type$.List_String._as(values);
|
|
t1 = this.$this;
|
|
originalName = t1._originalHeaderName$1($name);
|
|
t2 = this.sb;
|
|
t2._contents = (t2._contents += originalName) + ": ";
|
|
fold = t1._foldHeader$1($name);
|
|
for (t1 = J.getInterceptor$asx(values), i = 0; i < t1.get$length(values); ++i) {
|
|
if (i > 0) {
|
|
t3 = t2._contents;
|
|
if (fold)
|
|
t2._contents = t3 + ", ";
|
|
else {
|
|
t3 += "\n";
|
|
t2._contents = t3;
|
|
t3 += originalName;
|
|
t2._contents = t3;
|
|
t2._contents = t3 + ": ";
|
|
}
|
|
}
|
|
t3 = t1.$index(values, i);
|
|
t2._contents += t3;
|
|
}
|
|
t2._contents += "\n";
|
|
},
|
|
$signature: 8
|
|
};
|
|
A._HeaderValue.prototype = {
|
|
_HeaderValue$2(_value, parameters) {
|
|
var t1 = parameters.get$length(parameters);
|
|
if (t1 !== 0)
|
|
this._parameters = A.HashMap_HashMap$from(parameters, type$.String, type$.nullable_String);
|
|
},
|
|
_ensureParameters$0() {
|
|
var t1 = this._parameters;
|
|
return t1 == null ? this._parameters = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.nullable_String) : t1;
|
|
},
|
|
get$parameters() {
|
|
var t1 = this._unmodifiableParameters;
|
|
return t1 == null ? this._unmodifiableParameters = new A.UnmodifiableMapView(this._ensureParameters$0(), type$.UnmodifiableMapView_of_String_and_nullable_String) : t1;
|
|
},
|
|
toString$0(_) {
|
|
var parameters, t1,
|
|
sb = new A.StringBuffer("");
|
|
sb._contents = this._value;
|
|
parameters = this._parameters;
|
|
if (parameters != null && parameters.get$isNotEmpty(parameters))
|
|
parameters.forEach$1(0, new A._HeaderValue_toString_closure(sb));
|
|
t1 = sb._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
_parse$4(s, parameterSeparator, valueSeparator, preserveBackslash) {
|
|
var t2, t3, t4, t5, t6, t1 = {};
|
|
t1.index = 0;
|
|
t2 = new A._HeaderValue__parse_done(t1, s);
|
|
t3 = new A._HeaderValue__parse_skipWS(t1, t2, s);
|
|
t4 = new A._HeaderValue__parse_parseValue(t1, t2, s, valueSeparator, parameterSeparator);
|
|
t5 = new A._HeaderValue__parse_maybeExpect(t1, t2, s);
|
|
t3.call$0();
|
|
this._value = t4.call$0();
|
|
t3.call$0();
|
|
if (t2.call$0())
|
|
return;
|
|
t6 = t1.index;
|
|
if (!(t6 < s.length))
|
|
return A.ioore(s, t6);
|
|
t5.call$1(parameterSeparator);
|
|
new A._HeaderValue__parse_parseParameters(t1, this, t2, s, parameterSeparator, valueSeparator, false, t4, t3, t5, new A._HeaderValue__parse_expect(t1, t2, s)).call$0();
|
|
}
|
|
};
|
|
A._HeaderValue_toString_closure.prototype = {
|
|
call$2($name, value) {
|
|
var t1, t2, t3, start, i, codeUnit;
|
|
A._asString($name);
|
|
A._asStringQ(value);
|
|
t1 = this.sb;
|
|
t2 = (t1._contents += "; ") + $name;
|
|
t1._contents = t2;
|
|
if (value != null) {
|
|
t1._contents = t2 + "=";
|
|
t2 = A._HeaderValue__isToken(value);
|
|
t3 = t1._contents;
|
|
if (t2)
|
|
t1._contents = t3 + value;
|
|
else {
|
|
t1._contents = t3 + '"';
|
|
for (t2 = value.length, start = 0, i = 0; i < t2; ++i) {
|
|
codeUnit = value.charCodeAt(i);
|
|
if (codeUnit === 92 || codeUnit === 34) {
|
|
t1._contents = (t1._contents += B.JSString_methods.substring$2(value, start, i)) + "\\";
|
|
start = i;
|
|
}
|
|
}
|
|
t1._contents = (t1._contents += B.JSString_methods.substring$1(value, start)) + '"';
|
|
}
|
|
}
|
|
},
|
|
$signature: 58
|
|
};
|
|
A._HeaderValue__parse_done.prototype = {
|
|
call$0() {
|
|
return this._box_0.index === this.s.length;
|
|
},
|
|
$signature: 10
|
|
};
|
|
A._HeaderValue__parse_skipWS.prototype = {
|
|
call$0() {
|
|
var t1, t2, t3, t4, t5, t6;
|
|
for (t1 = this.done, t2 = this._box_0, t3 = this.s, t4 = t3.length; !t1.call$0();) {
|
|
t5 = t2.index;
|
|
if (!(t5 < t4))
|
|
return A.ioore(t3, t5);
|
|
t6 = t3[t5];
|
|
if (t6 !== " " && t6 !== "\t")
|
|
return;
|
|
t2.index = t5 + 1;
|
|
}
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HeaderValue__parse_parseValue.prototype = {
|
|
call$0() {
|
|
var t2, t3, t4, t5, t6, char, t7, _this = this,
|
|
t1 = _this._box_0,
|
|
start = t1.index;
|
|
for (t2 = _this.done, t3 = _this.s, t4 = t3.length, t5 = _this.parameterSeparator; !t2.call$0();) {
|
|
t6 = t1.index;
|
|
if (!(t6 < t4))
|
|
return A.ioore(t3, t6);
|
|
char = t3[t6];
|
|
t7 = true;
|
|
if (char !== " ")
|
|
if (char !== "\t")
|
|
t7 = char === t5;
|
|
if (t7)
|
|
break;
|
|
t1.index = t6 + 1;
|
|
}
|
|
return B.JSString_methods.substring$2(t3, start, t1.index);
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._HeaderValue__parse_expect.prototype = {
|
|
call$1(expected) {
|
|
var t1, t2, _this = this;
|
|
if (!_this.done.call$0()) {
|
|
t1 = _this.s;
|
|
t2 = _this._box_0.index;
|
|
if (!(t2 < t1.length))
|
|
return A.ioore(t1, t2);
|
|
t2 = t1[t2] !== expected;
|
|
t1 = t2;
|
|
} else
|
|
t1 = true;
|
|
if (t1)
|
|
throw A.wrapException(A.HttpException$("Failed to parse header value", null));
|
|
++_this._box_0.index;
|
|
},
|
|
$signature: 60
|
|
};
|
|
A._HeaderValue__parse_maybeExpect.prototype = {
|
|
call$1(expected) {
|
|
var _this = this;
|
|
if (_this.done.call$0() || !B.JSString_methods.startsWith$2(_this.s, expected, _this._box_0.index))
|
|
return false;
|
|
++_this._box_0.index;
|
|
return true;
|
|
},
|
|
$signature: 7
|
|
};
|
|
A._HeaderValue__parse_parseParameters.prototype = {
|
|
call$0() {
|
|
var t6, t7, t8, t9, $name, value, t10, _this = this,
|
|
t1 = _this.$this,
|
|
parameters = t1._ensureParameters$0(),
|
|
t2 = _this._box_0,
|
|
t3 = _this.done,
|
|
t4 = _this.s,
|
|
t5 = _this.parameterSeparator,
|
|
parseParameterName = new A._HeaderValue__parse_parseParameters_parseParameterName(t2, t3, t4, t5, _this.valueSeparator),
|
|
parseParameterValue = new A._HeaderValue__parse_parseParameters_parseParameterValue(t2, t3, t4, _this.preserveBackslash, _this.parseValue);
|
|
for (t6 = _this.expect, t7 = t4.length, t8 = _this.maybeExpect, t9 = _this.skipWS, t1 = t1 instanceof A._ContentType; !t3.call$0();) {
|
|
t9.call$0();
|
|
if (t3.call$0())
|
|
return;
|
|
$name = parseParameterName.call$0();
|
|
t9.call$0();
|
|
if (t8.call$1("=")) {
|
|
t9.call$0();
|
|
value = parseParameterValue.call$0();
|
|
parameters.$indexSet(0, $name, $name === "charset" && t1 ? value.toLowerCase() : value);
|
|
t9.call$0();
|
|
} else if ($name.length !== 0)
|
|
parameters.$indexSet(0, $name, null);
|
|
if (t3.call$0())
|
|
return;
|
|
t10 = t2.index;
|
|
if (!(t10 < t7))
|
|
return A.ioore(t4, t10);
|
|
t6.call$1(t5);
|
|
}
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HeaderValue__parse_parseParameters_parseParameterName.prototype = {
|
|
call$0() {
|
|
var t2, t3, t4, t5, t6, char, t7, _this = this,
|
|
t1 = _this._box_0,
|
|
start = t1.index;
|
|
for (t2 = _this.done, t3 = _this.s, t4 = t3.length, t5 = _this.parameterSeparator; !t2.call$0();) {
|
|
t6 = t1.index;
|
|
if (!(t6 < t4))
|
|
return A.ioore(t3, t6);
|
|
char = t3[t6];
|
|
t7 = true;
|
|
if (char !== " ")
|
|
if (char !== "\t")
|
|
if (char !== "=")
|
|
t7 = char === t5;
|
|
if (t7)
|
|
break;
|
|
t1.index = t6 + 1;
|
|
}
|
|
return B.JSString_methods.substring$2(t3, start, t1.index).toLowerCase();
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._HeaderValue__parse_parseParameters_parseParameterValue.prototype = {
|
|
call$0() {
|
|
var t2, t3, t4, t5, t6, char, _this = this,
|
|
_s28_ = "Failed to parse header value",
|
|
t1 = _this.done;
|
|
if (!t1.call$0()) {
|
|
t2 = _this.s;
|
|
t3 = _this._box_0.index;
|
|
if (!(t3 < t2.length))
|
|
return A.ioore(t2, t3);
|
|
t3 = t2[t3] === '"';
|
|
t2 = t3;
|
|
} else
|
|
t2 = false;
|
|
if (t2) {
|
|
t2 = _this._box_0;
|
|
++t2.index;
|
|
for (t3 = _this.s, t4 = t3.length, t5 = ""; !t1.call$0();) {
|
|
t6 = t2.index;
|
|
if (!(t6 < t4))
|
|
return A.ioore(t3, t6);
|
|
char = t3[t6];
|
|
if (char === "\\") {
|
|
++t6;
|
|
if (t6 === t4)
|
|
throw A.wrapException(A.HttpException$(_s28_, null));
|
|
t2.index = t6;
|
|
} else if (char === '"') {
|
|
t2.index = t6 + 1;
|
|
return t5.charCodeAt(0) == 0 ? t5 : t5;
|
|
}
|
|
if (!(t6 < t4))
|
|
return A.ioore(t3, t6);
|
|
t5 += t3[t6];
|
|
t2.index = t6 + 1;
|
|
}
|
|
throw A.wrapException(A.HttpException$(_s28_, null));
|
|
} else
|
|
return _this.parseValue.call$0();
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._ContentType.prototype = {};
|
|
A._Cookie.prototype = {
|
|
_parseSetCookieValue$1(s) {
|
|
var t2, _this = this, t1 = {};
|
|
t1.index = 0;
|
|
t2 = new A._Cookie__parseSetCookieValue_done(t1, s);
|
|
_this.__http$_name = A._Cookie__validateName(new A._Cookie__parseSetCookieValue_parseName(t1, t2, s).call$0());
|
|
if (t2.call$0() || _this.__http$_name.length === 0)
|
|
throw A.wrapException(A.HttpException$("Failed to parse header value [" + s + "]", null));
|
|
++t1.index;
|
|
_this._value = A._Cookie__validateValue(new A._Cookie__parseSetCookieValue_parseValue(t1, t2, s).call$0());
|
|
if (t2.call$0())
|
|
return;
|
|
++t1.index;
|
|
new A._Cookie__parseSetCookieValue_parseAttributes(t1, _this, t2, s).call$0();
|
|
},
|
|
toString$0(_) {
|
|
var t2, _this = this,
|
|
t1 = _this.__http$_name + "=" + _this._value,
|
|
expires = _this.expires;
|
|
if (expires != null)
|
|
t1 = t1 + "; Expires=" + A.HttpDate_format(expires);
|
|
t2 = _this.maxAge;
|
|
if (t2 != null)
|
|
t1 = t1 + "; Max-Age=" + A.S(t2);
|
|
t2 = _this.domain;
|
|
if (t2 != null)
|
|
t1 = t1 + "; Domain=" + t2;
|
|
t2 = _this._path;
|
|
if (t2 != null)
|
|
t1 = t1 + "; Path=" + t2;
|
|
if (_this.secure)
|
|
t1 += "; Secure";
|
|
if (_this.httpOnly)
|
|
t1 += "; HttpOnly";
|
|
t2 = _this.sameSite;
|
|
if (t2 != null)
|
|
t1 += "; " + t2.toString$0(0);
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
$isCookie: 1
|
|
};
|
|
A._Cookie__parseSetCookieValue_done.prototype = {
|
|
call$0() {
|
|
return this._box_0.index === this.s.length;
|
|
},
|
|
$signature: 10
|
|
};
|
|
A._Cookie__parseSetCookieValue_parseName.prototype = {
|
|
call$0() {
|
|
var t2, t3, t4, t5,
|
|
t1 = this._box_0,
|
|
start = t1.index;
|
|
for (t2 = this.done, t3 = this.s, t4 = t3.length; !t2.call$0();) {
|
|
t5 = t1.index;
|
|
if (!(t5 < t4))
|
|
return A.ioore(t3, t5);
|
|
if (t3[t5] === "=")
|
|
break;
|
|
t1.index = t5 + 1;
|
|
}
|
|
return B.JSString_methods.trim$0(B.JSString_methods.substring$2(t3, start, t1.index));
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._Cookie__parseSetCookieValue_parseValue.prototype = {
|
|
call$0() {
|
|
var t2, t3, t4, t5,
|
|
t1 = this._box_0,
|
|
start = t1.index;
|
|
for (t2 = this.done, t3 = this.s, t4 = t3.length; !t2.call$0();) {
|
|
t5 = t1.index;
|
|
if (!(t5 < t4))
|
|
return A.ioore(t3, t5);
|
|
if (t3[t5] === ";")
|
|
break;
|
|
t1.index = t5 + 1;
|
|
}
|
|
return B.JSString_methods.trim$0(B.JSString_methods.substring$2(t3, start, t1.index));
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._Cookie__parseSetCookieValue_parseAttributes.prototype = {
|
|
call$0() {
|
|
var t4, t5, $name, t6, value, _this = this,
|
|
t1 = _this._box_0,
|
|
t2 = _this.done,
|
|
t3 = _this.s,
|
|
parseAttributeName = new A._Cookie__parseSetCookieValue_parseAttributes_parseAttributeName(t1, t2, t3),
|
|
parseAttributeValue = new A._Cookie__parseSetCookieValue_parseAttributes_parseAttributeValue(t1, t2, t3);
|
|
for (t4 = t3.length, t5 = _this.$this; !t2.call$0();) {
|
|
$name = parseAttributeName.call$0();
|
|
if (!t2.call$0()) {
|
|
t6 = t1.index;
|
|
if (!(t6 < t4))
|
|
return A.ioore(t3, t6);
|
|
t6 = t3[t6] === "=";
|
|
} else
|
|
t6 = false;
|
|
if (t6) {
|
|
++t1.index;
|
|
value = parseAttributeValue.call$0();
|
|
} else
|
|
value = "";
|
|
if ($name === "expires")
|
|
t5.expires = A.HttpDate__parseCookieDate(value);
|
|
else if ($name === "max-age")
|
|
t5.maxAge = A.int_parse(value, null);
|
|
else if ($name === "domain")
|
|
t5.domain = value;
|
|
else if ($name === "path") {
|
|
A._Cookie__validatePath(value);
|
|
t5._path = value;
|
|
} else if ($name === "httponly")
|
|
t5.httpOnly = true;
|
|
else if ($name === "secure")
|
|
t5.secure = true;
|
|
else if ($name === "samesite") {
|
|
$label0$4: {
|
|
if ("lax" === value) {
|
|
t6 = B.SameSite_Lax;
|
|
break $label0$4;
|
|
}
|
|
if ("none" === value) {
|
|
t6 = B.SameSite_None;
|
|
break $label0$4;
|
|
}
|
|
if ("strict" === value) {
|
|
t6 = B.SameSite_Strict;
|
|
break $label0$4;
|
|
}
|
|
t6 = A.throwExpression(A.HttpException$("SameSite value should be one of Lax, Strict or None.", null));
|
|
}
|
|
t5.sameSite = t6;
|
|
}
|
|
if (!t2.call$0())
|
|
++t1.index;
|
|
}
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Cookie__parseSetCookieValue_parseAttributes_parseAttributeName.prototype = {
|
|
call$0() {
|
|
var t2, t3, t4, t5, t6,
|
|
t1 = this._box_0,
|
|
start = t1.index;
|
|
for (t2 = this.done, t3 = this.s, t4 = t3.length; !t2.call$0();) {
|
|
t5 = t1.index;
|
|
if (!(t5 < t4))
|
|
return A.ioore(t3, t5);
|
|
t6 = t3[t5];
|
|
if (t6 === "=" || t6 === ";")
|
|
break;
|
|
t1.index = t5 + 1;
|
|
}
|
|
return B.JSString_methods.trim$0(B.JSString_methods.substring$2(t3, start, t1.index)).toLowerCase();
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._Cookie__parseSetCookieValue_parseAttributes_parseAttributeValue.prototype = {
|
|
call$0() {
|
|
var t2, t3, t4, t5,
|
|
t1 = this._box_0,
|
|
start = t1.index;
|
|
for (t2 = this.done, t3 = this.s, t4 = t3.length; !t2.call$0();) {
|
|
t5 = t1.index;
|
|
if (!(t5 < t4))
|
|
return A.ioore(t3, t5);
|
|
if (t3[t5] === ";")
|
|
break;
|
|
t1.index = t5 + 1;
|
|
}
|
|
return B.JSString_methods.trim$0(B.JSString_methods.substring$2(t3, start, t1.index)).toLowerCase();
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._HttpProfileEvent.prototype = {
|
|
toJson$0() {
|
|
var t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.dynamic);
|
|
t1.$indexSet(0, "timestamp", this.timestamp);
|
|
t1.$indexSet(0, "event", this.name);
|
|
return t1;
|
|
}
|
|
};
|
|
A._HttpProfileData.prototype = {
|
|
requestEvent$1($name) {
|
|
this._timeline.instant$2$arguments($name, null);
|
|
B.JSArray_methods.add$1(this.requestEvents, new A._HttpProfileEvent(1000 * Date.now(), $name, null));
|
|
Date.now();
|
|
},
|
|
formatHeaders$1(headers) {
|
|
var newHeaders = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.List_String);
|
|
headers.forEach$1(0, new A._HttpProfileData_formatHeaders_closure(newHeaders));
|
|
return newHeaders;
|
|
},
|
|
formatConnectionInfo$1(connectionInfo) {
|
|
var t1;
|
|
if (connectionInfo == null)
|
|
t1 = null;
|
|
else {
|
|
t1 = type$.dynamic;
|
|
t1 = A.LinkedHashMap_LinkedHashMap$_literal(["localPort", connectionInfo.localPort, "remoteAddress", connectionInfo.remoteAddress.get$address(), "remotePort", connectionInfo.remotePort], t1, t1);
|
|
}
|
|
return t1;
|
|
},
|
|
finishRequest$1$request(request) {
|
|
var t2, t3, t4, t5, t6, _i, _this = this,
|
|
t1 = Date.now();
|
|
_this.___HttpProfileData_requestEndTimestamp_F !== $ && A.throwLateFieldAI("requestEndTimestamp");
|
|
_this.___HttpProfileData_requestEndTimestamp_F = 1000 * t1;
|
|
t1 = request.headers;
|
|
t2 = _this.formatHeaders$1(t1);
|
|
t3 = _this.formatConnectionInfo$1(A._HttpConnectionInfo_create(request._httpClientConnection._socket));
|
|
t4 = t1._contentLength;
|
|
t5 = A._setArrayType([], type$.JSArray_String);
|
|
for (t6 = request.cookies, _i = 0; false; ++_i)
|
|
t5.push(t6[_i].toString$0(0));
|
|
t1 = A.LinkedHashMap_LinkedHashMap$_literal(["headers", t2, "connectionInfo", t3, "contentLength", t4, "cookies", t5, "followRedirects", true, "maxRedirects", request._maxRedirects, "method", request.method, "persistentConnection", t1._persistentConnection, "uri", request.uri.toString$0(0)], type$.String, type$.dynamic);
|
|
_this.requestDetails = t1;
|
|
_this._timeline.finish$1$arguments(t1);
|
|
Date.now();
|
|
},
|
|
startResponse$1$response(response) {
|
|
var t9, t10, _i, t11, t12, t13, t14, redirect, _this = this,
|
|
t1 = response._incoming,
|
|
t2 = t1.headers,
|
|
t3 = _this.formatHeaders$1(t2),
|
|
t4 = response.compressionState._enumToString$0(),
|
|
t5 = response._httpRequest,
|
|
t6 = _this.formatConnectionInfo$1(A._HttpConnectionInfo_create(t5._httpClientConnection._socket)),
|
|
t7 = t2._contentLength,
|
|
t8 = A._setArrayType([], type$.JSArray_String);
|
|
for (t9 = response.get$cookies(), t10 = t9.length, _i = 0; _i < t9.length; t9.length === t10 || (0, A.throwConcurrentModificationError)(t9), ++_i)
|
|
t8.push(t9[_i].toString$0(0));
|
|
t9 = response.get$isRedirect();
|
|
t2 = t2._persistentConnection;
|
|
t10 = t1.reasonPhrase;
|
|
t10.toString;
|
|
t11 = A._setArrayType([], type$.JSArray_Map_String_Object);
|
|
for (t5 = t5._responseRedirects, t12 = t5.length, t13 = type$.String, t14 = type$.Object, _i = 0; _i < t5.length; t5.length === t12 || (0, A.throwConcurrentModificationError)(t5), ++_i) {
|
|
redirect = t5[_i];
|
|
t11.push(A.LinkedHashMap_LinkedHashMap$_literal(["location", redirect.location.toString$0(0), "method", redirect.method, "statusCode", redirect.statusCode], t13, t14));
|
|
}
|
|
t1 = t1.statusCode;
|
|
t1.toString;
|
|
t5 = type$.dynamic;
|
|
_this.responseDetails = A.LinkedHashMap_LinkedHashMap$_literal(["headers", t3, "compressionState", t4, "connectionInfo", t6, "contentLength", t7, "cookies", t8, "isRedirect", t9, "persistentConnection", t2, "reasonPhrase", t10, "redirects", t11, "statusCode", t1], t13, t5);
|
|
_this.responseInProgress = true;
|
|
t13 = A._setArrayType([], type$.JSArray_nullable__AsyncBlock);
|
|
_this.___HttpProfileData__responseTimeline_A = new A.TimelineTask(_this._timeline, "HTTP/client", A._getNextTaskId(), t13);
|
|
t13 = Date.now();
|
|
_this.___HttpProfileData_responseStartTimestamp_F !== $ && A.throwLateFieldAI("responseStartTimestamp");
|
|
_this.___HttpProfileData_responseStartTimestamp_F = 1000 * t13;
|
|
t13 = _this.___HttpProfileData__responseTimeline_A;
|
|
t5 = A.LinkedHashMap_LinkedHashMap$_empty(t5, t5);
|
|
t5.$indexSet(0, "requestUri", _this.uri.toString$0(0));
|
|
t1 = _this.responseDetails;
|
|
t1.toString;
|
|
t5.addAll$1(0, t1);
|
|
t13.start$2$arguments("HTTP CLIENT response of " + _this.method, t5);
|
|
Date.now();
|
|
},
|
|
finishResponse$0() {
|
|
var t1, _this = this;
|
|
if (_this.responseInProgress !== true)
|
|
return;
|
|
_this.responseInProgress = false;
|
|
t1 = Date.now();
|
|
_this.___HttpProfileData_responseEndTimestamp_F !== $ && A.throwLateFieldAI("responseEndTimestamp");
|
|
_this.___HttpProfileData_responseEndTimestamp_F = 1000 * t1;
|
|
_this.requestEvent$1("Content Download");
|
|
t1 = _this.___HttpProfileData__responseTimeline_A;
|
|
t1 === $ && A.throwLateFieldNI("_responseTimeline");
|
|
t1.finish$0();
|
|
Date.now();
|
|
},
|
|
finishResponseWithError$1(error) {
|
|
var t2, _this = this,
|
|
t1 = _this.responseInProgress;
|
|
t1.toString;
|
|
if (!t1)
|
|
return;
|
|
_this.responseInProgress = false;
|
|
t1 = Date.now();
|
|
_this.___HttpProfileData_responseEndTimestamp_F !== $ && A.throwLateFieldAI("responseEndTimestamp");
|
|
_this.___HttpProfileData_responseEndTimestamp_F = 1000 * t1;
|
|
t1 = _this.___HttpProfileData__responseTimeline_A;
|
|
t1 === $ && A.throwLateFieldNI("_responseTimeline");
|
|
t2 = type$.dynamic;
|
|
t1.finish$1$arguments(A.LinkedHashMap_LinkedHashMap$_literal(["error", error], t2, t2));
|
|
Date.now();
|
|
}
|
|
};
|
|
A._HttpProfileData_formatHeaders_closure.prototype = {
|
|
call$2($name, values) {
|
|
this.newHeaders.$indexSet(0, $name, type$.List_String._as(values));
|
|
},
|
|
$signature: 8
|
|
};
|
|
A._CopyingBytesBuilder.prototype = {
|
|
add$1(_, bytes) {
|
|
var t1, bytesLength, required, i, t2, t3, t4, _this = this;
|
|
type$.List_int._as(bytes);
|
|
t1 = J.getInterceptor$asx(bytes);
|
|
bytesLength = t1.get$length(bytes);
|
|
if (bytesLength === 0)
|
|
return;
|
|
required = _this.__http$_length + bytesLength;
|
|
if (_this.__http$_buffer.length < required)
|
|
_this._grow$1(required);
|
|
for (i = 0; i < bytesLength; ++i) {
|
|
t2 = _this.__http$_buffer;
|
|
t3 = _this.__http$_length + i;
|
|
t4 = t1.$index(bytes, i);
|
|
t2.$flags & 2 && A.throwUnsupportedOperation(t2);
|
|
if (!(t3 >= 0 && t3 < t2.length))
|
|
return A.ioore(t2, t3);
|
|
t2[t3] = t4;
|
|
}
|
|
_this.__http$_length = required;
|
|
},
|
|
addByte$1(byte) {
|
|
var _this = this,
|
|
t1 = _this.__http$_buffer,
|
|
t2 = _this.__http$_length;
|
|
if (t1.length === t2)
|
|
_this._grow$1(t2);
|
|
t1 = _this.__http$_buffer;
|
|
t2 = _this.__http$_length;
|
|
t1.$flags & 2 && A.throwUnsupportedOperation(t1);
|
|
if (!(t2 >= 0 && t2 < t1.length))
|
|
return A.ioore(t1, t2);
|
|
t1[t2] = byte;
|
|
_this.__http$_length = t2 + 1;
|
|
},
|
|
_grow$1(required) {
|
|
var newBuffer, t1,
|
|
newSize = required * 2;
|
|
newSize = newSize < 1024 ? 1024 : A._CopyingBytesBuilder__pow2roundup(newSize);
|
|
newBuffer = new Uint8Array(newSize);
|
|
t1 = this.__http$_buffer;
|
|
B.NativeUint8List_methods.setRange$3(newBuffer, 0, t1.length, t1);
|
|
this.__http$_buffer = newBuffer;
|
|
},
|
|
takeBytes$0() {
|
|
var buffer, _this = this;
|
|
if (_this.__http$_length === 0)
|
|
return $.$get$_CopyingBytesBuilder__emptyList();
|
|
buffer = J.asUint8List$2$x(B.NativeUint8List_methods.get$buffer(_this.__http$_buffer), _this.__http$_buffer.byteOffset, _this.__http$_length);
|
|
_this.__http$_length = 0;
|
|
_this.__http$_buffer = $.$get$_CopyingBytesBuilder__emptyList();
|
|
return buffer;
|
|
},
|
|
get$length(_) {
|
|
return this.__http$_length;
|
|
},
|
|
$isBytesBuilder: 1
|
|
};
|
|
A._HttpIncoming.prototype = {
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
type$.nullable_void_Function_Uint8List._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
this.hasSubscriber = true;
|
|
return this.__http$_stream.handleError$2$test(new A._HttpIncoming_listen_closure(this), new A._HttpIncoming_listen_closure0()).listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError);
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
}
|
|
};
|
|
A._HttpIncoming_listen_closure.prototype = {
|
|
call$1(error) {
|
|
throw A.wrapException(A.HttpException$(type$.HttpException._as(error).get$message(), this.$this.uri));
|
|
},
|
|
$signature: 5
|
|
};
|
|
A._HttpIncoming_listen_closure0.prototype = {
|
|
call$1(error) {
|
|
return type$.HttpException._is(error);
|
|
},
|
|
$signature: 57
|
|
};
|
|
A._HttpInboundMessageListInt.prototype = {};
|
|
A._HttpClientResponse.prototype = {
|
|
get$redirects() {
|
|
return this._httpRequest._responseRedirects;
|
|
},
|
|
get$cookies() {
|
|
var values, t1, t2,
|
|
cookies = this._cookies;
|
|
if (cookies != null)
|
|
return cookies;
|
|
cookies = A._setArrayType([], type$.JSArray_Cookie);
|
|
values = this._incoming.headers._headers.$index(0, A._HttpHeaders__validateField("set-cookie"));
|
|
if (values != null)
|
|
for (t1 = J.get$iterator$ax(values); t1.moveNext$0();) {
|
|
t2 = new A._Cookie("", "", false);
|
|
t2._parseSetCookieValue$1(t1.get$current());
|
|
B.JSArray_methods.add$1(cookies, t2);
|
|
}
|
|
return this._cookies = cookies;
|
|
},
|
|
get$isRedirect() {
|
|
var t1 = this._httpRequest.method;
|
|
if (t1 === "GET" || t1 === "HEAD") {
|
|
t1 = this._incoming.statusCode;
|
|
t1.toString;
|
|
return t1 === 301 || t1 === 308 || t1 === 302 || t1 === 303 || t1 === 307;
|
|
} else if (t1 === "POST") {
|
|
t1 = this._incoming.statusCode;
|
|
t1.toString;
|
|
return t1 === 303;
|
|
}
|
|
return false;
|
|
},
|
|
redirect$0() {
|
|
var method, url, t1, $location, t2, _i, t3, _this = this, _box_0 = {};
|
|
_box_0.method = method;
|
|
_box_0.url = url;
|
|
_box_0.url = _box_0.method = null;
|
|
t1 = _this._incoming.statusCode;
|
|
t1.toString;
|
|
if (t1 === 303 && _this._httpRequest.method === "POST")
|
|
_box_0.method = "GET";
|
|
else
|
|
_box_0.method = _this._httpRequest.method;
|
|
$location = _this._incoming.headers.value$1("location");
|
|
if ($location == null)
|
|
throw A.wrapException(A.RedirectException$("Server response has no Location header for redirect", _this.get$redirects()));
|
|
_box_0.url = A.Uri_parse($location);
|
|
for (t1 = _this._httpRequest._responseRedirects, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i)
|
|
if (t1[_i].location.$eq(0, _box_0.url)) {
|
|
t2 = A._interceptUserError(new A.RedirectException("Redirect loop detected", t1), null);
|
|
t3 = new A._Future($.Zone__current, type$._Future_HttpClientResponse);
|
|
t3._asyncCompleteErrorObject$1(t2);
|
|
return t3;
|
|
}
|
|
return _this._httpClient._openUrlFromRequest$4$isRedirect(_box_0.method, _box_0.url, _this._httpRequest, true).then$1$1(new A._HttpClientResponse_redirect_closure(_box_0, _this), type$.HttpClientResponse);
|
|
},
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var stream, t1, _this = this;
|
|
type$.nullable_void_Function_Uint8List._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
stream = _this._incoming;
|
|
if (stream.upgraded) {
|
|
t1 = _this._profileData;
|
|
if (t1 != null)
|
|
t1.finishResponseWithError$1("Connection was upgraded");
|
|
_this._httpRequest._httpClientConnection.destroy$0();
|
|
return A._DoneStreamSubscription$(onDone, type$.Uint8List);
|
|
}
|
|
if (_this.compressionState === B.HttpClientResponseCompressionState_1) {
|
|
t1 = A._instanceType(stream)._eval$1("CastStream<Stream.T,List<int>>");
|
|
t1 = t1._eval$1("StreamTransformer<Stream.T,List<int>>")._as(B.C_GZipCodec.get$decoder()).bind$1(new A.CastStream(stream, t1));
|
|
stream = t1.$ti._eval$1("StreamTransformer<Stream.T,Uint8List>")._as(B.C__ToUint8List).bind$1(t1);
|
|
}
|
|
if (_this._profileData != null) {
|
|
t1 = A._instanceType(stream);
|
|
stream = new A._MapStream(t1._eval$1("Uint8List(Stream.T)")._as(new A._HttpClientResponse_listen_closure(_this)), stream, t1._eval$1("_MapStream<Stream.T,Uint8List>"));
|
|
}
|
|
return stream.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, new A._HttpClientResponse_listen_closure0(_this, onError));
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
},
|
|
_authenticate$1(proxyAuth) {
|
|
var challenge, header, s, exception, scheme, realm, _this = this, t1 = {},
|
|
t2 = _this._httpRequest._profileData;
|
|
if (t2 != null)
|
|
t2.requestEvent$1("Authentication");
|
|
t2 = new A._HttpClientResponse__authenticate_authChallenge(_this, proxyAuth).call$0();
|
|
t2.toString;
|
|
challenge = t2;
|
|
header = null;
|
|
try {
|
|
header = A._HeaderValue_parse(J.$index$asx(challenge, 0), ",");
|
|
} catch (exception) {
|
|
if (type$.HttpException._is(A.unwrapException(exception))) {
|
|
s = A.getTraceFromException(exception);
|
|
A.Error_throwWithStackTrace(new A.HttpException("The authentication challenge sent by the server is not correctly formatted.", null), s);
|
|
} else
|
|
throw exception;
|
|
}
|
|
scheme = A._AuthenticationScheme__AuthenticationScheme$fromString(header._value);
|
|
realm = header.get$parameters()._collection$_map.$index(0, "realm");
|
|
t1.cr = new A._HttpClientResponse__authenticate_findCredentials(_this, proxyAuth).call$1(scheme);
|
|
return new A._HttpClientResponse__authenticate_requestAuthentication(_this, proxyAuth).call$2(scheme, realm).then$1$1(new A._HttpClientResponse__authenticate_closure(t1, _this, scheme, new A._HttpClientResponse__authenticate_retry(_this)), type$.HttpClientResponse);
|
|
},
|
|
$isHttpClientResponse: 1
|
|
};
|
|
A._HttpClientResponse_redirect_closure.prototype = {
|
|
call$1(request) {
|
|
var t1, t2, t3, t4;
|
|
type$._HttpClientRequest._as(request);
|
|
t1 = request._responseRedirects;
|
|
t2 = this.$this;
|
|
B.JSArray_methods.addAll$1(t1, t2._httpRequest._responseRedirects);
|
|
t2 = t2._incoming.statusCode;
|
|
t2.toString;
|
|
t3 = this._box_0;
|
|
t4 = t3.method;
|
|
t4.toString;
|
|
t3 = t3.url;
|
|
t3.toString;
|
|
B.JSArray_methods.add$1(t1, new A._RedirectInfo(t2, t4, t3));
|
|
return request.close$0();
|
|
},
|
|
$signature: 20
|
|
};
|
|
A._HttpClientResponse_listen_closure.prototype = {
|
|
call$1(data) {
|
|
var t1;
|
|
type$.Uint8List._as(data);
|
|
t1 = this.$this._profileData;
|
|
B.JSArray_methods.addAll$1((t1 == null ? type$._HttpProfileData._as(t1) : t1).responseBody, data);
|
|
Date.now();
|
|
return data;
|
|
},
|
|
$signature: 59
|
|
};
|
|
A._HttpClientResponse_listen_closure0.prototype = {
|
|
call$2(e, st) {
|
|
var t2,
|
|
t1 = this.$this._profileData;
|
|
if (t1 != null)
|
|
t1.finishResponseWithError$1(J.toString$0$(e));
|
|
t1 = this.onError;
|
|
if (t1 == null)
|
|
return;
|
|
if (type$.void_Function_Object_StackTrace._is(t1)) {
|
|
t2 = e == null ? A._asObject(e) : e;
|
|
t1.call$2(t2, type$.StackTrace._as(st));
|
|
} else {
|
|
type$.void_Function_Object._as(t1);
|
|
t1.call$1(e == null ? A._asObject(e) : e);
|
|
}
|
|
},
|
|
$signature: 11
|
|
};
|
|
A._HttpClientResponse__authenticate_retry.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this,
|
|
t2 = t1._httpRequest._profileData;
|
|
if (t2 != null)
|
|
t2.requestEvent$1("Retrying");
|
|
return t1.drain$1$0(type$.dynamic).then$1$1(new A._HttpClientResponse__authenticate_retry_closure(t1), type$.HttpClientResponse);
|
|
},
|
|
$signature: 61
|
|
};
|
|
A._HttpClientResponse__authenticate_retry_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
var t1 = this.$this,
|
|
t2 = t1._httpRequest;
|
|
return t1._httpClient._openUrlFromRequest$4$isRedirect(t2.method, t2.uri, t2, false).then$1$1(new A._HttpClientResponse__authenticate_retry__closure(), type$.HttpClientResponse);
|
|
},
|
|
$signature: 12
|
|
};
|
|
A._HttpClientResponse__authenticate_retry__closure.prototype = {
|
|
call$1(request) {
|
|
return type$._HttpClientRequest._as(request).close$0();
|
|
},
|
|
$signature: 20
|
|
};
|
|
A._HttpClientResponse__authenticate_authChallenge.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this._incoming;
|
|
return this.proxyAuth ? t1.headers._headers.$index(0, A._HttpHeaders__validateField("proxy-authenticate")) : t1.headers._headers.$index(0, A._HttpHeaders__validateField("www-authenticate"));
|
|
},
|
|
$signature: 35
|
|
};
|
|
A._HttpClientResponse__authenticate_findCredentials.prototype = {
|
|
call$1(scheme) {
|
|
var t1 = this.$this,
|
|
t2 = t1._httpClient;
|
|
t1 = t1._httpRequest;
|
|
return this.proxyAuth ? t2._findProxyCredentials$2(t1._proxy, scheme) : t2._findCredentials$2(t1.uri, scheme);
|
|
},
|
|
$signature: 36
|
|
};
|
|
A._HttpClientResponse__authenticate_requestAuthentication.prototype = {
|
|
call$2(scheme, realm) {
|
|
var t1;
|
|
if (this.proxyAuth) {
|
|
t1 = A.Future_Future$value(false, type$.bool);
|
|
return t1;
|
|
}
|
|
t1 = A.Future_Future$value(false, type$.bool);
|
|
return t1;
|
|
},
|
|
$signature: 43
|
|
};
|
|
A._HttpClientResponse__authenticate_closure.prototype = {
|
|
call$1(credsAvailable) {
|
|
var _this = this,
|
|
t1 = _this.$this;
|
|
if (A._asBool(credsAvailable)) {
|
|
_this._box_0.cr = t1._httpClient._findCredentials$2(t1._httpRequest.uri, _this.scheme);
|
|
return _this.retry.call$0();
|
|
} else
|
|
return t1;
|
|
},
|
|
$signature: 53
|
|
};
|
|
A._ToUint8List.prototype = {
|
|
startChunkedConversion$1(sink) {
|
|
return new A._Uint8ListConversionSink(type$.Sink_Uint8List._as(sink));
|
|
}
|
|
};
|
|
A._Uint8ListConversionSink.prototype = {
|
|
add$1(_, data) {
|
|
var t1 = this._target,
|
|
t2 = t1._sink;
|
|
t1 = t2.$ti._rest[1]._as(t1.$ti._precomputed1._as(new Uint8Array(A._ensureNativeList(type$.List_int._as(data)))));
|
|
if ((t2._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
t2.super$_BufferingStreamSubscription$_add(t1);
|
|
},
|
|
close$0() {
|
|
var t1 = this._target._sink;
|
|
if ((t1._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
t1.super$_BufferingStreamSubscription$_close();
|
|
},
|
|
$isSink: 1
|
|
};
|
|
A._StreamSinkImpl.prototype = {
|
|
add$1(_, data) {
|
|
A._instanceType(this)._eval$1("_StreamSinkImpl.T")._as(data);
|
|
if (this._isClosed)
|
|
throw A.wrapException(A.StateError$("StreamSink is closed"));
|
|
this.get$_controller().add$1(0, data);
|
|
},
|
|
addError$2(error, stackTrace) {
|
|
if (this._isClosed)
|
|
throw A.wrapException(A.StateError$("StreamSink is closed"));
|
|
this.get$_controller().addError$2(error, stackTrace);
|
|
},
|
|
close$0() {
|
|
var controller, _this = this;
|
|
if (_this._isBound)
|
|
throw A.wrapException(A.StateError$("StreamSink is bound to a stream"));
|
|
if (!_this._isClosed) {
|
|
_this._isClosed = true;
|
|
controller = _this._controllerInstance;
|
|
if (controller != null)
|
|
controller.close$0();
|
|
else
|
|
_this._closeTarget$0();
|
|
}
|
|
return _this.get$done();
|
|
},
|
|
_closeTarget$0() {
|
|
this._target.close$0().then$1$2$onError(this.get$_completeDoneValue(), this.get$_completeDoneError(), type$.void);
|
|
},
|
|
get$done() {
|
|
return this._doneCompleter.future;
|
|
},
|
|
_completeDoneValue$1(value) {
|
|
var t1 = this._doneCompleter;
|
|
if ((t1.future._state & 30) === 0)
|
|
t1.complete$1(value);
|
|
},
|
|
_completeDoneError$2(error, stackTrace) {
|
|
var t1;
|
|
A._asObject(error);
|
|
type$.StackTrace._as(stackTrace);
|
|
t1 = this._doneCompleter;
|
|
if ((t1.future._state & 30) === 0) {
|
|
this._hasError = true;
|
|
t1.completeError$2(error, stackTrace);
|
|
}
|
|
},
|
|
get$_controller() {
|
|
var t1, _this = this;
|
|
if (_this._isBound)
|
|
throw A.wrapException(A.StateError$("StreamSink is bound to a stream"));
|
|
if (_this._isClosed)
|
|
throw A.wrapException(A.StateError$("StreamSink is closed"));
|
|
if (_this._controllerInstance == null) {
|
|
_this._controllerInstance = A.StreamController_StreamController(true, A._instanceType(_this)._eval$1("_StreamSinkImpl.T"));
|
|
_this._controllerCompleter = new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_dynamic), type$._AsyncCompleter_dynamic);
|
|
t1 = _this.get$_controller();
|
|
_this._target.addStream$1(new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>"))).then$1$2$onError(new A._StreamSinkImpl__controller_closure(_this), new A._StreamSinkImpl__controller_closure0(_this), type$.Null);
|
|
}
|
|
t1 = _this._controllerInstance;
|
|
t1.toString;
|
|
return t1;
|
|
},
|
|
$isEventSink: 1,
|
|
$isStreamConsumer: 1,
|
|
$isSink: 1
|
|
};
|
|
A._StreamSinkImpl__controller_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
var t1 = this.$this;
|
|
if (t1._isBound) {
|
|
t1._controllerCompleter.complete$1(t1);
|
|
t1._controllerInstance = t1._controllerCompleter = null;
|
|
} else
|
|
t1._closeTarget$0();
|
|
},
|
|
$signature: 3
|
|
};
|
|
A._StreamSinkImpl__controller_closure0.prototype = {
|
|
call$2(error, stackTrace) {
|
|
var t1;
|
|
A._asObject(error);
|
|
type$.StackTrace._as(stackTrace);
|
|
t1 = this.$this;
|
|
if (t1._isBound) {
|
|
t1._controllerCompleter.completeError$2(error, stackTrace);
|
|
t1._controllerInstance = t1._controllerCompleter = null;
|
|
} else
|
|
t1._completeDoneError$2(error, stackTrace);
|
|
},
|
|
$signature: 9
|
|
};
|
|
A._IOSinkImpl.prototype = {
|
|
write$1(obj) {
|
|
var t1, utf8Encoding, _this = this;
|
|
if (obj.length === 0)
|
|
return;
|
|
t1 = _this._profileData;
|
|
if (t1 == null)
|
|
utf8Encoding = null;
|
|
else {
|
|
utf8Encoding = B.C_Utf8Encoder.convert$1(obj);
|
|
B.JSArray_methods.addAll$1(t1.requestBody, utf8Encoding);
|
|
Date.now();
|
|
}
|
|
_this.super$_StreamSinkImpl$add(0, utf8Encoding != null && _this._encoding === B.C_Utf8Codec ? utf8Encoding : _this._encoding.encode$1(obj));
|
|
},
|
|
$isStringSink: 1
|
|
};
|
|
A._HttpOutboundMessage.prototype = {
|
|
get$encoding() {
|
|
var contentType, t1, charset, _this = this;
|
|
if (_this._encodingSet && _this._outgoing.headersWritten)
|
|
return _this._encoding;
|
|
contentType = _this.headers.get$contentType();
|
|
if (contentType != null && contentType.get$parameters()._collection$_map.$index(0, "charset") != null) {
|
|
t1 = contentType.get$parameters()._collection$_map.$index(0, "charset");
|
|
t1.toString;
|
|
charset = t1;
|
|
} else
|
|
charset = "iso-8859-1";
|
|
t1 = A.Encoding_getByName(charset);
|
|
return t1 == null ? B.C_Latin1Codec : t1;
|
|
},
|
|
add$1(_, data) {
|
|
var t1, t2;
|
|
type$.List_int._as(data);
|
|
if (J.get$isEmpty$asx(data))
|
|
return;
|
|
t1 = this._profileData;
|
|
if (t1 != null) {
|
|
t2 = new Uint8Array(A._ensureNativeList(data));
|
|
B.JSArray_methods.addAll$1(t1.requestBody, t2);
|
|
Date.now();
|
|
}
|
|
this.super$_StreamSinkImpl$add(0, data);
|
|
},
|
|
write$1(obj) {
|
|
var _this = this;
|
|
if (!_this._encodingSet) {
|
|
_this._encoding = _this.get$encoding();
|
|
_this._encodingSet = true;
|
|
}
|
|
_this.super$_IOSinkImpl$write(obj);
|
|
}
|
|
};
|
|
A._HttpClientRequest.prototype = {
|
|
_HttpClientRequest$7(outgoing, uri, method, _proxy, _httpClient, _httpClientConnection, _profileData) {
|
|
var t1, t2;
|
|
if (_profileData != null)
|
|
_profileData.requestEvent$1("Request sent");
|
|
t1 = this.method;
|
|
t1 = t1 === "GET" || t1 === "HEAD";
|
|
t2 = this.headers;
|
|
if (t1)
|
|
t2.set$contentLength(0);
|
|
else
|
|
t2.set$chunkedTransferEncoding(true);
|
|
this._responseCompleter.future.then$1$2$onError(new A._HttpClientRequest_closure(_profileData), new A._HttpClientRequest_closure0(), type$.Null);
|
|
},
|
|
get$done() {
|
|
var _this = this,
|
|
t1 = _this._response;
|
|
return t1 == null ? _this._response = A.Future_wait(A._setArrayType([_this._responseCompleter.future, A._StreamSinkImpl.prototype.get$done.call(_this)], type$.JSArray_Future_dynamic), true, type$.dynamic).then$1$1(new A._HttpClientRequest_done_closure(), type$.HttpClientResponse) : t1;
|
|
},
|
|
close$0() {
|
|
this.super$_StreamSinkImpl$close();
|
|
return this.get$done();
|
|
},
|
|
_handleIncoming$1(incoming) {
|
|
var t3, future, challenge, _this = this,
|
|
t1 = _this._httpClient,
|
|
t2 = incoming.headers,
|
|
response = new A._HttpClientResponse(t1, _this, A._HttpClientResponse__getCompressionState(t1, t2), _this._profileData, incoming);
|
|
incoming.uri = _this.uri;
|
|
t3 = response.get$isRedirect();
|
|
if (t3) {
|
|
t1 = type$.dynamic;
|
|
t2 = type$.HttpClientResponse;
|
|
future = _this._responseRedirects.length < _this._maxRedirects ? response.drain$1$0(t1).then$1$1(new A._HttpClientRequest__handleIncoming_closure(response), t2) : response.drain$1$0(t1).then$1$1(new A._HttpClientRequest__handleIncoming_closure0(response), t2);
|
|
} else {
|
|
t2 = t2._headers;
|
|
challenge = t2.$index(0, A._HttpHeaders__validateField("proxy-authenticate"));
|
|
t3 = incoming.statusCode;
|
|
t3.toString;
|
|
if (t3 === 407 && challenge != null && J.get$length$asx(challenge) === 1)
|
|
future = response._authenticate$1(true);
|
|
else {
|
|
challenge = t2.$index(0, A._HttpHeaders__validateField("www-authenticate"));
|
|
t2 = incoming.statusCode;
|
|
t2.toString;
|
|
t3 = false;
|
|
if (t2 === 401)
|
|
if (challenge != null)
|
|
if (J.get$length$asx(challenge) === 1) {
|
|
t1 = t1._credentials.length;
|
|
t1 = t1 !== 0;
|
|
} else
|
|
t1 = t3;
|
|
else
|
|
t1 = t3;
|
|
else
|
|
t1 = t3;
|
|
future = t1 ? response._authenticate$1(false) : A.Future_Future$value(response, type$.HttpClientResponse);
|
|
}
|
|
}
|
|
future.then$1$2$onError(new A._HttpClientRequest__handleIncoming_closure1(_this), new A._HttpClientRequest__handleIncoming_closure2(_this), type$.Null);
|
|
},
|
|
_requestUri$0() {
|
|
var _this = this,
|
|
t1 = new A._HttpClientRequest__requestUri_uriStartingFromPath(_this);
|
|
if (_this._proxy.isDirect)
|
|
return t1.call$0();
|
|
else if (_this.method === "CONNECT") {
|
|
t1 = _this.uri;
|
|
return t1.get$host() + ":" + t1.get$port();
|
|
} else if (_this._httpClientConnection._proxyTunnel)
|
|
return t1.call$0();
|
|
else
|
|
return _this.uri.removeFragment$0().toString$0(0);
|
|
},
|
|
add$1(_, data) {
|
|
var t1;
|
|
type$.List_int._as(data);
|
|
t1 = J.get$isEmpty$asx(data);
|
|
if (t1)
|
|
return;
|
|
this.super$_HttpOutboundMessage$add(0, data);
|
|
},
|
|
write$1(obj) {
|
|
this.super$_HttpOutboundMessage$write(obj);
|
|
},
|
|
_writeHeader$0() {
|
|
var buffer, t2, headerBytes, _this = this,
|
|
t1 = A._CopyingBytesBuilder__pow2roundup(8192);
|
|
t1 = new Uint8Array(t1);
|
|
buffer = new A._CopyingBytesBuilder(t1);
|
|
t1 = _this.method;
|
|
buffer.add$1(0, new A.CodeUnits(t1));
|
|
buffer.addByte$1(32);
|
|
buffer.add$1(0, new A.CodeUnits(_this._requestUri$0()));
|
|
buffer.addByte$1(32);
|
|
buffer.add$1(0, B.List_mxl);
|
|
buffer.addByte$1(13);
|
|
buffer.addByte$1(10);
|
|
t2 = _this.headers;
|
|
t2._mutable = false;
|
|
t2._build$2$skipZeroContentLength(buffer, t1 === "CONNECT" || t1 === "DELETE" || t1 === "GET" || t1 === "HEAD");
|
|
buffer.addByte$1(13);
|
|
buffer.addByte$1(10);
|
|
headerBytes = buffer.takeBytes$0();
|
|
t1 = _this._outgoing;
|
|
t1.__http$_buffer = type$.List_int._as(headerBytes);
|
|
t1.__http$_length = headerBytes.length;
|
|
},
|
|
$isHttpClientRequest: 1
|
|
};
|
|
A._HttpClientRequest_closure.prototype = {
|
|
call$1(response) {
|
|
var t1, t2;
|
|
type$.HttpClientResponse._as(response);
|
|
t1 = this._profileData;
|
|
t2 = t1 == null;
|
|
if (!t2)
|
|
t1.requestEvent$1("Waiting (TTFB)");
|
|
if (!t2)
|
|
t1.startResponse$1$response(response);
|
|
response._incoming._dataCompleter.future.then$1$1(new A._HttpClientRequest__closure(t1), type$.void);
|
|
},
|
|
$signature: 21
|
|
};
|
|
A._HttpClientRequest__closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
var t1;
|
|
A._asBool(__wc0_formal);
|
|
t1 = this._profileData;
|
|
return t1 == null ? null : t1.finishResponse$0();
|
|
},
|
|
$signature: 65
|
|
};
|
|
A._HttpClientRequest_closure0.prototype = {
|
|
call$1(e) {
|
|
},
|
|
$signature: 3
|
|
};
|
|
A._HttpClientRequest_done_closure.prototype = {
|
|
call$1(list) {
|
|
return type$.FutureOr_HttpClientResponse._as(J.$index$asx(type$.List_dynamic._as(list), 0));
|
|
},
|
|
$signature: 66
|
|
};
|
|
A._HttpClientRequest__handleIncoming_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
return this.response.redirect$0();
|
|
},
|
|
$signature: 12
|
|
};
|
|
A._HttpClientRequest__handleIncoming_closure0.prototype = {
|
|
call$1(__wc1_formal) {
|
|
var t1 = A._interceptUserError(new A.RedirectException("Redirect limit exceeded", this.response._httpRequest._responseRedirects), null),
|
|
t2 = new A._Future($.Zone__current, type$._Future_HttpClientResponse);
|
|
t2._asyncCompleteErrorObject$1(t1);
|
|
return t2;
|
|
},
|
|
$signature: 12
|
|
};
|
|
A._HttpClientRequest__handleIncoming_closure1.prototype = {
|
|
call$1(v) {
|
|
var t1;
|
|
type$.HttpClientResponse._as(v);
|
|
t1 = this.$this._responseCompleter;
|
|
if ((t1.future._state & 30) === 0)
|
|
t1.complete$1(v);
|
|
},
|
|
$signature: 21
|
|
};
|
|
A._HttpClientRequest__handleIncoming_closure2.prototype = {
|
|
call$2(e, s) {
|
|
var t2,
|
|
t1 = this.$this._responseCompleter;
|
|
if ((t1.future._state & 30) === 0) {
|
|
t2 = e == null ? A._asObject(e) : e;
|
|
t1.completeError$2(t2, type$.nullable_StackTrace._as(s));
|
|
}
|
|
},
|
|
$signature: 11
|
|
};
|
|
A._HttpClientRequest__requestUri_uriStartingFromPath.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this.uri,
|
|
result = t1.get$path();
|
|
if (result.length === 0)
|
|
result = "/";
|
|
return t1.get$hasQuery() ? result + "?" + t1.get$query() : result;
|
|
},
|
|
$signature: 1
|
|
};
|
|
A._HttpOutgoing.prototype = {
|
|
writeHeaders$0() {
|
|
var response, t1, contentLength, _this = this;
|
|
if (_this.headersWritten)
|
|
return null;
|
|
_this.headersWritten = true;
|
|
response = _this.outbound;
|
|
t1 = response.headers;
|
|
contentLength = t1._contentLength;
|
|
if (t1._chunkedTransferEncoding)
|
|
_this.chunked = true;
|
|
else if (contentLength >= 0)
|
|
_this.contentLength = contentLength;
|
|
response._writeHeader$0();
|
|
return null;
|
|
},
|
|
addStream$1(stream) {
|
|
var controller, sub, _this = this;
|
|
type$.Stream_List_int._as(stream);
|
|
if (_this._socketError) {
|
|
stream.listen$1(null).cancel$0();
|
|
return A.Future_Future$value(_this.outbound, type$.dynamic);
|
|
}
|
|
controller = A.StreamController_StreamController(true, type$.List_int);
|
|
sub = stream.listen$4$cancelOnError$onDone$onError(new A._HttpOutgoing_addStream_onData(_this, controller), true, controller.get$close(), controller.get$addError());
|
|
controller.set$onCancel(sub.get$cancel());
|
|
controller.set$onPause(sub.get$pause());
|
|
controller.set$onResume(sub.get$resume());
|
|
if (!_this.headersWritten)
|
|
_this.writeHeaders$0();
|
|
return _this.socket.addStream$1(new A._ControllerStream(controller, A._instanceType(controller)._eval$1("_ControllerStream<1>"))).then$1$2$onError(new A._HttpOutgoing_addStream_closure(_this), new A._HttpOutgoing_addStream_closure0(_this), type$.dynamic);
|
|
},
|
|
close$0() {
|
|
var t1, t2, t3, error, contentLength, _this = this,
|
|
closeFuture = _this._closeFuture;
|
|
if (closeFuture != null)
|
|
return closeFuture;
|
|
t1 = _this.outbound;
|
|
t1.toString;
|
|
if (_this._socketError)
|
|
return A.Future_Future$value(t1, type$.dynamic);
|
|
t2 = _this.headersWritten;
|
|
if (!t2) {
|
|
t2 = t1.headers;
|
|
t3 = t2._contentLength;
|
|
if (t3 === -1) {
|
|
t2.set$chunkedTransferEncoding(false);
|
|
t2.set$contentLength(0);
|
|
} else if (t3 > 0) {
|
|
error = new A.HttpException("No content even though contentLength was specified to be greater than 0: " + t3 + ".", t1._uri);
|
|
_this._doneCompleter.completeError$1(error);
|
|
t1 = A._interceptUserError(error, null);
|
|
t2 = new A._Future($.Zone__current, type$._Future_dynamic);
|
|
t2._asyncCompleteErrorObject$1(t1);
|
|
return _this._closeFuture = t2;
|
|
}
|
|
}
|
|
contentLength = _this.contentLength;
|
|
if (contentLength != null) {
|
|
t2 = _this._bytesWritten;
|
|
if (t2 < contentLength) {
|
|
error = new A.HttpException("Content size below specified contentLength. " + t2 + " bytes written but expected " + A.S(contentLength) + ".", t1._uri);
|
|
_this._doneCompleter.completeError$1(error);
|
|
t1 = A._interceptUserError(error, null);
|
|
t2 = new A._Future($.Zone__current, type$._Future_dynamic);
|
|
t2._asyncCompleteErrorObject$1(t1);
|
|
return _this._closeFuture = t2;
|
|
}
|
|
}
|
|
_this.writeHeaders$0();
|
|
return _this._closeFuture = new A._HttpOutgoing_close_finalize(_this, t1).call$0();
|
|
},
|
|
_addGZipChunk$2(chunk, add) {
|
|
var t1, t2, currentLength, newLength, _this = this;
|
|
type$.List_int._as(chunk);
|
|
type$.void_Function_List_int._as(add);
|
|
_this.outbound.toString;
|
|
t1 = _this._gzipBuffer;
|
|
t1.toString;
|
|
t2 = J.getInterceptor$asx(chunk);
|
|
if (t2.get$length(chunk) > 8192 - _this._gzipBufferLength) {
|
|
add.call$1(J.asUint8List$2$x(B.NativeUint8List_methods.get$buffer(t1), t1.byteOffset, _this._gzipBufferLength));
|
|
_this._gzipBuffer = new Uint8Array(8192);
|
|
_this._gzipBufferLength = 0;
|
|
}
|
|
if (t2.get$length(chunk) > 8192)
|
|
add.call$1(chunk);
|
|
else {
|
|
currentLength = _this._gzipBufferLength;
|
|
newLength = currentLength + t2.get$length(chunk);
|
|
t1 = _this._gzipBuffer;
|
|
t1.toString;
|
|
B.NativeUint8List_methods.setRange$3(t1, currentLength, newLength, chunk);
|
|
_this._gzipBufferLength = newLength;
|
|
}
|
|
},
|
|
_addChunk$2(chunk, add) {
|
|
var t1, t2, t3, _this = this;
|
|
type$.List_int._as(chunk);
|
|
type$.void_Function_List_int._as(add);
|
|
_this.outbound.toString;
|
|
t1 = J.getInterceptor$asx(chunk);
|
|
t2 = t1.get$length(chunk);
|
|
t3 = _this.__http$_buffer;
|
|
if (t2 > t3.length - _this.__http$_length) {
|
|
add.call$1(J.asUint8List$2$x(B.NativeUint8List_methods.get$buffer(t3), _this.__http$_buffer.byteOffset, _this.__http$_length));
|
|
_this.__http$_buffer = new Uint8Array(8192);
|
|
_this.__http$_length = 0;
|
|
}
|
|
if (t1.get$length(chunk) > 8192)
|
|
add.call$1(chunk);
|
|
else {
|
|
t2 = _this.__http$_buffer;
|
|
t2.toString;
|
|
t3 = _this.__http$_length;
|
|
B.NativeUint8List_methods.setRange$3(t2, t3, t3 + t1.get$length(chunk), chunk);
|
|
_this.__http$_length = _this.__http$_length + t1.get$length(chunk);
|
|
}
|
|
},
|
|
_chunkHeader$1($length) {
|
|
var size, len, size0, t1, footerAndHeader, index, t2;
|
|
if ($length === 0) {
|
|
if (this._pendingChunkedFooter === 2)
|
|
return B.List_nhL;
|
|
return B.List_5IB;
|
|
}
|
|
size = this._pendingChunkedFooter;
|
|
for (len = $length, size0 = size; len > 0;) {
|
|
++size0;
|
|
len = B.JSInt_methods._shrOtherPositive$1(len, 4);
|
|
}
|
|
t1 = size0 + 2;
|
|
footerAndHeader = new Uint8Array(t1);
|
|
if (size === 2) {
|
|
footerAndHeader[0] = 13;
|
|
footerAndHeader[1] = 10;
|
|
}
|
|
for (index = size0; index > size;) {
|
|
--index;
|
|
t2 = B.List_XJC[$length & 15];
|
|
if (!(index < t1))
|
|
return A.ioore(footerAndHeader, index);
|
|
footerAndHeader[index] = t2;
|
|
$length = B.JSInt_methods._shrOtherPositive$1($length, 4);
|
|
}
|
|
if (!(size0 < t1))
|
|
return A.ioore(footerAndHeader, size0);
|
|
footerAndHeader[size0] = 13;
|
|
t2 = size0 + 1;
|
|
if (!(t2 < t1))
|
|
return A.ioore(footerAndHeader, t2);
|
|
footerAndHeader[t2] = 10;
|
|
return footerAndHeader;
|
|
},
|
|
$isStreamConsumer: 1
|
|
};
|
|
A._HttpOutgoing_addStream_onData.prototype = {
|
|
call$1(data) {
|
|
var t1, t2, t3, contentLength, _this = this;
|
|
type$.List_int._as(data);
|
|
t1 = _this.$this;
|
|
if (t1._socketError)
|
|
return;
|
|
t2 = J.getInterceptor$asx(data);
|
|
if (t2.get$isEmpty(data))
|
|
return;
|
|
if (t1.chunked) {
|
|
if (t1._gzip) {
|
|
t2 = _this.controller;
|
|
t3 = type$.void_Function_List_int;
|
|
t1._gzipAdd = t3._as(t2.get$add(t2));
|
|
t2 = t1._gzipSink;
|
|
t1._addGZipChunk$2(data, t3._as(t2.get$add(t2)));
|
|
t1._gzipAdd = null;
|
|
return;
|
|
}
|
|
t3 = _this.controller;
|
|
t1._addChunk$2(t1._chunkHeader$1(t2.get$length(data)), type$.void_Function_List_int._as(t3.get$add(t3)));
|
|
t1._pendingChunkedFooter = 2;
|
|
} else {
|
|
contentLength = t1.contentLength;
|
|
if (contentLength != null) {
|
|
t2 = t1._bytesWritten = t1._bytesWritten + t2.get$length(data);
|
|
if (t2 > contentLength) {
|
|
_this.controller.addError$1(new A.HttpException("Content size exceeds specified contentLength. " + t2 + " bytes written while expected " + A.S(contentLength) + ". [" + A.String_String$fromCharCodes(data, 0, null) + "]", null));
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
t2 = _this.controller;
|
|
t1._addChunk$2(data, type$.void_Function_List_int._as(t2.get$add(t2)));
|
|
},
|
|
$signature: 70
|
|
};
|
|
A._HttpOutgoing_addStream_closure.prototype = {
|
|
call$1(__wc2_formal) {
|
|
return this.$this.outbound;
|
|
},
|
|
$signature: 71
|
|
};
|
|
A._HttpOutgoing_addStream_closure0.prototype = {
|
|
call$2(error, stackTrace) {
|
|
var t1 = this.$this;
|
|
if (t1._gzip)
|
|
t1._gzipSink.close$0();
|
|
t1._socketError = true;
|
|
t1._doneCompleter.completeError$2(error, stackTrace);
|
|
throw A.wrapException(error);
|
|
},
|
|
$signature: 79
|
|
};
|
|
A._HttpOutgoing_close_finalize.prototype = {
|
|
call$0() {
|
|
var t2, t3,
|
|
t1 = this.$this;
|
|
if (t1.chunked) {
|
|
if (t1._gzip) {
|
|
t2 = t1.socket;
|
|
t1._gzipAdd = t2.get$add(t2);
|
|
if (t1._gzipBufferLength > 0) {
|
|
t2 = t1._gzipSink;
|
|
t2.toString;
|
|
t3 = t1._gzipBuffer;
|
|
t3.toString;
|
|
t3 = type$.List_int._as(J.asUint8List$2$x(B.NativeUint8List_methods.get$buffer(t3), t1._gzipBuffer.byteOffset, t1._gzipBufferLength));
|
|
t2.addSlice$4(t3, 0, t3.length, false);
|
|
}
|
|
t1._gzipBuffer = null;
|
|
t1._gzipSink.close$0();
|
|
t1._gzipAdd = null;
|
|
}
|
|
t2 = t1.socket;
|
|
t1._addChunk$2(t1._chunkHeader$1(0), t2.get$add(t2));
|
|
}
|
|
if (t1.__http$_length > 0) {
|
|
t2 = t1.__http$_buffer;
|
|
t2.toString;
|
|
t1.socket.add$1(0, J.asUint8List$2$x(B.NativeUint8List_methods.get$buffer(t2), t1.__http$_buffer.byteOffset, t1.__http$_length));
|
|
}
|
|
t1.__http$_buffer = null;
|
|
t2 = this.outbound;
|
|
return t1.socket.flush$0().then$1$2$onError(new A._HttpOutgoing_close_finalize_closure(t1, t2), new A._HttpOutgoing_close_finalize_closure0(t1, t2), type$.dynamic);
|
|
},
|
|
$signature: 14
|
|
};
|
|
A._HttpOutgoing_close_finalize_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
var t1 = this.$this;
|
|
t1._doneCompleter.complete$1(t1.socket);
|
|
return this.outbound;
|
|
},
|
|
$signature: 82
|
|
};
|
|
A._HttpOutgoing_close_finalize_closure0.prototype = {
|
|
call$2(error, stackTrace) {
|
|
this.$this._doneCompleter.completeError$2(error, stackTrace);
|
|
throw A.wrapException(error);
|
|
},
|
|
$signature: 33
|
|
};
|
|
A._HttpClientConnection.prototype = {
|
|
_HttpClientConnection$5(key, _socket, _httpClient, _proxyTunnel, _context) {
|
|
var _this = this,
|
|
t1 = _this._httpParser;
|
|
t1.__http$_socketSubscription = type$.Stream_Uint8List._as(_this._socket).listen$3$onDone$onError(t1.get$__http$_onData(), t1.get$__http$_onDone(), t1._controller.get$addError());
|
|
_this.__http$_subscription = t1.listen$3$onDone$onError(new A._HttpClientConnection_closure(_this), new A._HttpClientConnection_closure0(_this), new A._HttpClientConnection_closure1(_this));
|
|
},
|
|
send$5(uri, port, method, proxy, profileData) {
|
|
var t2, t3, request, host, t4, t5, _this = this,
|
|
_s28_ = "HTTP headers are not mutable",
|
|
t1 = {};
|
|
if (_this.closed)
|
|
throw A.wrapException(A.HttpException$("Socket closed before request was sent", uri));
|
|
_this._currentUri = uri;
|
|
_this.__http$_subscription.pause$0();
|
|
if (method === "CONNECT")
|
|
_this._httpParser.connectMethod = true;
|
|
t1.creds = t1.proxyCreds = null;
|
|
t2 = new A._Future($.Zone__current, type$._Future_Socket);
|
|
t3 = _this._httpClient;
|
|
request = A._HttpClientRequest$(new A._HttpOutgoing(new A._AsyncCompleter(t2, type$._AsyncCompleter_Socket), _this._socket), uri, method, proxy, t3, _this, profileData);
|
|
host = uri.get$host();
|
|
if (B.JSString_methods.contains$1(host, ":"))
|
|
host = "[" + host + "]";
|
|
t4 = request.headers;
|
|
if (!t4._mutable)
|
|
A.throwExpression(A.HttpException$(_s28_, null));
|
|
t4._host = host;
|
|
t4._updateHostHeader$0();
|
|
if (!t4._mutable)
|
|
A.throwExpression(A.HttpException$(_s28_, null));
|
|
t4._port = port;
|
|
t4._updateHostHeader$0();
|
|
t4.add$2(0, "accept-encoding", "gzip");
|
|
t4.add$2(0, "user-agent", t3.userAgent);
|
|
t5 = proxy.username;
|
|
if (t5 != null) {
|
|
t5 = type$.Base64Codec._eval$1("Codec.S")._as(B.C_Utf8Encoder.convert$1(t5 + ":" + A.S(proxy.password)));
|
|
t4.$set$2("proxy-authorization", "Basic " + B.C_Base64Codec.get$encoder().convert$1(t5));
|
|
} else if (!proxy.isDirect && t3._proxyCredentials.length !== 0)
|
|
t1.proxyCreds = t3._findProxyCredentials$1(proxy);
|
|
uri.get$userInfo();
|
|
t5 = uri.get$userInfo();
|
|
if (t5.length !== 0) {
|
|
t3 = type$.Base64Codec._eval$1("Codec.S")._as(B.C_Utf8Encoder.convert$1(uri.get$userInfo()));
|
|
t4.$set$2("authorization", "Basic " + B.C_Base64Codec.get$encoder().convert$1(t3));
|
|
} else
|
|
t1.creds = t3._findCredentials$1(uri);
|
|
_this._httpParser._noMessageBody = A.valueOfNonNullableParamWithDefault(method === "HEAD", false, type$.bool);
|
|
t1 = t2.then$1$1(new A._HttpClientConnection_send_closure(t1, _this, profileData, request, method, uri), type$.Socket);
|
|
_this._streamFuture = t1;
|
|
A.Future_Future$value(t1, type$.nullable_Socket).catchError$1(new A._HttpClientConnection_send_closure0(_this));
|
|
return request;
|
|
},
|
|
destroy$0() {
|
|
var _this = this;
|
|
_this.closed = true;
|
|
_this._httpClient._connectionClosed$1(_this);
|
|
_this._socket.destroy$0();
|
|
},
|
|
__http$_close$0() {
|
|
var _this = this;
|
|
_this.closed = true;
|
|
_this._httpClient._connectionClosed$1(_this);
|
|
_this._streamFuture.timeout$1(B.Duration_15000000).then$1$1(new A._HttpClientConnection__close_closure(_this), type$.void);
|
|
},
|
|
createProxyTunnel$5(host, port, proxy, callback, profileData) {
|
|
var uri, t1, t2, t3, t4, proxyProfileData, request;
|
|
type$.bool_Function_X509Certificate._as(callback);
|
|
uri = A._Uri__Uri(host, port);
|
|
t1 = profileData == null;
|
|
if (!t1) {
|
|
t2 = type$.dynamic;
|
|
t3 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, t2);
|
|
t4 = proxy.host;
|
|
if (t4 != null)
|
|
t3.$indexSet(0, "host", t4);
|
|
t4 = proxy.port;
|
|
if (t4 != null)
|
|
t3.$indexSet(0, "port", t4);
|
|
t4 = proxy.username;
|
|
if (t4 != null)
|
|
t3.$indexSet(0, "username", t4);
|
|
profileData.proxyDetails = t3;
|
|
profileData._timeline.instant$2$arguments("Establishing proxy tunnel", A.LinkedHashMap_LinkedHashMap$_literal(["proxyDetails", t3], t2, t2));
|
|
Date.now();
|
|
}
|
|
proxyProfileData = !t1 ? A.HttpProfiler_startRequest("CONNECT", uri, profileData) : null;
|
|
request = this.send$5(A._Uri__Uri(host, port), port, "CONNECT", proxy, proxyProfileData);
|
|
t1 = proxy.username;
|
|
if (t1 != null) {
|
|
t1 = type$.Base64Codec._eval$1("Codec.S")._as(B.C_Utf8Encoder.convert$1(t1 + ":" + A.S(proxy.password)));
|
|
request.headers.$set$2("proxy-authorization", "Basic " + B.C_Base64Codec.get$encoder().convert$1(t1));
|
|
}
|
|
return request.close$0().then$1$1(new A._HttpClientConnection_createProxyTunnel_closure(this, profileData, request, host, callback), type$.SecureSocket).then$1$1(new A._HttpClientConnection_createProxyTunnel_closure0(host, port, profileData, request), type$._HttpClientConnection);
|
|
},
|
|
stopTimer$0() {
|
|
var t1 = this._idleTimer;
|
|
if (t1 != null)
|
|
t1.cancel$0();
|
|
this._idleTimer = null;
|
|
},
|
|
startTimer$0() {
|
|
this._idleTimer = A.Timer_Timer(B.Duration_15000000, new A._HttpClientConnection_startTimer_closure(this));
|
|
}
|
|
};
|
|
A._HttpClientConnection_closure.prototype = {
|
|
call$1(incoming) {
|
|
var t1, t2;
|
|
type$._HttpIncoming._as(incoming);
|
|
t1 = this.$this;
|
|
t1.__http$_subscription.pause$0();
|
|
t2 = t1._nextResponseCompleter;
|
|
if (t2 == null)
|
|
throw A.wrapException(A.HttpException$("Unexpected response (unsolicited response without request). This can be caused when a malformed request is sent to the server (e.g. a GET request containing a body) or if the server is not correctly implemented. Future requests to this server, using the same HttpClient, are likely to fail.", t1._currentUri));
|
|
if (incoming.statusCode === 100)
|
|
incoming.drain$1$0(type$.dynamic).then$1$1(new A._HttpClientConnection__closure(t1), type$.Null).catchError$2$test(new A._HttpClientConnection__closure0(t1), new A._HttpClientConnection__closure1());
|
|
else {
|
|
t2.complete$1(incoming);
|
|
t1._nextResponseCompleter = null;
|
|
}
|
|
},
|
|
$signature: 34
|
|
};
|
|
A._HttpClientConnection__closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
this.$this.__http$_subscription.resume$0();
|
|
},
|
|
$signature: 3
|
|
};
|
|
A._HttpClientConnection__closure0.prototype = {
|
|
call$2(error, stackTrace) {
|
|
var message, t1;
|
|
type$.StackTrace._as(stackTrace);
|
|
if (type$.HttpException._is(error))
|
|
message = error.get$message();
|
|
else if (error instanceof A.SocketException)
|
|
message = error.message;
|
|
else if (error instanceof A.TlsException)
|
|
message = error.message;
|
|
else
|
|
throw A.wrapException(error == null ? A._asObject(error) : error);
|
|
t1 = this.$this;
|
|
t1._nextResponseCompleter.completeError$2(new A.HttpException(message, t1._currentUri), stackTrace);
|
|
t1._nextResponseCompleter = null;
|
|
},
|
|
$signature: 15
|
|
};
|
|
A._HttpClientConnection__closure1.prototype = {
|
|
call$1(error) {
|
|
A._asObject(error);
|
|
return type$.HttpException._is(error) || error instanceof A.SocketException || error instanceof A.TlsException;
|
|
},
|
|
$signature: 22
|
|
};
|
|
A._HttpClientConnection_closure1.prototype = {
|
|
call$2(error, stackTrace) {
|
|
var message, t1, t2;
|
|
type$.StackTrace._as(stackTrace);
|
|
if (type$.HttpException._is(error))
|
|
message = error.get$message();
|
|
else if (error instanceof A.SocketException)
|
|
message = error.message;
|
|
else if (error instanceof A.TlsException)
|
|
message = error.message;
|
|
else
|
|
throw A.wrapException(error == null ? A._asObject(error) : error);
|
|
t1 = this.$this;
|
|
t2 = t1._nextResponseCompleter;
|
|
if (t2 != null)
|
|
t2.completeError$2(new A.HttpException(message, t1._currentUri), stackTrace);
|
|
t1._nextResponseCompleter = null;
|
|
},
|
|
$signature: 15
|
|
};
|
|
A._HttpClientConnection_closure0.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this,
|
|
t2 = t1._nextResponseCompleter;
|
|
if (t2 != null)
|
|
t2.completeError$1(new A.HttpException("Connection closed before response was received", t1._currentUri));
|
|
t1._nextResponseCompleter = null;
|
|
if (!t1.closed)
|
|
t1.__http$_close$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HttpClientConnection_send_closure.prototype = {
|
|
call$1(s) {
|
|
var t1, t2, t3, _this = this;
|
|
type$.Socket._as(s);
|
|
t1 = _this.profileData;
|
|
if (t1 != null)
|
|
t1.finishRequest$1$request(_this.request);
|
|
t1 = new A._Future($.Zone__current, type$._Future__HttpIncoming);
|
|
t2 = _this.$this;
|
|
t2._nextResponseCompleter = new A._AsyncCompleter(t1, type$._AsyncCompleter__HttpIncoming);
|
|
t3 = _this.request;
|
|
t1.then$1$1(new A._HttpClientConnection_send__closure(_this._box_0, t2, _this.method, t3), type$.Null).catchError$2$test(new A._HttpClientConnection_send__closure0(_this.uri), new A._HttpClientConnection_send__closure1()).catchError$1(new A._HttpClientConnection_send__closure2(t2, t3));
|
|
t2.__http$_subscription.resume$0();
|
|
return s;
|
|
},
|
|
$signature: 37
|
|
};
|
|
A._HttpClientConnection_send__closure.prototype = {
|
|
call$1(incoming) {
|
|
var t1, t2;
|
|
type$._HttpIncoming._as(incoming);
|
|
t1 = this.$this;
|
|
t1._currentUri = null;
|
|
t2 = this.request;
|
|
incoming._dataCompleter.future.then$1$1(new A._HttpClientConnection_send___closure(t1, incoming, this.method, t2), type$.Null);
|
|
t2._handleIncoming$1(incoming);
|
|
},
|
|
$signature: 38
|
|
};
|
|
A._HttpClientConnection_send___closure.prototype = {
|
|
call$1(closing) {
|
|
var t1, t2, t3, _this = this;
|
|
A._asBool(closing);
|
|
t1 = _this.incoming;
|
|
if (t1.upgraded) {
|
|
t1 = _this.$this;
|
|
t1._httpClient._connectionClosed$1(t1);
|
|
t1.startTimer$0();
|
|
return;
|
|
}
|
|
t2 = _this.$this;
|
|
if (!t2.closed)
|
|
t3 = _this.method === "CONNECT" && t1.statusCode === 200;
|
|
else
|
|
t3 = true;
|
|
if (t3)
|
|
return;
|
|
if (!closing && !t2._dispose && t1.headers._persistentConnection && _this.request.headers._persistentConnection) {
|
|
t1 = t2._httpClient._connectionTargets.$index(0, t2.key);
|
|
t1._active.remove$1(0, t2);
|
|
t1._idle.add$1(0, t2);
|
|
t2.startTimer$0();
|
|
t1._checkPending$0();
|
|
t2.__http$_subscription.resume$0();
|
|
} else
|
|
t2.destroy$0();
|
|
},
|
|
$signature: 39
|
|
};
|
|
A._HttpClientConnection_send__closure0.prototype = {
|
|
call$1(error) {
|
|
throw A.wrapException(A.HttpException$("Connection closed before data was received", this.uri));
|
|
},
|
|
$signature: 5
|
|
};
|
|
A._HttpClientConnection_send__closure1.prototype = {
|
|
call$1(error) {
|
|
return A._asObject(error) instanceof A.StateError;
|
|
},
|
|
$signature: 22
|
|
};
|
|
A._HttpClientConnection_send__closure2.prototype = {
|
|
call$2(error, stackTrace) {
|
|
var t1;
|
|
this.$this.destroy$0();
|
|
type$.StackTrace._as(stackTrace);
|
|
t1 = this.request._responseCompleter;
|
|
if ((t1.future._state & 30) === 0)
|
|
t1.completeError$2(error == null ? A._asObject(error) : error, stackTrace);
|
|
},
|
|
$signature: 11
|
|
};
|
|
A._HttpClientConnection_send_closure0.prototype = {
|
|
call$1(e) {
|
|
this.$this.destroy$0();
|
|
return null;
|
|
},
|
|
$signature: 3
|
|
};
|
|
A._HttpClientConnection__close_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
type$.Socket._as(__wc0_formal);
|
|
return this.$this._socket.destroy$0();
|
|
},
|
|
$signature: 40
|
|
};
|
|
A._HttpClientConnection_createProxyTunnel_closure.prototype = {
|
|
call$1(response) {
|
|
var t1, t2, error, _this = this;
|
|
type$.HttpClientResponse._as(response);
|
|
t1 = response._incoming;
|
|
t2 = t1.statusCode;
|
|
t2.toString;
|
|
if (t2 !== 200) {
|
|
t1 = t1.reasonPhrase;
|
|
t1.toString;
|
|
error = "Proxy failed to establish tunnel (" + t2 + " " + t1 + ")";
|
|
t1 = _this.profileData;
|
|
if (t1 != null)
|
|
t1.requestEvent$1(error);
|
|
throw A.wrapException(A.HttpException$(error, _this.request.uri));
|
|
}
|
|
return A.SecureSocket_secure(response._httpRequest._httpClientConnection._socket, _this.$this._context, _this.host, _this.callback);
|
|
},
|
|
$signature: 41
|
|
};
|
|
A._HttpClientConnection_createProxyTunnel_closure0.prototype = {
|
|
call$1(secureSocket) {
|
|
var t1, _this = this;
|
|
type$.SecureSocket._as(secureSocket);
|
|
t1 = _this.profileData;
|
|
if (t1 != null)
|
|
t1.requestEvent$1("Proxy tunnel established");
|
|
return A._HttpClientConnection$("ssh:" + _this.host + ":" + _this.port, secureSocket, _this.request._httpClient, true, null);
|
|
},
|
|
$signature: 42
|
|
};
|
|
A._HttpClientConnection_startTimer_closure.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
t1._idleTimer = null;
|
|
t1.__http$_close$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._ConnectionInfo.prototype = {};
|
|
A._ConnectionTarget.prototype = {
|
|
get$isEmpty(_) {
|
|
return this._idle._collection$_length === 0 && this._active._collection$_length === 0 && this._connecting === 0;
|
|
},
|
|
_checkPending$0() {
|
|
var t2, t3, result,
|
|
t1 = this.__http$_pending;
|
|
if (!t1.get$isEmpty(0)) {
|
|
t2 = t1._head;
|
|
if (t2 === t1._tail)
|
|
A.throwExpression(A.IterableElementError_noElement());
|
|
++t1._modificationCount;
|
|
t3 = t1._table;
|
|
if (!(t2 < t3.length))
|
|
return A.ioore(t3, t2);
|
|
result = t3[t2];
|
|
if (result == null)
|
|
result = t1.$ti._precomputed1._as(result);
|
|
B.JSArray_methods.$indexSet(t3, t2, null);
|
|
t1._head = (t1._head + 1 & t1._table.length - 1) >>> 0;
|
|
result.call$0();
|
|
}
|
|
},
|
|
connectionClosed$1(connection) {
|
|
this._active.remove$1(0, connection);
|
|
this._idle.remove$1(0, connection);
|
|
this._checkPending$0();
|
|
},
|
|
connect$6(uri, uriHost, uriPort, proxy, client, profileData) {
|
|
var it, connection, t2, t3, t4, connectionTask, _this = this,
|
|
t1 = _this._idle;
|
|
if (t1._collection$_length !== 0) {
|
|
it = t1.get$iterator(0);
|
|
if (!it.moveNext$0())
|
|
A.throwExpression(A.IterableElementError_noElement());
|
|
connection = it.get$current();
|
|
t1.remove$1(0, connection);
|
|
connection.stopTimer$0();
|
|
_this._active.add$1(0, connection);
|
|
return A.Future_Future$value(new A._ConnectionInfo(connection, proxy), type$._ConnectionInfo);
|
|
}
|
|
t1 = new A._ConnectionTarget_connect_callback(null, uriHost, uriPort);
|
|
t2 = _this.isSecure && proxy.isDirect;
|
|
t3 = _this.host;
|
|
t4 = _this.port;
|
|
connectionTask = t2 ? A.SecureSocket_startConnect(t3, t4, _this.context, null, t1) : A.Socket_startConnect(t3, t4);
|
|
++_this._connecting;
|
|
return connectionTask.then$1$2$onError(new A._ConnectionTarget_connect_closure(_this, client, proxy, uriHost, uriPort, t1, profileData), new A._ConnectionTarget_connect_closure0(_this), type$._ConnectionInfo);
|
|
}
|
|
};
|
|
A._ConnectionTarget_connect_callback.prototype = {
|
|
call$1(certificate) {
|
|
return false;
|
|
},
|
|
$signature: 23
|
|
};
|
|
A._ConnectionTarget_connect_closure.prototype = {
|
|
call$1(task) {
|
|
var t1, socketFuture, _this = this;
|
|
type$.ConnectionTask_Socket._as(task);
|
|
t1 = _this.$this;
|
|
t1._socketTasks.add$1(0, task);
|
|
socketFuture = task.get$socket();
|
|
return socketFuture.then$1$2$onError(new A._ConnectionTarget_connect__closure(t1, _this.client, _this.proxy, _this.uriHost, _this.uriPort, _this.callback, _this.profileData, task), new A._ConnectionTarget_connect__closure0(t1, task, null), type$._ConnectionInfo);
|
|
},
|
|
$signature: 44
|
|
};
|
|
A._ConnectionTarget_connect__closure.prototype = {
|
|
call$1(socket) {
|
|
var t2, connection, t3, t4, t5, t6, _this = this,
|
|
t1 = _this.$this;
|
|
--t1._connecting;
|
|
socket.get$address().get$type();
|
|
socket.setOption$2(B.C_SocketOption, true);
|
|
t2 = _this.client;
|
|
connection = A._HttpClientConnection$(t1.key, socket, t2, false, t1.context);
|
|
t3 = t1.isSecure && !_this.proxy.isDirect;
|
|
t4 = _this.task;
|
|
t5 = _this.proxy;
|
|
if (t3) {
|
|
connection._dispose = true;
|
|
t3 = _this.uriHost;
|
|
t6 = _this.uriPort;
|
|
return connection.createProxyTunnel$5(t3, t6, t5, _this.callback, _this.profileData).then$1$1(new A._ConnectionTarget_connect___closure(t1, t2, t3, t6, t4, t5), type$._ConnectionInfo);
|
|
} else {
|
|
t1._active.add$1(0, connection);
|
|
t1._socketTasks.remove$1(0, t4);
|
|
return new A._ConnectionInfo(connection, t5);
|
|
}
|
|
},
|
|
$signature: 45
|
|
};
|
|
A._ConnectionTarget_connect___closure.prototype = {
|
|
call$1(tunnel) {
|
|
var _this = this;
|
|
type$._HttpClientConnection._as(tunnel);
|
|
_this.client._getConnectionTarget$3(_this.uriHost, _this.uriPort, true)._active.add$1(0, tunnel);
|
|
_this.$this._socketTasks.remove$1(0, _this.task);
|
|
return new A._ConnectionInfo(tunnel, _this.proxy);
|
|
},
|
|
$signature: 46
|
|
};
|
|
A._ConnectionTarget_connect__closure0.prototype = {
|
|
call$1(error) {
|
|
var t2,
|
|
t1 = this.$this;
|
|
--t1._connecting;
|
|
t2 = this.task;
|
|
t1._socketTasks.remove$1(0, t2);
|
|
t1._checkPending$0();
|
|
t2.cancel$0();
|
|
t1 = A.SocketException$("HTTP connection timed out after " + A.S(this.connectionTimeout) + ", host: " + t1.host + ", port: " + t1.port);
|
|
throw A.wrapException(t1);
|
|
},
|
|
$signature: 5
|
|
};
|
|
A._ConnectionTarget_connect_closure0.prototype = {
|
|
call$1(error) {
|
|
var t1 = this.$this;
|
|
--t1._connecting;
|
|
t1._checkPending$0();
|
|
throw A.wrapException(error);
|
|
},
|
|
$signature: 5
|
|
};
|
|
A._HttpClient.prototype = {
|
|
_isValidToken$1(token) {
|
|
var t1, t2, t3,
|
|
_s128_ = " ! #$%&' *+ -. 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ ^_`abcdefghijklmnopqrstuvwxyz | ~ ";
|
|
A.checkNotNullable(token, "token", type$.String);
|
|
for (t1 = new A.CodeUnits(token), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator<ListBase.E>")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) {
|
|
t3 = t1.__internal$_current;
|
|
if (t3 == null)
|
|
t3 = t2._as(t3);
|
|
if (!(t3 >= 128)) {
|
|
if (t3 >>> 0 !== t3 || t3 >= 128)
|
|
return A.ioore(_s128_, t3);
|
|
t3 = _s128_.charCodeAt(t3) === 32;
|
|
} else
|
|
t3 = true;
|
|
if (t3)
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
_openUrl$2(method, uri) {
|
|
var findProxy, configuration, error, stackTrace, isSecure, port, t2, proxyConf, t3, exception, _null = null, t1 = {};
|
|
t1.uri = uri;
|
|
uri = t1.uri = uri.removeFragment$0();
|
|
if (!this._isValidToken$1(method))
|
|
throw A.wrapException(A.ArgumentError$value(method, "method", _null));
|
|
if (method !== "CONNECT")
|
|
if (uri.get$host().length === 0)
|
|
throw A.wrapException(A.ArgumentError$("No host specified in URI " + uri.toString$0(0), _null));
|
|
else if (!uri.isScheme$1("http") && !uri.isScheme$1("https"))
|
|
throw A.wrapException(A.ArgumentError$("Unsupported scheme '" + uri.get$scheme() + "' in URI " + uri.toString$0(0), _null));
|
|
$.$get$_httpConnectionHook().call$1(uri);
|
|
isSecure = uri.isScheme$1("https");
|
|
port = t1.port = uri.get$port();
|
|
if (port === 0)
|
|
t2 = t1.port = isSecure ? 443 : 80;
|
|
else
|
|
t2 = port;
|
|
t1.proxyConf = B._ProxyConfiguration_PMa;
|
|
findProxy = A._http_HttpClient_findProxyFromEnvironment$closure();
|
|
if (findProxy != null)
|
|
try {
|
|
configuration = findProxy.call$1(uri);
|
|
configuration = configuration;
|
|
proxyConf = new A._ProxyConfiguration(A._setArrayType([], type$.JSArray__Proxy));
|
|
proxyConf._ProxyConfiguration$1(configuration);
|
|
t1.proxyConf = proxyConf;
|
|
t3 = proxyConf;
|
|
} catch (exception) {
|
|
error = A.unwrapException(exception);
|
|
stackTrace = A.getTraceFromException(exception);
|
|
t1 = A._interceptUserError(error, stackTrace);
|
|
t2 = new A._Future($.Zone__current, type$._Future__HttpClientRequest);
|
|
t2._asyncCompleteErrorObject$1(t1);
|
|
return t2;
|
|
}
|
|
else
|
|
t3 = B._ProxyConfiguration_PMa;
|
|
t1.profileData = null;
|
|
return this._getConnection$6(uri, uri.get$host(), t2, t3, isSecure, _null).then$1$2$onError(new A._HttpClient__openUrl_closure(t1, this, method, isSecure), new A._HttpClient__openUrl_closure0(t1), type$._HttpClientRequest);
|
|
},
|
|
_openUrlFromRequest$4$isRedirect(method, uri, previous, isRedirect) {
|
|
var resolved;
|
|
A._asString(method);
|
|
resolved = previous.uri.resolveUri$1(type$.Uri._as(uri));
|
|
return this._openUrl$2(method, resolved).then$1$1(new A._HttpClient__openUrlFromRequest_closure(previous, isRedirect, resolved), type$._HttpClientRequest);
|
|
},
|
|
_connectionClosed$1(connection) {
|
|
var t1, t2, connectionTarget;
|
|
connection.stopTimer$0();
|
|
t1 = this._connectionTargets;
|
|
t2 = connection.key;
|
|
connectionTarget = t1.$index(0, t2);
|
|
if (connectionTarget != null) {
|
|
connectionTarget.connectionClosed$1(connection);
|
|
if (connectionTarget.get$isEmpty(0))
|
|
t1.remove$1(0, t2);
|
|
}
|
|
},
|
|
_getConnectionTarget$3(host, port, isSecure) {
|
|
var t1 = "" + port,
|
|
key = isSecure ? "ssh:" + host + ":" + t1 : host + ":" + t1;
|
|
return this._connectionTargets.putIfAbsent$2(key, new A._HttpClient__getConnectionTarget_closure(this, key, host, port, isSecure));
|
|
},
|
|
_getConnection$6(uri, uriHost, uriPort, proxyConf, isSecure, profileData) {
|
|
var t1 = proxyConf.proxies;
|
|
return new A._HttpClient__getConnection_connect(this, new J.ArrayIterator(t1, t1.length, A._arrayInstanceType(t1)._eval$1("ArrayIterator<1>")), uriHost, uriPort, isSecure, uri, profileData).call$2(new A.HttpException("No proxies given", null), A.StackTrace_current());
|
|
},
|
|
_findCredentials$2(url, scheme) {
|
|
return B.JSArray_methods.fold$1$2(this._credentials, null, new A._HttpClient__findCredentials_closure(url, scheme), type$.nullable__SiteCredentials);
|
|
},
|
|
_findCredentials$1(url) {
|
|
return this._findCredentials$2(url, null);
|
|
},
|
|
_findProxyCredentials$2(proxy, scheme) {
|
|
var t1, t2, _i, current;
|
|
for (t1 = this._proxyCredentials, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) {
|
|
current = t1[_i];
|
|
if (current.applies$2(proxy, scheme))
|
|
return current;
|
|
}
|
|
return null;
|
|
},
|
|
_findProxyCredentials$1(proxy) {
|
|
return this._findProxyCredentials$2(proxy, null);
|
|
}
|
|
};
|
|
A._HttpClient__openUrl_closure.prototype = {
|
|
call$1(info) {
|
|
var t1, t2, t3, _this = this;
|
|
type$._ConnectionInfo._as(info);
|
|
t1 = _this._box_0;
|
|
t2 = new A._HttpClient__openUrl_closure_send(t1, _this.method);
|
|
if (info.connection.closed) {
|
|
t3 = t1.uri;
|
|
return _this.$this._getConnection$6(t3, t3.get$host(), t1.port, t1.proxyConf, _this.isSecure, t1.profileData).then$1$1(t2, type$._HttpClientRequest);
|
|
}
|
|
return t2.call$1(info);
|
|
},
|
|
$signature: 47
|
|
};
|
|
A._HttpClient__openUrl_closure_send.prototype = {
|
|
call$1(info) {
|
|
var t1, t2;
|
|
type$._ConnectionInfo._as(info);
|
|
t1 = this._box_0;
|
|
t2 = t1.profileData;
|
|
if (t2 != null)
|
|
t2.requestEvent$1("Connection established");
|
|
return info.connection.send$5(t1.uri, t1.port, this.method.toUpperCase(), info.proxy, t1.profileData);
|
|
},
|
|
$signature: 48
|
|
};
|
|
A._HttpClient__openUrl_closure0.prototype = {
|
|
call$1(error) {
|
|
var t2, t3,
|
|
t1 = this._box_0.profileData;
|
|
if (t1 != null) {
|
|
t2 = J.toString$0$(error);
|
|
t3 = Date.now();
|
|
t1.___HttpProfileData_requestEndTimestamp_F !== $ && A.throwLateFieldAI("requestEndTimestamp");
|
|
t1.___HttpProfileData_requestEndTimestamp_F = 1000 * t3;
|
|
t3 = type$.dynamic;
|
|
t1._timeline.finish$1$arguments(A.LinkedHashMap_LinkedHashMap$_literal(["error", t2], t3, t3));
|
|
Date.now();
|
|
}
|
|
throw A.wrapException(error == null ? A._asObject(error) : error);
|
|
},
|
|
$signature: 5
|
|
};
|
|
A._HttpClient__openUrlFromRequest_closure.prototype = {
|
|
call$1(request) {
|
|
var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
|
|
type$._HttpClientRequest._as(request);
|
|
if (request._outgoing.headersWritten)
|
|
A.throwExpression(A.StateError$("Request already sent"));
|
|
request._followRedirects = true;
|
|
t1 = this.previous;
|
|
t2 = t1._maxRedirects;
|
|
request._maxRedirects = t2;
|
|
for (t2 = t1.headers._headers, t3 = A._instanceType(t2), t4 = new A._HashMapKeyIterator(t2, t2._collection$_computeKeys$0(), t3._eval$1("_HashMapKeyIterator<1>")), t5 = request.headers, t6 = t5._headers, t3 = t3._precomputed1, t7 = this.isRedirect, t8 = this.resolved, t1 = t1.uri; t4.moveNext$0();) {
|
|
t9 = t4._collection$_current;
|
|
if (t9 == null)
|
|
t9 = t3._as(t9);
|
|
if (t6.$index(0, A._HttpHeaders__validateField(t9)) == null)
|
|
t10 = !t7 || A._HttpClient_shouldCopyHeaderOnRedirect(t9, t8, t1);
|
|
else
|
|
t10 = false;
|
|
if (t10) {
|
|
t10 = t2.$index(0, A._HttpHeaders__validateField(t9));
|
|
t10.toString;
|
|
t5.$set$2(t9, t10);
|
|
}
|
|
}
|
|
t5.set$chunkedTransferEncoding(false);
|
|
t5.set$contentLength(0);
|
|
return request;
|
|
},
|
|
$signature: 49
|
|
};
|
|
A._HttpClient__getConnectionTarget_closure.prototype = {
|
|
call$0() {
|
|
var _this = this,
|
|
t1 = type$._HttpClientConnection;
|
|
return new A._ConnectionTarget(_this.key, _this.host, _this.port, _this.isSecure, _this.$this._context, null, A.HashSet_HashSet(t1), A.HashSet_HashSet(t1), A.HashSet_HashSet(type$.ConnectionTask_Socket), new A.ListQueue(A.List_List$filled(A.ListQueue__calculateCapacity(null), null, false, type$.nullable_void_Function), type$.ListQueue_of_void_Function));
|
|
},
|
|
$signature: 50
|
|
};
|
|
A._HttpClient__getConnection_connect.prototype = {
|
|
call$2(error, stackTrace) {
|
|
var t2, proxy, host, port, _this = this,
|
|
t1 = _this.proxies;
|
|
if (!t1.moveNext$0()) {
|
|
t1 = error == null ? A._asObject(error) : error;
|
|
t1 = A._interceptUserError(t1, type$.nullable_StackTrace._as(stackTrace));
|
|
t2 = new A._Future($.Zone__current, type$._Future__ConnectionInfo);
|
|
t2._asyncCompleteErrorObject$1(t1);
|
|
return t2;
|
|
}
|
|
proxy = t1._current;
|
|
if (proxy == null)
|
|
proxy = t1.$ti._precomputed1._as(proxy);
|
|
t1 = proxy.isDirect;
|
|
if (t1)
|
|
host = _this.uriHost;
|
|
else {
|
|
t2 = proxy.host;
|
|
t2.toString;
|
|
host = t2;
|
|
}
|
|
if (t1)
|
|
port = _this.uriPort;
|
|
else {
|
|
t1 = proxy.port;
|
|
t1.toString;
|
|
port = t1;
|
|
}
|
|
t1 = _this.$this;
|
|
return t1._getConnectionTarget$3(host, port, _this.isSecure).connect$6(_this.uri, _this.uriHost, _this.uriPort, proxy, t1, _this.profileData).catchError$1(_this);
|
|
},
|
|
$signature: 51
|
|
};
|
|
A._HttpClient__findCredentials_closure.prototype = {
|
|
call$2(prev, value) {
|
|
type$.nullable__SiteCredentials._as(prev);
|
|
type$._Credentials._as(value);
|
|
if (value.applies$2(this.url, this.scheme))
|
|
return value;
|
|
else
|
|
return prev;
|
|
},
|
|
$signature: 52
|
|
};
|
|
A._HttpClient__findProxyFromEnvironment_checkNoProxy.prototype = {
|
|
call$1(option) {
|
|
var t1, t2, names, $name, t3;
|
|
if (option == null)
|
|
return null;
|
|
t1 = type$.MappedListIterable_String_String;
|
|
t2 = new A.MappedListIterable(A._setArrayType(option.split(","), type$.JSArray_String), type$.String_Function_String._as(new A._HttpClient__findProxyFromEnvironment_checkNoProxy_closure()), t1);
|
|
names = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator<ListIterable.E>"));
|
|
for (t1 = t1._eval$1("ListIterable.E"), t2 = this.url; names.moveNext$0();) {
|
|
$name = names.__internal$_current;
|
|
if ($name == null)
|
|
$name = t1._as($name);
|
|
if (!(B.JSString_methods.startsWith$1($name, "[") && B.JSString_methods.endsWith$1($name, "]") && "[" + t2.get$host() + "]" === $name))
|
|
t3 = $name.length !== 0 && B.JSString_methods.endsWith$1(t2.get$host(), $name);
|
|
else
|
|
t3 = true;
|
|
if (t3)
|
|
return "DIRECT";
|
|
}
|
|
return null;
|
|
},
|
|
$signature: 24
|
|
};
|
|
A._HttpClient__findProxyFromEnvironment_checkNoProxy_closure.prototype = {
|
|
call$1(s) {
|
|
return B.JSString_methods.trim$0(A._asString(s));
|
|
},
|
|
$signature: 54
|
|
};
|
|
A._HttpClient__findProxyFromEnvironment_checkProxy.prototype = {
|
|
call$1(option) {
|
|
var pos;
|
|
if (option == null)
|
|
return null;
|
|
option = B.JSString_methods.trim$0(option);
|
|
if (option.length === 0)
|
|
return null;
|
|
pos = B.JSString_methods.indexOf$1(option, "://");
|
|
if (pos >= 0)
|
|
option = B.JSString_methods.substring$1(option, pos + 3);
|
|
pos = B.JSString_methods.indexOf$1(option, "/");
|
|
if (pos >= 0)
|
|
option = B.JSString_methods.substring$2(option, 0, pos);
|
|
if (B.JSString_methods.indexOf$1(option, "[") === 0) {
|
|
pos = B.JSString_methods.lastIndexOf$1(option, ":");
|
|
if (B.JSString_methods.indexOf$1(option, "]") > pos)
|
|
option += ":1080";
|
|
} else if (!B.JSString_methods.contains$1(option, ":"))
|
|
option += ":1080";
|
|
return "PROXY " + option;
|
|
},
|
|
$signature: 24
|
|
};
|
|
A._ProxyConfiguration.prototype = {
|
|
_ProxyConfiguration$1(configuration) {
|
|
var portString, port, t1, t2, _i, proxy, at, userinfo, colon, username, password, host, exception, _null = null,
|
|
_s28_ = "Invalid proxy configuration ",
|
|
list = configuration.split(";");
|
|
for (t1 = list.length, t2 = this.proxies, _i = 0; _i < t1; ++_i) {
|
|
proxy = B.JSString_methods.trim$0(list[_i]);
|
|
if (proxy.length !== 0)
|
|
if (B.JSString_methods.startsWith$1(proxy, "PROXY ")) {
|
|
proxy = B.JSString_methods.trim$0(B.JSString_methods.substring$1(proxy, 6));
|
|
at = B.JSString_methods.lastIndexOf$1(proxy, "@");
|
|
if (at !== -1) {
|
|
userinfo = B.JSString_methods.trim$0(B.JSString_methods.substring$2(proxy, 0, at));
|
|
proxy = B.JSString_methods.trim$0(B.JSString_methods.substring$1(proxy, at + 1));
|
|
colon = B.JSString_methods.indexOf$1(userinfo, ":");
|
|
if (colon === -1 || colon === 0 || colon === userinfo.length - 1)
|
|
throw A.wrapException(A.HttpException$(_s28_ + configuration, _null));
|
|
username = B.JSString_methods.trim$0(B.JSString_methods.substring$2(userinfo, 0, colon));
|
|
password = B.JSString_methods.trim$0(B.JSString_methods.substring$1(userinfo, colon + 1));
|
|
} else {
|
|
password = _null;
|
|
username = password;
|
|
}
|
|
colon = B.JSString_methods.lastIndexOf$1(proxy, ":");
|
|
if (colon === -1 || colon === 0 || colon === proxy.length - 1)
|
|
throw A.wrapException(A.HttpException$(_s28_ + configuration, _null));
|
|
host = B.JSString_methods.trim$0(B.JSString_methods.substring$2(proxy, 0, colon));
|
|
if (B.JSString_methods.startsWith$1(host, "[") && B.JSString_methods.endsWith$1(host, "]"))
|
|
host = B.JSString_methods.substring$2(host, 1, host.length - 1);
|
|
portString = B.JSString_methods.trim$0(B.JSString_methods.substring$1(proxy, colon + 1));
|
|
port = null;
|
|
try {
|
|
port = A.int_parse(portString, _null);
|
|
} catch (exception) {
|
|
if (A.unwrapException(exception) instanceof A.FormatException)
|
|
throw A.wrapException(A.HttpException$(_s28_ + configuration + ", invalid port '" + A.S(portString) + "'", _null));
|
|
else
|
|
throw exception;
|
|
}
|
|
B.JSArray_methods.add$1(t2, new A._Proxy(host, port, username, password, false));
|
|
} else if (B.JSString_methods.trim$0(proxy) === "DIRECT")
|
|
B.JSArray_methods.add$1(t2, new A._Proxy(_null, _null, _null, _null, true));
|
|
else
|
|
throw A.wrapException(A.HttpException$(_s28_ + configuration, _null));
|
|
}
|
|
}
|
|
};
|
|
A._Proxy.prototype = {};
|
|
A._HttpConnectionInfo.prototype = {$isHttpConnectionInfo: 1};
|
|
A._AuthenticationScheme.prototype = {
|
|
_enumToString$0() {
|
|
return "_AuthenticationScheme." + this._name;
|
|
},
|
|
toString$0(_) {
|
|
return this._name;
|
|
}
|
|
};
|
|
A._AuthenticationScheme__AuthenticationScheme$fromString_closure.prototype = {
|
|
call$1(e) {
|
|
return type$._AuthenticationScheme._as(e)._name.toLowerCase() === this.lower;
|
|
},
|
|
$signature: 55
|
|
};
|
|
A._RedirectInfo.prototype = {$isRedirectInfo: 1};
|
|
A._HttpParser.prototype = {
|
|
_HttpParser$_$1(_requestParser) {
|
|
var _this = this,
|
|
t1 = _this._controller;
|
|
t1.set$onListen(new A._HttpParser$__closure(_this));
|
|
t1.set$onPause(new A._HttpParser$__closure0(_this));
|
|
t1.set$onResume(new A._HttpParser$__closure1(_this));
|
|
t1.set$onCancel(new A._HttpParser$__closure2(_this));
|
|
_this._reset$0();
|
|
},
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var t1 = this._controller;
|
|
return new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$4$cancelOnError$onDone$onError(type$.nullable_void_Function__HttpIncoming._as(onData), cancelOnError, type$.nullable_void_Function._as(onDone), onError);
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
},
|
|
_parse$0() {
|
|
var e, s, exception, t1, _this = this;
|
|
try {
|
|
_this._doParse$0();
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
t1 = _this.__http$_state;
|
|
if (t1 >= 17 && t1 <= 24) {
|
|
_this.__http$_state = 27;
|
|
_this._reportBodyError$2(e, s);
|
|
} else {
|
|
_this.__http$_state = 27;
|
|
_this._reportHttpError$2(e, s);
|
|
}
|
|
}
|
|
},
|
|
_headersEnd$0() {
|
|
var t2, incoming, _this = this,
|
|
t1 = _this._headers;
|
|
t1.toString;
|
|
t2 = _this._statusCode;
|
|
t2 = t2 >= 200 && t2 < 300 && _this.connectMethod;
|
|
if (t2) {
|
|
_this._transferLength = -1;
|
|
t1.set$chunkedTransferEncoding(false);
|
|
_this._chunked = false;
|
|
t1.removeAll$1("content-length");
|
|
t1.removeAll$1("transfer-encoding");
|
|
}
|
|
t1._mutable = false;
|
|
t1 = t1._contentLength;
|
|
_this._transferLength = t1;
|
|
t2 = _this._chunked;
|
|
if (t2) {
|
|
_this._transferLength = -1;
|
|
t1 = -1;
|
|
}
|
|
if (_this._messageType === 1 && t1 < 0 && !t2) {
|
|
_this._transferLength = 0;
|
|
t1 = 0;
|
|
}
|
|
if (_this._connectionUpgrade) {
|
|
_this.__http$_state = 26;
|
|
t1 = _this._transferLength = 0;
|
|
}
|
|
incoming = _this._createIncoming$1(t1);
|
|
incoming.statusCode = _this._statusCode;
|
|
t1 = _this._uriOrReasonPhrase;
|
|
incoming.reasonPhrase = A.String_String$fromCharCodes(t1, 0, null);
|
|
B.JSArray_methods.clear$0(_this.__http$_method);
|
|
B.JSArray_methods.clear$0(t1);
|
|
if (_this._connectionUpgrade) {
|
|
incoming.upgraded = true;
|
|
_this._parserCalled = false;
|
|
_this._closeIncoming$0();
|
|
_this._controller.add$1(0, incoming);
|
|
return true;
|
|
}
|
|
t1 = _this._transferLength;
|
|
if (t1 !== 0)
|
|
t2 = _this._messageType === 0 && _this._noMessageBody;
|
|
else
|
|
t2 = true;
|
|
if (t2) {
|
|
_this._reset$0();
|
|
_this._closeIncoming$0();
|
|
_this._controller.add$1(0, incoming);
|
|
return false;
|
|
} else if (_this._chunked) {
|
|
_this.__http$_state = 19;
|
|
_this._remainingContent = 0;
|
|
} else if (t1 > 0) {
|
|
_this._remainingContent = t1;
|
|
_this.__http$_state = 24;
|
|
} else
|
|
_this.__http$_state = 24;
|
|
_this._parserCalled = false;
|
|
_this._controller.add$1(0, incoming);
|
|
return true;
|
|
},
|
|
_doParse$0() {
|
|
var t1, t2, t3, t4, t5, t6, index, buffer, byte, t7, i, headerField, headerValue, tokens, isResponse, isUpgradeCode, isUpgrade, t8, lowerCaseValue, dataAvailable, dataAvailable0, data, lastEvent, _this = this, _null = null,
|
|
_s22_ = "Invalid request method",
|
|
_s21_ = "Invalid response line",
|
|
_s22_0 = "Failed to parse HTTP, ",
|
|
_s16_ = " does not match ",
|
|
_s18_ = " does not match 10",
|
|
_s18_0 = " does not match 13";
|
|
_this._parserCalled = true;
|
|
t1 = _this.__http$_state;
|
|
if (t1 === 25)
|
|
throw A.wrapException(A.HttpException$("Data on closed connection", _null));
|
|
if (t1 === 27)
|
|
throw A.wrapException(A.HttpException$("Data on failed connection", _null));
|
|
t1 = type$.List_int;
|
|
t2 = _this._headerField;
|
|
t3 = _this._headerValue;
|
|
t4 = _this._uriOrReasonPhrase;
|
|
t5 = _this.__http$_method;
|
|
while (true) {
|
|
if (!false)
|
|
break;
|
|
t6 = _this._incoming == null;
|
|
if (!(!t6 && _this._bodyPaused))
|
|
t6 = t6 && _this._paused;
|
|
else
|
|
t6 = true;
|
|
if (t6) {
|
|
_this._parserCalled = false;
|
|
return;
|
|
}
|
|
index = _this.__http$_index;
|
|
buffer = _this.__http$_buffer;
|
|
t6 = buffer.length;
|
|
if (!(index >= 0 && index < t6))
|
|
return A.ioore(buffer, index);
|
|
byte = buffer[index];
|
|
t7 = index + 1;
|
|
_this.__http$_index = t7;
|
|
switch (_this.__http$_state) {
|
|
case 0:
|
|
if (!(byte.$gt(0, 31) && byte.$lt(0, 128) && !B.JSArray_methods.$index(B.List_H5v, byte)))
|
|
throw A.wrapException(A.HttpException$(_s22_, _null));
|
|
t1._as(t5);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t5, byte);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
t6 = A.HttpException$(_s21_, _null);
|
|
throw A.wrapException(t6);
|
|
case 1:
|
|
t6 = _this._httpVersionIndex;
|
|
t6.toString;
|
|
for (i = 0; i < t6; ++i) {
|
|
if (!(i < 4))
|
|
return A.ioore(B.List_72_84_84_80, i);
|
|
t7 = B.List_72_84_84_80[i];
|
|
t1._as(t5);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t5, t7);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
}
|
|
t1._as(t5);
|
|
t6 = ++_this._headersReceivedSize;
|
|
if (t6 < 1048576)
|
|
B.JSArray_methods.add$1(t5, byte);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
_this._httpVersion = 0;
|
|
t6 = A.HttpException$(_s21_, _null);
|
|
throw A.wrapException(t6);
|
|
case 2:
|
|
t6 = _this._httpVersionIndex;
|
|
t6.toString;
|
|
if (t6 < 7) {
|
|
t7 = B.List_kXu[t6];
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s16_ + t7, _null));
|
|
_this._httpVersionIndex = t6 + 1;
|
|
} else if (t6 === 8) {
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + " does not match 32", _null));
|
|
_this.__http$_state = 7;
|
|
} else
|
|
throw A.wrapException(A.HttpException$("Invalid response line, failed to parse HTTP version", _null));
|
|
break;
|
|
case 3:
|
|
t6 = B.JSArray_methods.$index(B.List_H5v, byte);
|
|
if (t6)
|
|
throw A.wrapException(A.HttpException$(_s22_, _null));
|
|
t1._as(t5);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t5, byte);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
break;
|
|
case 4:
|
|
t1._as(t4);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t4, byte);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
break;
|
|
case 5:
|
|
t6 = _this._httpVersionIndex;
|
|
t6.toString;
|
|
if (t6 < 7) {
|
|
t7 = B.List_mxl[t6];
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s16_ + t7, _null));
|
|
_this._httpVersionIndex = t6 + 1;
|
|
} else if (t6 === 7) {
|
|
t6 = A.HttpException$("Invalid response, invalid HTTP version", _null);
|
|
throw A.wrapException(t6);
|
|
}
|
|
break;
|
|
case 6:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_, _null));
|
|
_this._messageType = 1;
|
|
_this.__http$_state = 10;
|
|
break;
|
|
case 7:
|
|
++_this._statusCodeLength;
|
|
if (byte.$lt(0, 48) || byte.$gt(0, 57))
|
|
throw A.wrapException(A.HttpException$("Invalid response status code with " + A.S(byte), _null));
|
|
else if (_this._statusCodeLength > 3)
|
|
throw A.wrapException(A.HttpException$("Invalid response, status code is over 3 digits", _null));
|
|
else
|
|
_this._statusCode = B.JSInt_methods.$add(_this._statusCode * 10, byte) - 48;
|
|
break;
|
|
case 8:
|
|
t1._as(t4);
|
|
t6 = ++_this._headersReceivedSize;
|
|
if (t6 < 1048576)
|
|
B.JSArray_methods.add$1(t4, byte);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
break;
|
|
case 9:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_, _null));
|
|
t6 = _this._statusCode;
|
|
if (t6 <= 199 || t6 === 204 || t6 === 304)
|
|
_this._noMessageBody = true;
|
|
_this.__http$_state = 10;
|
|
break;
|
|
case 10:
|
|
t6 = _this.get$version();
|
|
t6.toString;
|
|
_this._headers = A._HttpHeaders$(t6, 80, _null);
|
|
t6 = (byte.$sub(0, 65) & 127) < 26 ? byte.$or(0, 32) : byte;
|
|
t1._as(t2);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t2, t6);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
_this.__http$_state = 11;
|
|
break;
|
|
case 11:
|
|
if (!(byte.$gt(0, 31) && byte.$lt(0, 128) && !B.JSArray_methods.$index(B.List_H5v, byte)))
|
|
throw A.wrapException(A.HttpException$("Invalid header field name, with " + A.S(byte), _null));
|
|
t6 = (byte.$sub(0, 65) & 127) < 26 ? byte.$or(0, 32) : byte;
|
|
t1._as(t2);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t2, t6);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
break;
|
|
case 12:
|
|
t1._as(t3);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t3, byte);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
_this.__http$_state = 13;
|
|
break;
|
|
case 13:
|
|
t1._as(t3);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t3, byte);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
break;
|
|
case 14:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_, _null));
|
|
_this.__http$_state = 15;
|
|
break;
|
|
case 15:
|
|
headerField = A.String_String$fromCharCodes(t2, 0, _null);
|
|
A._HttpParser__removeTrailingSpaces(t3);
|
|
headerValue = A.String_String$fromCharCodes(t3, 0, _null);
|
|
t6 = headerField === "content-length";
|
|
if (t6) {
|
|
if (_this._contentLength)
|
|
throw A.wrapException(A.HttpException$("The Content-Length header occurred more than once, at most one is allowed.", _null));
|
|
else if (!_this._transferEncoding)
|
|
_this._contentLength = true;
|
|
} else if (headerField === "transfer-encoding") {
|
|
_this._transferEncoding = true;
|
|
if (A._HttpParser__caseInsensitiveCompare(new A.CodeUnits("chunked"), t3))
|
|
_this._chunked = true;
|
|
_this._contentLength = false;
|
|
}
|
|
t7 = _this._headers;
|
|
t7.toString;
|
|
if (headerField === "connection") {
|
|
tokens = A._HttpParser__tokenizeFieldValue(headerValue);
|
|
isResponse = _this._messageType === 0;
|
|
t6 = _this._statusCode;
|
|
isUpgradeCode = t6 === 426 || t6 === 101;
|
|
for (t6 = !isResponse, i = 0; i < tokens.length; ++i) {
|
|
isUpgrade = A._HttpParser__caseInsensitiveCompare(new A.CodeUnits("upgrade"), new A.CodeUnits(tokens[i]));
|
|
if (!(isUpgrade && t6))
|
|
t8 = isUpgrade && isResponse && isUpgradeCode;
|
|
else
|
|
t8 = true;
|
|
if (t8)
|
|
_this._connectionUpgrade = true;
|
|
if (!(i < tokens.length))
|
|
return A.ioore(tokens, i);
|
|
t8 = tokens[i];
|
|
lowerCaseValue = t8.toLowerCase();
|
|
if (lowerCaseValue === "close")
|
|
t7._persistentConnection = false;
|
|
else if (lowerCaseValue === "keep-alive")
|
|
t7._persistentConnection = true;
|
|
t7._addValue$2(headerField, t8);
|
|
}
|
|
} else if (!t6 || !_this._transferEncoding)
|
|
t7.__http$_add$2(headerField, headerValue);
|
|
B.JSArray_methods.clear$0(t2);
|
|
B.JSArray_methods.clear$0(t3);
|
|
_this.__http$_state = 11;
|
|
t6 = (byte - 65 & 127) < 26 ? (byte | 32) >>> 0 : byte;
|
|
t1._as(t2);
|
|
if (++_this._headersReceivedSize < 1048576)
|
|
B.JSArray_methods.add$1(t2, t6);
|
|
else
|
|
_this._reportSizeLimitError$0();
|
|
break;
|
|
case 16:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_, _null));
|
|
if (_this._headersEnd$0())
|
|
return;
|
|
break;
|
|
case 17:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_0, _null));
|
|
_this.__http$_state = 18;
|
|
break;
|
|
case 18:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_, _null));
|
|
_this.__http$_state = 19;
|
|
break;
|
|
case 19:
|
|
_this._expectHexDigit$1(byte);
|
|
break;
|
|
case 20:
|
|
break;
|
|
case 21:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_, _null));
|
|
if (_this._remainingContent > 0)
|
|
_this.__http$_state = 24;
|
|
else
|
|
_this.__http$_state = 22;
|
|
break;
|
|
case 22:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_0, _null));
|
|
break;
|
|
case 23:
|
|
A.throwExpression(A.HttpException$(_s22_0 + A.S(byte) + _s18_, _null));
|
|
_this._reset$0();
|
|
_this._closeIncoming$0();
|
|
break;
|
|
case 24:
|
|
--t7;
|
|
_this.__http$_index = t7;
|
|
dataAvailable = t6 - t7;
|
|
dataAvailable0 = _this._remainingContent;
|
|
if (dataAvailable0 >= 0 && dataAvailable > dataAvailable0)
|
|
dataAvailable = dataAvailable0;
|
|
data = buffer.get$buffer(buffer).asUint8List$2(0, buffer.get$offsetInBytes(buffer).$add(0, _this.__http$_index), dataAvailable);
|
|
t6 = _this._bodyController;
|
|
t6.toString;
|
|
t7 = A._instanceType(t6);
|
|
t7._precomputed1._as(data);
|
|
t8 = t6._state;
|
|
if (t8 >= 4)
|
|
A.throwExpression(t6._badEventState$0());
|
|
if ((t8 & 1) !== 0)
|
|
t6._sendData$1(data);
|
|
else if ((t8 & 3) === 0) {
|
|
t6 = t6._ensurePendingEvents$0();
|
|
t7 = new A._DelayedData(data, t7._eval$1("_DelayedData<1>"));
|
|
lastEvent = t6.lastPendingEvent;
|
|
if (lastEvent == null)
|
|
t6.firstPendingEvent = t6.lastPendingEvent = t7;
|
|
else {
|
|
lastEvent.set$next(t7);
|
|
t6.lastPendingEvent = t7;
|
|
}
|
|
}
|
|
t6 = _this._remainingContent;
|
|
if (t6 !== -1)
|
|
t6 = _this._remainingContent = t6 - data.length;
|
|
_this.__http$_index = _this.__http$_index + data.length;
|
|
if (t6 === 0)
|
|
if (!_this._chunked) {
|
|
_this._reset$0();
|
|
_this._closeIncoming$0();
|
|
} else
|
|
_this.__http$_state = 17;
|
|
break;
|
|
case 27:
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
_this._parserCalled = false;
|
|
},
|
|
__http$_onData$1(buffer) {
|
|
var _this = this;
|
|
_this.__http$_socketSubscription.pause$0();
|
|
_this.__http$_buffer = buffer;
|
|
_this.__http$_index = 0;
|
|
_this._parse$0();
|
|
},
|
|
__http$_onDone$0() {
|
|
var t1, t2, _this = this, _null = null,
|
|
_s49_ = "Connection closed before full header was received";
|
|
_this.__http$_socketSubscription = null;
|
|
t1 = _this.__http$_state;
|
|
if (t1 === 25 || t1 === 27)
|
|
return;
|
|
if (_this._incoming != null) {
|
|
t2 = false;
|
|
if (t1 !== 26)
|
|
if (t1 !== 0) {
|
|
t2 = !(t1 === 24 && !_this._chunked && _this._transferLength === -1);
|
|
t1 = t2;
|
|
} else
|
|
t1 = t2;
|
|
else
|
|
t1 = t2;
|
|
if (t1)
|
|
_this._reportBodyError$1(new A.HttpException("Connection closed while receiving data", _null));
|
|
_this._closeIncoming$1(true);
|
|
_this._controller.close$0();
|
|
return;
|
|
}
|
|
if (t1 === 0) {
|
|
_this._reportHttpError$1(new A.HttpException(_s49_, _null));
|
|
_this._controller.close$0();
|
|
return;
|
|
}
|
|
if (t1 === 26) {
|
|
_this._controller.close$0();
|
|
return;
|
|
}
|
|
if (t1 < 17) {
|
|
_this.__http$_state = 27;
|
|
_this._reportHttpError$1(new A.HttpException(_s49_, _null));
|
|
_this._controller.close$0();
|
|
return;
|
|
}
|
|
if (!_this._chunked && _this._transferLength === -1)
|
|
_this.__http$_state = 25;
|
|
else {
|
|
_this.__http$_state = 27;
|
|
_this._reportHttpError$1(new A.HttpException("Connection closed before full body was received", _null));
|
|
}
|
|
_this._controller.close$0();
|
|
},
|
|
get$version() {
|
|
switch (this._httpVersion) {
|
|
case 1:
|
|
return "1.0";
|
|
case 2:
|
|
return "1.1";
|
|
}
|
|
return null;
|
|
},
|
|
_reset$0() {
|
|
var _this = this;
|
|
if (_this.__http$_state === 26)
|
|
return;
|
|
_this._messageType = _this.__http$_state = 0;
|
|
B.JSArray_methods.clear$0(_this._headerField);
|
|
B.JSArray_methods.clear$0(_this._headerValue);
|
|
_this._headersReceivedSize = 0;
|
|
B.JSArray_methods.clear$0(_this.__http$_method);
|
|
B.JSArray_methods.clear$0(_this._uriOrReasonPhrase);
|
|
_this._httpVersion = _this._statusCodeLength = _this._statusCode = 0;
|
|
_this._transferLength = -1;
|
|
_this._noMessageBody = _this._chunked = _this._connectionUpgrade = false;
|
|
_this._remainingContent = -1;
|
|
_this._transferEncoding = _this._contentLength = false;
|
|
_this._headers = null;
|
|
},
|
|
_expectHexDigit$1(byte) {
|
|
if (B.JSInt_methods.$le(48, byte) && byte.$le(0, 57))
|
|
return byte.$sub(0, 48);
|
|
else if (B.JSInt_methods.$le(65, byte) && byte.$le(0, 70))
|
|
return byte.$sub(0, 65) + 10;
|
|
else if (B.JSInt_methods.$le(97, byte) && byte.$le(0, 102))
|
|
return byte.$sub(0, 97) + 10;
|
|
else
|
|
throw A.wrapException(A.HttpException$("Failed to parse HTTP, " + A.S(byte) + " is expected to be a Hex digit", null));
|
|
},
|
|
_reportSizeLimitError$0() {
|
|
var method,
|
|
t1 = this.__http$_state;
|
|
switch (t1) {
|
|
case 0:
|
|
case 1:
|
|
case 3:
|
|
method = "Method";
|
|
break;
|
|
case 4:
|
|
method = "URI";
|
|
break;
|
|
case 8:
|
|
method = "Reason phrase";
|
|
break;
|
|
case 10:
|
|
case 11:
|
|
method = "Header field";
|
|
break;
|
|
case 12:
|
|
case 13:
|
|
method = "Header value";
|
|
break;
|
|
default:
|
|
throw A.wrapException(A.UnsupportedError$("Unexpected state: " + t1));
|
|
}
|
|
throw A.wrapException(A.HttpException$(method + " exceeds the 1048576 size limit", null));
|
|
},
|
|
_createIncoming$1(transferLength) {
|
|
var incoming, _this = this,
|
|
controller = _this._bodyController = A.StreamController_StreamController(true, type$.Uint8List),
|
|
t1 = _this._headers;
|
|
t1.toString;
|
|
incoming = _this._incoming = new A._HttpIncoming(new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_bool), type$._AsyncCompleter_bool), new A._ControllerStream(controller, A._instanceType(controller)._eval$1("_ControllerStream<1>")), t1);
|
|
controller.set$onListen(new A._HttpParser__createIncoming_closure(_this, incoming));
|
|
controller.set$onPause(new A._HttpParser__createIncoming_closure0(_this, incoming));
|
|
controller.set$onResume(new A._HttpParser__createIncoming_closure1(_this, incoming));
|
|
controller.set$onCancel(new A._HttpParser__createIncoming_closure2(_this, incoming));
|
|
_this._bodyPaused = true;
|
|
_this._pauseStateChanged$0();
|
|
return incoming;
|
|
},
|
|
_closeIncoming$1(closing) {
|
|
var controller, _this = this,
|
|
tmp = _this._incoming;
|
|
if (tmp == null)
|
|
return;
|
|
tmp.hasSubscriber = true;
|
|
tmp._dataCompleter.complete$1(closing);
|
|
_this._incoming = null;
|
|
controller = _this._bodyController;
|
|
if (controller != null) {
|
|
controller.close$0();
|
|
_this._bodyController = null;
|
|
}
|
|
_this._bodyPaused = false;
|
|
_this._pauseStateChanged$0();
|
|
},
|
|
_closeIncoming$0() {
|
|
return this._closeIncoming$1(false);
|
|
},
|
|
_pauseStateChanged$0() {
|
|
var _this = this;
|
|
if (_this._incoming != null) {
|
|
if (!_this._bodyPaused && !_this._parserCalled)
|
|
_this._parse$0();
|
|
} else if (!_this._paused && !_this._parserCalled)
|
|
_this._parse$0();
|
|
},
|
|
_reportHttpError$2(error, stackTrace) {
|
|
var t1;
|
|
this.__http$_state = 27;
|
|
t1 = this._controller;
|
|
t1.addError$2(error, type$.nullable_StackTrace._as(stackTrace));
|
|
t1.close$0();
|
|
},
|
|
_reportHttpError$1(error) {
|
|
return this._reportHttpError$2(error, null);
|
|
},
|
|
_reportBodyError$2(error, stackTrace) {
|
|
var t1;
|
|
this.__http$_state = 27;
|
|
t1 = this._bodyController;
|
|
if (t1 != null)
|
|
t1.addError$2(error, type$.nullable_StackTrace._as(stackTrace));
|
|
t1 = this._bodyController;
|
|
if (t1 != null)
|
|
t1.close$0();
|
|
},
|
|
_reportBodyError$1(error) {
|
|
return this._reportBodyError$2(error, null);
|
|
}
|
|
};
|
|
A._HttpParser$__closure.prototype = {
|
|
call$0() {
|
|
this.$this._paused = false;
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HttpParser$__closure0.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
t1._paused = true;
|
|
t1._pauseStateChanged$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HttpParser$__closure1.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
t1._paused = false;
|
|
t1._pauseStateChanged$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HttpParser$__closure2.prototype = {
|
|
call$0() {
|
|
},
|
|
$signature: 4
|
|
};
|
|
A._HttpParser__createIncoming_closure.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
if (this.incoming !== t1._incoming)
|
|
return;
|
|
t1._bodyPaused = false;
|
|
t1._pauseStateChanged$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HttpParser__createIncoming_closure0.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
if (this.incoming !== t1._incoming)
|
|
return;
|
|
t1._bodyPaused = true;
|
|
t1._pauseStateChanged$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HttpParser__createIncoming_closure1.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
if (this.incoming !== t1._incoming)
|
|
return;
|
|
t1._bodyPaused = false;
|
|
t1._pauseStateChanged$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HttpParser__createIncoming_closure2.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
if (this.incoming !== t1._incoming)
|
|
return;
|
|
t1._closeIncoming$1(true);
|
|
t1._controller.close$0();
|
|
},
|
|
$signature: 4
|
|
};
|
|
J.Interceptor.prototype = {
|
|
$eq(receiver, other) {
|
|
return receiver === other;
|
|
},
|
|
get$hashCode(receiver) {
|
|
return A.Primitives_objectHashCode(receiver);
|
|
},
|
|
toString$0(receiver) {
|
|
return "Instance of '" + A.Primitives_objectTypeName(receiver) + "'";
|
|
},
|
|
get$runtimeType(receiver) {
|
|
return A.createRuntimeType(A._instanceTypeFromConstructor(this));
|
|
}
|
|
};
|
|
J.JSBool.prototype = {
|
|
toString$0(receiver) {
|
|
return String(receiver);
|
|
},
|
|
get$hashCode(receiver) {
|
|
return receiver ? 519018 : 218159;
|
|
},
|
|
get$runtimeType(receiver) {
|
|
return A.createRuntimeType(type$.bool);
|
|
},
|
|
$isTrustedGetRuntimeType: 1,
|
|
$isbool: 1
|
|
};
|
|
J.JSNull.prototype = {
|
|
$eq(receiver, other) {
|
|
return null == other;
|
|
},
|
|
toString$0(receiver) {
|
|
return "null";
|
|
},
|
|
get$hashCode(receiver) {
|
|
return 0;
|
|
},
|
|
$isTrustedGetRuntimeType: 1,
|
|
$isNull: 1
|
|
};
|
|
J.JavaScriptObject.prototype = {$isJSObject: 1};
|
|
J.LegacyJavaScriptObject.prototype = {
|
|
get$hashCode(receiver) {
|
|
return 0;
|
|
},
|
|
toString$0(receiver) {
|
|
return String(receiver);
|
|
}
|
|
};
|
|
J.PlainJavaScriptObject.prototype = {};
|
|
J.UnknownJavaScriptObject.prototype = {};
|
|
J.JavaScriptFunction.prototype = {
|
|
toString$0(receiver) {
|
|
var dartClosure = receiver[$.$get$DART_CLOSURE_PROPERTY_NAME()];
|
|
if (dartClosure == null)
|
|
return this.super$LegacyJavaScriptObject$toString(receiver);
|
|
return "JavaScript function for " + J.toString$0$(dartClosure);
|
|
},
|
|
$isFunction: 1
|
|
};
|
|
J.JavaScriptBigInt.prototype = {
|
|
get$hashCode(receiver) {
|
|
return 0;
|
|
},
|
|
toString$0(receiver) {
|
|
return String(receiver);
|
|
}
|
|
};
|
|
J.JavaScriptSymbol.prototype = {
|
|
get$hashCode(receiver) {
|
|
return 0;
|
|
},
|
|
toString$0(receiver) {
|
|
return String(receiver);
|
|
}
|
|
};
|
|
J.JSArray.prototype = {
|
|
add$1(receiver, value) {
|
|
A._arrayInstanceType(receiver)._precomputed1._as(value);
|
|
receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, 29);
|
|
receiver.push(value);
|
|
},
|
|
remove$1(receiver, element) {
|
|
var i;
|
|
receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "remove", 1);
|
|
for (i = 0; i < receiver.length; ++i)
|
|
if (J.$eq$(receiver[i], element)) {
|
|
receiver.splice(i, 1);
|
|
return true;
|
|
}
|
|
return false;
|
|
},
|
|
addAll$1(receiver, collection) {
|
|
var t1, _i;
|
|
A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(collection);
|
|
receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "addAll", 2);
|
|
if (Array.isArray(collection)) {
|
|
this._addAllFromArray$1(receiver, collection);
|
|
return;
|
|
}
|
|
for (t1 = collection.length, _i = 0; _i < collection.length; collection.length === t1 || (0, A.throwConcurrentModificationError)(collection), ++_i)
|
|
receiver.push(collection[_i]);
|
|
},
|
|
_addAllFromArray$1(receiver, array) {
|
|
var len, i;
|
|
type$.JSArray_dynamic._as(array);
|
|
len = array.length;
|
|
if (len === 0)
|
|
return;
|
|
if (receiver === array)
|
|
throw A.wrapException(A.ConcurrentModificationError$(receiver));
|
|
for (i = 0; i < len; ++i)
|
|
receiver.push(array[i]);
|
|
},
|
|
clear$0(receiver) {
|
|
receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "clear", "clear");
|
|
receiver.length = 0;
|
|
},
|
|
join$1(receiver, separator) {
|
|
var i,
|
|
list = A.List_List$filled(receiver.length, "", false, type$.String);
|
|
for (i = 0; i < receiver.length; ++i)
|
|
this.$indexSet(list, i, A.S(receiver[i]));
|
|
return list.join(separator);
|
|
},
|
|
take$1(receiver, n) {
|
|
return A.SubListIterable$(receiver, 0, A.checkNotNullable(n, "count", type$.int), A._arrayInstanceType(receiver)._precomputed1);
|
|
},
|
|
skip$1(receiver, n) {
|
|
return A.SubListIterable$(receiver, n, null, A._arrayInstanceType(receiver)._precomputed1);
|
|
},
|
|
fold$1$2(receiver, initialValue, combine, $T) {
|
|
var $length, value, i;
|
|
$T._as(initialValue);
|
|
A._arrayInstanceType(receiver)._bind$1($T)._eval$1("1(1,2)")._as(combine);
|
|
$length = receiver.length;
|
|
for (value = initialValue, i = 0; i < $length; ++i) {
|
|
value = combine.call$2(value, receiver[i]);
|
|
if (receiver.length !== $length)
|
|
throw A.wrapException(A.ConcurrentModificationError$(receiver));
|
|
}
|
|
return value;
|
|
},
|
|
elementAt$1(receiver, index) {
|
|
if (!(index >= 0 && index < receiver.length))
|
|
return A.ioore(receiver, index);
|
|
return receiver[index];
|
|
},
|
|
get$last(receiver) {
|
|
var t1 = receiver.length;
|
|
if (t1 > 0)
|
|
return receiver[t1 - 1];
|
|
throw A.wrapException(A.IterableElementError_noElement());
|
|
},
|
|
indexOf$1(receiver, element) {
|
|
var i,
|
|
$length = receiver.length;
|
|
if (0 >= $length)
|
|
return -1;
|
|
for (i = 0; i < $length; ++i) {
|
|
if (!(i < receiver.length))
|
|
return A.ioore(receiver, i);
|
|
if (J.$eq$(receiver[i], element))
|
|
return i;
|
|
}
|
|
return -1;
|
|
},
|
|
contains$1(receiver, other) {
|
|
var i;
|
|
for (i = 0; i < receiver.length; ++i)
|
|
if (J.$eq$(receiver[i], other))
|
|
return true;
|
|
return false;
|
|
},
|
|
get$isEmpty(receiver) {
|
|
return receiver.length === 0;
|
|
},
|
|
get$isNotEmpty(receiver) {
|
|
return receiver.length !== 0;
|
|
},
|
|
toString$0(receiver) {
|
|
return A.Iterable_iterableToFullString(receiver, "[", "]");
|
|
},
|
|
get$iterator(receiver) {
|
|
return new J.ArrayIterator(receiver, receiver.length, A._arrayInstanceType(receiver)._eval$1("ArrayIterator<1>"));
|
|
},
|
|
get$hashCode(receiver) {
|
|
return A.Primitives_objectHashCode(receiver);
|
|
},
|
|
get$length(receiver) {
|
|
return receiver.length;
|
|
},
|
|
set$length(receiver, newLength) {
|
|
receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "set length", "change the length of");
|
|
if (newLength < 0)
|
|
throw A.wrapException(A.RangeError$range(newLength, 0, null, "newLength", null));
|
|
if (newLength > receiver.length)
|
|
A._arrayInstanceType(receiver)._precomputed1._as(null);
|
|
receiver.length = newLength;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
if (!(index >= 0 && index < receiver.length))
|
|
throw A.wrapException(A.diagnoseIndexError(receiver, index));
|
|
return receiver[index];
|
|
},
|
|
$indexSet(receiver, index, value) {
|
|
A._arrayInstanceType(receiver)._precomputed1._as(value);
|
|
receiver.$flags & 2 && A.throwUnsupportedOperation(receiver);
|
|
if (!(index >= 0 && index < receiver.length))
|
|
throw A.wrapException(A.diagnoseIndexError(receiver, index));
|
|
receiver[index] = value;
|
|
},
|
|
$isJSIndexable: 1,
|
|
$isIterable: 1,
|
|
$isList: 1
|
|
};
|
|
J.JSArraySafeToStringHook.prototype = {
|
|
tryFormat$1(array) {
|
|
var flags, info, base;
|
|
if (!Array.isArray(array))
|
|
return null;
|
|
flags = array.$flags | 0;
|
|
if ((flags & 4) !== 0)
|
|
info = "const, ";
|
|
else if ((flags & 2) !== 0)
|
|
info = "unmodifiable, ";
|
|
else
|
|
info = (flags & 1) !== 0 ? "fixed, " : "";
|
|
base = "Instance of '" + A.Primitives_objectTypeName(array) + "'";
|
|
if (info === "")
|
|
return base;
|
|
return base + " (" + info + "length: " + array.length + ")";
|
|
}
|
|
};
|
|
J.JSUnmodifiableArray.prototype = {};
|
|
J.ArrayIterator.prototype = {
|
|
get$current() {
|
|
var t1 = this._current;
|
|
return t1 == null ? this.$ti._precomputed1._as(t1) : t1;
|
|
},
|
|
moveNext$0() {
|
|
var t2, _this = this,
|
|
t1 = _this._iterable,
|
|
$length = t1.length;
|
|
if (_this._length !== $length) {
|
|
t1 = A.throwConcurrentModificationError(t1);
|
|
throw A.wrapException(t1);
|
|
}
|
|
t2 = _this._index;
|
|
if (t2 >= $length) {
|
|
_this._current = null;
|
|
return false;
|
|
}
|
|
_this._current = t1[t2];
|
|
_this._index = t2 + 1;
|
|
return true;
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
J.JSNumber.prototype = {
|
|
compareTo$1(receiver, b) {
|
|
var bIsNegative;
|
|
if (receiver < b)
|
|
return -1;
|
|
else if (receiver > b)
|
|
return 1;
|
|
else if (receiver === b) {
|
|
if (receiver === 0) {
|
|
bIsNegative = B.JSInt_methods.get$isNegative(b);
|
|
if (this.get$isNegative(receiver) === bIsNegative)
|
|
return 0;
|
|
if (this.get$isNegative(receiver))
|
|
return -1;
|
|
return 1;
|
|
}
|
|
return 0;
|
|
} else if (isNaN(receiver)) {
|
|
if (isNaN(b))
|
|
return 0;
|
|
return 1;
|
|
} else
|
|
return -1;
|
|
},
|
|
get$isNegative(receiver) {
|
|
return receiver === 0 ? 1 / receiver < 0 : receiver < 0;
|
|
},
|
|
abs$0(receiver) {
|
|
return Math.abs(receiver);
|
|
},
|
|
floor$0(receiver) {
|
|
var truncated, d;
|
|
if (receiver >= 0) {
|
|
if (receiver <= 2147483647)
|
|
return receiver | 0;
|
|
} else if (receiver >= -2147483648) {
|
|
truncated = receiver | 0;
|
|
return receiver === truncated ? truncated : truncated - 1;
|
|
}
|
|
d = Math.floor(receiver);
|
|
if (isFinite(d))
|
|
return d;
|
|
throw A.wrapException(A.UnsupportedError$("" + receiver + ".floor()"));
|
|
},
|
|
clamp$2(receiver, lowerLimit, upperLimit) {
|
|
if (B.JSInt_methods.compareTo$1(lowerLimit, upperLimit) > 0)
|
|
throw A.wrapException(A.argumentErrorValue(lowerLimit));
|
|
if (this.compareTo$1(receiver, lowerLimit) < 0)
|
|
return lowerLimit;
|
|
if (this.compareTo$1(receiver, upperLimit) > 0)
|
|
return upperLimit;
|
|
return receiver;
|
|
},
|
|
toRadixString$1(receiver, radix) {
|
|
var result, t1, t2, match, exponent;
|
|
if (radix < 2 || radix > 36)
|
|
throw A.wrapException(A.RangeError$range(radix, 2, 36, "radix", null));
|
|
result = receiver.toString(radix);
|
|
t1 = result.length;
|
|
t2 = t1 - 1;
|
|
if (!(t2 >= 0))
|
|
return A.ioore(result, t2);
|
|
if (result.charCodeAt(t2) !== 41)
|
|
return result;
|
|
match = /^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(result);
|
|
if (match == null)
|
|
A.throwExpression(A.UnsupportedError$("Unexpected toString result: " + result));
|
|
t1 = match.length;
|
|
if (1 >= t1)
|
|
return A.ioore(match, 1);
|
|
result = match[1];
|
|
if (3 >= t1)
|
|
return A.ioore(match, 3);
|
|
exponent = +match[3];
|
|
t1 = match[2];
|
|
if (t1 != null) {
|
|
result += t1;
|
|
exponent -= t1.length;
|
|
}
|
|
return result + B.JSString_methods.$mul("0", exponent);
|
|
},
|
|
toString$0(receiver) {
|
|
if (receiver === 0 && 1 / receiver < 0)
|
|
return "-0.0";
|
|
else
|
|
return "" + receiver;
|
|
},
|
|
get$hashCode(receiver) {
|
|
var absolute, floorLog2, factor, scaled,
|
|
intValue = receiver | 0;
|
|
if (receiver === intValue)
|
|
return intValue & 536870911;
|
|
absolute = Math.abs(receiver);
|
|
floorLog2 = Math.log(absolute) / 0.6931471805599453 | 0;
|
|
factor = Math.pow(2, floorLog2);
|
|
scaled = absolute < 1 ? absolute / factor : factor / absolute;
|
|
return ((scaled * 9007199254740992 | 0) + (scaled * 3542243181176521 | 0)) * 599197 + floorLog2 * 1259 & 536870911;
|
|
},
|
|
$add(receiver, other) {
|
|
return receiver + other;
|
|
},
|
|
$mod(receiver, other) {
|
|
var result = receiver % other;
|
|
if (result === 0)
|
|
return 0;
|
|
if (result > 0)
|
|
return result;
|
|
return result + other;
|
|
},
|
|
$tdiv(receiver, other) {
|
|
if ((receiver | 0) === receiver)
|
|
if (other >= 1 || other < -1)
|
|
return receiver / other | 0;
|
|
return this._tdivSlow$1(receiver, other);
|
|
},
|
|
_tdivFast$1(receiver, other) {
|
|
return (receiver | 0) === receiver ? receiver / other | 0 : this._tdivSlow$1(receiver, other);
|
|
},
|
|
_tdivSlow$1(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 A.wrapException(A.UnsupportedError$("Result of truncating division is " + A.S(quotient) + ": " + A.S(receiver) + " ~/ " + other));
|
|
},
|
|
$shl(receiver, other) {
|
|
return other > 31 ? 0 : receiver << other >>> 0;
|
|
},
|
|
_shrOtherPositive$1(receiver, other) {
|
|
var t1;
|
|
if (receiver > 0)
|
|
t1 = this._shrBothPositive$1(receiver, other);
|
|
else {
|
|
t1 = other > 31 ? 31 : other;
|
|
t1 = receiver >> t1 >>> 0;
|
|
}
|
|
return t1;
|
|
},
|
|
_shrReceiverPositive$1(receiver, other) {
|
|
if (0 > other)
|
|
throw A.wrapException(A.argumentErrorValue(other));
|
|
return this._shrBothPositive$1(receiver, other);
|
|
},
|
|
_shrBothPositive$1(receiver, other) {
|
|
return other > 31 ? 0 : receiver >>> other;
|
|
},
|
|
$le(receiver, other) {
|
|
return receiver <= other;
|
|
},
|
|
get$runtimeType(receiver) {
|
|
return A.createRuntimeType(type$.num);
|
|
},
|
|
$isdouble: 1,
|
|
$isnum: 1
|
|
};
|
|
J.JSInt.prototype = {
|
|
abs$0(receiver) {
|
|
return Math.abs(receiver);
|
|
},
|
|
get$runtimeType(receiver) {
|
|
return A.createRuntimeType(type$.int);
|
|
},
|
|
$isTrustedGetRuntimeType: 1,
|
|
$isint: 1
|
|
};
|
|
J.JSNumNotInt.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return A.createRuntimeType(type$.double);
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
J.JSString.prototype = {
|
|
codeUnitAt$1(receiver, index) {
|
|
if (index < 0)
|
|
throw A.wrapException(A.diagnoseIndexError(receiver, index));
|
|
if (index >= receiver.length)
|
|
A.throwExpression(A.diagnoseIndexError(receiver, index));
|
|
return receiver.charCodeAt(index);
|
|
},
|
|
endsWith$1(receiver, other) {
|
|
var otherLength = other.length,
|
|
t1 = receiver.length;
|
|
if (otherLength > t1)
|
|
return false;
|
|
return other === this.substring$1(receiver, t1 - otherLength);
|
|
},
|
|
replaceRange$3(receiver, start, end, replacement) {
|
|
var e = A.RangeError_checkValidRange(start, end, receiver.length);
|
|
return receiver.substring(0, start) + replacement + receiver.substring(e);
|
|
},
|
|
startsWith$2(receiver, pattern, index) {
|
|
var endIndex;
|
|
if (index < 0 || index > receiver.length)
|
|
throw A.wrapException(A.RangeError$range(index, 0, receiver.length, null, null));
|
|
endIndex = index + pattern.length;
|
|
if (endIndex > receiver.length)
|
|
return false;
|
|
return pattern === receiver.substring(index, endIndex);
|
|
},
|
|
startsWith$1(receiver, pattern) {
|
|
return this.startsWith$2(receiver, pattern, 0);
|
|
},
|
|
substring$2(receiver, start, end) {
|
|
return receiver.substring(start, A.RangeError_checkValidRange(start, end, receiver.length));
|
|
},
|
|
substring$1(receiver, start) {
|
|
return this.substring$2(receiver, start, null);
|
|
},
|
|
trim$0(receiver) {
|
|
var startIndex, t1, endIndex0,
|
|
result = receiver.trim(),
|
|
endIndex = result.length;
|
|
if (endIndex === 0)
|
|
return result;
|
|
if (0 >= endIndex)
|
|
return A.ioore(result, 0);
|
|
if (result.charCodeAt(0) === 133) {
|
|
startIndex = J.JSString__skipLeadingWhitespace(result, 1);
|
|
if (startIndex === endIndex)
|
|
return "";
|
|
} else
|
|
startIndex = 0;
|
|
t1 = endIndex - 1;
|
|
if (!(t1 >= 0))
|
|
return A.ioore(result, t1);
|
|
endIndex0 = result.charCodeAt(t1) === 133 ? J.JSString__skipTrailingWhitespace(result, t1) : endIndex;
|
|
if (startIndex === 0 && endIndex0 === endIndex)
|
|
return result;
|
|
return result.substring(startIndex, endIndex0);
|
|
},
|
|
$mul(receiver, times) {
|
|
var s, result;
|
|
if (0 >= times)
|
|
return "";
|
|
if (times === 1 || receiver.length === 0)
|
|
return receiver;
|
|
if (times !== times >>> 0)
|
|
throw A.wrapException(B.C_OutOfMemoryError);
|
|
for (s = receiver, result = ""; true;) {
|
|
if ((times & 1) === 1)
|
|
result = s + result;
|
|
times = times >>> 1;
|
|
if (times === 0)
|
|
break;
|
|
s += s;
|
|
}
|
|
return result;
|
|
},
|
|
padLeft$2(receiver, width, padding) {
|
|
var delta = width - receiver.length;
|
|
if (delta <= 0)
|
|
return receiver;
|
|
return this.$mul(padding, delta) + receiver;
|
|
},
|
|
indexOf$2(receiver, pattern, start) {
|
|
var t1;
|
|
if (start < 0 || start > receiver.length)
|
|
throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null));
|
|
t1 = receiver.indexOf(pattern, start);
|
|
return t1;
|
|
},
|
|
indexOf$1(receiver, pattern) {
|
|
return this.indexOf$2(receiver, pattern, 0);
|
|
},
|
|
lastIndexOf$2(receiver, pattern, start) {
|
|
var t1, t2;
|
|
if (start == null)
|
|
start = receiver.length;
|
|
else if (start < 0 || start > receiver.length)
|
|
throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null));
|
|
t1 = pattern.length;
|
|
t2 = receiver.length;
|
|
if (start + t1 > t2)
|
|
start = t2 - t1;
|
|
return receiver.lastIndexOf(pattern, start);
|
|
},
|
|
lastIndexOf$1(receiver, pattern) {
|
|
return this.lastIndexOf$2(receiver, pattern, null);
|
|
},
|
|
contains$1(receiver, other) {
|
|
return A.stringContainsUnchecked(receiver, other, 0);
|
|
},
|
|
toString$0(receiver) {
|
|
return receiver;
|
|
},
|
|
get$hashCode(receiver) {
|
|
var t1, hash, i;
|
|
for (t1 = receiver.length, hash = 0, i = 0; i < t1; ++i) {
|
|
hash = hash + receiver.charCodeAt(i) & 536870911;
|
|
hash = hash + ((hash & 524287) << 10) & 536870911;
|
|
hash ^= hash >> 6;
|
|
}
|
|
hash = hash + ((hash & 67108863) << 3) & 536870911;
|
|
hash ^= hash >> 11;
|
|
return hash + ((hash & 16383) << 15) & 536870911;
|
|
},
|
|
get$runtimeType(receiver) {
|
|
return A.createRuntimeType(type$.String);
|
|
},
|
|
get$length(receiver) {
|
|
return receiver.length;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
if (!(index >= 0 && index < receiver.length))
|
|
throw A.wrapException(A.diagnoseIndexError(receiver, index));
|
|
return receiver[index];
|
|
},
|
|
$isJSIndexable: 1,
|
|
$isTrustedGetRuntimeType: 1,
|
|
$isPattern: 1,
|
|
$isString: 1
|
|
};
|
|
A.CastStream.prototype = {
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var t2,
|
|
t1 = this.$ti;
|
|
t1._eval$1("~(2)?")._as(onData);
|
|
t2 = this._source.listen$3$cancelOnError$onDone(null, cancelOnError, type$.nullable_void_Function._as(onDone));
|
|
t1 = new A.CastStreamSubscription(t2, $.Zone__current, t1._eval$1("CastStreamSubscription<1,2>"));
|
|
t2.onData$1(t1.get$__internal$_onData());
|
|
t1.onData$1(onData);
|
|
t1.onError$1(onError);
|
|
return t1;
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
}
|
|
};
|
|
A.CastStreamSubscription.prototype = {
|
|
cancel$0() {
|
|
return this._source.cancel$0();
|
|
},
|
|
onData$1(handleData) {
|
|
var t1 = this.$ti;
|
|
t1._eval$1("~(2)?")._as(handleData);
|
|
this.__internal$_handleData = handleData == null ? null : type$.$env_1_1_dynamic._bind$1(t1._rest[1])._eval$1("1(2)")._as(handleData);
|
|
},
|
|
onError$1(handleError) {
|
|
var _this = this;
|
|
_this._source.onError$1(handleError);
|
|
if (handleError == null)
|
|
_this.__internal$_handleError = null;
|
|
else if (type$.void_Function_Object_StackTrace._is(handleError))
|
|
_this.__internal$_handleError = _this.__internal$_zone.registerBinaryCallback$3$1(handleError, type$.dynamic, type$.Object, type$.StackTrace);
|
|
else if (type$.void_Function_Object._is(handleError))
|
|
_this.__internal$_handleError = type$.dynamic_Function_Object._as(handleError);
|
|
else
|
|
throw A.wrapException(A.ArgumentError$(string$.handle, null));
|
|
},
|
|
__internal$_onData$1(data) {
|
|
var targetData, error, stack, handleError, t2, exception, _this = this,
|
|
t1 = _this.$ti;
|
|
t1._precomputed1._as(data);
|
|
t2 = _this.__internal$_handleData;
|
|
if (t2 == null)
|
|
return;
|
|
targetData = null;
|
|
try {
|
|
targetData = t1._rest[1]._as(data);
|
|
} catch (exception) {
|
|
error = A.unwrapException(exception);
|
|
stack = A.getTraceFromException(exception);
|
|
handleError = _this.__internal$_handleError;
|
|
if (handleError == null)
|
|
A._rootHandleError(A._asObject(error), type$.StackTrace._as(stack));
|
|
else {
|
|
t1 = type$.Object;
|
|
t2 = _this.__internal$_zone;
|
|
if (type$.void_Function_Object_StackTrace._is(handleError))
|
|
t2.runBinaryGuarded$2$3(handleError, error, stack, t1, type$.StackTrace);
|
|
else
|
|
t2.runUnaryGuarded$1$2(type$.void_Function_Object._as(handleError), error, t1);
|
|
}
|
|
return;
|
|
}
|
|
_this.__internal$_zone.runUnaryGuarded$1$2(t2, targetData, t1._rest[1]);
|
|
},
|
|
pause$1(resumeSignal) {
|
|
this._source.pause$1(resumeSignal);
|
|
},
|
|
pause$0() {
|
|
return this.pause$1(null);
|
|
},
|
|
resume$0() {
|
|
this._source.resume$0();
|
|
},
|
|
asFuture$1$1(futureValue, $E) {
|
|
return this._source.asFuture$1$1(futureValue, $E);
|
|
},
|
|
$isStreamSubscription: 1
|
|
};
|
|
A._BytesBuilder.prototype = {
|
|
add$1(_, bytes) {
|
|
var typedBytes;
|
|
type$.List_int._as(bytes);
|
|
typedBytes = type$.Uint8List._is(bytes) ? bytes : new Uint8Array(A._ensureNativeList(bytes));
|
|
B.JSArray_methods.add$1(this._chunks, typedBytes);
|
|
this.__internal$_length = this.__internal$_length + typedBytes.length;
|
|
},
|
|
takeBytes$0() {
|
|
var t2, t3, buffer, offset, _i, chunk, offset0, _this = this,
|
|
t1 = _this.__internal$_length;
|
|
if (t1 === 0)
|
|
return $.$get$_CopyingBytesBuilder__emptyList0();
|
|
t2 = _this._chunks;
|
|
t3 = t2.length;
|
|
if (t3 === 1) {
|
|
if (0 >= t3)
|
|
return A.ioore(t2, 0);
|
|
buffer = t2[0];
|
|
_this.__internal$_length = 0;
|
|
B.JSArray_methods.clear$0(t2);
|
|
return buffer;
|
|
}
|
|
buffer = new Uint8Array(t1);
|
|
for (offset = 0, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i, offset = offset0) {
|
|
chunk = t2[_i];
|
|
offset0 = offset + chunk.length;
|
|
B.NativeUint8List_methods.setRange$3(buffer, offset, offset0, chunk);
|
|
}
|
|
_this.__internal$_length = 0;
|
|
B.JSArray_methods.clear$0(t2);
|
|
return buffer;
|
|
},
|
|
get$length(_) {
|
|
return this.__internal$_length;
|
|
},
|
|
$isBytesBuilder: 1
|
|
};
|
|
A.LateError.prototype = {
|
|
toString$0(_) {
|
|
return "LateInitializationError: " + this._message;
|
|
}
|
|
};
|
|
A.CodeUnits.prototype = {
|
|
get$length(_) {
|
|
return this._string.length;
|
|
},
|
|
$index(_, i) {
|
|
var t1;
|
|
A._asInt(i);
|
|
t1 = this._string;
|
|
if (!(i >= 0 && i < t1.length))
|
|
return A.ioore(t1, i);
|
|
return t1.charCodeAt(i);
|
|
}
|
|
};
|
|
A.nullFuture_closure.prototype = {
|
|
call$0() {
|
|
return A.Future_Future$value(null, type$.void);
|
|
},
|
|
$signature: 25
|
|
};
|
|
A.SentinelValue.prototype = {};
|
|
A.EfficientLengthIterable.prototype = {};
|
|
A.ListIterable.prototype = {
|
|
get$iterator(_) {
|
|
var _this = this;
|
|
return new A.ListIterator(_this, _this.get$length(_this), A._instanceType(_this)._eval$1("ListIterator<ListIterable.E>"));
|
|
},
|
|
get$isEmpty(_) {
|
|
return this.get$length(this) === 0;
|
|
}
|
|
};
|
|
A.SubListIterable.prototype = {
|
|
get$_endIndex() {
|
|
var $length = J.get$length$asx(this.__internal$_iterable),
|
|
endOrLength = this._endOrLength;
|
|
if (endOrLength == null || endOrLength > $length)
|
|
return $length;
|
|
return endOrLength;
|
|
},
|
|
get$_startIndex() {
|
|
var $length = J.get$length$asx(this.__internal$_iterable),
|
|
t1 = this._start;
|
|
if (t1 > $length)
|
|
return $length;
|
|
return t1;
|
|
},
|
|
get$length(_) {
|
|
var endOrLength,
|
|
$length = J.get$length$asx(this.__internal$_iterable),
|
|
t1 = this._start;
|
|
if (t1 >= $length)
|
|
return 0;
|
|
endOrLength = this._endOrLength;
|
|
if (endOrLength == null || endOrLength >= $length)
|
|
return $length - t1;
|
|
return endOrLength - t1;
|
|
},
|
|
elementAt$1(_, index) {
|
|
var _this = this,
|
|
realIndex = _this.get$_startIndex() + index;
|
|
if (index < 0 || realIndex >= _this.get$_endIndex())
|
|
throw A.wrapException(A.IndexError$withLength(index, _this.get$length(0), _this, null, "index"));
|
|
return J.elementAt$1$ax(_this.__internal$_iterable, realIndex);
|
|
},
|
|
skip$1(_, count) {
|
|
var newStart, endOrLength, _this = this;
|
|
A.RangeError_checkNotNegative(count, "count");
|
|
newStart = _this._start + count;
|
|
endOrLength = _this._endOrLength;
|
|
if (endOrLength != null && newStart >= endOrLength)
|
|
return new A.EmptyIterable(_this.$ti._eval$1("EmptyIterable<1>"));
|
|
return A.SubListIterable$(_this.__internal$_iterable, newStart, endOrLength, _this.$ti._precomputed1);
|
|
}
|
|
};
|
|
A.ListIterator.prototype = {
|
|
get$current() {
|
|
var t1 = this.__internal$_current;
|
|
return t1 == null ? this.$ti._precomputed1._as(t1) : t1;
|
|
},
|
|
moveNext$0() {
|
|
var t3, _this = this,
|
|
t1 = _this.__internal$_iterable,
|
|
t2 = J.getInterceptor$asx(t1),
|
|
$length = t2.get$length(t1);
|
|
if (_this.__internal$_length !== $length)
|
|
throw A.wrapException(A.ConcurrentModificationError$(t1));
|
|
t3 = _this.__internal$_index;
|
|
if (t3 >= $length) {
|
|
_this.__internal$_current = null;
|
|
return false;
|
|
}
|
|
_this.__internal$_current = t2.elementAt$1(t1, t3);
|
|
++_this.__internal$_index;
|
|
return true;
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
A.MappedListIterable.prototype = {
|
|
get$length(_) {
|
|
return J.get$length$asx(this._source);
|
|
},
|
|
elementAt$1(_, index) {
|
|
return this._f.call$1(J.elementAt$1$ax(this._source, index));
|
|
}
|
|
};
|
|
A.WhereIterable.prototype = {
|
|
get$iterator(_) {
|
|
return new A.WhereIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, this.$ti._eval$1("WhereIterator<1>"));
|
|
}
|
|
};
|
|
A.WhereIterator.prototype = {
|
|
moveNext$0() {
|
|
var t1, t2;
|
|
for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();)
|
|
if (t2.call$1(t1.get$current()))
|
|
return true;
|
|
return false;
|
|
},
|
|
get$current() {
|
|
return this._iterator.get$current();
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
A.EmptyIterable.prototype = {
|
|
get$iterator(_) {
|
|
return B.C_EmptyIterator;
|
|
},
|
|
get$length(_) {
|
|
return 0;
|
|
}
|
|
};
|
|
A.EmptyIterator.prototype = {
|
|
moveNext$0() {
|
|
return false;
|
|
},
|
|
get$current() {
|
|
throw A.wrapException(A.IterableElementError_noElement());
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
A.FixedLengthListMixin.prototype = {
|
|
set$length(receiver, newLength) {
|
|
throw A.wrapException(A.UnsupportedError$("Cannot change the length of a fixed-length list"));
|
|
},
|
|
add$1(receiver, value) {
|
|
A.instanceType(receiver)._eval$1("FixedLengthListMixin.E")._as(value);
|
|
throw A.wrapException(A.UnsupportedError$("Cannot add to a fixed-length list"));
|
|
},
|
|
remove$1(receiver, element) {
|
|
throw A.wrapException(A.UnsupportedError$("Cannot remove from a fixed-length list"));
|
|
}
|
|
};
|
|
A.UnmodifiableListMixin.prototype = {
|
|
$indexSet(_, index, value) {
|
|
A._instanceType(this)._eval$1("UnmodifiableListMixin.E")._as(value);
|
|
throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list"));
|
|
},
|
|
set$length(_, newLength) {
|
|
throw A.wrapException(A.UnsupportedError$("Cannot change the length of an unmodifiable list"));
|
|
},
|
|
add$1(_, value) {
|
|
A._instanceType(this)._eval$1("UnmodifiableListMixin.E")._as(value);
|
|
throw A.wrapException(A.UnsupportedError$("Cannot add to an unmodifiable list"));
|
|
},
|
|
remove$1(_, element) {
|
|
throw A.wrapException(A.UnsupportedError$("Cannot remove from an unmodifiable list"));
|
|
}
|
|
};
|
|
A.UnmodifiableListBase.prototype = {};
|
|
A.ConstantMap.prototype = {
|
|
get$isEmpty(_) {
|
|
return this.get$length(this) === 0;
|
|
},
|
|
toString$0(_) {
|
|
return A.MapBase_mapToString(this);
|
|
},
|
|
$isMap: 1
|
|
};
|
|
A.ConstantStringMap.prototype = {
|
|
get$length(_) {
|
|
return this._values.length;
|
|
},
|
|
get$__js_helper$_keys() {
|
|
var keys = this.$keys;
|
|
if (keys == null) {
|
|
keys = Object.keys(this._jsIndex);
|
|
this.$keys = keys;
|
|
}
|
|
return keys;
|
|
},
|
|
containsKey$1(key) {
|
|
if ("__proto__" === key)
|
|
return false;
|
|
return this._jsIndex.hasOwnProperty(key);
|
|
},
|
|
$index(_, key) {
|
|
if (!this.containsKey$1(key))
|
|
return null;
|
|
return this._values[this._jsIndex[key]];
|
|
},
|
|
forEach$1(_, f) {
|
|
var keys, values, t1, i;
|
|
this.$ti._eval$1("~(1,2)")._as(f);
|
|
keys = this.get$__js_helper$_keys();
|
|
values = this._values;
|
|
for (t1 = keys.length, i = 0; i < t1; ++i)
|
|
f.call$2(keys[i], values[i]);
|
|
}
|
|
};
|
|
A.Primitives_initTicker_closure.prototype = {
|
|
call$0() {
|
|
return B.JSNumber_methods.floor$0(1000 * this.performance.now());
|
|
},
|
|
$signature: 26
|
|
};
|
|
A.SafeToStringHook.prototype = {};
|
|
A.TypeErrorDecoder.prototype = {
|
|
matchTypeError$1(message) {
|
|
var result, t1, _this = this,
|
|
match = new RegExp(_this._pattern).exec(message);
|
|
if (match == null)
|
|
return null;
|
|
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;
|
|
}
|
|
};
|
|
A.NullError.prototype = {
|
|
toString$0(_) {
|
|
return "Null check operator used on a null value";
|
|
}
|
|
};
|
|
A.JsNoSuchMethodError.prototype = {
|
|
toString$0(_) {
|
|
var t2, _this = this,
|
|
_s38_ = "NoSuchMethodError: method not found: '",
|
|
t1 = _this._method;
|
|
if (t1 == null)
|
|
return "NoSuchMethodError: " + _this.__js_helper$_message;
|
|
t2 = _this._receiver;
|
|
if (t2 == null)
|
|
return _s38_ + t1 + "' (" + _this.__js_helper$_message + ")";
|
|
return _s38_ + t1 + "' on '" + t2 + "' (" + _this.__js_helper$_message + ")";
|
|
}
|
|
};
|
|
A.UnknownJsTypeError.prototype = {
|
|
toString$0(_) {
|
|
var t1 = this.__js_helper$_message;
|
|
return t1.length === 0 ? "Error" : "Error: " + t1;
|
|
}
|
|
};
|
|
A.NullThrownFromJavaScriptException.prototype = {
|
|
toString$0(_) {
|
|
return "Throw of null ('" + (this._irritant === null ? "null" : "undefined") + "' from JavaScript)";
|
|
}
|
|
};
|
|
A.ExceptionAndStackTrace.prototype = {};
|
|
A._StackTrace.prototype = {
|
|
toString$0(_) {
|
|
var trace,
|
|
t1 = this._trace;
|
|
if (t1 != null)
|
|
return t1;
|
|
t1 = this._exception;
|
|
trace = t1 !== null && typeof t1 === "object" ? t1.stack : null;
|
|
return this._trace = trace == null ? "" : trace;
|
|
},
|
|
$isStackTrace: 1
|
|
};
|
|
A.Closure.prototype = {
|
|
toString$0(_) {
|
|
var $constructor = this.constructor,
|
|
$name = $constructor == null ? null : $constructor.name;
|
|
return "Closure '" + A.unminifyOrTag($name == null ? "unknown" : $name) + "'";
|
|
},
|
|
$isFunction: 1,
|
|
get$$call() {
|
|
return this;
|
|
},
|
|
"call*": "call$1",
|
|
$requiredArgCount: 1,
|
|
$defaultValues: null
|
|
};
|
|
A.Closure0Args.prototype = {"call*": "call$0", $requiredArgCount: 0};
|
|
A.Closure2Args.prototype = {"call*": "call$2", $requiredArgCount: 2};
|
|
A.TearOffClosure.prototype = {};
|
|
A.StaticClosure.prototype = {
|
|
toString$0(_) {
|
|
var $name = this.$static_name;
|
|
if ($name == null)
|
|
return "Closure of unknown static method";
|
|
return "Closure '" + A.unminifyOrTag($name) + "'";
|
|
}
|
|
};
|
|
A.BoundClosure.prototype = {
|
|
$eq(_, other) {
|
|
if (other == null)
|
|
return false;
|
|
if (this === other)
|
|
return true;
|
|
if (!(other instanceof A.BoundClosure))
|
|
return false;
|
|
return this.$_target === other.$_target && this._receiver === other._receiver;
|
|
},
|
|
get$hashCode(_) {
|
|
return (A.objectHashCode(this._receiver) ^ A.Primitives_objectHashCode(this.$_target)) >>> 0;
|
|
},
|
|
toString$0(_) {
|
|
return "Closure '" + this.$_name + "' of " + ("Instance of '" + A.Primitives_objectTypeName(this._receiver) + "'");
|
|
}
|
|
};
|
|
A.RuntimeError.prototype = {
|
|
toString$0(_) {
|
|
return "RuntimeError: " + this.message;
|
|
}
|
|
};
|
|
A.JsLinkedHashMap.prototype = {
|
|
get$length(_) {
|
|
return this.__js_helper$_length;
|
|
},
|
|
get$isEmpty(_) {
|
|
return this.__js_helper$_length === 0;
|
|
},
|
|
get$isNotEmpty(_) {
|
|
return this.__js_helper$_length !== 0;
|
|
},
|
|
get$keys() {
|
|
return new A.LinkedHashMapKeysIterable(this, A._instanceType(this)._eval$1("LinkedHashMapKeysIterable<1>"));
|
|
},
|
|
containsKey$1(key) {
|
|
var strings, nums;
|
|
if (typeof key == "string") {
|
|
strings = this._strings;
|
|
if (strings == null)
|
|
return false;
|
|
return strings[key] != null;
|
|
} else if (typeof key == "number" && (key & 0x3fffffff) === key) {
|
|
nums = this._nums;
|
|
if (nums == null)
|
|
return false;
|
|
return nums[key] != null;
|
|
} else
|
|
return this.internalContainsKey$1(key);
|
|
},
|
|
internalContainsKey$1(key) {
|
|
var rest = this.__js_helper$_rest;
|
|
if (rest == null)
|
|
return false;
|
|
return this.internalFindBucketIndex$2(rest[this.internalComputeHashCode$1(key)], key) >= 0;
|
|
},
|
|
addAll$1(_, other) {
|
|
A._instanceType(this)._eval$1("Map<1,2>")._as(other).forEach$1(0, new A.JsLinkedHashMap_addAll_closure(this));
|
|
},
|
|
$index(_, key) {
|
|
var strings, cell, t1, nums, _null = null;
|
|
if (typeof key == "string") {
|
|
strings = this._strings;
|
|
if (strings == null)
|
|
return _null;
|
|
cell = strings[key];
|
|
t1 = cell == null ? _null : cell.hashMapCellValue;
|
|
return t1;
|
|
} else if (typeof key == "number" && (key & 0x3fffffff) === key) {
|
|
nums = this._nums;
|
|
if (nums == null)
|
|
return _null;
|
|
cell = nums[key];
|
|
t1 = cell == null ? _null : cell.hashMapCellValue;
|
|
return t1;
|
|
} else
|
|
return this.internalGet$1(key);
|
|
},
|
|
internalGet$1(key) {
|
|
var bucket, index,
|
|
rest = this.__js_helper$_rest;
|
|
if (rest == null)
|
|
return null;
|
|
bucket = rest[this.internalComputeHashCode$1(key)];
|
|
index = this.internalFindBucketIndex$2(bucket, key);
|
|
if (index < 0)
|
|
return null;
|
|
return bucket[index].hashMapCellValue;
|
|
},
|
|
$indexSet(_, key, value) {
|
|
var strings, nums, rest, hash, bucket, index, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._precomputed1._as(key);
|
|
t1._rest[1]._as(value);
|
|
if (typeof key == "string") {
|
|
strings = _this._strings;
|
|
_this._addHashTableEntry$3(strings == null ? _this._strings = _this._newHashTable$0() : strings, key, value);
|
|
} else if (typeof key == "number" && (key & 0x3fffffff) === key) {
|
|
nums = _this._nums;
|
|
_this._addHashTableEntry$3(nums == null ? _this._nums = _this._newHashTable$0() : nums, key, value);
|
|
} else {
|
|
rest = _this.__js_helper$_rest;
|
|
if (rest == null)
|
|
rest = _this.__js_helper$_rest = _this._newHashTable$0();
|
|
hash = _this.internalComputeHashCode$1(key);
|
|
bucket = rest[hash];
|
|
if (bucket == null)
|
|
rest[hash] = [_this._newLinkedCell$2(key, value)];
|
|
else {
|
|
index = _this.internalFindBucketIndex$2(bucket, key);
|
|
if (index >= 0)
|
|
bucket[index].hashMapCellValue = value;
|
|
else
|
|
bucket.push(_this._newLinkedCell$2(key, value));
|
|
}
|
|
}
|
|
},
|
|
remove$1(_, key) {
|
|
var _this = this;
|
|
if (typeof key == "string")
|
|
return _this.__js_helper$_removeHashTableEntry$2(_this._strings, key);
|
|
else if (typeof key == "number" && (key & 0x3fffffff) === key)
|
|
return _this.__js_helper$_removeHashTableEntry$2(_this._nums, key);
|
|
else
|
|
return _this.internalRemove$1(key);
|
|
},
|
|
internalRemove$1(key) {
|
|
var hash, bucket, index, cell, _this = this,
|
|
rest = _this.__js_helper$_rest;
|
|
if (rest == null)
|
|
return null;
|
|
hash = _this.internalComputeHashCode$1(key);
|
|
bucket = rest[hash];
|
|
index = _this.internalFindBucketIndex$2(bucket, key);
|
|
if (index < 0)
|
|
return null;
|
|
cell = bucket.splice(index, 1)[0];
|
|
_this._unlinkCell$1(cell);
|
|
if (bucket.length === 0)
|
|
delete rest[hash];
|
|
return cell.hashMapCellValue;
|
|
},
|
|
forEach$1(_, action) {
|
|
var cell, modifications, _this = this;
|
|
A._instanceType(_this)._eval$1("~(1,2)")._as(action);
|
|
cell = _this._first;
|
|
modifications = _this._modifications;
|
|
for (; cell != null;) {
|
|
action.call$2(cell.hashMapCellKey, cell.hashMapCellValue);
|
|
if (modifications !== _this._modifications)
|
|
throw A.wrapException(A.ConcurrentModificationError$(_this));
|
|
cell = cell._next;
|
|
}
|
|
},
|
|
_addHashTableEntry$3(table, key, value) {
|
|
var cell,
|
|
t1 = A._instanceType(this);
|
|
t1._precomputed1._as(key);
|
|
t1._rest[1]._as(value);
|
|
cell = table[key];
|
|
if (cell == null)
|
|
table[key] = this._newLinkedCell$2(key, value);
|
|
else
|
|
cell.hashMapCellValue = value;
|
|
},
|
|
__js_helper$_removeHashTableEntry$2(table, key) {
|
|
var cell;
|
|
if (table == null)
|
|
return null;
|
|
cell = table[key];
|
|
if (cell == null)
|
|
return null;
|
|
this._unlinkCell$1(cell);
|
|
delete table[key];
|
|
return cell.hashMapCellValue;
|
|
},
|
|
_modified$0() {
|
|
this._modifications = this._modifications + 1 & 1073741823;
|
|
},
|
|
_newLinkedCell$2(key, value) {
|
|
var _this = this,
|
|
t1 = A._instanceType(_this),
|
|
cell = new A.LinkedHashMapCell(t1._precomputed1._as(key), t1._rest[1]._as(value));
|
|
if (_this._first == null)
|
|
_this._first = _this._last = cell;
|
|
else {
|
|
t1 = _this._last;
|
|
t1.toString;
|
|
cell._previous = t1;
|
|
_this._last = t1._next = cell;
|
|
}
|
|
++_this.__js_helper$_length;
|
|
_this._modified$0();
|
|
return cell;
|
|
},
|
|
_unlinkCell$1(cell) {
|
|
var _this = this,
|
|
previous = cell._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._modified$0();
|
|
},
|
|
internalComputeHashCode$1(key) {
|
|
return J.get$hashCode$(key) & 1073741823;
|
|
},
|
|
internalFindBucketIndex$2(bucket, key) {
|
|
var $length, i;
|
|
if (bucket == null)
|
|
return -1;
|
|
$length = bucket.length;
|
|
for (i = 0; i < $length; ++i)
|
|
if (J.$eq$(bucket[i].hashMapCellKey, key))
|
|
return i;
|
|
return -1;
|
|
},
|
|
toString$0(_) {
|
|
return A.MapBase_mapToString(this);
|
|
},
|
|
_newHashTable$0() {
|
|
var table = Object.create(null);
|
|
table["<non-identifier-key>"] = table;
|
|
delete table["<non-identifier-key>"];
|
|
return table;
|
|
},
|
|
$isLinkedHashMap: 1
|
|
};
|
|
A.JsLinkedHashMap_addAll_closure.prototype = {
|
|
call$2(key, value) {
|
|
var t1 = this.$this,
|
|
t2 = A._instanceType(t1);
|
|
t1.$indexSet(0, t2._precomputed1._as(key), t2._rest[1]._as(value));
|
|
},
|
|
$signature() {
|
|
return A._instanceType(this.$this)._eval$1("~(1,2)");
|
|
}
|
|
};
|
|
A.LinkedHashMapCell.prototype = {};
|
|
A.LinkedHashMapKeysIterable.prototype = {
|
|
get$length(_) {
|
|
return this._map.__js_helper$_length;
|
|
},
|
|
get$isEmpty(_) {
|
|
return this._map.__js_helper$_length === 0;
|
|
},
|
|
get$iterator(_) {
|
|
var t1 = this._map;
|
|
return new A.LinkedHashMapKeyIterator(t1, t1._modifications, t1._first, this.$ti._eval$1("LinkedHashMapKeyIterator<1>"));
|
|
}
|
|
};
|
|
A.LinkedHashMapKeyIterator.prototype = {
|
|
get$current() {
|
|
return this.__js_helper$_current;
|
|
},
|
|
moveNext$0() {
|
|
var cell, _this = this,
|
|
t1 = _this._map;
|
|
if (_this._modifications !== t1._modifications)
|
|
throw A.wrapException(A.ConcurrentModificationError$(t1));
|
|
cell = _this._cell;
|
|
if (cell == null) {
|
|
_this.__js_helper$_current = null;
|
|
return false;
|
|
} else {
|
|
_this.__js_helper$_current = cell.hashMapCellKey;
|
|
_this._cell = cell._next;
|
|
return true;
|
|
}
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
A.initHooks_closure.prototype = {
|
|
call$1(o) {
|
|
return this.getTag(o);
|
|
},
|
|
$signature: 27
|
|
};
|
|
A.initHooks_closure0.prototype = {
|
|
call$2(o, tag) {
|
|
return this.getUnknownTag(o, tag);
|
|
},
|
|
$signature: 62
|
|
};
|
|
A.initHooks_closure1.prototype = {
|
|
call$1(tag) {
|
|
return this.prototypeForTag(A._asString(tag));
|
|
},
|
|
$signature: 63
|
|
};
|
|
A.JSSyntaxRegExp.prototype = {
|
|
toString$0(_) {
|
|
return "RegExp/" + this.pattern + "/" + this._nativeRegExp.flags;
|
|
},
|
|
$isPattern: 1
|
|
};
|
|
A.NativeByteBuffer.prototype = {
|
|
get$lengthInBytes(receiver) {
|
|
return receiver.byteLength;
|
|
},
|
|
get$runtimeType(receiver) {
|
|
return B.Type_ByteBuffer_rqD;
|
|
},
|
|
asUint8List$2(receiver, offsetInBytes, $length) {
|
|
var t1 = new Uint8Array(receiver, offsetInBytes, $length);
|
|
return t1;
|
|
},
|
|
$isTrustedGetRuntimeType: 1,
|
|
$isNativeByteBuffer: 1
|
|
};
|
|
A.NativeTypedData.prototype = {
|
|
get$buffer(receiver) {
|
|
if (((receiver.$flags | 0) & 2) !== 0)
|
|
return new A._UnmodifiableNativeByteBufferView(receiver.buffer);
|
|
else
|
|
return receiver.buffer;
|
|
},
|
|
_invalidPosition$3(receiver, position, $length, $name) {
|
|
var t1 = A.RangeError$range(position, 0, $length, $name, null);
|
|
throw A.wrapException(t1);
|
|
},
|
|
_checkPosition$3(receiver, position, $length, $name) {
|
|
if (position >>> 0 !== position || position > $length)
|
|
this._invalidPosition$3(receiver, position, $length, $name);
|
|
}
|
|
};
|
|
A._UnmodifiableNativeByteBufferView.prototype = {
|
|
get$lengthInBytes(_) {
|
|
return this.__native_typed_data$_data.byteLength;
|
|
},
|
|
asUint8List$2(_, offsetInBytes, $length) {
|
|
var result = A.NativeUint8List_NativeUint8List$view(this.__native_typed_data$_data, offsetInBytes, $length);
|
|
result.$flags = 3;
|
|
return result;
|
|
}
|
|
};
|
|
A.NativeByteData.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_ByteData_9dB;
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeTypedArray.prototype = {
|
|
get$length(receiver) {
|
|
return receiver.length;
|
|
},
|
|
_setRangeFast$4(receiver, start, end, source, skipCount) {
|
|
var count, sourceLength,
|
|
targetLength = receiver.length;
|
|
this._checkPosition$3(receiver, start, targetLength, "start");
|
|
this._checkPosition$3(receiver, end, targetLength, "end");
|
|
if (start > end)
|
|
throw A.wrapException(A.RangeError$range(start, 0, end, null, null));
|
|
count = end - start;
|
|
sourceLength = source.length;
|
|
if (sourceLength - skipCount < count)
|
|
throw A.wrapException(A.StateError$("Not enough elements"));
|
|
if (skipCount !== 0 || sourceLength !== count)
|
|
source = source.subarray(skipCount, skipCount + count);
|
|
receiver.set(source, start);
|
|
},
|
|
$isJSIndexable: 1,
|
|
$isJavaScriptIndexingBehavior: 1
|
|
};
|
|
A.NativeTypedArrayOfDouble.prototype = {
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
$indexSet(receiver, index, value) {
|
|
A._asDouble(value);
|
|
receiver.$flags & 2 && A.throwUnsupportedOperation(receiver);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
receiver[index] = value;
|
|
},
|
|
$isIterable: 1,
|
|
$isList: 1
|
|
};
|
|
A.NativeTypedArrayOfInt.prototype = {
|
|
$indexSet(receiver, index, value) {
|
|
A._asInt(value);
|
|
receiver.$flags & 2 && A.throwUnsupportedOperation(receiver);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
receiver[index] = value;
|
|
},
|
|
setRange$4(receiver, start, end, iterable, skipCount) {
|
|
type$.Iterable_int._as(iterable);
|
|
receiver.$flags & 2 && A.throwUnsupportedOperation(receiver, 5);
|
|
if (type$.NativeTypedArrayOfInt._is(iterable)) {
|
|
this._setRangeFast$4(receiver, start, end, iterable, skipCount);
|
|
return;
|
|
}
|
|
this.super$ListBase$setRange(receiver, start, end, iterable, skipCount);
|
|
},
|
|
setRange$3(receiver, start, end, iterable) {
|
|
return this.setRange$4(receiver, start, end, iterable, 0);
|
|
},
|
|
$isIterable: 1,
|
|
$isList: 1
|
|
};
|
|
A.NativeFloat32List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Float32List_9Kz;
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeFloat64List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Float64List_9Kz;
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeInt16List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Int16List_s5h;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeInt32List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Int32List_O8Z;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeInt8List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Int8List_rFV;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeUint16List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Uint16List_kmP;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeUint32List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Uint32List_kmP;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeUint8ClampedList.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Uint8ClampedList_04U;
|
|
},
|
|
get$length(receiver) {
|
|
return receiver.length;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
$isTrustedGetRuntimeType: 1
|
|
};
|
|
A.NativeUint8List.prototype = {
|
|
get$runtimeType(receiver) {
|
|
return B.Type_Uint8List_8Eb;
|
|
},
|
|
get$length(receiver) {
|
|
return receiver.length;
|
|
},
|
|
$index(receiver, index) {
|
|
A._asInt(index);
|
|
A._checkValidIndex(index, receiver, receiver.length);
|
|
return receiver[index];
|
|
},
|
|
sublist$2(receiver, start, end) {
|
|
return new Uint8Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length)));
|
|
},
|
|
$isTrustedGetRuntimeType: 1,
|
|
$isNativeUint8List: 1,
|
|
$isUint8List: 1
|
|
};
|
|
A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.prototype = {};
|
|
A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {};
|
|
A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.prototype = {};
|
|
A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {};
|
|
A.Rti.prototype = {
|
|
_eval$1(recipe) {
|
|
return A._Universe_evalInEnvironment(init.typeUniverse, this, recipe);
|
|
},
|
|
_bind$1(typeOrTuple) {
|
|
return A._Universe_bind(init.typeUniverse, this, typeOrTuple);
|
|
}
|
|
};
|
|
A._FunctionParameters.prototype = {};
|
|
A._Type.prototype = {
|
|
toString$0(_) {
|
|
return A._rtiToString(this._rti, null);
|
|
}
|
|
};
|
|
A._Error.prototype = {
|
|
toString$0(_) {
|
|
return this.__rti$_message;
|
|
}
|
|
};
|
|
A._TypeError.prototype = {$isTypeError: 1};
|
|
A._AsyncRun__initializeScheduleImmediate_internalCallback.prototype = {
|
|
call$1(__wc0_formal) {
|
|
var t1 = this._box_0,
|
|
f = t1.storedCallback;
|
|
t1.storedCallback = null;
|
|
f.call$0();
|
|
},
|
|
$signature: 3
|
|
};
|
|
A._AsyncRun__initializeScheduleImmediate_closure.prototype = {
|
|
call$1(callback) {
|
|
var t1, t2;
|
|
this._box_0.storedCallback = type$.void_Function._as(callback);
|
|
t1 = this.div;
|
|
t2 = this.span;
|
|
t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2);
|
|
},
|
|
$signature: 64
|
|
};
|
|
A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = {
|
|
call$0() {
|
|
this.callback.call$0();
|
|
},
|
|
$signature: 4
|
|
};
|
|
A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback.prototype = {
|
|
call$0() {
|
|
this.callback.call$0();
|
|
},
|
|
$signature: 4
|
|
};
|
|
A._TimerImpl.prototype = {
|
|
_TimerImpl$2(milliseconds, callback) {
|
|
if (self.setTimeout != null)
|
|
this._handle = self.setTimeout(A.convertDartClosureToJS(new A._TimerImpl_internalCallback(this, callback), 0), milliseconds);
|
|
else
|
|
throw A.wrapException(A.UnsupportedError$("`setTimeout()` not found."));
|
|
},
|
|
cancel$0() {
|
|
if (self.setTimeout != null) {
|
|
var t1 = this._handle;
|
|
if (t1 == null)
|
|
return;
|
|
self.clearTimeout(t1);
|
|
this._handle = null;
|
|
} else
|
|
throw A.wrapException(A.UnsupportedError$("Canceling a timer."));
|
|
},
|
|
$isTimer: 1
|
|
};
|
|
A._TimerImpl_internalCallback.prototype = {
|
|
call$0() {
|
|
this.$this._handle = null;
|
|
this.callback.call$0();
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._AsyncAwaitCompleter.prototype = {
|
|
complete$1(value) {
|
|
var t2, _this = this,
|
|
t1 = _this.$ti;
|
|
t1._eval$1("1/?")._as(value);
|
|
if (value == null)
|
|
value = t1._precomputed1._as(value);
|
|
if (!_this.isSync)
|
|
_this._future._asyncComplete$1(value);
|
|
else {
|
|
t2 = _this._future;
|
|
if (t1._eval$1("Future<1>")._is(value))
|
|
t2._chainFuture$1(value);
|
|
else
|
|
t2._completeWithValue$1(value);
|
|
}
|
|
},
|
|
completeError$2(e, st) {
|
|
var t1 = this._future;
|
|
if (this.isSync)
|
|
t1._completeErrorObject$1(new A.AsyncError(e, st));
|
|
else
|
|
t1._asyncCompleteErrorObject$1(new A.AsyncError(e, st));
|
|
},
|
|
$isCompleter: 1
|
|
};
|
|
A._awaitOnObject_closure.prototype = {
|
|
call$1(result) {
|
|
return this.bodyFunction.call$2(0, result);
|
|
},
|
|
$signature: 13
|
|
};
|
|
A._awaitOnObject_closure0.prototype = {
|
|
call$2(error, stackTrace) {
|
|
this.bodyFunction.call$2(1, new A.ExceptionAndStackTrace(error, type$.StackTrace._as(stackTrace)));
|
|
},
|
|
$signature: 15
|
|
};
|
|
A._wrapJsFunctionForAsync_closure.prototype = {
|
|
call$2(errorCode, result) {
|
|
this.$protected(A._asInt(errorCode), result);
|
|
},
|
|
$signature: 99
|
|
};
|
|
A.AsyncError.prototype = {
|
|
toString$0(_) {
|
|
return A.S(this.error);
|
|
},
|
|
$isError: 1,
|
|
get$stackTrace() {
|
|
return this.stackTrace;
|
|
}
|
|
};
|
|
A.Future_wait_handleError.prototype = {
|
|
call$2(theError, theStackTrace) {
|
|
var t1, t2, _this = this;
|
|
A._asObject(theError);
|
|
type$.StackTrace._as(theStackTrace);
|
|
t1 = _this._box_0;
|
|
t2 = --t1.remaining;
|
|
if (t1.values != null) {
|
|
t1.values = null;
|
|
t1.error = theError;
|
|
t1.stackTrace = theStackTrace;
|
|
if (t2 === 0 || _this.eagerError)
|
|
_this._future._completeErrorObject$1(new A.AsyncError(theError, theStackTrace));
|
|
} else if (t2 === 0 && !_this.eagerError) {
|
|
t2 = t1.error;
|
|
t2.toString;
|
|
t1 = t1.stackTrace;
|
|
t1.toString;
|
|
_this._future._completeErrorObject$1(new A.AsyncError(t2, t1));
|
|
}
|
|
},
|
|
$signature: 2
|
|
};
|
|
A.Future_wait_closure.prototype = {
|
|
call$1(value) {
|
|
var remainingResults, valueList, t1, value0, t3, t4, _i, t5, _this = this,
|
|
t2 = _this.T;
|
|
t2._as(value);
|
|
t3 = _this._box_0;
|
|
remainingResults = --t3.remaining;
|
|
valueList = t3.values;
|
|
if (valueList != null) {
|
|
J.$indexSet$ax(valueList, _this.pos, value);
|
|
if (J.$eq$(remainingResults, 0)) {
|
|
t1 = A._setArrayType([], t2._eval$1("JSArray<0>"));
|
|
for (t3 = valueList, t4 = t3.length, _i = 0; _i < t3.length; t3.length === t4 || (0, A.throwConcurrentModificationError)(t3), ++_i) {
|
|
value0 = t3[_i];
|
|
t5 = value0;
|
|
if (t5 == null)
|
|
t5 = t2._as(t5);
|
|
J.add$1$ax(t1, t5);
|
|
}
|
|
_this._future._completeWithValue$1(t1);
|
|
}
|
|
} else if (J.$eq$(remainingResults, 0) && !_this.eagerError) {
|
|
t1 = t3.error;
|
|
t1.toString;
|
|
t3 = t3.stackTrace;
|
|
t3.toString;
|
|
_this._future._completeErrorObject$1(new A.AsyncError(t1, t3));
|
|
}
|
|
},
|
|
$signature() {
|
|
return this.T._eval$1("Null(0)");
|
|
}
|
|
};
|
|
A.TimeoutException.prototype = {
|
|
toString$0(_) {
|
|
var t1 = this.duration.toString$0(0);
|
|
return "TimeoutException after " + t1 + ": " + this.message;
|
|
}
|
|
};
|
|
A._Completer.prototype = {
|
|
completeError$2(error, stackTrace) {
|
|
var t1;
|
|
A._asObject(error);
|
|
type$.nullable_StackTrace._as(stackTrace);
|
|
t1 = this.future;
|
|
if ((t1._state & 30) !== 0)
|
|
throw A.wrapException(A.StateError$("Future already completed"));
|
|
t1._asyncCompleteErrorObject$1(A._interceptUserError(error, stackTrace));
|
|
},
|
|
completeError$1(error) {
|
|
return this.completeError$2(error, null);
|
|
},
|
|
$isCompleter: 1
|
|
};
|
|
A._AsyncCompleter.prototype = {
|
|
complete$1(value) {
|
|
var t2,
|
|
t1 = this.$ti;
|
|
t1._eval$1("1/?")._as(value);
|
|
t2 = this.future;
|
|
if ((t2._state & 30) !== 0)
|
|
throw A.wrapException(A.StateError$("Future already completed"));
|
|
t2._asyncComplete$1(t1._eval$1("1/")._as(value));
|
|
}
|
|
};
|
|
A._FutureListener.prototype = {
|
|
matchesErrorTest$1(asyncError) {
|
|
if ((this.state & 15) !== 6)
|
|
return true;
|
|
return this.result._zone.runUnary$2$2(type$.bool_Function_Object._as(this.callback), asyncError.error, type$.bool, type$.Object);
|
|
},
|
|
handleError$1(asyncError) {
|
|
var exception, _this = this,
|
|
errorCallback = _this.errorCallback,
|
|
result = null,
|
|
t1 = type$.dynamic,
|
|
t2 = type$.Object,
|
|
t3 = asyncError.error,
|
|
t4 = _this.result._zone;
|
|
if (type$.dynamic_Function_Object_StackTrace._is(errorCallback))
|
|
result = t4.runBinary$3$3(errorCallback, t3, asyncError.stackTrace, t1, t2, type$.StackTrace);
|
|
else
|
|
result = t4.runUnary$2$2(type$.dynamic_Function_Object._as(errorCallback), t3, t1, t2);
|
|
try {
|
|
t1 = _this.$ti._eval$1("2/")._as(result);
|
|
return t1;
|
|
} catch (exception) {
|
|
if (type$.TypeError._is(A.unwrapException(exception))) {
|
|
if ((_this.state & 1) !== 0)
|
|
throw A.wrapException(A.ArgumentError$("The error handler of Future.then must return a value of the returned future's type", "onError"));
|
|
throw A.wrapException(A.ArgumentError$("The error handler of Future.catchError must return a value of the future's type", "onError"));
|
|
} else
|
|
throw exception;
|
|
}
|
|
}
|
|
};
|
|
A._Future.prototype = {
|
|
then$1$2$onError(f, onError, $R) {
|
|
var currentZone, result, t2,
|
|
t1 = this.$ti;
|
|
t1._bind$1($R)._eval$1("1/(2)")._as(f);
|
|
currentZone = $.Zone__current;
|
|
if (currentZone === B.C__RootZone) {
|
|
if (onError != null && !type$.dynamic_Function_Object_StackTrace._is(onError) && !type$.dynamic_Function_Object._is(onError))
|
|
throw A.wrapException(A.ArgumentError$value(onError, "onError", string$.Error_));
|
|
} else {
|
|
$R._eval$1("@<0/>")._bind$1(t1._precomputed1)._eval$1("1(2)")._as(f);
|
|
if (onError != null)
|
|
onError = A._registerErrorHandler(onError, currentZone);
|
|
}
|
|
result = new A._Future(currentZone, $R._eval$1("_Future<0>"));
|
|
t2 = onError == null ? 1 : 3;
|
|
this._addListener$1(new A._FutureListener(result, t2, f, onError, t1._eval$1("@<1>")._bind$1($R)._eval$1("_FutureListener<1,2>")));
|
|
return result;
|
|
},
|
|
then$1$1(f, $R) {
|
|
return this.then$1$2$onError(f, null, $R);
|
|
},
|
|
_thenAwait$1$2(f, onError, $E) {
|
|
var result,
|
|
t1 = this.$ti;
|
|
t1._bind$1($E)._eval$1("1/(2)")._as(f);
|
|
result = new A._Future($.Zone__current, $E._eval$1("_Future<0>"));
|
|
this._addListener$1(new A._FutureListener(result, 19, f, onError, t1._eval$1("@<1>")._bind$1($E)._eval$1("_FutureListener<1,2>")));
|
|
return result;
|
|
},
|
|
catchError$2$test(onError, test) {
|
|
var t1, t2, result;
|
|
type$.nullable_bool_Function_Object._as(test);
|
|
t1 = this.$ti;
|
|
t2 = $.Zone__current;
|
|
result = new A._Future(t2, t1);
|
|
if (t2 !== B.C__RootZone) {
|
|
onError = A._registerErrorHandler(onError, t2);
|
|
if (test != null)
|
|
test = type$.bool_Function_Object._as(test);
|
|
}
|
|
t2 = test == null ? 2 : 6;
|
|
this._addListener$1(new A._FutureListener(result, t2, test, onError, t1._eval$1("_FutureListener<1,1>")));
|
|
return result;
|
|
},
|
|
catchError$1(onError) {
|
|
return this.catchError$2$test(onError, null);
|
|
},
|
|
whenComplete$1(action) {
|
|
var t1, result;
|
|
type$.dynamic_Function._as(action);
|
|
t1 = this.$ti;
|
|
result = new A._Future($.Zone__current, t1);
|
|
this._addListener$1(new A._FutureListener(result, 8, action, null, t1._eval$1("_FutureListener<1,1>")));
|
|
return result;
|
|
},
|
|
_setErrorObject$1(error) {
|
|
this._state = this._state & 1 | 16;
|
|
this._resultOrListeners = error;
|
|
},
|
|
_cloneResult$1(source) {
|
|
this._state = source._state & 30 | this._state & 1;
|
|
this._resultOrListeners = source._resultOrListeners;
|
|
},
|
|
_addListener$1(listener) {
|
|
var source, _this = this,
|
|
t1 = _this._state;
|
|
if (t1 <= 3) {
|
|
listener._nextListener = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners);
|
|
_this._resultOrListeners = listener;
|
|
} else {
|
|
if ((t1 & 4) !== 0) {
|
|
source = type$._Future_dynamic._as(_this._resultOrListeners);
|
|
if ((source._state & 24) === 0) {
|
|
source._addListener$1(listener);
|
|
return;
|
|
}
|
|
_this._cloneResult$1(source);
|
|
}
|
|
A._rootScheduleMicrotask(null, null, _this._zone, type$.void_Function._as(new A._Future__addListener_closure(_this, listener)));
|
|
}
|
|
},
|
|
_prependListeners$1(listeners) {
|
|
var t1, existingListeners, next, cursor, next0, source, _this = this, _box_0 = {};
|
|
_box_0.listeners = listeners;
|
|
if (listeners == null)
|
|
return;
|
|
t1 = _this._state;
|
|
if (t1 <= 3) {
|
|
existingListeners = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners);
|
|
_this._resultOrListeners = listeners;
|
|
if (existingListeners != null) {
|
|
next = listeners._nextListener;
|
|
for (cursor = listeners; next != null; cursor = next, next = next0)
|
|
next0 = next._nextListener;
|
|
cursor._nextListener = existingListeners;
|
|
}
|
|
} else {
|
|
if ((t1 & 4) !== 0) {
|
|
source = type$._Future_dynamic._as(_this._resultOrListeners);
|
|
if ((source._state & 24) === 0) {
|
|
source._prependListeners$1(listeners);
|
|
return;
|
|
}
|
|
_this._cloneResult$1(source);
|
|
}
|
|
_box_0.listeners = _this._reverseListeners$1(listeners);
|
|
A._rootScheduleMicrotask(null, null, _this._zone, type$.void_Function._as(new A._Future__prependListeners_closure(_box_0, _this)));
|
|
}
|
|
},
|
|
_removeListeners$0() {
|
|
var current = type$.nullable__FutureListener_dynamic_dynamic._as(this._resultOrListeners);
|
|
this._resultOrListeners = null;
|
|
return this._reverseListeners$1(current);
|
|
},
|
|
_reverseListeners$1(listeners) {
|
|
var current, prev, next;
|
|
for (current = listeners, prev = null; current != null; prev = current, current = next) {
|
|
next = current._nextListener;
|
|
current._nextListener = prev;
|
|
}
|
|
return prev;
|
|
},
|
|
_complete$1(value) {
|
|
var listeners, _this = this,
|
|
t1 = _this.$ti;
|
|
t1._eval$1("1/")._as(value);
|
|
if (t1._eval$1("Future<1>")._is(value))
|
|
A._Future__chainCoreFuture(value, _this, true);
|
|
else {
|
|
listeners = _this._removeListeners$0();
|
|
t1._precomputed1._as(value);
|
|
_this._state = 8;
|
|
_this._resultOrListeners = value;
|
|
A._Future__propagateToListeners(_this, listeners);
|
|
}
|
|
},
|
|
_completeWithValue$1(value) {
|
|
var listeners, _this = this;
|
|
_this.$ti._precomputed1._as(value);
|
|
listeners = _this._removeListeners$0();
|
|
_this._state = 8;
|
|
_this._resultOrListeners = value;
|
|
A._Future__propagateToListeners(_this, listeners);
|
|
},
|
|
_completeWithResultOf$1(source) {
|
|
var t1, listeners, _this = this;
|
|
if ((source._state & 16) !== 0) {
|
|
t1 = _this._zone === source._zone;
|
|
t1 = !(t1 || t1);
|
|
} else
|
|
t1 = false;
|
|
if (t1)
|
|
return;
|
|
listeners = _this._removeListeners$0();
|
|
_this._cloneResult$1(source);
|
|
A._Future__propagateToListeners(_this, listeners);
|
|
},
|
|
_completeErrorObject$1(error) {
|
|
var listeners = this._removeListeners$0();
|
|
this._setErrorObject$1(error);
|
|
A._Future__propagateToListeners(this, listeners);
|
|
},
|
|
_completeError$2(error, stackTrace) {
|
|
A._asObject(error);
|
|
type$.StackTrace._as(stackTrace);
|
|
this._completeErrorObject$1(new A.AsyncError(error, stackTrace));
|
|
},
|
|
_asyncComplete$1(value) {
|
|
var t1 = this.$ti;
|
|
t1._eval$1("1/")._as(value);
|
|
if (t1._eval$1("Future<1>")._is(value)) {
|
|
this._chainFuture$1(value);
|
|
return;
|
|
}
|
|
this._asyncCompleteWithValue$1(value);
|
|
},
|
|
_asyncCompleteWithValue$1(value) {
|
|
var _this = this;
|
|
_this.$ti._precomputed1._as(value);
|
|
_this._state ^= 2;
|
|
A._rootScheduleMicrotask(null, null, _this._zone, type$.void_Function._as(new A._Future__asyncCompleteWithValue_closure(_this, value)));
|
|
},
|
|
_chainFuture$1(value) {
|
|
A._Future__chainCoreFuture(this.$ti._eval$1("Future<1>")._as(value), this, false);
|
|
return;
|
|
},
|
|
_asyncCompleteErrorObject$1(error) {
|
|
this._state ^= 2;
|
|
A._rootScheduleMicrotask(null, null, this._zone, type$.void_Function._as(new A._Future__asyncCompleteErrorObject_closure(this, error)));
|
|
},
|
|
timeout$1(timeLimit) {
|
|
var _future, _this = this, t1 = {};
|
|
if ((_this._state & 24) !== 0) {
|
|
t1 = new A._Future($.Zone__current, _this.$ti);
|
|
t1._asyncComplete$1(_this);
|
|
return t1;
|
|
}
|
|
_future = new A._Future($.Zone__current, _this.$ti);
|
|
t1.timer = null;
|
|
t1.timer = A.Timer_Timer(timeLimit, new A._Future_timeout_closure(_future, timeLimit));
|
|
_this.then$1$2$onError(new A._Future_timeout_closure0(t1, _this, _future), new A._Future_timeout_closure1(t1, _future), type$.Null);
|
|
return _future;
|
|
},
|
|
$isFuture: 1
|
|
};
|
|
A._Future__addListener_closure.prototype = {
|
|
call$0() {
|
|
A._Future__propagateToListeners(this.$this, this.listener);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future__prependListeners_closure.prototype = {
|
|
call$0() {
|
|
A._Future__propagateToListeners(this.$this, this._box_0.listeners);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future__chainCoreFuture_closure.prototype = {
|
|
call$0() {
|
|
A._Future__chainCoreFuture(this._box_0.source, this.target, true);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future__asyncCompleteWithValue_closure.prototype = {
|
|
call$0() {
|
|
this.$this._completeWithValue$1(this.value);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future__asyncCompleteErrorObject_closure.prototype = {
|
|
call$0() {
|
|
this.$this._completeErrorObject$1(this.error);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future__propagateToListeners_handleWhenCompleteCallback.prototype = {
|
|
call$0() {
|
|
var e, s, t1, exception, t2, t3, originalSource, joinedResult, _this = this, completeResult = null;
|
|
try {
|
|
t1 = _this._box_0.listener;
|
|
completeResult = t1.result._zone.run$1$1(type$.dynamic_Function._as(t1.callback), type$.dynamic);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
if (_this.hasError && type$.AsyncError._as(_this._box_1.source._resultOrListeners).error === e) {
|
|
t1 = _this._box_0;
|
|
t1.listenerValueOrError = type$.AsyncError._as(_this._box_1.source._resultOrListeners);
|
|
} else {
|
|
t1 = e;
|
|
t2 = s;
|
|
if (t2 == null)
|
|
t2 = A.AsyncError_defaultStackTrace(t1);
|
|
t3 = _this._box_0;
|
|
t3.listenerValueOrError = new A.AsyncError(t1, t2);
|
|
t1 = t3;
|
|
}
|
|
t1.listenerHasError = true;
|
|
return;
|
|
}
|
|
if (completeResult instanceof A._Future && (completeResult._state & 24) !== 0) {
|
|
if ((completeResult._state & 16) !== 0) {
|
|
t1 = _this._box_0;
|
|
t1.listenerValueOrError = type$.AsyncError._as(completeResult._resultOrListeners);
|
|
t1.listenerHasError = true;
|
|
}
|
|
return;
|
|
}
|
|
if (completeResult instanceof A._Future) {
|
|
originalSource = _this._box_1.source;
|
|
joinedResult = new A._Future(originalSource._zone, originalSource.$ti);
|
|
completeResult.then$1$2$onError(new A._Future__propagateToListeners_handleWhenCompleteCallback_closure(joinedResult, originalSource), new A._Future__propagateToListeners_handleWhenCompleteCallback_closure0(joinedResult), type$.void);
|
|
t1 = _this._box_0;
|
|
t1.listenerValueOrError = joinedResult;
|
|
t1.listenerHasError = false;
|
|
}
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future__propagateToListeners_handleWhenCompleteCallback_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
this.joinedResult._completeWithResultOf$1(this.originalSource);
|
|
},
|
|
$signature: 3
|
|
};
|
|
A._Future__propagateToListeners_handleWhenCompleteCallback_closure0.prototype = {
|
|
call$2(e, s) {
|
|
A._asObject(e);
|
|
type$.StackTrace._as(s);
|
|
this.joinedResult._completeErrorObject$1(new A.AsyncError(e, s));
|
|
},
|
|
$signature: 9
|
|
};
|
|
A._Future__propagateToListeners_handleValueCallback.prototype = {
|
|
call$0() {
|
|
var e, s, t1, t2, t3, t4, t5, exception;
|
|
try {
|
|
t1 = this._box_0;
|
|
t2 = t1.listener;
|
|
t3 = t2.$ti;
|
|
t4 = t3._precomputed1;
|
|
t5 = t4._as(this.sourceResult);
|
|
t1.listenerValueOrError = t2.result._zone.runUnary$2$2(t3._eval$1("2/(1)")._as(t2.callback), t5, t3._eval$1("2/"), t4);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
t1 = e;
|
|
t2 = s;
|
|
if (t2 == null)
|
|
t2 = A.AsyncError_defaultStackTrace(t1);
|
|
t3 = this._box_0;
|
|
t3.listenerValueOrError = new A.AsyncError(t1, t2);
|
|
t3.listenerHasError = true;
|
|
}
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future__propagateToListeners_handleError.prototype = {
|
|
call$0() {
|
|
var asyncError, e, s, t1, exception, t2, t3, _this = this;
|
|
try {
|
|
asyncError = type$.AsyncError._as(_this._box_1.source._resultOrListeners);
|
|
t1 = _this._box_0;
|
|
if (t1.listener.matchesErrorTest$1(asyncError) && t1.listener.errorCallback != null) {
|
|
t1.listenerValueOrError = t1.listener.handleError$1(asyncError);
|
|
t1.listenerHasError = false;
|
|
}
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
t1 = type$.AsyncError._as(_this._box_1.source._resultOrListeners);
|
|
if (t1.error === e) {
|
|
t2 = _this._box_0;
|
|
t2.listenerValueOrError = t1;
|
|
t1 = t2;
|
|
} else {
|
|
t1 = e;
|
|
t2 = s;
|
|
if (t2 == null)
|
|
t2 = A.AsyncError_defaultStackTrace(t1);
|
|
t3 = _this._box_0;
|
|
t3.listenerValueOrError = new A.AsyncError(t1, t2);
|
|
t1 = t3;
|
|
}
|
|
t1.listenerHasError = true;
|
|
}
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future_timeout_closure.prototype = {
|
|
call$0() {
|
|
var t1 = A.StackTrace_current();
|
|
this._future._completeErrorObject$1(new A.AsyncError(new A.TimeoutException("Future not completed", this.timeLimit), t1));
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._Future_timeout_closure0.prototype = {
|
|
call$1(v) {
|
|
var t1;
|
|
this.$this.$ti._precomputed1._as(v);
|
|
t1 = this._box_0.timer;
|
|
if (t1._handle != null) {
|
|
t1.cancel$0();
|
|
this._future._completeWithValue$1(v);
|
|
}
|
|
},
|
|
$signature() {
|
|
return this.$this.$ti._eval$1("Null(1)");
|
|
}
|
|
};
|
|
A._Future_timeout_closure1.prototype = {
|
|
call$2(e, s) {
|
|
var t1;
|
|
A._asObject(e);
|
|
type$.StackTrace._as(s);
|
|
t1 = this._box_0.timer;
|
|
if (t1._handle != null) {
|
|
t1.cancel$0();
|
|
this._future._completeErrorObject$1(new A.AsyncError(e, s));
|
|
}
|
|
},
|
|
$signature: 9
|
|
};
|
|
A._AsyncCallbackEntry.prototype = {};
|
|
A.Stream.prototype = {
|
|
handleError$2$test(onError, test) {
|
|
var callback;
|
|
type$.nullable_bool_Function_dynamic._as(test);
|
|
if (type$.void_Function_Object_StackTrace._is(onError))
|
|
callback = onError;
|
|
else if (type$.void_Function_Object._is(onError))
|
|
callback = new A.Stream_handleError_closure(onError);
|
|
else
|
|
throw A.wrapException(A.ArgumentError$value(onError, "onError", "Error handler must accept one Object or one Object and a StackTrace as arguments."));
|
|
return new A._HandleErrorStream(callback, test, this, A._instanceType(this)._eval$1("_HandleErrorStream<Stream.T>"));
|
|
},
|
|
join$0(_) {
|
|
var result = new A._Future($.Zone__current, type$._Future_String),
|
|
buffer = new A.StringBuffer(""),
|
|
subscription = this.listen$4$cancelOnError$onDone$onError(null, true, new A.Stream_join_closure(result, buffer), result.get$_completeError());
|
|
subscription.onData$1(new A.Stream_join_closure0(this, buffer, subscription, result));
|
|
return result;
|
|
},
|
|
get$length(_) {
|
|
var t1 = {},
|
|
future = new A._Future($.Zone__current, type$._Future_int);
|
|
t1.count = 0;
|
|
this.listen$4$cancelOnError$onDone$onError(new A.Stream_length_closure(t1, this), true, new A.Stream_length_closure0(t1, future), future.get$_completeError());
|
|
return future;
|
|
},
|
|
drain$1$0($E) {
|
|
var futureValue;
|
|
$E._as(null);
|
|
futureValue = null;
|
|
return this.listen$2$cancelOnError(null, true).asFuture$1$1(futureValue, $E);
|
|
}
|
|
};
|
|
A.Stream_handleError_closure.prototype = {
|
|
call$2(error, __wc0_formal) {
|
|
this.onError.call$1(error);
|
|
},
|
|
$signature: 2
|
|
};
|
|
A.Stream_join_closure.prototype = {
|
|
call$0() {
|
|
var t1 = this.buffer._contents;
|
|
this.result._complete$1(t1.charCodeAt(0) == 0 ? t1 : t1);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A.Stream_join_closure0.prototype = {
|
|
call$1(element) {
|
|
var e, s, t1, t2, exception, t3, _this = this;
|
|
A._instanceType(_this.$this)._eval$1("Stream.T")._as(element);
|
|
try {
|
|
t1 = _this.buffer;
|
|
t2 = A.S(element);
|
|
t1._contents += t2;
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
t1 = e;
|
|
t2 = s;
|
|
t3 = A._interceptError(t1, t2);
|
|
t1 = new A.AsyncError(t1, t2);
|
|
A._cancelAndError(_this.subscription, _this.result, t1);
|
|
}
|
|
},
|
|
$signature() {
|
|
return A._instanceType(this.$this)._eval$1("~(Stream.T)");
|
|
}
|
|
};
|
|
A.Stream_length_closure.prototype = {
|
|
call$1(__wc0_formal) {
|
|
A._instanceType(this.$this)._eval$1("Stream.T")._as(__wc0_formal);
|
|
++this._box_0.count;
|
|
},
|
|
$signature() {
|
|
return A._instanceType(this.$this)._eval$1("~(Stream.T)");
|
|
}
|
|
};
|
|
A.Stream_length_closure0.prototype = {
|
|
call$0() {
|
|
this.future._complete$1(this._box_0.count);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A.StreamTransformerBase.prototype = {$isStreamTransformer: 1};
|
|
A._StreamController.prototype = {
|
|
get$_pendingEvents() {
|
|
var t1, _this = this;
|
|
if ((_this._state & 8) === 0)
|
|
return A._instanceType(_this)._eval$1("_PendingEvents<1>?")._as(_this._varData);
|
|
t1 = A._instanceType(_this);
|
|
return t1._eval$1("_PendingEvents<1>?")._as(t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData)._varData);
|
|
},
|
|
_ensurePendingEvents$0() {
|
|
var events, t1, state, _this = this;
|
|
if ((_this._state & 8) === 0) {
|
|
events = _this._varData;
|
|
if (events == null)
|
|
events = _this._varData = new A._PendingEvents(A._instanceType(_this)._eval$1("_PendingEvents<1>"));
|
|
return A._instanceType(_this)._eval$1("_PendingEvents<1>")._as(events);
|
|
}
|
|
t1 = A._instanceType(_this);
|
|
state = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData);
|
|
events = state._varData;
|
|
if (events == null)
|
|
events = state._varData = new A._PendingEvents(t1._eval$1("_PendingEvents<1>"));
|
|
return t1._eval$1("_PendingEvents<1>")._as(events);
|
|
},
|
|
get$_subscription() {
|
|
var varData = this._varData;
|
|
if ((this._state & 8) !== 0)
|
|
varData = type$._StreamControllerAddStreamState_nullable_Object._as(varData)._varData;
|
|
return A._instanceType(this)._eval$1("_ControllerSubscription<1>")._as(varData);
|
|
},
|
|
_badEventState$0() {
|
|
if ((this._state & 4) !== 0)
|
|
return new A.StateError("Cannot add event after closing");
|
|
return new A.StateError("Cannot add event while adding a stream");
|
|
},
|
|
_ensureDoneFuture$0() {
|
|
var t1 = this._doneFuture;
|
|
if (t1 == null)
|
|
t1 = this._doneFuture = (this._state & 2) !== 0 ? $.$get$Future__nullFuture() : new A._Future($.Zone__current, type$._Future_void);
|
|
return t1;
|
|
},
|
|
add$1(_, value) {
|
|
var _this = this;
|
|
A._instanceType(_this)._precomputed1._as(value);
|
|
if (_this._state >= 4)
|
|
throw A.wrapException(_this._badEventState$0());
|
|
_this._add$1(value);
|
|
},
|
|
addError$2(error, stackTrace) {
|
|
var _0_0;
|
|
A._asObject(error);
|
|
type$.nullable_StackTrace._as(stackTrace);
|
|
if (this._state >= 4)
|
|
throw A.wrapException(this._badEventState$0());
|
|
_0_0 = A._interceptUserError(error, stackTrace);
|
|
this._addError$2(_0_0.error, _0_0.stackTrace);
|
|
},
|
|
addError$1(error) {
|
|
return this.addError$2(error, null);
|
|
},
|
|
close$0() {
|
|
var _this = this,
|
|
t1 = _this._state;
|
|
if ((t1 & 4) !== 0)
|
|
return _this._ensureDoneFuture$0();
|
|
if (t1 >= 4)
|
|
throw A.wrapException(_this._badEventState$0());
|
|
t1 = _this._state = t1 | 4;
|
|
if ((t1 & 1) !== 0)
|
|
_this._sendDone$0();
|
|
else if ((t1 & 3) === 0)
|
|
_this._ensurePendingEvents$0().add$1(0, B.C__DelayedDone);
|
|
return _this._ensureDoneFuture$0();
|
|
},
|
|
_add$1(value) {
|
|
var t2, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._precomputed1._as(value);
|
|
t2 = _this._state;
|
|
if ((t2 & 1) !== 0)
|
|
_this._sendData$1(value);
|
|
else if ((t2 & 3) === 0)
|
|
_this._ensurePendingEvents$0().add$1(0, new A._DelayedData(value, t1._eval$1("_DelayedData<1>")));
|
|
},
|
|
_addError$2(error, stackTrace) {
|
|
var t1 = this._state;
|
|
if ((t1 & 1) !== 0)
|
|
this._sendError$2(error, stackTrace);
|
|
else if ((t1 & 3) === 0)
|
|
this._ensurePendingEvents$0().add$1(0, new A._DelayedError(error, stackTrace));
|
|
},
|
|
_subscribe$4(onData, onError, onDone, cancelOnError) {
|
|
var t2, t3, t4, subscription, pendingEvents, addState, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._eval$1("~(1)?")._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
if ((_this._state & 3) !== 0)
|
|
throw A.wrapException(A.StateError$("Stream has already been listened to."));
|
|
t2 = $.Zone__current;
|
|
t3 = cancelOnError ? 1 : 0;
|
|
t4 = onError != null ? 32 : 0;
|
|
subscription = new A._ControllerSubscription(_this, A._BufferingStreamSubscription__registerDataHandler(t2, onData, t1._precomputed1), A._BufferingStreamSubscription__registerErrorHandler(t2, onError), A._BufferingStreamSubscription__registerDoneHandler(t2, onDone), t2, t3 | t4, t1._eval$1("_ControllerSubscription<1>"));
|
|
pendingEvents = _this.get$_pendingEvents();
|
|
if (((_this._state |= 1) & 8) !== 0) {
|
|
addState = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData);
|
|
addState._varData = subscription;
|
|
addState.addSubscription.resume$0();
|
|
} else
|
|
_this._varData = subscription;
|
|
subscription._setPendingEvents$1(pendingEvents);
|
|
subscription._guardCallback$1(new A._StreamController__subscribe_closure(_this));
|
|
return subscription;
|
|
},
|
|
_recordCancel$1(subscription) {
|
|
var result, onCancel, cancelResult, e, s, exception, result0, t2, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._eval$1("StreamSubscription<1>")._as(subscription);
|
|
result = null;
|
|
if ((_this._state & 8) !== 0)
|
|
result = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).cancel$0();
|
|
_this._varData = null;
|
|
_this._state = _this._state & 4294967286 | 2;
|
|
onCancel = _this.onCancel;
|
|
if (onCancel != null)
|
|
if (result == null)
|
|
try {
|
|
cancelResult = onCancel.call$0();
|
|
if (cancelResult instanceof A._Future)
|
|
result = cancelResult;
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
result0 = new A._Future($.Zone__current, type$._Future_void);
|
|
t1 = A._asObject(e);
|
|
t2 = type$.StackTrace._as(s);
|
|
result0._asyncCompleteErrorObject$1(new A.AsyncError(t1, t2));
|
|
result = result0;
|
|
}
|
|
else
|
|
result = result.whenComplete$1(onCancel);
|
|
t1 = new A._StreamController__recordCancel_complete(_this);
|
|
if (result != null)
|
|
result = result.whenComplete$1(t1);
|
|
else
|
|
t1.call$0();
|
|
return result;
|
|
},
|
|
set$onListen(onListen) {
|
|
this.onListen = type$.nullable_void_Function._as(onListen);
|
|
},
|
|
set$onPause(onPause) {
|
|
this.onPause = type$.nullable_void_Function._as(onPause);
|
|
},
|
|
set$onResume(onResume) {
|
|
this.onResume = type$.nullable_void_Function._as(onResume);
|
|
},
|
|
set$onCancel(onCancel) {
|
|
this.onCancel = type$.nullable_void_Function._as(onCancel);
|
|
},
|
|
$isEventSink: 1,
|
|
$isStreamConsumer: 1,
|
|
$isStreamController: 1,
|
|
$is_StreamControllerLifecycle: 1,
|
|
$is_EventSink: 1,
|
|
$is_EventDispatch: 1,
|
|
$isSink: 1
|
|
};
|
|
A._StreamController__subscribe_closure.prototype = {
|
|
call$0() {
|
|
A._runGuarded(this.$this.onListen);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._StreamController__recordCancel_complete.prototype = {
|
|
call$0() {
|
|
var doneFuture = this.$this._doneFuture;
|
|
if (doneFuture != null && (doneFuture._state & 30) === 0)
|
|
doneFuture._asyncComplete$1(null);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._SyncStreamControllerDispatch.prototype = {
|
|
_sendData$1(data) {
|
|
this.$ti._precomputed1._as(data);
|
|
this.get$_subscription()._add$1(data);
|
|
},
|
|
_sendError$2(error, stackTrace) {
|
|
this.get$_subscription()._addError$2(error, stackTrace);
|
|
},
|
|
_sendDone$0() {
|
|
this.get$_subscription()._close$0();
|
|
}
|
|
};
|
|
A._SyncStreamController.prototype = {};
|
|
A._ControllerStream.prototype = {
|
|
get$hashCode(_) {
|
|
return (A.Primitives_objectHashCode(this._async$_controller) ^ 892482866) >>> 0;
|
|
},
|
|
$eq(_, other) {
|
|
if (other == null)
|
|
return false;
|
|
if (this === other)
|
|
return true;
|
|
return other instanceof A._ControllerStream && other._async$_controller === this._async$_controller;
|
|
}
|
|
};
|
|
A._ControllerSubscription.prototype = {
|
|
_onCancel$0() {
|
|
return this._async$_controller._recordCancel$1(this);
|
|
},
|
|
_onPause$0() {
|
|
var t1 = this._async$_controller,
|
|
t2 = A._instanceType(t1);
|
|
t2._eval$1("StreamSubscription<1>")._as(this);
|
|
if ((t1._state & 8) !== 0)
|
|
t2._eval$1("_StreamControllerAddStreamState<1>")._as(t1._varData).addSubscription.pause$0();
|
|
A._runGuarded(t1.onPause);
|
|
},
|
|
_onResume$0() {
|
|
var t1 = this._async$_controller,
|
|
t2 = A._instanceType(t1);
|
|
t2._eval$1("StreamSubscription<1>")._as(this);
|
|
if ((t1._state & 8) !== 0)
|
|
t2._eval$1("_StreamControllerAddStreamState<1>")._as(t1._varData).addSubscription.resume$0();
|
|
A._runGuarded(t1.onResume);
|
|
}
|
|
};
|
|
A._AddStreamState_cancel_closure.prototype = {
|
|
call$0() {
|
|
this.$this.addStreamFuture._asyncComplete$1(null);
|
|
},
|
|
$signature: 4
|
|
};
|
|
A._BufferingStreamSubscription.prototype = {
|
|
_setPendingEvents$1(pendingEvents) {
|
|
var _this = this;
|
|
A._instanceType(_this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>?")._as(pendingEvents);
|
|
if (pendingEvents == null)
|
|
return;
|
|
_this._pending = pendingEvents;
|
|
if (pendingEvents.lastPendingEvent != null) {
|
|
_this._state = (_this._state | 128) >>> 0;
|
|
pendingEvents.schedule$1(_this);
|
|
}
|
|
},
|
|
onData$1(handleData) {
|
|
var t1 = A._instanceType(this);
|
|
this._onData = A._BufferingStreamSubscription__registerDataHandler(this._zone, t1._eval$1("~(_BufferingStreamSubscription.T)?")._as(handleData), t1._eval$1("_BufferingStreamSubscription.T"));
|
|
},
|
|
onError$1(handleError) {
|
|
var _this = this,
|
|
t1 = _this._state;
|
|
if (handleError == null)
|
|
_this._state = (t1 & 4294967263) >>> 0;
|
|
else
|
|
_this._state = (t1 | 32) >>> 0;
|
|
_this._onError = A._BufferingStreamSubscription__registerErrorHandler(_this._zone, handleError);
|
|
},
|
|
pause$1(resumeSignal) {
|
|
var t2, t3, _this = this,
|
|
t1 = _this._state;
|
|
if ((t1 & 8) !== 0)
|
|
return;
|
|
t2 = (t1 + 256 | 4) >>> 0;
|
|
_this._state = t2;
|
|
if (t1 < 256) {
|
|
t3 = _this._pending;
|
|
if (t3 != null)
|
|
if (t3._state === 1)
|
|
t3._state = 3;
|
|
}
|
|
if ((t1 & 4) === 0 && (t2 & 64) === 0)
|
|
_this._guardCallback$1(_this.get$_onPause());
|
|
},
|
|
pause$0() {
|
|
return this.pause$1(null);
|
|
},
|
|
resume$0() {
|
|
var _this = this,
|
|
t1 = _this._state;
|
|
if ((t1 & 8) !== 0)
|
|
return;
|
|
if (t1 >= 256) {
|
|
t1 = _this._state = t1 - 256;
|
|
if (t1 < 256)
|
|
if ((t1 & 128) !== 0 && _this._pending.lastPendingEvent != null)
|
|
_this._pending.schedule$1(_this);
|
|
else {
|
|
t1 = (t1 & 4294967291) >>> 0;
|
|
_this._state = t1;
|
|
if ((t1 & 64) === 0)
|
|
_this._guardCallback$1(_this.get$_onResume());
|
|
}
|
|
}
|
|
},
|
|
cancel$0() {
|
|
var _this = this,
|
|
t1 = (_this._state & 4294967279) >>> 0;
|
|
_this._state = t1;
|
|
if ((t1 & 8) === 0)
|
|
_this._cancel$0();
|
|
t1 = _this._cancelFuture;
|
|
return t1 == null ? $.$get$Future__nullFuture() : t1;
|
|
},
|
|
asFuture$1$1(futureValue, $E) {
|
|
var result, _this = this, t1 = {};
|
|
t1.resultValue = null;
|
|
if (!$E._is(null))
|
|
throw A.wrapException(A.ArgumentError$notNull("futureValue"));
|
|
$E._as(futureValue);
|
|
t1.resultValue = futureValue;
|
|
result = new A._Future($.Zone__current, $E._eval$1("_Future<0>"));
|
|
_this._onDone = new A._BufferingStreamSubscription_asFuture_closure(t1, result);
|
|
_this._state = (_this._state | 32) >>> 0;
|
|
_this._onError = new A._BufferingStreamSubscription_asFuture_closure0(_this, result);
|
|
return result;
|
|
},
|
|
_cancel$0() {
|
|
var t2, _this = this,
|
|
t1 = _this._state = (_this._state | 8) >>> 0;
|
|
if ((t1 & 128) !== 0) {
|
|
t2 = _this._pending;
|
|
if (t2._state === 1)
|
|
t2._state = 3;
|
|
}
|
|
if ((t1 & 64) === 0)
|
|
_this._pending = null;
|
|
_this._cancelFuture = _this._onCancel$0();
|
|
},
|
|
_add$1(data) {
|
|
var t2, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._eval$1("_BufferingStreamSubscription.T")._as(data);
|
|
t2 = _this._state;
|
|
if ((t2 & 8) !== 0)
|
|
return;
|
|
if (t2 < 64)
|
|
_this._sendData$1(data);
|
|
else
|
|
_this._addPending$1(new A._DelayedData(data, t1._eval$1("_DelayedData<_BufferingStreamSubscription.T>")));
|
|
},
|
|
_addError$2(error, stackTrace) {
|
|
var t1;
|
|
if (type$.Error._is(error))
|
|
A.Primitives_trySetStackTrace(error, stackTrace);
|
|
t1 = this._state;
|
|
if ((t1 & 8) !== 0)
|
|
return;
|
|
if (t1 < 64)
|
|
this._sendError$2(error, stackTrace);
|
|
else
|
|
this._addPending$1(new A._DelayedError(error, stackTrace));
|
|
},
|
|
_close$0() {
|
|
var _this = this,
|
|
t1 = _this._state;
|
|
if ((t1 & 8) !== 0)
|
|
return;
|
|
t1 = (t1 | 2) >>> 0;
|
|
_this._state = t1;
|
|
if (t1 < 64)
|
|
_this._sendDone$0();
|
|
else
|
|
_this._addPending$1(B.C__DelayedDone);
|
|
},
|
|
_onPause$0() {
|
|
},
|
|
_onResume$0() {
|
|
},
|
|
_onCancel$0() {
|
|
return null;
|
|
},
|
|
_addPending$1($event) {
|
|
var t1, _this = this,
|
|
pending = _this._pending;
|
|
if (pending == null)
|
|
pending = _this._pending = new A._PendingEvents(A._instanceType(_this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>"));
|
|
pending.add$1(0, $event);
|
|
t1 = _this._state;
|
|
if ((t1 & 128) === 0) {
|
|
t1 = (t1 | 128) >>> 0;
|
|
_this._state = t1;
|
|
if (t1 < 256)
|
|
pending.schedule$1(_this);
|
|
}
|
|
},
|
|
_sendData$1(data) {
|
|
var t2, _this = this,
|
|
t1 = A._instanceType(_this)._eval$1("_BufferingStreamSubscription.T");
|
|
t1._as(data);
|
|
t2 = _this._state;
|
|
_this._state = (t2 | 64) >>> 0;
|
|
_this._zone.runUnaryGuarded$1$2(_this._onData, data, t1);
|
|
_this._state = (_this._state & 4294967231) >>> 0;
|
|
_this._checkState$1((t2 & 4) !== 0);
|
|
},
|
|
_sendError$2(error, stackTrace) {
|
|
var cancelFuture, _this = this,
|
|
t1 = _this._state,
|
|
t2 = new A._BufferingStreamSubscription__sendError_sendError(_this, error, stackTrace);
|
|
if ((t1 & 1) !== 0) {
|
|
_this._state = (t1 | 16) >>> 0;
|
|
_this._cancel$0();
|
|
cancelFuture = _this._cancelFuture;
|
|
if (cancelFuture != null && cancelFuture !== $.$get$Future__nullFuture())
|
|
cancelFuture.whenComplete$1(t2);
|
|
else
|
|
t2.call$0();
|
|
} else {
|
|
t2.call$0();
|
|
_this._checkState$1((t1 & 4) !== 0);
|
|
}
|
|
},
|
|
_sendDone$0() {
|
|
var cancelFuture, _this = this,
|
|
t1 = new A._BufferingStreamSubscription__sendDone_sendDone(_this);
|
|
_this._cancel$0();
|
|
_this._state = (_this._state | 16) >>> 0;
|
|
cancelFuture = _this._cancelFuture;
|
|
if (cancelFuture != null && cancelFuture !== $.$get$Future__nullFuture())
|
|
cancelFuture.whenComplete$1(t1);
|
|
else
|
|
t1.call$0();
|
|
},
|
|
_guardCallback$1(callback) {
|
|
var t1, _this = this;
|
|
type$.void_Function._as(callback);
|
|
t1 = _this._state;
|
|
_this._state = (t1 | 64) >>> 0;
|
|
callback.call$0();
|
|
_this._state = (_this._state & 4294967231) >>> 0;
|
|
_this._checkState$1((t1 & 4) !== 0);
|
|
},
|
|
_checkState$1(wasInputPaused) {
|
|
var t2, isInputPaused, _this = this,
|
|
t1 = _this._state;
|
|
if ((t1 & 128) !== 0 && _this._pending.lastPendingEvent == null) {
|
|
t1 = _this._state = (t1 & 4294967167) >>> 0;
|
|
t2 = false;
|
|
if ((t1 & 4) !== 0)
|
|
if (t1 < 256) {
|
|
t2 = _this._pending;
|
|
t2 = t2 == null ? null : t2.lastPendingEvent == null;
|
|
t2 = t2 !== false;
|
|
}
|
|
if (t2) {
|
|
t1 = (t1 & 4294967291) >>> 0;
|
|
_this._state = t1;
|
|
}
|
|
}
|
|
for (; true; wasInputPaused = isInputPaused) {
|
|
if ((t1 & 8) !== 0) {
|
|
_this._pending = null;
|
|
return;
|
|
}
|
|
isInputPaused = (t1 & 4) !== 0;
|
|
if (wasInputPaused === isInputPaused)
|
|
break;
|
|
_this._state = (t1 ^ 64) >>> 0;
|
|
if (isInputPaused)
|
|
_this._onPause$0();
|
|
else
|
|
_this._onResume$0();
|
|
t1 = (_this._state & 4294967231) >>> 0;
|
|
_this._state = t1;
|
|
}
|
|
if ((t1 & 128) !== 0 && t1 < 256)
|
|
_this._pending.schedule$1(_this);
|
|
},
|
|
$isStreamSubscription: 1,
|
|
$is_EventSink: 1,
|
|
$is_EventDispatch: 1
|
|
};
|
|
A._BufferingStreamSubscription_asFuture_closure.prototype = {
|
|
call$0() {
|
|
this.result._complete$1(this._box_0.resultValue);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._BufferingStreamSubscription_asFuture_closure0.prototype = {
|
|
call$2(error, stackTrace) {
|
|
var cancelFuture, t1;
|
|
A._asObject(error);
|
|
type$.StackTrace._as(stackTrace);
|
|
cancelFuture = this.$this.cancel$0();
|
|
t1 = this.result;
|
|
if (cancelFuture !== $.$get$Future__nullFuture())
|
|
cancelFuture.whenComplete$1(new A._BufferingStreamSubscription_asFuture__closure(t1, error, stackTrace));
|
|
else
|
|
t1._completeErrorObject$1(new A.AsyncError(error, stackTrace));
|
|
},
|
|
$signature: 9
|
|
};
|
|
A._BufferingStreamSubscription_asFuture__closure.prototype = {
|
|
call$0() {
|
|
this.result._completeErrorObject$1(new A.AsyncError(this.error, this.stackTrace));
|
|
},
|
|
$signature: 4
|
|
};
|
|
A._BufferingStreamSubscription__sendError_sendError.prototype = {
|
|
call$0() {
|
|
var onError, t3, t4,
|
|
t1 = this.$this,
|
|
t2 = t1._state;
|
|
if ((t2 & 8) !== 0 && (t2 & 16) === 0)
|
|
return;
|
|
t1._state = (t2 | 64) >>> 0;
|
|
onError = t1._onError;
|
|
t2 = this.error;
|
|
t3 = type$.Object;
|
|
t4 = t1._zone;
|
|
if (type$.void_Function_Object_StackTrace._is(onError))
|
|
t4.runBinaryGuarded$2$3(onError, t2, this.stackTrace, t3, type$.StackTrace);
|
|
else
|
|
t4.runUnaryGuarded$1$2(type$.void_Function_Object._as(onError), t2, t3);
|
|
t1._state = (t1._state & 4294967231) >>> 0;
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._BufferingStreamSubscription__sendDone_sendDone.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this,
|
|
t2 = t1._state;
|
|
if ((t2 & 16) === 0)
|
|
return;
|
|
t1._state = (t2 | 74) >>> 0;
|
|
t1._zone.runGuarded$1(t1._onDone);
|
|
t1._state = (t1._state & 4294967231) >>> 0;
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._StreamImpl.prototype = {
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var t1 = this.$ti;
|
|
t1._eval$1("~(1)?")._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
return this._async$_controller._subscribe$4(t1._eval$1("~(1)?")._as(onData), onError, onDone, cancelOnError === true);
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$1(onData) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, null, null);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
}
|
|
};
|
|
A._DelayedEvent.prototype = {
|
|
set$next(next) {
|
|
this.next = type$.nullable__DelayedEvent_dynamic._as(next);
|
|
},
|
|
get$next() {
|
|
return this.next;
|
|
}
|
|
};
|
|
A._DelayedData.prototype = {
|
|
perform$1(dispatch) {
|
|
this.$ti._eval$1("_EventDispatch<1>")._as(dispatch)._sendData$1(this.value);
|
|
}
|
|
};
|
|
A._DelayedError.prototype = {
|
|
perform$1(dispatch) {
|
|
dispatch._sendError$2(this.error, this.stackTrace);
|
|
}
|
|
};
|
|
A._DelayedDone.prototype = {
|
|
perform$1(dispatch) {
|
|
dispatch._sendDone$0();
|
|
},
|
|
get$next() {
|
|
return null;
|
|
},
|
|
set$next(__wc0_formal) {
|
|
throw A.wrapException(A.StateError$("No events after a done."));
|
|
},
|
|
$is_DelayedEvent: 1
|
|
};
|
|
A._PendingEvents.prototype = {
|
|
schedule$1(dispatch) {
|
|
var t1, _this = this;
|
|
_this.$ti._eval$1("_EventDispatch<1>")._as(dispatch);
|
|
t1 = _this._state;
|
|
if (t1 === 1)
|
|
return;
|
|
if (t1 >= 1) {
|
|
_this._state = 1;
|
|
return;
|
|
}
|
|
A.scheduleMicrotask(new A._PendingEvents_schedule_closure(_this, dispatch));
|
|
_this._state = 1;
|
|
},
|
|
add$1(_, $event) {
|
|
var _this = this,
|
|
lastEvent = _this.lastPendingEvent;
|
|
if (lastEvent == null)
|
|
_this.firstPendingEvent = _this.lastPendingEvent = $event;
|
|
else {
|
|
lastEvent.set$next($event);
|
|
_this.lastPendingEvent = $event;
|
|
}
|
|
}
|
|
};
|
|
A._PendingEvents_schedule_closure.prototype = {
|
|
call$0() {
|
|
var t2, $event, nextEvent,
|
|
t1 = this.$this,
|
|
oldState = t1._state;
|
|
t1._state = 0;
|
|
if (oldState === 3)
|
|
return;
|
|
t2 = t1.$ti._eval$1("_EventDispatch<1>")._as(this.dispatch);
|
|
$event = t1.firstPendingEvent;
|
|
nextEvent = $event.get$next();
|
|
t1.firstPendingEvent = nextEvent;
|
|
if (nextEvent == null)
|
|
t1.lastPendingEvent = null;
|
|
$event.perform$1(t2);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._DoneStreamSubscription.prototype = {
|
|
onData$1(handleData) {
|
|
this.$ti._eval$1("~(1)?")._as(handleData);
|
|
},
|
|
onError$1(handleError) {
|
|
},
|
|
pause$1(resumeSignal) {
|
|
var t1 = this._state;
|
|
if (t1 >= 0)
|
|
this._state = t1 + 2;
|
|
},
|
|
pause$0() {
|
|
return this.pause$1(null);
|
|
},
|
|
resume$0() {
|
|
var _this = this,
|
|
resumeState = _this._state - 2;
|
|
if (resumeState < 0)
|
|
return;
|
|
if (resumeState === 0) {
|
|
_this._state = 1;
|
|
A.scheduleMicrotask(_this.get$_onMicrotask());
|
|
} else
|
|
_this._state = resumeState;
|
|
},
|
|
cancel$0() {
|
|
this._state = -1;
|
|
this._onDone = null;
|
|
return $.$get$Future__nullFuture();
|
|
},
|
|
asFuture$1$1(futureValue, $E) {
|
|
var result, t1 = {};
|
|
t1.resultValue = null;
|
|
if (!$E._is(null))
|
|
throw A.wrapException(A.ArgumentError$notNull("futureValue"));
|
|
$E._as(futureValue);
|
|
t1.resultValue = futureValue;
|
|
result = new A._Future($.Zone__current, $E._eval$1("_Future<0>"));
|
|
if (this._state >= 0)
|
|
this._onDone = type$.void_Function._as(new A._DoneStreamSubscription_asFuture_closure(t1, result));
|
|
return result;
|
|
},
|
|
_onMicrotask$0() {
|
|
var _0_0, _this = this,
|
|
unscheduledState = _this._state - 1;
|
|
if (unscheduledState === 0) {
|
|
_this._state = -1;
|
|
_0_0 = _this._onDone;
|
|
if (_0_0 != null) {
|
|
_this._onDone = null;
|
|
_this._zone.runGuarded$1(_0_0);
|
|
}
|
|
} else
|
|
_this._state = unscheduledState;
|
|
},
|
|
$isStreamSubscription: 1
|
|
};
|
|
A._DoneStreamSubscription_asFuture_closure.prototype = {
|
|
call$0() {
|
|
this.result._completeWithValue$1(this._box_0.resultValue);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._StreamIterator.prototype = {};
|
|
A._EmptyStream.prototype = {
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var t1 = this.$ti;
|
|
t1._eval$1("~(1)?")._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
t1 = new A._DoneStreamSubscription($.Zone__current, t1._eval$1("_DoneStreamSubscription<1>"));
|
|
A.scheduleMicrotask(t1.get$_onMicrotask());
|
|
if (onDone != null)
|
|
t1._onDone = type$.void_Function._as(onDone);
|
|
return t1;
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
}
|
|
};
|
|
A._cancelAndError_closure.prototype = {
|
|
call$0() {
|
|
return this.future._completeErrorObject$1(this.error);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._ForwardingStream.prototype = {
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var t2, t3, t4,
|
|
t1 = A._instanceType(this);
|
|
t1._eval$1("~(_ForwardingStream.T)?")._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
t2 = $.Zone__current;
|
|
t3 = cancelOnError === true ? 1 : 0;
|
|
t4 = onError != null ? 32 : 0;
|
|
t1 = new A._ForwardingStreamSubscription(this, A._BufferingStreamSubscription__registerDataHandler(t2, onData, t1._eval$1("_ForwardingStream.T")), A._BufferingStreamSubscription__registerErrorHandler(t2, onError), A._BufferingStreamSubscription__registerDoneHandler(t2, onDone), t2, t3 | t4, t1._eval$1("_ForwardingStreamSubscription<_ForwardingStream.S,_ForwardingStream.T>"));
|
|
t1._subscription = this._async$_source.listen$3$onDone$onError(t1.get$_handleData(), t1.get$_handleDone(), t1.get$_handleError());
|
|
return t1;
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
},
|
|
_handleError$3(error, stackTrace, sink) {
|
|
A._instanceType(this)._eval$1("_EventSink<_ForwardingStream.T>")._as(sink)._addError$2(error, stackTrace);
|
|
}
|
|
};
|
|
A._ForwardingStreamSubscription.prototype = {
|
|
_add$1(data) {
|
|
this.$ti._rest[1]._as(data);
|
|
if ((this._state & 2) !== 0)
|
|
return;
|
|
this.super$_BufferingStreamSubscription$_add(data);
|
|
},
|
|
_addError$2(error, stackTrace) {
|
|
if ((this._state & 2) !== 0)
|
|
return;
|
|
this.super$_BufferingStreamSubscription$_addError(error, stackTrace);
|
|
},
|
|
_onPause$0() {
|
|
var t1 = this._subscription;
|
|
if (t1 != null)
|
|
t1.pause$0();
|
|
},
|
|
_onResume$0() {
|
|
var t1 = this._subscription;
|
|
if (t1 != null)
|
|
t1.resume$0();
|
|
},
|
|
_onCancel$0() {
|
|
var subscription = this._subscription;
|
|
if (subscription != null) {
|
|
this._subscription = null;
|
|
return subscription.cancel$0();
|
|
}
|
|
return null;
|
|
},
|
|
_handleData$1(data) {
|
|
this._stream._handleData$2(this.$ti._precomputed1._as(data), this);
|
|
},
|
|
_handleError$2(error, stackTrace) {
|
|
var t1;
|
|
type$.StackTrace._as(stackTrace);
|
|
t1 = error == null ? A._asObject(error) : error;
|
|
this._stream._handleError$3(t1, stackTrace, this);
|
|
},
|
|
_handleDone$0() {
|
|
A._instanceType(this._stream)._eval$1("_EventSink<_ForwardingStream.T>")._as(this)._close$0();
|
|
}
|
|
};
|
|
A._MapStream.prototype = {
|
|
_handleData$2(inputEvent, sink) {
|
|
var outputEvent, e, s, exception,
|
|
t1 = this.$ti;
|
|
t1._precomputed1._as(inputEvent);
|
|
t1._eval$1("_EventSink<2>")._as(sink);
|
|
outputEvent = null;
|
|
try {
|
|
outputEvent = this._transform.call$1(inputEvent);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
A._addErrorWithReplacement(sink, e, s);
|
|
return;
|
|
}
|
|
sink._add$1(outputEvent);
|
|
}
|
|
};
|
|
A._HandleErrorStream.prototype = {
|
|
_handleData$2(data, sink) {
|
|
var t1 = this.$ti;
|
|
t1._precomputed1._as(data);
|
|
t1._eval$1("_EventSink<1>")._as(sink)._add$1(data);
|
|
},
|
|
_handleError$3(error, stackTrace, sink) {
|
|
var matches, test, e, s, e0, s0, exception;
|
|
this.$ti._eval$1("_EventSink<1>")._as(sink);
|
|
matches = true;
|
|
test = this._test;
|
|
if (test != null)
|
|
try {
|
|
matches = test.call$1(error);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
A._addErrorWithReplacement(sink, e, s);
|
|
return;
|
|
}
|
|
if (matches)
|
|
try {
|
|
this._onError.call$2(error, stackTrace);
|
|
} catch (exception) {
|
|
e0 = A.unwrapException(exception);
|
|
s0 = A.getTraceFromException(exception);
|
|
if (e0 === error)
|
|
sink._addError$2(error, stackTrace);
|
|
else
|
|
A._addErrorWithReplacement(sink, e0, s0);
|
|
return;
|
|
}
|
|
else
|
|
sink._addError$2(error, stackTrace);
|
|
}
|
|
};
|
|
A._EventSinkWrapper.prototype = {
|
|
add$1(_, data) {
|
|
var t1 = this._sink;
|
|
data = t1.$ti._rest[1]._as(this.$ti._precomputed1._as(data));
|
|
if ((t1._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
t1.super$_BufferingStreamSubscription$_add(data);
|
|
},
|
|
addError$2(error, stackTrace) {
|
|
var t1 = this._sink;
|
|
if ((t1._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
t1.super$_BufferingStreamSubscription$_addError(error, stackTrace);
|
|
},
|
|
close$0() {
|
|
var t1 = this._sink;
|
|
if ((t1._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
t1.super$_BufferingStreamSubscription$_close();
|
|
},
|
|
$isEventSink: 1,
|
|
$isSink: 1
|
|
};
|
|
A._SinkTransformerStreamSubscription.prototype = {
|
|
_onPause$0() {
|
|
var t1 = this._subscription;
|
|
if (t1 != null)
|
|
t1.pause$0();
|
|
},
|
|
_onResume$0() {
|
|
var t1 = this._subscription;
|
|
if (t1 != null)
|
|
t1.resume$0();
|
|
},
|
|
_onCancel$0() {
|
|
var subscription = this._subscription;
|
|
if (subscription != null) {
|
|
this._subscription = null;
|
|
return subscription.cancel$0();
|
|
}
|
|
return null;
|
|
},
|
|
_handleData$1(data) {
|
|
var e, s, t1, exception, t2, _this = this;
|
|
_this.$ti._precomputed1._as(data);
|
|
try {
|
|
t1 = _this.___SinkTransformerStreamSubscription__transformerSink_A;
|
|
t1 === $ && A.throwLateFieldNI("_transformerSink");
|
|
t1.add$1(0, data);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
t1 = A._asObject(e);
|
|
t2 = type$.StackTrace._as(s);
|
|
if ((_this._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
_this.super$_BufferingStreamSubscription$_addError(t1, t2);
|
|
}
|
|
},
|
|
_handleError$2(error, stackTrace) {
|
|
var e, s, t1, t2, exception, _this = this,
|
|
_s24_ = "Stream is already closed";
|
|
A._asObject(error);
|
|
t1 = type$.StackTrace;
|
|
t1._as(stackTrace);
|
|
try {
|
|
t2 = _this.___SinkTransformerStreamSubscription__transformerSink_A;
|
|
t2 === $ && A.throwLateFieldNI("_transformerSink");
|
|
t2.addError$2(error, stackTrace);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
if (e === error) {
|
|
if ((_this._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
_this.super$_BufferingStreamSubscription$_addError(error, stackTrace);
|
|
} else {
|
|
t2 = A._asObject(e);
|
|
t1 = t1._as(s);
|
|
if ((_this._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
_this.super$_BufferingStreamSubscription$_addError(t2, t1);
|
|
}
|
|
}
|
|
},
|
|
_handleDone$0() {
|
|
var e, s, t1, exception, t2, _this = this;
|
|
try {
|
|
_this._subscription = null;
|
|
t1 = _this.___SinkTransformerStreamSubscription__transformerSink_A;
|
|
t1 === $ && A.throwLateFieldNI("_transformerSink");
|
|
t1.close$0();
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
t1 = A._asObject(e);
|
|
t2 = type$.StackTrace._as(s);
|
|
if ((_this._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
_this.super$_BufferingStreamSubscription$_addError(t1, t2);
|
|
}
|
|
}
|
|
};
|
|
A._BoundSinkStream.prototype = {
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var t2, t3, t4, subscription,
|
|
t1 = this.$ti;
|
|
t1._eval$1("~(2)?")._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
t2 = $.Zone__current;
|
|
t3 = cancelOnError === true ? 1 : 0;
|
|
t4 = onError != null ? 32 : 0;
|
|
subscription = new A._SinkTransformerStreamSubscription(A._BufferingStreamSubscription__registerDataHandler(t2, onData, t1._rest[1]), A._BufferingStreamSubscription__registerErrorHandler(t2, onError), A._BufferingStreamSubscription__registerDoneHandler(t2, onDone), t2, t3 | t4, t1._eval$1("_SinkTransformerStreamSubscription<1,2>"));
|
|
subscription.___SinkTransformerStreamSubscription__transformerSink_A = t1._eval$1("EventSink<1>")._as(this._sinkMapper.call$1(new A._EventSinkWrapper(subscription, t1._eval$1("_EventSinkWrapper<2>"))));
|
|
subscription._subscription = this._stream.listen$3$onDone$onError(subscription.get$_handleData(), subscription.get$_handleDone(), subscription.get$_handleError());
|
|
return subscription;
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
}
|
|
};
|
|
A._Zone.prototype = {$isZone: 1};
|
|
A._rootHandleError_closure.prototype = {
|
|
call$0() {
|
|
A.Error_throwWithStackTrace(this.error, this.stackTrace);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._RootZone.prototype = {
|
|
runGuarded$1(f) {
|
|
var e, s, exception;
|
|
type$.void_Function._as(f);
|
|
try {
|
|
if (B.C__RootZone === $.Zone__current) {
|
|
f.call$0();
|
|
return;
|
|
}
|
|
A._rootRun(null, null, this, f, type$.void);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
A._rootHandleError(A._asObject(e), type$.StackTrace._as(s));
|
|
}
|
|
},
|
|
runUnaryGuarded$1$2(f, arg, $T) {
|
|
var e, s, exception;
|
|
$T._eval$1("~(0)")._as(f);
|
|
$T._as(arg);
|
|
try {
|
|
if (B.C__RootZone === $.Zone__current) {
|
|
f.call$1(arg);
|
|
return;
|
|
}
|
|
A._rootRunUnary(null, null, this, f, arg, type$.void, $T);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
A._rootHandleError(A._asObject(e), type$.StackTrace._as(s));
|
|
}
|
|
},
|
|
runBinaryGuarded$2$3(f, arg1, arg2, $T1, $T2) {
|
|
var e, s, exception;
|
|
$T1._eval$1("@<0>")._bind$1($T2)._eval$1("~(1,2)")._as(f);
|
|
$T1._as(arg1);
|
|
$T2._as(arg2);
|
|
try {
|
|
if (B.C__RootZone === $.Zone__current) {
|
|
f.call$2(arg1, arg2);
|
|
return;
|
|
}
|
|
A._rootRunBinary(null, null, this, f, arg1, arg2, type$.void, $T1, $T2);
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
A._rootHandleError(A._asObject(e), type$.StackTrace._as(s));
|
|
}
|
|
},
|
|
bindCallbackGuarded$1(f) {
|
|
return new A._RootZone_bindCallbackGuarded_closure(this, type$.void_Function._as(f));
|
|
},
|
|
$index(_, key) {
|
|
return null;
|
|
},
|
|
run$1$1(f, $R) {
|
|
$R._eval$1("0()")._as(f);
|
|
if ($.Zone__current === B.C__RootZone)
|
|
return f.call$0();
|
|
return A._rootRun(null, null, this, f, $R);
|
|
},
|
|
runUnary$2$2(f, arg, $R, $T) {
|
|
$R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f);
|
|
$T._as(arg);
|
|
if ($.Zone__current === B.C__RootZone)
|
|
return f.call$1(arg);
|
|
return A._rootRunUnary(null, null, this, f, arg, $R, $T);
|
|
},
|
|
runBinary$3$3(f, arg1, arg2, $R, $T1, $T2) {
|
|
$R._eval$1("@<0>")._bind$1($T1)._bind$1($T2)._eval$1("1(2,3)")._as(f);
|
|
$T1._as(arg1);
|
|
$T2._as(arg2);
|
|
if ($.Zone__current === B.C__RootZone)
|
|
return f.call$2(arg1, arg2);
|
|
return A._rootRunBinary(null, null, this, f, arg1, arg2, $R, $T1, $T2);
|
|
},
|
|
registerBinaryCallback$3$1(f, $R, $T1, $T2) {
|
|
return $R._eval$1("@<0>")._bind$1($T1)._bind$1($T2)._eval$1("1(2,3)")._as(f);
|
|
}
|
|
};
|
|
A._RootZone_bindCallbackGuarded_closure.prototype = {
|
|
call$0() {
|
|
return this.$this.runGuarded$1(this.f);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._HashMap.prototype = {
|
|
get$length(_) {
|
|
return this._collection$_length;
|
|
},
|
|
get$isEmpty(_) {
|
|
return this._collection$_length === 0;
|
|
},
|
|
get$isNotEmpty(_) {
|
|
return this._collection$_length !== 0;
|
|
},
|
|
get$keys() {
|
|
return new A._HashMapKeyIterable(this, A._instanceType(this)._eval$1("_HashMapKeyIterable<1>"));
|
|
},
|
|
containsKey$1(key) {
|
|
var strings, t1;
|
|
if (key !== "__proto__") {
|
|
strings = this._collection$_strings;
|
|
return strings == null ? false : strings[key] != null;
|
|
} else {
|
|
t1 = this._containsKey$1(key);
|
|
return t1;
|
|
}
|
|
},
|
|
_containsKey$1(key) {
|
|
var rest = this._collection$_rest;
|
|
if (rest == null)
|
|
return false;
|
|
return this._findBucketIndex$2(this._getBucket$2(rest, key), key) >= 0;
|
|
},
|
|
$index(_, key) {
|
|
var strings, t1, nums;
|
|
if (typeof key == "string" && key !== "__proto__") {
|
|
strings = this._collection$_strings;
|
|
t1 = strings == null ? null : A._HashMap__getTableEntry(strings, key);
|
|
return t1;
|
|
} else if (typeof key == "number" && (key & 1073741823) === key) {
|
|
nums = this._collection$_nums;
|
|
t1 = nums == null ? null : A._HashMap__getTableEntry(nums, key);
|
|
return t1;
|
|
} else
|
|
return this._get$1(key);
|
|
},
|
|
_get$1(key) {
|
|
var bucket, index,
|
|
rest = this._collection$_rest;
|
|
if (rest == null)
|
|
return null;
|
|
bucket = this._getBucket$2(rest, key);
|
|
index = this._findBucketIndex$2(bucket, key);
|
|
return index < 0 ? null : bucket[index + 1];
|
|
},
|
|
$indexSet(_, key, value) {
|
|
var strings, nums, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._precomputed1._as(key);
|
|
t1._rest[1]._as(value);
|
|
if (typeof key == "string" && key !== "__proto__") {
|
|
strings = _this._collection$_strings;
|
|
_this._collection$_addHashTableEntry$3(strings == null ? _this._collection$_strings = A._HashMap__newHashTable() : strings, key, value);
|
|
} else if (typeof key == "number" && (key & 1073741823) === key) {
|
|
nums = _this._collection$_nums;
|
|
_this._collection$_addHashTableEntry$3(nums == null ? _this._collection$_nums = A._HashMap__newHashTable() : nums, key, value);
|
|
} else
|
|
_this._set$2(key, value);
|
|
},
|
|
_set$2(key, value) {
|
|
var rest, hash, bucket, index, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._precomputed1._as(key);
|
|
t1._rest[1]._as(value);
|
|
rest = _this._collection$_rest;
|
|
if (rest == null)
|
|
rest = _this._collection$_rest = A._HashMap__newHashTable();
|
|
hash = _this._computeHashCode$1(key);
|
|
bucket = rest[hash];
|
|
if (bucket == null) {
|
|
A._HashMap__setTableEntry(rest, hash, [key, value]);
|
|
++_this._collection$_length;
|
|
_this._keys = null;
|
|
} else {
|
|
index = _this._findBucketIndex$2(bucket, key);
|
|
if (index >= 0)
|
|
bucket[index + 1] = value;
|
|
else {
|
|
bucket.push(key, value);
|
|
++_this._collection$_length;
|
|
_this._keys = null;
|
|
}
|
|
}
|
|
},
|
|
putIfAbsent$2(key, ifAbsent) {
|
|
var t2, value, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._precomputed1._as(key);
|
|
t1._eval$1("2()")._as(ifAbsent);
|
|
if (_this.containsKey$1(key)) {
|
|
t2 = _this.$index(0, key);
|
|
return t2 == null ? t1._rest[1]._as(t2) : t2;
|
|
}
|
|
value = ifAbsent.call$0();
|
|
_this.$indexSet(0, key, value);
|
|
return value;
|
|
},
|
|
remove$1(_, key) {
|
|
var t1;
|
|
if (key !== "__proto__")
|
|
return this._removeHashTableEntry$2(this._collection$_strings, key);
|
|
else {
|
|
t1 = this._remove$1(key);
|
|
return t1;
|
|
}
|
|
},
|
|
_remove$1(key) {
|
|
var hash, bucket, index, result, _this = this,
|
|
rest = _this._collection$_rest;
|
|
if (rest == null)
|
|
return null;
|
|
hash = _this._computeHashCode$1(key);
|
|
bucket = rest[hash];
|
|
index = _this._findBucketIndex$2(bucket, key);
|
|
if (index < 0)
|
|
return null;
|
|
--_this._collection$_length;
|
|
_this._keys = null;
|
|
result = bucket.splice(index, 2)[1];
|
|
if (0 === bucket.length)
|
|
delete rest[hash];
|
|
return result;
|
|
},
|
|
forEach$1(_, action) {
|
|
var keys, $length, t2, i, key, t3, _this = this,
|
|
t1 = A._instanceType(_this);
|
|
t1._eval$1("~(1,2)")._as(action);
|
|
keys = _this._collection$_computeKeys$0();
|
|
for ($length = keys.length, t2 = t1._precomputed1, t1 = t1._rest[1], i = 0; i < $length; ++i) {
|
|
key = keys[i];
|
|
t2._as(key);
|
|
t3 = _this.$index(0, key);
|
|
action.call$2(key, t3 == null ? t1._as(t3) : t3);
|
|
if (keys !== _this._keys)
|
|
throw A.wrapException(A.ConcurrentModificationError$(_this));
|
|
}
|
|
},
|
|
_collection$_computeKeys$0() {
|
|
var strings, index, names, entries, i, nums, rest, bucket, $length, i0, _this = this,
|
|
result = _this._keys;
|
|
if (result != null)
|
|
return result;
|
|
result = A.List_List$filled(_this._collection$_length, null, false, type$.dynamic);
|
|
strings = _this._collection$_strings;
|
|
index = 0;
|
|
if (strings != null) {
|
|
names = Object.getOwnPropertyNames(strings);
|
|
entries = names.length;
|
|
for (i = 0; i < entries; ++i) {
|
|
result[index] = names[i];
|
|
++index;
|
|
}
|
|
}
|
|
nums = _this._collection$_nums;
|
|
if (nums != null) {
|
|
names = Object.getOwnPropertyNames(nums);
|
|
entries = names.length;
|
|
for (i = 0; i < entries; ++i) {
|
|
result[index] = +names[i];
|
|
++index;
|
|
}
|
|
}
|
|
rest = _this._collection$_rest;
|
|
if (rest != null) {
|
|
names = Object.getOwnPropertyNames(rest);
|
|
entries = names.length;
|
|
for (i = 0; i < entries; ++i) {
|
|
bucket = rest[names[i]];
|
|
$length = bucket.length;
|
|
for (i0 = 0; i0 < $length; i0 += 2) {
|
|
result[index] = bucket[i0];
|
|
++index;
|
|
}
|
|
}
|
|
}
|
|
return _this._keys = result;
|
|
},
|
|
_collection$_addHashTableEntry$3(table, key, value) {
|
|
var t1 = A._instanceType(this);
|
|
t1._precomputed1._as(key);
|
|
t1._rest[1]._as(value);
|
|
if (table[key] == null) {
|
|
++this._collection$_length;
|
|
this._keys = null;
|
|
}
|
|
A._HashMap__setTableEntry(table, key, value);
|
|
},
|
|
_removeHashTableEntry$2(table, key) {
|
|
var value;
|
|
if (table != null && table[key] != null) {
|
|
value = A._instanceType(this)._rest[1]._as(A._HashMap__getTableEntry(table, key));
|
|
delete table[key];
|
|
--this._collection$_length;
|
|
this._keys = null;
|
|
return value;
|
|
} else
|
|
return null;
|
|
},
|
|
_computeHashCode$1(key) {
|
|
return J.get$hashCode$(key) & 1073741823;
|
|
},
|
|
_getBucket$2(table, key) {
|
|
return table[this._computeHashCode$1(key)];
|
|
},
|
|
_findBucketIndex$2(bucket, key) {
|
|
var $length, i;
|
|
if (bucket == null)
|
|
return -1;
|
|
$length = bucket.length;
|
|
for (i = 0; i < $length; i += 2)
|
|
if (J.$eq$(bucket[i], key))
|
|
return i;
|
|
return -1;
|
|
}
|
|
};
|
|
A._HashMapKeyIterable.prototype = {
|
|
get$length(_) {
|
|
return this._collection$_map._collection$_length;
|
|
},
|
|
get$isEmpty(_) {
|
|
return this._collection$_map._collection$_length === 0;
|
|
},
|
|
get$iterator(_) {
|
|
var t1 = this._collection$_map;
|
|
return new A._HashMapKeyIterator(t1, t1._collection$_computeKeys$0(), this.$ti._eval$1("_HashMapKeyIterator<1>"));
|
|
}
|
|
};
|
|
A._HashMapKeyIterator.prototype = {
|
|
get$current() {
|
|
var t1 = this._collection$_current;
|
|
return t1 == null ? this.$ti._precomputed1._as(t1) : t1;
|
|
},
|
|
moveNext$0() {
|
|
var _this = this,
|
|
keys = _this._keys,
|
|
offset = _this._offset,
|
|
t1 = _this._collection$_map;
|
|
if (keys !== t1._keys)
|
|
throw A.wrapException(A.ConcurrentModificationError$(t1));
|
|
else if (offset >= keys.length) {
|
|
_this._collection$_current = null;
|
|
return false;
|
|
} else {
|
|
_this._collection$_current = keys[offset];
|
|
_this._offset = offset + 1;
|
|
return true;
|
|
}
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
A._HashSet.prototype = {
|
|
get$iterator(_) {
|
|
return new A._HashSetIterator(this, this._computeElements$0(), A._instanceType(this)._eval$1("_HashSetIterator<1>"));
|
|
},
|
|
get$length(_) {
|
|
return this._collection$_length;
|
|
},
|
|
add$1(_, element) {
|
|
var t1;
|
|
A._instanceType(this)._precomputed1._as(element);
|
|
t1 = this._collection$_add$1(element);
|
|
return t1;
|
|
},
|
|
_collection$_add$1(element) {
|
|
var rest, hash, bucket, _this = this;
|
|
A._instanceType(_this)._precomputed1._as(element);
|
|
rest = _this._collection$_rest;
|
|
if (rest == null)
|
|
rest = _this._collection$_rest = A._HashSet__newHashTable();
|
|
hash = _this._computeHashCode$1(element);
|
|
bucket = rest[hash];
|
|
if (bucket == null)
|
|
rest[hash] = [element];
|
|
else {
|
|
if (_this._findBucketIndex$2(bucket, element) >= 0)
|
|
return false;
|
|
bucket.push(element);
|
|
}
|
|
++_this._collection$_length;
|
|
_this._elements = null;
|
|
return true;
|
|
},
|
|
remove$1(_, object) {
|
|
var t1 = this._remove$1(object);
|
|
return t1;
|
|
},
|
|
_remove$1(object) {
|
|
var hash, bucket, index, _this = this,
|
|
rest = _this._collection$_rest;
|
|
if (rest == null)
|
|
return false;
|
|
hash = _this._computeHashCode$1(object);
|
|
bucket = rest[hash];
|
|
index = _this._findBucketIndex$2(bucket, object);
|
|
if (index < 0)
|
|
return false;
|
|
--_this._collection$_length;
|
|
_this._elements = null;
|
|
bucket.splice(index, 1);
|
|
if (0 === bucket.length)
|
|
delete rest[hash];
|
|
return true;
|
|
},
|
|
_computeElements$0() {
|
|
var strings, index, names, entries, i, nums, rest, bucket, $length, i0, _this = this,
|
|
result = _this._elements;
|
|
if (result != null)
|
|
return result;
|
|
result = A.List_List$filled(_this._collection$_length, null, false, type$.dynamic);
|
|
strings = _this._collection$_strings;
|
|
index = 0;
|
|
if (strings != null) {
|
|
names = Object.getOwnPropertyNames(strings);
|
|
entries = names.length;
|
|
for (i = 0; i < entries; ++i) {
|
|
result[index] = names[i];
|
|
++index;
|
|
}
|
|
}
|
|
nums = _this._collection$_nums;
|
|
if (nums != null) {
|
|
names = Object.getOwnPropertyNames(nums);
|
|
entries = names.length;
|
|
for (i = 0; i < entries; ++i) {
|
|
result[index] = +names[i];
|
|
++index;
|
|
}
|
|
}
|
|
rest = _this._collection$_rest;
|
|
if (rest != null) {
|
|
names = Object.getOwnPropertyNames(rest);
|
|
entries = names.length;
|
|
for (i = 0; i < entries; ++i) {
|
|
bucket = rest[names[i]];
|
|
$length = bucket.length;
|
|
for (i0 = 0; i0 < $length; ++i0) {
|
|
result[index] = bucket[i0];
|
|
++index;
|
|
}
|
|
}
|
|
}
|
|
return _this._elements = result;
|
|
},
|
|
_computeHashCode$1(element) {
|
|
return A.Primitives_objectHashCode(element) & 1073741823;
|
|
},
|
|
_findBucketIndex$2(bucket, element) {
|
|
var $length, i;
|
|
if (bucket == null)
|
|
return -1;
|
|
$length = bucket.length;
|
|
for (i = 0; i < $length; ++i)
|
|
if (J.$eq$(bucket[i], element))
|
|
return i;
|
|
return -1;
|
|
}
|
|
};
|
|
A._HashSetIterator.prototype = {
|
|
get$current() {
|
|
var t1 = this._collection$_current;
|
|
return t1 == null ? this.$ti._precomputed1._as(t1) : t1;
|
|
},
|
|
moveNext$0() {
|
|
var _this = this,
|
|
elements = _this._elements,
|
|
offset = _this._offset,
|
|
t1 = _this._set;
|
|
if (elements !== t1._elements)
|
|
throw A.wrapException(A.ConcurrentModificationError$(t1));
|
|
else if (offset >= elements.length) {
|
|
_this._collection$_current = null;
|
|
return false;
|
|
} else {
|
|
_this._collection$_current = elements[offset];
|
|
_this._offset = offset + 1;
|
|
return true;
|
|
}
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
A.HashMap_HashMap$from_closure.prototype = {
|
|
call$2(k, v) {
|
|
this.result.$indexSet(0, this.K._as(k), this.V._as(v));
|
|
},
|
|
$signature: 69
|
|
};
|
|
A.ListBase.prototype = {
|
|
get$iterator(receiver) {
|
|
return new A.ListIterator(receiver, this.get$length(receiver), A.instanceType(receiver)._eval$1("ListIterator<ListBase.E>"));
|
|
},
|
|
elementAt$1(receiver, index) {
|
|
return this.$index(receiver, index);
|
|
},
|
|
get$isEmpty(receiver) {
|
|
return this.get$length(receiver) === 0;
|
|
},
|
|
get$isNotEmpty(receiver) {
|
|
return this.get$length(receiver) !== 0;
|
|
},
|
|
contains$1(receiver, element) {
|
|
var i,
|
|
$length = this.get$length(receiver);
|
|
for (i = 0; i < $length; ++i) {
|
|
this.$index(receiver, i);
|
|
if ($length !== this.get$length(receiver))
|
|
throw A.wrapException(A.ConcurrentModificationError$(receiver));
|
|
}
|
|
return false;
|
|
},
|
|
skip$1(receiver, count) {
|
|
return A.SubListIterable$(receiver, count, null, A.instanceType(receiver)._eval$1("ListBase.E"));
|
|
},
|
|
take$1(receiver, count) {
|
|
return A.SubListIterable$(receiver, 0, A.checkNotNullable(count, "count", type$.int), A.instanceType(receiver)._eval$1("ListBase.E"));
|
|
},
|
|
add$1(receiver, element) {
|
|
var t1;
|
|
A.instanceType(receiver)._eval$1("ListBase.E")._as(element);
|
|
t1 = this.get$length(receiver);
|
|
this.set$length(receiver, t1 + 1);
|
|
this.$indexSet(receiver, t1, element);
|
|
},
|
|
remove$1(receiver, element) {
|
|
var i;
|
|
for (i = 0; i < this.get$length(receiver); ++i)
|
|
this.$index(receiver, i);
|
|
return false;
|
|
},
|
|
setRange$4(receiver, start, end, iterable, skipCount) {
|
|
var $length, t1, i;
|
|
A.instanceType(receiver)._eval$1("Iterable<ListBase.E>")._as(iterable);
|
|
A.RangeError_checkValidRange(start, end, this.get$length(receiver));
|
|
$length = end - start;
|
|
if ($length === 0)
|
|
return;
|
|
A.RangeError_checkNotNegative(skipCount, "skipCount");
|
|
t1 = J.getInterceptor$asx(iterable);
|
|
if (skipCount + $length > t1.get$length(iterable))
|
|
throw A.wrapException(A.IterableElementError_tooFew());
|
|
if (skipCount < start)
|
|
for (i = $length - 1; i >= 0; --i)
|
|
this.$indexSet(receiver, start + i, t1.$index(iterable, skipCount + i));
|
|
else
|
|
for (i = 0; i < $length; ++i)
|
|
this.$indexSet(receiver, start + i, t1.$index(iterable, skipCount + i));
|
|
},
|
|
toString$0(receiver) {
|
|
return A.Iterable_iterableToFullString(receiver, "[", "]");
|
|
},
|
|
$isIterable: 1,
|
|
$isList: 1
|
|
};
|
|
A.MapBase.prototype = {
|
|
forEach$1(_, action) {
|
|
var t2, key, t3,
|
|
t1 = A._instanceType(this);
|
|
t1._eval$1("~(MapBase.K,MapBase.V)")._as(action);
|
|
for (t2 = this.get$keys(), t2 = t2.get$iterator(t2), t1 = t1._eval$1("MapBase.V"); t2.moveNext$0();) {
|
|
key = t2.get$current();
|
|
t3 = this.$index(0, key);
|
|
action.call$2(key, t3 == null ? t1._as(t3) : t3);
|
|
}
|
|
},
|
|
get$length(_) {
|
|
var t1 = this.get$keys();
|
|
return t1.get$length(t1);
|
|
},
|
|
get$isEmpty(_) {
|
|
var t1 = this.get$keys();
|
|
return t1.get$isEmpty(t1);
|
|
},
|
|
toString$0(_) {
|
|
return A.MapBase_mapToString(this);
|
|
},
|
|
$isMap: 1
|
|
};
|
|
A.MapBase_mapToString_closure.prototype = {
|
|
call$2(k, v) {
|
|
var t2,
|
|
t1 = this._box_0;
|
|
if (!t1.first)
|
|
this.result._contents += ", ";
|
|
t1.first = false;
|
|
t1 = this.result;
|
|
t2 = A.S(k);
|
|
t1._contents = (t1._contents += t2) + ": ";
|
|
t2 = A.S(v);
|
|
t1._contents += t2;
|
|
},
|
|
$signature: 29
|
|
};
|
|
A._UnmodifiableMapMixin.prototype = {};
|
|
A.MapView.prototype = {
|
|
$index(_, key) {
|
|
return this._collection$_map.$index(0, key);
|
|
},
|
|
forEach$1(_, action) {
|
|
this._collection$_map.forEach$1(0, this.$ti._eval$1("~(1,2)")._as(action));
|
|
},
|
|
get$isEmpty(_) {
|
|
var t1 = this._collection$_map;
|
|
return t1.get$isEmpty(t1);
|
|
},
|
|
get$length(_) {
|
|
var t1 = this._collection$_map;
|
|
return t1.get$length(t1);
|
|
},
|
|
toString$0(_) {
|
|
return this._collection$_map.toString$0(0);
|
|
},
|
|
$isMap: 1
|
|
};
|
|
A.UnmodifiableMapView.prototype = {};
|
|
A.ListQueue.prototype = {
|
|
get$iterator(_) {
|
|
var _this = this;
|
|
return new A._ListQueueIterator(_this, _this._tail, _this._modificationCount, _this._head, _this.$ti._eval$1("_ListQueueIterator<1>"));
|
|
},
|
|
get$isEmpty(_) {
|
|
return this._head === this._tail;
|
|
},
|
|
get$length(_) {
|
|
return (this._tail - this._head & this._table.length - 1) >>> 0;
|
|
},
|
|
elementAt$1(_, index) {
|
|
var t2, t3, _this = this,
|
|
t1 = _this.get$length(0);
|
|
if (0 > index || index >= t1)
|
|
A.throwExpression(A.IndexError$withLength(index, t1, _this, null, "index"));
|
|
t1 = _this._table;
|
|
t2 = t1.length;
|
|
t3 = (_this._head + index & t2 - 1) >>> 0;
|
|
if (!(t3 >= 0 && t3 < t2))
|
|
return A.ioore(t1, t3);
|
|
t3 = t1[t3];
|
|
return t3 == null ? _this.$ti._precomputed1._as(t3) : t3;
|
|
},
|
|
toString$0(_) {
|
|
return A.Iterable_iterableToFullString(this, "{", "}");
|
|
}
|
|
};
|
|
A._ListQueueIterator.prototype = {
|
|
get$current() {
|
|
var t1 = this._collection$_current;
|
|
return t1 == null ? this.$ti._precomputed1._as(t1) : t1;
|
|
},
|
|
moveNext$0() {
|
|
var t2, t3, _this = this,
|
|
t1 = _this._queue;
|
|
if (_this._modificationCount !== t1._modificationCount)
|
|
A.throwExpression(A.ConcurrentModificationError$(t1));
|
|
t2 = _this._position;
|
|
if (t2 === _this._end) {
|
|
_this._collection$_current = null;
|
|
return false;
|
|
}
|
|
t1 = t1._table;
|
|
t3 = t1.length;
|
|
if (!(t2 < t3))
|
|
return A.ioore(t1, t2);
|
|
_this._collection$_current = t1[t2];
|
|
_this._position = (t2 + 1 & t3 - 1) >>> 0;
|
|
return true;
|
|
},
|
|
$isIterator: 1
|
|
};
|
|
A.SetBase.prototype = {
|
|
toString$0(_) {
|
|
return A.Iterable_iterableToFullString(this, "{", "}");
|
|
},
|
|
$isIterable: 1,
|
|
$isSet: 1
|
|
};
|
|
A._SetBase.prototype = {};
|
|
A._UnmodifiableMapView_MapView__UnmodifiableMapMixin.prototype = {};
|
|
A._JsonMap.prototype = {
|
|
$index(_, key) {
|
|
var result,
|
|
t1 = this._processed;
|
|
if (t1 == null)
|
|
return this._data.$index(0, key);
|
|
else if (typeof key != "string")
|
|
return null;
|
|
else {
|
|
result = t1[key];
|
|
return typeof result == "undefined" ? this._process$1(key) : result;
|
|
}
|
|
},
|
|
get$length(_) {
|
|
return this._processed == null ? this._data.__js_helper$_length : this._computeKeys$0().length;
|
|
},
|
|
get$isEmpty(_) {
|
|
return this.get$length(0) === 0;
|
|
},
|
|
get$keys() {
|
|
if (this._processed == null) {
|
|
var t1 = this._data;
|
|
return new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"));
|
|
}
|
|
return new A._JsonMapKeyIterable(this);
|
|
},
|
|
forEach$1(_, f) {
|
|
var keys, i, key, value, _this = this;
|
|
type$.void_Function_String_dynamic._as(f);
|
|
if (_this._processed == null)
|
|
return _this._data.forEach$1(0, f);
|
|
keys = _this._computeKeys$0();
|
|
for (i = 0; i < keys.length; ++i) {
|
|
key = keys[i];
|
|
value = _this._processed[key];
|
|
if (typeof value == "undefined") {
|
|
value = A._convertJsonToDartLazy(_this._original[key]);
|
|
_this._processed[key] = value;
|
|
}
|
|
f.call$2(key, value);
|
|
if (keys !== _this._data)
|
|
throw A.wrapException(A.ConcurrentModificationError$(_this));
|
|
}
|
|
},
|
|
_computeKeys$0() {
|
|
var keys = type$.nullable_List_dynamic._as(this._data);
|
|
if (keys == null)
|
|
keys = this._data = A._setArrayType(Object.keys(this._original), type$.JSArray_String);
|
|
return keys;
|
|
},
|
|
_process$1(key) {
|
|
var result;
|
|
if (!Object.prototype.hasOwnProperty.call(this._original, key))
|
|
return null;
|
|
result = A._convertJsonToDartLazy(this._original[key]);
|
|
return this._processed[key] = result;
|
|
}
|
|
};
|
|
A._JsonMapKeyIterable.prototype = {
|
|
get$length(_) {
|
|
return this._parent.get$length(0);
|
|
},
|
|
elementAt$1(_, index) {
|
|
var t1 = this._parent;
|
|
if (t1._processed == null)
|
|
t1 = t1.get$keys().elementAt$1(0, index);
|
|
else {
|
|
t1 = t1._computeKeys$0();
|
|
if (!(index >= 0 && index < t1.length))
|
|
return A.ioore(t1, index);
|
|
t1 = t1[index];
|
|
}
|
|
return t1;
|
|
},
|
|
get$iterator(_) {
|
|
var t1 = this._parent;
|
|
if (t1._processed == null) {
|
|
t1 = t1.get$keys();
|
|
t1 = t1.get$iterator(t1);
|
|
} else {
|
|
t1 = t1._computeKeys$0();
|
|
t1 = new J.ArrayIterator(t1, t1.length, A._arrayInstanceType(t1)._eval$1("ArrayIterator<1>"));
|
|
}
|
|
return t1;
|
|
}
|
|
};
|
|
A._JsonDecoderSink.prototype = {
|
|
close$0() {
|
|
var t1, t2, t3, _this = this,
|
|
_s24_ = "Stream is already closed";
|
|
_this.super$_StringSinkConversionSink$close();
|
|
t1 = _this._stringSink;
|
|
t2 = t1._contents;
|
|
t1._contents = "";
|
|
t1 = _this._convert$_sink;
|
|
t3 = t1._sink;
|
|
t2 = t3.$ti._rest[1]._as(t1.$ti._precomputed1._as(A._parseJson(t2.charCodeAt(0) == 0 ? t2 : t2, _this._reviver)));
|
|
if ((t3._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
t3.super$_BufferingStreamSubscription$_add(t2);
|
|
if ((t3._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
t3.super$_BufferingStreamSubscription$_close();
|
|
}
|
|
};
|
|
A._Utf8Decoder__decoder_closure.prototype = {
|
|
call$0() {
|
|
var t1, exception;
|
|
try {
|
|
t1 = new TextDecoder("utf-8", {fatal: true});
|
|
return t1;
|
|
} catch (exception) {
|
|
}
|
|
return null;
|
|
},
|
|
$signature: 30
|
|
};
|
|
A._Utf8Decoder__decoderNonfatal_closure.prototype = {
|
|
call$0() {
|
|
var t1, exception;
|
|
try {
|
|
t1 = new TextDecoder("utf-8", {fatal: false});
|
|
return t1;
|
|
} catch (exception) {
|
|
}
|
|
return null;
|
|
},
|
|
$signature: 30
|
|
};
|
|
A.AsciiCodec.prototype = {
|
|
encode$1(source) {
|
|
return B.AsciiEncoder_127.convert$1(source);
|
|
}
|
|
};
|
|
A._UnicodeSubsetEncoder.prototype = {
|
|
convert$1(string) {
|
|
var stringLength, end, result, t1, i, codeUnit;
|
|
A._asString(string);
|
|
stringLength = string.length;
|
|
end = A.RangeError_checkValidRange(0, null, stringLength);
|
|
result = new Uint8Array(end);
|
|
for (t1 = ~this._subsetMask, i = 0; i < end; ++i) {
|
|
if (!(i < stringLength))
|
|
return A.ioore(string, i);
|
|
codeUnit = string.charCodeAt(i);
|
|
if ((codeUnit & t1) !== 0)
|
|
throw A.wrapException(A.ArgumentError$value(string, "string", "Contains invalid characters."));
|
|
if (!(i < end))
|
|
return A.ioore(result, i);
|
|
result[i] = codeUnit;
|
|
}
|
|
return result;
|
|
},
|
|
startChunkedConversion$1(sink) {
|
|
type$.Sink_List_int._as(sink);
|
|
return new A._UnicodeSubsetEncoderSink(new A._ByteAdapterSink(sink), this._subsetMask);
|
|
}
|
|
};
|
|
A.AsciiEncoder.prototype = {};
|
|
A._UnicodeSubsetEncoderSink.prototype = {
|
|
close$0() {
|
|
this._convert$_sink._convert$_sink.close$0();
|
|
},
|
|
addSlice$4(source, start, end, isLast) {
|
|
var t2, i, codeUnit, listLength,
|
|
t1 = source.length;
|
|
A.RangeError_checkValidRange(start, end, t1);
|
|
for (t2 = ~this._subsetMask, i = start; i < end; ++i) {
|
|
if (!(i < t1))
|
|
return A.ioore(source, i);
|
|
codeUnit = source.charCodeAt(i);
|
|
if ((codeUnit & t2) !== 0)
|
|
throw A.wrapException(A.ArgumentError$("Source contains invalid character with code point: " + codeUnit + ".", null));
|
|
}
|
|
t1 = new A.CodeUnits(source);
|
|
listLength = t1.get$length(0);
|
|
A.RangeError_checkValidRange(start, end, listLength);
|
|
A.RangeError_checkValidRange(start, end, t1.get$length(0));
|
|
t2 = type$.CodeUnits._eval$1("ListBase.E");
|
|
t1 = A.List_List$_of(A.SubListIterable$(t1, start, end, t2), t2);
|
|
t2 = this._convert$_sink._convert$_sink;
|
|
t2.add$1(0, type$.List_int._as(t1));
|
|
if (isLast)
|
|
t2.close$0();
|
|
}
|
|
};
|
|
A.Base64Codec.prototype = {
|
|
get$encoder() {
|
|
return B.C_Base64Encoder;
|
|
},
|
|
normalize$3(source, start, end) {
|
|
var inverseAlphabet, t2, i, sliceStart, buffer, firstPadding, firstPaddingSourceIndex, paddingCount, i0, char, i1, digit1, t3, digit2, char0, value, t4, endLength, $length,
|
|
_s64_ = string$.ABCDEF,
|
|
_s31_ = "Invalid base64 encoding length ",
|
|
t1 = source.length;
|
|
end = A.RangeError_checkValidRange(start, end, t1);
|
|
inverseAlphabet = $.$get$_Base64Decoder__inverseAlphabet();
|
|
for (t2 = inverseAlphabet.length, i = start, sliceStart = i, buffer = null, firstPadding = -1, firstPaddingSourceIndex = -1, paddingCount = 0; i < end; i = i0) {
|
|
i0 = i + 1;
|
|
if (!(i < t1))
|
|
return A.ioore(source, i);
|
|
char = source.charCodeAt(i);
|
|
if (char === 37) {
|
|
i1 = i0 + 2;
|
|
if (i1 <= end) {
|
|
if (!(i0 < t1))
|
|
return A.ioore(source, i0);
|
|
digit1 = A.hexDigitValue(source.charCodeAt(i0));
|
|
t3 = i0 + 1;
|
|
if (!(t3 < t1))
|
|
return A.ioore(source, t3);
|
|
digit2 = A.hexDigitValue(source.charCodeAt(t3));
|
|
char0 = digit1 * 16 + digit2 - (digit2 & 256);
|
|
if (char0 === 37)
|
|
char0 = -1;
|
|
i0 = i1;
|
|
} else
|
|
char0 = -1;
|
|
} else
|
|
char0 = char;
|
|
if (0 <= char0 && char0 <= 127) {
|
|
if (!(char0 >= 0 && char0 < t2))
|
|
return A.ioore(inverseAlphabet, char0);
|
|
value = inverseAlphabet[char0];
|
|
if (value >= 0) {
|
|
if (!(value < 64))
|
|
return A.ioore(_s64_, value);
|
|
char0 = _s64_.charCodeAt(value);
|
|
if (char0 === char)
|
|
continue;
|
|
char = char0;
|
|
} else {
|
|
if (value === -1) {
|
|
if (firstPadding < 0) {
|
|
t3 = buffer == null ? null : buffer._contents.length;
|
|
if (t3 == null)
|
|
t3 = 0;
|
|
firstPadding = t3 + (i - sliceStart);
|
|
firstPaddingSourceIndex = i;
|
|
}
|
|
++paddingCount;
|
|
if (char === 61)
|
|
continue;
|
|
}
|
|
char = char0;
|
|
}
|
|
if (value !== -2) {
|
|
if (buffer == null) {
|
|
buffer = new A.StringBuffer("");
|
|
t3 = buffer;
|
|
} else
|
|
t3 = buffer;
|
|
t3._contents += B.JSString_methods.substring$2(source, sliceStart, i);
|
|
t4 = A.Primitives_stringFromCharCode(char);
|
|
t3._contents += t4;
|
|
sliceStart = i0;
|
|
continue;
|
|
}
|
|
}
|
|
throw A.wrapException(A.FormatException$("Invalid base64 data", source, i));
|
|
}
|
|
if (buffer != null) {
|
|
t1 = B.JSString_methods.substring$2(source, sliceStart, end);
|
|
t1 = buffer._contents += t1;
|
|
t2 = t1.length;
|
|
if (firstPadding >= 0)
|
|
A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, t2);
|
|
else {
|
|
endLength = B.JSInt_methods.$mod(t2 - 1, 4) + 1;
|
|
if (endLength === 1)
|
|
throw A.wrapException(A.FormatException$(_s31_, source, end));
|
|
for (; endLength < 4;) {
|
|
t1 += "=";
|
|
buffer._contents = t1;
|
|
++endLength;
|
|
}
|
|
}
|
|
t1 = buffer._contents;
|
|
return B.JSString_methods.replaceRange$3(source, start, end, t1.charCodeAt(0) == 0 ? t1 : t1);
|
|
}
|
|
$length = end - start;
|
|
if (firstPadding >= 0)
|
|
A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, $length);
|
|
else {
|
|
endLength = B.JSInt_methods.$mod($length, 4);
|
|
if (endLength === 1)
|
|
throw A.wrapException(A.FormatException$(_s31_, source, end));
|
|
if (endLength > 1)
|
|
source = B.JSString_methods.replaceRange$3(source, end, end, endLength === 2 ? "==" : "=");
|
|
}
|
|
return source;
|
|
}
|
|
};
|
|
A.Base64Encoder.prototype = {
|
|
convert$1(input) {
|
|
var t1;
|
|
type$.List_int._as(input);
|
|
t1 = input.length;
|
|
if (t1 === 0)
|
|
return "";
|
|
t1 = new A._Base64Encoder(string$.ABCDEF).encode$4(input, 0, t1, true);
|
|
t1.toString;
|
|
return A.String_String$fromCharCodes(t1, 0, null);
|
|
},
|
|
startChunkedConversion$1(sink) {
|
|
type$.Sink_String._as(sink);
|
|
return new A._AsciiBase64EncoderSink(sink, new A._BufferCachingBase64Encoder(string$.ABCDEF));
|
|
}
|
|
};
|
|
A._Base64Encoder.prototype = {
|
|
createBuffer$1(bufferLength) {
|
|
return new Uint8Array(bufferLength);
|
|
},
|
|
encode$4(bytes, start, end, isLast) {
|
|
var byteCount, fullChunks, bufferLength, output, _this = this;
|
|
type$.List_int._as(bytes);
|
|
byteCount = (_this._convert$_state & 3) + (end - start);
|
|
fullChunks = B.JSInt_methods._tdivFast$1(byteCount, 3);
|
|
bufferLength = fullChunks * 4;
|
|
if (isLast && byteCount - fullChunks * 3 > 0)
|
|
bufferLength += 4;
|
|
output = _this.createBuffer$1(bufferLength);
|
|
_this._convert$_state = A._Base64Encoder_encodeChunk(_this._alphabet, bytes, start, end, isLast, output, 0, _this._convert$_state);
|
|
if (bufferLength > 0)
|
|
return output;
|
|
return null;
|
|
}
|
|
};
|
|
A._BufferCachingBase64Encoder.prototype = {
|
|
createBuffer$1(bufferLength) {
|
|
var buffer = this.bufferCache;
|
|
if (buffer == null || buffer.length < bufferLength)
|
|
buffer = this.bufferCache = new Uint8Array(bufferLength);
|
|
return J.asUint8List$2$x(B.NativeUint8List_methods.get$buffer(buffer), buffer.byteOffset, bufferLength);
|
|
}
|
|
};
|
|
A._Base64EncoderSink.prototype = {
|
|
add$1(_, source) {
|
|
type$.List_int._as(source);
|
|
this._convert$_add$4(source, 0, J.get$length$asx(source), false);
|
|
},
|
|
close$0() {
|
|
this._convert$_add$4(B.List_empty, 0, 0, true);
|
|
}
|
|
};
|
|
A._AsciiBase64EncoderSink.prototype = {
|
|
_convert$_add$4(source, start, end, isLast) {
|
|
var t1, t2,
|
|
_s24_ = "Stream is already closed",
|
|
buffer = this._encoder.encode$4(type$.List_int._as(source), start, end, isLast);
|
|
if (buffer != null) {
|
|
t1 = this._convert$_sink;
|
|
t2 = t1._sink;
|
|
t1 = t2.$ti._rest[1]._as(t1.$ti._precomputed1._as(A.String_String$fromCharCodes(buffer, 0, null)));
|
|
if ((t2._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
t2.super$_BufferingStreamSubscription$_add(t1);
|
|
}
|
|
if (isLast) {
|
|
t1 = this._convert$_sink._sink;
|
|
if ((t1._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
t1.super$_BufferingStreamSubscription$_close();
|
|
}
|
|
}
|
|
};
|
|
A.ByteConversionSink.prototype = {$isSink: 1};
|
|
A._ByteAdapterSink.prototype = {
|
|
add$1(_, chunk) {
|
|
this._convert$_sink.add$1(0, type$.List_int._as(chunk));
|
|
},
|
|
close$0() {
|
|
this._convert$_sink.close$0();
|
|
}
|
|
};
|
|
A.ChunkedConversionSink.prototype = {$isSink: 1};
|
|
A._ConverterStreamEventSink.prototype = {
|
|
add$1(_, o) {
|
|
this._chunkedSink.add$1(0, this.$ti._precomputed1._as(o));
|
|
},
|
|
addError$2(error, stackTrace) {
|
|
A.checkNotNullable(error, "error", type$.Object);
|
|
this._eventSink.addError$2(error, stackTrace);
|
|
},
|
|
close$0() {
|
|
this._chunkedSink.close$0();
|
|
},
|
|
$isEventSink: 1,
|
|
$isSink: 1
|
|
};
|
|
A.Codec.prototype = {};
|
|
A.Converter.prototype = {
|
|
startChunkedConversion$1(sink) {
|
|
A._instanceType(this)._eval$1("Sink<Converter.T>")._as(sink);
|
|
throw A.wrapException(A.UnsupportedError$("This converter does not support chunked conversions: " + this.toString$0(0)));
|
|
},
|
|
bind$1(stream) {
|
|
var t1 = A._instanceType(this);
|
|
return new A._BoundSinkStream(new A.Converter_bind_closure(this), t1._eval$1("Stream<Converter.S>")._as(stream), type$.$env_1_1_dynamic._bind$1(t1._eval$1("Converter.T"))._eval$1("_BoundSinkStream<1,2>"));
|
|
},
|
|
$isStreamTransformer: 1
|
|
};
|
|
A.Converter_bind_closure.prototype = {
|
|
call$1(sink) {
|
|
return new A._ConverterStreamEventSink(sink, this.$this.startChunkedConversion$1(sink), type$._ConverterStreamEventSink_dynamic_dynamic);
|
|
},
|
|
$signature: 72
|
|
};
|
|
A.Encoding.prototype = {};
|
|
A.JsonUnsupportedObjectError.prototype = {
|
|
toString$0(_) {
|
|
var safeString = A.Error_safeToString(this.unsupportedObject);
|
|
return (this.cause != null ? "Converting object to an encodable object failed:" : "Converting object did not return an encodable object:") + " " + safeString;
|
|
}
|
|
};
|
|
A.JsonCyclicError.prototype = {
|
|
toString$0(_) {
|
|
return "Cyclic error in JSON stringify";
|
|
}
|
|
};
|
|
A.JsonCodec.prototype = {
|
|
decode$2$reviver(source, reviver) {
|
|
var t1 = A._parseJson(source, this.get$decoder()._reviver);
|
|
return t1;
|
|
},
|
|
encode$2$toEncodable(value, toEncodable) {
|
|
var t1 = A._JsonStringStringifier_stringify(value, this.get$encoder()._toEncodable, null);
|
|
return t1;
|
|
},
|
|
encode$1(value) {
|
|
return this.encode$2$toEncodable(value, null);
|
|
},
|
|
get$encoder() {
|
|
return B.JsonEncoder_null;
|
|
},
|
|
get$decoder() {
|
|
return B.JsonDecoder_null;
|
|
}
|
|
};
|
|
A.JsonEncoder.prototype = {
|
|
startChunkedConversion$1(sink) {
|
|
type$.Sink_String._as(sink);
|
|
return new A._JsonEncoderSink(null, this._toEncodable, new A._StringAdapterSink(sink));
|
|
}
|
|
};
|
|
A._JsonEncoderSink.prototype = {
|
|
add$1(_, o) {
|
|
var t1, t2, stringSink, _this = this;
|
|
if (_this._isDone)
|
|
throw A.wrapException(A.StateError$("Only one call to add allowed"));
|
|
_this._isDone = true;
|
|
t1 = _this._convert$_sink;
|
|
t2 = new A.StringBuffer("");
|
|
stringSink = new A._StringConversionSinkAsStringSinkAdapter(t2, t1);
|
|
A._JsonStringStringifier_printOn(o, stringSink, _this._toEncodable, _this._indent);
|
|
if (t2._contents.length !== 0)
|
|
stringSink._flush$0();
|
|
t1.close$0();
|
|
},
|
|
close$0() {
|
|
}
|
|
};
|
|
A.JsonDecoder.prototype = {
|
|
startChunkedConversion$1(sink) {
|
|
return new A._JsonDecoderSink(this._reviver, sink, new A.StringBuffer(""));
|
|
}
|
|
};
|
|
A._JsonStringifier.prototype = {
|
|
writeStringContent$1(s) {
|
|
var offset, i, charCode, t1, t2, _this = this,
|
|
$length = s.length;
|
|
for (offset = 0, i = 0; i < $length; ++i) {
|
|
charCode = s.charCodeAt(i);
|
|
if (charCode > 92) {
|
|
if (charCode >= 55296) {
|
|
t1 = charCode & 64512;
|
|
if (t1 === 55296) {
|
|
t2 = i + 1;
|
|
t2 = !(t2 < $length && (s.charCodeAt(t2) & 64512) === 56320);
|
|
} else
|
|
t2 = false;
|
|
if (!t2)
|
|
if (t1 === 56320) {
|
|
t1 = i - 1;
|
|
t1 = !(t1 >= 0 && (s.charCodeAt(t1) & 64512) === 55296);
|
|
} else
|
|
t1 = false;
|
|
else
|
|
t1 = true;
|
|
if (t1) {
|
|
if (i > offset)
|
|
_this.writeStringSlice$3(s, offset, i);
|
|
offset = i + 1;
|
|
_this.writeCharCode$1(92);
|
|
_this.writeCharCode$1(117);
|
|
_this.writeCharCode$1(100);
|
|
t1 = charCode >>> 8 & 15;
|
|
_this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1);
|
|
t1 = charCode >>> 4 & 15;
|
|
_this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1);
|
|
t1 = charCode & 15;
|
|
_this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1);
|
|
}
|
|
}
|
|
continue;
|
|
}
|
|
if (charCode < 32) {
|
|
if (i > offset)
|
|
_this.writeStringSlice$3(s, offset, i);
|
|
offset = i + 1;
|
|
_this.writeCharCode$1(92);
|
|
switch (charCode) {
|
|
case 8:
|
|
_this.writeCharCode$1(98);
|
|
break;
|
|
case 9:
|
|
_this.writeCharCode$1(116);
|
|
break;
|
|
case 10:
|
|
_this.writeCharCode$1(110);
|
|
break;
|
|
case 12:
|
|
_this.writeCharCode$1(102);
|
|
break;
|
|
case 13:
|
|
_this.writeCharCode$1(114);
|
|
break;
|
|
default:
|
|
_this.writeCharCode$1(117);
|
|
_this.writeCharCode$1(48);
|
|
_this.writeCharCode$1(48);
|
|
t1 = charCode >>> 4 & 15;
|
|
_this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1);
|
|
t1 = charCode & 15;
|
|
_this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1);
|
|
break;
|
|
}
|
|
} else if (charCode === 34 || charCode === 92) {
|
|
if (i > offset)
|
|
_this.writeStringSlice$3(s, offset, i);
|
|
offset = i + 1;
|
|
_this.writeCharCode$1(92);
|
|
_this.writeCharCode$1(charCode);
|
|
}
|
|
}
|
|
if (offset === 0)
|
|
_this.writeString$1(s);
|
|
else if (offset < $length)
|
|
_this.writeStringSlice$3(s, offset, $length);
|
|
},
|
|
_checkCycle$1(object) {
|
|
var t1, t2, i, t3;
|
|
for (t1 = this._seen, t2 = t1.length, i = 0; i < t2; ++i) {
|
|
t3 = t1[i];
|
|
if (object == null ? t3 == null : object === t3)
|
|
throw A.wrapException(new A.JsonCyclicError(object, null));
|
|
}
|
|
B.JSArray_methods.add$1(t1, object);
|
|
},
|
|
writeObject$1(object) {
|
|
var customJson, e, t1, exception, _this = this;
|
|
if (_this.writeJsonValue$1(object))
|
|
return;
|
|
_this._checkCycle$1(object);
|
|
try {
|
|
customJson = _this._toEncodable.call$1(object);
|
|
if (!_this.writeJsonValue$1(customJson)) {
|
|
t1 = A.JsonUnsupportedObjectError$(object, null, _this.get$_partialResult());
|
|
throw A.wrapException(t1);
|
|
}
|
|
t1 = _this._seen;
|
|
if (0 >= t1.length)
|
|
return A.ioore(t1, -1);
|
|
t1.pop();
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
t1 = A.JsonUnsupportedObjectError$(object, e, _this.get$_partialResult());
|
|
throw A.wrapException(t1);
|
|
}
|
|
},
|
|
writeJsonValue$1(object) {
|
|
var t1, success, _this = this;
|
|
if (typeof object == "number") {
|
|
if (!isFinite(object))
|
|
return false;
|
|
_this.writeNumber$1(object);
|
|
return true;
|
|
} else if (object === true) {
|
|
_this.writeString$1("true");
|
|
return true;
|
|
} else if (object === false) {
|
|
_this.writeString$1("false");
|
|
return true;
|
|
} else if (object == null) {
|
|
_this.writeString$1("null");
|
|
return true;
|
|
} else if (typeof object == "string") {
|
|
_this.writeString$1('"');
|
|
_this.writeStringContent$1(object);
|
|
_this.writeString$1('"');
|
|
return true;
|
|
} else if (type$.List_dynamic._is(object)) {
|
|
_this._checkCycle$1(object);
|
|
_this.writeList$1(object);
|
|
t1 = _this._seen;
|
|
if (0 >= t1.length)
|
|
return A.ioore(t1, -1);
|
|
t1.pop();
|
|
return true;
|
|
} else if (type$.Map_dynamic_dynamic._is(object)) {
|
|
_this._checkCycle$1(object);
|
|
success = _this.writeMap$1(object);
|
|
t1 = _this._seen;
|
|
if (0 >= t1.length)
|
|
return A.ioore(t1, -1);
|
|
t1.pop();
|
|
return success;
|
|
} else
|
|
return false;
|
|
},
|
|
writeList$1(list) {
|
|
var t1, i, _this = this;
|
|
_this.writeString$1("[");
|
|
t1 = J.getInterceptor$asx(list);
|
|
if (t1.get$isNotEmpty(list)) {
|
|
_this.writeObject$1(t1.$index(list, 0));
|
|
for (i = 1; i < t1.get$length(list); ++i) {
|
|
_this.writeString$1(",");
|
|
_this.writeObject$1(t1.$index(list, i));
|
|
}
|
|
}
|
|
_this.writeString$1("]");
|
|
},
|
|
writeMap$1(map) {
|
|
var t1, keyValueList, i, separator, t2, _this = this, _box_0 = {};
|
|
if (map.get$isEmpty(map)) {
|
|
_this.writeString$1("{}");
|
|
return true;
|
|
}
|
|
t1 = map.get$length(map) * 2;
|
|
keyValueList = A.List_List$filled(t1, null, false, type$.nullable_Object);
|
|
i = _box_0.i = 0;
|
|
_box_0.allStringKeys = true;
|
|
map.forEach$1(0, new A._JsonStringifier_writeMap_closure(_box_0, keyValueList));
|
|
if (!_box_0.allStringKeys)
|
|
return false;
|
|
_this.writeString$1("{");
|
|
for (separator = '"'; i < t1; i += 2, separator = ',"') {
|
|
_this.writeString$1(separator);
|
|
_this.writeStringContent$1(A._asString(keyValueList[i]));
|
|
_this.writeString$1('":');
|
|
t2 = i + 1;
|
|
if (!(t2 < t1))
|
|
return A.ioore(keyValueList, t2);
|
|
_this.writeObject$1(keyValueList[t2]);
|
|
}
|
|
_this.writeString$1("}");
|
|
return true;
|
|
}
|
|
};
|
|
A._JsonStringifier_writeMap_closure.prototype = {
|
|
call$2(key, value) {
|
|
var t1, t2;
|
|
if (typeof key != "string")
|
|
this._box_0.allStringKeys = false;
|
|
t1 = this.keyValueList;
|
|
t2 = this._box_0;
|
|
B.JSArray_methods.$indexSet(t1, t2.i++, key);
|
|
B.JSArray_methods.$indexSet(t1, t2.i++, value);
|
|
},
|
|
$signature: 29
|
|
};
|
|
A._JsonStringStringifier.prototype = {
|
|
get$_partialResult() {
|
|
var t1 = this._convert$_sink;
|
|
return t1 instanceof A.StringBuffer ? t1.toString$0(0) : null;
|
|
},
|
|
writeNumber$1(number) {
|
|
this._convert$_sink.write$1(B.JSNumber_methods.toString$0(number));
|
|
},
|
|
writeString$1(string) {
|
|
this._convert$_sink.write$1(string);
|
|
},
|
|
writeStringSlice$3(string, start, end) {
|
|
this._convert$_sink.write$1(B.JSString_methods.substring$2(string, start, end));
|
|
},
|
|
writeCharCode$1(charCode) {
|
|
this._convert$_sink.writeCharCode$1(charCode);
|
|
}
|
|
};
|
|
A.Latin1Codec.prototype = {
|
|
encode$1(source) {
|
|
return B.Latin1Encoder_255.convert$1(source);
|
|
}
|
|
};
|
|
A.Latin1Encoder.prototype = {};
|
|
A.LineSplitter.prototype = {
|
|
convert$1(data) {
|
|
var lines, end, sliceStart, char, i, char0;
|
|
A._asString(data);
|
|
lines = A._setArrayType([], type$.JSArray_String);
|
|
end = data.length;
|
|
for (sliceStart = 0, char = 0, i = 0; i < end; ++i, char = char0) {
|
|
char0 = data.charCodeAt(i);
|
|
if (char0 !== 13) {
|
|
if (char0 !== 10)
|
|
continue;
|
|
if (char === 13) {
|
|
sliceStart = i + 1;
|
|
continue;
|
|
}
|
|
}
|
|
B.JSArray_methods.add$1(lines, B.JSString_methods.substring$2(data, sliceStart, i));
|
|
sliceStart = i + 1;
|
|
}
|
|
if (sliceStart < end)
|
|
B.JSArray_methods.add$1(lines, B.JSString_methods.substring$2(data, sliceStart, end));
|
|
return lines;
|
|
}
|
|
};
|
|
A.StringConversionSink.prototype = {
|
|
add$1(_, str) {
|
|
A._asString(str);
|
|
this.addSlice$4(str, 0, str.length, false);
|
|
},
|
|
$isSink: 1
|
|
};
|
|
A._StringConversionSinkAsStringSinkAdapter.prototype = {
|
|
writeCharCode$1(charCode) {
|
|
var t1 = this._buffer,
|
|
t2 = A.Primitives_stringFromCharCode(charCode);
|
|
if ((t1._contents += t2).length > 16)
|
|
this._flush$0();
|
|
},
|
|
write$1(o) {
|
|
if (this._buffer._contents.length !== 0)
|
|
this._flush$0();
|
|
this._chunkedSink.add$1(0, o);
|
|
},
|
|
_flush$0() {
|
|
var t1 = this._buffer,
|
|
t2 = t1._contents;
|
|
t1._contents = "";
|
|
this._chunkedSink.add$1(0, t2.charCodeAt(0) == 0 ? t2 : t2);
|
|
},
|
|
$isStringSink: 1
|
|
};
|
|
A._StringSinkConversionSink.prototype = {
|
|
close$0() {
|
|
},
|
|
addSlice$4(str, start, end, isLast) {
|
|
var t1, t2, i, t3;
|
|
if (start !== 0 || end !== str.length)
|
|
for (t1 = this._stringSink, t2 = str.length, i = start; i < end; ++i) {
|
|
if (!(i < t2))
|
|
return A.ioore(str, i);
|
|
t3 = A.Primitives_stringFromCharCode(str.charCodeAt(i));
|
|
t1._contents += t3;
|
|
}
|
|
else
|
|
this._stringSink._contents += str;
|
|
if (isLast)
|
|
this.close$0();
|
|
},
|
|
add$1(_, str) {
|
|
this._stringSink._contents += A._asString(str);
|
|
}
|
|
};
|
|
A._StringAdapterSink.prototype = {
|
|
add$1(_, str) {
|
|
var t1 = this._convert$_sink,
|
|
t2 = t1._sink;
|
|
str = t2.$ti._rest[1]._as(t1.$ti._precomputed1._as(A._asString(str)));
|
|
if ((t2._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
t2.super$_BufferingStreamSubscription$_add(str);
|
|
},
|
|
addSlice$4(str, start, end, isLast) {
|
|
var _s24_ = "Stream is already closed",
|
|
t1 = start === 0 && end === str.length,
|
|
t2 = this._convert$_sink,
|
|
t3 = t2.$ti;
|
|
t2 = t2._sink;
|
|
if (t1) {
|
|
str = t2.$ti._rest[1]._as(t3._precomputed1._as(str));
|
|
if ((t2._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
t2.super$_BufferingStreamSubscription$_add(str);
|
|
} else {
|
|
t1 = t2.$ti._rest[1]._as(t3._precomputed1._as(B.JSString_methods.substring$2(str, start, end)));
|
|
if ((t2._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
t2.super$_BufferingStreamSubscription$_add(t1);
|
|
}
|
|
if (isLast) {
|
|
if ((t2._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$(_s24_));
|
|
t2.super$_BufferingStreamSubscription$_close();
|
|
}
|
|
},
|
|
close$0() {
|
|
var t1 = this._convert$_sink._sink;
|
|
if ((t1._state & 2) !== 0)
|
|
A.throwExpression(A.StateError$("Stream is already closed"));
|
|
t1.super$_BufferingStreamSubscription$_close();
|
|
}
|
|
};
|
|
A._Utf8ConversionSink.prototype = {
|
|
close$0() {
|
|
var t2, t3, accumulated,
|
|
t1 = this._buffer;
|
|
this._decoder.flush$1(t1);
|
|
t2 = t1._contents;
|
|
t3 = this._chunkedSink;
|
|
if (t2.length !== 0) {
|
|
accumulated = t2.charCodeAt(0) == 0 ? t2 : t2;
|
|
t1._contents = "";
|
|
t3.addSlice$4(accumulated, 0, accumulated.length, true);
|
|
} else
|
|
t3.close$0();
|
|
},
|
|
add$1(_, chunk) {
|
|
type$.List_int._as(chunk);
|
|
this.addSlice$4(chunk, 0, J.get$length$asx(chunk), false);
|
|
},
|
|
addSlice$4(chunk, startIndex, endIndex, isLast) {
|
|
var accumulated,
|
|
t1 = this._buffer,
|
|
t2 = this._decoder._convertGeneral$4(type$.List_int._as(chunk), startIndex, endIndex, false);
|
|
t2 = t1._contents += t2;
|
|
if (t2.length !== 0) {
|
|
accumulated = t2.charCodeAt(0) == 0 ? t2 : t2;
|
|
this._chunkedSink.addSlice$4(accumulated, 0, accumulated.length, false);
|
|
t1._contents = "";
|
|
return;
|
|
}
|
|
}
|
|
};
|
|
A.Utf8Codec.prototype = {
|
|
encode$1(string) {
|
|
return B.C_Utf8Encoder.convert$1(string);
|
|
}
|
|
};
|
|
A.Utf8Encoder.prototype = {
|
|
convert$1(string) {
|
|
var stringLength, end, t1, encoder, t2;
|
|
A._asString(string);
|
|
stringLength = string.length;
|
|
end = A.RangeError_checkValidRange(0, null, stringLength);
|
|
if (end === 0)
|
|
return new Uint8Array(0);
|
|
t1 = new Uint8Array(end * 3);
|
|
encoder = new A._Utf8Encoder(t1);
|
|
if (encoder._fillBuffer$3(string, 0, end) !== end) {
|
|
t2 = end - 1;
|
|
if (!(t2 >= 0 && t2 < stringLength))
|
|
return A.ioore(string, t2);
|
|
encoder._writeReplacementCharacter$0();
|
|
}
|
|
return B.NativeUint8List_methods.sublist$2(t1, 0, encoder._bufferIndex);
|
|
},
|
|
startChunkedConversion$1(sink) {
|
|
type$.Sink_List_int._as(sink);
|
|
return new A._Utf8EncoderSink(new A._ByteAdapterSink(sink), new Uint8Array(1024));
|
|
}
|
|
};
|
|
A._Utf8Encoder.prototype = {
|
|
_writeReplacementCharacter$0() {
|
|
var t4, _this = this,
|
|
t1 = _this._buffer,
|
|
t2 = _this._bufferIndex,
|
|
t3 = _this._bufferIndex = t2 + 1;
|
|
t1.$flags & 2 && A.throwUnsupportedOperation(t1);
|
|
t4 = t1.length;
|
|
if (!(t2 < t4))
|
|
return A.ioore(t1, t2);
|
|
t1[t2] = 239;
|
|
t2 = _this._bufferIndex = t3 + 1;
|
|
if (!(t3 < t4))
|
|
return A.ioore(t1, t3);
|
|
t1[t3] = 191;
|
|
_this._bufferIndex = t2 + 1;
|
|
if (!(t2 < t4))
|
|
return A.ioore(t1, t2);
|
|
t1[t2] = 189;
|
|
},
|
|
_writeSurrogate$2(leadingSurrogate, nextCodeUnit) {
|
|
var rune, t1, t2, t3, t4, _this = this;
|
|
if ((nextCodeUnit & 64512) === 56320) {
|
|
rune = 65536 + ((leadingSurrogate & 1023) << 10) | nextCodeUnit & 1023;
|
|
t1 = _this._buffer;
|
|
t2 = _this._bufferIndex;
|
|
t3 = _this._bufferIndex = t2 + 1;
|
|
t1.$flags & 2 && A.throwUnsupportedOperation(t1);
|
|
t4 = t1.length;
|
|
if (!(t2 < t4))
|
|
return A.ioore(t1, t2);
|
|
t1[t2] = rune >>> 18 | 240;
|
|
t2 = _this._bufferIndex = t3 + 1;
|
|
if (!(t3 < t4))
|
|
return A.ioore(t1, t3);
|
|
t1[t3] = rune >>> 12 & 63 | 128;
|
|
t3 = _this._bufferIndex = t2 + 1;
|
|
if (!(t2 < t4))
|
|
return A.ioore(t1, t2);
|
|
t1[t2] = rune >>> 6 & 63 | 128;
|
|
_this._bufferIndex = t3 + 1;
|
|
if (!(t3 < t4))
|
|
return A.ioore(t1, t3);
|
|
t1[t3] = rune & 63 | 128;
|
|
return true;
|
|
} else {
|
|
_this._writeReplacementCharacter$0();
|
|
return false;
|
|
}
|
|
},
|
|
_fillBuffer$3(str, start, end) {
|
|
var t1, t2, t3, t4, stringIndex, codeUnit, t5, t6, _this = this;
|
|
if (start !== end) {
|
|
t1 = end - 1;
|
|
if (!(t1 >= 0 && t1 < str.length))
|
|
return A.ioore(str, t1);
|
|
t1 = (str.charCodeAt(t1) & 64512) === 55296;
|
|
} else
|
|
t1 = false;
|
|
if (t1)
|
|
--end;
|
|
for (t1 = _this._buffer, t2 = t1.$flags | 0, t3 = t1.length, t4 = str.length, stringIndex = start; stringIndex < end; ++stringIndex) {
|
|
if (!(stringIndex < t4))
|
|
return A.ioore(str, stringIndex);
|
|
codeUnit = str.charCodeAt(stringIndex);
|
|
if (codeUnit <= 127) {
|
|
t5 = _this._bufferIndex;
|
|
if (t5 >= t3)
|
|
break;
|
|
_this._bufferIndex = t5 + 1;
|
|
t2 & 2 && A.throwUnsupportedOperation(t1);
|
|
t1[t5] = codeUnit;
|
|
} else {
|
|
t5 = codeUnit & 64512;
|
|
if (t5 === 55296) {
|
|
if (_this._bufferIndex + 4 > t3)
|
|
break;
|
|
t5 = stringIndex + 1;
|
|
if (!(t5 < t4))
|
|
return A.ioore(str, t5);
|
|
if (_this._writeSurrogate$2(codeUnit, str.charCodeAt(t5)))
|
|
stringIndex = t5;
|
|
} else if (t5 === 56320) {
|
|
if (_this._bufferIndex + 3 > t3)
|
|
break;
|
|
_this._writeReplacementCharacter$0();
|
|
} else if (codeUnit <= 2047) {
|
|
t5 = _this._bufferIndex;
|
|
t6 = t5 + 1;
|
|
if (t6 >= t3)
|
|
break;
|
|
_this._bufferIndex = t6;
|
|
t2 & 2 && A.throwUnsupportedOperation(t1);
|
|
if (!(t5 < t3))
|
|
return A.ioore(t1, t5);
|
|
t1[t5] = codeUnit >>> 6 | 192;
|
|
_this._bufferIndex = t6 + 1;
|
|
t1[t6] = codeUnit & 63 | 128;
|
|
} else {
|
|
t5 = _this._bufferIndex;
|
|
if (t5 + 2 >= t3)
|
|
break;
|
|
t6 = _this._bufferIndex = t5 + 1;
|
|
t2 & 2 && A.throwUnsupportedOperation(t1);
|
|
if (!(t5 < t3))
|
|
return A.ioore(t1, t5);
|
|
t1[t5] = codeUnit >>> 12 | 224;
|
|
t5 = _this._bufferIndex = t6 + 1;
|
|
if (!(t6 < t3))
|
|
return A.ioore(t1, t6);
|
|
t1[t6] = codeUnit >>> 6 & 63 | 128;
|
|
_this._bufferIndex = t5 + 1;
|
|
if (!(t5 < t3))
|
|
return A.ioore(t1, t5);
|
|
t1[t5] = codeUnit & 63 | 128;
|
|
}
|
|
}
|
|
}
|
|
return stringIndex;
|
|
}
|
|
};
|
|
A._Utf8EncoderSink.prototype = {
|
|
close$0() {
|
|
if (this._carry !== 0) {
|
|
this.addSlice$4("", 0, 0, true);
|
|
return;
|
|
}
|
|
this._convert$_sink._convert$_sink.close$0();
|
|
},
|
|
addSlice$4(str, start, end, isLast) {
|
|
var t1, t2, nextCodeUnit, t3, t4, t5, t6, isLastSlice, t7, _this = this;
|
|
_this._bufferIndex = 0;
|
|
t1 = start === end;
|
|
if (t1 && !isLast)
|
|
return;
|
|
t2 = _this._carry;
|
|
if (t2 !== 0) {
|
|
if (!t1) {
|
|
if (!(start < str.length))
|
|
return A.ioore(str, start);
|
|
nextCodeUnit = str.charCodeAt(start);
|
|
} else
|
|
nextCodeUnit = 0;
|
|
if (_this._writeSurrogate$2(t2, nextCodeUnit))
|
|
++start;
|
|
_this._carry = 0;
|
|
}
|
|
t1 = _this._convert$_sink;
|
|
t2 = _this._buffer;
|
|
t3 = type$.List_int;
|
|
t4 = end - 1;
|
|
t5 = str.length;
|
|
t6 = t2.length - 3;
|
|
do {
|
|
start = _this._fillBuffer$3(str, start, end);
|
|
isLastSlice = isLast && start === end;
|
|
if (start === t4) {
|
|
if (!(start < t5))
|
|
return A.ioore(str, start);
|
|
t7 = (str.charCodeAt(start) & 64512) === 55296;
|
|
} else
|
|
t7 = false;
|
|
if (t7) {
|
|
if (isLast && _this._bufferIndex < t6)
|
|
_this._writeReplacementCharacter$0();
|
|
else {
|
|
if (!(start < t5))
|
|
return A.ioore(str, start);
|
|
_this._carry = str.charCodeAt(start);
|
|
}
|
|
++start;
|
|
}
|
|
t7 = _this._bufferIndex;
|
|
t1.add$1(0, B.NativeUint8List_methods.sublist$2(t3._as(t2), 0, t7));
|
|
if (isLastSlice)
|
|
t1.close$0();
|
|
_this._bufferIndex = 0;
|
|
} while (start < end);
|
|
if (isLast)
|
|
_this.close$0();
|
|
},
|
|
$isSink: 1
|
|
};
|
|
A.Utf8Decoder.prototype = {
|
|
convert$1(codeUnits) {
|
|
return new A._Utf8Decoder(this._allowMalformed)._convertGeneral$4(type$.List_int._as(codeUnits), 0, null, true);
|
|
},
|
|
startChunkedConversion$1(sink) {
|
|
type$.Sink_String._as(sink);
|
|
return new A._Utf8ConversionSink(new A._Utf8Decoder(this._allowMalformed), new A._StringAdapterSink(sink), new A.StringBuffer(""));
|
|
},
|
|
bind$1(stream) {
|
|
return this.super$Converter$bind(type$.Stream_List_int._as(stream));
|
|
}
|
|
};
|
|
A._Utf8Decoder.prototype = {
|
|
_convertGeneral$4(codeUnits, start, maybeEnd, single) {
|
|
var end, casted, bytes, errorOffset, t1, result, message, _this = this;
|
|
type$.List_int._as(codeUnits);
|
|
end = A.RangeError_checkValidRange(start, maybeEnd, J.get$length$asx(codeUnits));
|
|
if (start === end)
|
|
return "";
|
|
if (codeUnits instanceof Uint8Array) {
|
|
casted = codeUnits;
|
|
bytes = casted;
|
|
errorOffset = 0;
|
|
} else {
|
|
bytes = A._Utf8Decoder__makeNativeUint8List(codeUnits, start, end);
|
|
end -= start;
|
|
errorOffset = start;
|
|
start = 0;
|
|
}
|
|
if (single && end - start >= 15) {
|
|
t1 = _this.allowMalformed;
|
|
result = A._Utf8Decoder__convertInterceptedUint8List(t1, bytes, start, end);
|
|
if (result != null) {
|
|
if (!t1)
|
|
return result;
|
|
if (result.indexOf("\ufffd") < 0)
|
|
return result;
|
|
}
|
|
}
|
|
result = _this._decodeRecursive$4(bytes, start, end, single);
|
|
t1 = _this._convert$_state;
|
|
if ((t1 & 1) !== 0) {
|
|
message = A._Utf8Decoder_errorDescription(t1);
|
|
_this._convert$_state = 0;
|
|
throw A.wrapException(A.FormatException$(message, codeUnits, errorOffset + _this._charOrIndex));
|
|
}
|
|
return result;
|
|
},
|
|
_decodeRecursive$4(bytes, start, end, single) {
|
|
var mid, s1, _this = this;
|
|
if (end - start > 1000) {
|
|
mid = B.JSInt_methods._tdivFast$1(start + end, 2);
|
|
s1 = _this._decodeRecursive$4(bytes, start, mid, false);
|
|
if ((_this._convert$_state & 1) !== 0)
|
|
return s1;
|
|
return s1 + _this._decodeRecursive$4(bytes, mid, end, single);
|
|
}
|
|
return _this.decodeGeneral$4(bytes, start, end, single);
|
|
},
|
|
flush$1(sink) {
|
|
var t1,
|
|
state = this._convert$_state;
|
|
this._convert$_state = 0;
|
|
if (state <= 32)
|
|
return;
|
|
if (this.allowMalformed) {
|
|
t1 = A.Primitives_stringFromCharCode(65533);
|
|
sink._contents += t1;
|
|
} else
|
|
throw A.wrapException(A.FormatException$(A._Utf8Decoder_errorDescription(77), null, null));
|
|
},
|
|
decodeGeneral$4(bytes, start, end, single) {
|
|
var byte, t2, type, t3, i0, markEnd, i1, m, _this = this,
|
|
_s256_ = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHIHHHJEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKCCCCCCCCCCCCDCLONNNMEEEEEEEEEEE",
|
|
_s144_ = " \x000:XECCCCCN:lDb \x000:XECCCCCNvlDb \x000:XECCCCCN:lDb AAAAA\x00\x00\x00\x00\x00AAAAA00000AAAAA:::::AAAAAGG000AAAAA00KKKAAAAAG::::AAAAA:IIIIAAAAA000\x800AAAAA\x00\x00\x00\x00 AAAAA",
|
|
_65533 = 65533,
|
|
state = _this._convert$_state,
|
|
char = _this._charOrIndex,
|
|
buffer = new A.StringBuffer(""),
|
|
i = start + 1,
|
|
t1 = bytes.length;
|
|
if (!(start >= 0 && start < t1))
|
|
return A.ioore(bytes, start);
|
|
byte = bytes[start];
|
|
$label0$0:
|
|
for (t2 = _this.allowMalformed; true;) {
|
|
for (; true; i = i0) {
|
|
if (!(byte >= 0 && byte < 256))
|
|
return A.ioore(_s256_, byte);
|
|
type = _s256_.charCodeAt(byte) & 31;
|
|
char = state <= 32 ? byte & 61694 >>> type : (byte & 63 | char << 6) >>> 0;
|
|
t3 = state + type;
|
|
if (!(t3 >= 0 && t3 < 144))
|
|
return A.ioore(_s144_, t3);
|
|
state = _s144_.charCodeAt(t3);
|
|
if (state === 0) {
|
|
t3 = A.Primitives_stringFromCharCode(char);
|
|
buffer._contents += t3;
|
|
if (i === end)
|
|
break $label0$0;
|
|
break;
|
|
} else if ((state & 1) !== 0) {
|
|
if (t2)
|
|
switch (state) {
|
|
case 69:
|
|
case 67:
|
|
t3 = A.Primitives_stringFromCharCode(_65533);
|
|
buffer._contents += t3;
|
|
break;
|
|
case 65:
|
|
t3 = A.Primitives_stringFromCharCode(_65533);
|
|
buffer._contents += t3;
|
|
--i;
|
|
break;
|
|
default:
|
|
t3 = A.Primitives_stringFromCharCode(_65533);
|
|
buffer._contents = (buffer._contents += t3) + t3;
|
|
break;
|
|
}
|
|
else {
|
|
_this._convert$_state = state;
|
|
_this._charOrIndex = i - 1;
|
|
return "";
|
|
}
|
|
state = 0;
|
|
}
|
|
if (i === end)
|
|
break $label0$0;
|
|
i0 = i + 1;
|
|
if (!(i >= 0 && i < t1))
|
|
return A.ioore(bytes, i);
|
|
byte = bytes[i];
|
|
}
|
|
i0 = i + 1;
|
|
if (!(i >= 0 && i < t1))
|
|
return A.ioore(bytes, i);
|
|
byte = bytes[i];
|
|
if (byte < 128) {
|
|
while (true) {
|
|
if (!(i0 < end)) {
|
|
markEnd = end;
|
|
break;
|
|
}
|
|
i1 = i0 + 1;
|
|
if (!(i0 >= 0 && i0 < t1))
|
|
return A.ioore(bytes, i0);
|
|
byte = bytes[i0];
|
|
if (byte >= 128) {
|
|
markEnd = i1 - 1;
|
|
i0 = i1;
|
|
break;
|
|
}
|
|
i0 = i1;
|
|
}
|
|
if (markEnd - i < 20)
|
|
for (m = i; m < markEnd; ++m) {
|
|
if (!(m < t1))
|
|
return A.ioore(bytes, m);
|
|
t3 = A.Primitives_stringFromCharCode(bytes[m]);
|
|
buffer._contents += t3;
|
|
}
|
|
else {
|
|
t3 = A.String_String$fromCharCodes(bytes, i, markEnd);
|
|
buffer._contents += t3;
|
|
}
|
|
if (markEnd === end)
|
|
break $label0$0;
|
|
i = i0;
|
|
} else
|
|
i = i0;
|
|
}
|
|
if (single && state > 32)
|
|
if (t2) {
|
|
t1 = A.Primitives_stringFromCharCode(_65533);
|
|
buffer._contents += t1;
|
|
} else {
|
|
_this._convert$_state = 77;
|
|
_this._charOrIndex = end;
|
|
return "";
|
|
}
|
|
_this._convert$_state = state;
|
|
_this._charOrIndex = char;
|
|
t1 = buffer._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
}
|
|
};
|
|
A.__Utf8EncoderSink__Utf8Encoder_StringConversionSink.prototype = {};
|
|
A.DateTime.prototype = {
|
|
$eq(_, other) {
|
|
if (other == null)
|
|
return false;
|
|
return other instanceof A.DateTime && this._core$_value === other._core$_value && this._microsecond === other._microsecond && this.isUtc === other.isUtc;
|
|
},
|
|
get$hashCode(_) {
|
|
return A.Object_hash(this._core$_value, this._microsecond);
|
|
},
|
|
toUtc$0() {
|
|
var _this = this;
|
|
if (_this.isUtc)
|
|
return _this;
|
|
return new A.DateTime(_this._core$_value, _this._microsecond, true);
|
|
},
|
|
toString$0(_) {
|
|
var _this = this,
|
|
y = A.DateTime__fourDigits(A.Primitives_getYear(_this)),
|
|
m = A.DateTime__twoDigits(A.Primitives_getMonth(_this)),
|
|
d = A.DateTime__twoDigits(A.Primitives_getDay(_this)),
|
|
h = A.DateTime__twoDigits(A.Primitives_getHours(_this)),
|
|
min = A.DateTime__twoDigits(A.Primitives_getMinutes(_this)),
|
|
sec = A.DateTime__twoDigits(A.Primitives_getSeconds(_this)),
|
|
ms = A.DateTime__threeDigits(A.Primitives_getMilliseconds(_this)),
|
|
t1 = _this._microsecond,
|
|
us = t1 === 0 ? "" : A.DateTime__threeDigits(t1);
|
|
t1 = y + "-" + m;
|
|
if (_this.isUtc)
|
|
return t1 + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms + us + "Z";
|
|
else
|
|
return t1 + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms + us;
|
|
}
|
|
};
|
|
A.Duration.prototype = {
|
|
$eq(_, other) {
|
|
if (other == null)
|
|
return false;
|
|
return other instanceof A.Duration && this._duration === other._duration;
|
|
},
|
|
get$hashCode(_) {
|
|
return B.JSInt_methods.get$hashCode(this._duration);
|
|
},
|
|
toString$0(_) {
|
|
var minutesPadding, seconds, secondsPadding,
|
|
microseconds = this._duration,
|
|
microseconds0 = microseconds % 3600000000,
|
|
minutes = B.JSInt_methods._tdivFast$1(microseconds0, 60000000);
|
|
microseconds0 %= 60000000;
|
|
minutesPadding = minutes < 10 ? "0" : "";
|
|
seconds = B.JSInt_methods._tdivFast$1(microseconds0, 1000000);
|
|
secondsPadding = seconds < 10 ? "0" : "";
|
|
return "" + (microseconds / 3600000000 | 0) + ":" + minutesPadding + minutes + ":" + secondsPadding + seconds + "." + B.JSString_methods.padLeft$2(B.JSInt_methods.toString$0(microseconds0 % 1000000), 6, "0");
|
|
}
|
|
};
|
|
A._Enum.prototype = {
|
|
toString$0(_) {
|
|
return this._enumToString$0();
|
|
}
|
|
};
|
|
A.Error.prototype = {
|
|
get$stackTrace() {
|
|
return A.Primitives_extractStackTrace(this);
|
|
}
|
|
};
|
|
A.AssertionError.prototype = {
|
|
toString$0(_) {
|
|
var t1 = this.message;
|
|
if (t1 != null)
|
|
return "Assertion failed: " + A.Error_safeToString(t1);
|
|
return "Assertion failed";
|
|
}
|
|
};
|
|
A.TypeError.prototype = {};
|
|
A.ArgumentError.prototype = {
|
|
get$_errorName() {
|
|
return "Invalid argument" + (!this._hasValue ? "(s)" : "");
|
|
},
|
|
get$_errorExplanation() {
|
|
return "";
|
|
},
|
|
toString$0(_) {
|
|
var _this = this,
|
|
$name = _this.name,
|
|
nameString = $name == null ? "" : " (" + $name + ")",
|
|
message = _this.message,
|
|
messageString = message == null ? "" : ": " + A.S(message),
|
|
prefix = _this.get$_errorName() + nameString + messageString;
|
|
if (!_this._hasValue)
|
|
return prefix;
|
|
return prefix + _this.get$_errorExplanation() + ": " + A.Error_safeToString(_this.get$invalidValue());
|
|
},
|
|
get$invalidValue() {
|
|
return this.invalidValue;
|
|
}
|
|
};
|
|
A.RangeError.prototype = {
|
|
get$invalidValue() {
|
|
return A._asNumQ(this.invalidValue);
|
|
},
|
|
get$_errorName() {
|
|
return "RangeError";
|
|
},
|
|
get$_errorExplanation() {
|
|
var explanation,
|
|
start = this.start,
|
|
end = this.end;
|
|
if (start == null)
|
|
explanation = end != null ? ": Not less than or equal to " + A.S(end) : "";
|
|
else if (end == null)
|
|
explanation = ": Not greater than or equal to " + A.S(start);
|
|
else if (end > start)
|
|
explanation = ": Not in inclusive range " + A.S(start) + ".." + A.S(end);
|
|
else
|
|
explanation = end < start ? ": Valid value range is empty" : ": Only valid value is " + A.S(start);
|
|
return explanation;
|
|
}
|
|
};
|
|
A.IndexError.prototype = {
|
|
get$invalidValue() {
|
|
return A._asInt(this.invalidValue);
|
|
},
|
|
get$_errorName() {
|
|
return "RangeError";
|
|
},
|
|
get$_errorExplanation() {
|
|
if (A._asInt(this.invalidValue) < 0)
|
|
return ": index must not be negative";
|
|
var t1 = this.length;
|
|
if (t1 === 0)
|
|
return ": no indices are valid";
|
|
return ": index should be less than " + t1;
|
|
},
|
|
get$length(receiver) {
|
|
return this.length;
|
|
}
|
|
};
|
|
A.UnsupportedError.prototype = {
|
|
toString$0(_) {
|
|
return "Unsupported operation: " + this.message;
|
|
}
|
|
};
|
|
A.UnimplementedError.prototype = {
|
|
toString$0(_) {
|
|
return "UnimplementedError: " + this.message;
|
|
}
|
|
};
|
|
A.StateError.prototype = {
|
|
toString$0(_) {
|
|
return "Bad state: " + this.message;
|
|
}
|
|
};
|
|
A.ConcurrentModificationError.prototype = {
|
|
toString$0(_) {
|
|
var t1 = this.modifiedObject;
|
|
if (t1 == null)
|
|
return "Concurrent modification during iteration.";
|
|
return "Concurrent modification during iteration: " + A.Error_safeToString(t1) + ".";
|
|
}
|
|
};
|
|
A.OutOfMemoryError.prototype = {
|
|
toString$0(_) {
|
|
return "Out of Memory";
|
|
},
|
|
get$stackTrace() {
|
|
return null;
|
|
},
|
|
$isError: 1
|
|
};
|
|
A.StackOverflowError.prototype = {
|
|
toString$0(_) {
|
|
return "Stack Overflow";
|
|
},
|
|
get$stackTrace() {
|
|
return null;
|
|
},
|
|
$isError: 1
|
|
};
|
|
A._Exception.prototype = {
|
|
toString$0(_) {
|
|
return "Exception: " + this.message;
|
|
}
|
|
};
|
|
A.FormatException.prototype = {
|
|
toString$0(_) {
|
|
var t1, lineEnd, lineNum, lineStart, previousCharWasCR, i, char, prefix, postfix, end, start,
|
|
message = this.message,
|
|
report = "" !== message ? "FormatException: " + message : "FormatException",
|
|
offset = this.offset,
|
|
source = this.source;
|
|
if (typeof source == "string") {
|
|
if (offset != null)
|
|
t1 = offset < 0 || offset > source.length;
|
|
else
|
|
t1 = false;
|
|
if (t1)
|
|
offset = null;
|
|
if (offset == null) {
|
|
if (source.length > 78)
|
|
source = B.JSString_methods.substring$2(source, 0, 75) + "...";
|
|
return report + "\n" + source;
|
|
}
|
|
for (lineEnd = source.length, lineNum = 1, lineStart = 0, previousCharWasCR = false, i = 0; i < offset; ++i) {
|
|
if (!(i < lineEnd))
|
|
return A.ioore(source, i);
|
|
char = source.charCodeAt(i);
|
|
if (char === 10) {
|
|
if (lineStart !== i || !previousCharWasCR)
|
|
++lineNum;
|
|
lineStart = i + 1;
|
|
previousCharWasCR = false;
|
|
} else if (char === 13) {
|
|
++lineNum;
|
|
lineStart = i + 1;
|
|
previousCharWasCR = true;
|
|
}
|
|
}
|
|
report = lineNum > 1 ? report + (" (at line " + lineNum + ", character " + (offset - lineStart + 1) + ")\n") : report + (" (at character " + (offset + 1) + ")\n");
|
|
for (i = offset; i < lineEnd; ++i) {
|
|
if (!(i >= 0))
|
|
return A.ioore(source, i);
|
|
char = source.charCodeAt(i);
|
|
if (char === 10 || char === 13) {
|
|
lineEnd = i;
|
|
break;
|
|
}
|
|
}
|
|
prefix = "";
|
|
if (lineEnd - lineStart > 78) {
|
|
postfix = "...";
|
|
if (offset - lineStart < 75) {
|
|
end = lineStart + 75;
|
|
start = lineStart;
|
|
} else {
|
|
if (lineEnd - offset < 75) {
|
|
start = lineEnd - 75;
|
|
end = lineEnd;
|
|
postfix = "";
|
|
} else {
|
|
start = offset - 36;
|
|
end = offset + 36;
|
|
}
|
|
prefix = "...";
|
|
}
|
|
} else {
|
|
end = lineEnd;
|
|
start = lineStart;
|
|
postfix = "";
|
|
}
|
|
return report + prefix + B.JSString_methods.substring$2(source, start, end) + postfix + "\n" + B.JSString_methods.$mul(" ", offset - start + prefix.length) + "^\n";
|
|
} else
|
|
return offset != null ? report + (" (at offset " + A.S(offset) + ")") : report;
|
|
}
|
|
};
|
|
A.Iterable.prototype = {
|
|
get$length(_) {
|
|
var count,
|
|
it = this.get$iterator(this);
|
|
for (count = 0; it.moveNext$0();)
|
|
++count;
|
|
return count;
|
|
},
|
|
elementAt$1(_, index) {
|
|
var iterator, skipCount;
|
|
A.RangeError_checkNotNegative(index, "index");
|
|
iterator = this.get$iterator(this);
|
|
for (skipCount = index; iterator.moveNext$0();) {
|
|
if (skipCount === 0)
|
|
return iterator.get$current();
|
|
--skipCount;
|
|
}
|
|
throw A.wrapException(A.IndexError$withLength(index, index - skipCount, this, null, "index"));
|
|
},
|
|
toString$0(_) {
|
|
return A.Iterable_iterableToShortString(this, "(", ")");
|
|
}
|
|
};
|
|
A.Null.prototype = {
|
|
get$hashCode(_) {
|
|
return A.Object.prototype.get$hashCode.call(this, 0);
|
|
},
|
|
toString$0(_) {
|
|
return "null";
|
|
}
|
|
};
|
|
A.Object.prototype = {$isObject: 1,
|
|
$eq(_, other) {
|
|
return this === other;
|
|
},
|
|
get$hashCode(_) {
|
|
return A.Primitives_objectHashCode(this);
|
|
},
|
|
toString$0(_) {
|
|
return "Instance of '" + A.Primitives_objectTypeName(this) + "'";
|
|
},
|
|
get$runtimeType(_) {
|
|
return A.getRuntimeTypeOfDartObject(this);
|
|
},
|
|
toString() {
|
|
return this.toString$0(this);
|
|
}
|
|
};
|
|
A._StringStackTrace.prototype = {
|
|
toString$0(_) {
|
|
return "";
|
|
},
|
|
$isStackTrace: 1
|
|
};
|
|
A.Stopwatch.prototype = {
|
|
get$elapsedMicroseconds() {
|
|
var ticks,
|
|
t1 = this._stop;
|
|
if (t1 == null)
|
|
t1 = $.Primitives_timerTicks.call$0();
|
|
ticks = t1 - this._core$_start;
|
|
if ($.$get$Stopwatch__frequency() === 1000000)
|
|
return ticks;
|
|
return ticks * 1000;
|
|
}
|
|
};
|
|
A.StringBuffer.prototype = {
|
|
get$length(_) {
|
|
return this._contents.length;
|
|
},
|
|
write$1(obj) {
|
|
var t1 = A.S(obj);
|
|
this._contents += t1;
|
|
},
|
|
writeCharCode$1(charCode) {
|
|
var t1 = A.Primitives_stringFromCharCode(charCode);
|
|
this._contents += t1;
|
|
},
|
|
toString$0(_) {
|
|
var t1 = this._contents;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
$isStringSink: 1
|
|
};
|
|
A.Uri__parseIPv4Address_error.prototype = {
|
|
call$2(msg, position) {
|
|
throw A.wrapException(A.FormatException$("Illegal IPv4 address, " + msg, this.host, position));
|
|
},
|
|
$signature: 74
|
|
};
|
|
A.Uri_parseIPv6Address_error.prototype = {
|
|
call$2(msg, position) {
|
|
throw A.wrapException(A.FormatException$("Illegal IPv6 address, " + msg, this.host, position));
|
|
},
|
|
$signature: 75
|
|
};
|
|
A.Uri_parseIPv6Address_parseHex.prototype = {
|
|
call$2(start, end) {
|
|
var value;
|
|
if (end - start > 4)
|
|
this.error.call$2("an IPv6 part can only contain a maximum of 4 hex digits", start);
|
|
value = A.int_parse(B.JSString_methods.substring$2(this.host, start, end), 16);
|
|
if (value < 0 || value > 65535)
|
|
this.error.call$2("each part must be in the range of `0x0..0xFFFF`", start);
|
|
return value;
|
|
},
|
|
$signature: 76
|
|
};
|
|
A._Uri.prototype = {
|
|
get$_text() {
|
|
var t1, t2, t3, t4, _this = this,
|
|
value = _this.___Uri__text_FI;
|
|
if (value === $) {
|
|
t1 = _this.scheme;
|
|
t2 = t1.length !== 0 ? t1 + ":" : "";
|
|
t3 = _this._core$_host;
|
|
t4 = t3 == null;
|
|
if (!t4 || t1 === "file") {
|
|
t1 = t2 + "//";
|
|
t2 = _this._userInfo;
|
|
if (t2.length !== 0)
|
|
t1 = t1 + t2 + "@";
|
|
if (!t4)
|
|
t1 += t3;
|
|
t2 = _this._core$_port;
|
|
if (t2 != null)
|
|
t1 = t1 + ":" + A.S(t2);
|
|
} else
|
|
t1 = t2;
|
|
t1 += _this.path;
|
|
t2 = _this._query;
|
|
if (t2 != null)
|
|
t1 = t1 + "?" + t2;
|
|
t2 = _this._fragment;
|
|
if (t2 != null)
|
|
t1 = t1 + "#" + t2;
|
|
value = _this.___Uri__text_FI = t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
}
|
|
return value;
|
|
},
|
|
get$hashCode(_) {
|
|
var result, _this = this,
|
|
value = _this.___Uri_hashCode_FI;
|
|
if (value === $) {
|
|
result = B.JSString_methods.get$hashCode(_this.get$_text());
|
|
_this.___Uri_hashCode_FI !== $ && A.throwLateFieldADI("hashCode");
|
|
_this.___Uri_hashCode_FI = result;
|
|
value = result;
|
|
}
|
|
return value;
|
|
},
|
|
get$userInfo() {
|
|
return this._userInfo;
|
|
},
|
|
get$host() {
|
|
var host = this._core$_host;
|
|
if (host == null)
|
|
return "";
|
|
if (B.JSString_methods.startsWith$1(host, "[") && !B.JSString_methods.startsWith$2(host, "v", 1))
|
|
return B.JSString_methods.substring$2(host, 1, host.length - 1);
|
|
return host;
|
|
},
|
|
get$port() {
|
|
var t1 = this._core$_port;
|
|
return t1 == null ? A._Uri__defaultPort(this.scheme) : t1;
|
|
},
|
|
get$query() {
|
|
var t1 = this._query;
|
|
return t1 == null ? "" : t1;
|
|
},
|
|
get$fragment() {
|
|
var t1 = this._fragment;
|
|
return t1 == null ? "" : t1;
|
|
},
|
|
isScheme$1(scheme) {
|
|
var thisScheme = this.scheme;
|
|
if (scheme.length !== thisScheme.length)
|
|
return false;
|
|
return A._caseInsensitiveCompareStart(scheme, thisScheme, 0) >= 0;
|
|
},
|
|
replace$1$scheme(scheme) {
|
|
var isFile, userInfo, port, host, currentPath, t1, path, _this = this;
|
|
scheme = A._Uri__makeScheme(scheme, 0, scheme.length);
|
|
isFile = scheme === "file";
|
|
userInfo = _this._userInfo;
|
|
port = _this._core$_port;
|
|
if (scheme !== _this.scheme)
|
|
port = A._Uri__makePort(port, scheme);
|
|
host = _this._core$_host;
|
|
if (!(host != null))
|
|
host = userInfo.length !== 0 || port != null || isFile ? "" : null;
|
|
currentPath = _this.path;
|
|
if (!isFile)
|
|
t1 = host != null && currentPath.length !== 0;
|
|
else
|
|
t1 = true;
|
|
if (t1 && !B.JSString_methods.startsWith$1(currentPath, "/"))
|
|
currentPath = "/" + currentPath;
|
|
path = currentPath;
|
|
return A._Uri$_internal(scheme, userInfo, host, port, path, _this._query, _this._fragment);
|
|
},
|
|
removeFragment$0() {
|
|
var _this = this;
|
|
if (_this._fragment == null)
|
|
return _this;
|
|
return A._Uri$_internal(_this.scheme, _this._userInfo, _this._core$_host, _this._core$_port, _this.path, _this._query, null);
|
|
},
|
|
_mergePaths$2(base, reference) {
|
|
var backCount, refStart, baseEnd, t1, newEnd, delta, t2, t3, t4;
|
|
for (backCount = 0, refStart = 0; B.JSString_methods.startsWith$2(reference, "../", refStart);) {
|
|
refStart += 3;
|
|
++backCount;
|
|
}
|
|
baseEnd = B.JSString_methods.lastIndexOf$1(base, "/");
|
|
t1 = base.length;
|
|
while (true) {
|
|
if (!(baseEnd > 0 && backCount > 0))
|
|
break;
|
|
newEnd = B.JSString_methods.lastIndexOf$2(base, "/", baseEnd - 1);
|
|
if (newEnd < 0)
|
|
break;
|
|
delta = baseEnd - newEnd;
|
|
t2 = delta !== 2;
|
|
t3 = false;
|
|
if (!t2 || delta === 3) {
|
|
t4 = newEnd + 1;
|
|
if (!(t4 < t1))
|
|
return A.ioore(base, t4);
|
|
if (base.charCodeAt(t4) === 46)
|
|
if (t2) {
|
|
t2 = newEnd + 2;
|
|
if (!(t2 < t1))
|
|
return A.ioore(base, t2);
|
|
t2 = base.charCodeAt(t2) === 46;
|
|
} else
|
|
t2 = true;
|
|
else
|
|
t2 = t3;
|
|
} else
|
|
t2 = t3;
|
|
if (t2)
|
|
break;
|
|
--backCount;
|
|
baseEnd = newEnd;
|
|
}
|
|
return B.JSString_methods.replaceRange$3(base, baseEnd + 1, null, B.JSString_methods.substring$1(reference, refStart - 3 * backCount));
|
|
},
|
|
resolveUri$1(reference) {
|
|
var targetScheme, t1, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, packageNameEnd, packageName, mergedPath, fragment, _this = this;
|
|
if (reference.get$scheme().length !== 0)
|
|
return reference;
|
|
else {
|
|
targetScheme = _this.scheme;
|
|
if (reference.get$hasAuthority()) {
|
|
t1 = reference.replace$1$scheme(targetScheme);
|
|
return t1;
|
|
} else {
|
|
targetUserInfo = _this._userInfo;
|
|
targetHost = _this._core$_host;
|
|
targetPort = _this._core$_port;
|
|
targetPath = _this.path;
|
|
if (reference.get$hasEmptyPath())
|
|
targetQuery = reference.get$hasQuery() ? reference.get$query() : _this._query;
|
|
else {
|
|
packageNameEnd = A._Uri__packageNameEnd(_this, targetPath);
|
|
if (packageNameEnd > 0) {
|
|
packageName = B.JSString_methods.substring$2(targetPath, 0, packageNameEnd);
|
|
targetPath = reference.get$hasAbsolutePath() ? packageName + A._Uri__removeDotSegments(reference.get$path()) : packageName + A._Uri__removeDotSegments(_this._mergePaths$2(B.JSString_methods.substring$1(targetPath, packageName.length), reference.get$path()));
|
|
} else if (reference.get$hasAbsolutePath())
|
|
targetPath = A._Uri__removeDotSegments(reference.get$path());
|
|
else if (targetPath.length === 0)
|
|
if (targetHost == null)
|
|
targetPath = targetScheme.length === 0 ? reference.get$path() : A._Uri__removeDotSegments(reference.get$path());
|
|
else
|
|
targetPath = A._Uri__removeDotSegments("/" + reference.get$path());
|
|
else {
|
|
mergedPath = _this._mergePaths$2(targetPath, reference.get$path());
|
|
t1 = targetScheme.length === 0;
|
|
if (!t1 || targetHost != null || B.JSString_methods.startsWith$1(targetPath, "/"))
|
|
targetPath = A._Uri__removeDotSegments(mergedPath);
|
|
else
|
|
targetPath = A._Uri__normalizeRelativePath(mergedPath, !t1 || targetHost != null);
|
|
}
|
|
targetQuery = reference.get$hasQuery() ? reference.get$query() : null;
|
|
}
|
|
}
|
|
}
|
|
fragment = reference.get$hasFragment() ? reference.get$fragment() : null;
|
|
return A._Uri$_internal(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, fragment);
|
|
},
|
|
get$hasAuthority() {
|
|
return this._core$_host != null;
|
|
},
|
|
get$hasQuery() {
|
|
return this._query != null;
|
|
},
|
|
get$hasFragment() {
|
|
return this._fragment != null;
|
|
},
|
|
get$hasEmptyPath() {
|
|
return this.path.length === 0;
|
|
},
|
|
get$hasAbsolutePath() {
|
|
return B.JSString_methods.startsWith$1(this.path, "/");
|
|
},
|
|
toString$0(_) {
|
|
return this.get$_text();
|
|
},
|
|
$eq(_, other) {
|
|
var t1, t2, t3, _this = this;
|
|
if (other == null)
|
|
return false;
|
|
if (_this === other)
|
|
return true;
|
|
t1 = false;
|
|
if (type$.Uri._is(other))
|
|
if (_this.scheme === other.get$scheme())
|
|
if (_this._core$_host != null === other.get$hasAuthority())
|
|
if (_this._userInfo === other.get$userInfo())
|
|
if (_this.get$host() === other.get$host())
|
|
if (_this.get$port() === other.get$port())
|
|
if (_this.path === other.get$path()) {
|
|
t2 = _this._query;
|
|
t3 = t2 == null;
|
|
if (!t3 === other.get$hasQuery()) {
|
|
if (t3)
|
|
t2 = "";
|
|
if (t2 === other.get$query()) {
|
|
t2 = _this._fragment;
|
|
t3 = t2 == null;
|
|
if (!t3 === other.get$hasFragment()) {
|
|
t1 = t3 ? "" : t2;
|
|
t1 = t1 === other.get$fragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return t1;
|
|
},
|
|
$isUri: 1,
|
|
get$scheme() {
|
|
return this.scheme;
|
|
},
|
|
get$path() {
|
|
return this.path;
|
|
}
|
|
};
|
|
A.UriData.prototype = {
|
|
get$uri() {
|
|
var t2, queryIndex, end, query, _this = this, _null = null,
|
|
t1 = _this._uriCache;
|
|
if (t1 == null) {
|
|
t1 = _this._separatorIndices;
|
|
if (0 >= t1.length)
|
|
return A.ioore(t1, 0);
|
|
t2 = _this._text;
|
|
t1 = t1[0] + 1;
|
|
queryIndex = B.JSString_methods.indexOf$2(t2, "?", t1);
|
|
end = t2.length;
|
|
if (queryIndex >= 0) {
|
|
query = A._Uri__normalizeOrSubstring(t2, queryIndex + 1, end, 256, false, false);
|
|
end = queryIndex;
|
|
} else
|
|
query = _null;
|
|
t1 = _this._uriCache = new A._DataUri("data", "", _null, _null, A._Uri__normalizeOrSubstring(t2, t1, end, 128, false, false), query, _null);
|
|
}
|
|
return t1;
|
|
},
|
|
toString$0(_) {
|
|
var t2,
|
|
t1 = this._separatorIndices;
|
|
if (0 >= t1.length)
|
|
return A.ioore(t1, 0);
|
|
t2 = this._text;
|
|
return t1[0] === -1 ? "data:" + t2 : t2;
|
|
}
|
|
};
|
|
A._SimpleUri.prototype = {
|
|
get$hasAuthority() {
|
|
return this._hostStart > 0;
|
|
},
|
|
get$hasPort() {
|
|
return this._hostStart > 0 && this._portStart + 1 < this._pathStart;
|
|
},
|
|
get$hasQuery() {
|
|
return this._queryStart < this._fragmentStart;
|
|
},
|
|
get$hasFragment() {
|
|
return this._fragmentStart < this._core$_uri.length;
|
|
},
|
|
get$hasAbsolutePath() {
|
|
return B.JSString_methods.startsWith$2(this._core$_uri, "/", this._pathStart);
|
|
},
|
|
get$hasEmptyPath() {
|
|
return this._pathStart === this._queryStart;
|
|
},
|
|
isScheme$1(scheme) {
|
|
var t1 = scheme.length;
|
|
if (t1 === 0)
|
|
return this._schemeEnd < 0;
|
|
if (t1 !== this._schemeEnd)
|
|
return false;
|
|
return A._caseInsensitiveCompareStart(scheme, this._core$_uri, 0) >= 0;
|
|
},
|
|
get$scheme() {
|
|
var t1 = this._schemeCache;
|
|
return t1 == null ? this._schemeCache = this._computeScheme$0() : t1;
|
|
},
|
|
_computeScheme$0() {
|
|
var t2, _this = this,
|
|
t1 = _this._schemeEnd;
|
|
if (t1 <= 0)
|
|
return "";
|
|
t2 = t1 === 4;
|
|
if (t2 && B.JSString_methods.startsWith$1(_this._core$_uri, "http"))
|
|
return "http";
|
|
if (t1 === 5 && B.JSString_methods.startsWith$1(_this._core$_uri, "https"))
|
|
return "https";
|
|
if (t2 && B.JSString_methods.startsWith$1(_this._core$_uri, "file"))
|
|
return "file";
|
|
if (t1 === 7 && B.JSString_methods.startsWith$1(_this._core$_uri, "package"))
|
|
return "package";
|
|
return B.JSString_methods.substring$2(_this._core$_uri, 0, t1);
|
|
},
|
|
get$userInfo() {
|
|
var t1 = this._hostStart,
|
|
t2 = this._schemeEnd + 3;
|
|
return t1 > t2 ? B.JSString_methods.substring$2(this._core$_uri, t2, t1 - 1) : "";
|
|
},
|
|
get$host() {
|
|
var t1 = this._hostStart;
|
|
return t1 > 0 ? B.JSString_methods.substring$2(this._core$_uri, t1, this._portStart) : "";
|
|
},
|
|
get$port() {
|
|
var t1, _this = this;
|
|
if (_this.get$hasPort())
|
|
return A.int_parse(B.JSString_methods.substring$2(_this._core$_uri, _this._portStart + 1, _this._pathStart), null);
|
|
t1 = _this._schemeEnd;
|
|
if (t1 === 4 && B.JSString_methods.startsWith$1(_this._core$_uri, "http"))
|
|
return 80;
|
|
if (t1 === 5 && B.JSString_methods.startsWith$1(_this._core$_uri, "https"))
|
|
return 443;
|
|
return 0;
|
|
},
|
|
get$path() {
|
|
return B.JSString_methods.substring$2(this._core$_uri, this._pathStart, this._queryStart);
|
|
},
|
|
get$query() {
|
|
var t1 = this._queryStart,
|
|
t2 = this._fragmentStart;
|
|
return t1 < t2 ? B.JSString_methods.substring$2(this._core$_uri, t1 + 1, t2) : "";
|
|
},
|
|
get$fragment() {
|
|
var t1 = this._fragmentStart,
|
|
t2 = this._core$_uri;
|
|
return t1 < t2.length ? B.JSString_methods.substring$1(t2, t1 + 1) : "";
|
|
},
|
|
_isPort$1(port) {
|
|
var portDigitStart = this._portStart + 1;
|
|
return portDigitStart + port.length === this._pathStart && B.JSString_methods.startsWith$2(this._core$_uri, port, portDigitStart);
|
|
},
|
|
removeFragment$0() {
|
|
var _this = this,
|
|
t1 = _this._fragmentStart,
|
|
t2 = _this._core$_uri;
|
|
if (t1 >= t2.length)
|
|
return _this;
|
|
return new A._SimpleUri(B.JSString_methods.substring$2(t2, 0, t1), _this._schemeEnd, _this._hostStart, _this._portStart, _this._pathStart, _this._queryStart, t1, _this._schemeCache);
|
|
},
|
|
replace$1$scheme(scheme) {
|
|
var schemeChanged, isFile, t1, userInfo, port, host, t2, path, t3, query, fragment, _this = this, _null = null;
|
|
scheme = A._Uri__makeScheme(scheme, 0, scheme.length);
|
|
schemeChanged = !(_this._schemeEnd === scheme.length && B.JSString_methods.startsWith$1(_this._core$_uri, scheme));
|
|
isFile = scheme === "file";
|
|
t1 = _this._hostStart;
|
|
userInfo = t1 > 0 ? B.JSString_methods.substring$2(_this._core$_uri, _this._schemeEnd + 3, t1) : "";
|
|
port = _this.get$hasPort() ? _this.get$port() : _null;
|
|
if (schemeChanged)
|
|
port = A._Uri__makePort(port, scheme);
|
|
t1 = _this._hostStart;
|
|
if (t1 > 0)
|
|
host = B.JSString_methods.substring$2(_this._core$_uri, t1, _this._portStart);
|
|
else
|
|
host = userInfo.length !== 0 || port != null || isFile ? "" : _null;
|
|
t1 = _this._core$_uri;
|
|
t2 = _this._queryStart;
|
|
path = B.JSString_methods.substring$2(t1, _this._pathStart, t2);
|
|
if (!isFile)
|
|
t3 = host != null && path.length !== 0;
|
|
else
|
|
t3 = true;
|
|
if (t3 && !B.JSString_methods.startsWith$1(path, "/"))
|
|
path = "/" + path;
|
|
t3 = _this._fragmentStart;
|
|
query = t2 < t3 ? B.JSString_methods.substring$2(t1, t2 + 1, t3) : _null;
|
|
t2 = _this._fragmentStart;
|
|
fragment = t2 < t1.length ? B.JSString_methods.substring$1(t1, t2 + 1) : _null;
|
|
return A._Uri$_internal(scheme, userInfo, host, port, path, query, fragment);
|
|
},
|
|
resolveUri$1(reference) {
|
|
if (reference instanceof A._SimpleUri)
|
|
return this._simpleMerge$2(this, reference);
|
|
return this._toNonSimple$0().resolveUri$1(reference);
|
|
},
|
|
_simpleMerge$2(base, ref) {
|
|
var t2, t3, t4, isSimple, delta, refStart, basePathStart, packageNameEnd, basePathStart0, baseStart, baseEnd, baseUri, baseStart0, backCount, refStart0, insert,
|
|
t1 = ref._schemeEnd;
|
|
if (t1 > 0)
|
|
return ref;
|
|
t2 = ref._hostStart;
|
|
if (t2 > 0) {
|
|
t3 = base._schemeEnd;
|
|
if (t3 <= 0)
|
|
return ref;
|
|
t4 = t3 === 4;
|
|
if (t4 && B.JSString_methods.startsWith$1(base._core$_uri, "file"))
|
|
isSimple = ref._pathStart !== ref._queryStart;
|
|
else if (t4 && B.JSString_methods.startsWith$1(base._core$_uri, "http"))
|
|
isSimple = !ref._isPort$1("80");
|
|
else
|
|
isSimple = !(t3 === 5 && B.JSString_methods.startsWith$1(base._core$_uri, "https")) || !ref._isPort$1("443");
|
|
if (isSimple) {
|
|
delta = t3 + 1;
|
|
return new A._SimpleUri(B.JSString_methods.substring$2(base._core$_uri, 0, delta) + B.JSString_methods.substring$1(ref._core$_uri, t1 + 1), t3, t2 + delta, ref._portStart + delta, ref._pathStart + delta, ref._queryStart + delta, ref._fragmentStart + delta, base._schemeCache);
|
|
} else
|
|
return this._toNonSimple$0().resolveUri$1(ref);
|
|
}
|
|
refStart = ref._pathStart;
|
|
t1 = ref._queryStart;
|
|
if (refStart === t1) {
|
|
t2 = ref._fragmentStart;
|
|
if (t1 < t2) {
|
|
t3 = base._queryStart;
|
|
delta = t3 - t1;
|
|
return new A._SimpleUri(B.JSString_methods.substring$2(base._core$_uri, 0, t3) + B.JSString_methods.substring$1(ref._core$_uri, t1), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, t1 + delta, t2 + delta, base._schemeCache);
|
|
}
|
|
t1 = ref._core$_uri;
|
|
if (t2 < t1.length) {
|
|
t3 = base._fragmentStart;
|
|
return new A._SimpleUri(B.JSString_methods.substring$2(base._core$_uri, 0, t3) + B.JSString_methods.substring$1(t1, t2), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, base._queryStart, t2 + (t3 - t2), base._schemeCache);
|
|
}
|
|
return base.removeFragment$0();
|
|
}
|
|
t2 = ref._core$_uri;
|
|
if (B.JSString_methods.startsWith$2(t2, "/", refStart)) {
|
|
basePathStart = base._pathStart;
|
|
packageNameEnd = A._SimpleUri__packageNameEnd(this);
|
|
basePathStart0 = packageNameEnd > 0 ? packageNameEnd : basePathStart;
|
|
delta = basePathStart0 - refStart;
|
|
return new A._SimpleUri(B.JSString_methods.substring$2(base._core$_uri, 0, basePathStart0) + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, basePathStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache);
|
|
}
|
|
baseStart = base._pathStart;
|
|
baseEnd = base._queryStart;
|
|
if (baseStart === baseEnd && base._hostStart > 0) {
|
|
for (; B.JSString_methods.startsWith$2(t2, "../", refStart);)
|
|
refStart += 3;
|
|
delta = baseStart - refStart + 1;
|
|
return new A._SimpleUri(B.JSString_methods.substring$2(base._core$_uri, 0, baseStart) + "/" + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache);
|
|
}
|
|
baseUri = base._core$_uri;
|
|
packageNameEnd = A._SimpleUri__packageNameEnd(this);
|
|
if (packageNameEnd >= 0)
|
|
baseStart0 = packageNameEnd;
|
|
else
|
|
for (baseStart0 = baseStart; B.JSString_methods.startsWith$2(baseUri, "../", baseStart0);)
|
|
baseStart0 += 3;
|
|
backCount = 0;
|
|
while (true) {
|
|
refStart0 = refStart + 3;
|
|
if (!(refStart0 <= t1 && B.JSString_methods.startsWith$2(t2, "../", refStart)))
|
|
break;
|
|
++backCount;
|
|
refStart = refStart0;
|
|
}
|
|
for (t3 = baseUri.length, insert = ""; baseEnd > baseStart0;) {
|
|
--baseEnd;
|
|
if (!(baseEnd >= 0 && baseEnd < t3))
|
|
return A.ioore(baseUri, baseEnd);
|
|
if (baseUri.charCodeAt(baseEnd) === 47) {
|
|
if (backCount === 0) {
|
|
insert = "/";
|
|
break;
|
|
}
|
|
--backCount;
|
|
insert = "/";
|
|
}
|
|
}
|
|
if (baseEnd === baseStart0 && base._schemeEnd <= 0 && !B.JSString_methods.startsWith$2(baseUri, "/", baseStart)) {
|
|
refStart -= backCount * 3;
|
|
insert = "";
|
|
}
|
|
delta = baseEnd - refStart + insert.length;
|
|
return new A._SimpleUri(B.JSString_methods.substring$2(baseUri, 0, baseEnd) + insert + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache);
|
|
},
|
|
get$hashCode(_) {
|
|
var t1 = this._hashCodeCache;
|
|
return t1 == null ? this._hashCodeCache = B.JSString_methods.get$hashCode(this._core$_uri) : t1;
|
|
},
|
|
$eq(_, other) {
|
|
if (other == null)
|
|
return false;
|
|
if (this === other)
|
|
return true;
|
|
return type$.Uri._is(other) && this._core$_uri === other.toString$0(0);
|
|
},
|
|
_toNonSimple$0() {
|
|
var _this = this, _null = null,
|
|
t1 = _this.get$scheme(),
|
|
t2 = _this.get$userInfo(),
|
|
t3 = _this._hostStart > 0 ? _this.get$host() : _null,
|
|
t4 = _this.get$hasPort() ? _this.get$port() : _null,
|
|
t5 = _this._core$_uri,
|
|
t6 = _this._queryStart,
|
|
t7 = B.JSString_methods.substring$2(t5, _this._pathStart, t6),
|
|
t8 = _this._fragmentStart;
|
|
t6 = t6 < t8 ? _this.get$query() : _null;
|
|
return A._Uri$_internal(t1, t2, t3, t4, t7, t6, t8 < t5.length ? _this.get$fragment() : _null);
|
|
},
|
|
toString$0(_) {
|
|
return this._core$_uri;
|
|
},
|
|
$isUri: 1
|
|
};
|
|
A._DataUri.prototype = {};
|
|
A._performance_closure.prototype = {
|
|
call$0() {
|
|
var value = init.G.performance;
|
|
if (value != null && A.JSAnyUtilityExtension_instanceOfString(value, "Object")) {
|
|
A._asJSObject(value);
|
|
if (value.measure != null && value.mark != null && value.clearMeasures != null && value.clearMarks != null)
|
|
return value;
|
|
}
|
|
return null;
|
|
},
|
|
$signature: 77
|
|
};
|
|
A._json_closure.prototype = {
|
|
call$0() {
|
|
var value = init.G.JSON;
|
|
if (value != null && A.JSAnyUtilityExtension_instanceOfString(value, "Object"))
|
|
return A._asJSObject(value);
|
|
throw A.wrapException(A.UnsupportedError$("Missing JSON.parse() support"));
|
|
},
|
|
$signature: 78
|
|
};
|
|
A.TimelineTask.prototype = {
|
|
start$2$arguments($name, $arguments) {
|
|
var t1, t2, t3, _this = this;
|
|
A.ArgumentError_checkNotNull($name, "name", type$.String);
|
|
if ($.$get$_performance() == null) {
|
|
B.JSArray_methods.add$1(_this._stack, null);
|
|
return;
|
|
}
|
|
t1 = _this._taskId;
|
|
B.JSArray_methods.add$1(_this._stack, new A._AsyncBlock($name, t1));
|
|
t2 = type$.dynamic;
|
|
t2 = A.LinkedHashMap_LinkedHashMap$_empty(t2, t2);
|
|
t2.addAll$1(0, $arguments);
|
|
t3 = _this._developer$_parent;
|
|
if (t3 != null)
|
|
t2.$indexSet(0, "parentId", B.JSInt_methods.toRadixString$1(t3._taskId, 16));
|
|
t2.$indexSet(0, "filterKey", _this._filterKey);
|
|
A._reportTaskEvent(t1, -1, 5, $name, A._argumentsAsJson(t2));
|
|
},
|
|
instant$2$arguments($name, $arguments) {
|
|
var t1;
|
|
A.ArgumentError_checkNotNull($name, "name", type$.String);
|
|
if ($.$get$_performance() == null)
|
|
return;
|
|
t1 = type$.dynamic;
|
|
t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1);
|
|
if ($arguments != null)
|
|
t1.addAll$1(0, $arguments);
|
|
t1.$indexSet(0, "filterKey", this._filterKey);
|
|
A._reportTaskEvent(this._taskId, -1, 6, $name, A._argumentsAsJson(t1));
|
|
},
|
|
finish$1$arguments($arguments) {
|
|
var t2, block,
|
|
t1 = this._stack;
|
|
if (t1.length === 0)
|
|
throw A.wrapException(A.StateError$("Uneven calls to start and finish"));
|
|
if ($arguments == null) {
|
|
t2 = type$.dynamic;
|
|
$arguments = A.LinkedHashMap_LinkedHashMap$_empty(t2, t2);
|
|
}
|
|
$arguments.$indexSet(0, "filterKey", this._filterKey);
|
|
if (0 >= t1.length)
|
|
return A.ioore(t1, -1);
|
|
block = t1.pop();
|
|
if (block == null)
|
|
return;
|
|
A._reportTaskEvent(block._taskId, -1, 7, block.name, A._argumentsAsJson($arguments));
|
|
},
|
|
finish$0() {
|
|
return this.finish$1$arguments(null);
|
|
}
|
|
};
|
|
A._AsyncBlock.prototype = {};
|
|
A.OSError.prototype = {
|
|
toString$0(_) {
|
|
var t2,
|
|
t1 = this.message;
|
|
if (t1.length !== 0) {
|
|
t1 = "OS Error: " + t1;
|
|
t2 = this.errorCode;
|
|
if (t2 !== -1)
|
|
t1 = t1 + ", errno = " + B.JSInt_methods.toString$0(t2);
|
|
} else {
|
|
t1 = this.errorCode;
|
|
t1 = t1 !== -1 ? "OS Error: errno = " + B.JSInt_methods.toString$0(t1) : "OS Error";
|
|
}
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
}
|
|
};
|
|
A._BufferAndStart.prototype = {};
|
|
A.GZipCodec.prototype = {
|
|
get$decoder() {
|
|
A._validateZLibWindowBits(15);
|
|
return new A.ZLibDecoder(true, 15, null, false);
|
|
}
|
|
};
|
|
A.ZLibDecoder.prototype = {
|
|
startChunkedConversion$1(sink) {
|
|
type$.Sink_List_int._as(sink);
|
|
if (!(sink instanceof A.ByteConversionSink))
|
|
sink = new A._ByteAdapterSink(sink);
|
|
return new A._ZLibDecoderSink(A.RawZLibFilter__makeZLibInflateFilter(true, this.windowBits, this.dictionary, false), sink);
|
|
}
|
|
};
|
|
A._ZLibDecoderSink.prototype = {};
|
|
A._FilterSink.prototype = {
|
|
add$1(_, data) {
|
|
type$.List_int._as(data);
|
|
this.addSlice$4(data, 0, J.get$length$asx(data), false);
|
|
},
|
|
addSlice$4(data, start, end, isLast) {
|
|
var bufferAndStart, out, t1, t2, exception, _this = this;
|
|
type$.List_int._as(data);
|
|
if (_this._closed)
|
|
return;
|
|
A.RangeError_checkValidRange(start, end, J.get$length$asx(data));
|
|
try {
|
|
_this._empty = false;
|
|
bufferAndStart = A._ensureFastAndSerializableByteData(data, start, end);
|
|
t1 = _this._filter;
|
|
t1.process$3(bufferAndStart.buffer, bufferAndStart.start, end - (start - bufferAndStart.start));
|
|
for (t2 = _this._io$_sink; true;) {
|
|
out = t1.processed$1$flush(false);
|
|
if (out == null)
|
|
break;
|
|
t2.add$1(0, out);
|
|
}
|
|
} catch (exception) {
|
|
_this._closed = true;
|
|
throw exception;
|
|
}
|
|
},
|
|
close$0() {
|
|
var out, t1, t2, exception, _this = this;
|
|
if (_this._closed)
|
|
return;
|
|
if (_this._empty)
|
|
_this._filter.process$3(B.List_empty, 0, 0);
|
|
try {
|
|
for (t1 = _this._io$_sink, t2 = _this._filter; true;) {
|
|
out = t2.processed$1$end(true);
|
|
if (out == null)
|
|
break;
|
|
t1.add$1(0, out);
|
|
}
|
|
} catch (exception) {
|
|
_this._closed = true;
|
|
throw exception;
|
|
}
|
|
_this._closed = true;
|
|
_this._io$_sink.close$0();
|
|
}
|
|
};
|
|
A.FileMode.prototype = {};
|
|
A.FileSystemException.prototype = {
|
|
_toStringHelper$1(className) {
|
|
var t2, _this = this,
|
|
t1 = _this.message;
|
|
if (t1.length !== 0) {
|
|
t1 = className + (": " + t1) + (", path = '" + _this.path + "'");
|
|
t2 = _this.osError;
|
|
if (t2 != null)
|
|
t1 += " (" + t2.toString$0(0) + ")";
|
|
} else {
|
|
t1 = _this.osError;
|
|
if (t1 != null)
|
|
t1 = className + (": " + t1.toString$0(0)) + (", path = '" + _this.path + "'");
|
|
else
|
|
t1 = className + (": " + _this.path);
|
|
}
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
},
|
|
toString$0(_) {
|
|
return this._toStringHelper$1("FileSystemException");
|
|
}
|
|
};
|
|
A.PathAccessException.prototype = {
|
|
toString$0(_) {
|
|
return this._toStringHelper$1("PathAccessException");
|
|
}
|
|
};
|
|
A.PathExistsException.prototype = {
|
|
toString$0(_) {
|
|
return this._toStringHelper$1("PathExistsException");
|
|
}
|
|
};
|
|
A.PathNotFoundException.prototype = {
|
|
toString$0(_) {
|
|
return this._toStringHelper$1("PathNotFoundException");
|
|
}
|
|
};
|
|
A._File.prototype = {
|
|
open$0() {
|
|
return A._File__dispatchWithNamespace(5, [null, this._rawPath, 0]).then$1$1(new A._File_open_closure(this), type$.RandomAccessFile);
|
|
},
|
|
length$0(_) {
|
|
return A._File__dispatchWithNamespace(12, [null, this._rawPath]).then$1$1(new A._File_length_closure(this), type$.int);
|
|
},
|
|
readAsBytes$0() {
|
|
return this.open$0().then$1$1(new A._File_readAsBytes_closure(new A._File_readAsBytes_readUnsized(), new A._File_readAsBytes_readSized()), type$.Uint8List);
|
|
},
|
|
_tryDecode$2(bytes, encoding) {
|
|
var t1, exception;
|
|
type$.List_int._as(bytes);
|
|
try {
|
|
t1 = B.Utf8Decoder_false.convert$1(bytes);
|
|
return t1;
|
|
} catch (exception) {
|
|
t1 = A.FileSystemException$("Failed to decode data using encoding 'utf-8'", this._io$_path, null);
|
|
throw A.wrapException(t1);
|
|
}
|
|
},
|
|
readAsString$1$encoding(encoding) {
|
|
var $async$goto = 0,
|
|
$async$completer = A._makeAsyncAwaitCompleter(type$.String),
|
|
$async$returnValue, $async$self = this;
|
|
var $async$readAsString$1$encoding = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
|
|
if ($async$errorCode === 1)
|
|
return A._asyncRethrow($async$result, $async$completer);
|
|
while (true)
|
|
switch ($async$goto) {
|
|
case 0:
|
|
// Function start
|
|
$async$goto = 3;
|
|
return A._asyncAwait($async$self.readAsBytes$0(), $async$readAsString$1$encoding);
|
|
case 3:
|
|
// returning from await.
|
|
$async$returnValue = $async$self._tryDecode$2($async$result, encoding);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
case 1:
|
|
// return
|
|
return A._asyncReturn($async$returnValue, $async$completer);
|
|
}
|
|
});
|
|
return A._asyncStartSync($async$readAsString$1$encoding, $async$completer);
|
|
},
|
|
toString$0(_) {
|
|
return "File: '" + this._io$_path + "'";
|
|
}
|
|
};
|
|
A._File_open_closure.prototype = {
|
|
call$1(response) {
|
|
var t1 = this.$this._io$_path;
|
|
A._checkForErrorResponse(response, "Cannot open file", t1);
|
|
return new A._RandomAccessFile(t1, A._RandomAccessFileOps__RandomAccessFileOps$_(response));
|
|
},
|
|
$signature: 80
|
|
};
|
|
A._File_length_closure.prototype = {
|
|
call$1(response) {
|
|
A._checkForErrorResponse(response, "Cannot retrieve length of file", this.$this._io$_path);
|
|
return response;
|
|
},
|
|
$signature: 17
|
|
};
|
|
A._File_readAsBytes_readUnsized.prototype = {
|
|
call$1(file) {
|
|
var t1 = A._setArrayType([], type$.JSArray_Uint8List),
|
|
t2 = new A._Future($.Zone__current, type$._Future_Uint8List);
|
|
new A._File_readAsBytes_readUnsized_read(file, new A._BytesBuilder(t1), new A._AsyncCompleter(t2, type$._AsyncCompleter_Uint8List)).call$0();
|
|
return t2;
|
|
},
|
|
$signature: 32
|
|
};
|
|
A._File_readAsBytes_readUnsized_read.prototype = {
|
|
call$0() {
|
|
var _this = this,
|
|
t1 = _this.completer;
|
|
_this.file.read$1(65536).then$1$2$onError(new A._File_readAsBytes_readUnsized_read_closure(_this.builder, _this, t1), t1.get$completeError(), type$.Null);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._File_readAsBytes_readUnsized_read_closure.prototype = {
|
|
call$1(data) {
|
|
var t1;
|
|
type$.Uint8List._as(data);
|
|
t1 = this.builder;
|
|
if (data.length > 0) {
|
|
t1.add$1(0, data);
|
|
this.read.call$0();
|
|
} else
|
|
this.completer.complete$1(t1.takeBytes$0());
|
|
},
|
|
$signature: 83
|
|
};
|
|
A._File_readAsBytes_readSized.prototype = {
|
|
call$2(file, $length) {
|
|
var t2, t1 = {};
|
|
t1.data = new Uint8Array($length);
|
|
t1.offset = 0;
|
|
t2 = new A._Future($.Zone__current, type$._Future_Uint8List);
|
|
new A._File_readAsBytes_readSized_read(t1, file, $length, new A._AsyncCompleter(t2, type$._AsyncCompleter_Uint8List)).call$0();
|
|
return t2;
|
|
},
|
|
$signature: 84
|
|
};
|
|
A._File_readAsBytes_readSized_read.prototype = {
|
|
call$0() {
|
|
var _this = this,
|
|
t1 = _this._box_0,
|
|
t2 = t1.data,
|
|
t3 = t1.offset,
|
|
t4 = _this.length,
|
|
t5 = _this.completer;
|
|
_this.file.readInto$3(t2, t3, Math.min(t3 + 16777216, t4)).then$1$2$onError(new A._File_readAsBytes_readSized_read_closure(t1, _this, t4, t5), t5.get$completeError(), type$.Null);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A._File_readAsBytes_readSized_read_closure.prototype = {
|
|
call$1(readSize) {
|
|
var t1, t2, t3, elementSize, end, _this = this;
|
|
A._asInt(readSize);
|
|
if (readSize > 0) {
|
|
_this._box_0.offset += readSize;
|
|
_this.read.call$0();
|
|
} else {
|
|
t1 = _this._box_0;
|
|
t2 = t1.offset;
|
|
if (t2 < _this.length) {
|
|
t3 = t1.data;
|
|
elementSize = t3.BYTES_PER_ELEMENT;
|
|
end = A.RangeError_checkValidRange(0, t2, B.JSInt_methods.$tdiv(t3.byteLength, elementSize));
|
|
t1.data = J.asUint8List$2$x(B.NativeUint8List_methods.get$buffer(t3), t3.byteOffset + 0 * elementSize, end * elementSize);
|
|
}
|
|
_this.completer.complete$1(t1.data);
|
|
}
|
|
},
|
|
$signature: 85
|
|
};
|
|
A._File_readAsBytes_closure.prototype = {
|
|
call$1(file) {
|
|
type$.RandomAccessFile._as(file);
|
|
return file.length$0(0).then$1$1(new A._File_readAsBytes__closure(this.readUnsized, file, this.readSized), type$.Uint8List).whenComplete$1(file.get$close());
|
|
},
|
|
$signature: 32
|
|
};
|
|
A._File_readAsBytes__closure.prototype = {
|
|
call$1($length) {
|
|
var _this = this;
|
|
A._asInt($length);
|
|
if ($length === 0)
|
|
return _this.readUnsized.call$1(_this.file);
|
|
return _this.readSized.call$2(_this.file, $length);
|
|
},
|
|
$signature: 86
|
|
};
|
|
A._RandomAccessFile.prototype = {
|
|
close$0() {
|
|
return this._dispatch$3$markClosed(7, [null], true).then$1$1(new A._RandomAccessFile_close_closure(this), type$.void);
|
|
},
|
|
read$1(bytes) {
|
|
A.ArgumentError_checkNotNull(bytes, "bytes", type$.int);
|
|
return this._dispatch$2(20, [null, bytes]).then$1$1(new A._RandomAccessFile_read_closure(this), type$.Uint8List);
|
|
},
|
|
readInto$3(buffer, start, end) {
|
|
var t1 = type$.List_int;
|
|
t1._as(buffer);
|
|
A.ArgumentError_checkNotNull(buffer, "buffer", t1);
|
|
end = A.RangeError_checkValidRange(start, end, buffer.length);
|
|
if (end === start)
|
|
return A.Future_Future$value(0, type$.int);
|
|
return this._dispatch$2(21, [null, end - start]).then$1$1(new A._RandomAccessFile_readInto_closure(this, buffer, start), type$.int);
|
|
},
|
|
length$0(_) {
|
|
return this._dispatch$2(11, [null]).then$1$1(new A._RandomAccessFile_length_closure(this), type$.int);
|
|
},
|
|
_pointer$0() {
|
|
return this._ops._getPointer$0();
|
|
},
|
|
_dispatch$3$markClosed(request, data, markClosed) {
|
|
var t1, t2, _this = this, _null = null;
|
|
if (_this.closed) {
|
|
t1 = A._interceptUserError(new A.FileSystemException("File closed", _this.path, _null), _null);
|
|
t2 = new A._Future($.Zone__current, type$._Future_nullable_Object);
|
|
t2._asyncCompleteErrorObject$1(t1);
|
|
return t2;
|
|
}
|
|
if (_this._asyncDispatched) {
|
|
t1 = A._interceptUserError(new A.FileSystemException("An async operation is currently pending", _this.path, _null), _null);
|
|
t2 = new A._Future($.Zone__current, type$._Future_nullable_Object);
|
|
t2._asyncCompleteErrorObject$1(t1);
|
|
return t2;
|
|
}
|
|
if (markClosed)
|
|
_this.closed = true;
|
|
_this._asyncDispatched = true;
|
|
B.JSArray_methods.$indexSet(data, 0, _this._pointer$0());
|
|
},
|
|
_dispatch$2(request, data) {
|
|
return this._dispatch$3$markClosed(request, data, false);
|
|
},
|
|
$isRandomAccessFile: 1
|
|
};
|
|
A._RandomAccessFile_close_closure.prototype = {
|
|
call$1(result) {
|
|
var t2,
|
|
t1 = J.getInterceptor$(result);
|
|
if (t1.$eq(result, -1))
|
|
throw A.wrapException(A.FileSystemException$("Cannot close file", this.$this.path, null));
|
|
t2 = this.$this;
|
|
t1 = t2.closed || t1.$eq(result, 0);
|
|
t2.closed = t1;
|
|
if (t1) {
|
|
t1 = t2.___RandomAccessFile__resourceInfo_A;
|
|
t1 === $ && A.throwLateFieldNI("_resourceInfo");
|
|
$._FileResourceInfo_openFiles.remove$1(0, t1.id);
|
|
}
|
|
},
|
|
$signature: 87
|
|
};
|
|
A._RandomAccessFile_read_closure.prototype = {
|
|
call$1(response) {
|
|
var result,
|
|
t1 = this.$this;
|
|
A._checkForErrorResponse(response, "read failed", t1.path);
|
|
result = type$.Uint8List._as(J.$index$asx(type$.List_nullable_Object._as(response), 1));
|
|
t1 = t1.___RandomAccessFile__resourceInfo_A;
|
|
t1 === $ && A.throwLateFieldNI("_resourceInfo");
|
|
t1.addRead$1(result.length);
|
|
return result;
|
|
},
|
|
$signature: 88
|
|
};
|
|
A._RandomAccessFile_readInto_closure.prototype = {
|
|
call$1(response) {
|
|
var t2, read, t3,
|
|
t1 = this.$this;
|
|
A._checkForErrorResponse(response, "readInto failed", t1.path);
|
|
type$.List_nullable_Object._as(response);
|
|
t2 = J.getInterceptor$asx(response);
|
|
read = A._asInt(t2.$index(response, 1));
|
|
t3 = this.start;
|
|
B.NativeUint8List_methods.setRange$3(this.buffer, t3, t3 + read, type$.List_int._as(t2.$index(response, 2)));
|
|
t1 = t1.___RandomAccessFile__resourceInfo_A;
|
|
t1 === $ && A.throwLateFieldNI("_resourceInfo");
|
|
t1.addRead$1(read);
|
|
return read;
|
|
},
|
|
$signature: 17
|
|
};
|
|
A._RandomAccessFile_length_closure.prototype = {
|
|
call$1(response) {
|
|
A._checkForErrorResponse(response, "length failed", this.$this.path);
|
|
return A._asInt(response);
|
|
},
|
|
$signature: 17
|
|
};
|
|
A.FileSystemEntity.prototype = {};
|
|
A.SecureSocket_startConnect_closure.prototype = {
|
|
call$1(rawState) {
|
|
type$.ConnectionTask_RawSecureSocket._as(rawState);
|
|
return new A.ConnectionTask(rawState.get$socket().then$1$1(new A.SecureSocket_startConnect__closure(), type$.SecureSocket), rawState.get$_io$_onCancel(), type$.ConnectionTask_SecureSocket);
|
|
},
|
|
$signature: 89
|
|
};
|
|
A.SecureSocket_startConnect__closure.prototype = {
|
|
call$1(rawSocket) {
|
|
return A.SecureSocket_SecureSocket$_(rawSocket);
|
|
},
|
|
$signature: 18
|
|
};
|
|
A.SecureSocket_secure_closure.prototype = {
|
|
call$1(detachedRaw) {
|
|
var t2, _this = this,
|
|
t1 = detachedRaw.length;
|
|
if (0 >= t1)
|
|
return A.ioore(detachedRaw, 0);
|
|
t2 = detachedRaw[0];
|
|
if (1 >= t1)
|
|
return A.ioore(detachedRaw, 1);
|
|
return A.RawSecureSocket_secure(t2, _this.context, _this.host, _this.keyLog, _this.onBadCertificate, type$.nullable_StreamSubscription_RawSocketEvent._as(detachedRaw[1]), _this.supportedProtocols);
|
|
},
|
|
$signature: 91
|
|
};
|
|
A.SecureSocket_secure_closure0.prototype = {
|
|
call$1(raw) {
|
|
return A.SecureSocket_SecureSocket$_(raw);
|
|
},
|
|
$signature: 18
|
|
};
|
|
A.RawSecureSocket_startConnect_closure.prototype = {
|
|
call$1(rawState) {
|
|
var _this = this;
|
|
type$.ConnectionTask_RawSocket._as(rawState);
|
|
return new A.ConnectionTask(rawState.get$socket().then$1$1(new A.RawSecureSocket_startConnect__closure(_this.context, _this.onBadCertificate, _this.keyLog, _this.supportedProtocols), type$.RawSecureSocket), rawState.get$_io$_onCancel(), type$.ConnectionTask_RawSecureSocket);
|
|
},
|
|
$signature: 92
|
|
};
|
|
A.RawSecureSocket_startConnect__closure.prototype = {
|
|
call$1(rawSocket) {
|
|
var _this = this;
|
|
return A.RawSecureSocket_secure(rawSocket, _this.context, null, _this.keyLog, _this.onBadCertificate, null, _this.supportedProtocols);
|
|
},
|
|
$signature: 93
|
|
};
|
|
A._FilterStatus.prototype = {};
|
|
A._RawSecureSocket.prototype = {
|
|
get$_socketSubscription() {
|
|
var t1 = this.___RawSecureSocket__socketSubscription_F;
|
|
t1 === $ && A.throwLateFieldNI("_socketSubscription");
|
|
return t1;
|
|
},
|
|
_RawSecureSocket$12(address, requestedPort, isServer, context, _socket, subscription, _bufferedData, requestClientCertificate, requireClientCertificate, onBadCertificate, keyLog, supportedProtocols) {
|
|
var secureFilter, encodedProtocols, e, s, t3, exception, _this = this,
|
|
t1 = _this._io$_controller,
|
|
t2 = _this.get$_onSubscriptionStateChange();
|
|
t1.set$onListen(t2);
|
|
t3 = _this.get$_onPauseStateChange();
|
|
t1.set$onPause(t3);
|
|
t1.set$onResume(t3);
|
|
t1.set$onCancel(t2);
|
|
t2 = _this._secureFilter;
|
|
t2.toString;
|
|
secureFilter = t2;
|
|
secureFilter.init$0();
|
|
secureFilter.registerHandshakeCompleteCallback$1(_this.get$_secureHandshakeCompleteHandler());
|
|
secureFilter.registerBadCertificateCallback$1(_this.get$_onBadCertificateWrapper());
|
|
t1 = _this._io$_socket;
|
|
t1.set$readEventsEnabled(true);
|
|
t1.set$writeEventsEnabled(false);
|
|
_this.___RawSecureSocket__socketSubscription_F = type$.StreamSubscription_RawSocketEvent._as(t1.listen$3$onDone$onError(_this.get$_eventDispatcher(), _this.get$_doneHandler(), _this.get$_reportError()));
|
|
try {
|
|
encodedProtocols = A.SecurityContext__protocolsToLengthEncoding(supportedProtocols);
|
|
t1 = _this.address.get$host();
|
|
secureFilter.connect$6(t1, _this.context, false, false, false, encodedProtocols);
|
|
_this._secureHandshake$0();
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
s = A.getTraceFromException(exception);
|
|
_this._reportError$2(e, s);
|
|
}
|
|
},
|
|
listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) {
|
|
var t1;
|
|
type$.nullable_void_Function_RawSocketEvent._as(onData);
|
|
type$.nullable_void_Function._as(onDone);
|
|
this._sendWriteEvent$0();
|
|
t1 = this._io$_controller;
|
|
return new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError);
|
|
},
|
|
listen$3$onDone$onError(onData, onDone, onError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
|
|
},
|
|
listen$3$cancelOnError$onDone(onData, cancelOnError, onDone) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, null);
|
|
},
|
|
listen$2$cancelOnError(onData, cancelOnError) {
|
|
return this.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, null, null);
|
|
},
|
|
_completeCloseCompleter$1(dummy) {
|
|
var t1;
|
|
type$.nullable_RawSocket._as(dummy);
|
|
t1 = this._closeCompleter;
|
|
if ((t1.future._state & 30) === 0)
|
|
t1.complete$1(this);
|
|
},
|
|
_completeCloseCompleter$0() {
|
|
return this._completeCloseCompleter$1(null);
|
|
},
|
|
_io$_close$0() {
|
|
var _this = this;
|
|
_this._closedRead = _this._closedWrite = true;
|
|
_this._io$_socket.close$0().then$1$1(_this.get$_completeCloseCompleter(), type$.void);
|
|
_this._socketClosedRead = _this._socketClosedWrite = true;
|
|
_this.get$_socketSubscription();
|
|
_this.get$_socketSubscription().cancel$0();
|
|
_this._io$_controller.close$0();
|
|
_this._status = 203;
|
|
},
|
|
shutdown$1(direction) {
|
|
var _this = this;
|
|
if (direction === B.C_SocketDirection || direction === B.C_SocketDirection0) {
|
|
_this._closedWrite = true;
|
|
if (_this._filterStatus.writeEmpty) {
|
|
_this._io$_socket.shutdown$1(B.C_SocketDirection);
|
|
_this._socketClosedWrite = true;
|
|
if (_this._closedRead)
|
|
_this._io$_close$0();
|
|
}
|
|
}
|
|
if (direction === B.C_SocketDirection1 || direction === B.C_SocketDirection0) {
|
|
_this._socketClosedRead = _this._closedRead = true;
|
|
_this._io$_socket.shutdown$1(B.C_SocketDirection1);
|
|
if (_this._socketClosedWrite)
|
|
_this._io$_close$0();
|
|
}
|
|
},
|
|
_onBadCertificateWrapper$1(certificate) {
|
|
return this.onBadCertificate.call$1(certificate);
|
|
},
|
|
_eventDispatcher$1($event) {
|
|
var e, stackTrace, exception, _this = this;
|
|
type$.RawSocketEvent._as($event);
|
|
try {
|
|
if ($event === B.RawSocketEvent_0) {
|
|
_this._readSocket$0();
|
|
_this._filterPending = true;
|
|
_this._tryFilter$0();
|
|
} else if ($event === B.RawSocketEvent_1) {
|
|
_this._writeSocket$0();
|
|
_this._filterPending = true;
|
|
_this._tryFilter$0();
|
|
} else if ($event === B.RawSocketEvent_2)
|
|
_this._closeHandler$0();
|
|
} catch (exception) {
|
|
e = A.unwrapException(exception);
|
|
stackTrace = A.getTraceFromException(exception);
|
|
_this._reportError$2(e, stackTrace);
|
|
}
|
|
},
|
|
_doneHandler$0() {
|
|
if (this._filterStatus.readEmpty)
|
|
this._io$_close$0();
|
|
},
|
|
_reportError$2(e, stackTrace) {
|
|
var t1, _this = this;
|
|
type$.nullable_StackTrace._as(stackTrace);
|
|
if (_this._status === 203)
|
|
return;
|
|
else if (_this._connectPending) {
|
|
t1 = e == null ? A._asObject(e) : e;
|
|
_this._handshakeComplete.completeError$2(t1, stackTrace);
|
|
} else {
|
|
t1 = e == null ? A._asObject(e) : e;
|
|
_this._io$_controller.addError$2(t1, stackTrace);
|
|
}
|
|
_this._io$_close$0();
|
|
},
|
|
_reportError$1(e) {
|
|
return this._reportError$2(e, null);
|
|
},
|
|
_closeHandler$0() {
|
|
var $async$goto = 0,
|
|
$async$completer = A._makeAsyncAwaitCompleter(type$.void),
|
|
$async$returnValue, $async$self = this, t1;
|
|
var $async$_closeHandler$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
|
|
if ($async$errorCode === 1)
|
|
return A._asyncRethrow($async$result, $async$completer);
|
|
while (true)
|
|
switch ($async$goto) {
|
|
case 0:
|
|
// Function start
|
|
t1 = $async$self._status;
|
|
$async$goto = t1 === 202 ? 3 : 5;
|
|
break;
|
|
case 3:
|
|
// then
|
|
if ($async$self._closedRead) {
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
}
|
|
$async$self._socketClosedRead = true;
|
|
$async$goto = $async$self._filterStatus.readEmpty ? 6 : 8;
|
|
break;
|
|
case 6:
|
|
// then
|
|
$async$self._closedRead = true;
|
|
$async$self._io$_controller.add$1(0, B.RawSocketEvent_2);
|
|
if ($async$self._socketClosedWrite)
|
|
$async$self._io$_close$0();
|
|
// goto join
|
|
$async$goto = 7;
|
|
break;
|
|
case 8:
|
|
// else
|
|
$async$self._filterPending = true;
|
|
$async$goto = 9;
|
|
return A._asyncAwait($async$self._tryFilter$0(), $async$_closeHandler$0);
|
|
case 9:
|
|
// returning from await.
|
|
case 7:
|
|
// join
|
|
// goto join
|
|
$async$goto = 4;
|
|
break;
|
|
case 5:
|
|
// else
|
|
if (t1 === 201) {
|
|
$async$self._socketClosedRead = true;
|
|
if ($async$self._filterStatus.readEmpty)
|
|
$async$self._reportError$2(new A.HandshakeException("HandshakeException", "Connection terminated during handshake", null), null);
|
|
}
|
|
case 4:
|
|
// join
|
|
case 1:
|
|
// return
|
|
return A._asyncReturn($async$returnValue, $async$completer);
|
|
}
|
|
});
|
|
return A._asyncStartSync($async$_closeHandler$0, $async$completer);
|
|
},
|
|
_secureHandshake$0() {
|
|
var $async$goto = 0,
|
|
$async$completer = A._makeAsyncAwaitCompleter(type$.void),
|
|
$async$handler = 1, $async$errorStack = [], $async$self = this, needRetryHandshake, e, stackTrace, exception, $async$exception;
|
|
var $async$_secureHandshake$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
|
|
if ($async$errorCode === 1) {
|
|
$async$errorStack.push($async$result);
|
|
$async$goto = $async$handler;
|
|
}
|
|
while (true)
|
|
switch ($async$goto) {
|
|
case 0:
|
|
// Function start
|
|
$async$handler = 3;
|
|
$async$goto = 6;
|
|
return A._asyncAwait($async$self._secureFilter.handshake$0(), $async$_secureHandshake$0);
|
|
case 6:
|
|
// returning from await.
|
|
needRetryHandshake = $async$result;
|
|
$async$goto = needRetryHandshake ? 7 : 9;
|
|
break;
|
|
case 7:
|
|
// then
|
|
$async$goto = 10;
|
|
return A._asyncAwait($async$self._secureHandshake$0(), $async$_secureHandshake$0);
|
|
case 10:
|
|
// returning from await.
|
|
// goto join
|
|
$async$goto = 8;
|
|
break;
|
|
case 9:
|
|
// else
|
|
$async$self._filterStatus.writeEmpty = false;
|
|
$async$self._readSocket$0();
|
|
$async$self._writeSocket$0();
|
|
$async$self._filterPending = true;
|
|
$async$goto = 11;
|
|
return A._asyncAwait($async$self._tryFilter$0(), $async$_secureHandshake$0);
|
|
case 11:
|
|
// returning from await.
|
|
case 8:
|
|
// join
|
|
$async$handler = 1;
|
|
// goto after finally
|
|
$async$goto = 5;
|
|
break;
|
|
case 3:
|
|
// catch
|
|
$async$handler = 2;
|
|
$async$exception = $async$errorStack.pop();
|
|
e = A.unwrapException($async$exception);
|
|
stackTrace = A.getTraceFromException($async$exception);
|
|
$async$self._reportError$2(e, stackTrace);
|
|
// goto after finally
|
|
$async$goto = 5;
|
|
break;
|
|
case 2:
|
|
// uncaught
|
|
// goto rethrow
|
|
$async$goto = 1;
|
|
break;
|
|
case 5:
|
|
// after finally
|
|
// implicit return
|
|
return A._asyncReturn(null, $async$completer);
|
|
case 1:
|
|
// rethrow
|
|
return A._asyncRethrow($async$errorStack.at(-1), $async$completer);
|
|
}
|
|
});
|
|
return A._asyncStartSync($async$_secureHandshake$0, $async$completer);
|
|
},
|
|
_secureHandshakeCompleteHandler$0() {
|
|
var error, stack, exception, _this = this;
|
|
_this._status = 202;
|
|
if (_this._connectPending) {
|
|
_this._connectPending = false;
|
|
try {
|
|
_this._secureFilter.selectedProtocol$0();
|
|
A.Timer_Timer(B.Duration_0, new A._RawSecureSocket__secureHandshakeCompleteHandler_closure(_this));
|
|
} catch (exception) {
|
|
error = A.unwrapException(exception);
|
|
stack = A.getTraceFromException(exception);
|
|
_this._handshakeComplete.completeError$2(error, stack);
|
|
}
|
|
}
|
|
},
|
|
_onPauseStateChange$0() {
|
|
var t3, _this = this,
|
|
t1 = _this._io$_controller,
|
|
t2 = t1._state;
|
|
t2 = (t2 & 1) !== 0 ? (t1.get$_subscription()._state & 4) !== 0 : (t2 & 2) === 0;
|
|
t3 = _this._pauseCount;
|
|
if (t2)
|
|
_this._pauseCount = t3 + 1;
|
|
else {
|
|
t2 = t3 - 1;
|
|
_this._pauseCount = t2;
|
|
if (t2 === 0) {
|
|
_this._scheduleReadEvent$0();
|
|
_this._sendWriteEvent$0();
|
|
}
|
|
}
|
|
if (!_this._socketClosedRead || !_this._socketClosedWrite) {
|
|
t2 = t1._state;
|
|
if ((t2 & 1) !== 0 ? (t1.get$_subscription()._state & 4) !== 0 : (t2 & 2) === 0)
|
|
_this.get$_socketSubscription().pause$0();
|
|
else
|
|
_this.get$_socketSubscription().resume$0();
|
|
}
|
|
},
|
|
_onSubscriptionStateChange$0() {
|
|
},
|
|
_tryFilter$0() {
|
|
var $async$goto = 0,
|
|
$async$completer = A._makeAsyncAwaitCompleter(type$.void),
|
|
$async$returnValue, $async$handler = 2, $async$errorStack = [], $async$self = this, e, st, t1, t2, exception, $async$exception;
|
|
var $async$_tryFilter$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
|
|
if ($async$errorCode === 1) {
|
|
$async$errorStack.push($async$result);
|
|
$async$goto = $async$handler;
|
|
}
|
|
while (true)
|
|
switch ($async$goto) {
|
|
case 0:
|
|
// Function start
|
|
$async$handler = 4;
|
|
t1 = $async$self._io$_socket;
|
|
case 7:
|
|
// for condition
|
|
// trivial condition
|
|
if ($async$self._status === 203) {
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
}
|
|
if (!$async$self._filterPending || $async$self._filterActive) {
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
}
|
|
$async$self._filterActive = true;
|
|
$async$self._filterPending = false;
|
|
$async$goto = 9;
|
|
return A._asyncAwait($async$self._pushAllFilterStages$0(), $async$_tryFilter$0);
|
|
case 9:
|
|
// returning from await.
|
|
$async$self._filterStatus = $async$result;
|
|
$async$self._filterActive = false;
|
|
if ($async$self._status === 203) {
|
|
$async$self._secureFilter.destroy$0();
|
|
$async$self._secureFilter = null;
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
}
|
|
t1.set$readEventsEnabled(true);
|
|
if ($async$self._filterStatus.writeEmpty && $async$self._closedWrite && !$async$self._socketClosedWrite) {
|
|
$async$self.shutdown$1(B.C_SocketDirection);
|
|
if ($async$self._status === 203) {
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
}
|
|
}
|
|
if ($async$self._filterStatus.readEmpty && $async$self._socketClosedRead && !$async$self._closedRead) {
|
|
if ($async$self._status === 201) {
|
|
$async$self._secureFilter.handshake$0();
|
|
if ($async$self._status === 201) {
|
|
t1 = A.HandshakeException$("Connection terminated during handshake");
|
|
throw A.wrapException(t1);
|
|
}
|
|
}
|
|
$async$self._closeHandler$0();
|
|
}
|
|
if ($async$self._status === 203) {
|
|
// goto return
|
|
$async$goto = 1;
|
|
break;
|
|
}
|
|
t2 = $async$self._filterStatus;
|
|
$async$goto = t2.progress ? 10 : 11;
|
|
break;
|
|
case 10:
|
|
// then
|
|
$async$self._filterPending = true;
|
|
if (t2.writeEncryptedNoLongerEmpty)
|
|
$async$self._writeSocket$0();
|
|
if ($async$self._filterStatus.writePlaintextNoLongerFull)
|
|
$async$self._sendWriteEvent$0();
|
|
if ($async$self._filterStatus.readEncryptedNoLongerFull)
|
|
$async$self._readSocket$0();
|
|
if ($async$self._filterStatus.readPlaintextNoLongerEmpty)
|
|
$async$self._scheduleReadEvent$0();
|
|
$async$goto = $async$self._status === 201 ? 12 : 13;
|
|
break;
|
|
case 12:
|
|
// then
|
|
$async$goto = 14;
|
|
return A._asyncAwait($async$self._secureHandshake$0(), $async$_tryFilter$0);
|
|
case 14:
|
|
// returning from await.
|
|
case 13:
|
|
// join
|
|
case 11:
|
|
// join
|
|
// goto for condition
|
|
$async$goto = 7;
|
|
break;
|
|
case 8:
|
|
// after for
|
|
$async$handler = 2;
|
|
// goto after finally
|
|
$async$goto = 6;
|
|
break;
|
|
case 4:
|
|
// catch
|
|
$async$handler = 3;
|
|
$async$exception = $async$errorStack.pop();
|
|
e = A.unwrapException($async$exception);
|
|
st = A.getTraceFromException($async$exception);
|
|
$async$self._reportError$2(e, st);
|
|
// goto after finally
|
|
$async$goto = 6;
|
|
break;
|
|
case 3:
|
|
// uncaught
|
|
// goto rethrow
|
|
$async$goto = 2;
|
|
break;
|
|
case 6:
|
|
// after finally
|
|
case 1:
|
|
// return
|
|
return A._asyncReturn($async$returnValue, $async$completer);
|
|
case 2:
|
|
// rethrow
|
|
return A._asyncRethrow($async$errorStack.at(-1), $async$completer);
|
|
}
|
|
});
|
|
return A._asyncStartSync($async$_tryFilter$0, $async$completer);
|
|
},
|
|
_readSocketOrBufferedData$1(bytes) {
|
|
if (!this._socketClosedRead)
|
|
return this._io$_socket.read$1(bytes);
|
|
else
|
|
return null;
|
|
},
|
|
_readSocket$0() {
|
|
var t1, _this = this;
|
|
if (_this._status === 203)
|
|
return;
|
|
t1 = _this._secureFilter.get$buffers();
|
|
if (2 >= t1.length)
|
|
return A.ioore(t1, 2);
|
|
if (t1[2].writeFromSource$1(_this.get$_readSocketOrBufferedData()).$gt(0, 0))
|
|
_this._filterStatus.readEmpty = false;
|
|
else
|
|
_this._io$_socket.set$readEventsEnabled(false);
|
|
},
|
|
_writeSocket$0() {
|
|
var t1, t2;
|
|
if (this._socketClosedWrite)
|
|
return;
|
|
t1 = this._secureFilter.get$buffers();
|
|
if (3 >= t1.length)
|
|
return A.ioore(t1, 3);
|
|
t2 = this._io$_socket;
|
|
if (t1[3].readToSocket$1(t2))
|
|
t2.set$writeEventsEnabled(true);
|
|
},
|
|
_scheduleReadEvent$0() {
|
|
},
|
|
_sendWriteEvent$0() {
|
|
},
|
|
_pushAllFilterStages$0() {
|
|
var $async$goto = 0,
|
|
$async$completer = A._makeAsyncAwaitCompleter(type$._FilterStatus),
|
|
$async$returnValue, $async$self = this, bufs, i, t2, t1, args, $async$temp1;
|
|
var $async$_pushAllFilterStages$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
|
|
if ($async$errorCode === 1)
|
|
return A._asyncRethrow($async$result, $async$completer);
|
|
while (true)
|
|
$async$outer:
|
|
switch ($async$goto) {
|
|
case 0:
|
|
// Function start
|
|
t1 = $async$self._status;
|
|
args = A.List_List$filled(10, null, false, type$.dynamic);
|
|
B.JSArray_methods.$indexSet(args, 0, $async$self._secureFilter._pointer$0());
|
|
B.JSArray_methods.$indexSet(args, 1, t1 !== 202);
|
|
bufs = $async$self._secureFilter.get$buffers();
|
|
for (t1 = bufs.length, i = 0; i < 4; ++i) {
|
|
t2 = 2 * i;
|
|
if (!(i < t1)) {
|
|
$async$returnValue = A.ioore(bufs, i);
|
|
// goto return
|
|
$async$goto = 1;
|
|
break $async$outer;
|
|
}
|
|
B.JSArray_methods.$indexSet(args, t2 + 2, bufs[i].get$start());
|
|
B.JSArray_methods.$indexSet(args, t2 + 3, bufs[i].get$end());
|
|
}
|
|
$async$temp1 = type$.List_nullable_Object;
|
|
$async$goto = 3;
|
|
return A._asyncAwait(A._IOService__dispatch(43, args), $async$_pushAllFilterStages$0);
|
|
case 3:
|
|
// returning from await.
|
|
$async$temp1._as($async$result);
|
|
case 1:
|
|
// return
|
|
return A._asyncReturn($async$returnValue, $async$completer);
|
|
}
|
|
});
|
|
return A._asyncStartSync($async$_pushAllFilterStages$0, $async$completer);
|
|
},
|
|
$isRawSecureSocket: 1,
|
|
$isRawSocket: 1
|
|
};
|
|
A._RawSecureSocket__secureHandshakeCompleteHandler_closure.prototype = {
|
|
call$0() {
|
|
var t1 = this.$this;
|
|
return t1._handshakeComplete.complete$1(t1);
|
|
},
|
|
$signature: 0
|
|
};
|
|
A.TlsException.prototype = {
|
|
toString$0(_) {
|
|
var t1 = this.type,
|
|
t2 = this.message;
|
|
if (t2.length !== 0)
|
|
t1 += ": " + t2;
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
}
|
|
};
|
|
A.HandshakeException.prototype = {};
|
|
A.SocketDirection.prototype = {};
|
|
A.SocketOption.prototype = {};
|
|
A.RawSocketEvent.prototype = {
|
|
toString$0(_) {
|
|
var t1 = this._io$_value;
|
|
if (!(t1 < 4))
|
|
return A.ioore(B.List_HWg, t1);
|
|
return B.List_HWg[t1];
|
|
}
|
|
};
|
|
A.ConnectionTask.prototype = {};
|
|
A.SocketException.prototype = {
|
|
toString$0(_) {
|
|
var t1 = this.message;
|
|
if (t1.length !== 0)
|
|
t1 = "SocketException" + (": " + t1);
|
|
else
|
|
t1 = "SocketException";
|
|
return t1.charCodeAt(0) == 0 ? t1 : t1;
|
|
}
|
|
};
|
|
(function aliases() {
|
|
var _ = A._StreamSinkImpl.prototype;
|
|
_.super$_StreamSinkImpl$add = _.add$1;
|
|
_.super$_StreamSinkImpl$close = _.close$0;
|
|
_ = A._IOSinkImpl.prototype;
|
|
_.super$_IOSinkImpl$write = _.write$1;
|
|
_ = A._HttpOutboundMessage.prototype;
|
|
_.super$_HttpOutboundMessage$add = _.add$1;
|
|
_.super$_HttpOutboundMessage$write = _.write$1;
|
|
_ = J.LegacyJavaScriptObject.prototype;
|
|
_.super$LegacyJavaScriptObject$toString = _.toString$0;
|
|
_ = A._BufferingStreamSubscription.prototype;
|
|
_.super$_BufferingStreamSubscription$_add = _._add$1;
|
|
_.super$_BufferingStreamSubscription$_addError = _._addError$2;
|
|
_.super$_BufferingStreamSubscription$_close = _._close$0;
|
|
_ = A.ListBase.prototype;
|
|
_.super$ListBase$setRange = _.setRange$4;
|
|
_ = A.Converter.prototype;
|
|
_.super$Converter$bind = _.bind$1;
|
|
_ = A._StringSinkConversionSink.prototype;
|
|
_.super$_StringSinkConversionSink$close = _.close$0;
|
|
})();
|
|
(function installTearOffs() {
|
|
var _static = hunkHelpers.installStaticTearOff,
|
|
_instance_1_u = hunkHelpers._instance_1u,
|
|
_instance_2_u = hunkHelpers._instance_2u,
|
|
_instance_0_u = hunkHelpers._instance_0u,
|
|
_static_0 = hunkHelpers._static_0,
|
|
_static_1 = hunkHelpers._static_1,
|
|
_static_2 = hunkHelpers._static_2,
|
|
_instance = hunkHelpers.installInstanceTearOff,
|
|
_instance_1_i = hunkHelpers._instance_1i,
|
|
_instance_0_i = hunkHelpers._instance_0i;
|
|
_static(A, "_http_HttpClient_findProxyFromEnvironment$closure", 1, null, ["call$2$environment", "call$1"], ["HttpClient_findProxyFromEnvironment", function(url) {
|
|
return A.HttpClient_findProxyFromEnvironment(url, null);
|
|
}], 98, 0);
|
|
var _;
|
|
_instance_1_u(_ = A._StreamSinkImpl.prototype, "get$_completeDoneValue", "_completeDoneValue$1", 13);
|
|
_instance_2_u(_, "get$_completeDoneError", "_completeDoneError$2", 2);
|
|
_instance_1_u(_ = A._HttpParser.prototype, "get$__http$_onData", "__http$_onData$1", 56);
|
|
_instance_0_u(_, "get$__http$_onDone", "__http$_onDone$0", 0);
|
|
_instance_1_u(A.CastStreamSubscription.prototype, "get$__internal$_onData", "__internal$_onData$1", 6);
|
|
_static_0(A, "_js_helper_Primitives_dateNow$closure", "Primitives_dateNow", 26);
|
|
_static_1(A, "async__AsyncRun__scheduleImmediateJsOverride$closure", "_AsyncRun__scheduleImmediateJsOverride", 16);
|
|
_static_1(A, "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", "_AsyncRun__scheduleImmediateWithSetImmediate", 16);
|
|
_static_1(A, "async__AsyncRun__scheduleImmediateWithTimer$closure", "_AsyncRun__scheduleImmediateWithTimer", 16);
|
|
_static_0(A, "async___startMicrotaskLoop$closure", "_startMicrotaskLoop", 0);
|
|
_static_1(A, "async___nullDataHandler$closure", "_nullDataHandler", 13);
|
|
_static_2(A, "async___nullErrorHandler$closure", "_nullErrorHandler", 2);
|
|
_static_0(A, "async___nullDoneHandler$closure", "_nullDoneHandler", 0);
|
|
_instance(A._Completer.prototype, "get$completeError", 0, 1, null, ["call$2", "call$1"], ["completeError$2", "completeError$1"], 28, 0, 0);
|
|
_instance_2_u(A._Future.prototype, "get$_completeError", "_completeError$2", 2);
|
|
_instance_1_i(_ = A._StreamController.prototype, "get$add", "add$1", 6);
|
|
_instance(_, "get$addError", 0, 1, null, ["call$2", "call$1"], ["addError$2", "addError$1"], 28, 0, 0);
|
|
_instance_0_u(_, "get$close", "close$0", 14);
|
|
_instance_0_u(_ = A._ControllerSubscription.prototype, "get$_onPause", "_onPause$0", 0);
|
|
_instance_0_u(_, "get$_onResume", "_onResume$0", 0);
|
|
_instance(_ = A._BufferingStreamSubscription.prototype, "get$pause", 0, 0, null, ["call$1", "call$0"], ["pause$1", "pause$0"], 67, 0, 0);
|
|
_instance_0_u(_, "get$resume", "resume$0", 0);
|
|
_instance_0_u(_, "get$cancel", "cancel$0", 14);
|
|
_instance_0_u(_, "get$_onPause", "_onPause$0", 0);
|
|
_instance_0_u(_, "get$_onResume", "_onResume$0", 0);
|
|
_instance_0_u(A._DoneStreamSubscription.prototype, "get$_onMicrotask", "_onMicrotask$0", 0);
|
|
_instance_0_u(_ = A._ForwardingStreamSubscription.prototype, "get$_onPause", "_onPause$0", 0);
|
|
_instance_0_u(_, "get$_onResume", "_onResume$0", 0);
|
|
_instance_1_u(_, "get$_handleData", "_handleData$1", 6);
|
|
_instance_2_u(_, "get$_handleError", "_handleError$2", 68);
|
|
_instance_0_u(_, "get$_handleDone", "_handleDone$0", 0);
|
|
_instance_0_u(_ = A._SinkTransformerStreamSubscription.prototype, "get$_onPause", "_onPause$0", 0);
|
|
_instance_0_u(_, "get$_onResume", "_onResume$0", 0);
|
|
_instance_1_u(_, "get$_handleData", "_handleData$1", 6);
|
|
_instance_2_u(_, "get$_handleError", "_handleError$2", 2);
|
|
_instance_0_u(_, "get$_handleDone", "_handleDone$0", 0);
|
|
_static_1(A, "convert___defaultToEncodable$closure", "_defaultToEncodable", 27);
|
|
_instance_1_u(A.LineSplitter.prototype, "get$convert", "convert$1", 73);
|
|
_instance_1_i(A._FilterSink.prototype, "get$add", "add$1", 6);
|
|
_instance_0_i(A._File.prototype, "get$length", "length$0", 31);
|
|
_instance_0_u(_ = A._RandomAccessFile.prototype, "get$close", "close$0", 25);
|
|
_instance_0_i(_, "get$length", "length$0", 31);
|
|
_instance(_ = A._RawSecureSocket.prototype, "get$_completeCloseCompleter", 0, 0, null, ["call$1", "call$0"], ["_completeCloseCompleter$1", "_completeCloseCompleter$0"], 94, 0, 0);
|
|
_instance_1_u(_, "get$_onBadCertificateWrapper", "_onBadCertificateWrapper$1", 23);
|
|
_instance_1_u(_, "get$_eventDispatcher", "_eventDispatcher$1", 95);
|
|
_instance_0_u(_, "get$_doneHandler", "_doneHandler$0", 0);
|
|
_instance(_, "get$_reportError", 0, 1, null, ["call$2", "call$1"], ["_reportError$2", "_reportError$1"], 96, 0, 0);
|
|
_instance_0_u(_, "get$_secureHandshakeCompleteHandler", "_secureHandshakeCompleteHandler$0", 0);
|
|
_instance_0_u(_, "get$_onPauseStateChange", "_onPauseStateChange$0", 0);
|
|
_instance_0_u(_, "get$_onSubscriptionStateChange", "_onSubscriptionStateChange$0", 0);
|
|
_instance_1_u(_, "get$_readSocketOrBufferedData", "_readSocketOrBufferedData$1", 97);
|
|
})();
|
|
(function inheritance() {
|
|
var _mixin = hunkHelpers.mixin,
|
|
_inherit = hunkHelpers.inherit,
|
|
_inheritMany = hunkHelpers.inheritMany;
|
|
_inherit(A.Object, null);
|
|
_inheritMany(A.Object, [A.JS_CONST, A.Closure, A.SameSite, A._Enum, A.HttpException, A.RedirectException, A._HttpHeaders, A._HeaderValue, A._Cookie, A._HttpProfileEvent, A._HttpProfileData, A._CopyingBytesBuilder, A.Stream, A.Converter, A._Uint8ListConversionSink, A._StreamSinkImpl, A._HttpOutgoing, A._HttpClientConnection, A._ConnectionInfo, A._ConnectionTarget, A._HttpClient, A._ProxyConfiguration, A._Proxy, A._HttpConnectionInfo, A._RedirectInfo, J.Interceptor, A.SafeToStringHook, J.ArrayIterator, A.CastStreamSubscription, A._BytesBuilder, A.Error, A.ListBase, A.SentinelValue, A.Iterable, A.ListIterator, A.WhereIterator, A.EmptyIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.ConstantMap, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.MapBase, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._UnmodifiableNativeByteBufferView, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A.TimeoutException, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.StreamTransformerBase, A._StreamController, A._SyncStreamControllerDispatch, A._BufferingStreamSubscription, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._DoneStreamSubscription, A._StreamIterator, A._EventSinkWrapper, A._Zone, A._HashMapKeyIterator, A.SetBase, A._HashSetIterator, A._UnmodifiableMapMixin, A.MapView, A._ListQueueIterator, A.StringConversionSink, A.Codec, A._Base64Encoder, A.ByteConversionSink, A.ChunkedConversionSink, A._ConverterStreamEventSink, A._JsonStringifier, A._StringConversionSinkAsStringSinkAdapter, A._Utf8Encoder, A._Utf8Decoder, A.DateTime, A.Duration, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.Null, A._StringStackTrace, A.Stopwatch, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.TimelineTask, A._AsyncBlock, A.OSError, A._BufferAndStart, A.FileMode, A.FileSystemException, A.FileSystemEntity, A._RandomAccessFile, A._FilterStatus, A.TlsException, A.SocketDirection, A.SocketOption, A.RawSocketEvent, A.ConnectionTask, A.SocketException]);
|
|
_inheritMany(A.Closure, [A._httpConnectionHook_closure, A.Closure0Args, A.HttpDate__parseCookieDate_isDelimiter, A.HttpDate__parseCookieDate_isNonDelimiter, A.HttpDate__parseCookieDate_isDigit, A.HttpDate__parseCookieDate_getMonth, A.HttpDate__parseCookieDate_toInt, A.Closure2Args, A._HeaderValue__parse_expect, A._HeaderValue__parse_maybeExpect, A._HttpIncoming_listen_closure, A._HttpIncoming_listen_closure0, A._HttpClientResponse_redirect_closure, A._HttpClientResponse_listen_closure, A._HttpClientResponse__authenticate_retry_closure, A._HttpClientResponse__authenticate_retry__closure, A._HttpClientResponse__authenticate_findCredentials, A._HttpClientResponse__authenticate_closure, A._StreamSinkImpl__controller_closure, A._HttpClientRequest_closure, A._HttpClientRequest__closure, A._HttpClientRequest_closure0, A._HttpClientRequest_done_closure, A._HttpClientRequest__handleIncoming_closure, A._HttpClientRequest__handleIncoming_closure0, A._HttpClientRequest__handleIncoming_closure1, A._HttpOutgoing_addStream_onData, A._HttpOutgoing_addStream_closure, A._HttpOutgoing_close_finalize_closure, A._HttpClientConnection_closure, A._HttpClientConnection__closure, A._HttpClientConnection__closure1, A._HttpClientConnection_send_closure, A._HttpClientConnection_send__closure, A._HttpClientConnection_send___closure, A._HttpClientConnection_send__closure0, A._HttpClientConnection_send__closure1, A._HttpClientConnection_send_closure0, A._HttpClientConnection__close_closure, A._HttpClientConnection_createProxyTunnel_closure, A._HttpClientConnection_createProxyTunnel_closure0, A._ConnectionTarget_connect_callback, A._ConnectionTarget_connect_closure, A._ConnectionTarget_connect__closure, A._ConnectionTarget_connect___closure, A._ConnectionTarget_connect__closure0, A._ConnectionTarget_connect_closure0, A._HttpClient__openUrl_closure, A._HttpClient__openUrl_closure_send, A._HttpClient__openUrl_closure0, A._HttpClient__openUrlFromRequest_closure, A._HttpClient__findProxyFromEnvironment_checkNoProxy, A._HttpClient__findProxyFromEnvironment_checkNoProxy_closure, A._HttpClient__findProxyFromEnvironment_checkProxy, A._AuthenticationScheme__AuthenticationScheme$fromString_closure, A.TearOffClosure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A.Future_wait_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A._Future_timeout_closure0, A.Stream_join_closure0, A.Stream_length_closure, A.Converter_bind_closure, A._File_open_closure, A._File_length_closure, A._File_readAsBytes_readUnsized, A._File_readAsBytes_readUnsized_read_closure, A._File_readAsBytes_readSized_read_closure, A._File_readAsBytes_closure, A._File_readAsBytes__closure, A._RandomAccessFile_close_closure, A._RandomAccessFile_read_closure, A._RandomAccessFile_readInto_closure, A._RandomAccessFile_length_closure, A.SecureSocket_startConnect_closure, A.SecureSocket_startConnect__closure, A.SecureSocket_secure_closure, A.SecureSocket_secure_closure0, A.RawSecureSocket_startConnect_closure, A.RawSecureSocket_startConnect__closure]);
|
|
_inheritMany(A._Enum, [A.HttpClientResponseCompressionState, A._AuthenticationScheme]);
|
|
_inheritMany(A.Closure0Args, [A.HttpDate__parseCookieDate_error, A.HttpDate__parseCookieDate_isEnd, A._HeaderValue__parse_done, A._HeaderValue__parse_skipWS, A._HeaderValue__parse_parseValue, A._HeaderValue__parse_parseParameters, A._HeaderValue__parse_parseParameters_parseParameterName, A._HeaderValue__parse_parseParameters_parseParameterValue, A._Cookie__parseSetCookieValue_done, A._Cookie__parseSetCookieValue_parseName, A._Cookie__parseSetCookieValue_parseValue, A._Cookie__parseSetCookieValue_parseAttributes, A._Cookie__parseSetCookieValue_parseAttributes_parseAttributeName, A._Cookie__parseSetCookieValue_parseAttributes_parseAttributeValue, A._HttpClientResponse__authenticate_retry, A._HttpClientResponse__authenticate_authChallenge, A._HttpClientRequest__requestUri_uriStartingFromPath, A._HttpOutgoing_close_finalize, A._HttpClientConnection_closure0, A._HttpClientConnection_startTimer_closure, A._HttpClient__getConnectionTarget_closure, A._HttpParser$__closure, A._HttpParser$__closure0, A._HttpParser$__closure1, A._HttpParser$__closure2, A._HttpParser__createIncoming_closure, A._HttpParser__createIncoming_closure0, A._HttpParser__createIncoming_closure1, A._HttpParser__createIncoming_closure2, A.nullFuture_closure, A.Primitives_initTicker_closure, A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A._Future__addListener_closure, A._Future__prependListeners_closure, A._Future__chainCoreFuture_closure, A._Future__asyncCompleteWithValue_closure, A._Future__asyncCompleteErrorObject_closure, A._Future__propagateToListeners_handleWhenCompleteCallback, A._Future__propagateToListeners_handleValueCallback, A._Future__propagateToListeners_handleError, A._Future_timeout_closure, A.Stream_join_closure, A.Stream_length_closure0, A._StreamController__subscribe_closure, A._StreamController__recordCancel_complete, A._AddStreamState_cancel_closure, A._BufferingStreamSubscription_asFuture_closure, A._BufferingStreamSubscription_asFuture__closure, A._BufferingStreamSubscription__sendError_sendError, A._BufferingStreamSubscription__sendDone_sendDone, A._PendingEvents_schedule_closure, A._DoneStreamSubscription_asFuture_closure, A._cancelAndError_closure, A._rootHandleError_closure, A._RootZone_bindCallbackGuarded_closure, A._Utf8Decoder__decoder_closure, A._Utf8Decoder__decoderNonfatal_closure, A._performance_closure, A._json_closure, A._File_readAsBytes_readUnsized_read, A._File_readAsBytes_readSized_read, A._RawSecureSocket__secureHandshakeCompleteHandler_closure]);
|
|
_inheritMany(A.Closure2Args, [A._HttpHeaders_forEach_closure, A._HttpHeaders__build_closure, A._HttpHeaders_toString_closure, A._HeaderValue_toString_closure, A._HttpProfileData_formatHeaders_closure, A._HttpClientResponse_listen_closure0, A._HttpClientResponse__authenticate_requestAuthentication, A._StreamSinkImpl__controller_closure0, A._HttpClientRequest__handleIncoming_closure2, A._HttpOutgoing_addStream_closure0, A._HttpOutgoing_close_finalize_closure0, A._HttpClientConnection__closure0, A._HttpClientConnection_closure1, A._HttpClientConnection_send__closure2, A._HttpClient__getConnection_connect, A._HttpClient__findCredentials_closure, A.JsLinkedHashMap_addAll_closure, A.initHooks_closure0, A._awaitOnObject_closure0, A._wrapJsFunctionForAsync_closure, A.Future_wait_handleError, A._Future__propagateToListeners_handleWhenCompleteCallback_closure0, A._Future_timeout_closure1, A.Stream_handleError_closure, A._BufferingStreamSubscription_asFuture_closure0, A.HashMap_HashMap$from_closure, A.MapBase_mapToString_closure, A._JsonStringifier_writeMap_closure, A.Uri__parseIPv4Address_error, A.Uri_parseIPv6Address_error, A.Uri_parseIPv6Address_parseHex, A._File_readAsBytes_readSized]);
|
|
_inherit(A._ContentType, A._HeaderValue);
|
|
_inheritMany(A.Stream, [A._HttpIncoming, A._HttpInboundMessageListInt, A._HttpParser, A.CastStream, A._StreamImpl, A._EmptyStream, A._ForwardingStream, A._BoundSinkStream, A._RawSecureSocket]);
|
|
_inherit(A._HttpClientResponse, A._HttpInboundMessageListInt);
|
|
_inheritMany(A.Converter, [A._ToUint8List, A._UnicodeSubsetEncoder, A.Base64Encoder, A.JsonEncoder, A.JsonDecoder, A.Utf8Encoder, A.Utf8Decoder, A.ZLibDecoder]);
|
|
_inherit(A._IOSinkImpl, A._StreamSinkImpl);
|
|
_inherit(A._HttpOutboundMessage, A._IOSinkImpl);
|
|
_inherit(A._HttpClientRequest, A._HttpOutboundMessage);
|
|
_inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]);
|
|
_inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]);
|
|
_inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]);
|
|
_inherit(J.JSArraySafeToStringHook, A.SafeToStringHook);
|
|
_inherit(J.JSUnmodifiableArray, J.JSArray);
|
|
_inheritMany(J.JSNumber, [J.JSInt, J.JSNumNotInt]);
|
|
_inheritMany(A.Error, [A.LateError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A.RuntimeError, A._Error, A.JsonUnsupportedObjectError, A.AssertionError, A.ArgumentError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError]);
|
|
_inherit(A.UnmodifiableListBase, A.ListBase);
|
|
_inherit(A.CodeUnits, A.UnmodifiableListBase);
|
|
_inheritMany(A.Iterable, [A.EfficientLengthIterable, A.WhereIterable]);
|
|
_inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.EmptyIterable, A.LinkedHashMapKeysIterable, A._HashMapKeyIterable]);
|
|
_inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable, A.ListQueue, A._JsonMapKeyIterable]);
|
|
_inherit(A.ConstantStringMap, A.ConstantMap);
|
|
_inherit(A.NullError, A.TypeError);
|
|
_inheritMany(A.TearOffClosure, [A.StaticClosure, A.BoundClosure]);
|
|
_inheritMany(A.MapBase, [A.JsLinkedHashMap, A._HashMap, A._JsonMap]);
|
|
_inheritMany(A.NativeTypedData, [A.NativeByteData, A.NativeTypedArray]);
|
|
_inheritMany(A.NativeTypedArray, [A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin]);
|
|
_inherit(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin);
|
|
_inherit(A.NativeTypedArrayOfDouble, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin);
|
|
_inherit(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin);
|
|
_inherit(A.NativeTypedArrayOfInt, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin);
|
|
_inheritMany(A.NativeTypedArrayOfDouble, [A.NativeFloat32List, A.NativeFloat64List]);
|
|
_inheritMany(A.NativeTypedArrayOfInt, [A.NativeInt16List, A.NativeInt32List, A.NativeInt8List, A.NativeUint16List, A.NativeUint32List, A.NativeUint8ClampedList, A.NativeUint8List]);
|
|
_inherit(A._TypeError, A._Error);
|
|
_inherit(A._AsyncCompleter, A._Completer);
|
|
_inherit(A._SyncStreamController, A._StreamController);
|
|
_inherit(A._ControllerStream, A._StreamImpl);
|
|
_inheritMany(A._BufferingStreamSubscription, [A._ControllerSubscription, A._ForwardingStreamSubscription, A._SinkTransformerStreamSubscription]);
|
|
_inheritMany(A._DelayedEvent, [A._DelayedData, A._DelayedError]);
|
|
_inheritMany(A._ForwardingStream, [A._MapStream, A._HandleErrorStream]);
|
|
_inherit(A._RootZone, A._Zone);
|
|
_inherit(A._SetBase, A.SetBase);
|
|
_inherit(A._HashSet, A._SetBase);
|
|
_inherit(A._UnmodifiableMapView_MapView__UnmodifiableMapMixin, A.MapView);
|
|
_inherit(A.UnmodifiableMapView, A._UnmodifiableMapView_MapView__UnmodifiableMapMixin);
|
|
_inheritMany(A.StringConversionSink, [A._StringSinkConversionSink, A._UnicodeSubsetEncoderSink, A._StringAdapterSink]);
|
|
_inherit(A._JsonDecoderSink, A._StringSinkConversionSink);
|
|
_inheritMany(A.Codec, [A.Encoding, A.Base64Codec, A.JsonCodec, A.GZipCodec]);
|
|
_inheritMany(A.Encoding, [A.AsciiCodec, A.Latin1Codec, A.Utf8Codec]);
|
|
_inheritMany(A._UnicodeSubsetEncoder, [A.AsciiEncoder, A.Latin1Encoder]);
|
|
_inherit(A._BufferCachingBase64Encoder, A._Base64Encoder);
|
|
_inheritMany(A.ByteConversionSink, [A._Base64EncoderSink, A._ByteAdapterSink, A._Utf8ConversionSink, A._FilterSink]);
|
|
_inherit(A._AsciiBase64EncoderSink, A._Base64EncoderSink);
|
|
_inherit(A.JsonCyclicError, A.JsonUnsupportedObjectError);
|
|
_inherit(A._JsonEncoderSink, A.ChunkedConversionSink);
|
|
_inherit(A._JsonStringStringifier, A._JsonStringifier);
|
|
_inherit(A.LineSplitter, A.StreamTransformerBase);
|
|
_inherit(A.__Utf8EncoderSink__Utf8Encoder_StringConversionSink, A._Utf8Encoder);
|
|
_inherit(A._Utf8EncoderSink, A.__Utf8EncoderSink__Utf8Encoder_StringConversionSink);
|
|
_inheritMany(A.ArgumentError, [A.RangeError, A.IndexError]);
|
|
_inherit(A._DataUri, A._Uri);
|
|
_inherit(A._ZLibDecoderSink, A._FilterSink);
|
|
_inheritMany(A.FileSystemException, [A.PathAccessException, A.PathExistsException, A.PathNotFoundException]);
|
|
_inherit(A._File, A.FileSystemEntity);
|
|
_inherit(A.HandshakeException, A.TlsException);
|
|
_mixin(A.UnmodifiableListBase, A.UnmodifiableListMixin);
|
|
_mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A.ListBase);
|
|
_mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin);
|
|
_mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin, A.ListBase);
|
|
_mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin);
|
|
_mixin(A._SyncStreamController, A._SyncStreamControllerDispatch);
|
|
_mixin(A._UnmodifiableMapView_MapView__UnmodifiableMapMixin, A._UnmodifiableMapMixin);
|
|
_mixin(A.__Utf8EncoderSink__Utf8Encoder_StringConversionSink, A.StringConversionSink);
|
|
})();
|
|
var init = {
|
|
G: typeof self != "undefined" ? self : globalThis,
|
|
typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []},
|
|
mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List", Object: "Object", Map: "Map", JSObject: "JSObject"},
|
|
mangledNames: {},
|
|
types: ["~()", "String()", "~(Object,StackTrace)", "Null(@)", "Null()", "0&(@)", "~(Object?)", "bool(String)", "~(String,List<String>)", "Null(Object,StackTrace)", "bool()", "Null(@,@)", "Future<HttpClientResponse>(@)", "~(@)", "Future<@>()", "Null(@,StackTrace)", "~(~())", "int(Object?)", "SecureSocket(RawSecureSocket)", "int(String)", "Future<HttpClientResponse>(_HttpClientRequest)", "Null(HttpClientResponse)", "bool(Object)", "bool(X509Certificate)", "String?(String?)", "Future<~>()", "int()", "@(@)", "~(Object[StackTrace?])", "~(Object?,Object?)", "@()", "Future<int>()", "Future<Uint8List>(RandomAccessFile)", "_HttpOutboundMessage<@>(@,@)", "~(_HttpIncoming)", "List<String>?()", "_Credentials?(_AuthenticationScheme)", "Socket(Socket)", "Null(_HttpIncoming)", "Null(bool)", "~(Socket)", "Future<SecureSocket>(HttpClientResponse)", "_HttpClientConnection(SecureSocket)", "Future<bool>(_AuthenticationScheme,String?)", "Future<_ConnectionInfo>(ConnectionTask<Socket>)", "_ConnectionInfo/(Socket)", "_ConnectionInfo(_HttpClientConnection)", "_HttpClientRequest/(_ConnectionInfo)", "_HttpClientRequest(_ConnectionInfo)", "_HttpClientRequest(_HttpClientRequest)", "_ConnectionTarget()", "Future<_ConnectionInfo>(@,@)", "_SiteCredentials?(_SiteCredentials?,_Credentials)", "HttpClientResponse/(bool)", "String(String)", "bool(_AuthenticationScheme)", "~(Uint8List)", "bool(@)", "~(String,String?)", "Uint8List(Uint8List)", "~(String)", "Future<HttpClientResponse>()", "@(@,String)", "@(String)", "Null(~())", "~(bool)", "HttpClientResponse/(List<@>)", "~([Future<~>?])", "~(@,StackTrace)", "~(@,@)", "~(List<int>)", "_HttpOutboundMessage<@>?(@)", "_ConverterStreamEventSink<@,@>(EventSink<@>)", "List<String>(String)", "~(String,int)", "~(String,int?)", "int(int,int)", "JSObject?()", "JSObject()", "_HttpOutboundMessage<@>?(@,@)", "_RandomAccessFile(Object?)", "0&()", "_HttpOutboundMessage<@>(@)", "Null(Uint8List)", "Future<Uint8List>(RandomAccessFile,int)", "Null(int)", "Future<Uint8List>(int)", "Null(Object?)", "Uint8List(Object?)", "ConnectionTask<SecureSocket>(ConnectionTask<RawSecureSocket>)", "~(Uri)", "Future<RawSecureSocket>(List<Object?>)", "ConnectionTask<RawSecureSocket>(ConnectionTask<RawSocket>)", "Future<RawSecureSocket>(RawSocket)", "~([RawSocket?])", "~(RawSocketEvent)", "~(@[StackTrace?])", "List<int>?(int)", "String(Uri{environment:Map<String,String>?})", "~(int,@)"],
|
|
interceptorsByTag: null,
|
|
leafTags: null,
|
|
arrayRti: Symbol("$ti")
|
|
};
|
|
A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","NativeArrayBuffer":"NativeByteBuffer","HttpClientResponse":{"Stream":["List<int>"]},"_HttpIncoming":{"Stream":["Uint8List"],"Stream.T":"Uint8List"},"_HttpOutboundMessage":{"_StreamSinkImpl":["List<int>"],"EventSink":["List<int>"],"Sink":["List<int>"],"StreamConsumer":["List<int>"],"StringSink":[]},"_HttpClientRequest":{"_HttpOutboundMessage":["HttpClientResponse"],"HttpClientRequest":[],"_StreamSinkImpl":["List<int>"],"EventSink":["List<int>"],"Sink":["List<int>"],"StreamConsumer":["List<int>"],"StringSink":[],"_StreamSinkImpl.T":"List<int>"},"_SiteCredentials":{"_Credentials":[]},"_ProxyCredentials":{"_Credentials":[]},"RedirectException":{"HttpException":[]},"_HttpHeaders":{"HttpHeaders":[]},"_Cookie":{"Cookie":[]},"_CopyingBytesBuilder":{"BytesBuilder":[]},"_HttpInboundMessageListInt":{"Stream":["List<int>"]},"_HttpClientResponse":{"HttpClientResponse":[],"Stream":["List<int>"],"Stream.T":"List<int>"},"_ToUint8List":{"Converter":["List<int>","Uint8List"],"StreamTransformer":["List<int>","Uint8List"],"Converter.S":"List<int>","Converter.T":"Uint8List"},"_Uint8ListConversionSink":{"Sink":["List<int>"]},"_StreamSinkImpl":{"EventSink":["1"],"Sink":["1"],"StreamConsumer":["1"]},"_IOSinkImpl":{"_StreamSinkImpl":["List<int>"],"EventSink":["List<int>"],"Sink":["List<int>"],"StreamConsumer":["List<int>"],"StringSink":[]},"_HttpOutgoing":{"StreamConsumer":["List<int>"]},"_HttpConnectionInfo":{"HttpConnectionInfo":[]},"_RedirectInfo":{"RedirectInfo":[]},"_HttpParser":{"Stream":["_HttpIncoming"],"Stream.T":"_HttpIncoming"},"JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[]},"JSArray":{"List":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"]},"JSArraySafeToStringHook":{"SafeToStringHook":[]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"]},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[]},"JSInt":{"double":[],"int":[],"num":[],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Pattern":[],"JSIndexable":["@"],"TrustedGetRuntimeType":[]},"CastStream":{"Stream":["2"],"Stream.T":"2"},"CastStreamSubscription":{"StreamSubscription":["2"]},"_BytesBuilder":{"BytesBuilder":[]},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"Iterable":["int"],"ListBase.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"Iterable":["1"],"ListIterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedListIterable":{"ListIterable":["2"],"Iterable":["2"],"ListIterable.E":"2"},"WhereIterable":{"Iterable":["1"]},"WhereIterator":{"Iterator":["1"]},"EmptyIterable":{"Iterable":["1"]},"EmptyIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"Iterable":["1"]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"RuntimeError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeysIterable":{"Iterable":["1"]},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"JSSyntaxRegExp":{"Pattern":[]},"NativeByteBuffer":{"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JSObject":[]},"NativeByteData":{"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSObject":[],"JSIndexable":["1"]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","FixedLengthListMixin.E":"double"},"NativeFloat64List":{"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","FixedLengthListMixin.E":"double"},"NativeInt16List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeInt32List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeInt8List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint16List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint32List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8ClampedList":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8List":{"NativeTypedArrayOfInt":[],"Uint8List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"EventSink":{"Sink":["1"]},"_TimerImpl":{"Timer":[]},"_AsyncAwaitCompleter":{"Completer":["1"]},"AsyncError":{"Error":[]},"_Completer":{"Completer":["1"]},"_AsyncCompleter":{"_Completer":["1"],"Completer":["1"]},"_Future":{"Future":["1"]},"StreamTransformerBase":{"StreamTransformer":["1","2"]},"_StreamController":{"StreamController":["1"],"EventSink":["1"],"Sink":["1"],"StreamConsumer":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_SyncStreamController":{"_SyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"EventSink":["1"],"Sink":["1"],"StreamConsumer":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_ControllerStream":{"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_ControllerSubscription":{"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_BufferingStreamSubscription":{"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamImpl":{"Stream":["1"]},"_DelayedData":{"_DelayedEvent":["1"]},"_DelayedError":{"_DelayedEvent":["@"]},"_DelayedDone":{"_DelayedEvent":["@"]},"_DoneStreamSubscription":{"StreamSubscription":["1"]},"_EmptyStream":{"Stream":["1"],"Stream.T":"1"},"_ForwardingStream":{"Stream":["2"]},"_ForwardingStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_MapStream":{"_ForwardingStream":["1","2"],"Stream":["2"],"Stream.T":"2","_ForwardingStream.T":"2","_ForwardingStream.S":"1"},"_HandleErrorStream":{"_ForwardingStream":["1","1"],"Stream":["1"],"Stream.T":"1","_ForwardingStream.T":"1","_ForwardingStream.S":"1"},"_EventSinkWrapper":{"EventSink":["1"],"Sink":["1"]},"_SinkTransformerStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_BoundSinkStream":{"Stream":["2"],"Stream.T":"2"},"_Zone":{"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_HashMap":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashMapKeyIterable":{"Iterable":["1"]},"_HashMapKeyIterator":{"Iterator":["1"]},"_HashSet":{"SetBase":["1"],"Set":["1"],"Iterable":["1"]},"_HashSetIterator":{"Iterator":["1"]},"ListBase":{"List":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ListQueue":{"ListIterable":["1"],"Iterable":["1"],"ListIterable.E":"1"},"_ListQueueIterator":{"Iterator":["1"]},"SetBase":{"Set":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"Iterable":["1"]},"_ConverterStreamEventSink":{"EventSink":["1"],"Sink":["1"]},"Encoding":{"Codec":["String","List<int>"]},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"_JsonMapKeyIterable":{"ListIterable":["String"],"Iterable":["String"],"ListIterable.E":"String"},"_JsonDecoderSink":{"_StringSinkConversionSink":["StringBuffer"],"StringConversionSink":[],"Sink":["String"],"_StringSinkConversionSink.0":"StringBuffer"},"AsciiCodec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"_UnicodeSubsetEncoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"AsciiEncoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"],"Converter.S":"String","Converter.T":"List<int>"},"_UnicodeSubsetEncoderSink":{"StringConversionSink":[],"Sink":["String"]},"Base64Codec":{"Codec":["List<int>","String"],"Codec.S":"List<int>"},"Base64Encoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"],"Converter.S":"List<int>","Converter.T":"String"},"_BufferCachingBase64Encoder":{"_Base64Encoder":[]},"_Base64EncoderSink":{"ByteConversionSink":[],"Sink":["List<int>"]},"_AsciiBase64EncoderSink":{"ByteConversionSink":[],"Sink":["List<int>"]},"ByteConversionSink":{"Sink":["List<int>"]},"_ByteAdapterSink":{"ByteConversionSink":[],"Sink":["List<int>"]},"ChunkedConversionSink":{"Sink":["1"]},"Converter":{"StreamTransformer":["1","2"]},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"JsonCodec":{"Codec":["Object?","String"],"Codec.S":"Object?"},"JsonEncoder":{"Converter":["Object?","String"],"StreamTransformer":["Object?","String"],"Converter.S":"Object?","Converter.T":"String"},"_JsonEncoderSink":{"Sink":["Object?"]},"JsonDecoder":{"Converter":["String","Object?"],"StreamTransformer":["String","Object?"],"Converter.S":"String","Converter.T":"Object?"},"Latin1Codec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"Latin1Encoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"],"Converter.S":"String","Converter.T":"List<int>"},"LineSplitter":{"StreamTransformer":["String","String"]},"StringConversionSink":{"Sink":["String"]},"_StringConversionSinkAsStringSinkAdapter":{"StringSink":[]},"_StringSinkConversionSink":{"StringConversionSink":[],"Sink":["String"]},"_StringAdapterSink":{"StringConversionSink":[],"Sink":["String"]},"_Utf8ConversionSink":{"ByteConversionSink":[],"Sink":["List<int>"]},"Utf8Codec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"Utf8Encoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"],"Converter.S":"String","Converter.T":"List<int>"},"_Utf8EncoderSink":{"StringConversionSink":[],"Sink":["String"]},"Utf8Decoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"],"Converter.S":"List<int>","Converter.T":"String"},"double":{"num":[]},"int":{"num":[]},"List":{"Iterable":["1"]},"String":{"Pattern":[]},"StringBuffer":{"StringSink":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"_RandomAccessFile":{"RandomAccessFile":[]},"SecureSocket":{"Socket":[],"EventSink":["List<int>"],"Stream":["Uint8List"],"Sink":["List<int>"],"StreamConsumer":["List<int>"],"StringSink":[]},"RawSecureSocket":{"RawSocket":[],"Stream":["RawSocketEvent"]},"_RawSecureSocket":{"RawSecureSocket":[],"RawSocket":[],"Stream":["RawSocketEvent"],"Stream.T":"RawSocketEvent"},"RawSocket":{"Stream":["RawSocketEvent"]},"Socket":{"EventSink":["List<int>"],"Stream":["Uint8List"],"Sink":["List<int>"],"StreamConsumer":["List<int>"],"StringSink":[]},"GZipCodec":{"Codec":["List<int>","List<int>"],"Codec.S":"List<int>"},"ZLibDecoder":{"Converter":["List<int>","List<int>"],"StreamTransformer":["List<int>","List<int>"],"Converter.S":"List<int>","Converter.T":"List<int>"},"_ZLibDecoderSink":{"ByteConversionSink":[],"Sink":["List<int>"]},"_FilterSink":{"ByteConversionSink":[],"Sink":["List<int>"]},"Int8List":{"List":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"Iterable":["double"]}}'));
|
|
A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"_HttpOutboundMessage":1,"EfficientLengthIterable":1,"UnmodifiableListBase":1,"NativeTypedArray":1,"StreamTransformerBase":2,"_DelayedEvent":1,"_SetBase":1,"ChunkedConversionSink":1}'));
|
|
var string$ = {
|
|
______: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\u03f6\x00\u0404\u03f4 \u03f4\u03f6\u01f6\u01f6\u03f6\u03fc\u01f4\u03ff\u03ff\u0584\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u05d4\u01f4\x00\u01f4\x00\u0504\u05c4\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u0400\x00\u0400\u0200\u03f7\u0200\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u0200\u0200\u0200\u03f7\x00",
|
|
ABCDEF: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type",
|
|
handle: "handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace."
|
|
};
|
|
var type$ = (function rtii() {
|
|
var findType = A.findType;
|
|
return {
|
|
$env_1_1_dynamic: findType("@<@>"),
|
|
$env_1_1_void: findType("@<~>"),
|
|
AsyncError: findType("AsyncError"),
|
|
Base64Codec: findType("Base64Codec"),
|
|
CodeUnits: findType("CodeUnits"),
|
|
ConnectionTask_RawSecureSocket: findType("ConnectionTask<RawSecureSocket>"),
|
|
ConnectionTask_RawSocket: findType("ConnectionTask<RawSocket>"),
|
|
ConnectionTask_SecureSocket: findType("ConnectionTask<SecureSocket>"),
|
|
ConnectionTask_Socket: findType("ConnectionTask<Socket>"),
|
|
Error: findType("Error"),
|
|
Function: findType("Function"),
|
|
FutureOr_HttpClientResponse: findType("HttpClientResponse/"),
|
|
HttpClientResponse: findType("HttpClientResponse"),
|
|
HttpException: findType("HttpException"),
|
|
Iterable_dynamic: findType("Iterable<@>"),
|
|
Iterable_int: findType("Iterable<int>"),
|
|
JSArray_Cookie: findType("JSArray<Cookie>"),
|
|
JSArray_Future_dynamic: findType("JSArray<Future<@>>"),
|
|
JSArray_Map_String_Object: findType("JSArray<Map<String,Object>>"),
|
|
JSArray_RedirectInfo: findType("JSArray<RedirectInfo>"),
|
|
JSArray_String: findType("JSArray<String>"),
|
|
JSArray_Uint8List: findType("JSArray<Uint8List>"),
|
|
JSArray__Credentials: findType("JSArray<_Credentials>"),
|
|
JSArray__HttpProfileEvent: findType("JSArray<_HttpProfileEvent>"),
|
|
JSArray__Proxy: findType("JSArray<_Proxy>"),
|
|
JSArray__ProxyCredentials: findType("JSArray<_ProxyCredentials>"),
|
|
JSArray_double: findType("JSArray<double>"),
|
|
JSArray_dynamic: findType("JSArray<@>"),
|
|
JSArray_int: findType("JSArray<int>"),
|
|
JSArray_nullable__AsyncBlock: findType("JSArray<_AsyncBlock?>"),
|
|
JSIndexable_dynamic: findType("JSIndexable<@>"),
|
|
JSNull: findType("JSNull"),
|
|
JSObject: findType("JSObject"),
|
|
JavaScriptFunction: findType("JavaScriptFunction"),
|
|
JavaScriptIndexingBehavior_dynamic: findType("JavaScriptIndexingBehavior<@>"),
|
|
ListQueue_of_void_Function: findType("ListQueue<~()>"),
|
|
List_String: findType("List<String>"),
|
|
List_dynamic: findType("List<@>"),
|
|
List_int: findType("List<int>"),
|
|
List_nullable_Object: findType("List<Object?>"),
|
|
Map_String_String: findType("Map<String,String>"),
|
|
Map_dynamic_dynamic: findType("Map<@,@>"),
|
|
MappedListIterable_String_String: findType("MappedListIterable<String,String>"),
|
|
NativeTypedArrayOfInt: findType("NativeTypedArrayOfInt"),
|
|
NativeUint8List: findType("NativeUint8List"),
|
|
Null: findType("Null"),
|
|
Object: findType("Object"),
|
|
RandomAccessFile: findType("RandomAccessFile"),
|
|
RawSecureSocket: findType("RawSecureSocket"),
|
|
RawSocketEvent: findType("RawSocketEvent"),
|
|
Record: findType("Record"),
|
|
SecureSocket: findType("SecureSocket"),
|
|
Sink_List_int: findType("Sink<List<int>>"),
|
|
Sink_String: findType("Sink<String>"),
|
|
Sink_Uint8List: findType("Sink<Uint8List>"),
|
|
Socket: findType("Socket"),
|
|
StackTrace: findType("StackTrace"),
|
|
StreamSubscription_RawSocketEvent: findType("StreamSubscription<RawSocketEvent>"),
|
|
Stream_List_int: findType("Stream<List<int>>"),
|
|
Stream_Uint8List: findType("Stream<Uint8List>"),
|
|
String: findType("String"),
|
|
String_Function_String: findType("String(String)"),
|
|
TrustedGetRuntimeType: findType("TrustedGetRuntimeType"),
|
|
TypeError: findType("TypeError"),
|
|
Uint8List: findType("Uint8List"),
|
|
UnknownJavaScriptObject: findType("UnknownJavaScriptObject"),
|
|
UnmodifiableMapView_of_String_and_nullable_String: findType("UnmodifiableMapView<String,String?>"),
|
|
Uri: findType("Uri"),
|
|
WhereIterable__AuthenticationScheme: findType("WhereIterable<_AuthenticationScheme>"),
|
|
_AsyncCompleter_HttpClientResponse: findType("_AsyncCompleter<HttpClientResponse>"),
|
|
_AsyncCompleter_RawSecureSocket: findType("_AsyncCompleter<RawSecureSocket>"),
|
|
_AsyncCompleter_Socket: findType("_AsyncCompleter<Socket>"),
|
|
_AsyncCompleter_Uint8List: findType("_AsyncCompleter<Uint8List>"),
|
|
_AsyncCompleter__HttpIncoming: findType("_AsyncCompleter<_HttpIncoming>"),
|
|
_AsyncCompleter__RawSecureSocket: findType("_AsyncCompleter<_RawSecureSocket>"),
|
|
_AsyncCompleter_bool: findType("_AsyncCompleter<bool>"),
|
|
_AsyncCompleter_dynamic: findType("_AsyncCompleter<@>"),
|
|
_AsyncCompleter_void: findType("_AsyncCompleter<~>"),
|
|
_AuthenticationScheme: findType("_AuthenticationScheme"),
|
|
_ConnectionInfo: findType("_ConnectionInfo"),
|
|
_ConnectionTarget: findType("_ConnectionTarget"),
|
|
_ConverterStreamEventSink_dynamic_dynamic: findType("_ConverterStreamEventSink<@,@>"),
|
|
_Credentials: findType("_Credentials"),
|
|
_FilterStatus: findType("_FilterStatus"),
|
|
_Future_HttpClientResponse: findType("_Future<HttpClientResponse>"),
|
|
_Future_RawSecureSocket: findType("_Future<RawSecureSocket>"),
|
|
_Future_Socket: findType("_Future<Socket>"),
|
|
_Future_String: findType("_Future<String>"),
|
|
_Future_Uint8List: findType("_Future<Uint8List>"),
|
|
_Future__ConnectionInfo: findType("_Future<_ConnectionInfo>"),
|
|
_Future__HttpClientRequest: findType("_Future<_HttpClientRequest>"),
|
|
_Future__HttpIncoming: findType("_Future<_HttpIncoming>"),
|
|
_Future__RawSecureSocket: findType("_Future<_RawSecureSocket>"),
|
|
_Future_bool: findType("_Future<bool>"),
|
|
_Future_dynamic: findType("_Future<@>"),
|
|
_Future_int: findType("_Future<int>"),
|
|
_Future_nullable_Object: findType("_Future<Object?>"),
|
|
_Future_void: findType("_Future<~>"),
|
|
_HttpClientConnection: findType("_HttpClientConnection"),
|
|
_HttpClientRequest: findType("_HttpClientRequest"),
|
|
_HttpIncoming: findType("_HttpIncoming"),
|
|
_HttpProfileData: findType("_HttpProfileData"),
|
|
_StreamControllerAddStreamState_nullable_Object: findType("_StreamControllerAddStreamState<Object?>"),
|
|
bool: findType("bool"),
|
|
bool_Function_Object: findType("bool(Object)"),
|
|
bool_Function_X509Certificate: findType("bool(X509Certificate)"),
|
|
bool_Function__AuthenticationScheme: findType("bool(_AuthenticationScheme)"),
|
|
double: findType("double"),
|
|
dynamic: findType("@"),
|
|
dynamic_Function: findType("@()"),
|
|
dynamic_Function_Object: findType("@(Object)"),
|
|
dynamic_Function_Object_StackTrace: findType("@(Object,StackTrace)"),
|
|
int: findType("int"),
|
|
nullable_Future_Null: findType("Future<Null>?"),
|
|
nullable_JSObject: findType("JSObject?"),
|
|
nullable_List_dynamic: findType("List<@>?"),
|
|
nullable_Object: findType("Object?"),
|
|
nullable_RawSocket: findType("RawSocket?"),
|
|
nullable_Socket: findType("Socket?"),
|
|
nullable_StackTrace: findType("StackTrace?"),
|
|
nullable_StreamSubscription_RawSocketEvent: findType("StreamSubscription<RawSocketEvent>?"),
|
|
nullable_String: findType("String?"),
|
|
nullable__DelayedEvent_dynamic: findType("_DelayedEvent<@>?"),
|
|
nullable__FutureListener_dynamic_dynamic: findType("_FutureListener<@,@>?"),
|
|
nullable__SiteCredentials: findType("_SiteCredentials?"),
|
|
nullable_bool: findType("bool?"),
|
|
nullable_bool_Function_Object: findType("bool(Object)?"),
|
|
nullable_bool_Function_dynamic: findType("bool(@)?"),
|
|
nullable_double: findType("double?"),
|
|
nullable_int: findType("int?"),
|
|
nullable_num: findType("num?"),
|
|
nullable_void_Function: findType("~()?"),
|
|
nullable_void_Function_RawSocketEvent: findType("~(RawSocketEvent)?"),
|
|
nullable_void_Function_Uint8List: findType("~(Uint8List)?"),
|
|
nullable_void_Function__HttpIncoming: findType("~(_HttpIncoming)?"),
|
|
num: findType("num"),
|
|
void: findType("~"),
|
|
void_Function: findType("~()"),
|
|
void_Function_2_String_and_List_String: findType("~(String,List<String>)"),
|
|
void_Function_List_int: findType("~(List<int>)"),
|
|
void_Function_Object: findType("~(Object)"),
|
|
void_Function_Object_StackTrace: findType("~(Object,StackTrace)"),
|
|
void_Function_String_dynamic: findType("~(String,@)")
|
|
};
|
|
})();
|
|
(function constants() {
|
|
var makeConstList = hunkHelpers.makeConstList;
|
|
B.Interceptor_methods = J.Interceptor.prototype;
|
|
B.JSArray_methods = J.JSArray.prototype;
|
|
B.JSInt_methods = J.JSInt.prototype;
|
|
B.JSNumber_methods = J.JSNumber.prototype;
|
|
B.JSString_methods = J.JSString.prototype;
|
|
B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype;
|
|
B.JavaScriptObject_methods = J.JavaScriptObject.prototype;
|
|
B.NativeUint8List_methods = A.NativeUint8List.prototype;
|
|
B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype;
|
|
B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype;
|
|
B.AsciiEncoder_127 = new A.AsciiEncoder(127);
|
|
B.C_AsciiCodec = new A.AsciiCodec();
|
|
B.C_Base64Encoder = new A.Base64Encoder();
|
|
B.C_Base64Codec = new A.Base64Codec();
|
|
B.C_EmptyIterator = new A.EmptyIterator(A.findType("EmptyIterator<0&>"));
|
|
B.C_GZipCodec = new A.GZipCodec();
|
|
B.C_JS_CONST = function getTagFallback(o) {
|
|
var s = Object.prototype.toString.call(o);
|
|
return s.substring(8, s.length - 1);
|
|
};
|
|
B.C_JS_CONST0 = function() {
|
|
var toStringFunction = Object.prototype.toString;
|
|
function getTag(o) {
|
|
var s = toStringFunction.call(o);
|
|
return s.substring(8, s.length - 1);
|
|
}
|
|
function getUnknownTag(object, tag) {
|
|
if (/^HTML[A-Z].*Element$/.test(tag)) {
|
|
var name = toStringFunction.call(object);
|
|
if (name == "[object Object]") return null;
|
|
return "HTMLElement";
|
|
}
|
|
}
|
|
function getUnknownTagGenericBrowser(object, tag) {
|
|
if (object instanceof HTMLElement) return "HTMLElement";
|
|
return getUnknownTag(object, tag);
|
|
}
|
|
function prototypeForTag(tag) {
|
|
if (typeof window == "undefined") return null;
|
|
if (typeof window[tag] == "undefined") return null;
|
|
var constructor = window[tag];
|
|
if (typeof constructor != "function") return null;
|
|
return constructor.prototype;
|
|
}
|
|
function discriminator(tag) { return null; }
|
|
var isBrowser = typeof HTMLElement == "function";
|
|
return {
|
|
getTag: getTag,
|
|
getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag,
|
|
prototypeForTag: prototypeForTag,
|
|
discriminator: discriminator };
|
|
};
|
|
B.C_JS_CONST6 = function(getTagFallback) {
|
|
return function(hooks) {
|
|
if (typeof navigator != "object") return hooks;
|
|
var userAgent = navigator.userAgent;
|
|
if (typeof userAgent != "string") return hooks;
|
|
if (userAgent.indexOf("DumpRenderTree") >= 0) return hooks;
|
|
if (userAgent.indexOf("Chrome") >= 0) {
|
|
function confirm(p) {
|
|
return typeof window == "object" && window[p] && window[p].name == p;
|
|
}
|
|
if (confirm("Window") && confirm("HTMLElement")) return hooks;
|
|
}
|
|
hooks.getTag = getTagFallback;
|
|
};
|
|
};
|
|
B.C_JS_CONST1 = function(hooks) {
|
|
if (typeof dartExperimentalFixupGetTag != "function") return hooks;
|
|
hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag);
|
|
};
|
|
B.C_JS_CONST5 = function(hooks) {
|
|
if (typeof navigator != "object") return hooks;
|
|
var userAgent = navigator.userAgent;
|
|
if (typeof userAgent != "string") return hooks;
|
|
if (userAgent.indexOf("Firefox") == -1) return hooks;
|
|
var getTag = hooks.getTag;
|
|
var quickMap = {
|
|
"BeforeUnloadEvent": "Event",
|
|
"DataTransfer": "Clipboard",
|
|
"GeoGeolocation": "Geolocation",
|
|
"Location": "!Location",
|
|
"WorkerMessageEvent": "MessageEvent",
|
|
"XMLDocument": "!Document"};
|
|
function getTagFirefox(o) {
|
|
var tag = getTag(o);
|
|
return quickMap[tag] || tag;
|
|
}
|
|
hooks.getTag = getTagFirefox;
|
|
};
|
|
B.C_JS_CONST4 = function(hooks) {
|
|
if (typeof navigator != "object") return hooks;
|
|
var userAgent = navigator.userAgent;
|
|
if (typeof userAgent != "string") return hooks;
|
|
if (userAgent.indexOf("Trident/") == -1) return hooks;
|
|
var getTag = hooks.getTag;
|
|
var quickMap = {
|
|
"BeforeUnloadEvent": "Event",
|
|
"DataTransfer": "Clipboard",
|
|
"HTMLDDElement": "HTMLElement",
|
|
"HTMLDTElement": "HTMLElement",
|
|
"HTMLPhraseElement": "HTMLElement",
|
|
"Position": "Geoposition"
|
|
};
|
|
function getTagIE(o) {
|
|
var tag = getTag(o);
|
|
var newTag = quickMap[tag];
|
|
if (newTag) return newTag;
|
|
if (tag == "Object") {
|
|
if (window.DataView && (o instanceof window.DataView)) return "DataView";
|
|
}
|
|
return tag;
|
|
}
|
|
function prototypeForTagIE(tag) {
|
|
var constructor = window[tag];
|
|
if (constructor == null) return null;
|
|
return constructor.prototype;
|
|
}
|
|
hooks.getTag = getTagIE;
|
|
hooks.prototypeForTag = prototypeForTagIE;
|
|
};
|
|
B.C_JS_CONST2 = function(hooks) {
|
|
var getTag = hooks.getTag;
|
|
var prototypeForTag = hooks.prototypeForTag;
|
|
function getTagFixed(o) {
|
|
var tag = getTag(o);
|
|
if (tag == "Document") {
|
|
if (!!o.xmlVersion) return "!Document";
|
|
return "!HTMLDocument";
|
|
}
|
|
return tag;
|
|
}
|
|
function prototypeForTagFixed(tag) {
|
|
if (tag == "Document") return null;
|
|
return prototypeForTag(tag);
|
|
}
|
|
hooks.getTag = getTagFixed;
|
|
hooks.prototypeForTag = prototypeForTagFixed;
|
|
};
|
|
B.C_JS_CONST3 = function(hooks) { return hooks; }
|
|
;
|
|
B.C_JsonCodec = new A.JsonCodec();
|
|
B.C_Latin1Codec = new A.Latin1Codec();
|
|
B.C_LineSplitter = new A.LineSplitter();
|
|
B.C_OutOfMemoryError = new A.OutOfMemoryError();
|
|
B.C_SentinelValue = new A.SentinelValue();
|
|
B.C_SocketDirection1 = new A.SocketDirection();
|
|
B.C_SocketDirection = new A.SocketDirection();
|
|
B.C_SocketDirection0 = new A.SocketDirection();
|
|
B.C_SocketOption = new A.SocketOption();
|
|
B.C_Utf8Codec = new A.Utf8Codec();
|
|
B.C_Utf8Encoder = new A.Utf8Encoder();
|
|
B.C__DelayedDone = new A._DelayedDone();
|
|
B.C__RootZone = new A._RootZone();
|
|
B.C__StringStackTrace = new A._StringStackTrace();
|
|
B.C__ToUint8List = new A._ToUint8List();
|
|
B.Duration_0 = new A.Duration(0);
|
|
B.Duration_15000000 = new A.Duration(15000000);
|
|
B.FileMode_0 = new A.FileMode(0);
|
|
B.HttpClientResponseCompressionState_0 = new A.HttpClientResponseCompressionState("notCompressed");
|
|
B.HttpClientResponseCompressionState_1 = new A.HttpClientResponseCompressionState("decompressed");
|
|
B.JsonDecoder_null = new A.JsonDecoder(null);
|
|
B.JsonEncoder_null = new A.JsonEncoder(null);
|
|
B.Latin1Encoder_255 = new A.Latin1Encoder(255);
|
|
B.List_2Rn = makeConstList(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], type$.JSArray_dynamic);
|
|
B.List_5IB = makeConstList([48, 13, 10, 13, 10], type$.JSArray_int);
|
|
B.List_72_84_84_80 = makeConstList([72, 84, 84, 80], type$.JSArray_int);
|
|
B.List_Bn4 = makeConstList(["authorization", "www-authenticate", "cookie", "cookie2"], type$.JSArray_String);
|
|
B.List_H5v = makeConstList([false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, false, false, false, false, false, true, true, false, false, true, false, false, true, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false], A.findType("JSArray<bool>"));
|
|
B.List_HWg = makeConstList(["RawSocketEvent.read", "RawSocketEvent.write", "RawSocketEvent.readClosed", "RawSocketEvent.closed"], type$.JSArray_String);
|
|
B.List_OZ7 = makeConstList(["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], type$.JSArray_dynamic);
|
|
B.List_VDu = makeConstList(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], type$.JSArray_dynamic);
|
|
B.List_XJC = makeConstList([48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70], type$.JSArray_int);
|
|
B._AuthenticationScheme_0 = new A._AuthenticationScheme("Unknown");
|
|
B._AuthenticationScheme_1 = new A._AuthenticationScheme("Basic");
|
|
B._AuthenticationScheme_2 = new A._AuthenticationScheme("Bearer");
|
|
B._AuthenticationScheme_3 = new A._AuthenticationScheme("Digest");
|
|
B.List_bW6 = makeConstList([B._AuthenticationScheme_0, B._AuthenticationScheme_1, B._AuthenticationScheme_2, B._AuthenticationScheme_3], A.findType("JSArray<_AuthenticationScheme>"));
|
|
B.List_bhA = makeConstList(["(", ")", "<", ">", "@", ",", ";", ":", "\\", '"', "/", "[", "]", "?", "=", "{", "}"], type$.JSArray_String);
|
|
B.List_empty = makeConstList([], type$.JSArray_int);
|
|
B.List_kXu = makeConstList([72, 84, 84, 80, 47, 49, 46], type$.JSArray_int);
|
|
B.List_mxl = makeConstList([72, 84, 84, 80, 47, 49, 46, 49], type$.JSArray_int);
|
|
B.List_nhL = makeConstList([13, 10, 48, 13, 10, 13, 10], type$.JSArray_int);
|
|
B.Object_empty = {};
|
|
B.Map_empty = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap<String,String?>"));
|
|
B.RawSocketEvent_0 = new A.RawSocketEvent(0);
|
|
B.RawSocketEvent_1 = new A.RawSocketEvent(1);
|
|
B.RawSocketEvent_2 = new A.RawSocketEvent(2);
|
|
B.SameSite_Lax = new A.SameSite("Lax");
|
|
B.SameSite_None = new A.SameSite("None");
|
|
B.SameSite_Strict = new A.SameSite("Strict");
|
|
B.Type_ByteBuffer_rqD = A.typeLiteral("ByteBuffer");
|
|
B.Type_ByteData_9dB = A.typeLiteral("ByteData");
|
|
B.Type_Float32List_9Kz = A.typeLiteral("Float32List");
|
|
B.Type_Float64List_9Kz = A.typeLiteral("Float64List");
|
|
B.Type_Int16List_s5h = A.typeLiteral("Int16List");
|
|
B.Type_Int32List_O8Z = A.typeLiteral("Int32List");
|
|
B.Type_Int8List_rFV = A.typeLiteral("Int8List");
|
|
B.Type_Object_A4p = A.typeLiteral("Object");
|
|
B.Type_Uint16List_kmP = A.typeLiteral("Uint16List");
|
|
B.Type_Uint32List_kmP = A.typeLiteral("Uint32List");
|
|
B.Type_Uint8ClampedList_04U = A.typeLiteral("Uint8ClampedList");
|
|
B.Type_Uint8List_8Eb = A.typeLiteral("Uint8List");
|
|
B.Utf8Decoder_false = new A.Utf8Decoder(false);
|
|
B._Proxy_EtH = new A._Proxy(null, null, null, null, true);
|
|
B.List_AuN = makeConstList([B._Proxy_EtH], type$.JSArray__Proxy);
|
|
B._ProxyConfiguration_PMa = new A._ProxyConfiguration(B.List_AuN);
|
|
})();
|
|
(function staticFields() {
|
|
$.HttpProfiler__profile = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$._HttpProfileData);
|
|
$._JS_INTEROP_INTERCEPTOR_TAG = null;
|
|
$.toStringVisiting = A._setArrayType([], A.findType("JSArray<Object>"));
|
|
$.Primitives__identityHashCodeProperty = null;
|
|
$.Primitives_timerFrequency = 0;
|
|
$.Primitives_timerTicks = A._js_helper_Primitives_dateNow$closure();
|
|
$.BoundClosure__receiverFieldNameCache = null;
|
|
$.BoundClosure__interceptorFieldNameCache = null;
|
|
$.getTagFunction = null;
|
|
$.alternateTagFunction = null;
|
|
$.prototypeForTagFunction = null;
|
|
$.dispatchRecordsForInstanceTags = null;
|
|
$.interceptorsForUncacheableTags = null;
|
|
$.initNativeDispatchFlag = null;
|
|
$._nextCallback = null;
|
|
$._lastCallback = null;
|
|
$._lastPriorityCallback = null;
|
|
$._isInCallbackLoop = false;
|
|
$.Zone__current = B.C__RootZone;
|
|
$._markAndMeasureEntryCount = 0;
|
|
$._taskId = 1;
|
|
$._eventNameToCount = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.int);
|
|
$._FileResourceInfo_openFiles = A.LinkedHashMap_LinkedHashMap$_empty(type$.int, A.findType("_FileResourceInfo"));
|
|
$._Platform__environmentCache = null;
|
|
})();
|
|
(function lazyInitializers() {
|
|
var _lazy = hunkHelpers.lazy,
|
|
_lazyFinal = hunkHelpers.lazyFinal;
|
|
_lazy($, "_httpConnectionHook", "$get$_httpConnectionHook", () => new A._httpConnectionHook_closure());
|
|
_lazyFinal($, "_digitsValidator", "$get$_digitsValidator", () => A.RegExp_RegExp("^\\d+$"));
|
|
_lazyFinal($, "_CopyingBytesBuilder__emptyList", "$get$_CopyingBytesBuilder__emptyList", () => A.NativeUint8List_NativeUint8List(0));
|
|
_lazyFinal($, "_HttpClient__platformEnvironmentCache", "$get$_HttpClient__platformEnvironmentCache", () => A._Platform_environment());
|
|
_lazyFinal($, "_httpOverridesToken", "$get$_httpOverridesToken", () => new A.Object());
|
|
_lazyFinal($, "DART_CLOSURE_PROPERTY_NAME", "$get$DART_CLOSURE_PROPERTY_NAME", () => A.getIsolateAffinityTag("_$dart_dartClosure"));
|
|
_lazyFinal($, "_CopyingBytesBuilder__emptyList0", "$get$_CopyingBytesBuilder__emptyList0", () => A.NativeUint8List_NativeUint8List(0));
|
|
_lazyFinal($, "nullFuture", "$get$nullFuture", () => B.C__RootZone.run$1$1(new A.nullFuture_closure(), A.findType("Future<~>")));
|
|
_lazyFinal($, "_safeToStringHooks", "$get$_safeToStringHooks", () => A._setArrayType([new J.JSArraySafeToStringHook()], A.findType("JSArray<SafeToStringHook>")));
|
|
_lazyFinal($, "TypeErrorDecoder_noSuchMethodPattern", "$get$TypeErrorDecoder_noSuchMethodPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({
|
|
toString: function() {
|
|
return "$receiver$";
|
|
}
|
|
})));
|
|
_lazyFinal($, "TypeErrorDecoder_notClosurePattern", "$get$TypeErrorDecoder_notClosurePattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({$method$: null,
|
|
toString: function() {
|
|
return "$receiver$";
|
|
}
|
|
})));
|
|
_lazyFinal($, "TypeErrorDecoder_nullCallPattern", "$get$TypeErrorDecoder_nullCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(null)));
|
|
_lazyFinal($, "TypeErrorDecoder_nullLiteralCallPattern", "$get$TypeErrorDecoder_nullLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() {
|
|
var $argumentsExpr$ = "$arguments$";
|
|
try {
|
|
null.$method$($argumentsExpr$);
|
|
} catch (e) {
|
|
return e.message;
|
|
}
|
|
}()));
|
|
_lazyFinal($, "TypeErrorDecoder_undefinedCallPattern", "$get$TypeErrorDecoder_undefinedCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(void 0)));
|
|
_lazyFinal($, "TypeErrorDecoder_undefinedLiteralCallPattern", "$get$TypeErrorDecoder_undefinedLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() {
|
|
var $argumentsExpr$ = "$arguments$";
|
|
try {
|
|
(void 0).$method$($argumentsExpr$);
|
|
} catch (e) {
|
|
return e.message;
|
|
}
|
|
}()));
|
|
_lazyFinal($, "TypeErrorDecoder_nullPropertyPattern", "$get$TypeErrorDecoder_nullPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(null)));
|
|
_lazyFinal($, "TypeErrorDecoder_nullLiteralPropertyPattern", "$get$TypeErrorDecoder_nullLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() {
|
|
try {
|
|
null.$method$;
|
|
} catch (e) {
|
|
return e.message;
|
|
}
|
|
}()));
|
|
_lazyFinal($, "TypeErrorDecoder_undefinedPropertyPattern", "$get$TypeErrorDecoder_undefinedPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(void 0)));
|
|
_lazyFinal($, "TypeErrorDecoder_undefinedLiteralPropertyPattern", "$get$TypeErrorDecoder_undefinedLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() {
|
|
try {
|
|
(void 0).$method$;
|
|
} catch (e) {
|
|
return e.message;
|
|
}
|
|
}()));
|
|
_lazyFinal($, "_AsyncRun__scheduleImmediateClosure", "$get$_AsyncRun__scheduleImmediateClosure", () => A._AsyncRun__initializeScheduleImmediate());
|
|
_lazyFinal($, "Future__nullFuture", "$get$Future__nullFuture", () => $.$get$nullFuture());
|
|
_lazyFinal($, "_Utf8Decoder__reusableBuffer", "$get$_Utf8Decoder__reusableBuffer", () => A.NativeUint8List_NativeUint8List(4096));
|
|
_lazyFinal($, "_Utf8Decoder__decoder", "$get$_Utf8Decoder__decoder", () => new A._Utf8Decoder__decoder_closure().call$0());
|
|
_lazyFinal($, "_Utf8Decoder__decoderNonfatal", "$get$_Utf8Decoder__decoderNonfatal", () => new A._Utf8Decoder__decoderNonfatal_closure().call$0());
|
|
_lazyFinal($, "_Base64Decoder__inverseAlphabet", "$get$_Base64Decoder__inverseAlphabet", () => A.NativeInt8List__create1(A._ensureNativeList(A._setArrayType([-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, 62, -2, 62, -2, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -1, -2, -2, -2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, 63, -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2], type$.JSArray_int))));
|
|
_lazyFinal($, "Encoding__nameToEncoding", "$get$Encoding__nameToEncoding", () => A.LinkedHashMap_LinkedHashMap$_literal(["iso_8859-1:1987", B.C_Latin1Codec, "iso-ir-100", B.C_Latin1Codec, "iso_8859-1", B.C_Latin1Codec, "iso-8859-1", B.C_Latin1Codec, "latin1", B.C_Latin1Codec, "l1", B.C_Latin1Codec, "ibm819", B.C_Latin1Codec, "cp819", B.C_Latin1Codec, "csisolatin1", B.C_Latin1Codec, "iso-ir-6", B.C_AsciiCodec, "ansi_x3.4-1968", B.C_AsciiCodec, "ansi_x3.4-1986", B.C_AsciiCodec, "iso_646.irv:1991", B.C_AsciiCodec, "iso646-us", B.C_AsciiCodec, "us-ascii", B.C_AsciiCodec, "us", B.C_AsciiCodec, "ibm367", B.C_AsciiCodec, "cp367", B.C_AsciiCodec, "csascii", B.C_AsciiCodec, "ascii", B.C_AsciiCodec, "csutf8", B.C_Utf8Codec, "utf-8", B.C_Utf8Codec], type$.String, A.findType("Encoding")));
|
|
_lazyFinal($, "_hashSeed", "$get$_hashSeed", () => A.objectHashCode(B.Type_Object_A4p));
|
|
_lazyFinal($, "Stopwatch__frequency", "$get$Stopwatch__frequency", () => {
|
|
A.Primitives_initTicker();
|
|
return $.Primitives_timerFrequency;
|
|
});
|
|
_lazy($, "_performance", "$get$_performance", () => new A._performance_closure().call$0());
|
|
_lazy($, "_json", "$get$_json", () => new A._json_closure().call$0());
|
|
_lazyFinal($, "_IOResourceInfo__sw", "$get$_IOResourceInfo__sw", () => {
|
|
var t1 = new A.Stopwatch();
|
|
$.$get$Stopwatch__frequency();
|
|
t1._core$_start = A.Stopwatch__now();
|
|
t1._stop = null;
|
|
return t1;
|
|
});
|
|
_lazyFinal($, "_IOResourceInfo__startTime", "$get$_IOResourceInfo__startTime", () => A.DateTime$now()._core$_value);
|
|
_lazyFinal($, "_ioOverridesToken", "$get$_ioOverridesToken", () => new A.Object());
|
|
_lazyFinal($, "Platform_operatingSystem", "$get$Platform_operatingSystem", () => A._Platform_operatingSystem());
|
|
_lazyFinal($, "Platform_version", "$get$Platform_version", () => A._Platform_version());
|
|
_lazy($, "Platform_isWindows", "$get$Platform_isWindows", () => {
|
|
$.$get$Platform_operatingSystem();
|
|
return false;
|
|
});
|
|
})();
|
|
(function nativeSupport() {
|
|
!function() {
|
|
var intern = function(s) {
|
|
var o = {};
|
|
o[s] = 1;
|
|
return Object.keys(hunkHelpers.convertToFastObject(o))[0];
|
|
};
|
|
init.getIsolateTag = function(name) {
|
|
return intern("___dart_" + name + init.isolateTag);
|
|
};
|
|
var tableProperty = "___dart_isolate_tags_";
|
|
var usedProperties = Object[tableProperty] || (Object[tableProperty] = Object.create(null));
|
|
var rootProperty = "_ZxYxX";
|
|
for (var i = 0;; i++) {
|
|
var property = intern(rootProperty + "_" + i + "_");
|
|
if (!(property in usedProperties)) {
|
|
usedProperties[property] = 1;
|
|
init.isolateTag = property;
|
|
break;
|
|
}
|
|
}
|
|
init.dispatchPropertyName = init.getIsolateTag("dispatch_record");
|
|
}();
|
|
hunkHelpers.setOrUpdateInterceptorsByTag({ArrayBuffer: A.NativeByteBuffer, SharedArrayBuffer: A.NativeByteBuffer, ArrayBufferView: A.NativeTypedData, DataView: A.NativeByteData, Float32Array: A.NativeFloat32List, Float64Array: A.NativeFloat64List, Int16Array: A.NativeInt16List, Int32Array: A.NativeInt32List, Int8Array: A.NativeInt8List, Uint16Array: A.NativeUint16List, Uint32Array: A.NativeUint32List, Uint8ClampedArray: A.NativeUint8ClampedList, CanvasPixelArray: A.NativeUint8ClampedList, Uint8Array: A.NativeUint8List});
|
|
hunkHelpers.setOrUpdateLeafTags({ArrayBuffer: true, SharedArrayBuffer: true, ArrayBufferView: false, DataView: true, Float32Array: true, Float64Array: true, Int16Array: true, Int32Array: true, Int8Array: true, Uint16Array: true, Uint32Array: true, Uint8ClampedArray: true, CanvasPixelArray: true, Uint8Array: false});
|
|
A.NativeTypedArray.$nativeSuperclassTag = "ArrayBufferView";
|
|
A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView";
|
|
A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView";
|
|
A.NativeTypedArrayOfDouble.$nativeSuperclassTag = "ArrayBufferView";
|
|
A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView";
|
|
A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView";
|
|
A.NativeTypedArrayOfInt.$nativeSuperclassTag = "ArrayBufferView";
|
|
})();
|
|
Function.prototype.call$1$1 = function(a) {
|
|
return this(a);
|
|
};
|
|
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$6 = function(a, b, c, d, e, f) {
|
|
return this(a, b, c, d, e, f);
|
|
};
|
|
convertAllToFastObject(holders);
|
|
convertToFastObject($);
|
|
(function(callback) {
|
|
if (typeof document === "undefined") {
|
|
callback(null);
|
|
return;
|
|
}
|
|
if (typeof document.currentScript != "undefined") {
|
|
callback(document.currentScript);
|
|
return;
|
|
}
|
|
var scripts = document.scripts;
|
|
function onLoad(event) {
|
|
for (var i = 0; i < scripts.length; ++i) {
|
|
scripts[i].removeEventListener("load", onLoad, false);
|
|
}
|
|
callback(event.target);
|
|
}
|
|
for (var i = 0; i < scripts.length; ++i) {
|
|
scripts[i].addEventListener("load", onLoad, false);
|
|
}
|
|
})(function(currentScript) {
|
|
init.currentScript = currentScript;
|
|
var callMain = A.main;
|
|
if (typeof dartMainRunner === "function") {
|
|
dartMainRunner(callMain, []);
|
|
} else {
|
|
callMain([]);
|
|
}
|
|
});
|
|
})();
|
|
|
|
//# sourceMappingURL=test_user_route.js.map
|