Comparing version 1.2.1 to 1.3.0
@@ -5,10 +5,2 @@ declare module "grpc-web" { | ||
export namespace AbstractClientBase { | ||
class MethodInfo<REQ, RESP> { | ||
constructor (responseType: new () => RESP, | ||
requestSerializeFn: (request: REQ) => {}, | ||
responseDeserializeFn: (bytes: Uint8Array) => RESP); | ||
} | ||
} | ||
export class AbstractClientBase { | ||
@@ -27,3 +19,3 @@ thenableCall<REQ, RESP> ( | ||
methodDescriptor: MethodDescriptor<REQ, RESP>, | ||
callback: (err: Error, response: RESP) => void | ||
callback: (err: RpcError, response: RESP) => void | ||
): ClientReadableStream<RESP>; | ||
@@ -41,3 +33,3 @@ | ||
on (eventType: "error", | ||
callback: (err: Error) => void): ClientReadableStream<RESP>; | ||
callback: (err: RpcError) => void): ClientReadableStream<RESP>; | ||
on (eventType: "status", | ||
@@ -53,3 +45,3 @@ callback: (status: Status) => void): ClientReadableStream<RESP>; | ||
removeListener (eventType: "error", | ||
callback: (err: Error) => void): void; | ||
callback: (err: RpcError) => void): void; | ||
removeListener (eventType: "status", | ||
@@ -63,3 +55,3 @@ callback: (status: Status) => void): void; | ||
callback: () => void): void; | ||
cancel (): void; | ||
@@ -92,6 +84,15 @@ } | ||
createRequest(requestMessage: REQ, | ||
metadata: Metadata, | ||
callOptions: CallOptions): UnaryResponse<REQ, RESP>; | ||
metadata?: Metadata, | ||
callOptions?: CallOptions): Request<REQ, RESP>; | ||
createUnaryResponse(responseMessage: RESP, | ||
metadata?: Metadata, | ||
status?: Status): UnaryResponse<REQ, RESP>; | ||
getName(): string; | ||
getMethodType(): string; | ||
getResponseMessageCtor(): any; | ||
getRequestMessageCtor(): any; | ||
getResponseDeserializeFn(): any; | ||
getRequestSerializeFn(): any; | ||
} | ||
export class Request<REQ, RESP> { | ||
@@ -103,3 +104,3 @@ getRequestMessage(): REQ; | ||
} | ||
export class UnaryResponse<REQ, RESP> { | ||
@@ -115,11 +116,15 @@ getResponseMessage(): RESP; | ||
suppressCorsPreflight?: boolean; | ||
withCredentials?: boolean; | ||
unaryInterceptors?: UnaryInterceptor<unknown, unknown>[]; | ||
streamInterceptors?: StreamInterceptor<unknown, unknown>[]; | ||
} | ||
export class GrpcWebClientBase extends AbstractClientBase { | ||
constructor (options: GrpcWebClientBaseOptions); | ||
constructor(options?: GrpcWebClientBaseOptions); | ||
} | ||
export interface Error { | ||
code: number; | ||
message: string; | ||
export class RpcError extends Error { | ||
constructor(code: StatusCode, message: string, metadata: Metadata); | ||
code: StatusCode; | ||
metadata: Metadata; | ||
} | ||
@@ -133,21 +138,26 @@ | ||
export namespace StatusCode { | ||
const ABORTED: number; | ||
const ALREADY_EXISTS: number; | ||
const CANCELLED: number; | ||
const DATA_LOSS: number; | ||
const DEADLINE_EXCEEDED: number; | ||
const FAILED_PRECONDITION: number; | ||
const INTERNAL: number; | ||
const INVALID_ARGUMENT: number; | ||
const NOT_FOUND: number; | ||
const OK: number; | ||
const OUT_OF_RANGE: number; | ||
const PERMISSION_DENIED: number; | ||
const RESOURCE_EXHAUSTED: number; | ||
const UNAUTHENTICATED: number; | ||
const UNAVAILABLE: number; | ||
const UNIMPLEMENTED: number; | ||
const UNKNOWN: number; | ||
export enum StatusCode { | ||
ABORTED, | ||
ALREADY_EXISTS, | ||
CANCELLED, | ||
DATA_LOSS, | ||
DEADLINE_EXCEEDED, | ||
FAILED_PRECONDITION, | ||
INTERNAL, | ||
INVALID_ARGUMENT, | ||
NOT_FOUND, | ||
OK, | ||
OUT_OF_RANGE, | ||
PERMISSION_DENIED, | ||
RESOURCE_EXHAUSTED, | ||
UNAUTHENTICATED, | ||
UNAVAILABLE, | ||
UNIMPLEMENTED, | ||
UNKNOWN, | ||
} | ||
export namespace MethodType { | ||
const UNARY: string; | ||
const SERVER_STREAMING: string; | ||
} | ||
} |
115
index.js
@@ -6,58 +6,61 @@ /* | ||
*/ | ||
function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function ca(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var da=ca(this); | ||
function ea(a,b){if(b){var c=da;a=a.split(".");for(var d=0;d<a.length-1;d++){var f=a[d];f in c||(c[f]={});c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}}ea("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}}); | ||
ea("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var f=d.length;c=c||0;for(0>c&&(c=Math.max(c+f,0));c<f;c++){var g=d[c];if(g===b||Object.is(g,b))return!0}return!1}});function fa(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}} | ||
ea("Promise",function(a){function b(e){this.b=0;this.c=void 0;this.a=[];var h=this.f();try{e(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(e){return e instanceof b?e:new b(function(h){h(e)})}if(a)return a;c.prototype.b=function(e){if(null==this.a){this.a=[];var h=this;this.c(function(){h.g()})}this.a.push(e)};var f=da.setTimeout;c.prototype.c=function(e){f(e,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var e=this.a;this.a=[];for(var h=0;h<e.length;++h){var k= | ||
e[h];e[h]=null;try{k()}catch(l){this.f(l)}}}this.a=null};c.prototype.f=function(e){this.c(function(){throw e;})};b.prototype.f=function(){function e(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:e(this.m),reject:e(this.g)}};b.prototype.m=function(e){if(e===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof b)this.o(e);else{a:switch(typeof e){case "object":var h=null!=e;break a;case "function":h=!0;break a;default:h=!1}h?this.l(e):this.h(e)}}; | ||
b.prototype.l=function(e){var h=void 0;try{h=e.then}catch(k){this.g(k);return}"function"==typeof h?this.u(h,e):this.h(e)};b.prototype.g=function(e){this.i(2,e)};b.prototype.h=function(e){this.i(1,e)};b.prototype.i=function(e,h){if(0!=this.b)throw Error("Cannot settle("+e+", "+h+"): Promise already settled in state"+this.b);this.b=e;this.c=h;this.j()};b.prototype.j=function(){if(null!=this.a){for(var e=0;e<this.a.length;++e)g.b(this.a[e]);this.a=null}};var g=new c;b.prototype.o=function(e){var h=this.f(); | ||
e.w(h.resolve,h.reject)};b.prototype.u=function(e,h){var k=this.f();try{e.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(e,h){function k(n,v){return"function"==typeof n?function(x){try{l(n(x))}catch(F){m(F)}}:v}var l,m,p=new b(function(n,v){l=n;m=v});this.w(k(e,l),k(h,m));return p};b.prototype.catch=function(e){return this.then(void 0,e)};b.prototype.w=function(e,h){function k(){switch(l.b){case 1:e(l.c);break;case 2:h(l.c);break;default:throw Error("Unexpected state: "+ | ||
l.b);}}var l=this;null==this.a?g.b(k):this.a.push(k)};b.resolve=d;b.reject=function(e){return new b(function(h,k){k(e)})};b.race=function(e){return new b(function(h,k){for(var l=fa(e),m=l.next();!m.done;m=l.next())d(m.value).w(h,k)})};b.all=function(e){var h=fa(e),k=h.next();return k.done?d([]):new b(function(l,m){function p(x){return function(F){n[x]=F;v--;0==v&&l(n)}}var n=[],v=0;do n.push(void 0),v++,d(k.value).w(p(n.length-1),m),k=h.next();while(!k.done)})};return b});var ha=ha||{},q=this||self; | ||
function r(a,b){a=a.split(".");b=b||q;for(var c=0;c<a.length;c++)if(b=b[a[c]],null==b)return null;return b}function t(){} | ||
function ia(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; | ||
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function u(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ja="closure_uid_"+(1E9*Math.random()>>>0),ka=0;function la(a,b,c){return a.call.apply(a.bind,arguments)} | ||
function ma(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,d);return a.apply(b,f)}}return function(){return a.apply(b,arguments)}}function w(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?w=la:w=ma;return w.apply(null,arguments)}var na=Date.now||function(){return+new Date}; | ||
function y(a,b){function c(){}c.prototype=b.prototype;a.S=b.prototype;a.prototype=new c;a.prototype.constructor=a};function oa(){this.a={}}oa.prototype.get=function(a){return this.a[a]};oa.prototype.f=function(){return Object.keys(this.a)};function z(a,b,c,d){this.f=a;this.c=b;this.b=c;this.a=d}z.prototype.getRequestMessage=function(){return this.f};z.prototype.getMethodDescriptor=function(){return this.c};z.prototype.getMetadata=function(){return this.b};z.prototype.getCallOptions=function(){return this.a};function A(a,b,c,d){c=void 0===c?{}:c;this.c=a;this.a=c;this.b=b;this.f=void 0===d?null:d}A.prototype.getResponseMessage=function(){return this.c};A.prototype.getMetadata=function(){return this.a};A.prototype.getMethodDescriptor=function(){return this.b};A.prototype.getStatus=function(){return this.f};function pa(a,b,c,d,f,g){this.name=a;this.a=f;this.b=g}function qa(a,b,c){c=void 0===c?{}:c;var d=void 0===d?new oa:d;return new z(b,a,c,d)};function ra(a,b,c,d){return d instanceof pa?d:new pa(a,c,d.b||b.constructor,d.f,d.a,d.c)};function B(a){this.a=a}B.prototype.on=function(a,b){return"data"==a||"error"==a?this:this.a.on(a,b)};B.prototype.removeListener=function(a,b){return this.a.removeListener(a,b)};B.prototype.cancel=function(){this.a.cancel()};function sa(a){switch(a){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}};function C(a){if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}y(C,Error);C.prototype.name="CustomError";function ta(a,b){a=a.split("%s");for(var c="",d=a.length-1,f=0;f<d;f++)c+=a[f]+(f<b.length?b[f]:"%s");C.call(this,c+a[d])}y(ta,C);ta.prototype.name="AssertionError";function ua(a,b){throw new ta("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};function va(){this.j=null;this.i=[];this.l=0;this.b=wa;this.f=this.a=this.h=0;this.c=null;this.g=0} | ||
function xa(a,b){function c(l){l==ya?e.h=l:l==D?e.h=l:za(e,h,k,"invalid frame byte");e.b=Aa;e.a=0;e.f=0}function d(l){e.f++;e.a=(e.a<<8)+l;4==e.f&&(e.b=Ba,e.g=0,"undefined"!==typeof Uint8Array?e.c=new Uint8Array(e.a):e.c=Array(e.a),0==e.a&&g())}function f(l){e.c[e.g++]=l;e.g==e.a&&g()}function g(){var l={};l[e.h]=e.c;e.i.push(l);e.b=wa}var e=a,h,k=0;for(b instanceof Uint8Array||b instanceof Array?h=b:h=new Uint8Array(b);k<h.length;){switch(e.b){case Ca:za(e,h,k,"stream already broken");break;case wa:c(h[k]); | ||
break;case Aa:d(h[k]);break;case Ba:f(h[k]);break;default:throw Error("unexpected parser state: "+e.b);}e.l++;k++}a=e.i;e.i=[];return 0<a.length?a:null}var wa=0,Aa=1,Ba=2,Ca=3,ya=0,D=128;function za(a,b,c,d){a.b=Ca;a.j="The stream is broken @"+a.l+"/"+c+". Error: "+d+". With input:\n"+b;throw Error(a.j);};function Da(a){switch(a){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}};var Ea=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};function Fa(a){a:{var b=Ga;for(var c=a.length,d="string"===typeof a?a.split(""):a,f=0;f<c;f++)if(f in d&&b.call(void 0,d[f],f,a)){b=f;break a}b=-1}return 0>b?null:"string"===typeof a?a.charAt(b):a[b]};var Ha=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};function E(a,b){return-1!=a.indexOf(b)}function Ia(a,b){return a<b?-1:a>b?1:0};var G;a:{var Ja=q.navigator;if(Ja){var Ka=Ja.userAgent;if(Ka){G=Ka;break a}}G=""};function La(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function Ma(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}var Na="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Oa(a,b){for(var c,d,f=1;f<arguments.length;f++){d=arguments[f];for(c in d)a[c]=d[c];for(var g=0;g<Na.length;g++)c=Na[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function Pa(a){var b=1;a=a.split(":");for(var c=[];0<b&&a.length;)c.push(a.shift()),b--;a.length&&c.push(a.join(":"));return c};function Qa(a){Qa[" "](a);return a}Qa[" "]=t;function Ra(a,b){var c=Sa;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var Ta=E(G,"Opera"),H=E(G,"Trident")||E(G,"MSIE"),Ua=E(G,"Edge"),Va=E(G,"Gecko")&&!(E(G.toLowerCase(),"webkit")&&!E(G,"Edge"))&&!(E(G,"Trident")||E(G,"MSIE"))&&!E(G,"Edge"),Wa=E(G.toLowerCase(),"webkit")&&!E(G,"Edge");function Xa(){var a=q.document;return a?a.documentMode:void 0}var I; | ||
a:{var Ya="",Za=function(){var a=G;if(Va)return/rv:([^\);]+)(\)|;)/.exec(a);if(Ua)return/Edge\/([\d\.]+)/.exec(a);if(H)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Wa)return/WebKit\/(\S+)/.exec(a);if(Ta)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Za&&(Ya=Za?Za[1]:"");if(H){var $a=Xa();if(null!=$a&&$a>parseFloat(Ya)){I=String($a);break a}}I=Ya}var Sa={}; | ||
function ab(a){return Ra(a,function(){for(var b=0,c=Ha(String(I)).split("."),d=Ha(String(a)).split("."),f=Math.max(c.length,d.length),g=0;0==b&&g<f;g++){var e=c[g]||"",h=d[g]||"";do{e=/(\d*)(\D*)(.*)/.exec(e)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==e[0].length&&0==h[0].length)break;b=Ia(0==e[1].length?0:parseInt(e[1],10),0==h[1].length?0:parseInt(h[1],10))||Ia(0==e[2].length,0==h[2].length)||Ia(e[2],h[2]);e=e[3];h=h[3]}while(0==b)}return 0<=b})}var bb; | ||
if(q.document&&H){var cb=Xa();bb=cb?cb:parseInt(I,10)||void 0}else bb=void 0;var db=bb;function eb(){0!=fb&&(Object.prototype.hasOwnProperty.call(this,ja)&&this[ja]||(this[ja]=++ka));this.F=this.F}var fb=0;eb.prototype.F=!1;var gb=Object.freeze||function(a){return a};var hb;(hb=!H)||(hb=9<=Number(db));var ib=hb,jb=H&&!ab("9"),kb=function(){if(!q.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});try{q.addEventListener("test",t,b),q.removeEventListener("test",t,b)}catch(c){}return a}();function J(a,b){this.type=a;this.a=this.target=b;this.defaultPrevented=!1}J.prototype.b=function(){this.defaultPrevented=!0};function K(a,b){J.call(this,a?a.type:"");this.relatedTarget=this.a=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key="";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.pointerId=0;this.pointerType="";this.c=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.a=b;if(b=a.relatedTarget){if(Va){a:{try{Qa(b.nodeName);var f=!0;break a}catch(g){}f=!1}f||(b=null)}}else"mouseover"== | ||
var n;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function ca(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var r=ca(this); | ||
function t(){t=function(){};r.Symbol||(r.Symbol=da)}function ea(a,b){this.a=a;ba(this,"description",{configurable:!0,writable:!0,value:b})}ea.prototype.toString=function(){return this.a};var da=function(){function a(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new ea("jscomp_symbol_"+(c||"")+"_"+b++,c)}var b=0;return a}(); | ||
function u(){t();var a=r.Symbol.iterator;a||(a=r.Symbol.iterator=r.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&ba(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return fa(aa(this))}});u=function(){}}function fa(a){u();a={next:a};a[r.Symbol.iterator]=function(){return this};return a}function ha(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}} | ||
var ia="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ja;if("function"==typeof Object.setPrototypeOf)ja=Object.setPrototypeOf;else{var ka;a:{var la={V:!0},ma={};try{ma.__proto__=la;ka=ma.V;break a}catch(a){}ka=!1}ja=ka?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var na=ja; | ||
function oa(a,b){a.prototype=ia(b.prototype);a.prototype.constructor=a;if(na)na(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.O=b.prototype} | ||
function pa(a,b){u();a instanceof String&&(a+="");var c=0,d={next:function(){if(c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d}function v(a,b){if(b){var c=r;a=a.split(".");for(var d=0;d<a.length-1;d++){var f=a[d];f in c||(c[f]={});c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}} | ||
v("Array.prototype.keys",function(a){return a?a:function(){return pa(this,function(b){return b})}});v("Array.prototype.find",function(a){return a?a:function(b,c){a:{var d=this;d instanceof String&&(d=String(d));for(var f=d.length,g=0;g<f;g++){var e=d[g];if(b.call(c,e,g,d)){b=e;break a}}b=void 0}return b}});v("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}}); | ||
v("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var f=d.length;c=c||0;for(0>c&&(c=Math.max(c+f,0));c<f;c++){var g=d[c];if(g===b||Object.is(g,b))return!0}return!1}}); | ||
v("Promise",function(a){function b(e){this.b=0;this.c=void 0;this.a=[];var h=this.f();try{e(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(e){return e instanceof b?e:new b(function(h){h(e)})}if(a)return a;c.prototype.b=function(e){if(null==this.a){this.a=[];var h=this;this.c(function(){h.g()})}this.a.push(e)};var f=r.setTimeout;c.prototype.c=function(e){f(e,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var e=this.a;this.a=[];for(var h=0;h<e.length;++h){var k= | ||
e[h];e[h]=null;try{k()}catch(l){this.f(l)}}}this.a=null};c.prototype.f=function(e){this.c(function(){throw e;})};b.prototype.f=function(){function e(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:e(this.s),reject:e(this.g)}};b.prototype.s=function(e){if(e===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof b)this.v(e);else{a:switch(typeof e){case "object":var h=null!=e;break a;case "function":h=!0;break a;default:h=!1}h?this.m(e):this.h(e)}}; | ||
b.prototype.m=function(e){var h=void 0;try{h=e.then}catch(k){this.g(k);return}"function"==typeof h?this.w(h,e):this.h(e)};b.prototype.g=function(e){this.i(2,e)};b.prototype.h=function(e){this.i(1,e)};b.prototype.i=function(e,h){if(0!=this.b)throw Error("Cannot settle("+e+", "+h+"): Promise already settled in state"+this.b);this.b=e;this.c=h;this.l()};b.prototype.l=function(){if(null!=this.a){for(var e=0;e<this.a.length;++e)g.b(this.a[e]);this.a=null}};var g=new c;b.prototype.v=function(e){var h=this.f(); | ||
e.F(h.resolve,h.reject)};b.prototype.w=function(e,h){var k=this.f();try{e.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(e,h){function k(q,w){return"function"==typeof q?function(y){try{l(q(y))}catch(M){m(M)}}:w}var l,m,p=new b(function(q,w){l=q;m=w});this.F(k(e,l),k(h,m));return p};b.prototype.catch=function(e){return this.then(void 0,e)};b.prototype.F=function(e,h){function k(){switch(l.b){case 1:e(l.c);break;case 2:h(l.c);break;default:throw Error("Unexpected state: "+ | ||
l.b);}}var l=this;null==this.a?g.b(k):this.a.push(k)};b.resolve=d;b.reject=function(e){return new b(function(h,k){k(e)})};b.race=function(e){return new b(function(h,k){for(var l=ha(e),m=l.next();!m.done;m=l.next())d(m.value).F(h,k)})};b.all=function(e){var h=ha(e),k=h.next();return k.done?d([]):new b(function(l,m){function p(y){return function(M){q[y]=M;w--;0==w&&l(q)}}var q=[],w=0;do q.push(void 0),w++,d(k.value).F(p(q.length-1),m),k=h.next();while(!k.done)})};return b});var qa=qa||{},x=this||self; | ||
function z(a,b){a=a.split(".");b=b||x;for(var c=0;c<a.length;c++)if(b=b[a[c]],null==b)return null;return b}function ra(){}function sa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ta="closure_uid_"+(1E9*Math.random()>>>0),ua=0;function va(a,b,c){return a.call.apply(a.bind,arguments)} | ||
function wa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,d);return a.apply(b,f)}}return function(){return a.apply(b,arguments)}}function A(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?A=va:A=wa;return A.apply(null,arguments)} | ||
function B(a,b){function c(){}c.prototype=b.prototype;a.O=b.prototype;a.prototype=new c;a.prototype.constructor=a};function xa(){this.a={}}xa.prototype.get=function(a){return this.a[a]};xa.prototype.G=function(){return Object.keys(this.a)};function C(a,b,c,d){this.f=a;this.c=b;this.b=c;this.a=d}C.prototype.getRequestMessage=function(){return this.f};C.prototype.getMethodDescriptor=function(){return this.c};C.prototype.getMetadata=function(){return this.b};C.prototype.getCallOptions=function(){return this.a};function D(a,b,c,d){c=void 0===c?{}:c;this.c=a;this.a=c;this.b=b;this.f=void 0===d?null:d}D.prototype.getResponseMessage=function(){return this.c};D.prototype.getMetadata=function(){return this.a};D.prototype.getMethodDescriptor=function(){return this.b};D.prototype.getStatus=function(){return this.f};function ya(a,b,c){c=void 0===c?{}:c;var d=void 0===d?new xa:d;return new C(b,a,c,d)};function za(a){switch(a){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}};function E(a,b,c){c=void 0===c?{}:c;b=Error.call(this,b);this.message=b.message;"stack"in b&&(this.stack=b.stack);this.code=a;this.metadata=c}oa(E,Error);E.prototype.name="RpcError";function Aa(a){this.a=a}Aa.prototype.on=function(a,b){return"data"==a||"error"==a?this:this.a.on(a,b)};Aa.prototype.removeListener=function(a,b){return this.a.removeListener(a,b)};Aa.prototype.cancel=function(){this.a.cancel()};function Ba(a){switch(a){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}};function F(a){if(Error.captureStackTrace)Error.captureStackTrace(this,F);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}B(F,Error);F.prototype.name="CustomError";function Ca(a,b){a=a.split("%s");for(var c="",d=a.length-1,f=0;f<d;f++)c+=a[f]+(f<b.length?b[f]:"%s");F.call(this,c+a[d])}B(Ca,F);Ca.prototype.name="AssertionError";function Da(a,b){throw new Ca("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};function Ea(){this.l=null;this.i=[];this.m=0;this.b=Fa;this.f=this.a=this.h=0;this.c=null;this.g=0} | ||
function Ga(a,b){function c(l){l==Ha?e.h=l:l==G?e.h=l:Ia(e,h,k,"invalid frame byte");e.b=Ja;e.a=0;e.f=0}function d(l){e.f++;e.a=(e.a<<8)+l;4==e.f&&(e.b=Ka,e.g=0,"undefined"!==typeof Uint8Array?e.c=new Uint8Array(e.a):e.c=Array(e.a),0==e.a&&g())}function f(l){e.c[e.g++]=l;e.g==e.a&&g()}function g(){var l={};l[e.h]=e.c;e.i.push(l);e.b=Fa}var e=a,h,k=0;for(b instanceof Uint8Array||b instanceof Array?h=b:h=new Uint8Array(b);k<h.length;){switch(e.b){case La:Ia(e,h,k,"stream already broken");break;case Fa:c(h[k]); | ||
break;case Ja:d(h[k]);break;case Ka:f(h[k]);break;default:throw Error("unexpected parser state: "+e.b);}e.m++;k++}a=e.i;e.i=[];return 0<a.length?a:null}var Fa=0,Ja=1,Ka=2,La=3,Ha=0,G=128;function Ia(a,b,c,d){a.b=La;a.l="The stream is broken @"+a.m+"/"+c+". Error: "+d+". With input:\n"+b;throw Error(a.l);};var Ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};var Na=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};function H(a,b){return-1!=a.indexOf(b)}function Oa(a,b){return a<b?-1:a>b?1:0};var I;a:{var Pa=x.navigator;if(Pa){var Qa=Pa.userAgent;if(Qa){I=Qa;break a}}I=""};function Ra(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function Sa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}var Ta="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ua(a,b){for(var c,d,f=1;f<arguments.length;f++){d=arguments[f];for(c in d)a[c]=d[c];for(var g=0;g<Ta.length;g++)c=Ta[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function Va(a){var b=1;a=a.split(":");for(var c=[];0<b&&a.length;)c.push(a.shift()),b--;a.length&&c.push(a.join(":"));return c};function Wa(a){Wa[" "](a);return a}Wa[" "]=ra;function Xa(a){var b=Ya;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)};var Za=H(I,"Opera"),$a=H(I,"Trident")||H(I,"MSIE"),ab=H(I,"Edge"),bb=H(I,"Gecko")&&!(H(I.toLowerCase(),"webkit")&&!H(I,"Edge"))&&!(H(I,"Trident")||H(I,"MSIE"))&&!H(I,"Edge"),cb=H(I.toLowerCase(),"webkit")&&!H(I,"Edge"),db; | ||
a:{var eb="",fb=function(){var a=I;if(bb)return/rv:([^\);]+)(\)|;)/.exec(a);if(ab)return/Edge\/([\d\.]+)/.exec(a);if($a)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(cb)return/WebKit\/(\S+)/.exec(a);if(Za)return/(?:Version)[ \/]?(\S+)/.exec(a)}();fb&&(eb=fb?fb[1]:"");if($a){var gb,hb=x.document;gb=hb?hb.documentMode:void 0;if(null!=gb&&gb>parseFloat(eb)){db=String(gb);break a}}db=eb}var Ya={}; | ||
function ib(){return Xa(function(){for(var a=0,b=Na(String(db)).split("."),c=Na("9").split("."),d=Math.max(b.length,c.length),f=0;0==a&&f<d;f++){var g=b[f]||"",e=c[f]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];e=/(\d*)(\D*)(.*)/.exec(e)||["","","",""];if(0==g[0].length&&0==e[0].length)break;a=Oa(0==g[1].length?0:parseInt(g[1],10),0==e[1].length?0:parseInt(e[1],10))||Oa(0==g[2].length,0==e[2].length)||Oa(g[2],e[2]);g=g[3];e=e[3]}while(0==a)}return 0<=a})};function jb(){0!=kb&&(Object.prototype.hasOwnProperty.call(this,ta)&&this[ta]||(this[ta]=++ua));this.K=this.K}var kb=0;jb.prototype.K=!1;var lb=Object.freeze||function(a){return a};function J(a,b){this.type=a;this.a=this.target=b;this.defaultPrevented=!1}J.prototype.b=function(){this.defaultPrevented=!0};var mb=function(){if(!x.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});try{x.addEventListener("test",ra,b),x.removeEventListener("test",ra,b)}catch(c){}return a}();function K(a,b){J.call(this,a?a.type:"");this.relatedTarget=this.a=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key="";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.pointerId=0;this.pointerType="";this.c=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.a=b;if(b=a.relatedTarget){if(bb){a:{try{Wa(b.nodeName);var f=!0;break a}catch(g){}f=!1}f||(b=null)}}else"mouseover"== | ||
c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||"";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey= | ||
a.metaKey;this.pointerId=a.pointerId||0;this.pointerType="string"===typeof a.pointerType?a.pointerType:lb[a.pointerType]||"";this.c=a;a.defaultPrevented&&this.b()}}y(K,J);var lb=gb({2:"touch",3:"pen",4:"mouse"});K.prototype.b=function(){K.S.b.call(this);var a=this.c;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,jb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};var L="closure_listenable_"+(1E6*Math.random()|0),mb=0;function nb(a,b,c,d,f){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.A=f;this.key=++mb;this.s=this.v=!1}function ob(a){a.s=!0;a.listener=null;a.proxy=null;a.src=null;a.A=null};function M(a){this.src=a;this.a={};this.b=0}M.prototype.add=function(a,b,c,d,f){var g=a.toString();a=this.a[g];a||(a=this.a[g]=[],this.b++);var e=pb(a,b,d,f);-1<e?(b=a[e],c||(b.v=!1)):(b=new nb(b,this.src,g,!!d,f),b.v=c,a.push(b));return b};function qb(a,b){var c=b.type;if(c in a.a){var d=a.a[c],f=Ea(d,b),g;(g=0<=f)&&Array.prototype.splice.call(d,f,1);g&&(ob(b),0==a.a[c].length&&(delete a.a[c],a.b--))}} | ||
function pb(a,b,c,d){for(var f=0;f<a.length;++f){var g=a[f];if(!g.s&&g.listener==b&&g.capture==!!c&&g.A==d)return f}return-1};var rb="closure_lm_"+(1E6*Math.random()|0),sb={},tb=0;function ub(a,b,c,d,f){if(d&&d.once)vb(a,b,c,d,f);else if(Array.isArray(b))for(var g=0;g<b.length;g++)ub(a,b[g],c,d,f);else c=wb(c),a&&a[L]?a.f.add(String(b),c,!1,u(d)?!!d.capture:!!d,f):xb(a,b,c,!1,d,f)} | ||
function xb(a,b,c,d,f,g){if(!b)throw Error("Invalid event type");var e=u(f)?!!f.capture:!!f,h=yb(a);h||(a[rb]=h=new M(a));c=h.add(b,c,d,e,g);if(!c.proxy){d=zb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)kb||(f=e),void 0===f&&(f=!1),a.addEventListener(b.toString(),d,f);else if(a.attachEvent)a.attachEvent(Ab(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");tb++}} | ||
function zb(){var a=Bb,b=ib?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b}function vb(a,b,c,d,f){if(Array.isArray(b))for(var g=0;g<b.length;g++)vb(a,b[g],c,d,f);else c=wb(c),a&&a[L]?a.f.add(String(b),c,!0,u(d)?!!d.capture:!!d,f):xb(a,b,c,!0,d,f)} | ||
function Cb(a,b,c,d,f){if(Array.isArray(b))for(var g=0;g<b.length;g++)Cb(a,b[g],c,d,f);else(d=u(d)?!!d.capture:!!d,c=wb(c),a&&a[L])?(a=a.f,b=String(b).toString(),b in a.a&&(g=a.a[b],c=pb(g,c,d,f),-1<c&&(ob(g[c]),Array.prototype.splice.call(g,c,1),0==g.length&&(delete a.a[b],a.b--)))):a&&(a=yb(a))&&(b=a.a[b.toString()],a=-1,b&&(a=pb(b,c,d,f)),(c=-1<a?b[a]:null)&&Db(c))} | ||
function Db(a){if("number"!==typeof a&&a&&!a.s){var b=a.src;if(b&&b[L])qb(b.f,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(Ab(c),d):b.addListener&&b.removeListener&&b.removeListener(d);tb--;(c=yb(b))?(qb(c,a),0==c.b&&(c.src=null,b[rb]=null)):ob(a)}}}function Ab(a){return a in sb?sb[a]:sb[a]="on"+a} | ||
function Fb(a,b,c,d){var f=!0;if(a=yb(a))if(b=a.a[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var g=b[a];g&&g.capture==c&&!g.s&&(g=Gb(g,d),f=f&&!1!==g)}return f}function Gb(a,b){var c=a.listener,d=a.A||a.src;a.v&&Db(a);return c.call(d,b)} | ||
function Bb(a,b){if(a.s)return!0;if(!ib){var c=b||r("window.event");b=new K(c,this);var d=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){a:{var f=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(e){f=!0}if(f||void 0==c.returnValue)c.returnValue=!0}c=[];for(f=b.a;f;f=f.parentNode)c.push(f);a=a.type;for(f=c.length-1;0<=f;f--){b.a=c[f];var g=Fb(c[f],a,!0,b);d=d&&g}for(f=0;f<c.length;f++)b.a=c[f],g=Fb(c[f],a,!1,b),d=d&&g}return d}return Gb(a,new K(b,this))} | ||
function yb(a){a=a[rb];return a instanceof M?a:null}var Hb="__closure_events_fn_"+(1E9*Math.random()>>>0);function wb(a){if("function"==ia(a))return a;a[Hb]||(a[Hb]=function(b){return a.handleEvent(b)});return a[Hb]};function N(){eb.call(this);this.f=new M(this);this.N=this}y(N,eb);N.prototype[L]=!0;N.prototype.addEventListener=function(a,b,c,d){ub(this,a,b,c,d)};N.prototype.removeEventListener=function(a,b,c,d){Cb(this,a,b,c,d)};function O(a,b){a=a.N;var c=b.type||b;if("string"===typeof b)b=new J(b,a);else if(b instanceof J)b.target=b.target||a;else{var d=b;b=new J(c,a);Oa(b,d)}a=b.a=a;Ib(a,c,!0,b);Ib(a,c,!1,b)} | ||
function Ib(a,b,c,d){if(b=a.f.a[String(b)]){b=b.concat();for(var f=!0,g=0;g<b.length;++g){var e=b[g];if(e&&!e.s&&e.capture==c){var h=e.listener,k=e.A||e.src;e.v&&qb(a.f,e);f=!1!==h.call(k,d)&&f}}}};function Jb(a,b,c){if("function"==ia(a))c&&(a=w(a,c));else if(a&&"function"==typeof a.handleEvent)a=w(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:q.setTimeout(a,b||0)};function Kb(a,b,c){this.reset(a,b,c,void 0,void 0)}Kb.prototype.a=null;var Lb=0;Kb.prototype.reset=function(a,b,c,d,f){"number"==typeof f||Lb++;d||na();delete this.a};function Mb(a){this.f=a;this.b=this.c=this.a=null}function Nb(a,b){this.name=a;this.value=b}Nb.prototype.toString=function(){return this.name};var Ob=new Nb("SEVERE",1E3),Pb=new Nb("CONFIG",700),Qb=new Nb("FINE",500);function Rb(a){if(a.c)return a.c;if(a.a)return Rb(a.a);ua("Root logger has no level set.");return null}Mb.prototype.log=function(a,b,c){if(a.value>=Rb(this).value)for("function"==ia(b)&&(b=b()),a=new Kb(a,String(b),this.f),c&&(a.a=c),c=this;c;)c=c.a};var Sb={},Tb=null; | ||
function Ub(a){Tb||(Tb=new Mb(""),Sb[""]=Tb,Tb.c=Pb);var b;if(!(b=Sb[a])){b=new Mb(a);var c=a.lastIndexOf("."),d=a.substr(c+1);c=Ub(a.substr(0,c));c.b||(c.b={});c.b[d]=b;b.a=c;Sb[a]=b}return b};function P(a,b){a&&a.log(Qb,b,void 0)};function Vb(){}Vb.prototype.a=null;function Wb(a){var b;(b=a.a)||(b={},Xb(a)&&(b[0]=!0,b[1]=!0),b=a.a=b);return b};var Yb;function Zb(){}y(Zb,Vb);function $b(a){return(a=Xb(a))?new ActiveXObject(a):new XMLHttpRequest}function Xb(a){if(!a.b&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.b=d}catch(f){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.b}Yb=new Zb;function Q(a,b){this.b={};this.a=[];this.c=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&ac(this,a)}Q.prototype.f=function(){bc(this);return this.a.concat()};function bc(a){if(a.c!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];R(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.c!=a.a.length){var f={};for(c=b=0;b<a.a.length;)d=a.a[b],R(f,d)||(a.a[c++]=d,f[d]=1),b++;a.a.length=c}} | ||
Q.prototype.get=function(a,b){return R(this.b,a)?this.b[a]:b};Q.prototype.set=function(a,b){R(this.b,a)||(this.c++,this.a.push(a));this.b[a]=b};function ac(a,b){if(b instanceof Q)for(var c=b.f(),d=0;d<c.length;d++)a.set(c[d],b.get(c[d]));else for(c in b)a.set(c,b[c])}Q.prototype.forEach=function(a,b){for(var c=this.f(),d=0;d<c.length;d++){var f=c[d],g=this.get(f);a.call(b,g,f,this)}};function R(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var cc=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function S(a){N.call(this);this.headers=new Q;this.D=a||null;this.c=!1;this.C=this.a=null;this.J=this.o="";this.g=0;this.i="";this.h=this.I=this.m=this.G=!1;this.l=0;this.u=null;this.j=dc;this.B=this.H=!1}y(S,N);var dc="",ec=S.prototype,fc=Ub("goog.net.XhrIo");ec.b=fc;var gc=/^https?$/i,hc=["POST","PUT"]; | ||
function ic(a,b,c){if(a.a)throw Error("[goog.net.XhrIo] Object is active with another request="+a.o+"; newUri="+b);a.o=b;a.i="";a.g=0;a.J="POST";a.G=!1;a.c=!0;a.a=a.D?$b(a.D):$b(Yb);a.C=a.D?Wb(a.D):Wb(Yb);a.a.onreadystatechange=w(a.K,a);try{P(a.b,T(a,"Opening Xhr")),a.I=!0,a.a.open("POST",String(b),!0),a.I=!1}catch(g){P(a.b,T(a,"Error opening Xhr: "+g.message));jc(a,g);return}b=c||"";c=new Q(a.headers);var d=Fa(c.f()),f=q.FormData&&b instanceof q.FormData;!(0<=Ea(hc,"POST"))||d||f||c.set("Content-Type", | ||
"application/x-www-form-urlencoded;charset=utf-8");c.forEach(function(g,e){this.a.setRequestHeader(e,g)},a);a.j&&(a.a.responseType=a.j);"withCredentials"in a.a&&a.a.withCredentials!==a.H&&(a.a.withCredentials=a.H);try{kc(a),0<a.l&&(a.B=lc(a.a),P(a.b,T(a,"Will abort after "+a.l+"ms if incomplete, xhr2 "+a.B)),a.B?(a.a.timeout=a.l,a.a.ontimeout=w(a.L,a)):a.u=Jb(a.L,a.l,a)),P(a.b,T(a,"Sending request")),a.m=!0,a.a.send(b),a.m=!1}catch(g){P(a.b,T(a,"Send error: "+g.message)),jc(a,g)}} | ||
function lc(a){return H&&ab(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout}function Ga(a){return"content-type"==a.toLowerCase()}S.prototype.L=function(){"undefined"!=typeof ha&&this.a&&(this.i="Timed out after "+this.l+"ms, aborting",this.g=8,P(this.b,T(this,this.i)),O(this,"timeout"),this.abort(8))};function jc(a,b){a.c=!1;a.a&&(a.h=!0,a.a.abort(),a.h=!1);a.i=b;a.g=5;mc(a);nc(a)}function mc(a){a.G||(a.G=!0,O(a,"complete"),O(a,"error"))} | ||
S.prototype.abort=function(a){this.a&&this.c&&(P(this.b,T(this,"Aborting")),this.c=!1,this.h=!0,this.a.abort(),this.h=!1,this.g=a||7,O(this,"complete"),O(this,"abort"),nc(this))};S.prototype.K=function(){this.F||(this.I||this.m||this.h?oc(this):this.O())};S.prototype.O=function(){oc(this)}; | ||
function oc(a){if(a.c&&"undefined"!=typeof ha)if(a.C[1]&&4==U(a)&&2==a.getStatus())P(a.b,T(a,"Local request error detected and ignored"));else if(a.m&&4==U(a))Jb(a.K,0,a);else if(O(a,"readystatechange"),4==U(a)){P(a.b,T(a,"Request complete"));a.c=!1;try{var b=a.getStatus();a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var f;if(f=0===b){var g=String(a.o).match(cc)[1]||null;if(!g&&q.self&&q.self.location){var e=q.self.location.protocol; | ||
g=e.substr(0,e.length-1)}f=!gc.test(g?g.toLowerCase():"")}d=f}if(d)O(a,"complete"),O(a,"success");else{a.g=6;try{var h=2<U(a)?a.a.statusText:""}catch(k){P(a.b,"Can not get status: "+k.message),h=""}a.i=h+" ["+a.getStatus()+"]";mc(a)}}finally{nc(a)}}}function nc(a){if(a.a){kc(a);var b=a.a,c=a.C[0]?t:null;a.a=null;a.C=null;O(a,"ready");try{b.onreadystatechange=c}catch(d){(a=a.b)&&a.log(Ob,"Problem encountered resetting onreadystatechange: "+d.message,void 0)}}} | ||
function kc(a){a.a&&a.B&&(a.a.ontimeout=null);a.u&&(q.clearTimeout(a.u),a.u=null)}function U(a){return a.a?a.a.readyState:0}S.prototype.getStatus=function(){try{return 2<U(this)?this.a.status:-1}catch(a){return-1}}; | ||
function pc(a){try{if(!a.a)return null;if("response"in a.a)return a.a.response;switch(a.j){case dc:case "text":return a.a.responseText;case "arraybuffer":if("mozResponseArrayBuffer"in a.a)return a.a.mozResponseArrayBuffer}var b=a.b;b&&b.log(Ob,"Response type "+a.j+" is not supported on this browser",void 0);return null}catch(c){return P(a.b,"Can not get response: "+c.message),null}}function qc(a,b){if(a.a&&4==U(a))return a=a.a.getResponseHeader(b),null===a?void 0:a} | ||
function rc(a){var b={};a=(a.a&&4==U(a)?a.a.getAllResponseHeaders()||"":"").split("\r\n");for(var c=0;c<a.length;c++)if(!/^[\s\xa0]*$/.test(a[c])){var d=Pa(a[c]),f=d[0];d=d[1];if("string"===typeof d){d=d.trim();var g=b[f]||[];b[f]=g;g.push(d)}}return Ma(b,function(e){return e.join(", ")})}function T(a,b){return b+" ["+a.J+" "+a.o+" "+a.getStatus()+"]"};var sc={},V=null;function tc(a){var b=a.length,c=3*b/4;c%3?c=Math.floor(c):E("=.",a[b-1])&&(c=E("=.",a[b-2])?c-2:c-1);var d=new Uint8Array(c),f=0;uc(a,function(g){d[f++]=g});return d.subarray(0,f)} | ||
function uc(a,b){function c(k){for(;d<a.length;){var l=a.charAt(d++),m=V[l];if(null!=m)return m;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l);}return k}vc();for(var d=0;;){var f=c(-1),g=c(0),e=c(64),h=c(64);if(64===h&&-1===f)break;b(f<<2|g>>4);64!=e&&(b(g<<4&240|e>>2),64!=h&&b(e<<6&192|h))}} | ||
function vc(){if(!V){V={};for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),b=["+/=","+/","-_=","-_.","-_"],c=0;5>c;c++){var d=a.concat(b[c].split(""));sc[c]=d;for(var f=0;f<d.length;f++){var g=d[f];void 0===V[g]&&(V[g]=f)}}}};var wc=["content-type","grpc-status","grpc-message"]; | ||
function W(a){this.a=a.T;this.l=null;this.b=[];this.h=[];this.g=[];this.f=[];this.c=[];this.j=!1;this.i=0;this.m=new va;var b=this;ub(this.a,"readystatechange",function(){var c=b.a;if(c=c.a?c.a.getResponseHeader("Content-Type"):null){c=c.toLowerCase();if(0==c.lastIndexOf("application/grpc-web-text",0)){c=b.a;try{var d=c.a?c.a.responseText:""}catch(l){P(c.b,"Can not get responseText: "+l.message),d=""}c=d||"";d=c.length-c.length%4;c=c.substr(b.i,d-b.i);if(0==c.length)return;b.i=d;c=tc(c)}else if(0== | ||
c.lastIndexOf("application/grpc",0))c=new Uint8Array(pc(b.a));else{X(b,{code:2,message:"Unknown Content-type received.",metadata:{}});return}d=null;try{d=xa(b.m,c)}catch(l){X(b,{code:2,message:"Error in parsing response body",metadata:{}})}if(d)for(c=0;c<d.length;c++){if(ya in d[c]){var f=d[c][ya];if(f)try{var g=b.l(f);if(g){f=b;for(var e=g,h=0;h<f.b.length;h++)f.b[h](e)}}catch(l){X(b,{code:2,message:"Error in response deserializer function.",metadata:{}})}}if(D in d[c]&&0<d[c][D].length){f="";for(e= | ||
0;e<d[c][D].length;e++)f+=String.fromCharCode(d[c][D][e]);f=f.trim().split("\r\n");e={};for(h=0;h<f.length;h++){var k=f[h].indexOf(":");e[f[h].substring(0,k).trim()]=f[h].substring(k+1).trim()}f=e;e=0;h="";"grpc-status"in f&&(e=f["grpc-status"],delete f["grpc-status"]);"grpc-message"in f&&(h=f["grpc-message"],delete f["grpc-message"]);X(b,{code:Number(e),message:h,metadata:f})}}}});ub(this.a,"complete",function(){var c=b.a.g,d="",f={},g=rc(b.a);Object.keys(g).forEach(function(h){wc.includes(h)||(f[h]= | ||
g[h])});xc(b,f);if(0!=c){switch(c){case 7:var e=10;break;case 8:e=4;break;case 6:e=Da(b.a.getStatus());break;default:e=14}10==e&&b.j||X(b,{code:e,message:sa(c),metadata:{}})}else c=!1,"grpc-status"in g&&(e=qc(b.a,"grpc-status"),"grpc-message"in g&&(d=qc(b.a,"grpc-message")),0!=Number(e)&&(X(b,{code:Number(e),message:d,metadata:g}),c=!0)),c||yc(b)})} | ||
W.prototype.on=function(a,b){"data"==a?this.b.push(b):"status"==a?this.h.push(b):"metadata"==a?this.g.push(b):"end"==a?this.c.push(b):"error"==a&&this.f.push(b);return this};function Y(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)}W.prototype.removeListener=function(a,b){"data"==a?Y(this.b,b):"status"==a?Y(this.h,b):"metadata"==a?Y(this.g,b):"end"==a?Y(this.c,b):"error"==a&&Y(this.f,b);return this};W.prototype.cancel=function(){this.j=!0;this.a.abort()}; | ||
function X(a,b){if(0!=b.code)for(var c={code:b.code,message:decodeURIComponent(b.message||""),metadata:b.metadata},d=0;d<a.f.length;d++)a.f[d](c);b={code:b.code,details:decodeURIComponent(b.message||""),metadata:b.metadata};for(c=0;c<a.h.length;c++)a.h[c](b)}function xc(a,b){for(var c=0;c<a.g.length;c++)a.g[c](b)}function yc(a){for(var b=0;b<a.c.length;b++)a.c[b]()}W.prototype.cancel=W.prototype.cancel;W.prototype.removeListener=W.prototype.removeListener;W.prototype.on=W.prototype.on;function zc(a){var b="";La(a,function(c,d){b+=d;b+=":";b+=c;b+="\r\n"});return b};function Z(a){this.a=r("format",a)||"text";this.f=r("suppressCorsPreflight",a)||!1;this.c=r("withCredentials",a)||!1;this.b=r("streamInterceptors",a)||[];this.g=r("unaryInterceptors",a)||[]}Z.prototype.P=function(a,b,c,d,f){var g=this;d=ra(a,b,"unary",d);var e=a.substr(0,a.length-d.name.length);a=Ac(function(h){return Bc(g,h,e)},this.b).call(this,qa(d,b,c));Cc(a,f,!1);return new B(a)}; | ||
Z.prototype.M=function(a,b,c,d){var f=this;d=ra(a,b,"unary",d);var g=a.substr(0,a.length-d.name.length);return Ac(function(e){return new Promise(function(h,k){var l=Bc(f,e,g),m,p,n;Cc(l,function(v,x,F,Eb){v?k(v):x?n=x:F?p=F:Eb?m=Eb:(v=e.getMethodDescriptor(),x=m,x=void 0===x?{}:x,h(new A(n,v,x,void 0===p?null:p)))},!0)})},this.g).call(this,qa(d,b,c)).then(function(e){return e.getResponseMessage()})};Z.prototype.unaryCall=function(a,b,c,d){return this.M(a,b,c,d)}; | ||
Z.prototype.R=function(a,b,c,d){var f=this;d=ra(a,b,"server_streaming",d);var g=a.substr(0,a.length-d.name.length);return Ac(function(e){return Bc(f,e,g)},this.b).call(this,qa(d,b,c))}; | ||
function Bc(a,b,c){var d=b.getMethodDescriptor(),f=c+d.name;c=new S;c.H=a.c;var g=new W({T:c});g.l=d.b;ac(c.headers,b.getMetadata());"text"==a.a?(c.headers.set("Content-Type","application/grpc-web-text"),c.headers.set("Accept","application/grpc-web-text")):c.headers.set("Content-Type","application/grpc-web+proto");c.headers.set("X-User-Agent","grpc-web-javascript/0.1");c.headers.set("X-Grpc-Web","1");if(R(c.headers.b,"deadline")){var e=c.headers.get("deadline");e=Math.round(e-(new Date).getTime()); | ||
var h=c.headers;R(h.b,"deadline")&&(delete h.b.deadline,h.c--,h.a.length>2*h.c&&bc(h));Infinity===e&&(e=0);0<e&&c.headers.set("grpc-timeout",e+"m")}if(a.f){h=c.headers;bc(h);e={};for(var k=0;k<h.a.length;k++){var l=h.a[k];e[l]=h.b[l]}h=c.headers;h.b={};h.a.length=0;h.c=0;b:{for(m in e){var m=!1;break b}m=!0}if(!m)if(e=zc(e),"string"===typeof f){if(m=encodeURIComponent("$httpHeaders"),e=null!=e?"="+encodeURIComponent(String(e)):"",m+=e)e=f.indexOf("#"),0>e&&(e=f.length),h=f.indexOf("?"),0>h||h>e?(h= | ||
e,k=""):k=f.substring(h+1,e),f=[f.substr(0,h),k,f.substr(e)],e=f[1],f[1]=m?e?e+"&"+m:m:e,f=f[0]+(f[1]?"?"+f[1]:"")+f[2]}else f.a("$httpHeaders",e)}b=(0,d.a)(b.getRequestMessage());d=b.length;m=[0,0,0,0];e=new Uint8Array(5+d);for(h=3;0<=h;h--)m[h]=d%256,d>>>=8;e.set(new Uint8Array(m),1);e.set(b,5);b=e;if("text"==a.a){a=b;var p;void 0===p&&(p=0);vc();p=sc[p];b=[];for(d=0;d<a.length;d+=3){l=a[d];var n=(m=d+1<a.length)?a[d+1]:0;k=(e=d+2<a.length)?a[d+2]:0;h=l>>2;l=(l&3)<<4|n>>4;n=(n&15)<<2|k>>6;k&=63; | ||
e||(k=64,m||(n=64));b.push(p[h],p[l],p[n]||"",p[k]||"")}b=b.join("")}else"binary"==a.a&&(c.j="arraybuffer");ic(c,f,b);return g} | ||
function Cc(a,b,c){var d=null,f=!1;a.on("data",function(g){d=g});a.on("error",function(g){0==g.code||f||(f=!0,b(g,null))});a.on("status",function(g){0==g.code||f?c&&b(null,null,g):(f=!0,b({code:g.code,message:g.details,metadata:g.metadata},null))});if(c)a.on("metadata",function(g){b(null,null,null,g)});a.on("end",function(){f||(null==d?b({code:2,message:"Incomplete response"}):b(null,d));c&&b(null,null)})} | ||
function Ac(a,b){var c=a;b.forEach(function(d){var f=c;c=function(g){return d.intercept(g,f)}});return c}Z.prototype.serverStreaming=Z.prototype.R;Z.prototype.unaryCall=Z.prototype.unaryCall;Z.prototype.thenableCall=Z.prototype.M;Z.prototype.rpcCall=Z.prototype.P;module.exports.AbstractClientBase={MethodInfo:function(a,b,c,d,f){this.name=d;this.b=f;this.f=a;this.a=b;this.c=c}};module.exports.GrpcWebClientBase=Z;module.exports.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15};module.exports.MethodDescriptor=pa; | ||
module.exports.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming"}; | ||
a.metaKey;this.pointerId=a.pointerId||0;this.pointerType="string"===typeof a.pointerType?a.pointerType:nb[a.pointerType]||"";this.c=a;a.defaultPrevented&&K.O.b.call(this)}}B(K,J);var nb=lb({2:"touch",3:"pen",4:"mouse"});K.prototype.b=function(){K.O.b.call(this);var a=this.c;a.preventDefault?a.preventDefault():a.returnValue=!1};var L="closure_listenable_"+(1E6*Math.random()|0);var ob=0;function pb(a,b,c,d,f){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.H=f;this.key=++ob;this.A=this.D=!1}function qb(a){a.A=!0;a.listener=null;a.proxy=null;a.src=null;a.H=null};function rb(a){this.src=a;this.a={};this.b=0}rb.prototype.add=function(a,b,c,d,f){var g=a.toString();a=this.a[g];a||(a=this.a[g]=[],this.b++);var e=sb(a,b,d,f);-1<e?(b=a[e],c||(b.D=!1)):(b=new pb(b,this.src,g,!!d,f),b.D=c,a.push(b));return b};rb.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.a))return!1;var f=this.a[a];b=sb(f,b,c,d);return-1<b?(qb(f[b]),Array.prototype.splice.call(f,b,1),0==f.length&&(delete this.a[a],this.b--),!0):!1}; | ||
function tb(a,b){var c=b.type;if(c in a.a){var d=a.a[c],f=Ma(d,b),g;(g=0<=f)&&Array.prototype.splice.call(d,f,1);g&&(qb(b),0==a.a[c].length&&(delete a.a[c],a.b--))}}function sb(a,b,c,d){for(var f=0;f<a.length;++f){var g=a[f];if(!g.A&&g.listener==b&&g.capture==!!c&&g.H==d)return f}return-1};var ub="closure_lm_"+(1E6*Math.random()|0),vb={},wb=0;function xb(a,b,c,d,f){if(d&&d.once)yb(a,b,c,d,f);else if(Array.isArray(b))for(var g=0;g<b.length;g++)xb(a,b[g],c,d,f);else c=zb(c),a&&a[L]?a.f.add(String(b),c,!1,sa(d)?!!d.capture:!!d,f):Ab(a,b,c,!1,d,f)} | ||
function Ab(a,b,c,d,f,g){if(!b)throw Error("Invalid event type");var e=sa(f)?!!f.capture:!!f,h=Bb(a);h||(a[ub]=h=new rb(a));c=h.add(b,c,d,e,g);if(!c.proxy){d=Cb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)mb||(f=e),void 0===f&&(f=!1),a.addEventListener(b.toString(),d,f);else if(a.attachEvent)a.attachEvent(Db(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");wb++}} | ||
function Cb(){function a(c){return b.call(a.src,a.listener,c)}var b=Eb;return a}function yb(a,b,c,d,f){if(Array.isArray(b))for(var g=0;g<b.length;g++)yb(a,b[g],c,d,f);else c=zb(c),a&&a[L]?a.f.add(String(b),c,!0,sa(d)?!!d.capture:!!d,f):Ab(a,b,c,!0,d,f)}function Fb(a,b,c,d,f){if(Array.isArray(b))for(var g=0;g<b.length;g++)Fb(a,b[g],c,d,f);else(d=sa(d)?!!d.capture:!!d,c=zb(c),a&&a[L])?a.f.remove(String(b),c,d,f):a&&(a=Bb(a))&&(b=a.a[b.toString()],a=-1,b&&(a=sb(b,c,d,f)),(c=-1<a?b[a]:null)&&Gb(c))} | ||
function Gb(a){if("number"!==typeof a&&a&&!a.A){var b=a.src;if(b&&b[L])tb(b.f,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(Db(c),d):b.addListener&&b.removeListener&&b.removeListener(d);wb--;(c=Bb(b))?(tb(c,a),0==c.b&&(c.src=null,b[ub]=null)):qb(a)}}}function Db(a){return a in vb?vb[a]:vb[a]="on"+a}function Eb(a,b){if(a.A)a=!0;else{b=new K(b,this);var c=a.listener,d=a.H||a.src;a.D&&Gb(a);a=c.call(d,b)}return a} | ||
function Bb(a){a=a[ub];return a instanceof rb?a:null}var Hb="__closure_events_fn_"+(1E9*Math.random()>>>0);function zb(a){if("function"===typeof a)return a;a[Hb]||(a[Hb]=function(b){return a.handleEvent(b)});return a[Hb]};function N(){jb.call(this);this.f=new rb(this);this.U=this}B(N,jb);N.prototype[L]=!0;N.prototype.addEventListener=function(a,b,c,d){xb(this,a,b,c,d)};N.prototype.removeEventListener=function(a,b,c,d){Fb(this,a,b,c,d)};function O(a,b){a=a.U;var c=b.type||b;if("string"===typeof b)b=new J(b,a);else if(b instanceof J)b.target=b.target||a;else{var d=b;b=new J(c,a);Ua(b,d)}a=b.a=a;Ib(a,c,!0,b);Ib(a,c,!1,b)} | ||
function Ib(a,b,c,d){if(b=a.f.a[String(b)]){b=b.concat();for(var f=!0,g=0;g<b.length;++g){var e=b[g];if(e&&!e.A&&e.capture==c){var h=e.listener,k=e.H||e.src;e.D&&tb(a.f,e);f=!1!==h.call(k,d)&&f}}}};function Jb(a,b,c){if("function"===typeof a)c&&(a=A(a,c));else if(a&&"function"==typeof a.handleEvent)a=A(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:x.setTimeout(a,b||0)};function Kb(a,b){this.name=a;this.value=b}Kb.prototype.toString=function(){return this.name};var Lb=new Kb("OFF",Infinity),Mb=new Kb("SEVERE",1E3),Nb=new Kb("CONFIG",700),Ob=new Kb("FINE",500);function Pb(){this.clear()}var Qb;Pb.prototype.clear=function(){};function Sb(a,b,c){this.reset(a||Lb,b,c,void 0,void 0)}Sb.prototype.reset=function(){};function Tb(a,b){this.a=null;this.f=[];this.b=(void 0===b?null:b)||null;this.c=[];this.g={a:function(){return a}}} | ||
function Ub(a){if(a.a)return a.a;if(a.b)return Ub(a.b);Da("Root logger has no level set.");return Lb}function Vb(a,b){for(;a;)a.f.forEach(function(c){c(b)}),a=a.b}function Wb(){this.entries={};var a=new Tb("");a.a=Nb;this.entries[""]=a}var Xb;function Yb(a,b,c){var d=a.entries[b];if(d)return void 0!==c&&(d.a=c),d;d=Yb(a,b.substr(0,b.lastIndexOf(".")));var f=new Tb(b,d);a.entries[b]=f;d.c.push(f);void 0!==c&&(f.a=c);return f}function Zb(){Xb||(Xb=new Wb);return Xb} | ||
function $b(a,b,c){var d;if(d=a)if(d=a&&b){d=b.value;var f=a?Ub(Yb(Zb(),a.a())):Lb;d=d>=f.value}d&&(b=b||Lb,d=Yb(Zb(),a.a()),"function"===typeof c&&(c=c()),Qb||(Qb=new Pb),a=new Sb(b,c,a.a()),Vb(d,a))}function P(a,b){a&&$b(a,Ob,b)};function ac(){}ac.prototype.a=null;function bc(a){var b;(b=a.a)||(b={},cc(a)&&(b[0]=!0,b[1]=!0),b=a.a=b);return b};var dc;function ec(){}B(ec,ac);function fc(a){return(a=cc(a))?new ActiveXObject(a):new XMLHttpRequest}function cc(a){if(!a.b&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.b=d}catch(f){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.b}dc=new ec;t();u();function gc(a,b){this.b=a[x.Symbol.iterator]();this.c=b;this.f=0}gc.prototype[Symbol.iterator]=function(){return this};gc.prototype.next=function(){var a=this.b.next();return{value:a.done?void 0:this.c.call(void 0,a.value,this.f++),done:a.done}};function hc(a,b){return new gc(a,b)}t();u();t();u();var ic="StopIteration"in x?x.StopIteration:{message:"StopIteration",stack:""};function Q(){}Q.prototype.next=function(){return Q.prototype.a.call(this)};Q.prototype.a=function(){throw ic;};Q.prototype.u=function(){return this};function jc(a){if(a instanceof R||a instanceof S||a instanceof T)return a;if("function"==typeof a.next)return new R(function(){return kc(a)});t();u();if("function"==typeof a[Symbol.iterator])return t(),u(),new R(function(){return a[Symbol.iterator]()});if("function"==typeof a.u)return new R(function(){return kc(a.u())});throw Error("Not an iterator or iterable.");} | ||
function kc(a){if(!(a instanceof Q))return a;var b=!1;return{next:function(){for(var c;!b;)try{c=a.a();break}catch(d){if(d!==ic)throw d;b=!0}return{value:c,done:b}}}}t();u();function R(a){this.b=a}R.prototype.u=function(){return new S(this.b())};R.prototype[Symbol.iterator]=function(){return new T(this.b())};R.prototype.c=function(){return new T(this.b())};t();u();function S(a){this.b=a}oa(S,Q);S.prototype.a=function(){var a=this.b.next();if(a.done)throw ic;return a.value};S.prototype.next=function(){return S.prototype.a.call(this)}; | ||
S.prototype[Symbol.iterator]=function(){return new T(this.b)};S.prototype.c=function(){return new T(this.b)};function T(a){R.call(this,function(){return a});this.f=a}oa(T,R);T.prototype.next=function(){return this.f.next()};function lc(a,b){this.o={};this.j=[];this.B=this.size=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)}n=lc.prototype;n.G=function(){mc(this);return this.j.concat()};n.has=function(a){return U(this.o,a)};n.clear=function(){this.o={};this.B=this.size=this.j.length=0};n.remove=function(a){return this.delete(a)}; | ||
n.delete=function(a){return U(this.o,a)?(delete this.o[a],--this.size,this.B++,this.j.length>2*this.size&&mc(this),!0):!1};function mc(a){if(a.size!=a.j.length){for(var b=0,c=0;b<a.j.length;){var d=a.j[b];U(a.o,d)&&(a.j[c++]=d);b++}a.j.length=c}if(a.size!=a.j.length){var f={};for(c=b=0;b<a.j.length;)d=a.j[b],U(f,d)||(a.j[c++]=d,f[d]=1),b++;a.j.length=c}}n.get=function(a,b){return U(this.o,a)?this.o[a]:b};n.set=function(a,b){U(this.o,a)||(this.size+=1,this.j.push(a),this.B++);this.o[a]=b}; | ||
n.addAll=function(a){if(a instanceof lc)for(var b=a.G(),c=0;c<b.length;c++)this.set(b[c],a.get(b[c]));else for(b in a)this.set(b,a[b])};n.forEach=function(a,b){for(var c=this.G(),d=0;d<c.length;d++){var f=c[d],g=this.get(f);a.call(b,g,f,this)}};n.clone=function(){return new lc(this)};n.keys=function(){return jc(this.u(!0)).c()};n.values=function(){return jc(this.u(!1)).c()};n.entries=function(){var a=this;return hc(this.keys(),function(b){return[b,a.get(b)]})}; | ||
n.u=function(a){mc(this);var b=0,c=this.B,d=this,f=new Q;f.a=function(){if(c!=d.B)throw Error("The map has changed since the iterator was created");if(b>=d.j.length)throw ic;var g=d.j[b++];return a?g:d.o[g]};f.next=f.a.bind(f);return f};function U(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var nc=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function oc(a){N.call(this);this.headers=new lc;this.C=a||null;this.c=!1;this.J=this.a=null;this.P=this.v="";this.g=0;this.l="";this.i=this.N=this.s=this.L=!1;this.h=0;this.w=null;this.m=pc;this.I=this.M=!1}B(oc,N);var pc="";oc.prototype.b=Yb(Zb(),"goog.net.XhrIo",void 0).g;var qc=/^https?$/i,rc=["POST","PUT"]; | ||
function sc(a,b,c){if(a.a)throw Error("[goog.net.XhrIo] Object is active with another request="+a.v+"; newUri="+b);a.v=b;a.l="";a.g=0;a.P="POST";a.L=!1;a.c=!0;a.a=a.C?fc(a.C):fc(dc);a.J=a.C?bc(a.C):bc(dc);a.a.onreadystatechange=A(a.R,a);try{P(a.b,V(a,"Opening Xhr")),a.N=!0,a.a.open("POST",String(b),!0),a.N=!1}catch(g){P(a.b,V(a,"Error opening Xhr: "+g.message));tc(a,g);return}b=c||"";c=a.headers.clone();var d=c.G().find(function(g){return"content-type"==g.toLowerCase()}),f=x.FormData&&b instanceof | ||
x.FormData;!(0<=Ma(rc,"POST"))||d||f||c.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");c.forEach(function(g,e){this.a.setRequestHeader(e,g)},a);a.m&&(a.a.responseType=a.m);"withCredentials"in a.a&&a.a.withCredentials!==a.M&&(a.a.withCredentials=a.M);try{uc(a),0<a.h&&(a.I=vc(a.a),P(a.b,V(a,"Will abort after "+a.h+"ms if incomplete, xhr2 "+a.I)),a.I?(a.a.timeout=a.h,a.a.ontimeout=A(a.T,a)):a.w=Jb(a.T,a.h,a)),P(a.b,V(a,"Sending request")),a.s=!0,a.a.send(b),a.s=!1}catch(g){P(a.b, | ||
V(a,"Send error: "+g.message)),tc(a,g)}}function vc(a){return $a&&ib()&&"number"===typeof a.timeout&&void 0!==a.ontimeout}n=oc.prototype;n.T=function(){"undefined"!=typeof qa&&this.a&&(this.l="Timed out after "+this.h+"ms, aborting",this.g=8,P(this.b,V(this,this.l)),O(this,"timeout"),this.abort(8))};function tc(a,b){a.c=!1;a.a&&(a.i=!0,a.a.abort(),a.i=!1);a.l=b;a.g=5;wc(a);xc(a)}function wc(a){a.L||(a.L=!0,O(a,"complete"),O(a,"error"))} | ||
n.abort=function(a){this.a&&this.c&&(P(this.b,V(this,"Aborting")),this.c=!1,this.i=!0,this.a.abort(),this.i=!1,this.g=a||7,O(this,"complete"),O(this,"abort"),xc(this))};n.R=function(){this.K||(this.N||this.s||this.i?yc(this):this.W())};n.W=function(){yc(this)}; | ||
function yc(a){if(a.c&&"undefined"!=typeof qa)if(a.J[1]&&4==W(a)&&2==a.getStatus())P(a.b,V(a,"Local request error detected and ignored"));else if(a.s&&4==W(a))Jb(a.R,0,a);else if(O(a,"readystatechange"),4==W(a)){P(a.b,V(a,"Request complete"));a.c=!1;try{var b=a.getStatus();a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var f;if(f=0===b){var g=String(a.v).match(nc)[1]||null;if(!g&&x.self&&x.self.location){var e=x.self.location.protocol; | ||
g=e.substr(0,e.length-1)}f=!qc.test(g?g.toLowerCase():"")}d=f}if(d)O(a,"complete"),O(a,"success");else{a.g=6;try{var h=2<W(a)?a.a.statusText:""}catch(k){P(a.b,"Can not get status: "+k.message),h=""}a.l=h+" ["+a.getStatus()+"]";wc(a)}}finally{xc(a)}}}function xc(a){if(a.a){uc(a);var b=a.a,c=a.J[0]?ra:null;a.a=null;a.J=null;O(a,"ready");try{b.onreadystatechange=c}catch(d){(a=a.b)&&$b(a,Mb,"Problem encountered resetting onreadystatechange: "+d.message)}}} | ||
function uc(a){a.a&&a.I&&(a.a.ontimeout=null);a.w&&(x.clearTimeout(a.w),a.w=null)}function W(a){return a.a?a.a.readyState:0}n.getStatus=function(){try{return 2<W(this)?this.a.status:-1}catch(a){return-1}}; | ||
function zc(a){try{if(!a.a)return null;if("response"in a.a)return a.a.response;switch(a.m){case pc:case "text":return a.a.responseText;case "arraybuffer":if("mozResponseArrayBuffer"in a.a)return a.a.mozResponseArrayBuffer}var b=a.b;b&&$b(b,Mb,"Response type "+a.m+" is not supported on this browser");return null}catch(c){return P(a.b,"Can not get response: "+c.message),null}}function Ac(a,b){if(a.a&&4==W(a))return a=a.a.getResponseHeader(b),null===a?void 0:a} | ||
function Bc(a){var b={};a=(a.a&&4==W(a)?a.a.getAllResponseHeaders()||"":"").split("\r\n");for(var c=0;c<a.length;c++)if(!/^[\s\xa0]*$/.test(a[c])){var d=Va(a[c]),f=d[0];d=d[1];if("string"===typeof d){d=d.trim();var g=b[f]||[];b[f]=g;g.push(d)}}return Sa(b,function(e){return e.join(", ")})}function V(a,b){return b+" ["+a.P+" "+a.v+" "+a.getStatus()+"]"};var Cc={},Dc=null;function Ec(a){var b=a.length,c=3*b/4;c%3?c=Math.floor(c):H("=.",a[b-1])&&(c=H("=.",a[b-2])?c-2:c-1);var d=new Uint8Array(c),f=0;Fc(a,function(g){d[f++]=g});return d.subarray(0,f)} | ||
function Fc(a,b){function c(k){for(;d<a.length;){var l=a.charAt(d++),m=Dc[l];if(null!=m)return m;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l);}return k}Gc();for(var d=0;;){var f=c(-1),g=c(0),e=c(64),h=c(64);if(64===h&&-1===f)break;b(f<<2|g>>4);64!=e&&(b(g<<4&240|e>>2),64!=h&&b(e<<6&192|h))}} | ||
function Gc(){if(!Dc){Dc={};for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),b=["+/=","+/","-_=","-_.","-_"],c=0;5>c;c++){var d=a.concat(b[c].split(""));Cc[c]=d;for(var f=0;f<d.length;f++){var g=d[f];void 0===Dc[g]&&(Dc[g]=f)}}}};var Hc=["content-type","grpc-status","grpc-message"]; | ||
function X(a){this.a=a.Z;this.m=null;this.b=[];this.h=[];this.g=[];this.f=[];this.c=[];this.l=!1;this.i=0;this.s=new Ea;var b=this;xb(this.a,"readystatechange",function(){var c=b.a;if(c=c.a?c.a.getResponseHeader("Content-Type"):null){c=c.toLowerCase();if(0==c.lastIndexOf("application/grpc-web-text",0)){c=b.a;try{var d=c.a?c.a.responseText:""}catch(k){P(c.b,"Can not get responseText: "+k.message),d=""}c=d||"";d=c.length-c.length%4;c=c.substr(b.i,d-b.i);if(0==c.length)return;b.i=d;c=Ec(c)}else if(0== | ||
c.lastIndexOf("application/grpc",0))c=new Uint8Array(zc(b.a));else{Y(b,new E(2,"Unknown Content-type received."));return}d=null;try{d=Ga(b.s,c)}catch(k){Y(b,new E(2,"Error in parsing response body"))}if(d)for(c=0;c<d.length;c++){if(Ha in d[c]){var f=d[c][Ha];if(f){var g=void 0;try{g=b.m(f)}catch(k){Y(b,new E(13,"Error when deserializing response data: "+g))}if(g){f=b;for(var e=0;e<f.b.length;e++)f.b[e](g)}}}if(G in d[c]&&0<d[c][G].length){f="";for(g=0;g<d[c][G].length;g++)f+=String.fromCharCode(d[c][G][g]); | ||
f=f.trim().split("\r\n");g={};for(e=0;e<f.length;e++){var h=f[e].indexOf(":");g[f[e].substring(0,h).trim()]=f[e].substring(h+1).trim()}f=g;g=0;e="";"grpc-status"in f&&(g=Number(f["grpc-status"]),delete f["grpc-status"]);"grpc-message"in f&&(e=f["grpc-message"],delete f["grpc-message"]);Y(b,new E(g,e,f))}}}});xb(this.a,"complete",function(){var c=b.a.g,d=2,f="",g={},e=Bc(b.a);Object.keys(e).forEach(function(h){Hc.includes(h)||(g[h]=e[h])});Ic(b,g);if(0!=c){switch(c){case 7:d=10;break;case 8:d=4;break; | ||
case 6:d=za(b.a.getStatus());break;default:d=14}10==d&&b.l||Y(b,new E(d,Ba(c)))}else c=!1,"grpc-status"in e&&(d=Number(Ac(b.a,"grpc-status")),"grpc-message"in e&&(f=Ac(b.a,"grpc-message")),0!=d&&(Y(b,new E(d,f||"",e)),c=!0)),c||Jc(b)})}X.prototype.on=function(a,b){"data"==a?this.b.push(b):"status"==a?this.h.push(b):"metadata"==a?this.g.push(b):"end"==a?this.c.push(b):"error"==a&&this.f.push(b);return this};function Kc(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)} | ||
X.prototype.removeListener=function(a,b){"data"==a?Kc(this.b,b):"status"==a?Kc(this.h,b):"metadata"==a?Kc(this.g,b):"end"==a?Kc(this.c,b):"error"==a&&Kc(this.f,b);return this};X.prototype.cancel=function(){this.l=!0;this.a.abort()};function Y(a,b){if(0!=b.code)for(var c=new E(b.code,decodeURIComponent(b.message||""),b.metadata),d=0;d<a.f.length;d++)a.f[d](c);b={code:b.code,details:decodeURIComponent(b.message||""),metadata:b.metadata};for(c=0;c<a.h.length;c++)a.h[c](b)} | ||
function Ic(a,b){for(var c=0;c<a.g.length;c++)a.g[c](b)}function Jc(a){for(var b=0;b<a.c.length;b++)a.c[b]()}X.prototype.cancel=X.prototype.cancel;X.prototype.removeListener=X.prototype.removeListener;X.prototype.on=X.prototype.on;function Lc(a){var b="";Ra(a,function(c,d){b+=d;b+=":";b+=c;b+="\r\n"});return b};function Z(a,b){a=void 0===a?{}:a;this.a=a.format||z("format",a)||"text";this.g=a.aa||z("suppressCorsPreflight",a)||!1;this.f=a.withCredentials||z("withCredentials",a)||!1;this.b=a.$||z("streamInterceptors",a)||[];this.h=a.ba||z("unaryInterceptors",a)||[];this.c=b||null}Z.prototype.X=function(a,b,c,d,f){var g=this,e=a.substr(0,a.length-d.name.length);a=Mc(function(h){return Nc(g,h,e)},this.b).call(this,ya(d,b,c));Oc(a,f,!1);return new Aa(a)}; | ||
Z.prototype.S=function(a,b,c,d){var f=this,g=a.substr(0,a.length-d.name.length);return Mc(function(e){return new Promise(function(h,k){var l=Nc(f,e,g),m,p,q;Oc(l,function(w,y,M,Rb){w?k(w):y?q=y:M?p=M:Rb?m=Rb:(w=e.getMethodDescriptor(),y=m,y=void 0===y?{}:y,h(new D(q,w,y,void 0===p?null:p)))},!0)})},this.h).call(this,ya(d,b,c)).then(function(e){return e.getResponseMessage()})};Z.prototype.unaryCall=function(a,b,c,d){return this.S(a,b,c,d)}; | ||
Z.prototype.Y=function(a,b,c,d){var f=this,g=a.substr(0,a.length-d.name.length);return Mc(function(e){return Nc(f,e,g)},this.b).call(this,ya(d,b,c))}; | ||
function Nc(a,b,c){var d=b.getMethodDescriptor(),f=c+d.name;c=a.c?a.c:new oc;c.M=a.f;var g=new X({Z:c});g.m=d.b;var e=b.getMetadata();for(h in e)c.headers.set(h,e[h]);"text"==a.a?(c.headers.set("Content-Type","application/grpc-web-text"),c.headers.set("Accept","application/grpc-web-text")):c.headers.set("Content-Type","application/grpc-web+proto");c.headers.set("X-User-Agent","grpc-web-javascript/0.1");c.headers.set("X-Grpc-Web","1");if(c.headers.has("deadline")){var h=Number(c.headers.get("deadline")); | ||
h=Math.ceil(h-(new Date).getTime());c.headers.delete("deadline");Infinity===h&&(h=0);0<h&&(c.headers.set("grpc-timeout",h+"m"),c.h=Math.max(0,Math.max(1E3,Math.ceil(1.1*h))))}if(a.g){e=c.headers;h={};for(var k=ha(e.keys()),l=k.next();!l.done;l=k.next())l=l.value,h[l]=e.get(l);c.headers.clear();b:{for(m in h){var m=!1;break b}m=!0}if(!m)if(h=Lc(h),"string"===typeof f){if(m=encodeURIComponent("$httpHeaders"),h=null!=h?"="+encodeURIComponent(String(h)):"",m+=h)h=f.indexOf("#"),0>h&&(h=f.length),e=f.indexOf("?"), | ||
0>e||e>h?(e=h,k=""):k=f.substring(e+1,h),f=[f.substr(0,e),k,f.substr(h)],h=f[1],f[1]=m?h?h+"&"+m:m:h,f=f[0]+(f[1]?"?"+f[1]:"")+f[2]}else f.a("$httpHeaders",h)}b=(0,d.a)(b.getRequestMessage());d=b.length;m=[0,0,0,0];h=new Uint8Array(5+d);for(e=3;0<=e;e--)m[e]=d%256,d>>>=8;h.set(new Uint8Array(m),1);h.set(b,5);b=h;if("text"==a.a){a=b;var p;void 0===p&&(p=0);Gc();p=Cc[p];b=Array(Math.floor(a.length/3));d=p[64]||"";for(m=h=0;h<a.length-2;h+=3){l=a[h];var q=a[h+1];k=a[h+2];e=p[l>>2];l=p[(l&3)<<4|q>>4]; | ||
q=p[(q&15)<<2|k>>6];k=p[k&63];b[m++]=e+l+q+k}e=0;k=d;switch(a.length-h){case 2:e=a[h+1],k=p[(e&15)<<2]||d;case 1:a=a[h],b[m]=p[a>>2]+p[(a&3)<<4|e>>4]+k+d}b=b.join("")}else"binary"==a.a&&(c.m="arraybuffer");sc(c,f,b);return g} | ||
function Oc(a,b,c){var d=!1,f=null,g=!1;a.on("data",function(e){d=!0;f=e});a.on("error",function(e){0==e.code||g||(g=!0,b(e,null))});a.on("status",function(e){0==e.code||g?c&&b(null,null,e):(g=!0,b({code:e.code,message:e.details,metadata:e.metadata},null))});if(c)a.on("metadata",function(e){b(null,null,null,e)});a.on("end",function(){g||(d?b(null,f):b({code:2,message:"Incomplete response"}));c&&b(null,null)})} | ||
function Mc(a,b){var c=a;b.forEach(function(d){var f=c;c=function(g){return d.intercept(g,f)}});return c}Z.prototype.serverStreaming=Z.prototype.Y;Z.prototype.unaryCall=Z.prototype.unaryCall;Z.prototype.thenableCall=Z.prototype.S;Z.prototype.rpcCall=Z.prototype.X;module.exports.GrpcWebClientBase=Z;module.exports.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15};module.exports.MethodDescriptor=function(a,b,c,d,f,g){this.name=a;this.a=f;this.b=g};module.exports.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming",BIDI_STREAMING:"bidi_streaming"}; |
{ | ||
"name": "grpc-web", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"author": "Google Inc.", | ||
@@ -22,3 +22,5 @@ "description": "gRPC-Web Client Runtime Library", | ||
"prepublishOnly": "npm run build", | ||
"test": "mocha --timeout 60000 \"./test/**/*_test.js\"" | ||
"test": "npm run test-jsunit && npm run test-mocha", | ||
"test-mocha": "mocha --timeout 10000 \"./test/**/*_test.js\"", | ||
"test-jsunit": "./scripts/generate_test_files.sh && ./scripts/run_jsunit_tests.sh && rm -rf ./generated" | ||
}, | ||
@@ -30,9 +32,13 @@ "license": "Apache-2.0", | ||
"google-closure-compiler": "~20200224.0.0", | ||
"google-protobuf": "~3.12.0", | ||
"google-closure-deps": "~20210601.0.0", | ||
"google-closure-library": "~20210808.0.0", | ||
"google-protobuf": "~3.14.0", | ||
"gulp": "~4.0.2", | ||
"gulp-connect": "~5.7.0", | ||
"gulp-eval": "~1.0.0", | ||
"mocha": "~5.2.0", | ||
"mock-xmlhttprequest": "~2.0.0", | ||
"protractor": "~7.0.0", | ||
"typescript": "~3.8.0" | ||
} | ||
} |
@@ -11,3 +11,3 @@ # gRPC-Web Client Runtime Library | ||
current version of the library uses [Envoy](https://www.envoyproxy.io/) by | ||
default, in which gRPC-Web support is built-in. | ||
default, in which gRPC-Web support is built-in. | ||
@@ -117,3 +117,3 @@ In the future, we expect gRPC-Web to be supported in language-specific Web | ||
const call = echoService.echo(request, {'custom-header-1': 'value1'}, | ||
(err: grpcWeb.Error, response: EchoResponse) => { | ||
(err: grpcWeb.RpcError, response: EchoResponse) => { | ||
console.log(response.getMessage()); | ||
@@ -120,0 +120,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
44585
290
13
2