@formant/data-sdk 0.0.97 → 0.0.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,7 +28,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
28
28
  `),stack:f.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(f)}}},{key:"getProcessInfo",value:function(){return{pid:n.pid,uid:n.getuid?n.getuid():null,gid:n.getgid?n.getgid():null,cwd:n.cwd(),execPath:n.execPath,version:n.version,argv:n.argv,memoryUsage:n.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:l.loadavg(),uptime:l.uptime()}}},{key:"getTrace",value:function(f){return(f?u.parse(f):u.get()).map(function(S){return{column:S.getColumnNumber(),file:S.getFileName(),function:S.getFunctionName(),line:S.getLineNumber(),method:S.getMethodName(),native:S.isNative()}})}},{key:"_addHandler",value:function(f){if(!this.handlers.has(f)){f.handleRejections=!0;var S=new b(f);this.handlers.set(f,S),this.logger.pipe(S)}}},{key:"_unhandledRejection",value:function(f){var S,w=this.getAllInfo(f),P=this._getRejectionHandlers(),N=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(f):this.logger.exitOnError;function T(){i("doExit",N),i("process._exiting",n._exiting),N&&!n._exiting&&(S&&clearTimeout(S),n.exit(1))}if(!P.length&&N&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),N=!1),!P||P.length===0)return n.nextTick(T);s(P,function(R,d){var I=c(d),Q=R.transport||R;function Z(h){return function(){i(h),I()}}Q._ending=!0,Q.once("finish",Z("finished")),Q.once("error",Z("error"))},function(){return N&&T()}),this.logger.log(w),N&&(S=setTimeout(T,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(f){return(f.transport||f).handleRejections})}}])&&o(_.prototype,v),A}()}).call(this,r(2))},function(e,t,r){const n=r(50);e.exports=function(o){const l=n(o);if(l<0)throw new Error("should be a positive integer");return l}},function(e,t,r){const n=r(46).URL,o=r(34);e.exports=function(l){const s=o(l);try{return new n(s)}catch{throw new Error("should be a valid URL")}}},function(e,t,r){const n={};n.web=r(21),r(94);const o={v1:{}};o.v1.signaling={},o.v1.signaling.api=r(8),o.v1.signaling.api.SignalingClient=function(_,v,f){f||(f={}),f.format="text",this.client_=new n.web.GrpcWebClientBase(f),this.hostname_=_},o.v1.signaling.api.SignalingPromiseClient=function(_,v,f){f||(f={}),f.format="text",this.client_=new n.web.GrpcWebClientBase(f),this.hostname_=_};const l=new n.web.MethodDescriptor("/v1.signaling.api.Signaling/CreatePeer",n.web.MethodType.UNARY,o.v1.signaling.api.CreatePeerRequest,o.v1.signaling.api.CreatePeerResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.CreatePeerResponse.deserializeBinary);new n.web.AbstractClientBase.MethodInfo(o.v1.signaling.api.CreatePeerResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.CreatePeerResponse.deserializeBinary),o.v1.signaling.api.SignalingClient.prototype.createPeer=function(_,v,f){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",_,v||{},l,f)},o.v1.signaling.api.SignalingPromiseClient.prototype.createPeer=function(_,v){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",_,v||{},l)};const s=new n.web.MethodDescriptor("/v1.signaling.api.Signaling/DeletePeer",n.web.MethodType.UNARY,o.v1.signaling.api.DeletePeerRequest,o.v1.signaling.api.DeletePeerResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.DeletePeerResponse.deserializeBinary);new n.web.AbstractClientBase.MethodInfo(o.v1.signaling.api.DeletePeerResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.DeletePeerResponse.deserializeBinary),o.v1.signaling.api.SignalingClient.prototype.deletePeer=function(_,v,f){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",_,v||{},s,f)},o.v1.signaling.api.SignalingPromiseClient.prototype.deletePeer=function(_,v){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",_,v||{},s)};const i=new n.web.MethodDescriptor("/v1.signaling.api.Signaling/RefreshPeer",n.web.MethodType.UNARY,o.v1.signaling.api.RefreshPeerRequest,o.v1.signaling.api.RefreshPeerResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.RefreshPeerResponse.deserializeBinary);new n.web.AbstractClientBase.MethodInfo(o.v1.signaling.api.RefreshPeerResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.RefreshPeerResponse.deserializeBinary),o.v1.signaling.api.SignalingClient.prototype.refreshPeer=function(_,v,f){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",_,v||{},i,f)},o.v1.signaling.api.SignalingPromiseClient.prototype.refreshPeer=function(_,v){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",_,v||{},i)};const c=new n.web.MethodDescriptor("/v1.signaling.api.Signaling/GetPeers",n.web.MethodType.UNARY,o.v1.signaling.api.GetPeersRequest,o.v1.signaling.api.GetPeersResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.GetPeersResponse.deserializeBinary);new n.web.AbstractClientBase.MethodInfo(o.v1.signaling.api.GetPeersResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.GetPeersResponse.deserializeBinary),o.v1.signaling.api.SignalingClient.prototype.getPeers=function(_,v,f){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",_,v||{},c,f)},o.v1.signaling.api.SignalingPromiseClient.prototype.getPeers=function(_,v){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",_,v||{},c)};const u=new n.web.MethodDescriptor("/v1.signaling.api.Signaling/GetIceServers",n.web.MethodType.UNARY,o.v1.signaling.api.GetIceServersRequest,o.v1.signaling.api.GetIceServersResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.GetIceServersResponse.deserializeBinary);new n.web.AbstractClientBase.MethodInfo(o.v1.signaling.api.GetIceServersResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.GetIceServersResponse.deserializeBinary),o.v1.signaling.api.SignalingClient.prototype.getIceServers=function(_,v,f){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",_,v||{},u,f)},o.v1.signaling.api.SignalingPromiseClient.prototype.getIceServers=function(_,v){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",_,v||{},u)};const b=new n.web.MethodDescriptor("/v1.signaling.api.Signaling/SendSignal",n.web.MethodType.UNARY,o.v1.signaling.api.SendSignalRequest,o.v1.signaling.api.SendSignalResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.SendSignalResponse.deserializeBinary);new n.web.AbstractClientBase.MethodInfo(o.v1.signaling.api.SendSignalResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.SendSignalResponse.deserializeBinary),o.v1.signaling.api.SignalingClient.prototype.sendSignal=function(_,v,f){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",_,v||{},b,f)},o.v1.signaling.api.SignalingPromiseClient.prototype.sendSignal=function(_,v){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",_,v||{},b)};const A=new n.web.MethodDescriptor("/v1.signaling.api.Signaling/ReceiveSignalStream",n.web.MethodType.SERVER_STREAMING,o.v1.signaling.api.ReceiveSignalStreamRequest,o.v1.signaling.api.ReceiveSignalStreamResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary);new n.web.AbstractClientBase.MethodInfo(o.v1.signaling.api.ReceiveSignalStreamResponse,function(_){return _.serializeBinary()},o.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary),o.v1.signaling.api.SignalingClient.prototype.receiveSignalStream=function(_,v){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",_,v||{},A)},o.v1.signaling.api.SignalingPromiseClient.prototype.receiveSignalStream=function(_,v){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",_,v||{},A)},e.exports=o.v1.signaling.api},function(e,t,r){var n=r(95),o=n,l=Function("return this")();o.exportSymbol("proto.google.protobuf.BoolValue",null,l),o.exportSymbol("proto.google.protobuf.BytesValue",null,l),o.exportSymbol("proto.google.protobuf.DoubleValue",null,l),o.exportSymbol("proto.google.protobuf.FloatValue",null,l),o.exportSymbol("proto.google.protobuf.Int32Value",null,l),o.exportSymbol("proto.google.protobuf.Int64Value",null,l),o.exportSymbol("proto.google.protobuf.StringValue",null,l),o.exportSymbol("proto.google.protobuf.UInt32Value",null,l),o.exportSymbol("proto.google.protobuf.UInt64Value",null,l),proto.google.protobuf.DoubleValue=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.DoubleValue,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.DoubleValue.displayName="proto.google.protobuf.DoubleValue"),proto.google.protobuf.FloatValue=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.FloatValue,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.FloatValue.displayName="proto.google.protobuf.FloatValue"),proto.google.protobuf.Int64Value=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.Int64Value,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int64Value.displayName="proto.google.protobuf.Int64Value"),proto.google.protobuf.UInt64Value=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt64Value,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt64Value.displayName="proto.google.protobuf.UInt64Value"),proto.google.protobuf.Int32Value=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.Int32Value,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int32Value.displayName="proto.google.protobuf.Int32Value"),proto.google.protobuf.UInt32Value=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt32Value,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt32Value.displayName="proto.google.protobuf.UInt32Value"),proto.google.protobuf.BoolValue=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.BoolValue,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BoolValue.displayName="proto.google.protobuf.BoolValue"),proto.google.protobuf.StringValue=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.StringValue,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.StringValue.displayName="proto.google.protobuf.StringValue"),proto.google.protobuf.BytesValue=function(s){n.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.google.protobuf.BytesValue,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BytesValue.displayName="proto.google.protobuf.BytesValue"),n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.DoubleValue.prototype.toObject=function(s){return proto.google.protobuf.DoubleValue.toObject(s,this)},proto.google.protobuf.DoubleValue.toObject=function(s,i){var c={value:n.Message.getFloatingPointFieldWithDefault(i,1,0)};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.DoubleValue.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.DoubleValue;return proto.google.protobuf.DoubleValue.deserializeBinaryFromReader(c,i)},proto.google.protobuf.DoubleValue.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readDouble();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.DoubleValue.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.DoubleValue.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.DoubleValue.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue())!==0&&i.writeDouble(1,c)},proto.google.protobuf.DoubleValue.prototype.getValue=function(){return n.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.DoubleValue.prototype.setValue=function(s){return n.Message.setProto3FloatField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.FloatValue.prototype.toObject=function(s){return proto.google.protobuf.FloatValue.toObject(s,this)},proto.google.protobuf.FloatValue.toObject=function(s,i){var c={value:n.Message.getFloatingPointFieldWithDefault(i,1,0)};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.FloatValue.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.FloatValue;return proto.google.protobuf.FloatValue.deserializeBinaryFromReader(c,i)},proto.google.protobuf.FloatValue.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readFloat();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.FloatValue.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.FloatValue.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.FloatValue.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue())!==0&&i.writeFloat(1,c)},proto.google.protobuf.FloatValue.prototype.getValue=function(){return n.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.FloatValue.prototype.setValue=function(s){return n.Message.setProto3FloatField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int64Value.prototype.toObject=function(s){return proto.google.protobuf.Int64Value.toObject(s,this)},proto.google.protobuf.Int64Value.toObject=function(s,i){var c={value:n.Message.getFieldWithDefault(i,1,0)};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.Int64Value.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.Int64Value;return proto.google.protobuf.Int64Value.deserializeBinaryFromReader(c,i)},proto.google.protobuf.Int64Value.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readInt64();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.Int64Value.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.Int64Value.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.Int64Value.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue())!==0&&i.writeInt64(1,c)},proto.google.protobuf.Int64Value.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int64Value.prototype.setValue=function(s){return n.Message.setProto3IntField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt64Value.prototype.toObject=function(s){return proto.google.protobuf.UInt64Value.toObject(s,this)},proto.google.protobuf.UInt64Value.toObject=function(s,i){var c={value:n.Message.getFieldWithDefault(i,1,0)};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.UInt64Value.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.UInt64Value;return proto.google.protobuf.UInt64Value.deserializeBinaryFromReader(c,i)},proto.google.protobuf.UInt64Value.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readUint64();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.UInt64Value.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.UInt64Value.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.UInt64Value.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue())!==0&&i.writeUint64(1,c)},proto.google.protobuf.UInt64Value.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt64Value.prototype.setValue=function(s){return n.Message.setProto3IntField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int32Value.prototype.toObject=function(s){return proto.google.protobuf.Int32Value.toObject(s,this)},proto.google.protobuf.Int32Value.toObject=function(s,i){var c={value:n.Message.getFieldWithDefault(i,1,0)};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.Int32Value.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.Int32Value;return proto.google.protobuf.Int32Value.deserializeBinaryFromReader(c,i)},proto.google.protobuf.Int32Value.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readInt32();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.Int32Value.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.Int32Value.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.Int32Value.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue())!==0&&i.writeInt32(1,c)},proto.google.protobuf.Int32Value.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int32Value.prototype.setValue=function(s){return n.Message.setProto3IntField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt32Value.prototype.toObject=function(s){return proto.google.protobuf.UInt32Value.toObject(s,this)},proto.google.protobuf.UInt32Value.toObject=function(s,i){var c={value:n.Message.getFieldWithDefault(i,1,0)};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.UInt32Value.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.UInt32Value;return proto.google.protobuf.UInt32Value.deserializeBinaryFromReader(c,i)},proto.google.protobuf.UInt32Value.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readUint32();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.UInt32Value.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.UInt32Value.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.UInt32Value.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue())!==0&&i.writeUint32(1,c)},proto.google.protobuf.UInt32Value.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt32Value.prototype.setValue=function(s){return n.Message.setProto3IntField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BoolValue.prototype.toObject=function(s){return proto.google.protobuf.BoolValue.toObject(s,this)},proto.google.protobuf.BoolValue.toObject=function(s,i){var c={value:n.Message.getBooleanFieldWithDefault(i,1,!1)};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.BoolValue.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.BoolValue;return proto.google.protobuf.BoolValue.deserializeBinaryFromReader(c,i)},proto.google.protobuf.BoolValue.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readBool();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.BoolValue.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.BoolValue.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.BoolValue.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue())&&i.writeBool(1,c)},proto.google.protobuf.BoolValue.prototype.getValue=function(){return n.Message.getBooleanFieldWithDefault(this,1,!1)},proto.google.protobuf.BoolValue.prototype.setValue=function(s){return n.Message.setProto3BooleanField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.StringValue.prototype.toObject=function(s){return proto.google.protobuf.StringValue.toObject(s,this)},proto.google.protobuf.StringValue.toObject=function(s,i){var c={value:n.Message.getFieldWithDefault(i,1,"")};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.StringValue.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.StringValue;return proto.google.protobuf.StringValue.deserializeBinaryFromReader(c,i)},proto.google.protobuf.StringValue.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readString();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.StringValue.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.StringValue.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.StringValue.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue()).length>0&&i.writeString(1,c)},proto.google.protobuf.StringValue.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.StringValue.prototype.setValue=function(s){return n.Message.setProto3StringField(this,1,s)},n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BytesValue.prototype.toObject=function(s){return proto.google.protobuf.BytesValue.toObject(s,this)},proto.google.protobuf.BytesValue.toObject=function(s,i){var c={value:i.getValue_asB64()};return s&&(c.$jspbMessageInstance=i),c}),proto.google.protobuf.BytesValue.deserializeBinary=function(s){var i=new n.BinaryReader(s),c=new proto.google.protobuf.BytesValue;return proto.google.protobuf.BytesValue.deserializeBinaryFromReader(c,i)},proto.google.protobuf.BytesValue.deserializeBinaryFromReader=function(s,i){for(;i.nextField()&&!i.isEndGroup();)switch(i.getFieldNumber()){case 1:var c=i.readBytes();s.setValue(c);break;default:i.skipField()}return s},proto.google.protobuf.BytesValue.prototype.serializeBinary=function(){var s=new n.BinaryWriter;return proto.google.protobuf.BytesValue.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.google.protobuf.BytesValue.serializeBinaryToWriter=function(s,i){var c;(c=s.getValue_asU8()).length>0&&i.writeBytes(1,c)},proto.google.protobuf.BytesValue.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.BytesValue.prototype.getValue_asB64=function(){return n.Message.bytesAsB64(this.getValue())},proto.google.protobuf.BytesValue.prototype.getValue_asU8=function(){return n.Message.bytesAsU8(this.getValue())},proto.google.protobuf.BytesValue.prototype.setValue=function(s){return n.Message.setProto3BytesField(this,1,s)},o.object.extend(t,proto.google.protobuf)},function(module,exports,__webpack_require__){(function(global,Buffer){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,r){e instanceof String&&(e=String(e));for(var n=e.length,o=0;o<n;o++){var l=e[o];if(t.call(r,l,o,e))return{i:o,v:l}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},$jscomp.getGlobal=function(e){return typeof window!="undefined"&&window===e?e:global!==void 0&&global!=null?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,r,n){if(t){for(r=$jscomp.global,e=e.split("."),n=0;n<e.length-1;n++){var o=e[n];o in r||(r[o]={}),r=r[o]}(t=t(n=r[e=e[e.length-1]]))!=n&&t!=null&&$jscomp.defineProperty(r,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",function(e){return e||function(t,r){return $jscomp.findInternal(this,t,r).i}},"es6","es3"),$jscomp.checkStringArgs=function(e,t,r){if(e==null)throw new TypeError("The 'this' value for String.prototype."+r+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+r+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",function(e){return e||function(t,r){var n=$jscomp.checkStringArgs(this,t,"endsWith");t+="",r===void 0&&(r=n.length),r=Math.max(0,Math.min(0|r,n.length));for(var o=t.length;0<o&&0<r;)if(n[--r]!=t[--o])return!1;return 0>=o}},"es6","es3"),$jscomp.polyfill("Array.prototype.find",function(e){return e||function(t,r){return $jscomp.findInternal(this,t,r).v}},"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",function(e){return e||function(t,r){var n=$jscomp.checkStringArgs(this,t,"startsWith");t+="";var o=n.length,l=t.length;r=Math.max(0,Math.min(0|r,n.length));for(var s=0;s<l&&r<o;)if(n[r++]!=t[s++])return!1;return s>=l}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(e){return e||function(t){var r=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var n="";t;)1&t&&(n+=r),(t>>>=1)&&(r+=r);return n}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return e!==void 0},goog.isString=function(e){return typeof e=="string"},goog.isBoolean=function(e){return typeof e=="boolean"},goog.isNumber=function(e){return typeof e=="number"},goog.exportPath_=function(e,t,r){e=e.split("."),r=r||goog.global,e[0]in r||r.execScript===void 0||r.execScript("var "+e[0]);for(var n;e.length&&(n=e.shift());)!e.length&&goog.isDef(t)?r[n]=t:r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}},goog.define=function(e,t){return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(goog.cspNonce_===null&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||e.search(goog.VALID_MODULE_RE_)==-1)throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&typeof e.getCurrentModulePath=="function"&&!!e.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||typeof t.getCurrentModulePath!="function")throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var r=0;r<e.length;r++)if(t=t[e[r]],!goog.isDefAndNotNull(t))return null;return t},goog.globalize=function(e,t){for(var r in t=t||goog.global,e)t[r]=e[r]},goog.addDependency=function(e,t,r,n){},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(goog.hasBadLetScoping==null){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+`
29
29
  ;})();
30
30
  `},goog.loadModule=function(e){var t=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(e))var r=e.call(void 0,{});else{if(!goog.isString(e))throw Error("Invalid module definition");goog.useSafari10Workaround()&&(e=goog.workaroundSafari10EvalBug(e)),r=goog.loadModuleFromSource_.call(void 0,e)}var n=goog.moduleLoaderState_.moduleName;if(!goog.isString(n)||!n)throw Error('Invalid module name "'+n+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(n,r):goog.SEAL_MODULE_EXPORTS&&Object.seal&&typeof r=="object"&&r!=null&&Object.seal(r),goog.loadedModules_[n]={exports:r,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=t}},goog.loadModuleFromSource_=function(a){return eval(a),{}},goog.normalizePath_=function(e){e=e.split("/");for(var t=0;t<e.length;)e[t]=="."?e.splice(t,1):t&&e[t]==".."&&e[t-1]&&e[t-1]!=".."?e.splice(--t,2):t++;return e.join("/")},goog.loadFileSync_=function(e){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(e);try{var t=new goog.global.XMLHttpRequest;return t.open("get",e,!1),t.send(),t.status==0||t.status==200?t.responseText:null}catch{return null}},goog.transpile_=function(e,t,r){var n=goog.global.$jscomp;n||(goog.global.$jscomp=n={});var o=n.transpile;if(!o){var l=goog.basePath+goog.TRANSPILER,s=goog.loadFileSync_(l);if(s){if(function(){(0,eval)(s+`
31
- //# sourceURL=`+l)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(n=goog.global.$jscomp).transpile}}return o||(o=n.transpile=function(i,c){return goog.logToConsole_(c+" requires transpilation but no transpiler was found."),i}),o(e,t,r)},goog.typeOf=function(e){var t=typeof e;if(t=="object"){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var r=Object.prototype.toString.call(e);if(r=="[object Window]")return"object";if(r=="[object Array]"||typeof e.length=="number"&&e.splice!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("splice"))return"array";if(r=="[object Function]"||e.call!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("call"))return"function"}else if(t=="function"&&e.call===void 0)return"object";return t},goog.isNull=function(e){return e===null},goog.isDefAndNotNull=function(e){return e!=null},goog.isArray=function(e){return goog.typeOf(e)=="array"},goog.isArrayLike=function(e){var t=goog.typeOf(e);return t=="array"||t=="object"&&typeof e.length=="number"},goog.isDateLike=function(e){return goog.isObject(e)&&typeof e.getFullYear=="function"},goog.isFunction=function(e){return goog.typeOf(e)=="function"},goog.isObject=function(e){var t=typeof e;return t=="object"&&e!=null||t=="function"},goog.getUid=function(e){return e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){e!==null&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch{}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(typeof e.clone=="function")return e.clone();for(var r in t=t=="array"?[]:{},e)t[r]=goog.cloneObject(e[r]);return t}return e},goog.bindNative_=function(e,t,r){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,r){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,n),e.apply(t,o)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,r){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var r=Array.prototype.slice.call(arguments,1);return function(){var n=r.slice();return n.push.apply(n,arguments),e.apply(this,n)}},goog.mixin=function(e,t){for(var r in t)e[r]=t[r]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(goog.evalWorksForGlobals_==null){try{goog.global.eval("var _evalTest_ = 1;")}catch{}if(goog.global._evalTest_!==void 0){try{delete goog.global._evalTest_}catch{}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,r=t.createElement("SCRIPT");r.type="text/javascript",r.defer=!1,r.appendChild(t.createTextNode(e)),t.head.appendChild(r),t.head.removeChild(r)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if(String(e).charAt(0)==".")throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var r=function(o){return goog.cssNameMapping_[o]||o},n=function(o){o=o.split("-");for(var l=[],s=0;s<o.length;s++)l.push(r(o[s]));return l.join("-")};return n=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?r:n:function(o){return o},e=t?e+"-"+n(t):n(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},goog.getMsg=function(e,t,r){return r&&r.html&&(e=e.replace(/</g,"&lt;")),t&&(e=e.replace(/\{\$([^}]+)}/g,function(n,o){return t!=null&&o in t?t[o]:n})),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,r){goog.exportPath_(e,t,r)},goog.exportProperty=function(e,t,r){e[t]=r},goog.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.base=function(n,o,l){for(var s=Array(arguments.length-2),i=2;i<arguments.length;i++)s[i-2]=arguments[i];return t.prototype[o].apply(n,s)}},goog.base=function(e,t,r){var n=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!n)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(n.superClass_!==void 0){for(var o=Array(arguments.length-1),l=1;l<arguments.length;l++)o[l-1]=arguments[l];return n.superClass_.constructor.apply(e,o)}if(typeof t!="string"&&typeof t!="symbol")throw Error("method names provided to goog.base must be a string or a symbol");for(o=Array(arguments.length-2),l=2;l<arguments.length;l++)o[l-2]=arguments[l];l=!1;for(var s=e.constructor.prototype;s;s=Object.getPrototypeOf(s))if(s[t]===n)l=!0;else if(l)return s[t].apply(e,o);if(e[t]===n)return e.constructor.prototype[t].apply(e,o);throw Error("goog.base called from a method of one name to a method of a different name")},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},goog.defineClass=function(e,t){var r=t.constructor,n=t.statics;return r&&r!=Object.prototype.constructor||(r=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),r=goog.defineClass.createSealingConstructor_(r,e),e&&goog.inherits(r,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(r.prototype,t),n!=null&&(n instanceof Function?n(r):goog.defineClass.applyProperties_(r,n)),r},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var r=!goog.defineClass.isUnsealable_(t),n=function(){var o=e.apply(this,arguments)||this;return o[goog.UID_PROPERTY_]=o[goog.UID_PROPERTY_],this.constructor===n&&r&&Object.seal instanceof Function&&Object.seal(o),o};return n},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);for(var n=0;n<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;n++)r=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[n],Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},goog.tagUnsealableClass=function(e){},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null;if(typeof TrustedTypes=="undefined"||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(r){goog.logToConsole_(r.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null;var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,r=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return r.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return r.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return r.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return r.FIXED32;default:return r.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=9223372036854776e3,jspb.BinaryConstants.TWO_TO_64=18446744073709552e3,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var r="",n=(e=e.split("%s")).length-1,o=0;o<n;o++)r+=e[o]+(o<t.length?t[o]:"%s");return r+e[n]},goog.asserts.doAssertFailure_=function(e,t,r,n){var o="Assertion failed";if(r){o+=": "+r;var l=n}else e&&(o+=": "+e,l=t);e=new goog.asserts.AssertionError(""+o,l||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&e==null&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(e)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(e)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(e)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,r){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,r,n){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],r,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,r){return!goog.asserts.ENABLE_ASSERTS||typeof e=="number"&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):e===null?"null":typeof e},goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.indexOf.call(e,t,r)}:function(e,t,r){if(r=r==null?0:0>r?Math.max(0,e.length+r):r,goog.isString(e))return goog.isString(t)&&t.length==1?e.indexOf(t,r):-1;for(;r<e.length;r++)if(r in e&&e[r]===t)return r;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.lastIndexOf.call(e,t,r==null?e.length-1:r)}:function(e,t,r){if(0>(r=r==null?e.length-1:r)&&(r=Math.max(0,e.length+r)),goog.isString(e))return goog.isString(t)&&t.length==1?e.lastIndexOf(t,r):-1;for(;0<=r;r--)if(r in e&&e[r]===t)return r;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,r){goog.asserts.assert(e.length!=null),Array.prototype.forEach.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)l in o&&t.call(r,o[l],l,e)},goog.array.forEachRight=function(e,t,r){var n=e.length,o=goog.isString(e)?e.split(""):e;for(--n;0<=n;--n)n in o&&t.call(r,o[n],n,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.filter.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=[],l=0,s=goog.isString(e)?e.split(""):e,i=0;i<n;i++)if(i in s){var c=s[i];t.call(r,c,i,e)&&(o[l++]=c)}return o},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.map.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=Array(n),l=goog.isString(e)?e.split(""):e,s=0;s<n;s++)s in l&&(o[s]=t.call(r,l[s],s,e));return o},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,r,n){return goog.asserts.assert(e.length!=null),n&&(t=goog.bind(t,n)),Array.prototype.reduce.call(e,t,r)}:function(e,t,r,n){var o=r;return goog.array.forEach(e,function(l,s){o=t.call(n,o,l,s,e)}),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,r,n){return goog.asserts.assert(e.length!=null),goog.asserts.assert(t!=null),n&&(t=goog.bind(t,n)),Array.prototype.reduceRight.call(e,t,r)}:function(e,t,r,n){var o=r;return goog.array.forEachRight(e,function(l,s){o=t.call(n,o,l,s,e)}),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.some.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)if(l in o&&t.call(r,o[l],l,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.every.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)if(l in o&&!t.call(r,o[l],l,e))return!1;return!0},goog.array.count=function(e,t,r){var n=0;return goog.array.forEach(e,function(o,l,s){t.call(r,o,l,s)&&++n},r),n},goog.array.find=function(e,t,r){return 0>(t=goog.array.findIndex(e,t,r))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)if(l in o&&t.call(r,o[l],l,e))return l;return-1},goog.array.findRight=function(e,t,r){return 0>(t=goog.array.findIndexRight(e,t,r))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,r){var n=e.length,o=goog.isString(e)?e.split(""):e;for(--n;0<=n;n--)if(n in o&&t.call(r,o[n],n,e))return n;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return e.length==0},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,r){goog.array.splice(e,r,0,t)},goog.array.insertArrayAt=function(e,t,r){goog.partial(goog.array.splice,e,r,0).apply(null,t)},goog.array.insertBefore=function(e,t,r){var n;arguments.length==2||0>(n=goog.array.indexOf(e,r))?e.push(t):goog.array.insertAt(e,t,n)},goog.array.remove=function(e,t){var r;return(r=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),r},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(e.length!=null),Array.prototype.splice.call(e,t,1).length==1},goog.array.removeIf=function(e,t,r){return 0<=(t=goog.array.findIndex(e,t,r))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,r){var n=0;return goog.array.forEachRight(e,function(o,l){t.call(r,o,l,e)&&goog.array.removeAt(e,l)&&n++}),n},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var r=Array(t),n=0;n<t;n++)r[n]=e[n];return r}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(goog.isArrayLike(n)){var o=e.length||0,l=n.length||0;e.length=o+l;for(var s=0;s<l;s++)e[o+s]=n[s]}else e.push(n)}},goog.array.splice=function(e,t,r,n){return goog.asserts.assert(e.length!=null),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,r){return goog.asserts.assert(e.length!=null),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)},goog.array.removeDuplicates=function(e,t,r){t=t||e;var n=function(c){return goog.isObject(c)?"o"+goog.getUid(c):(typeof c).charAt(0)+c};r=r||n,n={};for(var o=0,l=0;l<e.length;){var s=e[l++],i=r(s);Object.prototype.hasOwnProperty.call(n,i)||(n[i]=!0,t[o++]=s)}t.length=o},goog.array.binarySearch=function(e,t,r){return goog.array.binarySearch_(e,r||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,r){return goog.array.binarySearch_(e,t,!0,void 0,r)},goog.array.binarySearch_=function(e,t,r,n,o){for(var l,s=0,i=e.length;s<i;){var c=s+i>>1,u=r?t.call(o,e[c],c,e):t(n,e[c]);0<u?s=c+1:(i=c,l=!u)}return l?s:~s},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var r=Array(e.length),n=0;n<e.length;n++)r[n]={index:n,value:e[n]};var o=t||goog.array.defaultCompare;for(goog.array.sort(r,function(l,s){return o(l.value,s.value)||l.index-s.index}),n=0;n<e.length;n++)e[n]=r[n].value},goog.array.sortByKey=function(e,t,r){var n=r||goog.array.defaultCompare;goog.array.sort(e,function(o,l){return n(t(o),t(l))})},goog.array.sortObjectsByKey=function(e,t,r){goog.array.sortByKey(e,function(n){return n[t]},r)},goog.array.isSorted=function(e,t,r){t=t||goog.array.defaultCompare;for(var n=1;n<e.length;n++){var o=t(e[n-1],e[n]);if(0<o||o==0&&r)return!1}return!0},goog.array.equals=function(e,t,r){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var n=e.length;r=r||goog.array.defaultCompareEquality;for(var o=0;o<n;o++)if(!r(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,r){r=r||goog.array.defaultCompare;for(var n=Math.min(e.length,t.length),o=0;o<n;o++){var l=r(e[o],t[o]);if(l!=0)return l}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,r){return 0>(r=goog.array.binarySearch(e,t,r))&&(goog.array.insertAt(e,t,-(r+1)),!0)},goog.array.binaryRemove=function(e,t,r){return 0<=(t=goog.array.binarySearch(e,t,r))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,r){for(var n={},o=0;o<e.length;o++){var l=e[o],s=t.call(r,l,o,e);goog.isDef(s)&&(n[s]||(n[s]=[])).push(l)}return n},goog.array.toObject=function(e,t,r){var n={};return goog.array.forEach(e,function(o,l){n[t.call(r,o,l,e)]=o}),n},goog.array.range=function(e,t,r){var n=[],o=0,l=e;if(t!==void 0&&(o=e,l=t),0>(r=r||1)*(l-o))return[];if(0<r)for(e=o;e<l;e+=r)n.push(e);else for(e=o;e>l;e+=r)n.push(e);return n},goog.array.repeat=function(e,t){for(var r=[],n=0;n<t;n++)r[n]=e;return r},goog.array.flatten=function(e){for(var t=[],r=0;r<arguments.length;r++){var n=arguments[r];if(goog.isArray(n))for(var o=0;o<n.length;o+=8192){var l=goog.array.slice(n,o,o+8192);l=goog.array.flatten.apply(null,l);for(var s=0;s<l.length;s++)t.push(l[s])}else t.push(n)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(e.length!=null),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,r){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=r&&r<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,r,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],r=arguments[0].length,n=1;n<arguments.length;n++)arguments[n].length<r&&(r=arguments[n].length);for(n=0;n<r;n++){for(var o=[],l=0;l<arguments.length;l++)o.push(arguments[l][n]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var r=e.length-1;0<r;r--){var n=Math.floor(t()*(r+1)),o=e[r];e[r]=e[n],e[n]=o}},goog.array.copyByIndex=function(e,t){var r=[];return goog.array.forEach(t,function(n){r.push(e[n])}),r},goog.array.concatMap=function(e,t,r){return goog.array.concat.apply([],goog.array.map(e,t,r))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);255<o&&(t[r++]=255&o,o>>=8),t[r++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",r=0;r<e.length;r+=8192){var n=goog.array.slice(e,r,r+8192);t+=String.fromCharCode.apply(null,n)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,function(r){return 1<(r=r.toString(16)).length?r:"0"+r}).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(e.length%2==0,"Key string length must be multiple of 2");for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);128>o?t[r++]=o:(2048>o?t[r++]=o>>6|192:((64512&o)==55296&&n+1<e.length&&(64512&e.charCodeAt(n+1))==56320?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[r++]=o>>18|240,t[r++]=o>>12&63|128):t[r++]=o>>12|224,t[r++]=o>>6&63|128),t[r++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],r=0,n=0;r<e.length;){var o=e[r++];if(128>o)t[n++]=String.fromCharCode(o);else if(191<o&&224>o){var l=e[r++];t[n++]=String.fromCharCode((31&o)<<6|63&l)}else if(239<o&&365>o){l=e[r++];var s=e[r++];o=((7&o)<<18|(63&l)<<12|(63&s)<<6|63&e[r++])-65536,t[n++]=String.fromCharCode(55296+(o>>10)),t[n++]=String.fromCharCode(56320+(1023&o))}else l=e[r++],s=e[r++],t[n++]=String.fromCharCode((15&o)<<12|(63&l)<<6|63&s)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var r=[],n=0;n<e.length;n++)r.push(e[n]^t[n]);return r},goog.string={},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return e.lastIndexOf(t,0)==0},goog.string.internal.endsWith=function(e,t){var r=e.length-t.length;return 0<=r&&e.indexOf(t,r)==r},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))==0},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))==0},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&amp;").replace(goog.string.internal.LT_RE_,"&lt;").replace(goog.string.internal.GT_RE_,"&gt;").replace(goog.string.internal.QUOT_RE_,"&quot;").replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.internal.NULL_RE_,"&#0;");else{if(!goog.string.internal.ALL_RE_.test(e))return e;e.indexOf("&")!=-1&&(e=e.replace(goog.string.internal.AMP_RE_,"&amp;")),e.indexOf("<")!=-1&&(e=e.replace(goog.string.internal.LT_RE_,"&lt;")),e.indexOf(">")!=-1&&(e=e.replace(goog.string.internal.GT_RE_,"&gt;")),e.indexOf('"')!=-1&&(e=e.replace(goog.string.internal.QUOT_RE_,"&quot;")),e.indexOf("'")!=-1&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;")),e.indexOf("\0")!=-1&&(e=e.replace(goog.string.internal.NULL_RE_,"&#0;"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.internal.contains=function(e,t){return e.indexOf(t)!=-1},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var r=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var n=Math.max(e.length,t.length),o=0;r==0&&o<n;o++){var l=e[o]||"",s=t[o]||"";do{if(l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],l[0].length==0&&s[0].length==0)break;r=l[1].length==0?0:parseInt(l[1],10);var i=s[1].length==0?0:parseInt(s[1],10);r=goog.string.internal.compareElements_(r,i)||goog.string.internal.compareElements_(l[2].length==0,s[2].length==0)||goog.string.internal.compareElements_(l[2],s[2]),l=l[3],s=s[3]}while(r==0)}return r},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"},goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(e!=null)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return goog.fs.url.findUrlObject_()!=null},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||(goog.LOCALE.substring(0,2).toLowerCase()=="ar"||goog.LOCALE.substring(0,2).toLowerCase()=="fa"||goog.LOCALE.substring(0,2).toLowerCase()=="he"||goog.LOCALE.substring(0,2).toLowerCase()=="iw"||goog.LOCALE.substring(0,2).toLowerCase()=="ps"||goog.LOCALE.substring(0,2).toLowerCase()=="sd"||goog.LOCALE.substring(0,2).toLowerCase()=="ug"||goog.LOCALE.substring(0,2).toLowerCase()=="ur"||goog.LOCALE.substring(0,2).toLowerCase()=="yi")&&(goog.LOCALE.length==2||goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")||3<=goog.LOCALE.length&&goog.LOCALE.substring(0,3).toLowerCase()=="ckb"&&(goog.LOCALE.length==3||goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")||7<=goog.LOCALE.length&&(goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")&&(goog.LOCALE.substring(3,7).toLowerCase()=="adlm"||goog.LOCALE.substring(3,7).toLowerCase()=="arab"||goog.LOCALE.substring(3,7).toLowerCase()=="hebr"||goog.LOCALE.substring(3,7).toLowerCase()=="nkoo"||goog.LOCALE.substring(3,7).toLowerCase()=="rohg"||goog.LOCALE.substring(3,7).toLowerCase()=="thaa")||8<=goog.LOCALE.length&&(goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")&&(goog.LOCALE.substring(4,8).toLowerCase()=="adlm"||goog.LOCALE.substring(4,8).toLowerCase()=="arab"||goog.LOCALE.substring(4,8).toLowerCase()=="hebr"||goog.LOCALE.substring(4,8).toLowerCase()=="nkoo"||goog.LOCALE.substring(4,8).toLowerCase()=="rohg"||goog.LOCALE.substring(4,8).toLowerCase()=="thaa"),goog.i18n.bidi.Format={LRE:"\u202A",RLE:"\u202B",PDF:"\u202C",LRM:"\u200E",RLM:"\u200F"},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return typeof e=="number"?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:e==null?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0900-\u1FFF\u200E\u2C00-\uD801\uD804-\uD839\uD83C-\uDBFF\uF900-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",goog.i18n.bidi.rtlChars_="\u0591-\u06EF\u06FA-\u08FF\u200F\uD802-\uD803\uD83A-\uD83B\uFB1D-\uFDFF\uFE70-\uFEFC",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(t===void 0?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=rtl"):`
31
+ //# sourceURL=`+l)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(n=goog.global.$jscomp).transpile}}return o||(o=n.transpile=function(i,c){return goog.logToConsole_(c+" requires transpilation but no transpiler was found."),i}),o(e,t,r)},goog.typeOf=function(e){var t=typeof e;if(t=="object"){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var r=Object.prototype.toString.call(e);if(r=="[object Window]")return"object";if(r=="[object Array]"||typeof e.length=="number"&&e.splice!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("splice"))return"array";if(r=="[object Function]"||e.call!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("call"))return"function"}else if(t=="function"&&e.call===void 0)return"object";return t},goog.isNull=function(e){return e===null},goog.isDefAndNotNull=function(e){return e!=null},goog.isArray=function(e){return goog.typeOf(e)=="array"},goog.isArrayLike=function(e){var t=goog.typeOf(e);return t=="array"||t=="object"&&typeof e.length=="number"},goog.isDateLike=function(e){return goog.isObject(e)&&typeof e.getFullYear=="function"},goog.isFunction=function(e){return goog.typeOf(e)=="function"},goog.isObject=function(e){var t=typeof e;return t=="object"&&e!=null||t=="function"},goog.getUid=function(e){return e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){e!==null&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch{}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(typeof e.clone=="function")return e.clone();for(var r in t=t=="array"?[]:{},e)t[r]=goog.cloneObject(e[r]);return t}return e},goog.bindNative_=function(e,t,r){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,r){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,n),e.apply(t,o)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,r){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var r=Array.prototype.slice.call(arguments,1);return function(){var n=r.slice();return n.push.apply(n,arguments),e.apply(this,n)}},goog.mixin=function(e,t){for(var r in t)e[r]=t[r]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(goog.evalWorksForGlobals_==null){try{goog.global.eval("var _evalTest_ = 1;")}catch{}if(goog.global._evalTest_!==void 0){try{delete goog.global._evalTest_}catch{}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,r=t.createElement("SCRIPT");r.type="text/javascript",r.defer=!1,r.appendChild(t.createTextNode(e)),t.head.appendChild(r),t.head.removeChild(r)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if(String(e).charAt(0)==".")throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var r=function(o){return goog.cssNameMapping_[o]||o},n=function(o){o=o.split("-");for(var l=[],s=0;s<o.length;s++)l.push(r(o[s]));return l.join("-")};return n=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?r:n:function(o){return o},e=t?e+"-"+n(t):n(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},goog.getMsg=function(e,t,r){return r&&r.html&&(e=e.replace(/</g,"&lt;")),t&&(e=e.replace(/\{\$([^}]+)}/g,function(n,o){return t!=null&&o in t?t[o]:n})),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,r){goog.exportPath_(e,t,r)},goog.exportProperty=function(e,t,r){e[t]=r},goog.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.base=function(n,o,l){for(var s=Array(arguments.length-2),i=2;i<arguments.length;i++)s[i-2]=arguments[i];return t.prototype[o].apply(n,s)}},goog.base=function(e,t,r){var n=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!n)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(n.superClass_!==void 0){for(var o=Array(arguments.length-1),l=1;l<arguments.length;l++)o[l-1]=arguments[l];return n.superClass_.constructor.apply(e,o)}if(typeof t!="string"&&typeof t!="symbol")throw Error("method names provided to goog.base must be a string or a symbol");for(o=Array(arguments.length-2),l=2;l<arguments.length;l++)o[l-2]=arguments[l];l=!1;for(var s=e.constructor.prototype;s;s=Object.getPrototypeOf(s))if(s[t]===n)l=!0;else if(l)return s[t].apply(e,o);if(e[t]===n)return e.constructor.prototype[t].apply(e,o);throw Error("goog.base called from a method of one name to a method of a different name")},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},goog.defineClass=function(e,t){var r=t.constructor,n=t.statics;return r&&r!=Object.prototype.constructor||(r=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),r=goog.defineClass.createSealingConstructor_(r,e),e&&goog.inherits(r,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(r.prototype,t),n!=null&&(n instanceof Function?n(r):goog.defineClass.applyProperties_(r,n)),r},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var r=!goog.defineClass.isUnsealable_(t),n=function(){var o=e.apply(this,arguments)||this;return o[goog.UID_PROPERTY_]=o[goog.UID_PROPERTY_],this.constructor===n&&r&&Object.seal instanceof Function&&Object.seal(o),o};return n},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);for(var n=0;n<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;n++)r=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[n],Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},goog.tagUnsealableClass=function(e){},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null;if(typeof TrustedTypes=="undefined"||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(r){goog.logToConsole_(r.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null;var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,r=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return r.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return r.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return r.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return r.FIXED32;default:return r.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=9223372036854776e3,jspb.BinaryConstants.TWO_TO_64=0xffffffffffffffff,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var r="",n=(e=e.split("%s")).length-1,o=0;o<n;o++)r+=e[o]+(o<t.length?t[o]:"%s");return r+e[n]},goog.asserts.doAssertFailure_=function(e,t,r,n){var o="Assertion failed";if(r){o+=": "+r;var l=n}else e&&(o+=": "+e,l=t);e=new goog.asserts.AssertionError(""+o,l||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&e==null&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(e)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(e)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(e)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,r){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,r,n){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],r,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,r){return!goog.asserts.ENABLE_ASSERTS||typeof e=="number"&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):e===null?"null":typeof e},goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.indexOf.call(e,t,r)}:function(e,t,r){if(r=r==null?0:0>r?Math.max(0,e.length+r):r,goog.isString(e))return goog.isString(t)&&t.length==1?e.indexOf(t,r):-1;for(;r<e.length;r++)if(r in e&&e[r]===t)return r;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.lastIndexOf.call(e,t,r==null?e.length-1:r)}:function(e,t,r){if(0>(r=r==null?e.length-1:r)&&(r=Math.max(0,e.length+r)),goog.isString(e))return goog.isString(t)&&t.length==1?e.lastIndexOf(t,r):-1;for(;0<=r;r--)if(r in e&&e[r]===t)return r;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,r){goog.asserts.assert(e.length!=null),Array.prototype.forEach.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)l in o&&t.call(r,o[l],l,e)},goog.array.forEachRight=function(e,t,r){var n=e.length,o=goog.isString(e)?e.split(""):e;for(--n;0<=n;--n)n in o&&t.call(r,o[n],n,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.filter.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=[],l=0,s=goog.isString(e)?e.split(""):e,i=0;i<n;i++)if(i in s){var c=s[i];t.call(r,c,i,e)&&(o[l++]=c)}return o},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.map.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=Array(n),l=goog.isString(e)?e.split(""):e,s=0;s<n;s++)s in l&&(o[s]=t.call(r,l[s],s,e));return o},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,r,n){return goog.asserts.assert(e.length!=null),n&&(t=goog.bind(t,n)),Array.prototype.reduce.call(e,t,r)}:function(e,t,r,n){var o=r;return goog.array.forEach(e,function(l,s){o=t.call(n,o,l,s,e)}),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,r,n){return goog.asserts.assert(e.length!=null),goog.asserts.assert(t!=null),n&&(t=goog.bind(t,n)),Array.prototype.reduceRight.call(e,t,r)}:function(e,t,r,n){var o=r;return goog.array.forEachRight(e,function(l,s){o=t.call(n,o,l,s,e)}),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.some.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)if(l in o&&t.call(r,o[l],l,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,r){return goog.asserts.assert(e.length!=null),Array.prototype.every.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)if(l in o&&!t.call(r,o[l],l,e))return!1;return!0},goog.array.count=function(e,t,r){var n=0;return goog.array.forEach(e,function(o,l,s){t.call(r,o,l,s)&&++n},r),n},goog.array.find=function(e,t,r){return 0>(t=goog.array.findIndex(e,t,r))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,r){for(var n=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<n;l++)if(l in o&&t.call(r,o[l],l,e))return l;return-1},goog.array.findRight=function(e,t,r){return 0>(t=goog.array.findIndexRight(e,t,r))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,r){var n=e.length,o=goog.isString(e)?e.split(""):e;for(--n;0<=n;n--)if(n in o&&t.call(r,o[n],n,e))return n;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return e.length==0},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,r){goog.array.splice(e,r,0,t)},goog.array.insertArrayAt=function(e,t,r){goog.partial(goog.array.splice,e,r,0).apply(null,t)},goog.array.insertBefore=function(e,t,r){var n;arguments.length==2||0>(n=goog.array.indexOf(e,r))?e.push(t):goog.array.insertAt(e,t,n)},goog.array.remove=function(e,t){var r;return(r=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),r},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(e.length!=null),Array.prototype.splice.call(e,t,1).length==1},goog.array.removeIf=function(e,t,r){return 0<=(t=goog.array.findIndex(e,t,r))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,r){var n=0;return goog.array.forEachRight(e,function(o,l){t.call(r,o,l,e)&&goog.array.removeAt(e,l)&&n++}),n},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var r=Array(t),n=0;n<t;n++)r[n]=e[n];return r}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(goog.isArrayLike(n)){var o=e.length||0,l=n.length||0;e.length=o+l;for(var s=0;s<l;s++)e[o+s]=n[s]}else e.push(n)}},goog.array.splice=function(e,t,r,n){return goog.asserts.assert(e.length!=null),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,r){return goog.asserts.assert(e.length!=null),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)},goog.array.removeDuplicates=function(e,t,r){t=t||e;var n=function(c){return goog.isObject(c)?"o"+goog.getUid(c):(typeof c).charAt(0)+c};r=r||n,n={};for(var o=0,l=0;l<e.length;){var s=e[l++],i=r(s);Object.prototype.hasOwnProperty.call(n,i)||(n[i]=!0,t[o++]=s)}t.length=o},goog.array.binarySearch=function(e,t,r){return goog.array.binarySearch_(e,r||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,r){return goog.array.binarySearch_(e,t,!0,void 0,r)},goog.array.binarySearch_=function(e,t,r,n,o){for(var l,s=0,i=e.length;s<i;){var c=s+i>>1,u=r?t.call(o,e[c],c,e):t(n,e[c]);0<u?s=c+1:(i=c,l=!u)}return l?s:~s},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var r=Array(e.length),n=0;n<e.length;n++)r[n]={index:n,value:e[n]};var o=t||goog.array.defaultCompare;for(goog.array.sort(r,function(l,s){return o(l.value,s.value)||l.index-s.index}),n=0;n<e.length;n++)e[n]=r[n].value},goog.array.sortByKey=function(e,t,r){var n=r||goog.array.defaultCompare;goog.array.sort(e,function(o,l){return n(t(o),t(l))})},goog.array.sortObjectsByKey=function(e,t,r){goog.array.sortByKey(e,function(n){return n[t]},r)},goog.array.isSorted=function(e,t,r){t=t||goog.array.defaultCompare;for(var n=1;n<e.length;n++){var o=t(e[n-1],e[n]);if(0<o||o==0&&r)return!1}return!0},goog.array.equals=function(e,t,r){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var n=e.length;r=r||goog.array.defaultCompareEquality;for(var o=0;o<n;o++)if(!r(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,r){r=r||goog.array.defaultCompare;for(var n=Math.min(e.length,t.length),o=0;o<n;o++){var l=r(e[o],t[o]);if(l!=0)return l}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,r){return 0>(r=goog.array.binarySearch(e,t,r))&&(goog.array.insertAt(e,t,-(r+1)),!0)},goog.array.binaryRemove=function(e,t,r){return 0<=(t=goog.array.binarySearch(e,t,r))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,r){for(var n={},o=0;o<e.length;o++){var l=e[o],s=t.call(r,l,o,e);goog.isDef(s)&&(n[s]||(n[s]=[])).push(l)}return n},goog.array.toObject=function(e,t,r){var n={};return goog.array.forEach(e,function(o,l){n[t.call(r,o,l,e)]=o}),n},goog.array.range=function(e,t,r){var n=[],o=0,l=e;if(t!==void 0&&(o=e,l=t),0>(r=r||1)*(l-o))return[];if(0<r)for(e=o;e<l;e+=r)n.push(e);else for(e=o;e>l;e+=r)n.push(e);return n},goog.array.repeat=function(e,t){for(var r=[],n=0;n<t;n++)r[n]=e;return r},goog.array.flatten=function(e){for(var t=[],r=0;r<arguments.length;r++){var n=arguments[r];if(goog.isArray(n))for(var o=0;o<n.length;o+=8192){var l=goog.array.slice(n,o,o+8192);l=goog.array.flatten.apply(null,l);for(var s=0;s<l.length;s++)t.push(l[s])}else t.push(n)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(e.length!=null),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,r){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=r&&r<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,r,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],r=arguments[0].length,n=1;n<arguments.length;n++)arguments[n].length<r&&(r=arguments[n].length);for(n=0;n<r;n++){for(var o=[],l=0;l<arguments.length;l++)o.push(arguments[l][n]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var r=e.length-1;0<r;r--){var n=Math.floor(t()*(r+1)),o=e[r];e[r]=e[n],e[n]=o}},goog.array.copyByIndex=function(e,t){var r=[];return goog.array.forEach(t,function(n){r.push(e[n])}),r},goog.array.concatMap=function(e,t,r){return goog.array.concat.apply([],goog.array.map(e,t,r))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);255<o&&(t[r++]=255&o,o>>=8),t[r++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",r=0;r<e.length;r+=8192){var n=goog.array.slice(e,r,r+8192);t+=String.fromCharCode.apply(null,n)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,function(r){return 1<(r=r.toString(16)).length?r:"0"+r}).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(e.length%2==0,"Key string length must be multiple of 2");for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);128>o?t[r++]=o:(2048>o?t[r++]=o>>6|192:((64512&o)==55296&&n+1<e.length&&(64512&e.charCodeAt(n+1))==56320?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[r++]=o>>18|240,t[r++]=o>>12&63|128):t[r++]=o>>12|224,t[r++]=o>>6&63|128),t[r++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],r=0,n=0;r<e.length;){var o=e[r++];if(128>o)t[n++]=String.fromCharCode(o);else if(191<o&&224>o){var l=e[r++];t[n++]=String.fromCharCode((31&o)<<6|63&l)}else if(239<o&&365>o){l=e[r++];var s=e[r++];o=((7&o)<<18|(63&l)<<12|(63&s)<<6|63&e[r++])-65536,t[n++]=String.fromCharCode(55296+(o>>10)),t[n++]=String.fromCharCode(56320+(1023&o))}else l=e[r++],s=e[r++],t[n++]=String.fromCharCode((15&o)<<12|(63&l)<<6|63&s)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var r=[],n=0;n<e.length;n++)r.push(e[n]^t[n]);return r},goog.string={},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return e.lastIndexOf(t,0)==0},goog.string.internal.endsWith=function(e,t){var r=e.length-t.length;return 0<=r&&e.indexOf(t,r)==r},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))==0},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))==0},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&amp;").replace(goog.string.internal.LT_RE_,"&lt;").replace(goog.string.internal.GT_RE_,"&gt;").replace(goog.string.internal.QUOT_RE_,"&quot;").replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.internal.NULL_RE_,"&#0;");else{if(!goog.string.internal.ALL_RE_.test(e))return e;e.indexOf("&")!=-1&&(e=e.replace(goog.string.internal.AMP_RE_,"&amp;")),e.indexOf("<")!=-1&&(e=e.replace(goog.string.internal.LT_RE_,"&lt;")),e.indexOf(">")!=-1&&(e=e.replace(goog.string.internal.GT_RE_,"&gt;")),e.indexOf('"')!=-1&&(e=e.replace(goog.string.internal.QUOT_RE_,"&quot;")),e.indexOf("'")!=-1&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;")),e.indexOf("\0")!=-1&&(e=e.replace(goog.string.internal.NULL_RE_,"&#0;"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.internal.contains=function(e,t){return e.indexOf(t)!=-1},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var r=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var n=Math.max(e.length,t.length),o=0;r==0&&o<n;o++){var l=e[o]||"",s=t[o]||"";do{if(l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],l[0].length==0&&s[0].length==0)break;r=l[1].length==0?0:parseInt(l[1],10);var i=s[1].length==0?0:parseInt(s[1],10);r=goog.string.internal.compareElements_(r,i)||goog.string.internal.compareElements_(l[2].length==0,s[2].length==0)||goog.string.internal.compareElements_(l[2],s[2]),l=l[3],s=s[3]}while(r==0)}return r},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"},goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(e!=null)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return goog.fs.url.findUrlObject_()!=null},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||(goog.LOCALE.substring(0,2).toLowerCase()=="ar"||goog.LOCALE.substring(0,2).toLowerCase()=="fa"||goog.LOCALE.substring(0,2).toLowerCase()=="he"||goog.LOCALE.substring(0,2).toLowerCase()=="iw"||goog.LOCALE.substring(0,2).toLowerCase()=="ps"||goog.LOCALE.substring(0,2).toLowerCase()=="sd"||goog.LOCALE.substring(0,2).toLowerCase()=="ug"||goog.LOCALE.substring(0,2).toLowerCase()=="ur"||goog.LOCALE.substring(0,2).toLowerCase()=="yi")&&(goog.LOCALE.length==2||goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")||3<=goog.LOCALE.length&&goog.LOCALE.substring(0,3).toLowerCase()=="ckb"&&(goog.LOCALE.length==3||goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")||7<=goog.LOCALE.length&&(goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")&&(goog.LOCALE.substring(3,7).toLowerCase()=="adlm"||goog.LOCALE.substring(3,7).toLowerCase()=="arab"||goog.LOCALE.substring(3,7).toLowerCase()=="hebr"||goog.LOCALE.substring(3,7).toLowerCase()=="nkoo"||goog.LOCALE.substring(3,7).toLowerCase()=="rohg"||goog.LOCALE.substring(3,7).toLowerCase()=="thaa")||8<=goog.LOCALE.length&&(goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")&&(goog.LOCALE.substring(4,8).toLowerCase()=="adlm"||goog.LOCALE.substring(4,8).toLowerCase()=="arab"||goog.LOCALE.substring(4,8).toLowerCase()=="hebr"||goog.LOCALE.substring(4,8).toLowerCase()=="nkoo"||goog.LOCALE.substring(4,8).toLowerCase()=="rohg"||goog.LOCALE.substring(4,8).toLowerCase()=="thaa"),goog.i18n.bidi.Format={LRE:"\u202A",RLE:"\u202B",PDF:"\u202C",LRM:"\u200E",RLM:"\u200F"},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return typeof e=="number"?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:e==null?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0900-\u1FFF\u200E\u2C00-\uD801\uD804-\uD839\uD83C-\uDBFF\uF900-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",goog.i18n.bidi.rtlChars_="\u0591-\u06EF\u06FA-\u08FF\u200F\uD802-\uD803\uD83A-\uD83B\uFB1D-\uFDFF\uFE70-\uFEFC",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(t===void 0?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=rtl"):`
32
32
  <span dir=rtl>`+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=ltr"):`
33
33
  <span dir=ltr>`+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1\u05F4").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1\u05F3")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var r=0,n=0,o=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var l=e[t];goog.i18n.bidi.startsWithRtl(l)?(r++,n++):goog.i18n.bidi.isRequiredLtrRe_.test(l)?o=!0:goog.i18n.bidi.hasAnyLtr(l)?n++:goog.i18n.bidi.hasNumeralsRe_.test(l)&&(o=!0)}return n==0?o?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:r/n>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:e.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:e.dir="rtl";break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var r=goog.html.TrustedResourceUrl.unwrap(this),n=(r=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(r))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(r[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",r[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",n,t))},goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"}),goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl&&e.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.unwrapTrustedURL=function(e){return e.trustedURL_?e.trustedURL_:goog.html.TrustedResourceUrl.unwrap(e)},goog.html.TrustedResourceUrl.format=function(e,t){var r=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(r))throw Error("Invalid TrustedResourceUrl format: "+r);return e=r.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(n,o){if(!Object.prototype.hasOwnProperty.call(t,o))throw Error('Found marker, "'+o+'", in format string, "'+r+'", but no valid label mapping found in args: '+JSON.stringify(t));return(n=t[o])instanceof goog.string.Const?goog.string.Const.unwrap(n):encodeURIComponent(String(n))}),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,r,n){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(r,n)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",r=0;r<e.length;r++)t+=goog.string.Const.unwrap(e[r]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e)),t},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,r){if(r==null)return t;if(goog.isString(r))return r?e+encodeURIComponent(r):"";for(var n in r){var o=r[n];o=goog.isArray(o)?o:[o];for(var l=0;l<o.length;l++){var s=o[l];s!=null&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(n)+"="+encodeURIComponent(String(s)))}}return t},goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"}),goog.html.SafeUrl.unwrap=function(e){return goog.html.SafeUrl.unwrapTrustedURL(e).toString()},goog.html.SafeUrl.unwrapTrustedURL=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl&&e.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\w+=(?:\w+|"[\w;=]+"))*$/i,goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SAFE_MIME_TYPE_PATTERN_.test(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:([^,]*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.fromDataUrl=function(e){var t=(e=e.replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SAFE_MIME_TYPE_PATTERN_.test(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?e:goog.html.SafeUrl.INNOCUOUS_STRING)},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i,goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch{return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,r){return(e=e.exec(t))?(e=e[1],(r instanceof goog.string.Const?[goog.string.Const.unwrap(r)]:r.map(function(n){return goog.string.Const.unwrap(n)})).indexOf(e)==-1&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.sanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e):e,t},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyle.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(e,";"),"Last character of style string is not ';': "+e),goog.asserts.assert(goog.string.internal.contains(e,":"),`Style string must contain at least one ':', to specify a "name: value" pair: `+e),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"}),goog.html.SafeStyle.unwrap=function(e){return e instanceof goog.html.SafeStyle&&e.constructor===goog.html.SafeStyle&&e.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyle().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=e,this},goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez",goog.html.SafeStyle.create=function(e){var t,r="";for(t in e){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var n=e[t];n!=null&&(r+=t+":"+(n=goog.isArray(n)?goog.array.map(n,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(n))+";")}return r?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(r):goog.html.SafeStyle.EMPTY},goog.html.SafeStyle.sanitizePropertyValue_=function(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):goog.html.SafeStyle.sanitizePropertyValueString_(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e},goog.html.SafeStyle.sanitizePropertyValueString_=function(e){var t=e.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");return goog.html.SafeStyle.VALUE_RE_.test(t)?goog.html.SafeStyle.COMMENT_RE_.test(e)?(goog.asserts.fail("String value disallows comments, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):goog.html.SafeStyle.hasBalancedQuotes_(e)?goog.html.SafeStyle.hasBalancedSquareBrackets_(e)?goog.html.SafeStyle.sanitizeUrl_(e):(goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value requires balanced quotes, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING)},goog.html.SafeStyle.hasBalancedQuotes_=function(e){for(var t=!0,r=!0,n=0;n<e.length;n++){var o=e.charAt(n);o=="'"&&r?t=!t:o=='"'&&t&&(r=!r)}return t&&r},goog.html.SafeStyle.hasBalancedSquareBrackets_=function(e){for(var t=!0,r=/^[-_a-zA-Z0-9]$/,n=0;n<e.length;n++){var o=e.charAt(n);if(o=="]"){if(t)return!1;t=!0}else if(o=="["){if(!t)return!1;t=!1}else if(!t&&!r.test(o))return!1}return t},goog.html.SafeStyle.VALUE_ALLOWED_CHARS_=`[-,."'%_!# a-zA-Z0-9\\[\\]]`,goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$"),goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,goog.html.SafeStyle.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,goog.html.SafeStyle.COMMENT_RE_=/\/\*/,goog.html.SafeStyle.sanitizeUrl_=function(e){return e.replace(goog.html.SafeStyle.URL_RE_,function(t,r,n,o){var l="";return n=n.replace(/^(['"])(.*)\1$/,function(s,i,c){return l=i,c}),t=goog.html.SafeUrl.sanitize(n).getTypedStringValue(),r+l+t+l+o})},goog.html.SafeStyle.concat=function(e){var t="",r=function(n){goog.isArray(n)?goog.array.forEach(n,r):t+=goog.html.SafeStyle.unwrap(n)};return goog.array.forEach(arguments,r),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY},goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0,goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeScript.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeScript.fromConstantAndArgs=function(e,t){for(var r=[],n=1;n<arguments.length;n++)r.push(goog.html.SafeScript.stringify_(arguments[n]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(e)+")("+r.join(", ")+");")},goog.html.SafeScript.fromJson=function(e){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(e))},goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"}),goog.html.SafeScript.unwrap=function(e){return goog.html.SafeScript.unwrapTrustedScript(e).toString()},goog.html.SafeScript.unwrapTrustedScript=function(e){return e instanceof goog.html.SafeScript&&e.constructor===goog.html.SafeScript&&e.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},goog.html.SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeScript().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(e):e,this},goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.object={},goog.object.is=function(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t},goog.object.forEach=function(e,t,r){for(var n in e)t.call(r,e[n],n,e)},goog.object.filter=function(e,t,r){var n,o={};for(n in e)t.call(r,e[n],n,e)&&(o[n]=e[n]);return o},goog.object.map=function(e,t,r){var n,o={};for(n in e)o[n]=t.call(r,e[n],n,e);return o},goog.object.some=function(e,t,r){for(var n in e)if(t.call(r,e[n],n,e))return!0;return!1},goog.object.every=function(e,t,r){for(var n in e)if(!t.call(r,e[n],n,e))return!1;return!0},goog.object.getCount=function(e){var t,r=0;for(t in e)r++;return r},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.contains=function(e,t){return goog.object.containsValue(e,t)},goog.object.getValues=function(e){var t,r=[],n=0;for(t in e)r[n++]=e[t];return r},goog.object.getKeys=function(e){var t,r=[],n=0;for(t in e)r[n++]=t;return r},goog.object.getValueByKeys=function(e,t){var r=goog.isArrayLike(t),n=r?t:arguments;for(r=r?0:1;r<n.length;r++){if(e==null)return;e=e[n[r]]}return e},goog.object.containsKey=function(e,t){return e!==null&&t in e},goog.object.containsValue=function(e,t){for(var r in e)if(e[r]==t)return!0;return!1},goog.object.findKey=function(e,t,r){for(var n in e)if(t.call(r,e[n],n,e))return n},goog.object.findValue=function(e,t,r){return(t=goog.object.findKey(e,t,r))&&e[t]},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.remove=function(e,t){var r;return(r=t in e)&&delete e[t],r},goog.object.add=function(e,t,r){if(e!==null&&t in e)throw Error('The object already contains the key "'+t+'"');goog.object.set(e,t,r)},goog.object.get=function(e,t,r){return e!==null&&t in e?e[t]:r},goog.object.set=function(e,t,r){e[t]=r},goog.object.setIfUndefined=function(e,t,r){return t in e?e[t]:e[t]=r},goog.object.setWithReturnValueIfNotSet=function(e,t,r){return t in e?e[t]:(r=r(),e[t]=r)},goog.object.equals=function(e,t){for(var r in e)if(!(r in t)||e[r]!==t[r])return!1;for(var n in t)if(!(n in e))return!1;return!0},goog.object.clone=function(e){var t,r={};for(t in e)r[t]=e[t];return r},goog.object.unsafeClone=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(goog.isFunction(e.clone))return e.clone();for(var r in t=t=="array"?[]:{},e)t[r]=goog.object.unsafeClone(e[r]);return t}return e},goog.object.transpose=function(e){var t,r={};for(t in e)r[e[t]]=t;return r},goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.object.extend=function(e,t){for(var r,n,o=1;o<arguments.length;o++){for(r in n=arguments[o])e[r]=n[r];for(var l=0;l<goog.object.PROTOTYPE_FIELDS_.length;l++)r=goog.object.PROTOTYPE_FIELDS_[l],Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}},goog.object.create=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var r={},n=0;n<t;n+=2)r[arguments[n]]=arguments[n+1];return r},goog.object.createSet=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var r={},n=0;n<t;n++)r[arguments[n]]=!0;return r},goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.getAllPropertyNames=function(e,t,r){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(e);for(var n={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||r);){for(var o=Object.getOwnPropertyNames(e),l=0;l<o.length;l++)n[o[l]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(n)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyleSheet.createRule=function(e,t){if(goog.string.internal.contains(e,"<"))throw Error("Selector does not allow '<', got: "+e);var r=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(r))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(r))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),e=e+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},r=[],n=0;n<e.length;n++){var o=e[n];if(t[o])r.push(t[o]);else if(goog.object.contains(t,o)&&r.pop()!=o)return!1}return r.length==0},goog.html.SafeStyleSheet.concat=function(e){var t="",r=function(n){goog.isArray(n)?goog.array.forEach(n,r):t+=goog.html.SafeStyleSheet.unwrap(n)};return goog.array.forEach(arguments,r),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeStyleSheet.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(e,"<"),"Forbidden '<' character in style sheet string: "+e),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"}),goog.html.SafeStyleSheet.unwrap=function(e){return e instanceof goog.html.SafeStyleSheet&&e.constructor===goog.html.SafeStyleSheet&&e.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyleSheet().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=e,this},goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return goog.dom.tags.VOID_TAGS_[e]===!0},goog.dom.HtmlElement=function(){},goog.dom.TagName=function(e){this.tagName_=e},goog.dom.TagName.prototype.toString=function(){return this.tagName_},goog.dom.TagName.A=new goog.dom.TagName("A"),goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR"),goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM"),goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS"),goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET"),goog.dom.TagName.AREA=new goog.dom.TagName("AREA"),goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE"),goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE"),goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO"),goog.dom.TagName.B=new goog.dom.TagName("B"),goog.dom.TagName.BASE=new goog.dom.TagName("BASE"),goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT"),goog.dom.TagName.BDI=new goog.dom.TagName("BDI"),goog.dom.TagName.BDO=new goog.dom.TagName("BDO"),goog.dom.TagName.BIG=new goog.dom.TagName("BIG"),goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE"),goog.dom.TagName.BODY=new goog.dom.TagName("BODY"),goog.dom.TagName.BR=new goog.dom.TagName("BR"),goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON"),goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS"),goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION"),goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER"),goog.dom.TagName.CITE=new goog.dom.TagName("CITE"),goog.dom.TagName.CODE=new goog.dom.TagName("CODE"),goog.dom.TagName.COL=new goog.dom.TagName("COL"),goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP"),goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND"),goog.dom.TagName.DATA=new goog.dom.TagName("DATA"),goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST"),goog.dom.TagName.DD=new goog.dom.TagName("DD"),goog.dom.TagName.DEL=new goog.dom.TagName("DEL"),goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS"),goog.dom.TagName.DFN=new goog.dom.TagName("DFN"),goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG"),goog.dom.TagName.DIR=new goog.dom.TagName("DIR"),goog.dom.TagName.DIV=new goog.dom.TagName("DIV"),goog.dom.TagName.DL=new goog.dom.TagName("DL"),goog.dom.TagName.DT=new goog.dom.TagName("DT"),goog.dom.TagName.EM=new goog.dom.TagName("EM"),goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED"),goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET"),goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION"),goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE"),goog.dom.TagName.FONT=new goog.dom.TagName("FONT"),goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER"),goog.dom.TagName.FORM=new goog.dom.TagName("FORM"),goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME"),goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET"),goog.dom.TagName.H1=new goog.dom.TagName("H1"),goog.dom.TagName.H2=new goog.dom.TagName("H2"),goog.dom.TagName.H3=new goog.dom.TagName("H3"),goog.dom.TagName.H4=new goog.dom.TagName("H4"),goog.dom.TagName.H5=new goog.dom.TagName("H5"),goog.dom.TagName.H6=new goog.dom.TagName("H6"),goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD"),goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER"),goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP"),goog.dom.TagName.HR=new goog.dom.TagName("HR"),goog.dom.TagName.HTML=new goog.dom.TagName("HTML"),goog.dom.TagName.I=new goog.dom.TagName("I"),goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME"),goog.dom.TagName.IMG=new goog.dom.TagName("IMG"),goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT"),goog.dom.TagName.INS=new goog.dom.TagName("INS"),goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX"),goog.dom.TagName.KBD=new goog.dom.TagName("KBD"),goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN"),goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL"),goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND"),goog.dom.TagName.LI=new goog.dom.TagName("LI"),goog.dom.TagName.LINK=new goog.dom.TagName("LINK"),goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN"),goog.dom.TagName.MAP=new goog.dom.TagName("MAP"),goog.dom.TagName.MARK=new goog.dom.TagName("MARK"),goog.dom.TagName.MATH=new goog.dom.TagName("MATH"),goog.dom.TagName.MENU=new goog.dom.TagName("MENU"),goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM"),goog.dom.TagName.META=new goog.dom.TagName("META"),goog.dom.TagName.METER=new goog.dom.TagName("METER"),goog.dom.TagName.NAV=new goog.dom.TagName("NAV"),goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES"),goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT"),goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT"),goog.dom.TagName.OL=new goog.dom.TagName("OL"),goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP"),goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION"),goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT"),goog.dom.TagName.P=new goog.dom.TagName("P"),goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM"),goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE"),goog.dom.TagName.PRE=new goog.dom.TagName("PRE"),goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS"),goog.dom.TagName.Q=new goog.dom.TagName("Q"),goog.dom.TagName.RP=new goog.dom.TagName("RP"),goog.dom.TagName.RT=new goog.dom.TagName("RT"),goog.dom.TagName.RTC=new goog.dom.TagName("RTC"),goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY"),goog.dom.TagName.S=new goog.dom.TagName("S"),goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP"),goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT"),goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION"),goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT"),goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL"),goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE"),goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN"),goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE"),goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG"),goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE"),goog.dom.TagName.SUB=new goog.dom.TagName("SUB"),goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY"),goog.dom.TagName.SUP=new goog.dom.TagName("SUP"),goog.dom.TagName.SVG=new goog.dom.TagName("SVG"),goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE"),goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY"),goog.dom.TagName.TD=new goog.dom.TagName("TD"),goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE"),goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA"),goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT"),goog.dom.TagName.TH=new goog.dom.TagName("TH"),goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD"),goog.dom.TagName.TIME=new goog.dom.TagName("TIME"),goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE"),goog.dom.TagName.TR=new goog.dom.TagName("TR"),goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK"),goog.dom.TagName.TT=new goog.dom.TagName("TT"),goog.dom.TagName.U=new goog.dom.TagName("U"),goog.dom.TagName.UL=new goog.dom.TagName("UL"),goog.dom.TagName.VAR=new goog.dom.TagName("VAR"),goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO"),goog.dom.TagName.WBR=new goog.dom.TagName("WBR"),goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={},goog.labs.userAgent.util.getNativeUserAgentString_=function(){var e=goog.labs.userAgent.util.getNavigator_();return e&&(e=e.userAgent)?e:""},goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator},goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_(),goog.labs.userAgent.util.setUserAgent=function(e){goog.labs.userAgent.util.userAgent_=e||goog.labs.userAgent.util.getNativeUserAgentString_()},goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_},goog.labs.userAgent.util.matchUserAgent=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,e)},goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,e)},goog.labs.userAgent.util.extractVersionTuples=function(e){for(var t,r=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,n=[];t=r.exec(e);)n.push([t[1],t[2],t[3]||void 0]);return n},goog.labs.userAgent.browser={},goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")},goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")},goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")},goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")},goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))},goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")},goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()},goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())},goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_,goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_,goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_,goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_,goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_,goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_,goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_,goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_,goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_,goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_,goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_,goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")},goog.labs.userAgent.browser.getVersion=function(){function e(o){return o=goog.array.find(o,n),r[o]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var r={};goog.array.forEach(t,function(o){r[o[0]]=o[1]});var n=goog.partial(goog.object.containsKey,r);return goog.labs.userAgent.browser.isOpera()?e(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?e(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?e(["Edg"]):goog.labs.userAgent.browser.isChrome()?e(["Chrome","CriOS"]):(t=t[2])&&t[1]||""},goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),e)},goog.labs.userAgent.browser.getIEVersion_=function(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var r=/MSIE +([\d\.]+)/.exec(e);if(r&&r[1])if(e=/Trident\/(\d.\d)/.exec(e),r[1]=="7.0")if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=r[1];return t},goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null},goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_},goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0,goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"}),goog.html.SafeHtml.unwrap=function(e){return goog.html.SafeHtml.unwrapTrustedHTML(e).toString()},goog.html.SafeHtml.unwrapTrustedHTML=function(e){return e instanceof goog.html.SafeHtml&&e.constructor===goog.html.SafeHtml&&e.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},goog.html.SafeHtml.htmlEscape=function(e){if(e instanceof goog.html.SafeHtml)return e;var t=typeof e=="object",r=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(r=e.getDirection()),e=t&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(e),r)},goog.html.SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape,goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/,goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.html.SafeHtml.create=function(e,t,r){return goog.html.SafeHtml.verifyTagName(String(e)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,r)},goog.html.SafeHtml.verifyTagName=function(e){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(e))throw Error("Invalid tag name <"+e+">.");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+e+"> is not allowed for SafeHtml.")},goog.html.SafeHtml.createIframe=function(e,t,r,n){e&&goog.html.TrustedResourceUrl.unwrap(e);var o={};return o.src=e||null,o.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(o,{sandbox:""},r),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,n)},goog.html.SafeHtml.createSandboxIframe=function(e,t,r,n){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error("The browser does not support sandboxed iframes.");var o={};return o.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,o.srcdoc=t||null,o.sandbox="",e=goog.html.SafeHtml.combineAttributes(o,{},r),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,n)},goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},goog.html.SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=goog.html.SafeHtml.combineAttributes({src:e},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},goog.html.SafeHtml.createScript=function(e,t){for(var r in t){var n=r.toLowerCase();if(n=="language"||n=="src"||n=="text"||n=="type")throw Error('Cannot set "'+n+'" attribute')}for(r="",e=goog.array.concat(e),n=0;n<e.length;n++)r+=goog.html.SafeScript.unwrap(e[n]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},goog.html.SafeHtml.createStyle=function(e,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var r="";e=goog.array.concat(e);for(var n=0;n<e.length;n++)r+=goog.html.SafeStyleSheet.unwrap(e[n]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},goog.html.SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},goog.html.SafeHtml.getAttrNameAndValue_=function(e,t,r){if(r instanceof goog.string.Const)r=goog.string.Const.unwrap(r);else if(t.toLowerCase()=="style")r=goog.html.SafeHtml.getStyleValue_(r);else{if(/^on/i.test(t))throw Error('Attribute "'+t+'" requires goog.string.Const value, "'+r+'" given.');if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(r instanceof goog.html.TrustedResourceUrl)r=goog.html.TrustedResourceUrl.unwrap(r);else if(r instanceof goog.html.SafeUrl)r=goog.html.SafeUrl.unwrap(r);else{if(!goog.isString(r))throw Error('Attribute "'+t+'" on tag "'+e+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+r+'" given.');r=goog.html.SafeUrl.sanitize(r).getTypedStringValue()}}return r.implementsGoogStringTypedString&&(r=r.getTypedStringValue()),goog.asserts.assert(goog.isString(r)||goog.isNumber(r),"String or number value expected, got "+typeof r+" with value: "+r),t+'="'+goog.string.internal.htmlEscape(String(r))+'"'},goog.html.SafeHtml.getStyleValue_=function(e){if(!goog.isObject(e))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof e+" given: "+e);return e instanceof goog.html.SafeStyle||(e=goog.html.SafeStyle.create(e)),goog.html.SafeStyle.unwrap(e)},goog.html.SafeHtml.createWithDir=function(e,t,r,n){return(t=goog.html.SafeHtml.create(t,r,n)).dir_=e,t},goog.html.SafeHtml.join=function(e,t){var r=(e=goog.html.SafeHtml.htmlEscape(e)).getDirection(),n=[],o=function(l){goog.isArray(l)?goog.array.forEach(l,o):(l=goog.html.SafeHtml.htmlEscape(l),n.push(goog.html.SafeHtml.unwrap(l)),l=l.getDirection(),r==goog.i18n.bidi.Dir.NEUTRAL?r=l:l!=goog.i18n.bidi.Dir.NEUTRAL&&r!=l&&(r=null))};return goog.array.forEach(t,o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n.join(goog.html.SafeHtml.unwrap(e)),r)},goog.html.SafeHtml.concat=function(e){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},goog.html.SafeHtml.concatWithDir=function(e,t){var r=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return r.dir_=e,r},goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){return new goog.html.SafeHtml().initSecurityPrivateDoNotAccessOrElse_(e,t)},goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(e):e,this.dir_=t,this},goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,r){var n=null,o="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return goog.isDefAndNotNull(r)?goog.isArray(r)||(r=[r]):r=[],goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!r.length,"Void tag <"+e+"> does not allow content."),o+=">"):(n=goog.html.SafeHtml.concat(r),o+=">"+goog.html.SafeHtml.unwrap(n)+"</"+e+">",n=n.getDirection()),(e=t&&t.dir)&&(n=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(o,n)},goog.html.SafeHtml.stringifyAttributes=function(e,t){var r="";if(t)for(var n in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(n))throw Error('Invalid attribute name "'+n+'".');var o=t[n];goog.isDefAndNotNull(o)&&(r+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,n,o))}return r},goog.html.SafeHtml.combineAttributes=function(e,t,r){var n,o={};for(n in e)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),o[n]=e[n];for(n in t)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),o[n]=t[n];for(n in r){var l=n.toLowerCase();if(l in e)throw Error('Cannot override "'+l+'" attribute, got "'+n+'" with value "'+r[n]+'"');l in t&&delete o[l],o[n]=r[n]}return o},goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,r){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,r||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var r=goog.dom.asserts.getWindow_(e);r&&r[t]!==void 0&&(e&&(e instanceof r[t]||!(e instanceof r.Location||e instanceof r.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return e===void 0?"undefined":e===null?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch{return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,r=t&&(t.defaultView||t.parentWindow);if((r=r||goog.global).Element&&r.Location)return r}catch{}return null},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.identity=function(e,t){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var r=Array.prototype.slice.call(arguments,1);return function(){var n=Array.prototype.slice.call(arguments);return n.push.apply(n,r),e.apply(this,n)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(r){return t?e==r:e===r}},goog.functions.compose=function(e,t){var r=arguments,n=r.length;return function(){var o;n&&(o=r[n-1].apply(this,arguments));for(var l=n-2;0<=l;l--)o=r[l].call(this,o);return o}},goog.functions.sequence=function(e){var t=arguments,r=t.length;return function(){for(var n,o=0;o<r;o++)n=t[o].apply(this,arguments);return n}},goog.functions.and=function(e){var t=arguments,r=t.length;return function(){for(var n=0;n<r;n++)if(!t[n].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,r=t.length;return function(){for(var n=0;n<r;n++)if(t[n].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var r=function(){};return r.prototype=e.prototype,r=new r,e.apply(r,Array.prototype.slice.call(arguments,1)),r},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,r=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(r||(t=e(),r=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var r=t;t=null,r()}}},goog.functions.debounce=function(e,t,r){var n=0;return function(o){goog.global.clearTimeout(n);var l=arguments;n=goog.global.setTimeout(function(){e.apply(r,l)},t)}},goog.functions.throttle=function(e,t,r){var n=0,o=!1,l=[],s=function(){n=0,o&&(o=!1,i())},i=function(){n=goog.global.setTimeout(s,t),e.apply(r,l)};return function(c){l=arguments,n?o=!0:i()}},goog.functions.rateLimit=function(e,t,r){var n=0,o=function(){n=0};return function(l){n||(n=goog.global.setTimeout(o,t),e.apply(r,arguments))}},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,r){e.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(r))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue(function(){if(goog.DEBUG&&typeof document=="undefined")return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild)&&(t=e.firstChild.firstChild,e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),!t.parentElement)}),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var r=e.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[r])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=goog.html.SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(goog.html.SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setImageSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLImageElement(e),!(t instanceof goog.html.SafeUrl)){var r=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setAudioSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLAudioElement(e),!(t instanceof goog.html.SafeUrl)){var r=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setVideoSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLVideoElement(e),!(t instanceof goog.html.SafeUrl)){var r=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,r){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=r,goog.string.internal.caseInsensitiveContains(r,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.replaceLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.openInWindow=function(e,t,r,n,o){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(e),r?goog.string.Const.unwrap(r):"",n,o)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,r){return e.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),r)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:"\xA0"},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var r=e.split("%s"),n="",o=Array.prototype.slice.call(arguments,1);o.length&&1<r.length;)n+=r.shift()+o.shift();return n+r.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return e.length==0},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return e==" "},goog.string.isUnicodeChar=function(e){return e.length==1&&" "<=e&&"~">=e||"\x80"<=e&&"\uFFFD">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,`
34
34
  `)},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,r){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.toLowerCase().match(r),o=t.toLowerCase().match(r),l=Math.min(n.length,o.length),s=0;s<l;s++){r=n[s];var i=o[s];if(r!=i)return e=parseInt(r,10),!isNaN(e)&&(t=parseInt(i,10),!isNaN(t)&&e-t)?e-t:r<i?-1:1}return n.length!=o.length?n.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"&#101;")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var r={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},n=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,function(o,l){var s=r[o];return s||(l.charAt(0)=="#"&&(l=Number("0"+l.substr(1)),isNaN(l)||(s=String.fromCharCode(l))),s||(goog.dom.safe.setInnerHtml(n,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),o+" ")),s=n.firstChild.nodeValue.slice(0,-1)),r[o]=s)})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(t,r){switch(r){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return r.charAt(0)!="#"||(r=Number("0"+r.substr(1)),isNaN(r))?t:String.fromCharCode(r)}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var r=t.length,n=0;n<r;n++){var o=r==1?t:t.charAt(n);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,r){return r&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),r&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,r,n){if(r&&(e=goog.string.unescapeEntities(e)),n&&e.length>t){n>t&&(n=t);var o=e.length-n;e=e.substring(0,t-n)+"..."+e.substring(o)}else e.length>t&&(n=Math.floor(t/2),o=e.length-n,e=e.substring(0,n+t%2)+"..."+e.substring(o));return r&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],r=0;r<e.length;r++){var n=e.charAt(r),o=n.charCodeAt(0);t[r+1]=goog.string.specialEscapeChars_[n]||(31<o&&127>o?n:goog.string.escapeChar(n))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],r=0;r<e.length;r++)t[r]=goog.string.escapeChar(e.charAt(r));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var r=e;else 256>t?(r="\\x",(16>t||256<t)&&(r+="0")):(r="\\u",4096>t&&(r+="0")),r+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=r},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,r){var n=e;return 0<=t&&t<e.length&&0<r&&(n=e.substr(0,t)+e.substr(t+r,e.length-t-r)),n},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,r){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,r.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,r){return(r=(e=goog.isDef(r)?e.toFixed(r):String(e)).indexOf("."))==-1&&(r=e.length),goog.string.repeat("0",Math.max(0,t-r))+e},goog.string.makeSafe=function(e){return e==null?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,r=0;r<e.length;++r)t=31*t+e.charCodeAt(r)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return t==0&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,function(t,r){return r.toUpperCase()})},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(r,n,o){return n+o.toUpperCase()})},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,r){e=e.split(t);for(var n=[];0<r&&e.length;)n.push(e.shift()),r--;return e.length&&n.push(e.join(t)),n},goog.string.lastComponent=function(e,t){if(!t)return e;typeof t=="string"&&(t=[t]);for(var r=-1,n=0;n<t.length;n++)if(t[n]!=""){var o=e.lastIndexOf(t[n]);o>r&&(r=o)}return r==-1?e:e.slice(r+1)},goog.string.editDistance=function(e,t){var r=[],n=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)r[o]=o;for(o=0;o<e.length;o++){n[0]=o+1;for(var l=0;l<t.length;l++)n[l+1]=Math.min(n[l]+1,r[l+1]+1,r[l]+Number(e[o]!=t[l]));for(l=0;l<r.length;l++)r[l]=n[l]}return n[t.length]},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch{}return!1},goog.reflect.cache=function(e,t,r,n){return n=n?n(t):t,Object.prototype.hasOwnProperty.call(e,n)?e[n]:e[n]=r(t)},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,r=goog.labs.userAgent.engine.getEngineTuple_(e);if(r)return r[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):r[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var r=e[t];if(r[0]=="Edge")return r}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,function(r){return t==r[0]}))&&e[1]||""},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_())!=null&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)})},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function",goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function",goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var r=[],n=0;n<e.length;n+=3){var o=e[n],l=n+1<e.length,s=l?e[n+1]:0,i=n+2<e.length,c=i?e[n+2]:0,u=o>>2;o=(3&o)<<4|s>>4,s=(15&s)<<2|c>>6,c&=63,i||(c=64,l||(s=64)),r.push(t[u],t[o],t[s]||"",t[c]||"")}return r.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var r="";return goog.crypt.base64.decodeStringInternal_(e,function(n){r+=String.fromCharCode(n)}),r},goog.crypt.base64.decodeStringToByteArray=function(e,t){var r=[];return goog.crypt.base64.decodeStringInternal_(e,function(n){r.push(n)}),r},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,r=3*t/4;r%3?r=Math.floor(r):goog.crypt.base64.isPadding_(e[t-1])&&(r=goog.crypt.base64.isPadding_(e[t-2])?r-2:r-1);var n=new Uint8Array(r),o=0;return goog.crypt.base64.decodeStringInternal_(e,function(l){n[o++]=l}),n.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function r(c){for(;n<e.length;){var u=e.charAt(n++),b=goog.crypt.base64.charToByteMap_[u];if(b!=null)return b;if(!goog.string.isEmptyOrWhitespace(u))throw Error("Unknown base64 encoding at char: "+u)}return c}goog.crypt.base64.init_();for(var n=0;;){var o=r(-1),l=r(0),s=r(64),i=r(64);if(i===64&&o===-1)break;t(o<<2|l>>4),s!=64&&(t(l<<4&240|s>>2),i!=64&&t(s<<6&192|i))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));goog.crypt.base64.byteToCharMaps_[r]=n;for(var o=0;o<n.length;o++){var l=n[o],s=goog.crypt.base64.charToByteMap_[l];s===void 0?goog.crypt.base64.charToByteMap_[l]=o:goog.asserts.assert(s===o)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,r=(e=Math.abs(e))>>>0;e=Math.floor((e-r)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(r=1+(~r>>>0))&&(r=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=r,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;t&&(e==0?r==0?r=e=4294967295:(r--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=r},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var r=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-r),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|r+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var r=e/Math.pow(2,-1074);e=r/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=r>>>0}else{var n=0;if(2<=(r=e))for(;2<=r&&1023>n;)n++,r/=2;else for(;1>r&&-1022<n;)r*=2,n--;e=(r=e*Math.pow(2,-n))*jspb.BinaryConstants.TWO_TO_20&1048575,r=r*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|n+1023<<20|e)>>>0,jspb.utils.split64Low=r}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),o=e.charCodeAt(3),l=e.charCodeAt(4),s=e.charCodeAt(5),i=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(r<<8)+(n<<16)+(o<<24)>>>0,jspb.utils.split64High=l+(s<<8)+(i<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),r?-e:e},jspb.utils.toZigzag64=function(e,t,r){var n=t>>31;return r(e<<1^n,(t<<1|e>>>31)^n)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,r){var n=-(1&e);return r((e>>>1|t<<31)^n,t>>>1^n)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,r==255?e?NaN:1/0*t:r==0?t*Math.pow(2,-149)*e:t*Math.pow(2,r-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var r=2*(t>>31)+1,n=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,n==2047?e?NaN:1/0*r:n==0?r*Math.pow(2,-1074)*e:r*Math.pow(2,n-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function r(o,l){return o=o?String(o):"",l?"0000000".slice(o.length)+o:o}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+e);var n=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*n+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,1e7<=e&&(n+=Math.floor(e/1e7),e%=1e7),1e7<=n&&(t+=Math.floor(n/1e7),n%=1e7),r(t,0)+r(n,t)+r(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var r=2147483648&t;return r&&(t=~t+((e=1+~e>>>0)==0?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),r?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,r):jspb.utils.joinUnsignedDecimalString(e,r)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var r=Array(e.length),n=0;n<e.length;n++)r[n]=jspb.utils.hash64ToDecimalString(e[n],t);return r},jspb.utils.decimalStringToHash64=function(e){function t(l,s){for(var i=0;8>i&&(l!==1||0<s);i++)s=l*n[i]+s,n[i]=255&s,s>>>=8}goog.asserts.assert(0<e.length);var r=!1;e[0]==="-"&&(r=!0,e=e.slice(1));for(var n=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-jspb.utils.ZERO_CHAR_CODE_);return r&&(function(){for(var l=0;8>l;l++)n[l]=255&~n[l]}(),t(1,1)),goog.crypt.byteArrayToString(n)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var r=0;8>r;r++){var n=e.charCodeAt(7-r);t[2*r+2]=jspb.utils.toHexDigit_(n>>4),t[2*r+3]=jspb.utils.toHexDigit_(15&n)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(e.length==18),goog.asserts.assert(e[0]=="0"),goog.asserts.assert(e[1]=="x");for(var t="",r=0;8>r;r++){var n=jspb.utils.fromHexCharCode_(e.charCodeAt(2*r+2)),o=jspb.utils.fromHexCharCode_(e.charCodeAt(2*r+3));t=String.fromCharCode(16*n+o)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,r):jspb.utils.joinUint64(e,r)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,r){for(var n=0,o=t;o<r;o++)n+=e[o]>>7;return r-t-n},jspb.utils.countVarintFields=function(e,t,r,n){var o=0;if(128>(n=8*n+jspb.BinaryConstants.WireType.VARINT))for(;t<r&&e[t++]==n;)for(o++;;){var l=e[t++];if((128&l)==0)break}else for(;t<r;){for(l=n;128<l;){if(e[t]!=(127&l|128))return o;t++,l>>=7}if(e[t++]!=l)break;for(o++;(128&(l=e[t++]))!=0;);}return o},jspb.utils.countFixedFields_=function(e,t,r,n,o){var l=0;if(128>n)for(;t<r&&e[t++]==n;)l++,t+=o;else for(;t<r;){for(var s=n;128<s;){if(e[t++]!=(127&s|128))return l;s>>=7}if(e[t++]!=s)break;l++,t+=o}return l},jspb.utils.countFixed32Fields=function(e,t,r,n){return jspb.utils.countFixedFields_(e,t,r,8*n+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,r,n){return jspb.utils.countFixedFields_(e,t,r,8*n+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,r,n){var o=0;for(n=8*n+jspb.BinaryConstants.WireType.DELIMITED;t<r;){for(var l=n;128<l;){if(e[t++]!=(127&l|128))return o;l>>=7}if(e[t++]!=l)break;o++;for(var s=0,i=1;s+=(127&(l=e[t++]))*i,i*=128,(128&l)!=0;);t+=s}return o},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var r=0;r<e.length;r++)t+="\\x",16>e[r]&&(t+="0"),t+=e[r].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return typeof e=="string"?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var n=e.charCodeAt(r);if(255<n)throw Error("Conversion error: string contains codepoint outside of byte range");t[r]=n}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||Buffer!==void 0&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,r){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,r)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,r){if(jspb.BinaryDecoder.instanceCache_.length){var n=jspb.BinaryDecoder.instanceCache_.pop();return e&&n.setBlock(e,t,r),n}return new jspb.BinaryDecoder(e,t,r)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,r){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=t!==void 0?t:0,this.end_=r!==void 0?this.start_+r:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,r=0,n=0,o=0;4>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(r|=(127&(t=this.bytes_[this.cursor_++]))<<28,n|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(r>>>0,n>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64(function(t,r){return jspb.utils.fromZigzag64(t,r,e)})},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,r=this.cursor_;this.cursor_+=8;for(var n=0,o=0,l=r+7;l>=r;l--)n=n<<8|t[l],o=o<<8|t[l+4];return e(n,o)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],r=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),r>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),r)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],n=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|r<<16|n<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],n=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|r<<16|n<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,r=this.cursor_;e=r+e;for(var n=[],o="";r<e;){var l=t[r++];if(128>l)n.push(l);else{if(192>l)continue;if(224>l){var s=t[r++];n.push((31&l)<<6|63&s)}else if(240>l){s=t[r++];var i=t[r++];n.push((15&l)<<12|(63&s)<<6|63&i)}else 248>l&&(l=(7&l)<<18|(63&(s=t[r++]))<<12|(63&(i=t[r++]))<<6|63&t[r++],l-=65536,n.push(55296+(l>>10&1023),56320+(1023&l)))}8192<=n.length&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o+=goog.crypt.byteArrayToString(n),this.cursor_=r,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,r=e[t+0],n=e[t+1],o=e[t+2],l=e[t+3],s=e[t+4],i=e[t+5],c=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(r,n,o,l,s,i,c,e)},jspb.BinaryReader=function(e,t,r){this.decoder_=jspb.BinaryDecoder.alloc(e,t,r),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,r){if(jspb.BinaryReader.instanceCache_.length){var n=jspb.BinaryReader.instanceCache_.pop();return e&&n.decoder_.setBlock(e,t,r),n}return new jspb.BinaryReader(e,t,r)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,r){this.decoder_.setBlock(e,t,r),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(this.readCallbacks_!==null),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var r=this.decoder_.getEnd(),n=this.decoder_.readUnsignedVarint32();n=this.decoder_.getCursor()+n,this.decoder_.setEnd(n),t(e,this),this.decoder_.setCursor(n),this.decoder_.setEnd(r)},jspb.BinaryReader.prototype.readGroup=function(e,t,r){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),r(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),r=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(r),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,r){return jspb.utils.fromZigzag64(t,r,e)})},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var r=[];this.decoder_.getCursor()<t;)r.push(e.call(this.decoder_));return r},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],r=t[0];this.map_[r.toString()]=new jspb.Map.Entry_(r,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e].valueWrapper;r&&r.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var n=this.map_[t[e]];(r=n.valueWrapper)&&r.toArray(),this.arr_.push([n.key,n.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var r=this.toArray(),n=[],o=0;o<r.length;o++){var l=this.map_[r[o][0].toString()];this.wrapEntry_(l);var s=l.valueWrapper;s?(goog.asserts.assert(t),n.push([l.key,t(e,s)])):n.push([l.key,l.value])}return n},jspb.Map.fromObject=function(e,t,r){t=new jspb.Map([],t);for(var n=0;n<e.length;n++){var o=e[n][0],l=r(e[n][1]);t.set(o,l)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},typeof Symbol!="undefined"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var n=this.map_[t[r]];e.push([n.key,n.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var n=this.map_[t[r]];e.push([n.key,this.wrapEntry_(n)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)e.push(this.map_[t[r]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)e.push(this.wrapEntry_(this.map_[t[r]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var r=this.stringKeys_();r.sort();for(var n=0;n<r.length;n++){var o=this.map_[r[n]];e.call(t,this.wrapEntry_(o),o.key,this)}},jspb.Map.prototype.set=function(e,t){var r=new jspb.Map.Entry_(e);return this.valueCtor_?(r.valueWrapper=t,r.value=t.toArray()):r.value=t,this.map_[e.toString()]=r,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,r,n,o){var l=this.stringKeys_();l.sort();for(var s=0;s<l.length;s++){var i=this.map_[l[s]];t.beginSubMessage(e),r.call(t,1,i.key),this.valueCtor_?n.call(t,2,this.wrapEntry_(i),o):n.call(t,2,i.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,r,n,o,l,s){for(;t.nextField()&&!t.isEndGroup();){var i=t.getFieldNumber();i==1?l=r.call(t):i==2&&(e.valueCtor_?(goog.asserts.assert(o),s||(s=new e.valueCtor_),n.call(t,s,o)):s=n.call(t))}goog.asserts.assert(l!=null),goog.asserts.assert(s!=null),e.set(l,s)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,r,n,o){this.fieldIndex=e,this.fieldName=t,this.ctor=r,this.toObjectFn=n,this.isRepeated=o},jspb.ExtensionFieldBinaryInfo=function(e,t,r,n,o,l){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=r,this.binaryMessageSerializeFn=n,this.binaryMessageDeserializeFn=o,this.isPacked=l},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function",jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,r,n,o,l){if(e.wrappers_=null,t||(t=r?[r]:[]),e.messageId_=r?String(r):void 0,e.arrayIndexOffset_=r===0?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,n),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=o),o)for(t=0;t<o.length;t++)(r=o[t])<e.pivot_?(r=jspb.Message.getIndex_(e,r),e.array[r]=e.array[r]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[r]=e.extensionObject_[r]||jspb.Message.EMPTY_LIST_SENTINEL_);if(l&&l.length)for(t=0;t<l.length;t++)jspb.Message.computeOneofCase(e,l[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(e===null||typeof e!="object"||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var r=e.array.length,n=-1;if(r&&(n=r-1,r=e.array[n],jspb.Message.isExtensionObject_(r)))return e.pivot_=jspb.Message.getFieldNumber_(e,n),void(e.extensionObject_=r);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,n+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,r){for(var n=[],o=0;o<e.length;o++)n[o]=t.call(e[o],r,e[o]);return n},jspb.Message.toObjectExtension=function(e,t,r,n,o){for(var l in r){var s=r[l],i=n.call(e,s);if(i!=null){for(var c in s.fieldName)if(s.fieldName.hasOwnProperty(c))break;t[c]=s.toObjectFn?s.isRepeated?jspb.Message.toObjectList(i,s.toObjectFn,o):s.toObjectFn(o,i):i}}},jspb.Message.serializeBinaryExtensions=function(e,t,r,n){for(var o in r){var l=r[o],s=l.fieldInfo;if(!l.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var i=n.call(e,s);if(i!=null)if(s.isMessageType()){if(!l.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");l.binaryWriterFn.call(t,s.fieldIndex,i,l.binaryMessageSerializeFn)}else l.binaryWriterFn.call(t,s.fieldIndex,i)}},jspb.Message.readBinaryExtension=function(e,t,r,n,o){var l=r[t.getFieldNumber()];if(l){if(r=l.fieldInfo,!l.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(r.isMessageType()){var s=new r.ctor;l.binaryReaderFn.call(t,s,l.binaryMessageDeserializeFn)}else s=l.binaryReaderFn.call(t);r.isRepeated&&!l.isPacked?(t=n.call(e,r))?t.push(s):o.call(e,r,[s]):o.call(e,r,s)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var r=e.array[t];return r===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:r}if(e.extensionObject_)return(r=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:r},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:+e},jspb.Message.getBooleanField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var r=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var n=0;n<r.length;n++)r[n]=+r[n];e.convertedPrimitiveFields_[t]=!0}return r},jspb.Message.getRepeatedBooleanField=function(e,t){var r=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var n=0;n<r.length;n++)r[n]=!!r[n];e.convertedPrimitiveFields_[t]=!0}return r},jspb.Message.bytesAsB64=function(e){return e==null||typeof e=="string"?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return e==null||e instanceof Uint8Array?e:typeof e=="string"?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&typeof e[0]!="string"?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,function(r){goog.typeOf(r)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(r)+" expected "+t)})}},jspb.Message.getFieldWithDefault=function(e,t,r){return(e=jspb.Message.getField(e,t))==null?r:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,r){return(e=jspb.Message.getBooleanField(e,t))==null?r:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,r){return(e=jspb.Message.getOptionalFloatingPointField(e,t))==null?r:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,r,n){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var o=jspb.Message.getField(e,t);if(!o){if(r)return;o=[],jspb.Message.setField(e,t,o)}return e.wrappers_[t]=new jspb.Map(o,n)},jspb.Message.setField=function(e,t,r){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=r:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=r),e},jspb.Message.setProto3IntField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},jspb.Message.setProto3FloatField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},jspb.Message.setProto3BooleanField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,!1)},jspb.Message.setProto3StringField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"")},jspb.Message.setProto3BytesField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"")},jspb.Message.setProto3EnumField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},jspb.Message.setProto3StringIntField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,r,n){return goog.asserts.assertInstanceof(e,jspb.Message),r!==n?jspb.Message.setField(e,t,r):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,r,n){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),n!=null?t.splice(n,0,r):t.push(r),e},jspb.Message.setOneofField=function(e,t,r,n){return goog.asserts.assertInstanceof(e,jspb.Message),(r=jspb.Message.computeOneofCase(e,r))&&r!==t&&n!==void 0&&(e.wrappers_&&r in e.wrappers_&&(e.wrappers_[r]=void 0),jspb.Message.setField(e,r,void 0)),jspb.Message.setField(e,t,n)},jspb.Message.computeOneofCase=function(e,t){for(var r,n,o=0;o<t.length;o++){var l=t[o],s=jspb.Message.getField(e,l);s!=null&&(r=l,n=s,jspb.Message.setField(e,l,void 0))}return r?(jspb.Message.setField(e,r,n),r):0},jspb.Message.getWrapperField=function(e,t,r,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[r]){var o=jspb.Message.getField(e,r);(n||o)&&(e.wrappers_[r]=new t(o))}return e.wrappers_[r]},jspb.Message.getRepeatedWrapperField=function(e,t,r){return jspb.Message.wrapRepeatedField_(e,t,r),(t=e.wrappers_[r])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[r]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[r]){for(var n=jspb.Message.getRepeatedField(e,r),o=[],l=0;l<n.length;l++)o[l]=new t(n[l]);e.wrappers_[r]=o}},jspb.Message.setWrapperField=function(e,t,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var n=r&&r.toArray();return e.wrappers_[t]=r,jspb.Message.setField(e,t,n)},jspb.Message.setOneofWrapperField=function(e,t,r,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var o=n&&n.toArray();return e.wrappers_[t]=n,jspb.Message.setOneofField(e,t,r,o)},jspb.Message.setRepeatedWrapperField=function(e,t,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),r=r||[];for(var n=[],o=0;o<r.length;o++)n[o]=r[o].toArray();return e.wrappers_[t]=r,jspb.Message.setField(e,t,n)},jspb.Message.addToRepeatedWrapperField=function(e,t,r,n,o){jspb.Message.wrapRepeatedField_(e,n,t);var l=e.wrappers_[t];return l||(l=e.wrappers_[t]=[]),r=r||new n,e=jspb.Message.getRepeatedField(e,t),o!=null?(l.splice(o,0,r),e.splice(o,0,r.toArray())):(l.push(r),e.push(r.toArray())),r},jspb.Message.toMap=function(e,t,r,n){for(var o={},l=0;l<e.length;l++)o[t.call(e[l])]=r?r.call(e[l],n,e[l]):e[l];return o},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&t[r].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(r){return new e.ctor(r)})),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var r=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=goog.array.map(t,function(n){return n.toArray()})):this.extensionObject_[r]=t):e.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=t&&t.toArray()):this.extensionObject_[r]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var r=e.toArray();t=t.toArray();var n=[],o=0,l=r.length>t.length?r.length:t.length;for(e.getJsPbMessageId()&&(n[0]=e.getJsPbMessageId(),o=1);o<l;o++)jspb.Message.compareFields(r[o],t[o])||(n[o]=t[o]);return new e.constructor(n)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var r,n={};for(r in e)n[r]=0;for(r in t)n[r]=0;for(r in n)if(!jspb.Message.compareFields(e[r],t[r]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!(typeof e=="number"&&isNaN(e)||typeof t=="number"&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}if(e.constructor===Array){var n=void 0,o=void 0,l=Math.max(e.length,t.length);for(r=0;r<l;r++){var s=e[r],i=t[r];if(s&&s.constructor==Object&&(goog.asserts.assert(n===void 0),goog.asserts.assert(r===e.length-1),n=s,s=void 0),i&&i.constructor==Object&&(goog.asserts.assert(o===void 0),goog.asserts.assert(r===t.length-1),o=i,i=void 0),!jspb.Message.compareFields(s,i))return!1}return!n&&!o||(n=n||{},o=o||{},jspb.Message.compareExtensions(n,o))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var r=t.toArray(),n=e.toArray(),o=r.length=0;o<n.length;o++)r[o]=n[o];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),r=0;r<e.length;r++){var n=e[r];n!=null&&(t[r]=typeof n=="object"?jspb.Message.clone_(goog.asserts.assert(n)):n)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(r in t={},e)(n=e[r])!=null&&(t[r]=typeof n=="object"?jspb.Message.clone_(goog.asserts.assert(n)):n);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var r=65535&e,n=65535&t,o=t>>>16;for(t=r*n+65536*(r*o&65535)+65536*((e>>>=16)*n&65535),r=e*o+(r*o>>>16)+(e*n>>>16);4294967296<=t;)t-=4294967296,r+=1;return new jspb.arith.UInt64(t>>>0,r>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(e==0)return[];var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var n=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),n=n.leftShift();for(;!n.zero();)0>=e.cmp(r)&&(t=t.add(n),r=r.sub(e)),e=e.rightShift(),n=n.rightShift();return[t,r]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var r=(t=t.div(10))[0];e=t[1].lo+e,t=r}return e==""&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(0,0),n=0;n<e.length;n++){if("0">e[n]||"9"<e[n])return null;var o=parseInt(e[n],10);r.lo=o,t=t.mul(10).add(r)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=(2147483648&this.hi)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&e[0]=="-";return t&&(e=e.substring(1)),(e=jspb.arith.UInt64.fromString(e))===null?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(r,n){t.writeSplitVarint64(r>>>0,n>>>0)})},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(typeof e=="boolean"||typeof e=="number"),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(128>n)this.buffer_.push(n);else if(2048>n)this.buffer_.push(n>>6|192),this.buffer_.push(63&n|128);else if(65536>n)if(55296<=n&&56319>=n&&r+1<e.length){var o=e.charCodeAt(r+1);56320<=o&&57343>=o&&(n=1024*(n-55296)+o-56320+65536,this.buffer_.push(n>>18|240),this.buffer_.push(n>>12&63|128),this.buffer_.push(n>>6&63|128),this.buffer_.push(63&n|128),r++)}else this.buffer_.push(n>>12|224),this.buffer_.push(n>>6&63|128),this.buffer_.push(63&n|128)}return this.buffer_.length-t},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,r){this.appendUint8Array_(e.subarray(t,r))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,r){e!=null&&t!=null&&r!=null&&this.writeSerializedMessage(e,t,r)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,r=t.length,n=0,o=0;o<r;o++){var l=t[o];e.set(l,n),n+=l.length}return t=this.encoder_.end(),e.set(t,n),n+=t.length,goog.asserts.assert(n==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,r){var n=jspb.BinaryConstants.FieldType;switch(e){case n.DOUBLE:this.writeDouble(t,r);break;case n.FLOAT:this.writeFloat(t,r);break;case n.INT64:this.writeInt64(t,r);break;case n.UINT64:this.writeUint64(t,r);break;case n.INT32:this.writeInt32(t,r);break;case n.FIXED64:this.writeFixed64(t,r);break;case n.FIXED32:this.writeFixed32(t,r);break;case n.BOOL:this.writeBool(t,r);break;case n.STRING:this.writeString(t,r);break;case n.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case n.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case n.BYTES:this.writeBytes(t,r);break;case n.UINT32:this.writeUint32(t,r);break;case n.ENUM:this.writeEnum(t,r);break;case n.SFIXED32:this.writeSfixed32(t,r);break;case n.SFIXED64:this.writeSfixed64(t,r);break;case n.SINT32:this.writeSint32(t,r);break;case n.SINT64:this.writeSint64(t,r);break;case n.FHASH64:this.writeFixedHash64(t,r);break;case n.VHASH64:this.writeVarintHash64(t,r);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){t!=null&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){t!=null&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){t!=null&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,r){t!=null&&(e=this.beginDelimited_(e),r(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,r){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),r(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,r){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),r(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,r){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,r)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,r){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,r)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,r){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var n=this.encoder_;jspb.utils.toZigzag64(t,r,function(o,l){n.writeSplitVarint64(o>>>0,l>>>0)})},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSignedVarint32_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeInt32String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSignedVarint64_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,r,n){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,r(t[o]),n(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,r,n){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,r(t[o]),n(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,r,n){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,r(t[o]),n(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeInt64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUnsignedVarint32_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUint32String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUnsignedVarint64_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUint64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint32_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint64_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint64String_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarintHash64_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed32(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed64(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed32(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed64(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFloat(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeDouble(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeBool(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeEnum(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeString(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeBytes(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,r){if(t!=null)for(var n=0;n<t.length;n++){var o=this.beginDelimited_(e);r(t[n],this),this.endDelimited_(o)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,r){if(t!=null)for(var n=0;n<t.length;n++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),r(t[n],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixedHash64(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeVarintHash64(e,t[r])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(parseInt(t[r],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint64(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,r,n){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitFixed64(r(t[o]),n(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,r,n){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(r(t[o]),n(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,r,n){if(t!=null){e=this.beginDelimited_(e);for(var o=this.encoder_,l=0;l<t.length;l++)jspb.utils.toZigzag64(r(t[l]),n(t[l]),function(s,i){o.writeSplitVarint64(s>>>0,i>>>0)});this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++){var n=jspb.arith.Int64.fromString(t[r]);this.encoder_.writeSplitVarint64(n.lo,n.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(parseInt(t[r],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint64(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++){var n=jspb.arith.UInt64.fromString(t[r]);this.encoder_.writeSplitVarint64(n.lo,n.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint32(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint64(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[r]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var r=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(r.lo,r.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeEnum(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeVarintHash64(t[r]);this.endDelimited_(e)}},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf}).call(this,__webpack_require__(5),__webpack_require__(4).Buffer)},function(e,t){var r=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function(){return r(n),n}}else{var o=new Array(16);e.exports=function(){for(var l,s=0;s<16;s++)(3&s)==0&&(l=4294967296*Math.random()),o[s]=l>>>((3&s)<<3)&255;return o}}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(o,l){var s=l||0,i=r;return[i[o[s++]],i[o[s++]],i[o[s++]],i[o[s++]],"-",i[o[s++]],i[o[s++]],"-",i[o[s++]],i[o[s++]],"-",i[o[s++]],i[o[s++]],"-",i[o[s++]],i[o[s++]],i[o[s++]],i[o[s++]],i[o[s++]],i[o[s++]]].join("")}},function(e,t,r){(function(n){const o=r(210),l=r(49),s=(i,c)=>({from:s,EnvVarError:r(49),get:function(u){if(!u)return i;if(arguments.length>1)throw new l("It looks like you passed more than one argument to env.get(). Since env-var@6.0.0 this is no longer supported. To set a default value use env.get(TARGET).default(DEFAULT)");return o(i,u,c||{})}});e.exports=s(n.env)}).call(this,r(2))},function(e,t,r){var n=r(10),o=r(71),l=r(3).LEVEL,s=e.exports=function(){var i=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.call(this,{objectMode:!0,highWaterMark:c.highWaterMark}),this.format=c.format,this.level=c.level,this.handleExceptions=c.handleExceptions,this.silent=c.silent,c.log&&(this.log=c.log),c.logv&&(this.logv=c.logv),c.close&&(this.close=c.close),this.once("pipe",function(u){i.levels=u.levels,i.parent=u}),this.once("unpipe",function(u){u===i.parent&&(i.parent=null,i.close&&i.close())})};n.inherits(s,o),s.prototype._write=function(i,c,u){if(this.silent||i.exception===!0&&!this.handleExceptions)return u(null);var b=this.level||this.parent&&this.parent.level;if(!b||this.levels[b]>=this.levels[i[l]]){if(i&&!this.format)return this.log(i,u);var A=void 0,_=void 0;try{_=this.format.transform(Object.assign({},i),this.format.options)}catch(v){A=v}if(A||!_){if(u(),A)throw A;return}return this.log(_,u)}return u(null)},s.prototype._writev=function(i,c){if(this.logv){var u=i.filter(this._accept,this);return u.length?this.logv(u,c):c(null)}for(var b=0;b<i.length;b++)if(this._accept(i[b]))if(!i[b].chunk||this.format){var A=void 0,_=void 0;try{_=this.format.transform(Object.assign({},i[b].chunk),this.format.options)}catch(v){A=v}if(A||!_){if(i[b].callback(),A)throw c(null),A}else this.log(_,i[b].callback)}else this.log(i[b].chunk,i[b].callback);return c(null)},s.prototype._accept=function(i){var c=i.chunk;if(this.silent)return!1;var u=this.level||this.parent&&this.parent.level;return!(c.exception!==!0&&u&&!(this.levels[u]>=this.levels[c[l]])||!this.handleExceptions&&c.exception===!0)},s.prototype._nop=function(){}},function(e,t,r){const{AbortController:n,AbortSignal:o}=typeof self!="undefined"?self:typeof window!="undefined"?window:void 0;e.exports=n,e.exports.AbortSignal=o,e.exports.default=n},function(e,t){var r=function(n){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}(typeof self!="undefined"?self:this);(function(n){(function(o){var l="URLSearchParams"in n,s="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),c="FormData"in n,u="ArrayBuffer"in n;if(u)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(C){return C&&b.indexOf(Object.prototype.toString.call(C))>-1};function _(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}function v(C){return typeof C!="string"&&(C=String(C)),C}function f(C){var m={next:function(){var x=C.shift();return{done:x===void 0,value:x}}};return s&&(m[Symbol.iterator]=function(){return m}),m}function S(C){this.map={},C instanceof S?C.forEach(function(m,x){this.append(x,m)},this):Array.isArray(C)?C.forEach(function(m){this.append(m[0],m[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(m){this.append(m,C[m])},this)}function w(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function P(C){return new Promise(function(m,x){C.onload=function(){m(C.result)},C.onerror=function(){x(C.error)}})}function N(C){var m=new FileReader,x=P(m);return m.readAsArrayBuffer(C),x}function T(C){if(C.slice)return C.slice(0);var m=new Uint8Array(C.byteLength);return m.set(new Uint8Array(C)),m.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(C){var m;this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:i&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:c&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:l&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():u&&i&&(m=C)&&DataView.prototype.isPrototypeOf(m)?(this._bodyArrayBuffer=T(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(C)||A(C))?this._bodyArrayBuffer=T(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var C=w(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?w(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(N)}),this.text=function(){var C,m,x,F=w(this);if(F)return F;if(this._bodyBlob)return C=this._bodyBlob,m=new FileReader,x=P(m),m.readAsText(C),x;if(this._bodyArrayBuffer)return Promise.resolve(function(D){for(var O=new Uint8Array(D),L=new Array(O.length),k=0;k<O.length;k++)L[k]=String.fromCharCode(O[k]);return L.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c&&(this.formData=function(){return this.text().then(Q)}),this.json=function(){return this.text().then(JSON.parse)},this}S.prototype.append=function(C,m){C=_(C),m=v(m);var x=this.map[C];this.map[C]=x?x+", "+m:m},S.prototype.delete=function(C){delete this.map[_(C)]},S.prototype.get=function(C){return C=_(C),this.has(C)?this.map[C]:null},S.prototype.has=function(C){return this.map.hasOwnProperty(_(C))},S.prototype.set=function(C,m){this.map[_(C)]=v(m)},S.prototype.forEach=function(C,m){for(var x in this.map)this.map.hasOwnProperty(x)&&C.call(m,this.map[x],x,this)},S.prototype.keys=function(){var C=[];return this.forEach(function(m,x){C.push(x)}),f(C)},S.prototype.values=function(){var C=[];return this.forEach(function(m){C.push(m)}),f(C)},S.prototype.entries=function(){var C=[];return this.forEach(function(m,x){C.push([x,m])}),f(C)},s&&(S.prototype[Symbol.iterator]=S.prototype.entries);var d=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function I(C,m){var x,F,D=(m=m||{}).body;if(C instanceof I){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,m.headers||(this.headers=new S(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,D||C._bodyInit==null||(D=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=m.credentials||this.credentials||"same-origin",!m.headers&&this.headers||(this.headers=new S(m.headers)),this.method=(x=m.method||this.method||"GET",F=x.toUpperCase(),d.indexOf(F)>-1?F:x),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}function Q(C){var m=new FormData;return C.trim().split("&").forEach(function(x){if(x){var F=x.split("="),D=F.shift().replace(/\+/g," "),O=F.join("=").replace(/\+/g," ");m.append(decodeURIComponent(D),decodeURIComponent(O))}}),m}function Z(C,m){m||(m={}),this.type="default",this.status=m.status===void 0?200:m.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in m?m.statusText:"OK",this.headers=new S(m.headers),this.url=m.url||"",this._initBody(C)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})},R.call(I.prototype),R.call(Z.prototype),Z.prototype.clone=function(){return new Z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new S(this.headers),url:this.url})},Z.error=function(){var C=new Z(null,{status:0,statusText:""});return C.type="error",C};var h=[301,302,303,307,308];Z.redirect=function(C,m){if(h.indexOf(m)===-1)throw new RangeError("Invalid status code");return new Z(null,{status:m,headers:{location:C}})},o.DOMException=n.DOMException;try{new o.DOMException}catch{o.DOMException=function(m,x){this.message=m,this.name=x;var F=Error(m);this.stack=F.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function p(C,m){return new Promise(function(x,F){var D=new I(C,m);if(D.signal&&D.signal.aborted)return F(new o.DOMException("Aborted","AbortError"));var O=new XMLHttpRequest;function L(){O.abort()}O.onload=function(){var k,E,g={status:O.status,statusText:O.statusText,headers:(k=O.getAllResponseHeaders()||"",E=new S,k.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(B){var G=B.split(":"),Y=G.shift().trim();if(Y){var K=G.join(":").trim();E.append(Y,K)}}),E)};g.url="responseURL"in O?O.responseURL:g.headers.get("X-Request-URL");var U="response"in O?O.response:O.responseText;x(new Z(U,g))},O.onerror=function(){F(new TypeError("Network request failed"))},O.ontimeout=function(){F(new TypeError("Network request failed"))},O.onabort=function(){F(new o.DOMException("Aborted","AbortError"))},O.open(D.method,D.url,!0),D.credentials==="include"?O.withCredentials=!0:D.credentials==="omit"&&(O.withCredentials=!1),"responseType"in O&&i&&(O.responseType="blob"),D.headers.forEach(function(k,E){O.setRequestHeader(E,k)}),D.signal&&(D.signal.addEventListener("abort",L),O.onreadystatechange=function(){O.readyState===4&&D.signal.removeEventListener("abort",L)}),O.send(D._bodyInit===void 0?null:D._bodyInit)})}p.polyfill=!0,n.fetch||(n.fetch=p,n.Headers=S,n.Request=I,n.Response=Z),o.Headers=S,o.Request=I,o.Response=Z,o.fetch=p})({})})(r),delete r.fetch.polyfill,(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},function(e,t,r){(function(n){const o=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,l=typeof AbortController=="function"?AbortController:Object.assign(class{constructor(){this.signal=new l.AbortSignal}abort(){this.signal.dispatchEvent("abort")}},{AbortSignal:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(P){if(P==="abort"){this.aborted=!0;const N={type:P,target:this};this.onabort(N),this._listeners.forEach(T=>T(N),this)}}onabort(){}addEventListener(P,N){P==="abort"&&this._listeners.push(N)}removeEventListener(P,N){P==="abort"&&(this._listeners=this._listeners.filter(T=>T!==N))}}}),s=new Set,i=(P,N)=>{const T=`LRU_CACHE_OPTION_${P}`;b(T)&&A(T,`${P} option`,`options.${N}`,w)},c=(P,N)=>{const T=`LRU_CACHE_METHOD_${P}`;if(b(T)){const{prototype:R}=w,{get:d}=Object.getOwnPropertyDescriptor(R,P);A(T,`${P} method`,`cache.${N}()`,d)}},u=(...P)=>{typeof n=="object"&&n&&typeof n.emitWarning=="function"?n.emitWarning(...P):console.error(...P)},b=P=>!s.has(P),A=(P,N,T,R)=>{s.add(P),u(`The ${N} is deprecated. Please use ${T} instead.`,"DeprecationWarning",P,R)},_=P=>P&&P===Math.floor(P)&&P>0&&isFinite(P),v=P=>_(P)?P<=Math.pow(2,8)?Uint8Array:P<=Math.pow(2,16)?Uint16Array:P<=Math.pow(2,32)?Uint32Array:P<=Number.MAX_SAFE_INTEGER?f:null:null;class f extends Array{constructor(N){super(N),this.fill(0)}}class S{constructor(N){if(N===0)return[];const T=v(N);this.heap=new T(N),this.length=0}push(N){this.heap[this.length++]=N}pop(){return this.heap[--this.length]}}class w{constructor(N={}){const{max:T=0,ttl:R,ttlResolution:d=1,ttlAutopurge:I,updateAgeOnGet:Q,updateAgeOnHas:Z,allowStale:h,dispose:p,disposeAfter:C,noDisposeOnSet:m,noUpdateTTL:x,maxSize:F=0,sizeCalculation:D,fetchMethod:O}=N,{length:L,maxAge:k,stale:E}=N instanceof w?{}:N;if(T!==0&&!_(T))throw new TypeError("max option must be a nonnegative integer");const g=T?v(T):Array;if(!g)throw new Error("invalid max value: "+T);if(this.max=T,this.maxSize=F,this.sizeCalculation=D||L,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=O||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.keyMap=new Map,this.keyList=new Array(T).fill(null),this.valList=new Array(T).fill(null),this.next=new g(T),this.prev=new g(T),this.head=0,this.tail=0,this.free=new S(T),this.initialFill=1,this.size=0,typeof p=="function"&&(this.dispose=p),typeof C=="function"?(this.disposeAfter=C,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!m,this.noUpdateTTL=!!x,this.maxSize!==0){if(!_(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!h||!!E,this.updateAgeOnGet=!!Q,this.updateAgeOnHas=!!Z,this.ttlResolution=_(d)||d===0?d:1,this.ttlAutopurge=!!I,this.ttl=R||k||0,this.ttl){if(!_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const U="LRU_CACHE_UNBOUNDED";b(U)&&(s.add(U),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,w))}E&&i("stale","allowStale"),k&&i("maxAge","ttl"),L&&i("length","sizeCalculation")}getRemainingTTL(N){return this.has(N,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new f(this.max),this.starts=new f(this.max),this.setItemTTL=(R,d)=>{if(this.starts[R]=d!==0?o.now():0,this.ttls[R]=d,d!==0&&this.ttlAutopurge){const I=setTimeout(()=>{this.isStale(R)&&this.delete(this.keyList[R])},d+1);I.unref&&I.unref()}},this.updateItemAge=R=>{this.starts[R]=this.ttls[R]!==0?o.now():0};let N=0;const T=()=>{const R=o.now();if(this.ttlResolution>0){N=R;const d=setTimeout(()=>N=0,this.ttlResolution);d.unref&&d.unref()}return R};this.getRemainingTTL=R=>{const d=this.keyMap.get(R);return d===void 0?0:this.ttls[d]===0||this.starts[d]===0?1/0:this.starts[d]+this.ttls[d]-(N||T())},this.isStale=R=>this.ttls[R]!==0&&this.starts[R]!==0&&(N||T())-this.starts[R]>this.ttls[R]}updateItemAge(N){}setItemTTL(N,T){}isStale(N){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new f(this.max),this.removeItemSize=N=>this.calculatedSize-=this.sizes[N],this.requireSize=(N,T,R,d)=>{if(!_(R)){if(!d)throw new TypeError("invalid size value (must be positive integer)");if(typeof d!="function")throw new TypeError("sizeCalculation must be a function");if(R=d(T,N),!_(R))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return R},this.addItemSize=(N,T,R,d)=>{this.sizes[N]=d;const I=this.maxSize-this.sizes[N];for(;this.calculatedSize>I;)this.evict(!0);this.calculatedSize+=this.sizes[N]}}removeItemSize(N){}addItemSize(N,T,R,d){}requireSize(N,T,R,d){if(R||d)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:N=this.allowStale}={}){if(this.size)for(let T=this.tail;this.isValidIndex(T)&&(!N&&this.isStale(T)||(yield T),T!==this.head);)T=this.prev[T]}*rindexes({allowStale:N=this.allowStale}={}){if(this.size)for(let T=this.head;this.isValidIndex(T)&&(!N&&this.isStale(T)||(yield T),T!==this.tail);)T=this.next[T]}isValidIndex(N){return this.keyMap.get(this.keyList[N])===N}*entries(){for(const N of this.indexes())yield[this.keyList[N],this.valList[N]]}*rentries(){for(const N of this.rindexes())yield[this.keyList[N],this.valList[N]]}*keys(){for(const N of this.indexes())yield this.keyList[N]}*rkeys(){for(const N of this.rindexes())yield this.keyList[N]}*values(){for(const N of this.indexes())yield this.valList[N]}*rvalues(){for(const N of this.rindexes())yield this.valList[N]}[Symbol.iterator](){return this.entries()}find(N,T={}){for(const R of this.indexes())if(N(this.valList[R],this.keyList[R],this))return this.get(this.keyList[R],T)}forEach(N,T=this){for(const R of this.indexes())N.call(T,this.valList[R],this.keyList[R],this)}rforEach(N,T=this){for(const R of this.rindexes())N.call(T,this.valList[R],this.keyList[R],this)}get prune(){return c("prune","purgeStale"),this.purgeStale}purgeStale(){let N=!1;for(const T of this.rindexes({allowStale:!0}))this.isStale(T)&&(this.delete(this.keyList[T]),N=!0);return N}dump(){const N=[];for(const T of this.indexes()){const R=this.keyList[T],d={value:this.valList[T]};this.ttls&&(d.ttl=this.ttls[T]),this.sizes&&(d.size=this.sizes[T]),N.unshift([R,d])}return N}load(N){this.clear();for(const[T,R]of N)this.set(T,R.value,R)}dispose(N,T,R){}set(N,T,{ttl:R=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:I=0,sizeCalculation:Q=this.sizeCalculation,noUpdateTTL:Z=this.noUpdateTTL}={}){I=this.requireSize(N,T,I,Q);let h=this.size===0?void 0:this.keyMap.get(N);if(h===void 0)h=this.newIndex(),this.keyList[h]=N,this.valList[h]=T,this.keyMap.set(N,h),this.next[this.tail]=h,this.prev[h]=this.tail,this.tail=h,this.size++,this.addItemSize(h,T,N,I),Z=!1;else{const p=this.valList[h];T!==p&&(this.isBackgroundFetch(p)?p.__abortController.abort():d||(this.dispose(p,N,"set"),this.disposeAfter&&this.disposed.push([p,N,"set"])),this.removeItemSize(h),this.valList[h]=T,this.addItemSize(h,T,N,I)),this.moveToTail(h)}if(R===0||this.ttl!==0||this.ttls||this.initializeTTLTracking(),Z||this.setItemTTL(h,R),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const N=this.valList[this.head];return this.evict(!0),N}}evict(N){const T=this.head,R=this.keyList[T],d=this.valList[T];return this.isBackgroundFetch(d)?d.__abortController.abort():(this.dispose(d,R,"evict"),this.disposeAfter&&this.disposed.push([d,R,"evict"])),this.removeItemSize(T),N&&(this.keyList[T]=null,this.valList[T]=null,this.free.push(T)),this.head=this.next[T],this.keyMap.delete(R),this.size--,T}has(N,{updateAgeOnHas:T=this.updateAgeOnHas}={}){const R=this.keyMap.get(N);return R!==void 0&&!this.isStale(R)&&(T&&this.updateItemAge(R),!0)}peek(N,{allowStale:T=this.allowStale}={}){const R=this.keyMap.get(N);if(R!==void 0&&(T||!this.isStale(R)))return this.valList[R]}backgroundFetch(N,T,R){const d=T===void 0?void 0:this.valList[T];if(this.isBackgroundFetch(d))return d;const I=new l,Q={signal:I.signal,options:R},Z=Promise.resolve(this.fetchMethod(N,d,Q)).then(h=>(I.signal.aborted||this.set(N,h,Q.options),h));return Z.__abortController=I,Z.__staleWhileFetching=d,T===void 0?(this.set(N,Z,Q.options),T=this.keyMap.get(N)):this.valList[T]=Z,Z}isBackgroundFetch(N){return N&&typeof N=="object"&&typeof N.then=="function"&&Object.prototype.hasOwnProperty.call(N,"__staleWhileFetching")}async fetch(N,{allowStale:T=this.allowStale,updateAgeOnGet:R=this.updateAgeOnGet,ttl:d=this.ttl,noDisposeOnSet:I=this.noDisposeOnSet,size:Q=0,sizeCalculation:Z=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL}={}){if(!this.fetchMethod)return this.get(N,{allowStale:T,updateAgeOnGet:R});const p={allowStale:T,updateAgeOnGet:R,ttl:d,noDisposeOnSet:I,size:Q,sizeCalculation:Z,noUpdateTTL:h};let C=this.keyMap.get(N);if(C===void 0)return this.backgroundFetch(N,C,p);{const m=this.valList[C];if(this.isBackgroundFetch(m))return T&&m.__staleWhileFetching!==void 0?m.__staleWhileFetching:m;if(!this.isStale(C))return this.moveToTail(C),R&&this.updateItemAge(C),m;const x=this.backgroundFetch(N,C,p);return T&&x.__staleWhileFetching!==void 0?x.__staleWhileFetching:x}}get(N,{allowStale:T=this.allowStale,updateAgeOnGet:R=this.updateAgeOnGet}={}){const d=this.keyMap.get(N);if(d!==void 0){const I=this.valList[d],Q=this.isBackgroundFetch(I);return this.isStale(d)?Q?T?I.__staleWhileFetching:void 0:(this.delete(N),T?I:void 0):Q?void 0:(this.moveToTail(d),R&&this.updateItemAge(d),I)}}connect(N,T){this.prev[T]=N,this.next[N]=T}moveToTail(N){N!==this.tail&&(N===this.head?this.head=this.next[N]:this.connect(this.prev[N],this.next[N]),this.connect(this.tail,N),this.tail=N)}get del(){return c("del","delete"),this.delete}delete(N){let T=!1;if(this.size!==0){const R=this.keyMap.get(N);if(R!==void 0)if(T=!0,this.size===1)this.clear();else{this.removeItemSize(R);const d=this.valList[R];this.isBackgroundFetch(d)?d.__abortController.abort():(this.dispose(d,N,"delete"),this.disposeAfter&&this.disposed.push([d,N,"delete"])),this.keyMap.delete(N),this.keyList[R]=null,this.valList[R]=null,R===this.tail?this.tail=this.prev[R]:R===this.head?this.head=this.next[R]:(this.next[this.prev[R]]=this.next[R],this.prev[this.next[R]]=this.prev[R]),this.size--,this.free.push(R)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return T}clear(){for(const N of this.rindexes({allowStale:!0})){const T=this.valList[N];if(this.isBackgroundFetch(T))T.__abortController.abort();else{const R=this.keyList[N];this.dispose(T,R,"delete"),this.disposeAfter&&this.disposed.push([T,R,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return c("reset","clear"),this.clear}get length(){return((N,T)=>{const R=`LRU_CACHE_PROPERTY_${N}`;if(b(R)){const{prototype:d}=w,{get:I}=Object.getOwnPropertyDescriptor(d,N);A(R,`${N} property`,`cache.${T}`,I)}})("length","size"),this.size}static get AbortController(){return l}}e.exports=w}).call(this,r(2))},function(e,t,r){var n=r(223),o=r(224),l=o;l.v1=n,l.v4=o,e.exports=l},function(e,t,r){var n=r(37).Colorizer;e.exports=function(o){return n.addColors(o.colors||o),o}},function(e,t,r){var n={};e.exports=n,n.themes={};var o=r(10),l=n.styles=r(108),s=Object.defineProperties,i=new RegExp(/[\r\n]+/g);n.supportsColor=r(109).supportsColor,n.enabled===void 0&&(n.enabled=n.supportsColor()!==!1),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(w){return(""+w).replace(/\x1B\[\d+m/g,"")},n.stylize=function(w,P){return n.enabled?l[P].open+w+l[P].close:w+""};var c=/[|\\{}()[\]^$+*?.]/g;function u(w){var P=function N(){return v.apply(N,arguments)};return P._styles=w,P.__proto__=_,P}var b,A=(b={},l.grey=l.gray,Object.keys(l).forEach(function(w){l[w].closeRe=new RegExp(function(P){if(typeof P!="string")throw new TypeError("Expected a string");return P.replace(c,"\\$&")}(l[w].close),"g"),b[w]={get:function(){return u(this._styles.concat(w))}}}),b),_=s(function(){},A);function v(){var w=Array.prototype.slice.call(arguments),P=w.map(function(I){return I!==void 0&&I.constructor===String?I:o.inspect(I)}).join(" ");if(!n.enabled||!P)return P;for(var N=P.indexOf(`
@@ -41,4 +41,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
41
41
  `))},s.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,r){function n(l){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s})(l)}function o(l,s){for(var i=0;i<s.length;i++){var c=s[i];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}e.exports=function(){function l(c){if(function(u,b){if(!(u instanceof b))throw new TypeError("Cannot call a class as a function")}(this,l),!c)throw new Error("Logger is required for profiling.");this.logger=c,this.start=Date.now()}var s,i;return s=l,(i=[{key:"done",value:function(){for(var c=arguments.length,u=new Array(c),b=0;b<c;b++)u[b]=arguments[b];typeof u[u.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),u.pop());var A=n(u[u.length-1])==="object"?u.pop():{};return A.level=A.level||"info",A.durationMs=Date.now()-this.start,this.logger.write(A)}}])&&o(s.prototype,i),l}()},function(e,t,r){(function(n){const o=r(208),{MESSAGE:l}=r(3),s=r(30);function i(c,u){return u instanceof n?u.toString("base64"):typeof u=="bigint"?u.toString():u}e.exports=o((c,u={})=>(c[l]=(u.stable?s.stableStringify:s)(c,u.replacer||i,u.space),c))}).call(this,r(4).Buffer)},function(e,t,r){class n extends Error{constructor(l){super(`Format functions must be synchronous taking a two arguments: (info, opts)
42
42
  Found: ${l.toString().split(`
43
43
  `)[0]}
44
- `),Error.captureStackTrace(this,n)}}e.exports=o=>{if(o.length>2)throw new n(o);function l(i={}){this.options=i}function s(i){return new l(i)}return l.prototype.transform=o,s.Format=l,s}},function(e,t,r){function n(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function o(s,i){for(var c=0;c<i.length;c++){var u=i[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(s,u.key,u)}}var l=r(85);e.exports=function(){function s(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(this,s),this.loggers=new Map,this.options=u}var i,c;return i=s,(c=[{key:"add",value:function(u,b){var A=this;if(!this.loggers.has(u)){var _=(b=Object.assign({},b||this.options)).transports||this.options.transports;b.transports=_?_.slice():[];var v=l(b);v.on("close",function(){return A._delete(u)}),this.loggers.set(u,v)}return this.loggers.get(u)}},{key:"get",value:function(u,b){return this.add(u,b)}},{key:"has",value:function(u){return!!this.loggers.has(u)}},{key:"close",value:function(u){var b=this;if(u)return this._removeLogger(u);this.loggers.forEach(function(A,_){return b._removeLogger(_)})}},{key:"_removeLogger",value:function(u){this.loggers.has(u)&&(this.loggers.get(u).close(),this._delete(u))}},{key:"_delete",value:function(u){this.loggers.delete(u)}}])&&o(i.prototype,c),s}()},function(e,t,r){(function(n){const o=r(49),l=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;e.exports=function(s,i,c){let u,b,A=!1,_=!1;function v(w,P){let N=`"${i}" ${P}`;throw w&&(N=`${N}, but is set to "${w}"`),b&&(N=`${N}. An example of a valid value would be: ${b}`),new o(N)}function f(w){return function(){let P=s[i];if(P===void 0)if(u===void 0&&_)v(void 0,"is a required variable, but it was not set");else{if(u===void 0)return;P=u}_&&P.trim().length===0&&v(void 0,"is a required variable, but its value was empty"),A&&(P.match(l)||v(P,"should be a valid base64 string if using convertFromBase64"),P=n.from(P,"base64").toString());const N=[P].concat(Array.prototype.slice.call(arguments));try{return w.apply(w,N)}catch(T){v(P,T.message)}}}const S={asArray:f(r(211)),asBoolStrict:f(r(212)),asBool:f(r(213)),asPortNumber:f(r(214)),asEnum:f(r(215)),asFloatNegative:f(r(216)),asFloatPositive:f(r(217)),asFloat:f(r(51)),asIntNegative:f(r(218)),asIntPositive:f(r(91)),asInt:f(r(50)),asJsonArray:f(r(219)),asJsonObject:f(r(220)),asJson:f(r(52)),asString:f(r(34)),asUrlObject:f(r(92)),asUrlString:f(r(221)),convertFromBase64:function(){return A=!0,S},default:function(w){if(typeof w=="number")u=w.toString();else if(Array.isArray(w)||typeof w=="object"&&w!==null)u=JSON.stringify(w);else{if(typeof w!="string")throw new o("values passed to default() must be of Number, String, Array, or Object type");u=w}return S},required:function(w){return _=w===void 0||w,S},example:function(w){return b=w,S}};return Object.entries(c).forEach(([w,P])=>{S[w]=f(P)}),S}}).call(this,r(4).Buffer)},function(e,t,r){const n=r(34);e.exports=function(o,l){return l=l||",",o.length?n(o).split(l).filter(Boolean):[]}},function(e,t,r){e.exports=function(n){const o=n.toLowerCase();if(o!=="false"&&o!=="true")throw new Error('should be either "true", "false", "TRUE", or "FALSE"');return o!=="false"}},function(e,t,r){e.exports=function(n){const o=n.toLowerCase();if(["false","0","true","1"].indexOf(o)===-1)throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0');return!(o==="0"||o==="false")}},function(e,t,r){const n=r(91);e.exports=function(o){var l=n(o);if(l>65535)throw new Error("cannot assign a port number greater than 65535");return l}},function(e,t,r){const n=r(34);e.exports=function(o,l){const s=n(o);if(l.indexOf(s)<0)throw new Error(`should be one of [${l.join(", ")}]`);return s}},function(e,t,r){const n=r(51);e.exports=function(o){const l=n(o);if(l>0)throw new Error("should be a negative float");return l}},function(e,t,r){const n=r(51);e.exports=function(o){const l=n(o);if(l<0)throw new Error("should be a positive float");return l}},function(e,t,r){const n=r(50);e.exports=function(o){const l=n(o);if(l>0)throw new Error("should be a negative integer");return l}},function(e,t,r){const n=r(52);e.exports=function(o){var l=n(o);if(!Array.isArray(l))throw new Error("should be a parseable JSON Array");return l}},function(e,t,r){const n=r(52);e.exports=function(o){var l=n(o);if(Array.isArray(l))throw new Error("should be a parseable JSON Object");return l}},function(e,t,r){const n=r(92);e.exports=function(o){return n(o).toString()}},function(e,t,r){(function(n){(function(){var o,l,s,i,c,u;typeof performance!="undefined"&&performance!==null&&performance.now?e.exports=function(){return performance.now()}:n!=null&&n.hrtime?(e.exports=function(){return(o()-c)/1e6},l=n.hrtime,i=(o=function(){var b;return 1e9*(b=l())[0]+b[1]})(),u=1e9*n.uptime(),c=i-u):Date.now?(e.exports=function(){return Date.now()-s},s=Date.now()):(e.exports=function(){return new Date().getTime()-s},s=new Date().getTime())}).call(this)}).call(this,r(2))},function(e,t,r){var n,o,l=r(96),s=r(97),i=0,c=0;e.exports=function(u,b,A){var _=b&&A||0,v=b||[],f=(u=u||{}).node||n,S=u.clockseq!==void 0?u.clockseq:o;if(f==null||S==null){var w=l();f==null&&(f=n=[1|w[0],w[1],w[2],w[3],w[4],w[5]]),S==null&&(S=o=16383&(w[6]<<8|w[7]))}var P=u.msecs!==void 0?u.msecs:new Date().getTime(),N=u.nsecs!==void 0?u.nsecs:c+1,T=P-i+(N-c)/1e4;if(T<0&&u.clockseq===void 0&&(S=S+1&16383),(T<0||P>i)&&u.nsecs===void 0&&(N=0),N>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");i=P,c=N,o=S;var R=(1e4*(268435455&(P+=122192928e5))+N)%4294967296;v[_++]=R>>>24&255,v[_++]=R>>>16&255,v[_++]=R>>>8&255,v[_++]=255&R;var d=P/4294967296*1e4&268435455;v[_++]=d>>>8&255,v[_++]=255&d,v[_++]=d>>>24&15|16,v[_++]=d>>>16&255,v[_++]=S>>>8|128,v[_++]=255&S;for(var I=0;I<6;++I)v[_+I]=f[I];return b||s(v)}},function(e,t,r){var n=r(96),o=r(97);e.exports=function(l,s,i){var c=s&&i||0;typeof l=="string"&&(s=l==="binary"?new Array(16):null,l=null);var u=(l=l||{}).random||(l.rng||n)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,s)for(var b=0;b<16;++b)s[c+b]=u[b];return s||o(u)}},function(e,t,r){(function(n){(function(o){function l(i){if((i=i===void 0?"utf-8":i)!=="utf-8")throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+i+"') is invalid.")}function s(i,c){if(c=c===void 0?{fatal:!1}:c,(i=i===void 0?"utf-8":i)!=="utf-8")throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+i+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(o.TextEncoder&&o.TextDecoder)return!1;Object.defineProperty(l.prototype,"encoding",{value:"utf-8"}),l.prototype.encode=function(i,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");c=0;for(var u=i.length,b=0,A=Math.max(32,u+(u>>1)+7),_=new Uint8Array(A>>3<<3);c<u;){var v=i.charCodeAt(c++);if(55296<=v&&56319>=v){if(c<u){var f=i.charCodeAt(c);(64512&f)==56320&&(++c,v=((1023&v)<<10)+(1023&f)+65536)}if(55296<=v&&56319>=v)continue}if(b+4>_.length&&(A+=8,A=(A*=1+c/i.length*2)>>3<<3,(f=new Uint8Array(A)).set(_),_=f),(4294967168&v)==0)_[b++]=v;else{if((4294965248&v)==0)_[b++]=v>>6&31|192;else if((4294901760&v)==0)_[b++]=v>>12&15|224,_[b++]=v>>6&63|128;else{if((4292870144&v)!=0)continue;_[b++]=v>>18&7|240,_[b++]=v>>12&63|128,_[b++]=v>>6&63|128}_[b++]=63&v|128}}return _.slice(0,b)},Object.defineProperty(s.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(s.prototype,"fatal",{value:!1}),Object.defineProperty(s.prototype,"ignoreBOM",{value:!1}),s.prototype.decode=function(i,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");c=0;for(var u=(i=new Uint8Array(i)).length,b=[];c<u;){var A=i[c++];if(A===0)break;if((128&A)==0)b.push(A);else if((224&A)==192){var _=63&i[c++];b.push((31&A)<<6|_)}else if((240&A)==224){_=63&i[c++];var v=63&i[c++];b.push((31&A)<<12|_<<6|v)}else(248&A)==240&&(65535<(A=(7&A)<<18|(_=63&i[c++])<<12|(v=63&i[c++])<<6|63&i[c++])&&(A-=65536,b.push(A>>>10&1023|55296),A=56320|1023&A),b.push(A))}return String.fromCharCode.apply(null,b)},o.TextEncoder=l,o.TextDecoder=s})(typeof window!="undefined"?window:n!==void 0?n:this)}).call(this,r(5))},function(e,t,r){r.r(t),r.d(t,"AuthClient",function(){return l}),r.d(t,"RtcSignalingClient",function(){return i}),r.d(t,"Credentials",function(){return P}),r.d(t,"SignalingPromiseClient",function(){return N.SignalingPromiseClient}),r.d(t,"IRtcClientConfiguration",function(){}),r.d(t,"IRtcConnectConfiguration",function(){}),r.d(t,"IRtcConnectionStatsInfo",function(){}),r.d(t,"IRtcSendConfiguration",function(){}),r.d(t,"IRtcSessionMetricsMessageCounts",function(){}),r.d(t,"IRtcStreamMessage",function(){}),r.d(t,"IStreamControl",function(){}),r.d(t,"RtcClient",function(){return Ee}),r.d(t,"createRtcStreamMessage",function(){return X}),r.d(t,"IRtcStream",function(){}),r.d(t,"IRtcStreamPayload",function(){});var n=r(25),o=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class l extends n.a{adminSignup(q,$){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/admin-signup",{token:$,method:"POST",body:JSON.stringify(q)})})}login(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login",{method:"POST",body:JSON.stringify(q),allowUnsafeRetries:!0})})}loginWithGoogleToken(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login-google",{method:"POST",body:JSON.stringify(q),allowUnsafeRetries:!0})})}refresh(q,$){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/refresh",{method:"POST",body:JSON.stringify({refreshToken:q,tokenExpirationSeconds:$}),allowUnsafeRetries:!0})})}respondToNewPasswordRequiredChallenge(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/respond-to-new-password-required-challenge",{method:"POST",body:JSON.stringify(q)})})}forgotPassword(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/forgot-password",{method:"POST",body:JSON.stringify({email:q})})})}confirmForgotPassword(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/confirm-forgot-password",{method:"POST",body:JSON.stringify(q)})})}resendInvitation(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/resend-invitation",{method:"POST",body:JSON.stringify({email:q})})})}changePassword({token:q,refreshToken:$,currentPassword:te,newPassword:ue}){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/change-password",{token:q,method:"POST",body:JSON.stringify({refreshToken:$,currentPassword:te,newPassword:ue})})})}getDeviceCredentials(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/device-credentials",{token:q,method:"POST",allowUnsafeRetries:!0})})}impersonate(q,$){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/impersonate",{token:q,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({userId:$})})})}createServiceAccount(q,$,te,ue){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/service-account",{token:q,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({name:$,roleId:te,tags:ue})})})}getFeatures(q){return o(this,void 0,void 0,function*(){return(yield this.fetch("auth/features",{token:q})).features})}}var s=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class i extends n.a{createPeer(q,$){return s(this,void 0,void 0,function*(){return yield this.fetch("peers",{token:q,method:"POST",body:JSON.stringify($)})})}getPeers(q){return s(this,void 0,void 0,function*(){return(yield this.fetch("peers",{token:q})).items})}refreshPeer(q,$){return s(this,void 0,void 0,function*(){yield this.fetch(`peers/${$}/refresh`,{token:q,method:"POST",allowUnsafeRetries:!0})})}createSession(q,$){return s(this,void 0,void 0,function*(){return yield this.fetch("sessions",{token:q,method:"POST",body:JSON.stringify($)})})}refreshSession(q,$){return s(this,void 0,void 0,function*(){yield this.fetch(`sessions/${$}/refresh`,{token:q,method:"POST",allowUnsafeRetries:!0})})}deleteSession(q,$){return s(this,void 0,void 0,function*(){yield this.fetch(`sessions/${$}`,{token:q,method:"DELETE",allowUnsafeRetries:!0})})}getSessions(q){return s(this,void 0,void 0,function*(){return(yield this.fetch("sessions",{token:q})).items})}getIceServers(q){return s(this,void 0,void 0,function*(){return(yield this.fetch("ice-servers",{token:q})).items})}addSignals(q,$,te){return s(this,void 0,void 0,function*(){yield this.fetch(`sessions/${$}/add-signals`,{token:q,method:"POST",body:JSON.stringify(te)})})}takeSignals(q,$){return s(this,void 0,void 0,function*(){return(yield this.fetch(`sessions/${$}/take-signals`,{token:q,method:"POST"})).items})}}var c=r(1),u=r(11),b=r(35),A=r.n(b),_=r(102),v=r.n(_),f=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class S extends class{constructor(q){this.cache=new v.a(Object.assign(Object.assign({},q.dispose||q.disposeAfter?{ttlAutopurge:!0}:{}),q)),this.stringify=q.fastStringify?JSON.stringify:A.a}set(q,$,te){const ue=this.stringify(q);if(!this.cache.set(ue,$,{ttl:te})){const ae=this.cache.sizeCalculation?this.cache.sizeCalculation($,ue):"unknown";throw Error(`Value too large (${ae} > ${this.cache.max})`)}}get(q){return this.cache.get(this.stringify(q))}delete(q){this.cache.delete(this.stringify(q))}size(){return this.cache.size}clear(){this.cache.clear()}forEach(q){return this.cache.forEach(q)}}{constructor(q){if(super(q),this.expireRejectedPromiseValues=q.expireRejectedPromiseValues===void 0||q.expireRejectedPromiseValues,this.rejectedPromiseValueTtl=q.rejectedPromiseValueTtl!==void 0?q.rejectedPromiseValueTtl:c.a.second,this.rejectedPromiseValueTtl<0)throw new Error("rejectedPromiseValueTtl must not be negative")}set(q,$,te){const ue=this.stringify(q);this.cache.set(ue,$,{ttl:te}),this.expireRejectedPromiseValues&&Promise.resolve($).catch(()=>f(this,void 0,void 0,function*(){yield Object(u.a)(this.rejectedPromiseValueTtl),this.cache.peek(ue)===$&&this.cache.delete(ue)}))}}var w=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class P{constructor(q,$,te){this.authClient=q,this.email=$,this.password=te,this.tokenTtlMs=1*c.a.hour,this.tokenCache=new S({max:100,ttl:this.tokenTtlMs-5*c.a.minute,fastStringify:!0})}getToken(){return w(this,void 0,void 0,function*(){let q=this.tokenCache.get(this.email);return q||(q=(()=>w(this,void 0,void 0,function*(){const{authentication:$}=yield this.authClient.login({email:this.email,password:this.password,tokenExpirationSeconds:this.tokenTtlMs/c.a.second});if(!$)throw new Error("User account not verified.");return $.accessToken}))(),this.tokenCache.set(this.email,q)),q})}}var N=r(93),T=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};function R(ye){return T(this,void 0,void 0,function*(){return(yield Promise.all(ye.map(q=>q.catch($=>$)))).filter(q=>q instanceof Error)})}function d(ye){if(ye!==void 0)return ye;throw new Error("Value is undefined")}var I=r(0),Q=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};function Z({func:ye,delay:q,immediate:$}){let te=!1,ue=setTimeout(function de(){return Q(this,void 0,void 0,function*(){if(te)return;const me=new Date().getTime();try{ae=ye(),yield ae}finally{if(!te){const pe=new Date().getTime();ue=setTimeout(de,Math.max(q-(pe-me),0))}}})},$?0:q),ae=Promise.resolve();return{stop(){return Q(this,void 0,void 0,function*(){te=!0,clearTimeout(ue),yield ae})}}}function h(ye,q){return Object.keys(ye).reduce(($,te)=>Object.assign(Object.assign({},$),{[te]:q(ye[te])}),{})}var p=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class C{constructor(q){this.message=q}send(q){return p(this,void 0,void 0,function*(){I.a.info(this.message,h(q,$=>{const{sum:te,count:ue}=$,ae=te/ue;return Object.assign(Object.assign({},$),{average:ae})}))})}}var m=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};const x=r(222);var F=r(6);const D=!!F.c,O=new class{constructor(ye=60){this.buffer={},this.metrics={},this.reporters=[],this.flushInterval=Z({func:()=>this.flushStats(),delay:ye*c.a.second})}shutdown(){return m(this,void 0,void 0,function*(){yield this.flushInterval.stop(),yield this.flushStats(),yield Object(u.a)(2*c.a.second)})}aggregate(ye,q){if(this.buffer[ye]){const{min:$,max:te,sum:ue,count:ae}=this.buffer[ye];this.buffer[ye]={min:Math.min($,q),max:Math.max(te,q),sum:ue+q,count:ae+1}}else this.buffer[ye]={min:q,max:q,sum:q,count:1}}increment(ye){this.aggregate(ye,1)}timer(ye,q){return m(this,void 0,void 0,function*(){const $=x(),te=yield q(),ue=x();return this.aggregate(ye,ue-$),te})}metric(ye,q){this.metrics[ye]=q}registerStatsReporter(ye){this.reporters.push(ye)}write(ye){return m(this,void 0,void 0,function*(){if(Object.values(ye).length===0)return;const q=yield R(this.reporters.map($=>$.send(ye)));for(const $ of q)I.a.warn("Failed to write stats",{error:$})})}flushStats(){return m(this,void 0,void 0,function*(){const ye=Object.assign(Object.assign({},this.buffer),h(this.metrics,q=>{const $=q();return{min:$,max:$,sum:$,count:1}}));Object.keys(ye).length>0&&(yield this.write(ye),this.buffer={})})}};D||["local","on-prem"].includes(F.i)||O.registerStatsReporter(new C("stats"));var L=r(8),k=r(21),E=r(103),g=r(36),U=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class B extends g.a{constructor(q){super(q)}postLanRtcOffer(q){return U(this,void 0,void 0,function*(){return yield this.fetch("v1/lan-rtc-offer",{method:"POST",body:JSON.stringify(q)})})}}var G=r(55);const Y={ordered:!1,maxPacketLifeTime:300*c.a.millisecond},K={ordered:!0},H={ordered:!0},V={ordered:!1,maxRetransmits:0},y={ordered:!1,maxRetransmits:0};function j({entityId:ye,streamName:q,streamType:$}){return`${ye}.${q}.${$}`}var W=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class ee{constructor(q,$){this.sessionId=q,this.connection=$,this.counts={localSent:new Map,localReceived:new Map,remoteSent:new Map,remoteReceived:new Map},this.sessionId=q,this.connection=$}updateRemoteMessagesCounts(q){if(q.payload.streamsInfo){this.counts.remoteSent=new Map,this.counts.remoteReceived=new Map;for(const $ of q.payload.streamsInfo.items)this.counts.remoteSent.set($.streamId,$.sentCount),this.counts.remoteReceived.set($.streamId,$.receivedCount)}}getLocalStreamsInfo(q){const{localSent:$,localReceived:te}=this.counts;return{items:[...new Set([...$.keys(),...te.keys()])].map(ue=>{var ae,de;return{streamId:ue,sentCount:(ae=$.get(ue))!==null&&ae!==void 0?ae:0,receivedCount:(de=te.get(ue))!==null&&de!==void 0?de:0}}),timestamp:q}}incrementLocalSent(q){const{localSent:$}=this.counts,te=j(q.header.stream);$.set(te,($.get(te)||0)+1)}incrementLocalReceived(q){const{localReceived:$}=this.counts,te=j(q.header.stream),ue=$.get(te)||0;if(ue===0){const{streamName:ae,streamType:de}=q.header.stream;I.a.debug("RTC client received first message for stream",{streamName:ae,streamType:de})}$.set(te,ue+1)}uploadMetrics(){return W(this,void 0,void 0,function*(){const{sessionId:q}=this,$=yield this.connection.peerConnection.getStats(),te={};$.forEach(ge=>te[ge.id]=ge),I.a.debug("rtc-stats",Object.assign(Object.assign({},te),{sessionId:q}));const{localSent:ue,localReceived:ae,remoteSent:de,remoteReceived:me}=this.counts,pe=[...new Set([...ue.keys(),...ae.keys()])].reduce((ge,ce)=>{const Te=ue.get(ce),Re=ae.get(ce),Pe=de.get(ce),Le=me.get(ce);return Object.assign(Object.assign({},ge),{[`local-${ce}-sent`]:Te,[`local-${ce}-received`]:Re,[`remote-${ce}-sent`]:Pe,[`remote-${ce}-received`]:Le})},{sessionId:q});I.a.debug("rtc-message-report",Object.assign({deviceId:this.connection.getRemoteDeviceId()},pe))})}}function X(ye,q){return{header:{stream:ye,created:Date.now(),frameId:""},payload:q}}function ne(ye){return new Set(["disconnected","failed","closed"]).has(ye.iceConnectionState)}var ie=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class he{constructor(q,$,te){this.peerConnection=q,this.config=$,this.dataChannelNotifier=te,this.connectTimeoutMs=20*c.a.second,this.iceGatheringTimeoutMs=15*c.a.second,this.pingUpdateTimeoutMs=1*c.a.second,this.streamsInfoUpdateTimeoutMs=2*c.a.second,this.reassemblyTimeoutMs=500*c.a.millisecond,this.reassemblyTableCleanupMs=1*c.a.second,this.heartbeatTimeoutMs=20*c.a.millisecond,this.streamLatestTimestamp=new Map,this.reassemblyTable=new Map,this.reassemblyTableLastTimestamp=new Map,this.closeCalled=!1,this.gotOffer=!1,this.hasIceCandidate=!1;const{isOffer:ue}=$.baseConfig;ue?this.initializeChannels(q):q.ondatachannel=ae=>{switch(ae.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ae.channel;break;case"stream.reliable":this.reliableStreamChannel=ae.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ae.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ae.channel;break;case"heartbeat":return void(this.heartbeatChannel=ae.channel);default:return void this.dataChannelNotifier(ae.channel)}this.setupChannel(ae.channel)},this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ae}=this;ae&&this.sendSystemMessage(ae,{type:"ping"})},this.pingUpdateTimeoutMs),this.streamsInfoUpdateTimeout=setInterval(()=>{const{latestTtlStreamChannel:ae}=this;ae&&this.sendSystemMessage(ae,{type:"streams-info"})},this.streamsInfoUpdateTimeoutMs),this.reassemblyTableCleanupTimeout=setInterval(()=>{const ae=new Date().getTime();this.reassemblyTableLastTimestamp.forEach((de,me,pe)=>{ae>me+this.reassemblyTimeoutMs&&this.reassemblyTable.delete(de)})},this.reassemblyTableCleanupMs),this.heartbeatTimeout=setInterval(()=>{const{heartbeatChannel:ae}=this;ae&&ae.readyState==="open"&&ae.send(new Uint8Array([1]))},this.heartbeatTimeoutMs)}handleSignal(q){return ie(this,void 0,void 0,function*(){const{peerConnection:$}=this,{track:te}=this.config.baseConfig,ue=(()=>{try{return JSON.parse(q.getPayload())}catch{return}})();if(!ue)return void I.a.error("Received unparseable signal.");I.a.debug("Handling signal",{description:ue});const{sdp:ae,type:de}=ue;if(!ae||!de)return void I.a.warn("Received non-SDP signal");const{signalingState:me,connectionState:pe}=$;if(me!=="stable"||pe!=="connected")if($.remoteDescription)I.a.warn(`Received SDP after remote description was set: ${ae}`);else{if(de==="offer"){if(me!=="stable")return void I.a.warn("Received offer SDP when signaling is ongoing.");yield $.setRemoteDescription(ue);const ge=yield $.createAnswer();yield $.setLocalDescription(ge);const ce=q.clone();return te==null||te("Answer Received",ce),ce.setPayload(JSON.stringify(ge)),ce.setReceiverId(q.getSenderId()),ce.setSenderId(q.getReceiverId()),ce}if(de==="answer"){if(me==="stable")return void I.a.warn("Received answer SDP when signaling hasn't started.");yield $.setRemoteDescription(ue)}}else I.a.warn(`Received SDP when already connected: ${ae}`)})}send(q,$){const te=this.getChannelFromLabel($.channelLabel);te?this.sendOnChannel(te,q):I.a.warn("Send called with unexpected channel label",{channelLabel:$.channelLabel})}controlRemoteStream(q){this.sendSystemMessage(d(this.reliableStreamChannel),{type:"stream-control",streamControl:q})}isActive(){return new Set(["new","checking","connected","completed"]).has(this.peerConnection.iceConnectionState)||this.isReady()}isReady(){const{reliableStreamChannel:q,latestTtlStreamChannel:$,latestTryOnceStreamChannel:te,latestReliableStreamChannel:ue}=this;return(q==null?void 0:q.readyState)==="open"&&($==null?void 0:$.readyState)==="open"&&(te==null?void 0:te.readyState)==="open"&&(ue==null?void 0:ue.readyState)==="open"}close(){return ie(this,void 0,void 0,function*(){if(this.closeCalled)return;this.closeCalled=!0,this.sessionMetrics&&(yield this.sessionMetrics.uploadMetrics()),this.pingUpdateTimeout&&clearInterval(this.pingUpdateTimeout),this.reassemblyTableCleanupTimeout&&clearInterval(this.reassemblyTableCleanupTimeout),this.streamsInfoUpdateTimeout&&clearInterval(this.streamsInfoUpdateTimeout),this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout);const{peerConnection:q,reliableStreamChannel:$,latestTtlStreamChannel:te,latestTryOnceStreamChannel:ue,latestReliableStreamChannel:ae}=this;q.close(),$==null||$.close(),te==null||te.close(),ue==null||ue.close(),ae==null||ae.close()})}getPing(){return this.pingTimeMs}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionCreatedTimestamp(){var q;return(q=this.config.remoteConfig)===null||q===void 0?void 0:q.sessionCreatedTimestamp}setSessionCreatedTimestamp(q){this.config.remoteConfig&&(this.config.remoteConfig.sessionCreatedTimestamp=q)}getSessionId(){var q;return(q=this.config.remoteConfig)===null||q===void 0?void 0:q.sessionId}setSessionId(q){this.config.remoteConfig&&(this.config.remoteConfig.sessionId=q,this.sessionMetrics=new ee(q,this))}getRemotePeerId(){return this.config.baseConfig.remotePeerId}getRemoteDeviceId(){var q;return(q=this.config.baseConfig)===null||q===void 0?void 0:q.remoteDeviceId}setRemoteDeviceId(q){this.config.baseConfig.remoteDeviceId=q}getSessionMetricsMessageCounts(){var q;return(q=this.sessionMetrics)===null||q===void 0?void 0:q.counts}getConnectionStatsInfo(){return ie(this,void 0,void 0,function*(){const{peerConnection:q}=this;if(!q)return;const $=yield q.getStats(null),te=[];$.forEach(pe=>{te.push(pe)});const ue=te.find(pe=>pe.type==="transport");if(!ue)return;const ae=te.find(pe=>(pe.type==="candidate-pair"||pe.type==="candidatepair")&&pe.id===ue.selectedCandidatePairId);if(!ae)return;const de=te.find(pe=>pe.id===ae.localCandidateId),me=te.find(pe=>pe.id===ae.remoteCandidateId);return de&&me&&(de.address=de.address||de.ip,me.address=me.address||me.ip,de.address!==void 0&&me.address!==void 0)?{transport:ue,localCandidate:de,remoteCandidate:me}:void 0})}initializeChannels(q){this.heartbeatChannel=q.createDataChannel("heartbeat",y),this.heartbeatChannel.binaryType="arraybuffer",this.latestTtlStreamChannel=q.createDataChannel("stream.latest-ttl",Y),this.latestTtlStreamChannel.binaryType="arraybuffer",this.reliableStreamChannel=q.createDataChannel("stream.reliable",K),this.reliableStreamChannel.binaryType="arraybuffer",this.latestReliableStreamChannel=q.createDataChannel("stream.latest-reliable",H),this.latestReliableStreamChannel.binaryType="arraybuffer",this.latestTryOnceStreamChannel=q.createDataChannel("stream.latest-try-once",V),this.latestTryOnceStreamChannel.binaryType="arraybuffer",this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}getOffer(){var q,$,te;return ie(this,void 0,void 0,function*(){const{gotOffer:ue}=this,{peerConnection:ae,config:de}=this;if(this.config.baseConfig.isLan)throw new Error('"getOffer" method can only be called with internet connections. LAN connections should call the "getLanOffer" method.');const me=(q=this.config.remoteConfig)===null||q===void 0?void 0:q.sessionId;if(ue)return void I.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,ne(this.peerConnection))return void I.a.debug("Failed to generate offer because the peer connection was inactive.");const pe=de.baseConfig.track;ae.onicecandidate=()=>{this.hasIceCandidate=!0},ae.oniceconnectionstatechange=()=>ie(this,void 0,void 0,function*(){const Pe=ae.iceConnectionState;if(Pe==="connected"||Pe==="completed"){const Le=yield this.getConnectionStatsInfo(),Fe=Le?function(ze){const De=ze.localCandidate.candidateType,We=ze.remoteCandidate.candidateType;return De==="host"&&We==="host"?"local":De==="relay"||We==="relay"?"TURN":"STUN"}(Le):void 0;I.a.info(`ICE connection state changed to ${Pe}`,{sessionId:me,connectionStatsInfo:Le,iceMode:Fe}),pe==null||pe("ICE connection state change",{iceConnectionState:Pe,sessionId:me,connectionStatsInfo:Le,iceMode:Fe})}}),yield ae.setLocalDescription(yield ae.createOffer());const ge=new Date().getTime();for(;;){const Pe=new Date().getTime()-ge;if(Pe>this.connectTimeoutMs)return void I.a.debug("Failed to generate offer because ICE gathering timed out.");if(Pe>this.iceGatheringTimeoutMs&&this.hasIceCandidate){I.a.debug("ICE gathering partially completed; proceeding",{iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe}),pe==null||pe("ICE gathering partially completed",{sessionId:me,iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe});break}if(ae.iceGatheringState==="complete"){I.a.debug("ICE gathering complete",{iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe}),pe==null||pe("ICE gathering completed",{sessionId:me,iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe});break}yield Object(u.a)(.1*c.a.second)}const ce=($=this.peerConnection.getConfiguration().iceServers)!==null&&$!==void 0?$:[];for(const Pe of ce)Pe.credentialType=void 0;const Te=JSON.stringify(ce),Re=new L.Signal;return Re.setPayload(JSON.stringify(ae.localDescription)),Re.setSenderId(this.config.baseConfig.localPeerId),Re.setReceiverId(this.config.baseConfig.remotePeerId),Re.setIceServers(Te),Re.setIceTransportPolicy((te=this.peerConnection.getConfiguration().iceTransportPolicy)!==null&&te!==void 0?te:"all"),this.config.baseConfig.sessionType!==void 0?Re.setSessionType(this.config.baseConfig.sessionType):Re.setSessionType(L.SessionType.TELEOP),I.a.debug("Sending offer signal with description",{description:Re.getPayload()}),Re})}getLanOffer(){return ie(this,void 0,void 0,function*(){const{peerConnection:q,gotOffer:$}=this;if(!this.config.baseConfig.isLan)throw new Error('"getLanOffer" method can only be used with LAN connections. Internet connections should call the "getOffer" method.');if($)return void I.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,ne(this.peerConnection))return void I.a.debug("Failed to generate offer because the peer connection was inactive.");yield q.setLocalDescription(yield q.createOffer());const te=new Date().getTime();for(;;){if(new Date().getTime()-te>this.iceGatheringTimeoutMs)return void I.a.debug("Failed to generate offer because ICE gathering timed out.");if(q.iceGatheringState==="complete")break;yield Object(u.a)(.1*c.a.second)}const ue=q.localDescription;if(ue)return I.a.debug("Sending LAN offer signal with description",{description:ue}),ue;I.a.error("Failed to generate LAN offer description")})}handleLanAnswer(q){return ie(this,void 0,void 0,function*(){const{peerConnection:$}=this;if(!this.config.baseConfig.isLan)throw new Error('"handleLanAnswer" method can only be used with LAN connections. Internet connections should call the "handleSignal" method.');yield $.setRemoteDescription(q)})}getChannelFromLabel(q){switch(q){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(q,$){let te;try{te=Object(G.encode)(JSON.stringify($))}catch(ue){return void I.a.warn("Failed to encode RTC message",{error:ue})}try{q.send(te),this.sessionMetrics&&this.sessionMetrics.incrementLocalSent($)}catch(ue){I.a.warn("Failed to send message to channel",{error:ue,channel:q.label})}}channelNotRecognized(q){return q!==this.latestTtlStreamChannel&&q!==this.latestReliableStreamChannel&&q!==this.latestTryOnceStreamChannel&&q!==this.reliableStreamChannel}setupChannel(q){q.onmessage=$=>{if(this.channelNotRecognized(q))return void I.a.warn("Received message on unrecognized data channel.");let te;try{te=JSON.parse(Object(G.decode)($.data))}catch(ue){return void I.a.warn("Received unparseable message on RTC stream data channel",{error:ue,channel:q.label})}te.communicationType==="message-chunk"?this.receiveChannelMessageChunk(q,te):this.receiveChannelMessage(q,te)},q.onerror=$=>{I.a.warn(`Channel error: ${$.error}`,{error:$.error,sessionId:this.getSessionId(),channelLabel:q.label})},q.onopen=()=>{I.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:q.label})},q.onclose=()=>{const $={bufferedAmount:q.bufferedAmount,sessionId:this.getSessionId(),channelLabel:q.label};this.closeCalled===!1?I.a.debug("Unexpected channel closed",$):I.a.debug("Channel closed",$)}}receiveChannelMessage(q,$){const{config:te}=this,{remotePeerId:ue}=this.config.baseConfig;this.lastMessageTimestamp=new Date().getTime(),$=function(ae){switch(ae.header.stream.streamType){case"twist":{const{twist:de}=ae.payload;if(!de)throw Error("twist not in payload of RTC message with type twist");return{header:ae.header,payload:{twist:{linear:Object.assign({x:0,y:0,z:0},de.linear),angular:Object.assign({x:0,y:0,z:0},de.angular)}}}}case"pose":{const{pose:de}=ae.payload;if(!de)throw Error("pose not in payload of RTC message with type pose");return{header:ae.header,payload:{pose:{translation:Object.assign({x:0,y:0,z:0},de.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},de.rotation)}}}}case"pose-with-covariance":{const{poseWithCovariance:de}=ae.payload;if(!de)throw Error("poseWithCovariance not in payload of RTC message with type pose-with-covariance");const me=new Array(36).fill(0);return de.covariance.forEach((pe,ge)=>{if(ge>=36)throw Error("covariance contains more than 36 elements");me[ge]=pe}),{header:ae.header,payload:{poseWithCovariance:{pose:{translation:Object.assign({x:0,y:0,z:0},de.pose.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},de.pose.rotation)},covariance:me}}}}case"point":{const{point:de}=ae.payload;if(!de)throw Error("point not in payload of RTC message with type point");return{header:ae.header,payload:{point:Object.assign({x:0,y:0,z:0},de)}}}default:return ae}}($),this.sessionMetrics&&this.sessionMetrics.incrementLocalReceived($),this.handleSystemMessage(q,$)||(q===this.latestTryOnceStreamChannel||q===this.latestTtlStreamChannel||q===this.latestReliableStreamChannel)&&!this.isLatestMessage($)||te.baseConfig.receive(ue,$)}receiveChannelMessageChunk(q,$){const te=this.reassemblyTable.get($.id)||[];if(te.push($),te.length===$.total){const ue=function(ae){const de=ae.sort((me,pe)=>me.seq<pe.seq?-1:1).map(me=>me.part).reduce((me,pe)=>me+pe);try{return JSON.parse(de)}catch{return void I.a.warn("Could not reassemble RTC message chunks")}}(te);return ue&&this.receiveChannelMessage(q,ue),void this.reassemblyTable.delete($.id)}this.reassemblyTable.set($.id,te),this.reassemblyTableLastTimestamp.set($.id,new Date().getTime())}handleSystemMessage(q,$){var te,ue;const{config:ae}=this,{baseConfig:de}=ae,{remotePeerId:me}=de;switch($.header.stream.streamType){case"ping":return this.sendSystemMessage(q,{type:"pong",timestamp:d($.payload.ping)}),!0;case"pong":{const pe=new Date().getTime()-d($.payload.pong);return this.pingTimeMs=pe,O.aggregate("rtc-ping-time",pe),!0}case"streams-info":{const{sessionMetrics:pe}=this,ge=(te=$.payload.streamsInfo)===null||te===void 0?void 0:te.timestamp;return!!ge&&(pe==null||pe.updateRemoteMessagesCounts($),(ue=de.onStreamsInfoUpdate)===null||ue===void 0||ue.call(de,me,ge),!0)}case"stream-control":return!0;default:return!1}}sendSystemMessage(q,$){var te;const{localUserId:ue,localPeerId:ae}=this.config.baseConfig;if(q.readyState!=="open")return;const de={entityId:ue!=null?ue:ae,streamName:`$.${$.type}`,streamType:$.type};let me;switch($.type){case"ping":me={ping:new Date().getTime()};break;case"pong":me={pong:$.timestamp};break;case"stream-control":me={streamControl:$.streamControl};break;case"streams-info":me={streamsInfo:(te=this.sessionMetrics)===null||te===void 0?void 0:te.getLocalStreamsInfo(new Date().getTime())}}this.sendOnChannel(q,X(de,me))}isLatestMessage(q){const $=j(q.header.stream),te=(this.streamLatestTimestamp.get($)||0)<=q.header.created;return te&&this.streamLatestTimestamp.set($,q.header.created),te}}function Se(ye){var q,$;return{userId:(q=ye.getUserId())===null||q===void 0?void 0:q.getValue(),deviceId:($=ye.getDeviceId())===null||$===void 0?void 0:$.getValue(),organizationId:ye.getOrganizationId(),id:ye.getPeerId(),capabilities:[],capabilitySet:{}}}var we=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class Ee{constructor(q){this.config=q,this.grpcCallDeadline=5*c.a.second,this.refreshIntervalDelayMs=2*c.a.second,this.iceServersTtl=30*c.a.minute,this.connections=[],this.localConnections=[],this.isConnectionInitiator=new Map,this.isOutgoingConnection=new Map,this.peerDataChannelListeners=[];const{refreshIntervalDelayMs:$}=this;this.refreshInterval=Z({func:()=>we(this,void 0,void 0,function*(){try{yield this.update()}catch(te){I.a.warn("RTC refresh failed",{error:te})}}),delay:$,immediate:!0})}send(q,$,te){const ue=this.getActiveConnection(q);ue?ue.isReady()?ue.send($,te):I.a.warn("Send called with unready connection."):I.a.warn("Send called with no connection.")}controlRemoteStream(q,$){const te=this.getActiveConnection(q);te?te.isReady()?te.controlRemoteStream($):I.a.warn("controlRemoteStream called with unready connection."):I.a.warn("controlRemoteStream called with no connection.")}getLocalPeer(){return we(this,void 0,void 0,function*(){for(;!this.localPeer;)yield Object(u.a)(.1*c.a.second);return Se(this.localPeer)})}connect(q,$){var te,ue,ae;return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode===!0)throw new Error("connect method called in local only mode.");const{track:de,signalingClient:me}=this.config,{localPeer:pe,receiveSignalStream:ge,iceServers:ce}=this;if(!pe||!ge||!ce)return void I.a.warn("Connect called prior to local peer, receiveSignalStream, and ICE servers ready");if(this.getActiveConnection(q))return void I.a.warn("Connect called for peer with existing connection.");if(this.isOutgoingConnection.get(q))return void I.a.warn("Connect called for peer with an existing outgoing connection offer.");this.isOutgoingConnection.set(q,!0);const Te=new he(yield this.createRTCPeerConnection(ce,$),{baseConfig:{isOffer:!0,isLan:!1,receive:(De,We)=>this.config.receive(De,We),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(De,We)=>{var Be,ke;return(ke=(Be=this.config).onStreamsInfoUpdate)===null||ke===void 0?void 0:ke.call(Be,De,We)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(te=pe.getUserId())===null||te===void 0?void 0:te.getValue(),localPeerId:pe.getPeerId(),remotePeerId:q,sessionType:$==null?void 0:$.sessionType},remoteConfig:{}},De=>this.onCustomDataChannel(q,De)),Re=yield Te.getOffer();if(!Re)return I.a.error("Failed to generate offer."),void this.isOutgoingConnection.delete(q);I.a.debug("Sending offer."),de==null||de("Sending offer",Re);const Pe=new L.SendSignalRequest;Pe.setSignal(Re);const Le=yield(()=>we(this,void 0,void 0,function*(){try{return yield me.sendSignal(Pe,yield this.getMetadata({}))}catch(De){I.a.warn("Error when sending signal",{error:De})}}))();if(!this.isOutgoingConnection.get(q))return void I.a.debug("No offer set after receiving offer signal response.");I.a.debug("Offer sent.");const Fe=(ue=Le==null?void 0:Le.getSessionId())===null||ue===void 0?void 0:ue.getValue(),ze=(ae=Le==null?void 0:Le.getSessionCreatedTimestamp())===null||ae===void 0?void 0:ae.getValue();return Fe&&ze?(Te.setSessionId(Fe),Te.setSessionCreatedTimestamp(ze),this.isOutgoingConnection.delete(q),this.connections.push(Te),this.isConnectionInitiator.set(Te,!0),this.setupHandlers(Te),Fe):(I.a.warn("No session ID or no session created timestamp on send signal response."),void this.isOutgoingConnection.delete(q))})}connectLan(q){var $,te;return we(this,void 0,void 0,function*(){const ue=new B(q),ae=new he(yield this.createRTCPeerConnection([]),{baseConfig:{isOffer:!0,isLan:!0,receive:(ge,ce)=>this.config.receive(ge,ce),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(ge,ce)=>{var Te,Re;return(Re=(Te=this.config).onStreamsInfoUpdate)===null||Re===void 0?void 0:Re.call(Te,ge,ce)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(te=($=this.localPeer)===null||$===void 0?void 0:$.getUserId())===null||te===void 0?void 0:te.getValue(),localPeerId:"lan_client",remotePeerId:q}},ge=>this.onCustomDataChannel(q,ge)),de=yield ae.getLanOffer();if(!de)return I.a.warn("Could not generate LAN offer"),!1;const me=yield ue.postLanRtcOffer({offer:JSON.stringify(de)}),pe=new RTCSessionDescription(JSON.parse(me.answer));return yield ae.handleLanAnswer(pe),this.localConnections.push(ae),this.isConnectionInitiator.set(ae,!0),Object(E.v4)()})}getConnections(){return[...this.connections,...this.localConnections]}createCustomDataChannel(q,$,te,ue,ae){const de=this.getActiveConnection(q);if(de&&this.isConnectionInitiator.has(de)){const pe=de.peerConnection.createDataChannel("custom."+$,te);return ue&&(pe.binaryType="arraybuffer"),ae(q,pe),()=>{}}const me=(pe,ge)=>{q===pe&&ge.label==="custom."+$&&ae(q,ge)};return this.peerDataChannelListeners.push(me),()=>{this.peerDataChannelListeners=this.peerDataChannelListeners.filter(pe=>pe!==me)}}onCustomDataChannel(q,$){this.peerDataChannelListeners.forEach(te=>te(q,$))}getConnectionStatus(q){if(this.isOutgoingConnection.get(q))return"connecting";const $=this.getActiveConnection(q);return $?$.isReady()?"connected":"connecting":"disconnected"}getConnectionStatsInfo(q){return we(this,void 0,void 0,function*(){const $=this.getActiveConnection(q);if($)return yield $.getConnectionStatsInfo()})}disconnect(q){return we(this,void 0,void 0,function*(){const $=this.getActiveConnection(q);$&&(yield $.close())})}getPeers(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:q}=this.config,$=yield(()=>we(this,void 0,void 0,function*(){try{return yield q.getPeers(new L.GetPeersRequest,yield this.getMetadata({}))}catch(ae){I.a.warn("Error when getting peers",{error:ae})}}))();if(!$)return[];const te=$.getPeersList();if(!te)return[];const ue=ae=>{var de,me;return(me=(de=ae.getPeerCreatedTimestamp())===null||de===void 0?void 0:de.getValue())!==null&&me!==void 0?me:0};return te.sort((ae,de)=>ue(de)-ue(ae)).map(ae=>Se(ae))})}getSessions(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:q}=this.config,$=yield(()=>we(this,void 0,void 0,function*(){try{return yield q.getPeers(new L.GetPeersRequest,yield this.getMetadata({}))}catch(ae){I.a.warn("Error when getting peers",{error:ae})}}))();if(!$)return{};const te=$.getPeersList(),ue={};for(const ae of te)ue[ae.getPeerId()]=ae.getSessionIdsList();return ue})}getPing(q){const $=this.getActiveConnection(q);if($)return $.getPing();I.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(q){const $=this.getActiveConnection(q);if($)return $.getLastMessageTimestamp();I.a.warn("Attempted to get last message time from inactive peer.")}getSessionMetricsMessageCounts(q){const $=this.getActiveConnection(q);if($)return $.getSessionMetricsMessageCounts();I.a.warn("Attempted to get session metrics counts from inactive peer.")}isReady(){if(this.config.lanOnlyMode)return!0;const{localPeer:q,receiveSignalStream:$,iceServers:te}=this;return!!(q&&$&&te)}shutdown(){return we(this,void 0,void 0,function*(){I.a.info("Shutdown called on RTC client"),yield this.refreshInterval.stop(),this.receiveSignalStream&&this.receiveSignalStream.cancel();const q=this.connections;this.connections=[],yield this.closeConnections(q);const{localPeer:$}=this;if(!$||this.config.lanOnlyMode)return;const{signalingClient:te}=this.config;yield(()=>we(this,void 0,void 0,function*(){try{const ue=new L.DeletePeerRequest;ue.setPeerId($.getPeerId()),yield te.deletePeer(ue,yield this.getMetadata({}))}catch(ue){return void I.a.warn("Error deleting local peer",{error:ue})}}))()})}createPeer(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createPeer method cannot be used in local-only mode.");const{signalingClient:q}=this.config,$=yield(()=>we(this,void 0,void 0,function*(){try{return yield q.createPeer(new L.CreatePeerRequest,yield this.getMetadata({}))}catch(ue){throw new Error(`Was not able to create peer: ${JSON.stringify(ue)}`)}}))(),te=$==null?void 0:$.getPeer();if(!te)throw new Error("Response did not provide peer.");return this.localPeer=te})}createReceiveSignalStream(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createReceiveSignalStream method cannot be used in local-only mode.");const{signalingClient:q}=this.config,{localPeer:$,iceServers:te}=this;if(!$||!te)return;const{receiveSignalStream:ue}=this;ue&&ue.cancel();const ae=new L.ReceiveSignalStreamRequest;ae.setPeerId($.getPeerId());const de=yield(()=>we(this,void 0,void 0,function*(){try{return q.receiveSignalStream(ae,yield this.getMetadata({hasDeadline:!1}))}catch(me){throw new Error(`Unable to create receive signal stream: ${JSON.stringify(me)}`)}}))();if(!de)throw new Error("Response did not provide stream.");return de.on("data",me=>we(this,void 0,void 0,function*(){var pe,ge,ce,Te;const Re=me.getSignal(),Pe=(pe=Re==null?void 0:Re.getSessionId())===null||pe===void 0?void 0:pe.getValue(),Le=Re==null?void 0:Re.getSenderId(),Fe=Re==null?void 0:Re.getReceiverId(),ze=(ge=Re==null?void 0:Re.getSessionCreatedTimestamp())===null||ge===void 0?void 0:ge.getValue();if(!(Re&&Pe&&Le&&Fe&&ze))return void I.a.warn("Received signal with missing information.");const De=this.getActiveConnection(Le);if(De)if(De.getSessionId()!==Pe){if(I.a.debug("Received signal: different session for a peer we're already connected to."),(De.getSessionCreatedTimestamp()||0)>ze)return;const We=new he(yield this.createRTCPeerConnection(te),{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,ke)=>this.config.receive(Be,ke),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,ke)=>{var qe,Ge;return(Ge=(qe=this.config).onStreamsInfoUpdate)===null||Ge===void 0?void 0:Ge.call(qe,Be,ke)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:$.getPeerId(),localUserId:(Te=$.getUserId())===null||Te===void 0?void 0:Te.getValue(),remotePeerId:Le},remoteConfig:{sessionId:Pe,sessionCreatedTimestamp:ze}},Be=>this.onCustomDataChannel(Le,Be));yield We.handleSignal(Re),this.connections.push(We)}else I.a.debug("Received signal: for an existing connection."),yield De.handleSignal(Re);else{I.a.debug("Received signal: new connection.");const We=new he(yield this.createRTCPeerConnection(te),{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,ke)=>this.config.receive(Be,ke),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,ke)=>{var qe,Ge;return(Ge=(qe=this.config).onStreamsInfoUpdate)===null||Ge===void 0?void 0:Ge.call(qe,Be,ke)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:$.getPeerId(),localUserId:(ce=$.getUserId())===null||ce===void 0?void 0:ce.getValue(),remotePeerId:Le},remoteConfig:{sessionId:Pe,sessionCreatedTimestamp:ze}},Be=>this.onCustomDataChannel(Le,Be));yield We.handleSignal(Re),this.connections.push(We)}})),de.on("end",()=>{de.cancel(),this.receiveSignalStream=void 0}),de.on("error",me=>{switch(me.code){case k.StatusCode.CANCELLED:case k.StatusCode.UNAVAILABLE:case k.StatusCode.UNKNOWN:I.a.debug("Receive signal stream error",{error:me});break;case k.StatusCode.UNAUTHENTICATED:I.a.warn("Receive signal stream error",{error:me});break;default:I.a.error("Receive signal stream error",{error:me})}de.cancel(),this.receiveSignalStream=void 0}),this.receiveSignalStream=de})}createRTCPeerConnection(q,$){var te;return we(this,void 0,void 0,function*(){const ue=$==null?void 0:$.rtcIceTransportPolicies,ae=$!=null&&$.rtcIceServerProtocol?[$==null?void 0:$.rtcIceServerProtocol]:void 0,de=q.map(pe=>Object.assign(Object.assign({},pe),{urls:typeof pe.urls=="string"?[pe.urls]:pe.urls})).map(pe=>Object.assign(Object.assign({},pe),{urls:pe.urls.filter(ge=>{const ce=(ue===void 0||ue.some(Te=>((Re,Pe)=>{switch(Pe){case"stun":return/^stuns?:/.test(Re);case"turn":return/^turns?:/.test(Re)}})(ge,Te)))&&(ae===void 0||ae.some(Te=>((Re,Pe)=>Re.endsWith(`transport=${Pe}`))(ge,Te)));return ce||I.a.debug(`Ignoring ICE server: ${ge}`),ce})})).filter(({urls:pe})=>pe.filter(ge=>ge).length>0),me=(te=this.config.alternateRTCPeerConnection)!==null&&te!==void 0?te:window.RTCPeerConnection;if(!me)throw new Error("RTCPeerConnection class not found. WebRTC must be enabled.");return new me(Object.assign({iceServers:de,iceTransportPolicy:(ue==null?void 0:ue.length)===1&&ue[0]==="turn"?"relay":"all"},$))})}closeConnections(q){return we(this,void 0,void 0,function*(){const $=yield R(q.map(te=>we(this,void 0,void 0,function*(){yield te.close()})));for(const te of $)I.a.warn("Request to close session failed",{error:te})})}getActiveConnection(q){return this.getConnections().find($=>$.getRemotePeerId()===q&&$.isActive())}update(){var q;return we(this,void 0,void 0,function*(){if(this.localConnections=this.localConnections.filter(me=>me.isActive()),this.config.lanOnlyMode)return;const{signalingClient:$}=this.config;if(!this.localPeer||!this.receiveSignalStream||!this.iceServers)return this.localPeer||(yield this.createPeer()),this.iceServers||(yield this.updateIceServers()),void(this.receiveSignalStream||(yield this.createReceiveSignalStream()));yield this.closeConnections(this.connections.filter(me=>!me.isActive())),this.connections=this.connections.filter(me=>me.isActive());const{localPeer:te}=this,ue=this.connections.filter(me=>me.getSessionId).map(me=>d(me.getSessionId()));te.setSessionIdsList(ue);const ae=new L.RefreshPeerRequest;ae.setPeer(te);try{yield $.refreshPeer(ae,yield this.getMetadata({}))}catch(me){me.code===k.StatusCode.NOT_FOUND?(I.a.warn("Peer expired, creating new peer",{peerId:te.getPeerId()}),yield this.reset()):I.a.warn("Error calling RefreshPeer",{error:me})}const de=yield this.getPeers();for(const me of this.connections)me.setRemoteDeviceId((q=de.find(pe=>pe.id===me.getRemotePeerId()))===null||q===void 0?void 0:q.deviceId)})}reset(){return we(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.isOutgoingConnection=new Map,yield this.createPeer(),yield this.createReceiveSignalStream()})}updateIceServers(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)return;const{iceServersLastUpdate:q,iceServersTtl:$}=this,te=new Date().getTime();if(!q||te-q>$)try{const ue=(yield this.config.signalingClient.getIceServers(new L.GetIceServersRequest,yield this.getMetadata({}))).getIceServers();this.iceServers=JSON.parse(ue),this.iceServersLastUpdate=te}catch(ue){I.a.warn("Error in updateIceServers",{error:ue})}})}setupHandlers(q){const{peerConnection:$}=q,te=q.getSessionCreatedTimestamp();$.onconnectionstatechange=()=>we(this,void 0,void 0,function*(){const ue=$.connectionState;if(te)switch(ue){case"connected":O.aggregate("rtc-connect-time",new Date().getTime()-te);break;case"failed":O.increment("rtc-connect-failed")}})}getMetadata(q){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getMetadata method cannot be called in local-only mode");const{getToken:$}=this.config,{grpcCallDeadline:te}=this,{hasDeadline:ue}=q,ae=ue===!1?void 0:new Date().getTime()+te;return{authorization:yield $(),deadline:ae}})}}},,function(e,t,r){r.r(t),r.d(t,"LogClient",function(){return l});var n=r(25),o=function(s,i,c,u){return new(c||(c=Promise))(function(b,A){function _(S){try{f(u.next(S))}catch(w){A(w)}}function v(S){try{f(u.throw(S))}catch(w){A(w)}}function f(S){var w;S.done?b(S.value):(w=S.value,w instanceof c?w:new c(function(P){P(w)})).then(_,v)}f((u=u.apply(s,i||[])).next())})};class l extends n.a{log(i){return o(this,void 0,void 0,function*(){yield this.fetch("logs",{method:"POST",body:JSON.stringify({logs:i}),allowUnsafeRetries:!0})})}}}])})})(dist);let FORMANT_API_URL="https://api.formant.io";typeof window!="undefined"&&(FORMANT_API_URL=window.FORMANT_API_URL||FORMANT_API_URL);let urlParams$1=new URLSearchParams("");typeof window!="undefined"&&(urlParams$1=new URLSearchParams(window.location.search));const envDev=urlParams$1.get("formant_dev");envDev&&(FORMANT_API_URL="https://api-dev.formant.io");const envStage=urlParams$1.get("formant_stage");envStage&&(FORMANT_API_URL="https://api-stage.formant.io");function delay(e){return new Promise(t=>setTimeout(t,e))}function defined(e,t){if(e!==void 0)return e;throw new Error(t||"Value is undefined")}class App{static sendAppMessage(t){window.parent.postMessage(t,"*")}static getCurrentModuleContext(){let t=new URLSearchParams("");return typeof window!="undefined"&&(t=new URLSearchParams(window.location.search)),t.get("module")}static isModule(){return this.getCurrentModuleContext()!==null}static goToTime(t){this.sendAppMessage({type:"go_to_time",time:t.getTime()})}static goToDevice(t){this.sendAppMessage({type:"go_to_device",deviceId:t})}static showMessage(t){this.sendAppMessage({type:"show_message",message:t})}static requestModuleData(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"request_module_data",module:t})}static setModuleDateTimeRange(t,r){const n=this.getCurrentModuleContext();if(!n)throw new Error("No module context");this.sendAppMessage({type:"set_module_data_time_range",module:n,before:t,after:r||0})}static refreshAuthToken(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"refresh_auth_token",module:t})}static sendChannelData(t,r){const n=this.getCurrentModuleContext();if(!n)throw new Error("No module context");this.sendAppMessage({type:"send_channel_data",source:n,channel:t,data:r})}static setupModuleMenus(t){const r=this.getCurrentModuleContext();if(!r)throw new Error("No module context");this.sendAppMessage({type:"setup_module_menus",module:r,menus:t})}static addMenuListener(t){window.addEventListener("message",r=>{const n=r.data;n.type==="module_menu_item_clicked"&&t(n.menu)})}static addAccessTokenRefreshListener(t){window.addEventListener("message",r=>{const n=r.data;n.type==="auth_token"&&t(n.token)})}static addModuleDataListener(t){window.addEventListener("message",r=>{const n=r.data;n.type==="module_data"&&t({streams:n.streams,time:n.time,queryRange:n.queryRange})})}static addChannelDataListener(t,r){window.addEventListener("message",n=>{const o=n.data;o.type==="channel_data"&&o.channel===t&&r({source:o.source,data:o.data})})}}const Oe=class{static async login(t,r){try{const n=await fetch(`${FORMANT_API_URL}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:t,password:r}),headers:{"Content-Type":"application/json"}}),o=await n.json();if(n.status!==200)throw new Error(o.message);return await Oe.loginWithToken(o.authentication.accessToken,o.authentication.refreshToken),o.authentication}catch(n){return Oe.waitingForAuth.forEach(o=>o(!1)),Oe.waitingForAuth=[],Promise.reject(n)}}static async loginWithToken(t,r){const n=JSON.parse(atob(t.split(".")[1]));try{let o;if(Oe.isShareToken=n["formant:claims"]&&n["formant:claims"].type=="share",n["formant:claims"]&&(Oe.currentOrganization=n["formant:claims"].organizationId),n["custom:organization_id"]&&(Oe.currentOrganization=n["custom:organization_id"]),Oe.isShareToken||(o=n.sub),n["formant:claims"]&&n["formant:claims"].userId&&(o=n["formant:claims"].userId),o){const l=await fetch(`${FORMANT_API_URL}/v1/admin/users/${o}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t}}),s=await l.json();if(l.status!==200)throw new Error(s.message);Oe.currentUser=s}Oe.token=t,Oe.waitingForAuth.forEach(l=>l(!0))}catch(o){console.error(o),Oe.waitingForAuth.forEach(l=>l(!1))}Oe.waitingForAuth=[],r&&(Oe.refreshToken=r,setInterval(async()=>{if(Oe.refreshToken){const l=await(await fetch(`${FORMANT_API_URL}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:Oe.refreshToken})})).json();Oe.token=l.authentication.accessToken}},1e3*60*60))}static isAuthenticated(){return Oe.token!==void 0}static getCurrentUser(){return Oe.currentUser}static async waitTilAuthenticated(){return Oe.token!==void 0?!0:new Promise(t=>{Oe.waitingForAuth.push(function(r){t(r)})})}static async listenForRefresh(){App.addAccessTokenRefreshListener(t=>{this.loginWithToken(t)}),setInterval(async()=>{App.refreshAuthToken()},1e3*60*60)}};let Authentication=Oe;je(Authentication,"token"),je(Authentication,"refreshToken"),je(Authentication,"currentUser"),je(Authentication,"currentOrganization"),je(Authentication,"isShareToken",!1),je(Authentication,"defaultDeviceId"),je(Authentication,"waitingForAuth",[]);class DataChannel{constructor(t){je(this,"ready",!1);je(this,"listeners",[]);je(this,"openListeners",[]);je(this,"closeListeners",[]);je(this,"errorListeners",[]);je(this,"binaryListeners",[]);je(this,"error");je(this,"decoder",new TextDecoder);this.dataChannel=t,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.ready=!0,this.openListeners.forEach(r=>r())},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(r=>r())},this.dataChannel.onerror=r=>{console.error(r),this.error="An error occurred in DataChannel",this.errorListeners.forEach(n=>n(r))},this.dataChannel.onmessage=r=>{this.listeners.forEach(n=>{const o=new Uint8Array(r.data),l=this.decoder.decode(o);n(l)}),this.binaryListeners.forEach(n=>{n(new Uint8Array(r.data))})}}addOpenListener(t){this.openListeners.push(t)}removeOpenListener(t){this.openListeners=this.openListeners.filter(r=>r!==t)}addCloseListener(t){this.closeListeners.push(t)}removeCloseListener(t){this.closeListeners=this.closeListeners.filter(r=>r!==t)}addErrorListener(t){this.errorListeners.push(t)}removeErrorListener(t){this.errorListeners=this.errorListeners.filter(r=>r!==t)}async waitTilReady(){return this.ready?!0:new Promise((r,n)=>{let o=window.setInterval(()=>{this.ready&&(window.clearInterval(o),r(!0)),this.error&&n(this.error)},10)})}send(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}sendBinary(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}addListener(t){this.listeners.push(t)}removeListener(t){const r=this.listeners.indexOf(t);if(r===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(r,1)}addBinaryListener(t){this.binaryListeners.push(t)}removeBinaryListener(t){const r=this.binaryListeners.indexOf(t);if(r===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(r,1)}}class CaptureStream{constructor(t){je(this,"token");this.captureSession=t}async ingestJSON(t){if(!this.token){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=n.token}await fetch(`${FORMANT_API_URL}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(t)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}class Manipulator{constructor(t,r){je(this,"currentListeners",[]);je(this,"onRealtimeMessage",(t,r)=>{r.payload.jointState&&this.currentListeners.forEach(n=>{r.payload.jointState&&n(r.payload.jointState)})});this.device=t,this.config=r}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(t){this.currentListeners.push(t)}}class RequestDataChannel{constructor(t,r,n){je(this,"channel");je(this,"requestIdToResponseMap",new Map);this.device=t,this.channel_name=r,this.timeout=n}addOpenListener(t){defined(this.channel,"channel not initalized").addOpenListener(t)}removeOpenListener(t){defined(this.channel,"channel not initalized").removeOpenListener(t)}addCloseListener(t){defined(this.channel,"channel not initalized").addCloseListener(t)}removeCloseListener(t){defined(this.channel,"channel not initalized").removeCloseListener(t)}addErrorListener(t){defined(this.channel,"channel not initalized").addErrorListener(t)}removeErrorListener(t){defined(this.channel,"channel not initalized").removeErrorListener(t)}}class BinaryRequestDataChannel extends RequestDataChannel{constructor(){super(...arguments);je(this,"RESPONSE_SUCCESS_BYTE",0);je(this,"decoder",new TextDecoder)}generateBinaryId(){const r=new Uint8Array(16);for(let n=0;n<r.length;n++)r[n]=Math.floor(Math.random()*256);return r}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(r=>{const o=r.slice(0,16).toString();if(o.length===0)throw new Error("Invalid response");const l=r.slice(16);if(l.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(o)&&this.requestIdToResponseMap.set(o,l)})}async request(r){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:o,timeout:l}=this;await n.waitTilReady();const s=this.generateBinaryId(),i=s.toString();o.set(i,!0),n.sendBinary(new Uint8Array([...s,...r]));const c=new Date().getTime();for(;new Date().getTime()<c+l;)if(await delay(50),o.has(i)){const u=o.get(i);if(u!==!0){o.delete(i);const b=u[0]===this.RESPONSE_SUCCESS_BYTE,A=u.slice(1);if(b)return A;throw{name:"AdapterError",message:this.decoder.decode(A)}}}throw o.delete(i),{name:"TimeoutError",message:`Request timed out after ${l/1e3} seconds`}}}class TextRequestDataChannel extends RequestDataChannel{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(t=>{const r=JSON.parse(t),{id:n,data:o,error:l}=r;if(!n)throw new Error("Invalid response");if(!o&&!l)throw new Error("Invalid response");this.requestIdToResponseMap.has(n)&&this.requestIdToResponseMap.set(n,r)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:r,requestIdToResponseMap:n,timeout:o}=this;await r.waitTilReady();const l=this.generateTextId();n.set(l,!0),r.send(JSON.stringify({id:l,data:t}));const s=new Date().getTime();for(;new Date().getTime()<s+o;)if(await delay(50),n.has(l)){const i=n.get(l);if(i!==!0){n.delete(l);const{data:c,error:u}=i;if(c)return c;if(u)throw{name:"AdapterError",message:u}}}throw n.delete(l),{name:"TimeoutError",message:`Request timed out after ${o/1e3} seconds`}}}const SessionType={Teleop:1,Observe:3};class Device{constructor(t,r,n){je(this,"rtcClient");je(this,"remoteDevicePeerId");je(this,"realtimeListeners",[]);je(this,"handleMessage",(t,r)=>{this.realtimeListeners.forEach(n=>n(t,r))});this.id=t,this.name=r,this.organizationId=n}async getLatestTelemetry(){return(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async getConfiguration(){let t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});const r=await t.json();if(!r.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const n=r.state.reportedConfiguration.version;return t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${n}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),(await t.json()).document}async getFileUrl(t){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileId:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).fileUrls}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async startRealtimeConnection(t){if(this.rtcClient)throw new Error(`Already created realtime connection to device ${this.id}`);{const r=new dist.exports.RtcClient({signalingClient:new dist.exports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:this.handleMessage});for(;!r.isReady();)await delay(100);const o=(await r.getPeers()).find(l=>l.deviceId===this.id);if(!o)throw new Error("Cannot find peer, is the robot offline?");for(this.remoteDevicePeerId=o.id,await r.connect(this.remoteDevicePeerId,t||{sessionType:SessionType.Teleop});r.getConnectionStatus(this.remoteDevicePeerId)!=="connected";)await delay(100);this.rtcClient=r}}addRealtimeListener(t){this.realtimeListeners.push(t)}removeRealtimeListener(t){const r=this.realtimeListeners.indexOf(t);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeVideoStreams(){var n,o,l;const t=await this.getConfiguration(),r=[];for(const s of(n=t.teleop.hardwareStreams)!=null?n:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});for(const s of(o=t.teleop.rosStreams)!=null?o:[])s.topicType=="formant/H264VideoFrame"&&r.push({name:s.topicName});for(const s of(l=t.teleop.customStreams)!=null?l:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});return r}async getRealtimeManipulators(){var n;const t=await this.getConfiguration(),r=[];for(const o of(n=t.teleop.rosStreams)!=null?n:[])o.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:o.topicName},plannedJointStateStream:o.plannedTopic?{name:o.plannedTopic}:void 0,planValidStream:o.planValidTopic?{name:o.planValidTopic}:void 0,endEffectorStream:o.endEffectorTopic?{name:o.endEffectorTopic}:void 0,endEffectorLinkName:o.endEffectorLinkName,baseReferenceFrame:o.baseReferenceFrame,localFrame:o.localFrame}));return r}async startListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){const r=(await defined(this.rtcClient,"Realtime connection has not been started").getPeers()).find(n=>n.deviceId===this.id);return defined(r,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){if(this.rtcClient)await this.rtcClient.disconnect(this.id);else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){let t=await Fleet.getPeers(),r=await Fleet.getRealtimeSessions(),n=t.find(o=>o.deviceId===this.id);return n?r[n.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(n=>({name:n.name,id:n.id,command:n.command,description:n.description,parameterEnabled:n.parameterEnabled,parameterValue:n.parameterValue,parameterMeta:n.parameterMeta,enabled:n.enabled}))}async sendCommand(t,r,n,o){var u;const s=(await this.getAvailableCommands()).find(b=>b.name===t);if(!s)throw new Error(`Could not find command with name "${t}"`);let i;if(r===void 0)if(s.parameterEnabled&&s.parameterValue)i=s.parameterValue;else throw new Error("Command has no default parameter value, you must provide one");else i=r;let c={value:i,scrubberTime:(n||new Date).toISOString(),meta:st(st({},s.parameterMeta),o)};await fetch(`${FORMANT_API_URL}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:s.id,organizationId:this.organizationId,deviceId:this.id,command:s.command,parameter:c,userId:(u=Authentication.currentUser)==null?void 0:u.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async createCustomDataChannel(t,r){const n=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer(),l=await new Promise(s=>{n.createCustomDataChannel(defined(o).id,t,st({ordered:!0},r),!1,(i,c)=>{const u=new DataChannel(c);s(u)})});return await l.waitTilReady(),l}createCustomRequestDataChannel(t,r=3e3){return new TextRequestDataChannel(this,t,r)}createCustomBinaryRequestDataChannel(t,r=3e3){return new BinaryRequestDataChannel(this,t,r)}async createCaptureStream(t){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:t,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return new CaptureStream(n)}async getTelemetry(t,r,n,o){return await Fleet.getTelemetry(this.id,t,r,n,o)}async getTelemetryStreams(){var i,c;const t=await this.getConfiguration(),r=await fetch(`${FORMANT_API_URL}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=[],o=[];return(c=(i=t.telemetry)==null?void 0:i.streams)==null||c.forEach(u=>{u.disabled!==!0&&n.push(u.name),u.onDemand===!0&&o.push(u.name)}),console.log(o),(await r.json()).items.filter(u=>!n.includes(u)).map(u=>({name:u,onDemand:o.includes(u)}))}async createInterventionRequest(t,r,n,o){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:t,interventionType:r,time:new Date().toISOString(),deviceId:this.id,tags:o,data:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async addInterventionResponse(t,r,n){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:t,interventionType:r,data:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}}class PeerDevice{constructor(t){je(this,"rtcClient");je(this,"remoteDevicePeerId");je(this,"realtimeListeners",[]);je(this,"id");je(this,"handleMessage",(t,r)=>{this.realtimeListeners.forEach(n=>n(t,r))});this.peerUrl=t}async getLatestTelemetry(){const r=await(await fetch(`${this.peerUrl}/telemetry`)).json();return Object.entries(r).map(([o,l])=>({deviceId:this.id,streamName:o,streamType:"json",currentValue:l,currentValueTime:l.timestamp,tags:{}}))}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.document}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}async startRealtimeConnection(t){if(this.rtcClient)throw new Error(`Already created realtime connection to device ${this.id}`);{const r=new dist.exports.RtcClient({lanOnlyMode:!0,receive:this.handleMessage});for(await r.connectLan(this.peerUrl);r.getConnectionStatus(this.peerUrl)!=="connected";)await delay(100);this.rtcClient=r}}addRealtimeListener(t){this.realtimeListeners.push(t)}removeRealtimeListener(t){const r=this.realtimeListeners.indexOf(t);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeVideoStreams(){var n,o,l;const t=await this.getConfiguration(),r=[];for(const s of(n=t.teleop.hardwareStreams)!=null?n:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});for(const s of(o=t.teleop.rosStreams)!=null?o:[])s.topicType=="formant/H264VideoFrame"&&r.push({name:s.topicName});for(const s of(l=t.teleop.customStreams)!=null?l:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});return r}async getRealtimeManipulators(){var n;const t=await this.getConfiguration(),r=[];for(const o of(n=t.teleop.rosStreams)!=null?n:[])o.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:o.topicName},plannedJointStateStream:o.plannedTopic?{name:o.plannedTopic}:void 0,planValidStream:o.planValidTopic?{name:o.planValidTopic}:void 0,endEffectorStream:o.endEffectorTopic?{name:o.endEffectorTopic}:void 0,endEffectorLinkName:o.endEffectorLinkName,baseReferenceFrame:o.baseReferenceFrame,localFrame:o.localFrame}));return r}async startListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){if(this.rtcClient)await this.rtcClient.disconnect(this.id);else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async createCustomDataChannel(t,r){const n=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer(),l=await new Promise(s=>{n.createCustomDataChannel(defined(o).id,t,st({ordered:!0},r),!1,(i,c)=>{const u=new DataChannel(c);s(u)})});return await l.waitTilReady(),l}createCustomRequestDataChannel(t,r=3e3){return new TextRequestDataChannel(this,t,r)}createCustomBinaryRequestDataChannel(t,r=3e3){return new BinaryRequestDataChannel(this,t,r)}}const Me=class{static async setDefaultDevice(t){Me.defaultDeviceId=t}static async getCurrentDevice(){if(!Authentication.token)throw new Error("Not authenticated");if(!Me.defaultDeviceId)throw new Error("No known default device");const o=(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.find(s=>s.id===Me.defaultDeviceId).name,l=new Device(Me.defaultDeviceId,o,defined(Authentication.currentOrganization));return Me.knownContext.push(new WeakRef(l)),l}static async getPeerDevice(t){const r=new PeerDevice(t);return r.id=await r.getDeviceId(),r}static async getDevice(t){if(!Authentication.token)throw new Error("Not authenticated");const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json(),o=n.name,l=new Device(t,o,n.organizationId);return Me.knownContext.push(new WeakRef(l)),l}static async getDevices(){if(!Authentication.token)throw new Error("Not authenticated");const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return r.items,r.items.map(n=>new Device(n.id,n.name,n.organizationId))}static async getOnlineDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items;return(await Me.getDevices()).filter(l=>n.includes(l.id))}static async getPeers(){if(!Authentication.token)throw new Error("Not authenticated");return await new dist.exports.RtcClient({signalingClient:new dist.exports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getPeers()}static async getRealtimeSessions(){if(!Authentication.token)throw new Error("Not authenticated");return await new dist.exports.RtcClient({signalingClient:new dist.exports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getSessions()}static async getRealtimeDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(l=>l.deviceId);return(await Me.getDevices()).filter(l=>n.includes(l.id))}static async getLatestTelemetry(t){let r=t;return t&&!Array.isArray(t)&&(t=[t]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getTelemetry(t,r,n,o,l){let s=t;Array.isArray(t)||(s=[t]);let i=r;return Array.isArray(r)||(i=[r]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:s,end:o.toISOString(),names:i,start:n.toISOString(),tags:l}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getFileUrl(t){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();if(n.fileUrls.length===0)throw new Error("File not found");return n.fileUrls[0]}static async queryTelemetry(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async queryEvents(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getEvent(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query/id=${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getInterventions(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}};let Fleet=Me;je(Fleet,"defaultDeviceId"),je(Fleet,"knownContext",[]);class KeyValue{static async set(t,r){try{const n=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:defined(Authentication.currentUser).organizationId,key:t,value:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),o=await n.json();if(n.status!==200)throw new Error(o.message)}catch(n){throw n}}static async get(t){try{const r=await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=await r.json();if(r.status!==200)throw new Error(n.message);return n.value}catch(r){throw r}}static async list(){try{const t=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=await t.json();if(t.status!==200)throw new Error(r.message);return r.items}catch(t){throw t}}static async delete(t){try{if(!(await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to handle request");return}catch(r){throw r}}}const accessLevels=["viewer","operator","administrator"],viewer="viewer",operator="operator",administrator="administrator",aggregateLevels=["year","month","week","day","hour","minute"],annotationTypes=["tag","sheet","user"],eventTypes=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],healthStatuses=["unknown","operational","offline","error"],interventionTypes=["selection","labeling","teleop"],severities=["info","warning","error","critical"],videoMimeTypes=["video/mp4"];let urlParams=new URLSearchParams("");typeof window!="undefined"&&(urlParams=new URLSearchParams(window.location.search));const urlDevice=urlParams.get("device");urlDevice&&Fleet.setDefaultDevice(urlDevice);const urlAuth=urlParams.get("auth");urlAuth&&Authentication.loginWithToken(urlAuth);const moduleName=urlParams.get("module");moduleName&&Authentication.listenForRefresh(),exports.App=App,exports.Authentication=Authentication,exports.BinaryRequestDataChannel=BinaryRequestDataChannel,exports.CaptureStream=CaptureStream,exports.DataChannel=DataChannel,exports.Device=Device,exports.Fleet=Fleet,exports.KeyValue=KeyValue,exports.Manipulator=Manipulator,exports.PeerDevice=PeerDevice,exports.SessionType=SessionType,exports.TextRequestDataChannel=TextRequestDataChannel,exports.accessLevels=accessLevels,exports.administrator=administrator,exports.aggregateLevels=aggregateLevels,exports.annotationTypes=annotationTypes,exports.eventTypes=eventTypes,exports.healthStatuses=healthStatuses,exports.interventionTypes=interventionTypes,exports.operator=operator,exports.severities=severities,exports.videoMimeTypes=videoMimeTypes,exports.viewer=viewer,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
44
+ `),Error.captureStackTrace(this,n)}}e.exports=o=>{if(o.length>2)throw new n(o);function l(i={}){this.options=i}function s(i){return new l(i)}return l.prototype.transform=o,s.Format=l,s}},function(e,t,r){function n(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function o(s,i){for(var c=0;c<i.length;c++){var u=i[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(s,u.key,u)}}var l=r(85);e.exports=function(){function s(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(this,s),this.loggers=new Map,this.options=u}var i,c;return i=s,(c=[{key:"add",value:function(u,b){var A=this;if(!this.loggers.has(u)){var _=(b=Object.assign({},b||this.options)).transports||this.options.transports;b.transports=_?_.slice():[];var v=l(b);v.on("close",function(){return A._delete(u)}),this.loggers.set(u,v)}return this.loggers.get(u)}},{key:"get",value:function(u,b){return this.add(u,b)}},{key:"has",value:function(u){return!!this.loggers.has(u)}},{key:"close",value:function(u){var b=this;if(u)return this._removeLogger(u);this.loggers.forEach(function(A,_){return b._removeLogger(_)})}},{key:"_removeLogger",value:function(u){this.loggers.has(u)&&(this.loggers.get(u).close(),this._delete(u))}},{key:"_delete",value:function(u){this.loggers.delete(u)}}])&&o(i.prototype,c),s}()},function(e,t,r){(function(n){const o=r(49),l=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;e.exports=function(s,i,c){let u,b,A=!1,_=!1;function v(w,P){let N=`"${i}" ${P}`;throw w&&(N=`${N}, but is set to "${w}"`),b&&(N=`${N}. An example of a valid value would be: ${b}`),new o(N)}function f(w){return function(){let P=s[i];if(P===void 0)if(u===void 0&&_)v(void 0,"is a required variable, but it was not set");else{if(u===void 0)return;P=u}_&&P.trim().length===0&&v(void 0,"is a required variable, but its value was empty"),A&&(P.match(l)||v(P,"should be a valid base64 string if using convertFromBase64"),P=n.from(P,"base64").toString());const N=[P].concat(Array.prototype.slice.call(arguments));try{return w.apply(w,N)}catch(T){v(P,T.message)}}}const S={asArray:f(r(211)),asBoolStrict:f(r(212)),asBool:f(r(213)),asPortNumber:f(r(214)),asEnum:f(r(215)),asFloatNegative:f(r(216)),asFloatPositive:f(r(217)),asFloat:f(r(51)),asIntNegative:f(r(218)),asIntPositive:f(r(91)),asInt:f(r(50)),asJsonArray:f(r(219)),asJsonObject:f(r(220)),asJson:f(r(52)),asString:f(r(34)),asUrlObject:f(r(92)),asUrlString:f(r(221)),convertFromBase64:function(){return A=!0,S},default:function(w){if(typeof w=="number")u=w.toString();else if(Array.isArray(w)||typeof w=="object"&&w!==null)u=JSON.stringify(w);else{if(typeof w!="string")throw new o("values passed to default() must be of Number, String, Array, or Object type");u=w}return S},required:function(w){return _=w===void 0||w,S},example:function(w){return b=w,S}};return Object.entries(c).forEach(([w,P])=>{S[w]=f(P)}),S}}).call(this,r(4).Buffer)},function(e,t,r){const n=r(34);e.exports=function(o,l){return l=l||",",o.length?n(o).split(l).filter(Boolean):[]}},function(e,t,r){e.exports=function(n){const o=n.toLowerCase();if(o!=="false"&&o!=="true")throw new Error('should be either "true", "false", "TRUE", or "FALSE"');return o!=="false"}},function(e,t,r){e.exports=function(n){const o=n.toLowerCase();if(["false","0","true","1"].indexOf(o)===-1)throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0');return!(o==="0"||o==="false")}},function(e,t,r){const n=r(91);e.exports=function(o){var l=n(o);if(l>65535)throw new Error("cannot assign a port number greater than 65535");return l}},function(e,t,r){const n=r(34);e.exports=function(o,l){const s=n(o);if(l.indexOf(s)<0)throw new Error(`should be one of [${l.join(", ")}]`);return s}},function(e,t,r){const n=r(51);e.exports=function(o){const l=n(o);if(l>0)throw new Error("should be a negative float");return l}},function(e,t,r){const n=r(51);e.exports=function(o){const l=n(o);if(l<0)throw new Error("should be a positive float");return l}},function(e,t,r){const n=r(50);e.exports=function(o){const l=n(o);if(l>0)throw new Error("should be a negative integer");return l}},function(e,t,r){const n=r(52);e.exports=function(o){var l=n(o);if(!Array.isArray(l))throw new Error("should be a parseable JSON Array");return l}},function(e,t,r){const n=r(52);e.exports=function(o){var l=n(o);if(Array.isArray(l))throw new Error("should be a parseable JSON Object");return l}},function(e,t,r){const n=r(92);e.exports=function(o){return n(o).toString()}},function(e,t,r){(function(n){(function(){var o,l,s,i,c,u;typeof performance!="undefined"&&performance!==null&&performance.now?e.exports=function(){return performance.now()}:n!=null&&n.hrtime?(e.exports=function(){return(o()-c)/1e6},l=n.hrtime,i=(o=function(){var b;return 1e9*(b=l())[0]+b[1]})(),u=1e9*n.uptime(),c=i-u):Date.now?(e.exports=function(){return Date.now()-s},s=Date.now()):(e.exports=function(){return new Date().getTime()-s},s=new Date().getTime())}).call(this)}).call(this,r(2))},function(e,t,r){var n,o,l=r(96),s=r(97),i=0,c=0;e.exports=function(u,b,A){var _=b&&A||0,v=b||[],f=(u=u||{}).node||n,S=u.clockseq!==void 0?u.clockseq:o;if(f==null||S==null){var w=l();f==null&&(f=n=[1|w[0],w[1],w[2],w[3],w[4],w[5]]),S==null&&(S=o=16383&(w[6]<<8|w[7]))}var P=u.msecs!==void 0?u.msecs:new Date().getTime(),N=u.nsecs!==void 0?u.nsecs:c+1,T=P-i+(N-c)/1e4;if(T<0&&u.clockseq===void 0&&(S=S+1&16383),(T<0||P>i)&&u.nsecs===void 0&&(N=0),N>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");i=P,c=N,o=S;var R=(1e4*(268435455&(P+=122192928e5))+N)%4294967296;v[_++]=R>>>24&255,v[_++]=R>>>16&255,v[_++]=R>>>8&255,v[_++]=255&R;var d=P/4294967296*1e4&268435455;v[_++]=d>>>8&255,v[_++]=255&d,v[_++]=d>>>24&15|16,v[_++]=d>>>16&255,v[_++]=S>>>8|128,v[_++]=255&S;for(var I=0;I<6;++I)v[_+I]=f[I];return b||s(v)}},function(e,t,r){var n=r(96),o=r(97);e.exports=function(l,s,i){var c=s&&i||0;typeof l=="string"&&(s=l==="binary"?new Array(16):null,l=null);var u=(l=l||{}).random||(l.rng||n)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,s)for(var b=0;b<16;++b)s[c+b]=u[b];return s||o(u)}},function(e,t,r){(function(n){(function(o){function l(i){if((i=i===void 0?"utf-8":i)!=="utf-8")throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+i+"') is invalid.")}function s(i,c){if(c=c===void 0?{fatal:!1}:c,(i=i===void 0?"utf-8":i)!=="utf-8")throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+i+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(o.TextEncoder&&o.TextDecoder)return!1;Object.defineProperty(l.prototype,"encoding",{value:"utf-8"}),l.prototype.encode=function(i,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");c=0;for(var u=i.length,b=0,A=Math.max(32,u+(u>>1)+7),_=new Uint8Array(A>>3<<3);c<u;){var v=i.charCodeAt(c++);if(55296<=v&&56319>=v){if(c<u){var f=i.charCodeAt(c);(64512&f)==56320&&(++c,v=((1023&v)<<10)+(1023&f)+65536)}if(55296<=v&&56319>=v)continue}if(b+4>_.length&&(A+=8,A=(A*=1+c/i.length*2)>>3<<3,(f=new Uint8Array(A)).set(_),_=f),(4294967168&v)==0)_[b++]=v;else{if((4294965248&v)==0)_[b++]=v>>6&31|192;else if((4294901760&v)==0)_[b++]=v>>12&15|224,_[b++]=v>>6&63|128;else{if((4292870144&v)!=0)continue;_[b++]=v>>18&7|240,_[b++]=v>>12&63|128,_[b++]=v>>6&63|128}_[b++]=63&v|128}}return _.slice(0,b)},Object.defineProperty(s.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(s.prototype,"fatal",{value:!1}),Object.defineProperty(s.prototype,"ignoreBOM",{value:!1}),s.prototype.decode=function(i,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");c=0;for(var u=(i=new Uint8Array(i)).length,b=[];c<u;){var A=i[c++];if(A===0)break;if((128&A)==0)b.push(A);else if((224&A)==192){var _=63&i[c++];b.push((31&A)<<6|_)}else if((240&A)==224){_=63&i[c++];var v=63&i[c++];b.push((31&A)<<12|_<<6|v)}else(248&A)==240&&(65535<(A=(7&A)<<18|(_=63&i[c++])<<12|(v=63&i[c++])<<6|63&i[c++])&&(A-=65536,b.push(A>>>10&1023|55296),A=56320|1023&A),b.push(A))}return String.fromCharCode.apply(null,b)},o.TextEncoder=l,o.TextDecoder=s})(typeof window!="undefined"?window:n!==void 0?n:this)}).call(this,r(5))},function(e,t,r){r.r(t),r.d(t,"AuthClient",function(){return l}),r.d(t,"RtcSignalingClient",function(){return i}),r.d(t,"Credentials",function(){return P}),r.d(t,"SignalingPromiseClient",function(){return N.SignalingPromiseClient}),r.d(t,"IRtcClientConfiguration",function(){}),r.d(t,"IRtcConnectConfiguration",function(){}),r.d(t,"IRtcConnectionStatsInfo",function(){}),r.d(t,"IRtcSendConfiguration",function(){}),r.d(t,"IRtcSessionMetricsMessageCounts",function(){}),r.d(t,"IRtcStreamMessage",function(){}),r.d(t,"IStreamControl",function(){}),r.d(t,"RtcClient",function(){return Ee}),r.d(t,"createRtcStreamMessage",function(){return X}),r.d(t,"IRtcStream",function(){}),r.d(t,"IRtcStreamPayload",function(){});var n=r(25),o=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class l extends n.a{adminSignup(q,$){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/admin-signup",{token:$,method:"POST",body:JSON.stringify(q)})})}login(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login",{method:"POST",body:JSON.stringify(q),allowUnsafeRetries:!0})})}loginWithGoogleToken(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login-google",{method:"POST",body:JSON.stringify(q),allowUnsafeRetries:!0})})}refresh(q,$){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/refresh",{method:"POST",body:JSON.stringify({refreshToken:q,tokenExpirationSeconds:$}),allowUnsafeRetries:!0})})}respondToNewPasswordRequiredChallenge(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/respond-to-new-password-required-challenge",{method:"POST",body:JSON.stringify(q)})})}forgotPassword(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/forgot-password",{method:"POST",body:JSON.stringify({email:q})})})}confirmForgotPassword(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/confirm-forgot-password",{method:"POST",body:JSON.stringify(q)})})}resendInvitation(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/resend-invitation",{method:"POST",body:JSON.stringify({email:q})})})}changePassword({token:q,refreshToken:$,currentPassword:te,newPassword:ue}){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/change-password",{token:q,method:"POST",body:JSON.stringify({refreshToken:$,currentPassword:te,newPassword:ue})})})}getDeviceCredentials(q){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/device-credentials",{token:q,method:"POST",allowUnsafeRetries:!0})})}impersonate(q,$){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/impersonate",{token:q,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({userId:$})})})}createServiceAccount(q,$,te,ue){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/service-account",{token:q,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({name:$,roleId:te,tags:ue})})})}getFeatures(q){return o(this,void 0,void 0,function*(){return(yield this.fetch("auth/features",{token:q})).features})}}var s=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class i extends n.a{createPeer(q,$){return s(this,void 0,void 0,function*(){return yield this.fetch("peers",{token:q,method:"POST",body:JSON.stringify($)})})}getPeers(q){return s(this,void 0,void 0,function*(){return(yield this.fetch("peers",{token:q})).items})}refreshPeer(q,$){return s(this,void 0,void 0,function*(){yield this.fetch(`peers/${$}/refresh`,{token:q,method:"POST",allowUnsafeRetries:!0})})}createSession(q,$){return s(this,void 0,void 0,function*(){return yield this.fetch("sessions",{token:q,method:"POST",body:JSON.stringify($)})})}refreshSession(q,$){return s(this,void 0,void 0,function*(){yield this.fetch(`sessions/${$}/refresh`,{token:q,method:"POST",allowUnsafeRetries:!0})})}deleteSession(q,$){return s(this,void 0,void 0,function*(){yield this.fetch(`sessions/${$}`,{token:q,method:"DELETE",allowUnsafeRetries:!0})})}getSessions(q){return s(this,void 0,void 0,function*(){return(yield this.fetch("sessions",{token:q})).items})}getIceServers(q){return s(this,void 0,void 0,function*(){return(yield this.fetch("ice-servers",{token:q})).items})}addSignals(q,$,te){return s(this,void 0,void 0,function*(){yield this.fetch(`sessions/${$}/add-signals`,{token:q,method:"POST",body:JSON.stringify(te)})})}takeSignals(q,$){return s(this,void 0,void 0,function*(){return(yield this.fetch(`sessions/${$}/take-signals`,{token:q,method:"POST"})).items})}}var c=r(1),u=r(11),b=r(35),A=r.n(b),_=r(102),v=r.n(_),f=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class S extends class{constructor(q){this.cache=new v.a(Object.assign(Object.assign({},q.dispose||q.disposeAfter?{ttlAutopurge:!0}:{}),q)),this.stringify=q.fastStringify?JSON.stringify:A.a}set(q,$,te){const ue=this.stringify(q);if(!this.cache.set(ue,$,{ttl:te})){const ae=this.cache.sizeCalculation?this.cache.sizeCalculation($,ue):"unknown";throw Error(`Value too large (${ae} > ${this.cache.max})`)}}get(q){return this.cache.get(this.stringify(q))}delete(q){this.cache.delete(this.stringify(q))}size(){return this.cache.size}clear(){this.cache.clear()}forEach(q){return this.cache.forEach(q)}}{constructor(q){if(super(q),this.expireRejectedPromiseValues=q.expireRejectedPromiseValues===void 0||q.expireRejectedPromiseValues,this.rejectedPromiseValueTtl=q.rejectedPromiseValueTtl!==void 0?q.rejectedPromiseValueTtl:c.a.second,this.rejectedPromiseValueTtl<0)throw new Error("rejectedPromiseValueTtl must not be negative")}set(q,$,te){const ue=this.stringify(q);this.cache.set(ue,$,{ttl:te}),this.expireRejectedPromiseValues&&Promise.resolve($).catch(()=>f(this,void 0,void 0,function*(){yield Object(u.a)(this.rejectedPromiseValueTtl),this.cache.peek(ue)===$&&this.cache.delete(ue)}))}}var w=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class P{constructor(q,$,te){this.authClient=q,this.email=$,this.password=te,this.tokenTtlMs=1*c.a.hour,this.tokenCache=new S({max:100,ttl:this.tokenTtlMs-5*c.a.minute,fastStringify:!0})}getToken(){return w(this,void 0,void 0,function*(){let q=this.tokenCache.get(this.email);return q||(q=(()=>w(this,void 0,void 0,function*(){const{authentication:$}=yield this.authClient.login({email:this.email,password:this.password,tokenExpirationSeconds:this.tokenTtlMs/c.a.second});if(!$)throw new Error("User account not verified.");return $.accessToken}))(),this.tokenCache.set(this.email,q)),q})}}var N=r(93),T=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};function R(ye){return T(this,void 0,void 0,function*(){return(yield Promise.all(ye.map(q=>q.catch($=>$)))).filter(q=>q instanceof Error)})}function d(ye){if(ye!==void 0)return ye;throw new Error("Value is undefined")}var I=r(0),Q=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};function Z({func:ye,delay:q,immediate:$}){let te=!1,ue=setTimeout(function de(){return Q(this,void 0,void 0,function*(){if(te)return;const me=new Date().getTime();try{ae=ye(),yield ae}finally{if(!te){const pe=new Date().getTime();ue=setTimeout(de,Math.max(q-(pe-me),0))}}})},$?0:q),ae=Promise.resolve();return{stop(){return Q(this,void 0,void 0,function*(){te=!0,clearTimeout(ue),yield ae})}}}function h(ye,q){return Object.keys(ye).reduce(($,te)=>Object.assign(Object.assign({},$),{[te]:q(ye[te])}),{})}var p=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class C{constructor(q){this.message=q}send(q){return p(this,void 0,void 0,function*(){I.a.info(this.message,h(q,$=>{const{sum:te,count:ue}=$,ae=te/ue;return Object.assign(Object.assign({},$),{average:ae})}))})}}var m=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};const x=r(222);var F=r(6);const D=!!F.c,O=new class{constructor(ye=60){this.buffer={},this.metrics={},this.reporters=[],this.flushInterval=Z({func:()=>this.flushStats(),delay:ye*c.a.second})}shutdown(){return m(this,void 0,void 0,function*(){yield this.flushInterval.stop(),yield this.flushStats(),yield Object(u.a)(2*c.a.second)})}aggregate(ye,q){if(this.buffer[ye]){const{min:$,max:te,sum:ue,count:ae}=this.buffer[ye];this.buffer[ye]={min:Math.min($,q),max:Math.max(te,q),sum:ue+q,count:ae+1}}else this.buffer[ye]={min:q,max:q,sum:q,count:1}}increment(ye){this.aggregate(ye,1)}timer(ye,q){return m(this,void 0,void 0,function*(){const $=x(),te=yield q(),ue=x();return this.aggregate(ye,ue-$),te})}metric(ye,q){this.metrics[ye]=q}registerStatsReporter(ye){this.reporters.push(ye)}write(ye){return m(this,void 0,void 0,function*(){if(Object.values(ye).length===0)return;const q=yield R(this.reporters.map($=>$.send(ye)));for(const $ of q)I.a.warn("Failed to write stats",{error:$})})}flushStats(){return m(this,void 0,void 0,function*(){const ye=Object.assign(Object.assign({},this.buffer),h(this.metrics,q=>{const $=q();return{min:$,max:$,sum:$,count:1}}));Object.keys(ye).length>0&&(yield this.write(ye),this.buffer={})})}};D||["local","on-prem"].includes(F.i)||O.registerStatsReporter(new C("stats"));var L=r(8),k=r(21),E=r(103),g=r(36),U=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class B extends g.a{constructor(q){super(q)}postLanRtcOffer(q){return U(this,void 0,void 0,function*(){return yield this.fetch("v1/lan-rtc-offer",{method:"POST",body:JSON.stringify(q)})})}}var G=r(55);const Y={ordered:!1,maxPacketLifeTime:300*c.a.millisecond},K={ordered:!0},H={ordered:!0},V={ordered:!1,maxRetransmits:0},y={ordered:!1,maxRetransmits:0};function j({entityId:ye,streamName:q,streamType:$}){return`${ye}.${q}.${$}`}var W=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class ee{constructor(q,$){this.sessionId=q,this.connection=$,this.counts={localSent:new Map,localReceived:new Map,remoteSent:new Map,remoteReceived:new Map},this.sessionId=q,this.connection=$}updateRemoteMessagesCounts(q){if(q.payload.streamsInfo){this.counts.remoteSent=new Map,this.counts.remoteReceived=new Map;for(const $ of q.payload.streamsInfo.items)this.counts.remoteSent.set($.streamId,$.sentCount),this.counts.remoteReceived.set($.streamId,$.receivedCount)}}getLocalStreamsInfo(q){const{localSent:$,localReceived:te}=this.counts;return{items:[...new Set([...$.keys(),...te.keys()])].map(ue=>{var ae,de;return{streamId:ue,sentCount:(ae=$.get(ue))!==null&&ae!==void 0?ae:0,receivedCount:(de=te.get(ue))!==null&&de!==void 0?de:0}}),timestamp:q}}incrementLocalSent(q){const{localSent:$}=this.counts,te=j(q.header.stream);$.set(te,($.get(te)||0)+1)}incrementLocalReceived(q){const{localReceived:$}=this.counts,te=j(q.header.stream),ue=$.get(te)||0;if(ue===0){const{streamName:ae,streamType:de}=q.header.stream;I.a.debug("RTC client received first message for stream",{streamName:ae,streamType:de})}$.set(te,ue+1)}uploadMetrics(){return W(this,void 0,void 0,function*(){const{sessionId:q}=this,$=yield this.connection.peerConnection.getStats(),te={};$.forEach(ge=>te[ge.id]=ge),I.a.debug("rtc-stats",Object.assign(Object.assign({},te),{sessionId:q}));const{localSent:ue,localReceived:ae,remoteSent:de,remoteReceived:me}=this.counts,pe=[...new Set([...ue.keys(),...ae.keys()])].reduce((ge,ce)=>{const Te=ue.get(ce),Re=ae.get(ce),Pe=de.get(ce),Le=me.get(ce);return Object.assign(Object.assign({},ge),{[`local-${ce}-sent`]:Te,[`local-${ce}-received`]:Re,[`remote-${ce}-sent`]:Pe,[`remote-${ce}-received`]:Le})},{sessionId:q});I.a.debug("rtc-message-report",Object.assign({deviceId:this.connection.getRemoteDeviceId()},pe))})}}function X(ye,q){return{header:{stream:ye,created:Date.now(),frameId:""},payload:q}}function ne(ye){return new Set(["disconnected","failed","closed"]).has(ye.iceConnectionState)}var ie=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class he{constructor(q,$,te){this.peerConnection=q,this.config=$,this.dataChannelNotifier=te,this.connectTimeoutMs=20*c.a.second,this.iceGatheringTimeoutMs=15*c.a.second,this.pingUpdateTimeoutMs=1*c.a.second,this.streamsInfoUpdateTimeoutMs=2*c.a.second,this.reassemblyTimeoutMs=500*c.a.millisecond,this.reassemblyTableCleanupMs=1*c.a.second,this.heartbeatTimeoutMs=20*c.a.millisecond,this.streamLatestTimestamp=new Map,this.reassemblyTable=new Map,this.reassemblyTableLastTimestamp=new Map,this.closeCalled=!1,this.gotOffer=!1,this.hasIceCandidate=!1;const{isOffer:ue}=$.baseConfig;ue?this.initializeChannels(q):q.ondatachannel=ae=>{switch(ae.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ae.channel;break;case"stream.reliable":this.reliableStreamChannel=ae.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ae.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ae.channel;break;case"heartbeat":return void(this.heartbeatChannel=ae.channel);default:return void this.dataChannelNotifier(ae.channel)}this.setupChannel(ae.channel)},this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ae}=this;ae&&this.sendSystemMessage(ae,{type:"ping"})},this.pingUpdateTimeoutMs),this.streamsInfoUpdateTimeout=setInterval(()=>{const{latestTtlStreamChannel:ae}=this;ae&&this.sendSystemMessage(ae,{type:"streams-info"})},this.streamsInfoUpdateTimeoutMs),this.reassemblyTableCleanupTimeout=setInterval(()=>{const ae=new Date().getTime();this.reassemblyTableLastTimestamp.forEach((de,me,pe)=>{ae>me+this.reassemblyTimeoutMs&&this.reassemblyTable.delete(de)})},this.reassemblyTableCleanupMs),this.heartbeatTimeout=setInterval(()=>{const{heartbeatChannel:ae}=this;ae&&ae.readyState==="open"&&ae.send(new Uint8Array([1]))},this.heartbeatTimeoutMs)}handleSignal(q){return ie(this,void 0,void 0,function*(){const{peerConnection:$}=this,{track:te}=this.config.baseConfig,ue=(()=>{try{return JSON.parse(q.getPayload())}catch{return}})();if(!ue)return void I.a.error("Received unparseable signal.");I.a.debug("Handling signal",{description:ue});const{sdp:ae,type:de}=ue;if(!ae||!de)return void I.a.warn("Received non-SDP signal");const{signalingState:me,connectionState:pe}=$;if(me!=="stable"||pe!=="connected")if($.remoteDescription)I.a.warn(`Received SDP after remote description was set: ${ae}`);else{if(de==="offer"){if(me!=="stable")return void I.a.warn("Received offer SDP when signaling is ongoing.");yield $.setRemoteDescription(ue);const ge=yield $.createAnswer();yield $.setLocalDescription(ge);const ce=q.clone();return te==null||te("Answer Received",ce),ce.setPayload(JSON.stringify(ge)),ce.setReceiverId(q.getSenderId()),ce.setSenderId(q.getReceiverId()),ce}if(de==="answer"){if(me==="stable")return void I.a.warn("Received answer SDP when signaling hasn't started.");yield $.setRemoteDescription(ue)}}else I.a.warn(`Received SDP when already connected: ${ae}`)})}send(q,$){const te=this.getChannelFromLabel($.channelLabel);te?this.sendOnChannel(te,q):I.a.warn("Send called with unexpected channel label",{channelLabel:$.channelLabel})}controlRemoteStream(q){this.sendSystemMessage(d(this.reliableStreamChannel),{type:"stream-control",streamControl:q})}isActive(){return new Set(["new","checking","connected","completed"]).has(this.peerConnection.iceConnectionState)||this.isReady()}isReady(){const{reliableStreamChannel:q,latestTtlStreamChannel:$,latestTryOnceStreamChannel:te,latestReliableStreamChannel:ue}=this;return(q==null?void 0:q.readyState)==="open"&&($==null?void 0:$.readyState)==="open"&&(te==null?void 0:te.readyState)==="open"&&(ue==null?void 0:ue.readyState)==="open"}close(){return ie(this,void 0,void 0,function*(){if(this.closeCalled)return;this.closeCalled=!0,this.sessionMetrics&&(yield this.sessionMetrics.uploadMetrics()),this.pingUpdateTimeout&&clearInterval(this.pingUpdateTimeout),this.reassemblyTableCleanupTimeout&&clearInterval(this.reassemblyTableCleanupTimeout),this.streamsInfoUpdateTimeout&&clearInterval(this.streamsInfoUpdateTimeout),this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout);const{peerConnection:q,reliableStreamChannel:$,latestTtlStreamChannel:te,latestTryOnceStreamChannel:ue,latestReliableStreamChannel:ae}=this;q.close(),$==null||$.close(),te==null||te.close(),ue==null||ue.close(),ae==null||ae.close()})}getPing(){return this.pingTimeMs}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionCreatedTimestamp(){var q;return(q=this.config.remoteConfig)===null||q===void 0?void 0:q.sessionCreatedTimestamp}setSessionCreatedTimestamp(q){this.config.remoteConfig&&(this.config.remoteConfig.sessionCreatedTimestamp=q)}getSessionId(){var q;return(q=this.config.remoteConfig)===null||q===void 0?void 0:q.sessionId}setSessionId(q){this.config.remoteConfig&&(this.config.remoteConfig.sessionId=q,this.sessionMetrics=new ee(q,this))}getRemotePeerId(){return this.config.baseConfig.remotePeerId}getRemoteDeviceId(){var q;return(q=this.config.baseConfig)===null||q===void 0?void 0:q.remoteDeviceId}setRemoteDeviceId(q){this.config.baseConfig.remoteDeviceId=q}getSessionMetricsMessageCounts(){var q;return(q=this.sessionMetrics)===null||q===void 0?void 0:q.counts}getConnectionStatsInfo(){return ie(this,void 0,void 0,function*(){const{peerConnection:q}=this;if(!q)return;const $=yield q.getStats(null),te=[];$.forEach(pe=>{te.push(pe)});const ue=te.find(pe=>pe.type==="transport");if(!ue)return;const ae=te.find(pe=>(pe.type==="candidate-pair"||pe.type==="candidatepair")&&pe.id===ue.selectedCandidatePairId);if(!ae)return;const de=te.find(pe=>pe.id===ae.localCandidateId),me=te.find(pe=>pe.id===ae.remoteCandidateId);return de&&me&&(de.address=de.address||de.ip,me.address=me.address||me.ip,de.address!==void 0&&me.address!==void 0)?{transport:ue,localCandidate:de,remoteCandidate:me}:void 0})}initializeChannels(q){this.heartbeatChannel=q.createDataChannel("heartbeat",y),this.heartbeatChannel.binaryType="arraybuffer",this.latestTtlStreamChannel=q.createDataChannel("stream.latest-ttl",Y),this.latestTtlStreamChannel.binaryType="arraybuffer",this.reliableStreamChannel=q.createDataChannel("stream.reliable",K),this.reliableStreamChannel.binaryType="arraybuffer",this.latestReliableStreamChannel=q.createDataChannel("stream.latest-reliable",H),this.latestReliableStreamChannel.binaryType="arraybuffer",this.latestTryOnceStreamChannel=q.createDataChannel("stream.latest-try-once",V),this.latestTryOnceStreamChannel.binaryType="arraybuffer",this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}getOffer(){var q,$,te;return ie(this,void 0,void 0,function*(){const{gotOffer:ue}=this,{peerConnection:ae,config:de}=this;if(this.config.baseConfig.isLan)throw new Error('"getOffer" method can only be called with internet connections. LAN connections should call the "getLanOffer" method.');const me=(q=this.config.remoteConfig)===null||q===void 0?void 0:q.sessionId;if(ue)return void I.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,ne(this.peerConnection))return void I.a.debug("Failed to generate offer because the peer connection was inactive.");const pe=de.baseConfig.track;ae.onicecandidate=()=>{this.hasIceCandidate=!0},ae.oniceconnectionstatechange=()=>ie(this,void 0,void 0,function*(){const Pe=ae.iceConnectionState;if(Pe==="connected"||Pe==="completed"){const Le=yield this.getConnectionStatsInfo(),Fe=Le?function(ze){const De=ze.localCandidate.candidateType,We=ze.remoteCandidate.candidateType;return De==="host"&&We==="host"?"local":De==="relay"||We==="relay"?"TURN":"STUN"}(Le):void 0;I.a.info(`ICE connection state changed to ${Pe}`,{sessionId:me,connectionStatsInfo:Le,iceMode:Fe}),pe==null||pe("ICE connection state change",{iceConnectionState:Pe,sessionId:me,connectionStatsInfo:Le,iceMode:Fe})}}),yield ae.setLocalDescription(yield ae.createOffer());const ge=new Date().getTime();for(;;){const Pe=new Date().getTime()-ge;if(Pe>this.connectTimeoutMs)return void I.a.debug("Failed to generate offer because ICE gathering timed out.");if(Pe>this.iceGatheringTimeoutMs&&this.hasIceCandidate){I.a.debug("ICE gathering partially completed; proceeding",{iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe}),pe==null||pe("ICE gathering partially completed",{sessionId:me,iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe});break}if(ae.iceGatheringState==="complete"){I.a.debug("ICE gathering complete",{iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe}),pe==null||pe("ICE gathering completed",{sessionId:me,iceTransportPolicy:ae.getConfiguration().iceTransportPolicy,waitTime:Pe});break}yield Object(u.a)(.1*c.a.second)}const ce=($=this.peerConnection.getConfiguration().iceServers)!==null&&$!==void 0?$:[];for(const Pe of ce)Pe.credentialType=void 0;const Te=JSON.stringify(ce),Re=new L.Signal;return Re.setPayload(JSON.stringify(ae.localDescription)),Re.setSenderId(this.config.baseConfig.localPeerId),Re.setReceiverId(this.config.baseConfig.remotePeerId),Re.setIceServers(Te),Re.setIceTransportPolicy((te=this.peerConnection.getConfiguration().iceTransportPolicy)!==null&&te!==void 0?te:"all"),this.config.baseConfig.sessionType!==void 0?Re.setSessionType(this.config.baseConfig.sessionType):Re.setSessionType(L.SessionType.TELEOP),I.a.debug("Sending offer signal with description",{description:Re.getPayload()}),Re})}getLanOffer(){return ie(this,void 0,void 0,function*(){const{peerConnection:q,gotOffer:$}=this;if(!this.config.baseConfig.isLan)throw new Error('"getLanOffer" method can only be used with LAN connections. Internet connections should call the "getOffer" method.');if($)return void I.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,ne(this.peerConnection))return void I.a.debug("Failed to generate offer because the peer connection was inactive.");yield q.setLocalDescription(yield q.createOffer());const te=new Date().getTime();for(;;){if(new Date().getTime()-te>this.iceGatheringTimeoutMs)return void I.a.debug("Failed to generate offer because ICE gathering timed out.");if(q.iceGatheringState==="complete")break;yield Object(u.a)(.1*c.a.second)}const ue=q.localDescription;if(ue)return I.a.debug("Sending LAN offer signal with description",{description:ue}),ue;I.a.error("Failed to generate LAN offer description")})}handleLanAnswer(q){return ie(this,void 0,void 0,function*(){const{peerConnection:$}=this;if(!this.config.baseConfig.isLan)throw new Error('"handleLanAnswer" method can only be used with LAN connections. Internet connections should call the "handleSignal" method.');yield $.setRemoteDescription(q)})}getChannelFromLabel(q){switch(q){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(q,$){let te;try{te=Object(G.encode)(JSON.stringify($))}catch(ue){return void I.a.warn("Failed to encode RTC message",{error:ue})}try{q.send(te),this.sessionMetrics&&this.sessionMetrics.incrementLocalSent($)}catch(ue){I.a.warn("Failed to send message to channel",{error:ue,channel:q.label})}}channelNotRecognized(q){return q!==this.latestTtlStreamChannel&&q!==this.latestReliableStreamChannel&&q!==this.latestTryOnceStreamChannel&&q!==this.reliableStreamChannel}setupChannel(q){q.onmessage=$=>{if(this.channelNotRecognized(q))return void I.a.warn("Received message on unrecognized data channel.");let te;try{te=JSON.parse(Object(G.decode)($.data))}catch(ue){return void I.a.warn("Received unparseable message on RTC stream data channel",{error:ue,channel:q.label})}te.communicationType==="message-chunk"?this.receiveChannelMessageChunk(q,te):this.receiveChannelMessage(q,te)},q.onerror=$=>{I.a.warn(`Channel error: ${$.error}`,{error:$.error,sessionId:this.getSessionId(),channelLabel:q.label})},q.onopen=()=>{I.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:q.label})},q.onclose=()=>{const $={bufferedAmount:q.bufferedAmount,sessionId:this.getSessionId(),channelLabel:q.label};this.closeCalled===!1?I.a.debug("Unexpected channel closed",$):I.a.debug("Channel closed",$)}}receiveChannelMessage(q,$){const{config:te}=this,{remotePeerId:ue}=this.config.baseConfig;this.lastMessageTimestamp=new Date().getTime(),$=function(ae){switch(ae.header.stream.streamType){case"twist":{const{twist:de}=ae.payload;if(!de)throw Error("twist not in payload of RTC message with type twist");return{header:ae.header,payload:{twist:{linear:Object.assign({x:0,y:0,z:0},de.linear),angular:Object.assign({x:0,y:0,z:0},de.angular)}}}}case"pose":{const{pose:de}=ae.payload;if(!de)throw Error("pose not in payload of RTC message with type pose");return{header:ae.header,payload:{pose:{translation:Object.assign({x:0,y:0,z:0},de.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},de.rotation)}}}}case"pose-with-covariance":{const{poseWithCovariance:de}=ae.payload;if(!de)throw Error("poseWithCovariance not in payload of RTC message with type pose-with-covariance");const me=new Array(36).fill(0);return de.covariance.forEach((pe,ge)=>{if(ge>=36)throw Error("covariance contains more than 36 elements");me[ge]=pe}),{header:ae.header,payload:{poseWithCovariance:{pose:{translation:Object.assign({x:0,y:0,z:0},de.pose.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},de.pose.rotation)},covariance:me}}}}case"point":{const{point:de}=ae.payload;if(!de)throw Error("point not in payload of RTC message with type point");return{header:ae.header,payload:{point:Object.assign({x:0,y:0,z:0},de)}}}default:return ae}}($),this.sessionMetrics&&this.sessionMetrics.incrementLocalReceived($),this.handleSystemMessage(q,$)||(q===this.latestTryOnceStreamChannel||q===this.latestTtlStreamChannel||q===this.latestReliableStreamChannel)&&!this.isLatestMessage($)||te.baseConfig.receive(ue,$)}receiveChannelMessageChunk(q,$){const te=this.reassemblyTable.get($.id)||[];if(te.push($),te.length===$.total){const ue=function(ae){const de=ae.sort((me,pe)=>me.seq<pe.seq?-1:1).map(me=>me.part).reduce((me,pe)=>me+pe);try{return JSON.parse(de)}catch{return void I.a.warn("Could not reassemble RTC message chunks")}}(te);return ue&&this.receiveChannelMessage(q,ue),void this.reassemblyTable.delete($.id)}this.reassemblyTable.set($.id,te),this.reassemblyTableLastTimestamp.set($.id,new Date().getTime())}handleSystemMessage(q,$){var te,ue;const{config:ae}=this,{baseConfig:de}=ae,{remotePeerId:me}=de;switch($.header.stream.streamType){case"ping":return this.sendSystemMessage(q,{type:"pong",timestamp:d($.payload.ping)}),!0;case"pong":{const pe=new Date().getTime()-d($.payload.pong);return this.pingTimeMs=pe,O.aggregate("rtc-ping-time",pe),!0}case"streams-info":{const{sessionMetrics:pe}=this,ge=(te=$.payload.streamsInfo)===null||te===void 0?void 0:te.timestamp;return!!ge&&(pe==null||pe.updateRemoteMessagesCounts($),(ue=de.onStreamsInfoUpdate)===null||ue===void 0||ue.call(de,me,ge),!0)}case"stream-control":return!0;default:return!1}}sendSystemMessage(q,$){var te;const{localUserId:ue,localPeerId:ae}=this.config.baseConfig;if(q.readyState!=="open")return;const de={entityId:ue!=null?ue:ae,streamName:`$.${$.type}`,streamType:$.type};let me;switch($.type){case"ping":me={ping:new Date().getTime()};break;case"pong":me={pong:$.timestamp};break;case"stream-control":me={streamControl:$.streamControl};break;case"streams-info":me={streamsInfo:(te=this.sessionMetrics)===null||te===void 0?void 0:te.getLocalStreamsInfo(new Date().getTime())}}this.sendOnChannel(q,X(de,me))}isLatestMessage(q){const $=j(q.header.stream),te=(this.streamLatestTimestamp.get($)||0)<=q.header.created;return te&&this.streamLatestTimestamp.set($,q.header.created),te}}function Se(ye){var q,$;return{userId:(q=ye.getUserId())===null||q===void 0?void 0:q.getValue(),deviceId:($=ye.getDeviceId())===null||$===void 0?void 0:$.getValue(),organizationId:ye.getOrganizationId(),id:ye.getPeerId(),capabilities:[],capabilitySet:{}}}var we=function(ye,q,$,te){return new($||($=Promise))(function(ue,ae){function de(ge){try{pe(te.next(ge))}catch(ce){ae(ce)}}function me(ge){try{pe(te.throw(ge))}catch(ce){ae(ce)}}function pe(ge){var ce;ge.done?ue(ge.value):(ce=ge.value,ce instanceof $?ce:new $(function(Te){Te(ce)})).then(de,me)}pe((te=te.apply(ye,q||[])).next())})};class Ee{constructor(q){this.config=q,this.grpcCallDeadline=5*c.a.second,this.refreshIntervalDelayMs=2*c.a.second,this.iceServersTtl=30*c.a.minute,this.connections=[],this.localConnections=[],this.isConnectionInitiator=new Map,this.isOutgoingConnection=new Map,this.peerDataChannelListeners=[];const{refreshIntervalDelayMs:$}=this;this.refreshInterval=Z({func:()=>we(this,void 0,void 0,function*(){try{yield this.update()}catch(te){I.a.warn("RTC refresh failed",{error:te})}}),delay:$,immediate:!0})}send(q,$,te){const ue=this.getActiveConnection(q);ue?ue.isReady()?ue.send($,te):I.a.warn("Send called with unready connection."):I.a.warn("Send called with no connection.")}controlRemoteStream(q,$){const te=this.getActiveConnection(q);te?te.isReady()?te.controlRemoteStream($):I.a.warn("controlRemoteStream called with unready connection."):I.a.warn("controlRemoteStream called with no connection.")}getLocalPeer(){return we(this,void 0,void 0,function*(){for(;!this.localPeer;)yield Object(u.a)(.1*c.a.second);return Se(this.localPeer)})}connect(q,$){var te,ue,ae;return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode===!0)throw new Error("connect method called in local only mode.");const{track:de,signalingClient:me}=this.config,{localPeer:pe,receiveSignalStream:ge,iceServers:ce}=this;if(!pe||!ge||!ce)return void I.a.warn("Connect called prior to local peer, receiveSignalStream, and ICE servers ready");if(this.getActiveConnection(q))return void I.a.warn("Connect called for peer with existing connection.");if(this.isOutgoingConnection.get(q))return void I.a.warn("Connect called for peer with an existing outgoing connection offer.");this.isOutgoingConnection.set(q,!0);const Te=new he(yield this.createRTCPeerConnection(ce,$),{baseConfig:{isOffer:!0,isLan:!1,receive:(De,We)=>this.config.receive(De,We),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(De,We)=>{var Be,ke;return(ke=(Be=this.config).onStreamsInfoUpdate)===null||ke===void 0?void 0:ke.call(Be,De,We)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(te=pe.getUserId())===null||te===void 0?void 0:te.getValue(),localPeerId:pe.getPeerId(),remotePeerId:q,sessionType:$==null?void 0:$.sessionType},remoteConfig:{}},De=>this.onCustomDataChannel(q,De)),Re=yield Te.getOffer();if(!Re)return I.a.error("Failed to generate offer."),void this.isOutgoingConnection.delete(q);I.a.debug("Sending offer."),de==null||de("Sending offer",Re);const Pe=new L.SendSignalRequest;Pe.setSignal(Re);const Le=yield(()=>we(this,void 0,void 0,function*(){try{return yield me.sendSignal(Pe,yield this.getMetadata({}))}catch(De){I.a.warn("Error when sending signal",{error:De})}}))();if(!this.isOutgoingConnection.get(q))return void I.a.debug("No offer set after receiving offer signal response.");I.a.debug("Offer sent.");const Fe=(ue=Le==null?void 0:Le.getSessionId())===null||ue===void 0?void 0:ue.getValue(),ze=(ae=Le==null?void 0:Le.getSessionCreatedTimestamp())===null||ae===void 0?void 0:ae.getValue();return Fe&&ze?(Te.setSessionId(Fe),Te.setSessionCreatedTimestamp(ze),this.isOutgoingConnection.delete(q),this.connections.push(Te),this.isConnectionInitiator.set(Te,!0),this.setupHandlers(Te),Fe):(I.a.warn("No session ID or no session created timestamp on send signal response."),void this.isOutgoingConnection.delete(q))})}connectLan(q){var $,te;return we(this,void 0,void 0,function*(){const ue=new B(q),ae=new he(yield this.createRTCPeerConnection([]),{baseConfig:{isOffer:!0,isLan:!0,receive:(ge,ce)=>this.config.receive(ge,ce),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(ge,ce)=>{var Te,Re;return(Re=(Te=this.config).onStreamsInfoUpdate)===null||Re===void 0?void 0:Re.call(Te,ge,ce)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(te=($=this.localPeer)===null||$===void 0?void 0:$.getUserId())===null||te===void 0?void 0:te.getValue(),localPeerId:"lan_client",remotePeerId:q}},ge=>this.onCustomDataChannel(q,ge)),de=yield ae.getLanOffer();if(!de)return I.a.warn("Could not generate LAN offer"),!1;const me=yield ue.postLanRtcOffer({offer:JSON.stringify(de)}),pe=new RTCSessionDescription(JSON.parse(me.answer));return yield ae.handleLanAnswer(pe),this.localConnections.push(ae),this.isConnectionInitiator.set(ae,!0),Object(E.v4)()})}getConnections(){return[...this.connections,...this.localConnections]}createCustomDataChannel(q,$,te,ue,ae){const de=this.getActiveConnection(q);if(de&&this.isConnectionInitiator.has(de)){const pe=de.peerConnection.createDataChannel("custom."+$,te);return ue&&(pe.binaryType="arraybuffer"),ae(q,pe),()=>{}}const me=(pe,ge)=>{q===pe&&ge.label==="custom."+$&&ae(q,ge)};return this.peerDataChannelListeners.push(me),()=>{this.peerDataChannelListeners=this.peerDataChannelListeners.filter(pe=>pe!==me)}}onCustomDataChannel(q,$){this.peerDataChannelListeners.forEach(te=>te(q,$))}getConnectionStatus(q){if(this.isOutgoingConnection.get(q))return"connecting";const $=this.getActiveConnection(q);return $?$.isReady()?"connected":"connecting":"disconnected"}getConnectionStatsInfo(q){return we(this,void 0,void 0,function*(){const $=this.getActiveConnection(q);if($)return yield $.getConnectionStatsInfo()})}disconnect(q){return we(this,void 0,void 0,function*(){const $=this.getActiveConnection(q);$&&(yield $.close())})}getPeers(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:q}=this.config,$=yield(()=>we(this,void 0,void 0,function*(){try{return yield q.getPeers(new L.GetPeersRequest,yield this.getMetadata({}))}catch(ae){I.a.warn("Error when getting peers",{error:ae})}}))();if(!$)return[];const te=$.getPeersList();if(!te)return[];const ue=ae=>{var de,me;return(me=(de=ae.getPeerCreatedTimestamp())===null||de===void 0?void 0:de.getValue())!==null&&me!==void 0?me:0};return te.sort((ae,de)=>ue(de)-ue(ae)).map(ae=>Se(ae))})}getSessions(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:q}=this.config,$=yield(()=>we(this,void 0,void 0,function*(){try{return yield q.getPeers(new L.GetPeersRequest,yield this.getMetadata({}))}catch(ae){I.a.warn("Error when getting peers",{error:ae})}}))();if(!$)return{};const te=$.getPeersList(),ue={};for(const ae of te)ue[ae.getPeerId()]=ae.getSessionIdsList();return ue})}getPing(q){const $=this.getActiveConnection(q);if($)return $.getPing();I.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(q){const $=this.getActiveConnection(q);if($)return $.getLastMessageTimestamp();I.a.warn("Attempted to get last message time from inactive peer.")}getSessionMetricsMessageCounts(q){const $=this.getActiveConnection(q);if($)return $.getSessionMetricsMessageCounts();I.a.warn("Attempted to get session metrics counts from inactive peer.")}isReady(){if(this.config.lanOnlyMode)return!0;const{localPeer:q,receiveSignalStream:$,iceServers:te}=this;return!!(q&&$&&te)}shutdown(){return we(this,void 0,void 0,function*(){I.a.info("Shutdown called on RTC client"),yield this.refreshInterval.stop(),this.receiveSignalStream&&this.receiveSignalStream.cancel();const q=this.connections;this.connections=[],yield this.closeConnections(q);const{localPeer:$}=this;if(!$||this.config.lanOnlyMode)return;const{signalingClient:te}=this.config;yield(()=>we(this,void 0,void 0,function*(){try{const ue=new L.DeletePeerRequest;ue.setPeerId($.getPeerId()),yield te.deletePeer(ue,yield this.getMetadata({}))}catch(ue){return void I.a.warn("Error deleting local peer",{error:ue})}}))()})}createPeer(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createPeer method cannot be used in local-only mode.");const{signalingClient:q}=this.config,$=yield(()=>we(this,void 0,void 0,function*(){try{return yield q.createPeer(new L.CreatePeerRequest,yield this.getMetadata({}))}catch(ue){throw new Error(`Was not able to create peer: ${JSON.stringify(ue)}`)}}))(),te=$==null?void 0:$.getPeer();if(!te)throw new Error("Response did not provide peer.");return this.localPeer=te})}createReceiveSignalStream(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createReceiveSignalStream method cannot be used in local-only mode.");const{signalingClient:q}=this.config,{localPeer:$,iceServers:te}=this;if(!$||!te)return;const{receiveSignalStream:ue}=this;ue&&ue.cancel();const ae=new L.ReceiveSignalStreamRequest;ae.setPeerId($.getPeerId());const de=yield(()=>we(this,void 0,void 0,function*(){try{return q.receiveSignalStream(ae,yield this.getMetadata({hasDeadline:!1}))}catch(me){throw new Error(`Unable to create receive signal stream: ${JSON.stringify(me)}`)}}))();if(!de)throw new Error("Response did not provide stream.");return de.on("data",me=>we(this,void 0,void 0,function*(){var pe,ge,ce,Te;const Re=me.getSignal(),Pe=(pe=Re==null?void 0:Re.getSessionId())===null||pe===void 0?void 0:pe.getValue(),Le=Re==null?void 0:Re.getSenderId(),Fe=Re==null?void 0:Re.getReceiverId(),ze=(ge=Re==null?void 0:Re.getSessionCreatedTimestamp())===null||ge===void 0?void 0:ge.getValue();if(!(Re&&Pe&&Le&&Fe&&ze))return void I.a.warn("Received signal with missing information.");const De=this.getActiveConnection(Le);if(De)if(De.getSessionId()!==Pe){if(I.a.debug("Received signal: different session for a peer we're already connected to."),(De.getSessionCreatedTimestamp()||0)>ze)return;const We=new he(yield this.createRTCPeerConnection(te),{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,ke)=>this.config.receive(Be,ke),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,ke)=>{var qe,Ge;return(Ge=(qe=this.config).onStreamsInfoUpdate)===null||Ge===void 0?void 0:Ge.call(qe,Be,ke)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:$.getPeerId(),localUserId:(Te=$.getUserId())===null||Te===void 0?void 0:Te.getValue(),remotePeerId:Le},remoteConfig:{sessionId:Pe,sessionCreatedTimestamp:ze}},Be=>this.onCustomDataChannel(Le,Be));yield We.handleSignal(Re),this.connections.push(We)}else I.a.debug("Received signal: for an existing connection."),yield De.handleSignal(Re);else{I.a.debug("Received signal: new connection.");const We=new he(yield this.createRTCPeerConnection(te),{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,ke)=>this.config.receive(Be,ke),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,ke)=>{var qe,Ge;return(Ge=(qe=this.config).onStreamsInfoUpdate)===null||Ge===void 0?void 0:Ge.call(qe,Be,ke)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:$.getPeerId(),localUserId:(ce=$.getUserId())===null||ce===void 0?void 0:ce.getValue(),remotePeerId:Le},remoteConfig:{sessionId:Pe,sessionCreatedTimestamp:ze}},Be=>this.onCustomDataChannel(Le,Be));yield We.handleSignal(Re),this.connections.push(We)}})),de.on("end",()=>{de.cancel(),this.receiveSignalStream=void 0}),de.on("error",me=>{switch(me.code){case k.StatusCode.CANCELLED:case k.StatusCode.UNAVAILABLE:case k.StatusCode.UNKNOWN:I.a.debug("Receive signal stream error",{error:me});break;case k.StatusCode.UNAUTHENTICATED:I.a.warn("Receive signal stream error",{error:me});break;default:I.a.error("Receive signal stream error",{error:me})}de.cancel(),this.receiveSignalStream=void 0}),this.receiveSignalStream=de})}createRTCPeerConnection(q,$){var te;return we(this,void 0,void 0,function*(){const ue=$==null?void 0:$.rtcIceTransportPolicies,ae=$!=null&&$.rtcIceServerProtocol?[$==null?void 0:$.rtcIceServerProtocol]:void 0,de=q.map(pe=>Object.assign(Object.assign({},pe),{urls:typeof pe.urls=="string"?[pe.urls]:pe.urls})).map(pe=>Object.assign(Object.assign({},pe),{urls:pe.urls.filter(ge=>{const ce=(ue===void 0||ue.some(Te=>((Re,Pe)=>{switch(Pe){case"stun":return/^stuns?:/.test(Re);case"turn":return/^turns?:/.test(Re)}})(ge,Te)))&&(ae===void 0||ae.some(Te=>((Re,Pe)=>Re.endsWith(`transport=${Pe}`))(ge,Te)));return ce||I.a.debug(`Ignoring ICE server: ${ge}`),ce})})).filter(({urls:pe})=>pe.filter(ge=>ge).length>0),me=(te=this.config.alternateRTCPeerConnection)!==null&&te!==void 0?te:window.RTCPeerConnection;if(!me)throw new Error("RTCPeerConnection class not found. WebRTC must be enabled.");return new me(Object.assign({iceServers:de,iceTransportPolicy:(ue==null?void 0:ue.length)===1&&ue[0]==="turn"?"relay":"all"},$))})}closeConnections(q){return we(this,void 0,void 0,function*(){const $=yield R(q.map(te=>we(this,void 0,void 0,function*(){yield te.close()})));for(const te of $)I.a.warn("Request to close session failed",{error:te})})}getActiveConnection(q){return this.getConnections().find($=>$.getRemotePeerId()===q&&$.isActive())}update(){var q;return we(this,void 0,void 0,function*(){if(this.localConnections=this.localConnections.filter(me=>me.isActive()),this.config.lanOnlyMode)return;const{signalingClient:$}=this.config;if(!this.localPeer||!this.receiveSignalStream||!this.iceServers)return this.localPeer||(yield this.createPeer()),this.iceServers||(yield this.updateIceServers()),void(this.receiveSignalStream||(yield this.createReceiveSignalStream()));yield this.closeConnections(this.connections.filter(me=>!me.isActive())),this.connections=this.connections.filter(me=>me.isActive());const{localPeer:te}=this,ue=this.connections.filter(me=>me.getSessionId).map(me=>d(me.getSessionId()));te.setSessionIdsList(ue);const ae=new L.RefreshPeerRequest;ae.setPeer(te);try{yield $.refreshPeer(ae,yield this.getMetadata({}))}catch(me){me.code===k.StatusCode.NOT_FOUND?(I.a.warn("Peer expired, creating new peer",{peerId:te.getPeerId()}),yield this.reset()):I.a.warn("Error calling RefreshPeer",{error:me})}const de=yield this.getPeers();for(const me of this.connections)me.setRemoteDeviceId((q=de.find(pe=>pe.id===me.getRemotePeerId()))===null||q===void 0?void 0:q.deviceId)})}reset(){return we(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.isOutgoingConnection=new Map,yield this.createPeer(),yield this.createReceiveSignalStream()})}updateIceServers(){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)return;const{iceServersLastUpdate:q,iceServersTtl:$}=this,te=new Date().getTime();if(!q||te-q>$)try{const ue=(yield this.config.signalingClient.getIceServers(new L.GetIceServersRequest,yield this.getMetadata({}))).getIceServers();this.iceServers=JSON.parse(ue),this.iceServersLastUpdate=te}catch(ue){I.a.warn("Error in updateIceServers",{error:ue})}})}setupHandlers(q){const{peerConnection:$}=q,te=q.getSessionCreatedTimestamp();$.onconnectionstatechange=()=>we(this,void 0,void 0,function*(){const ue=$.connectionState;if(te)switch(ue){case"connected":O.aggregate("rtc-connect-time",new Date().getTime()-te);break;case"failed":O.increment("rtc-connect-failed")}})}getMetadata(q){return we(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getMetadata method cannot be called in local-only mode");const{getToken:$}=this.config,{grpcCallDeadline:te}=this,{hasDeadline:ue}=q,ae=ue===!1?void 0:new Date().getTime()+te;return{authorization:yield $(),deadline:ae}})}}},,function(e,t,r){r.r(t),r.d(t,"LogClient",function(){return l});var n=r(25),o=function(s,i,c,u){return new(c||(c=Promise))(function(b,A){function _(S){try{f(u.next(S))}catch(w){A(w)}}function v(S){try{f(u.throw(S))}catch(w){A(w)}}function f(S){var w;S.done?b(S.value):(w=S.value,w instanceof c?w:new c(function(P){P(w)})).then(_,v)}f((u=u.apply(s,i||[])).next())})};class l extends n.a{log(i){return o(this,void 0,void 0,function*(){yield this.fetch("logs",{method:"POST",body:JSON.stringify({logs:i}),allowUnsafeRetries:!0})})}}}])})})(dist);let FORMANT_API_URL="https://api.formant.io";typeof window!="undefined"&&(FORMANT_API_URL=window.FORMANT_API_URL||FORMANT_API_URL);let urlParams$1=new URLSearchParams("");typeof window!="undefined"&&(urlParams$1=new URLSearchParams(window.location.search));const envDev=urlParams$1.get("formant_dev");envDev&&(FORMANT_API_URL="https://api-dev.formant.io");const envStage=urlParams$1.get("formant_stage");envStage&&(FORMANT_API_URL="https://api-stage.formant.io");function delay(e){return new Promise(t=>setTimeout(t,e))}function defined(e,t){if(e!==void 0)return e;throw new Error(t||"Value is undefined")}class App{static sendAppMessage(t){window.parent.postMessage(t,"*")}static getCurrentModuleContext(){let t=new URLSearchParams("");return typeof window!="undefined"&&(t=new URLSearchParams(window.location.search)),t.get("module")}static isModule(){return this.getCurrentModuleContext()!==null}static goToTime(t){this.sendAppMessage({type:"go_to_time",time:t.getTime()})}static goToDevice(t){this.sendAppMessage({type:"go_to_device",deviceId:t})}static showMessage(t){this.sendAppMessage({type:"show_message",message:t})}static requestModuleData(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"request_module_data",module:t})}static setModuleDateTimeRange(t,r){const n=this.getCurrentModuleContext();if(!n)throw new Error("No module context");this.sendAppMessage({type:"set_module_data_time_range",module:n,before:t,after:r||0})}static refreshAuthToken(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"refresh_auth_token",module:t})}static sendChannelData(t,r){const n=this.getCurrentModuleContext();if(!n)throw new Error("No module context");this.sendAppMessage({type:"send_channel_data",source:n,channel:t,data:r})}static setupModuleMenus(t){const r=this.getCurrentModuleContext();if(!r)throw new Error("No module context");this.sendAppMessage({type:"setup_module_menus",module:r,menus:t})}static addMenuListener(t){window.addEventListener("message",r=>{const n=r.data;n.type==="module_menu_item_clicked"&&t(n.menu)})}static addAccessTokenRefreshListener(t){window.addEventListener("message",r=>{const n=r.data;n.type==="auth_token"&&t(n.token)})}static addModuleDataListener(t){window.addEventListener("message",r=>{const n=r.data;n.type==="module_data"&&t({streams:n.streams,time:n.time,queryRange:n.queryRange})})}static addChannelDataListener(t,r){window.addEventListener("message",n=>{const o=n.data;o.type==="channel_data"&&o.channel===t&&r({source:o.source,data:o.data})})}}const Oe=class{static async login(t,r){try{const n=await fetch(`${FORMANT_API_URL}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:t,password:r}),headers:{"Content-Type":"application/json"}}),o=await n.json();if(n.status!==200)throw new Error(o.message);return await Oe.loginWithToken(o.authentication.accessToken,o.authentication.refreshToken),o.authentication}catch(n){return Oe.waitingForAuth.forEach(o=>o(!1)),Oe.waitingForAuth=[],Promise.reject(n)}}static async loginWithToken(t,r){const n=JSON.parse(atob(t.split(".")[1]));try{let o;if(Oe.isShareToken=n["formant:claims"]&&n["formant:claims"].type=="share",n["formant:claims"]&&(Oe.currentOrganization=n["formant:claims"].organizationId),n["custom:organization_id"]&&(Oe.currentOrganization=n["custom:organization_id"]),Oe.isShareToken||(o=n.sub),n["formant:claims"]&&n["formant:claims"].userId&&(o=n["formant:claims"].userId),o){const l=await fetch(`${FORMANT_API_URL}/v1/admin/users/${o}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t}}),s=await l.json();if(l.status!==200)throw new Error(s.message);Oe.currentUser=s}Oe.token=t,Oe.waitingForAuth.forEach(l=>l(!0))}catch(o){console.error(o),Oe.waitingForAuth.forEach(l=>l(!1))}Oe.waitingForAuth=[],r&&(Oe.refreshToken=r,setInterval(async()=>{if(Oe.refreshToken){const l=await(await fetch(`${FORMANT_API_URL}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:Oe.refreshToken})})).json();Oe.token=l.authentication.accessToken}},1e3*60*60))}static isAuthenticated(){return Oe.token!==void 0}static getCurrentUser(){return Oe.currentUser}static async waitTilAuthenticated(){return Oe.token!==void 0?!0:new Promise(t=>{Oe.waitingForAuth.push(function(r){t(r)})})}static async listenForRefresh(){App.addAccessTokenRefreshListener(t=>{this.loginWithToken(t)}),setInterval(async()=>{App.refreshAuthToken()},1e3*60*60)}};let Authentication=Oe;je(Authentication,"token"),je(Authentication,"refreshToken"),je(Authentication,"currentUser"),je(Authentication,"currentOrganization"),je(Authentication,"isShareToken",!1),je(Authentication,"defaultDeviceId"),je(Authentication,"waitingForAuth",[]);class DataChannel{constructor(t){je(this,"ready",!1);je(this,"listeners",[]);je(this,"openListeners",[]);je(this,"closeListeners",[]);je(this,"errorListeners",[]);je(this,"binaryListeners",[]);je(this,"error");je(this,"decoder",new TextDecoder);this.dataChannel=t,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.ready=!0,this.openListeners.forEach(r=>r())},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(r=>r())},this.dataChannel.onerror=r=>{console.error(r),this.error="An error occurred in DataChannel",this.errorListeners.forEach(n=>n(r))},this.dataChannel.onmessage=r=>{this.listeners.forEach(n=>{const o=new Uint8Array(r.data),l=this.decoder.decode(o);n(l)}),this.binaryListeners.forEach(n=>{n(new Uint8Array(r.data))})}}addOpenListener(t){this.openListeners.push(t)}removeOpenListener(t){this.openListeners=this.openListeners.filter(r=>r!==t)}addCloseListener(t){this.closeListeners.push(t)}removeCloseListener(t){this.closeListeners=this.closeListeners.filter(r=>r!==t)}addErrorListener(t){this.errorListeners.push(t)}removeErrorListener(t){this.errorListeners=this.errorListeners.filter(r=>r!==t)}async waitTilReady(){return this.ready?!0:new Promise((r,n)=>{let o=window.setInterval(()=>{this.ready&&(window.clearInterval(o),r(!0)),this.error&&n(this.error)},10)})}send(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}sendBinary(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}addListener(t){this.listeners.push(t)}removeListener(t){const r=this.listeners.indexOf(t);if(r===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(r,1)}addBinaryListener(t){this.binaryListeners.push(t)}removeBinaryListener(t){const r=this.binaryListeners.indexOf(t);if(r===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(r,1)}}class CaptureStream{constructor(t){je(this,"token");this.captureSession=t}async ingestJSON(t){if(!this.token){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=n.token}await fetch(`${FORMANT_API_URL}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(t)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}class Manipulator{constructor(t,r){je(this,"currentListeners",[]);je(this,"onRealtimeMessage",(t,r)=>{r.payload.jointState&&this.currentListeners.forEach(n=>{r.payload.jointState&&n(r.payload.jointState)})});this.device=t,this.config=r}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(t){this.currentListeners.push(t)}}class RequestDataChannel{constructor(t,r,n){je(this,"channel");je(this,"requestIdToResponseMap",new Map);this.device=t,this.channel_name=r,this.timeout=n}addOpenListener(t){defined(this.channel,"channel not initalized").addOpenListener(t)}removeOpenListener(t){defined(this.channel,"channel not initalized").removeOpenListener(t)}addCloseListener(t){defined(this.channel,"channel not initalized").addCloseListener(t)}removeCloseListener(t){defined(this.channel,"channel not initalized").removeCloseListener(t)}addErrorListener(t){defined(this.channel,"channel not initalized").addErrorListener(t)}removeErrorListener(t){defined(this.channel,"channel not initalized").removeErrorListener(t)}}class BinaryRequestDataChannel extends RequestDataChannel{constructor(){super(...arguments);je(this,"RESPONSE_SUCCESS_BYTE",0);je(this,"decoder",new TextDecoder)}generateBinaryId(){const r=new Uint8Array(16);for(let n=0;n<r.length;n++)r[n]=Math.floor(Math.random()*256);return r}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(r=>{const o=r.slice(0,16).toString();if(o.length===0)throw new Error("Invalid response");const l=r.slice(16);if(l.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(o)&&this.requestIdToResponseMap.set(o,l)})}async request(r){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:o,timeout:l}=this;await n.waitTilReady();const s=this.generateBinaryId(),i=s.toString();o.set(i,!0),n.sendBinary(new Uint8Array([...s,...r]));const c=new Date().getTime();for(;new Date().getTime()<c+l;)if(await delay(50),o.has(i)){const u=o.get(i);if(u!==!0){o.delete(i);const b=u[0]===this.RESPONSE_SUCCESS_BYTE,A=u.slice(1);if(b)return A;throw console.error({name:"AdapterError",message:this.decoder.decode(A)}),new Error("Binary request datachannel adapter error")}}throw o.delete(i),console.error({name:"TimeoutError",message:`Request timed out after ${l/1e3} seconds`}),new Error("Binary request data channel request timed out")}}class TextRequestDataChannel extends RequestDataChannel{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(t=>{const r=JSON.parse(t),{id:n,data:o,error:l}=r;if(!n)throw new Error("Invalid response");if(!o&&!l)throw new Error("Invalid response");this.requestIdToResponseMap.has(n)&&this.requestIdToResponseMap.set(n,r)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:r,requestIdToResponseMap:n,timeout:o}=this;await r.waitTilReady();const l=this.generateTextId();n.set(l,!0),r.send(JSON.stringify({id:l,data:t}));const s=new Date().getTime();for(;new Date().getTime()<s+o;)if(await delay(50),n.has(l)){const i=n.get(l);if(i!==!0){n.delete(l);const{data:c,error:u}=i;if(c)return c;if(u)throw console.error({name:"AdapterError",message:u}),new Error("Text request datachannel adapter error")}}throw n.delete(l),console.error({name:"TimeoutError",message:`Request timed out after ${o/1e3} seconds`}),new Error("Text request datachannel request timed out")}}const SessionType={Teleop:1,Observe:3};class Device{constructor(t,r,n){je(this,"rtcClient");je(this,"remoteDevicePeerId");je(this,"realtimeListeners",[]);je(this,"handleMessage",(t,r)=>{this.realtimeListeners.forEach(n=>n(t,r))});this.id=t,this.name=r,this.organizationId=n}async getLatestTelemetry(){return(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async getConfiguration(){let t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});const r=await t.json();if(!r.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const n=r.state.reportedConfiguration.version;return t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${n}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),(await t.json()).document}async getFileUrl(t){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileId:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).fileUrls}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async startRealtimeConnection(t){if(this.rtcClient)throw new Error(`Already created realtime connection to device ${this.id}`);{const r=new dist.exports.RtcClient({signalingClient:new dist.exports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:this.handleMessage});for(;!r.isReady();)await delay(100);const o=(await r.getPeers()).find(l=>l.deviceId===this.id);if(!o)throw new Error("Cannot find peer, is the robot offline?");for(this.remoteDevicePeerId=o.id,await r.connect(this.remoteDevicePeerId,t||{sessionType:SessionType.Teleop});r.getConnectionStatus(this.remoteDevicePeerId)!=="connected";)await delay(100);this.rtcClient=r}}addRealtimeListener(t){this.realtimeListeners.push(t)}removeRealtimeListener(t){const r=this.realtimeListeners.indexOf(t);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeVideoStreams(){var n,o,l;const t=await this.getConfiguration(),r=[];for(const s of(n=t.teleop.hardwareStreams)!=null?n:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});for(const s of(o=t.teleop.rosStreams)!=null?o:[])s.topicType=="formant/H264VideoFrame"&&r.push({name:s.topicName});for(const s of(l=t.teleop.customStreams)!=null?l:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});return r}async getRealtimeManipulators(){var n;const t=await this.getConfiguration(),r=[];for(const o of(n=t.teleop.rosStreams)!=null?n:[])o.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:o.topicName},plannedJointStateStream:o.plannedTopic?{name:o.plannedTopic}:void 0,planValidStream:o.planValidTopic?{name:o.planValidTopic}:void 0,endEffectorStream:o.endEffectorTopic?{name:o.endEffectorTopic}:void 0,endEffectorLinkName:o.endEffectorLinkName,baseReferenceFrame:o.baseReferenceFrame,localFrame:o.localFrame}));return r}async startListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){const r=(await defined(this.rtcClient,"Realtime connection has not been started").getPeers()).find(n=>n.deviceId===this.id);return defined(r,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){if(this.rtcClient)await this.rtcClient.disconnect(this.id);else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){let t=await Fleet.getPeers(),r=await Fleet.getRealtimeSessions(),n=t.find(o=>o.deviceId===this.id);return n?r[n.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(n=>({name:n.name,id:n.id,command:n.command,description:n.description,parameterEnabled:n.parameterEnabled,parameterValue:n.parameterValue,parameterMeta:n.parameterMeta,enabled:n.enabled}))}async sendCommand(t,r,n,o){var u;const s=(await this.getAvailableCommands()).find(b=>b.name===t);if(!s)throw new Error(`Could not find command with name "${t}"`);let i;if(r===void 0)if(s.parameterEnabled&&s.parameterValue)i=s.parameterValue;else throw new Error("Command has no default parameter value, you must provide one");else i=r;let c={value:i,scrubberTime:(n||new Date).toISOString(),meta:st(st({},s.parameterMeta),o)};await fetch(`${FORMANT_API_URL}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:s.id,organizationId:this.organizationId,deviceId:this.id,command:s.command,parameter:c,userId:(u=Authentication.currentUser)==null?void 0:u.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async createCustomDataChannel(t,r){const n=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer(),l=await new Promise(s=>{n.createCustomDataChannel(defined(o).id,t,st({ordered:!0},r),!1,(i,c)=>{const u=new DataChannel(c);s(u)})});return await l.waitTilReady(),l}createCustomRequestDataChannel(t,r=3e3){return new TextRequestDataChannel(this,t,r)}createCustomBinaryRequestDataChannel(t,r=3e3){return new BinaryRequestDataChannel(this,t,r)}async createCaptureStream(t){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:t,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return new CaptureStream(n)}async getTelemetry(t,r,n,o){return await Fleet.getTelemetry(this.id,t,r,n,o)}async getTelemetryStreams(){var i,c;const t=await this.getConfiguration(),r=await fetch(`${FORMANT_API_URL}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=[],o=[];return(c=(i=t.telemetry)==null?void 0:i.streams)==null||c.forEach(u=>{u.disabled!==!0&&n.push(u.name),u.onDemand===!0&&o.push(u.name)}),console.log(o),(await r.json()).items.filter(u=>!n.includes(u)).map(u=>({name:u,onDemand:o.includes(u)}))}async createInterventionRequest(t,r,n,o){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:t,interventionType:r,time:new Date().toISOString(),deviceId:this.id,tags:o,data:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async addInterventionResponse(t,r,n){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:t,interventionType:r,data:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}}class PeerDevice{constructor(t){je(this,"rtcClient");je(this,"remoteDevicePeerId");je(this,"realtimeListeners",[]);je(this,"id");je(this,"handleMessage",(t,r)=>{this.realtimeListeners.forEach(n=>n(t,r))});this.peerUrl=t}async getLatestTelemetry(){const r=await(await fetch(`${this.peerUrl}/telemetry`)).json();return Object.entries(r).map(([o,l])=>({deviceId:this.id,streamName:o,streamType:"json",currentValue:l,currentValueTime:l.timestamp,tags:{}}))}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.document}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}async startRealtimeConnection(t){if(this.rtcClient)throw new Error(`Already created realtime connection to device ${this.id}`);{const r=new dist.exports.RtcClient({lanOnlyMode:!0,receive:this.handleMessage});for(await r.connectLan(this.peerUrl);r.getConnectionStatus(this.peerUrl)!=="connected";)await delay(100);this.rtcClient=r}}addRealtimeListener(t){this.realtimeListeners.push(t)}removeRealtimeListener(t){const r=this.realtimeListeners.indexOf(t);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeVideoStreams(){var n,o,l;const t=await this.getConfiguration(),r=[];for(const s of(n=t.teleop.hardwareStreams)!=null?n:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});for(const s of(o=t.teleop.rosStreams)!=null?o:[])s.topicType=="formant/H264VideoFrame"&&r.push({name:s.topicName});for(const s of(l=t.teleop.customStreams)!=null?l:[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});return r}async getRealtimeManipulators(){var n;const t=await this.getConfiguration(),r=[];for(const o of(n=t.teleop.rosStreams)!=null?n:[])o.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:o.topicName},plannedJointStateStream:o.plannedTopic?{name:o.plannedTopic}:void 0,planValidStream:o.planValidTopic?{name:o.planValidTopic}:void 0,endEffectorStream:o.endEffectorTopic?{name:o.endEffectorTopic}:void 0,endEffectorLinkName:o.endEffectorLinkName,baseReferenceFrame:o.baseReferenceFrame,localFrame:o.localFrame}));return r}async startListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(t){const r=defined(this.rtcClient,"Realtime connection has not been started"),n=await this.getRemotePeer();r.controlRemoteStream(defined(n).id,{streamName:t,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){if(this.rtcClient)await this.rtcClient.disconnect(this.id);else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async createCustomDataChannel(t,r){const n=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer(),l=await new Promise(s=>{n.createCustomDataChannel(defined(o).id,t,st({ordered:!0},r),!1,(i,c)=>{const u=new DataChannel(c);s(u)})});return await l.waitTilReady(),l}createCustomRequestDataChannel(t,r=3e3){return new TextRequestDataChannel(this,t,r)}createCustomBinaryRequestDataChannel(t,r=3e3){return new BinaryRequestDataChannel(this,t,r)}}const Me=class{static async setDefaultDevice(t){Me.defaultDeviceId=t}static async getCurrentDevice(){if(!Authentication.token)throw new Error("Not authenticated");if(!Me.defaultDeviceId)throw new Error("No known default device");const o=(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.find(s=>s.id===Me.defaultDeviceId).name,l=new Device(Me.defaultDeviceId,o,defined(Authentication.currentOrganization));return Me.knownContext.push(new WeakRef(l)),l}static async getPeerDevice(t){const r=new PeerDevice(t);return r.id=await r.getDeviceId(),r}static async getDevice(t){if(!Authentication.token)throw new Error("Not authenticated");const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json(),o=n.name,l=new Device(t,o,n.organizationId);return Me.knownContext.push(new WeakRef(l)),l}static async getDevices(){if(!Authentication.token)throw new Error("Not authenticated");const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return r.items,r.items.map(n=>new Device(n.id,n.name,n.organizationId))}static async getOnlineDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items;return(await Me.getDevices()).filter(l=>n.includes(l.id))}static async getPeers(){if(!Authentication.token)throw new Error("Not authenticated");return await new dist.exports.RtcClient({signalingClient:new dist.exports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getPeers()}static async getRealtimeSessions(){if(!Authentication.token)throw new Error("Not authenticated");return await new dist.exports.RtcClient({signalingClient:new dist.exports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getSessions()}static async getRealtimeDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(l=>l.deviceId);return(await Me.getDevices()).filter(l=>n.includes(l.id))}static async getLatestTelemetry(t){let r=t;return t&&!Array.isArray(t)&&(t=[t]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getTelemetry(t,r,n,o,l){let s=t;Array.isArray(t)||(s=[t]);let i=r;return Array.isArray(r)||(i=[r]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:s,end:o.toISOString(),names:i,start:n.toISOString(),tags:l}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getFileUrl(t){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();if(n.fileUrls.length===0)throw new Error("File not found");return n.fileUrls[0]}static async queryTelemetry(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async queryEvents(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getEvent(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query/id=${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getInterventions(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}};let Fleet=Me;je(Fleet,"defaultDeviceId"),je(Fleet,"knownContext",[]);class KeyValue{static async set(t,r){try{const n=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:defined(Authentication.currentUser).organizationId,key:t,value:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),o=await n.json();if(n.status!==200)throw new Error(o.message)}catch(n){throw n}}static async get(t){try{const r=await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=await r.json();if(r.status!==200)throw new Error(n.message);return n.value}catch(r){throw r}}static async list(){try{const t=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=await t.json();if(t.status!==200)throw new Error(r.message);return r.items}catch(t){throw t}}static async delete(t){try{if(!(await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to handle request");return}catch(r){throw r}}}const accessLevels=["viewer","operator","administrator"],viewer="viewer",operator="operator",administrator="administrator",aggregateLevels=["year","month","week","day","hour","minute"],annotationTypes=["tag","sheet","user"],eventTypes=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],healthStatuses=["unknown","operational","offline","error"],interventionTypes=["selection","labeling","teleop"],severities=["info","warning","error","critical"],videoMimeTypes=["video/mp4"];let urlParams=new URLSearchParams("");typeof window!="undefined"&&(urlParams=new URLSearchParams(window.location.search));const urlDevice=urlParams.get("device");urlDevice&&Fleet.setDefaultDevice(urlDevice);const urlAuth=urlParams.get("auth");urlAuth&&Authentication.loginWithToken(urlAuth);const moduleName=urlParams.get("module");moduleName&&Authentication.listenForRefresh(),exports.App=App,exports.Authentication=Authentication,exports.BinaryRequestDataChannel=BinaryRequestDataChannel,exports.CaptureStream=CaptureStream,exports.DataChannel=DataChannel,exports.Device=Device,exports.Fleet=Fleet,exports.KeyValue=KeyValue,exports.Manipulator=Manipulator,exports.PeerDevice=PeerDevice,exports.SessionType=SessionType,exports.TextRequestDataChannel=TextRequestDataChannel,exports.accessLevels=accessLevels,exports.administrator=administrator,exports.aggregateLevels=aggregateLevels,exports.annotationTypes=annotationTypes,exports.eventTypes=eventTypes,exports.healthStatuses=healthStatuses,exports.interventionTypes=interventionTypes,exports.operator=operator,exports.severities=severities,exports.videoMimeTypes=videoMimeTypes,exports.viewer=viewer,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});