diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index 7ea409f..38bc947 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -425,8 +425,10 @@ func (pR *Room) StartBattle() { } pR.StopBattleForSettlement() Logger.Info(fmt.Sprintf("The `battleMainLoop` for roomId=%v is stopped@renderFrameId=%v, with battleDurationFrames=%v:\n%v", pR.Id, pR.RenderFrameId, pR.BattleDurationFrames, pR.InputsBufferString(false))) // This takes sometime to print - //rdfIdToActuallyUsedInputDump := pR.rdfIdToActuallyUsedInputString() - //os.WriteFile(fmt.Sprintf("room_%d.txt", pR.Id), []byte(rdfIdToActuallyUsedInputDump), 0644) // DEBUG ONLY + if pR.FrameDataLoggingEnabled { + rdfIdToActuallyUsedInputDump := pR.rdfIdToActuallyUsedInputString() + os.WriteFile(fmt.Sprintf("room_%d.txt", pR.Id), []byte(rdfIdToActuallyUsedInputDump), 0644) // DEBUG ONLY + } pR.onBattleStoppedForSettlement() }() @@ -810,6 +812,8 @@ func (pR *Room) OnDismissed() { pR.GravityX = 0 pR.GravityY = -int32(float64(0.5) * pR.WorldToVirtualGridRatio) // makes all "playerCollider.Y" a multiple of 0.5 in all cases + pR.FrameDataLoggingEnabled = false // [WARNING] DON'T ENABLE ON LONG BATTLE DURATION! It consumes A LOT OF MEMORY! + pR.ChooseStage() pR.EffectivePlayerCount = 0 @@ -1283,14 +1287,16 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende delayedInputListForPrevRenderFrame = &delayedInputFrameForPrevRenderFrame.InputList } - actuallyUsedInputClone := make([]uint64, len(*delayedInputList), len(*delayedInputList)) - for i, v := range *delayedInputList { - actuallyUsedInputClone[i] = v - } - pR.rdfIdToActuallyUsedInput[currRenderFrame.Id] = &pb.InputFrameDownsync{ - InputFrameId: delayedInputFrame.InputFrameId, - InputList: actuallyUsedInputClone, - ConfirmedList: delayedInputFrame.ConfirmedList, + if pR.FrameDataLoggingEnabled { + actuallyUsedInputClone := make([]uint64, len(*delayedInputList), len(*delayedInputList)) + for i, v := range *delayedInputList { + actuallyUsedInputClone[i] = v + } + pR.rdfIdToActuallyUsedInput[currRenderFrame.Id] = &pb.InputFrameDownsync{ + InputFrameId: delayedInputFrame.InputFrameId, + InputList: actuallyUsedInputClone, + ConfirmedList: delayedInputFrame.ConfirmedList, + } } } diff --git a/battle_srv/protos/room_downsync_frame.pb.go b/battle_srv/protos/room_downsync_frame.pb.go index a56abdf..8cf0f22 100644 --- a/battle_srv/protos/room_downsync_frame.pb.go +++ b/battle_srv/protos/room_downsync_frame.pb.go @@ -961,6 +961,7 @@ type BattleColliderInfo struct { GravityX int32 `protobuf:"varint,28,opt,name=gravityX,proto3" json:"gravityX,omitempty"` GravityY int32 `protobuf:"varint,29,opt,name=gravityY,proto3" json:"gravityY,omitempty"` CollisionMinStep int32 `protobuf:"varint,30,opt,name=collisionMinStep,proto3" json:"collisionMinStep,omitempty"` + FrameDataLoggingEnabled bool `protobuf:"varint,999,opt,name=frameDataLoggingEnabled,proto3" json:"frameDataLoggingEnabled,omitempty"` } func (x *BattleColliderInfo) Reset() { @@ -1205,6 +1206,13 @@ func (x *BattleColliderInfo) GetCollisionMinStep() int32 { return 0 } +func (x *BattleColliderInfo) GetFrameDataLoggingEnabled() bool { + if x != nil { + return x.FrameDataLoggingEnabled + } + return false +} + type RoomDownsyncFrame struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1462,7 +1470,7 @@ var file_room_downsync_frame_proto_rawDesc = []byte{ 0x6c, 0x66, 0x4d, 0x6f, 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x58, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x4d, 0x6f, 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x59, 0x18, 0x13, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x4d, 0x6f, - 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x59, 0x22, 0x8a, 0x0c, 0x0a, 0x12, 0x42, + 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x59, 0x22, 0xc5, 0x0c, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, @@ -1553,33 +1561,37 @@ var file_room_downsync_frame_proto_rawDesc = []byte{ 0x59, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x59, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x63, 0x6f, 0x6c, - 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x1a, 0x58, 0x0a, - 0x15, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2e, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa2, 0x02, 0x0a, 0x11, 0x52, 0x6f, 0x6f, 0x6d, - 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, - 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x73, 0x41, 0x72, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, - 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x37, 0x0a, - 0x0c, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x6c, - 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x0c, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x42, - 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x16, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, - 0x64, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, 0x6b, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x55, - 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x2c, - 0x0a, 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x79, 0x6e, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, - 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x13, 0x5a, 0x11, - 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x73, 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, 0x39, 0x0a, + 0x17, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, + 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0xe7, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x17, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, + 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x58, 0x0a, 0x15, 0x4d, 0x65, 0x6c, 0x65, + 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x6c, 0x65, + 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0xa2, 0x02, 0x0a, 0x11, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, + 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, + 0x73, 0x79, 0x6e, 0x63, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, + 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, + 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, + 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x6d, 0x65, 0x6c, 0x65, + 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, + 0x6c, 0x65, 0x74, 0x52, 0x0c, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, + 0x73, 0x12, 0x36, 0x0a, 0x16, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x16, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x68, 0x6f, + 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x13, 0x5a, 0x11, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x5f, 0x73, 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/battle_srv/ws/serve.go b/battle_srv/ws/serve.go index 65c9691..06cb3c8 100644 --- a/battle_srv/ws/serve.go +++ b/battle_srv/ws/serve.go @@ -272,6 +272,8 @@ func Serve(c *gin.Context) { GravityX: pRoom.GravityX, GravityY: pRoom.GravityY, CollisionMinStep: pRoom.CollisionMinStep, + + FrameDataLoggingEnabled: pRoom.FrameDataLoggingEnabled, } resp := &pb.WsResp{ diff --git a/frontend/assets/plugin_scripts/jsexport.js b/frontend/assets/plugin_scripts/jsexport.js index 6de7e6a..282051f 100644 --- a/frontend/assets/plugin_scripts/jsexport.js +++ b/frontend/assets/plugin_scripts/jsexport.js @@ -4,16 +4,12 @@ var $goVersion = "go1.18.6"; Error.stackTraceLimit=1/0;var $global,$module,$NaN=NaN;if("undefined"!=typeof window?$global=window:"undefined"!=typeof self?$global=self:"undefined"!=typeof global?($global=global).require=require:$global=this,void 0===$global||void 0===$global.Array)throw new Error("no global object found");if("undefined"!=typeof module&&($module=module),!$global.fs&&$global.require)try{var fs=$global.require("fs");"object"==typeof fs&&null!==fs&&0!==Object.keys(fs).length&&($global.fs=fs)}catch(e){}if(!$global.fs){var outputBuf="",decoder=new TextDecoder("utf-8");$global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync:function(e,n){var r=(outputBuf+=decoder.decode(n)).lastIndexOf("\n");return-1!=r&&(console.log(outputBuf.substr(0,r)),outputBuf=outputBuf.substr(r+1)),n.length},write:function(e,n,r,t,i,a){0===r&&t===n.length&&null===i?a(null,this.writeSync(e,n)):a(enosys())}}}var $throwRuntimeError,$linknames={},$packages={},$idCounter=0,$keys=function(e){return e?Object.keys(e):[]},$flushConsole=function(){},$throwNilPointerError=function(){$throwRuntimeError("invalid memory address or nil pointer dereference")},$call=function(e,n,r){return e.apply(n,r)},$makeFunc=function(e){return function(){return $externalize(e(this,new($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments,[]))),$emptyInterface)}},$unused=function(e){},$print=console.log;if(void 0!==$global.process&&$global.require)try{var util=$global.require("util");$print=function(){$global.process.stderr.write(util.format.apply(this,arguments))}}catch(e){}var $println=console.log,$initAllLinknames=function(){for(var e=$keys($packages),n=0;ne.$capacity||t>e.$capacity)&&$throwRuntimeError("slice bounds out of range"),e===e.constructor.nil)return e;var i=new e.constructor(e.$array);return i.$offset=e.$offset+n,i.$length=r-n,i.$capacity=t-n,i},$substring=function(e,n,r){return(n<0||re.length)&&$throwRuntimeError("slice bounds out of range"),e.substring(n,r)},$sliceToNativeArray=function(e){return e.$array.constructor!==Array?e.$array.subarray(e.$offset,e.$offset+e.$length):e.$array.slice(e.$offset,e.$offset+e.$length)},$sliceToGoArray=function(e,n){var r=n.elem;return void 0!==r&&e.$length1114111||55296<=e&&e<=57343)&&(e=65533),e<=127?String.fromCharCode(e):e<=2047?String.fromCharCode(192|e>>6,128|63&e):e<=65535?String.fromCharCode(224|e>>12,128|e>>6&63,128|63&e):String.fromCharCode(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e)},$stringToBytes=function(e){for(var n=new Uint8Array(e.length),r=0;rt){for(var o=i-1;o>=0;o--)a.copy(e[r+o],n[t+o]);return}for(o=0;ot)for(o=i-1;o>=0;o--)e[r+o]=n[t+o];else for(o=0;oc)if(a=0,c=Math.max(o,e.$capacity<1024?2*e.$capacity:Math.floor(5*e.$capacity/4)),e.$array.constructor===Array){(i=e.$array.slice(e.$offset,e.$offset+e.$length)).length=c;for(var $=e.constructor.elem.zero,u=e.$length;u>>16&65535)*t+r*(n>>>16&65535)<<16>>>0)>>0},$floatKey=function(e){return e!=e?"NaN$"+ ++$idCounter:String(e)},$flatten64=function(e){return 4294967296*e.$high+e.$low},$shiftLeft64=function(e,n){return 0===n?e:n<32?new e.constructor(e.$high<>>32-n,e.$low<>>0):n<64?new e.constructor(e.$low<>n,(e.$low>>>n|e.$high<<32-n)>>>0):n<64?new e.constructor(e.$high>>31,e.$high>>n-32>>>0):e.$high<0?new e.constructor(-1,4294967295):new e.constructor(0,0)},$shiftRightUint64=function(e,n){return 0===n?e:n<32?new e.constructor(e.$high>>>n,(e.$low>>>n|e.$high<<32-n)>>>0):n<64?new e.constructor(0,e.$high>>>n-32):new e.constructor(0,0)},$mul64=function(e,n){var r=e.$high>>>16,t=65535&e.$high,i=e.$low>>>16,a=65535&e.$low,o=n.$high>>>16,c=65535&n.$high,$=n.$low>>>16,u=65535&n.$low,l=0,s=0,f=0,d=0;f+=(d+=a*u)>>>16,s+=(f+=i*u)>>>16,f&=65535,s+=(f+=a*$)>>>16,l+=(s+=t*u)>>>16,s&=65535,l+=(s+=i*$)>>>16,s&=65535,l+=(s+=a*c)>>>16,l+=r*u+t*$+i*c+a*o;var p=((l&=65535)<<16|(s&=65535))>>>0,h=((f&=65535)<<16|(d&=65535))>>>0;return new e.constructor(p,h)},$div64=function(e,n,r){0===n.$high&&0===n.$low&&$throwRuntimeError("integer divide by zero");var t=1,i=1,a=e.$high,o=e.$low;a<0&&(t=-1,i=-1,a=-a,0!==o&&(a--,o=4294967296-o));var c=n.$high,$=n.$low;n.$high<0&&(t*=-1,c=-c,0!==$&&(c--,$=4294967296-$));for(var u=0,l=0,s=0;c<2147483648&&(a>c||a===c&&o>$);)c=(c<<1|$>>>31)>>>0,$=$<<1>>>0,s++;for(var f=0;f<=s;f++)u=u<<1|l>>>31,l=l<<1>>>0,(a>c||a===c&&o>=$)&&(a-=c,(o-=$)<0&&(a--,o+=4294967296),4294967296===++l&&(u++,l=0)),$=($>>>1|c<<31)>>>0,c>>>=1;return r?new e.constructor(a*i,o*i):new e.constructor(u*t,l*t)},$divComplex=function(e,n){var r=e.$real===1/0||e.$real===-1/0||e.$imag===1/0||e.$imag===-1/0,t=n.$real===1/0||n.$real===-1/0||n.$imag===1/0||n.$imag===-1/0,i=!r&&(e.$real!=e.$real||e.$imag!=e.$imag),a=!t&&(n.$real!=n.$real||n.$imag!=n.$imag);if(i||a)return new e.constructor(NaN,NaN);if(r&&!t)return new e.constructor(1/0,1/0);if(!r&&t)return new e.constructor(0,0);if(0===n.$real&&0===n.$imag)return 0===e.$real&&0===e.$imag?new e.constructor(NaN,NaN):new e.constructor(1/0,1/0);if(Math.abs(n.$real)<=Math.abs(n.$imag)){var o=n.$real/n.$imag,c=n.$real*o+n.$imag;return new e.constructor((e.$real*o+e.$imag)/c,(e.$imag*o-e.$real)/c)}o=n.$imag/n.$real,c=n.$imag*o+n.$real;return new e.constructor((e.$imag*o+e.$real)/c,(e.$imag-e.$real*o)/c)},$kindBool=1,$kindInt=2,$kindInt8=3,$kindInt16=4,$kindInt32=5,$kindInt64=6,$kindUint=7,$kindUint8=8,$kindUint16=9,$kindUint32=10,$kindUint64=11,$kindUintptr=12,$kindFloat32=13,$kindFloat64=14,$kindComplex64=15,$kindComplex128=16,$kindArray=17,$kindChan=18,$kindFunc=19,$kindInterface=20,$kindMap=21,$kindPtr=22,$kindSlice=23,$kindString=24,$kindStruct=25,$kindUnsafePointer=26,$methodSynthesizers=[],$addMethodSynthesizer=function(e){null!==$methodSynthesizers?$methodSynthesizers.push(e):e()},$synthesizeMethods=function(){$methodSynthesizers.forEach(function(e){e()}),$methodSynthesizers=null},$ifaceKeyFor=function(e){if(e===$ifaceNil)return"nil";var n=e.constructor;return n.string+"$"+n.keyFor(e.$val)},$identity=function(e){return e},$typeIDCounter=0,$idKey=function(e){return void 0===e.$id&&($idCounter++,e.$id=$idCounter),String(e.$id)},$arrayPtrCtor=function(){return function(e){this.$get=function(){return e},this.$set=function(e){typ.copy(this,e)},this.$val=e}},$newType=function(e,n,r,t,i,a,o){var c;switch(n){case $kindBool:case $kindInt:case $kindInt8:case $kindInt16:case $kindInt32:case $kindUint:case $kindUint8:case $kindUint16:case $kindUint32:case $kindUintptr:case $kindUnsafePointer:(c=function(e){this.$val=e}).wrapped=!0,c.keyFor=$identity;break;case $kindString:(c=function(e){this.$val=e}).wrapped=!0,c.keyFor=function(e){return"$"+e};break;case $kindFloat32:case $kindFloat64:(c=function(e){this.$val=e}).wrapped=!0,c.keyFor=function(e){return $floatKey(e)};break;case $kindInt64:(c=function(e,n){this.$high=e+Math.floor(Math.ceil(n)/4294967296)>>0,this.$low=n>>>0,this.$val=this}).keyFor=function(e){return e.$high+"$"+e.$low};break;case $kindUint64:(c=function(e,n){this.$high=e+Math.floor(Math.ceil(n)/4294967296)>>>0,this.$low=n>>>0,this.$val=this}).keyFor=function(e){return e.$high+"$"+e.$low};break;case $kindComplex64:(c=function(e,n){this.$real=$fround(e),this.$imag=$fround(n),this.$val=this}).keyFor=function(e){return e.$real+"$"+e.$imag};break;case $kindComplex128:(c=function(e,n){this.$real=e,this.$imag=n,this.$val=this}).keyFor=function(e){return e.$real+"$"+e.$imag};break;case $kindArray:(c=function(e){this.$val=e}).wrapped=!0,c.ptr=$newType(4,$kindPtr,"*"+r,!1,"",!1,$arrayPtrCtor()),c.init=function(e,n){c.elem=e,c.len=n,c.comparable=e.comparable,c.keyFor=function(n){return Array.prototype.join.call($mapArray(n,function(n){return String(e.keyFor(n)).replace(/\\/g,"\\\\").replace(/\$/g,"\\$")}),"$")},c.copy=function(n,r){$copyArray(n,r,0,0,r.length,e)},c.ptr.init(c),Object.defineProperty(c.ptr.nil,"nilCheck",{get:$throwNilPointerError})};break;case $kindChan:(c=function(e){this.$val=e}).wrapped=!0,c.keyFor=$idKey,c.init=function(e,n,r){c.elem=e,c.sendOnly=n,c.recvOnly=r};break;case $kindFunc:(c=function(e){this.$val=e}).wrapped=!0,c.init=function(e,n,r){c.params=e,c.results=n,c.variadic=r,c.comparable=!1};break;case $kindInterface:(c={implementedBy:{},missingMethodFor:{}}).keyFor=$ifaceKeyFor,c.init=function(e){c.methods=e,e.forEach(function(e){$ifaceNil[e.prop]=$throwNilPointerError})};break;case $kindMap:(c=function(e){this.$val=e}).wrapped=!0,c.init=function(e,n){c.key=e,c.elem=n,c.comparable=!1};break;case $kindPtr:(c=o||function(e,n,r){this.$get=e,this.$set=n,this.$target=r,this.$val=this}).keyFor=$idKey,c.init=function(e){c.elem=e,c.wrapped=e.kind===$kindArray,c.nil=new c($throwNilPointerError,$throwNilPointerError)};break;case $kindSlice:(c=function(e){e.constructor!==c.nativeArray&&(e=new c.nativeArray(e)),this.$array=e,this.$offset=0,this.$length=e.length,this.$capacity=e.length,this.$val=this}).init=function(e){c.elem=e,c.comparable=!1,c.nativeArray=$nativeArray(e.kind),c.nil=new c([])};break;case $kindStruct:(c=function(e){this.$val=e}).wrapped=!0,c.ptr=$newType(4,$kindPtr,"*"+r,!1,i,a,o),c.ptr.elem=c,c.ptr.prototype.$get=function(){return this},c.ptr.prototype.$set=function(e){c.copy(this,e)},c.init=function(e,n){c.pkgPath=e,c.fields=n,n.forEach(function(e){e.typ.comparable||(c.comparable=!1)}),c.keyFor=function(e){var r=e.$val;return $mapArray(n,function(e){return String(e.typ.keyFor(r[e.prop])).replace(/\\/g,"\\\\").replace(/\$/g,"\\$")}).join("$")},c.copy=function(e,r){for(var t=0;t0;){var a=[],o=[];t.forEach(function(e){if(!i[e.typ.string])switch(i[e.typ.string]=!0,e.typ.named&&(o=o.concat(e.typ.methods),e.indirect&&(o=o.concat($ptrType(e.typ).methods))),e.typ.kind){case $kindStruct:e.typ.fields.forEach(function(n){if(n.embedded){var r=n.typ,t=r.kind===$kindPtr;a.push({typ:t?r.elem:r,indirect:e.indirect||t})}});break;case $kindInterface:o=o.concat(e.typ.methods)}}),o.forEach(function(e){void 0===n[e.name]&&(n[e.name]=e)}),t=a}return e.methodSetCache=[],Object.keys(n).sort().forEach(function(r){e.methodSetCache.push(n[r])}),e.methodSetCache},$Bool=$newType(1,$kindBool,"bool",!0,"",!1,null),$Int=$newType(4,$kindInt,"int",!0,"",!1,null),$Int8=$newType(1,$kindInt8,"int8",!0,"",!1,null),$Int16=$newType(2,$kindInt16,"int16",!0,"",!1,null),$Int32=$newType(4,$kindInt32,"int32",!0,"",!1,null),$Int64=$newType(8,$kindInt64,"int64",!0,"",!1,null),$Uint=$newType(4,$kindUint,"uint",!0,"",!1,null),$Uint8=$newType(1,$kindUint8,"uint8",!0,"",!1,null),$Uint16=$newType(2,$kindUint16,"uint16",!0,"",!1,null),$Uint32=$newType(4,$kindUint32,"uint32",!0,"",!1,null),$Uint64=$newType(8,$kindUint64,"uint64",!0,"",!1,null),$Uintptr=$newType(4,$kindUintptr,"uintptr",!0,"",!1,null),$Float32=$newType(4,$kindFloat32,"float32",!0,"",!1,null),$Float64=$newType(8,$kindFloat64,"float64",!0,"",!1,null),$Complex64=$newType(8,$kindComplex64,"complex64",!0,"",!1,null),$Complex128=$newType(16,$kindComplex128,"complex128",!0,"",!1,null),$String=$newType(8,$kindString,"string",!0,"",!1,null),$UnsafePointer=$newType(4,$kindUnsafePointer,"unsafe.Pointer",!0,"unsafe",!1,null),$nativeArray=function(e){switch(e){case $kindInt:return Int32Array;case $kindInt8:return Int8Array;case $kindInt16:return Int16Array;case $kindInt32:return Int32Array;case $kindUint:return Uint32Array;case $kindUint8:return Uint8Array;case $kindUint16:return Uint16Array;case $kindUint32:case $kindUintptr:return Uint32Array;case $kindFloat32:return Float32Array;case $kindFloat64:return Float64Array;default:return Array}},$toNativeArray=function(e,n){var r=$nativeArray(e);return r===Array?n:new r(n)},$arrayTypes={},$arrayType=function(e,n){var r=e.id+"$"+n,t=$arrayTypes[r];return void 0===t&&(t=$newType(12,$kindArray,"["+n+"]"+e.string,!1,"",!1,null),$arrayTypes[r]=t,t.init(e,n)),t},$chanType=function(e,n,r){var t=(r?"<-":"")+"chan"+(n?"<- ":" ");n||r||"<"!=e.string[0]?t+=e.string:t+="("+e.string+")";var i=n?"SendChan":r?"RecvChan":"Chan",a=e[i];return void 0===a&&(a=$newType(4,$kindChan,t,!1,"",!1,null),e[i]=a,a.init(e,n,r)),a},$Chan=function(e,n){(n<0||n>2147483647)&&$throwRuntimeError("makechan: size out of range"),this.$elem=e,this.$capacity=n,this.$buffer=[],this.$sendQueue=[],this.$recvQueue=[],this.$closed=!1},$chanNil=new $Chan(null,0);$chanNil.$sendQueue=$chanNil.$recvQueue={length:0,push:function(){},shift:function(){},indexOf:function(){return-1}};var $funcTypes={},$funcType=function(e,n,r){var t=$mapArray(e,function(e){return e.id}).join(",")+"$"+$mapArray(n,function(e){return e.id}).join(",")+"$"+r,i=$funcTypes[t];if(void 0===i){var a=$mapArray(e,function(e){return e.string});r&&(a[a.length-1]="..."+a[a.length-1].substr(2));var o="func("+a.join(", ")+")";1===n.length?o+=" "+n[0].string:n.length>1&&(o+=" ("+$mapArray(n,function(e){return e.string}).join(", ")+")"),i=$newType(4,$kindFunc,o,!1,"",!1,null),$funcTypes[t]=i,i.init(e,n,r)}return i},$interfaceTypes={},$interfaceType=function(e){var n=$mapArray(e,function(e){return e.pkg+","+e.name+","+e.typ.id}).join("$"),r=$interfaceTypes[n];if(void 0===r){var t="interface {}";0!==e.length&&(t="interface { "+$mapArray(e,function(e){return(""!==e.pkg?e.pkg+".":"")+e.name+e.typ.string.substr(4)}).join("; ")+" }"),r=$newType(8,$kindInterface,t,!1,"",!1,null),$interfaceTypes[n]=r,r.init(e)}return r},$emptyInterface=$interfaceType([]),$ifaceNil={},$error=$newType(8,$kindInterface,"error",!0,"",!1,null);$error.init([{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],!1)}]);var $panicValue,$jsObjectPtr,$jsErrorPtr,$mapTypes={},$mapType=function(e,n){var r=e.id+"$"+n.id,t=$mapTypes[r];return void 0===t&&(t=$newType(4,$kindMap,"map["+e.string+"]"+n.string,!1,"",!1,null),$mapTypes[r]=t,t.init(e,n)),t},$makeMap=function(e,n){for(var r={},t=0;t2147483647)&&$throwRuntimeError("makeslice: len out of range"),(r<0||r2147483647)&&$throwRuntimeError("makeslice: cap out of range");var t=new e.nativeArray(r);if(e.nativeArray===Array)for(var i=0;i4||t<0)break}}finally{0==$scheduled.length&&clearTimeout(e)}},$schedule=function(e){e.asleep&&(e.asleep=!1,$awakeGoroutines++),$scheduled.push(e),$curGoroutine===$noGoroutine&&$runScheduled()},$setTimeout=function(e,n){return $awakeGoroutines++,setTimeout(function(){$awakeGoroutines--,e()},n)},$block=function(){$curGoroutine===$noGoroutine&&$throwRuntimeError("cannot block in JavaScript callback, fix by wrapping code in goroutine"),$curGoroutine.asleep=!0},$restore=function(e,n){return void 0!==e&&void 0!==e.$blk?e:n},$send=function(e,n){e.$closed&&$throwRuntimeError("send on closed channel");var r=e.$recvQueue.shift();if(void 0===r){if(!(e.$buffer.length65535){var l=Math.floor((u-65536)/1024)+55296,s=(u-65536)%1024+56320;$+=String.fromCharCode(l,s)}else $+=String.fromCharCode(u)}return $;case $kindStruct:var f=$packages.time;if(void 0!==f&&e.constructor===f.Time.ptr){var d=$div64(e.UnixNano(),new $Int64(0,1e6));return new Date($flatten64(d))}var p={},h=function(e,n){if(n===$jsObjectPtr)return e;switch(n.kind){case $kindPtr:return e===n.nil?p:h(e.$get(),n.elem);case $kindStruct:var r=n.fields[0];return h(e[r.prop],r.typ);case $kindInterface:return h(e.$val,e.constructor);default:return p}},k=h(e,n);if(k!==p)return k;if(void 0!==r)return r(e);k={};for(a=0;a>24;case $kindInt16:return parseInt(e)<<16>>16;case $kindInt32:return parseInt(e)>>0;case $kindUint:return parseInt(e);case $kindUint8:return parseInt(e)<<24>>>24;case $kindUint16:return parseInt(e)<<16>>>16;case $kindUint32:case $kindUintptr:return parseInt(e)>>>0;case $kindInt64:case $kindUint64:return new n(0,e);case $kindFloat32:case $kindFloat64:return parseFloat(e);case $kindArray:return e.length!==n.len&&$throwRuntimeError("got array with wrong size from JavaScript native"),$mapArray(e,function(e){return $internalize(e,n.elem,i)});case $kindFunc:return function(){for(var t=[],a=0;a=128)return!1;return!0}; -$packages["github.com/gopherjs/gopherjs/js"]=(function(){var $pkg={},$init,A,B,J,K,M,O,P,Q,R,S,T,E,G,H,L;A=$pkg.Object=$newType(0,$kindStruct,"js.Object",true,"github.com/gopherjs/gopherjs/js",true,function(object_){this.$val=this;if(arguments.length===0){this.object=null;return;}this.object=object_;});B=$pkg.Error=$newType(0,$kindStruct,"js.Error",true,"github.com/gopherjs/gopherjs/js",true,function(Object_){this.$val=this;if(arguments.length===0){this.Object=null;return;}this.Object=Object_;});J=$pkg.M=$newType(4,$kindMap,"js.M",true,"github.com/gopherjs/gopherjs/js",true,null);K=$pkg.S=$newType(12,$kindSlice,"js.S",true,"github.com/gopherjs/gopherjs/js",true,null);M=$sliceType($emptyInterface);O=$ptrType(A);P=$sliceType(O);Q=$funcType([P],[O],true);R=$funcType([],[O],false);S=$funcType([O],[],false);T=$ptrType(B);A.ptr.prototype.Get=function(a){var a,b;b=this;return b.object[$externalize(a,$String)];};A.prototype.Get=function(a){return this.$val.Get(a);};A.ptr.prototype.Set=function(a,b){var a,b,c;c=this;c.object[$externalize(a,$String)]=$externalize(b,$emptyInterface);};A.prototype.Set=function(a,b){return this.$val.Set(a,b);};A.ptr.prototype.Delete=function(a){var a,b;b=this;delete b.object[$externalize(a,$String)];};A.prototype.Delete=function(a){return this.$val.Delete(a);};A.ptr.prototype.Length=function(){var a;a=this;return $parseInt(a.object.length);};A.prototype.Length=function(){return this.$val.Length();};A.ptr.prototype.Index=function(a){var a,b;b=this;return b.object[a];};A.prototype.Index=function(a){return this.$val.Index(a);};A.ptr.prototype.SetIndex=function(a,b){var a,b,c;c=this;c.object[a]=$externalize(b,$emptyInterface);};A.prototype.SetIndex=function(a,b){return this.$val.SetIndex(a,b);};A.ptr.prototype.Call=function(a,b){var a,b,c,d;c=this;return(d=c.object,d[$externalize(a,$String)].apply(d,$externalize(b,M)));};A.prototype.Call=function(a,b){return this.$val.Call(a,b);};A.ptr.prototype.Invoke=function(a){var a,b;b=this;return b.object.apply(undefined,$externalize(a,M));};A.prototype.Invoke=function(a){return this.$val.Invoke(a);};A.ptr.prototype.New=function(a){var a,b;b=this;return new($global.Function.prototype.bind.apply(b.object,[undefined].concat($externalize(a,M))));};A.prototype.New=function(a){return this.$val.New(a);};A.ptr.prototype.Bool=function(){var a;a=this;return!!(a.object);};A.prototype.Bool=function(){return this.$val.Bool();};A.ptr.prototype.String=function(){var a;a=this;return $internalize(a.object,$String);};A.prototype.String=function(){return this.$val.String();};A.ptr.prototype.Int=function(){var a;a=this;return $parseInt(a.object)>>0;};A.prototype.Int=function(){return this.$val.Int();};A.ptr.prototype.Int64=function(){var a;a=this;return $internalize(a.object,$Int64);};A.prototype.Int64=function(){return this.$val.Int64();};A.ptr.prototype.Uint64=function(){var a;a=this;return $internalize(a.object,$Uint64);};A.prototype.Uint64=function(){return this.$val.Uint64();};A.ptr.prototype.Float=function(){var a;a=this;return $parseFloat(a.object);};A.prototype.Float=function(){return this.$val.Float();};A.ptr.prototype.Interface=function(){var a;a=this;return $internalize(a.object,$emptyInterface);};A.prototype.Interface=function(){return this.$val.Interface();};A.ptr.prototype.Unsafe=function(){var a;a=this;return a.object;};A.prototype.Unsafe=function(){return this.$val.Unsafe();};B.ptr.prototype.Error=function(){var a;a=this;return"JavaScript error: "+$internalize(a.Object.message,$String);};B.prototype.Error=function(){return this.$val.Error();};B.ptr.prototype.Stack=function(){var a;a=this;return $internalize(a.Object.stack,$String);};B.prototype.Stack=function(){return this.$val.Stack();};E=function(a){var a;return $makeFunc(a);};$pkg.MakeFunc=E;G=function(a){var a,b,c,d,e,f;b=a;c=new($global.Object)();c.__internal_object__=b;d=b.constructor.methods;e=0;while(true){if(!(e<$parseInt(d.length))){break;}f=[f];f[0]=d[e];if(!($internalize(f[0].pkg,$String)==="")){e=e+(1)>>0;continue;}c[$externalize($internalize(f[0].name,$String),$String)]=$externalize((function(f){return function(g){var g;return $externalizeFunction(b[$externalize($internalize(f[0].prop,$String),$String)],f[0].typ,$externalize(true,$Bool)).apply(b,$externalize(g,P));};})(f),Q);e=e+(1)>>0;}return c;};$pkg.MakeWrapper=G;H=function(a){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=[b];c=[c];b[0]=a;d=b[0].constructor;c[0]=new($global.Object)();e=(function(b,c){return function(e,f){var e,f;$global.Object.defineProperty(c[0],$externalize(e,$String),$externalize(f,J));};})(b,c);$r=e("__internal_object__",$makeMap($String.keyFor,[{k:"value",v:new $jsObjectPtr(b[0])}]));$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=$internalize(d.string,$String);g=$internalize(d.pkg,$String);h="";if(f.charCodeAt(0)===42){h="*";}i=0;while(true){if(!(i>0));break;}i=i+(1)>>0;}j=g+"."+h+f;$r=e("$type",$makeMap($String.keyFor,[{k:"value",v:new $String(j)}]));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}k=null;l=new($global.Array)();m=d.methods;if(!(m===undefined)){l=l.concat(m);}n=d.elem;if(!(n===undefined)){k=n.fields;l=l.concat(n.methods);}else{k=d.fields;}o=0;case 3:if(!(o<$parseInt(l.length))){$s=4;continue;}p=[p];p[0]=l[o];if(!($internalize(p[0].pkg,$String)==="")){o=o+(1)>>0;$s=3;continue;}$r=e($internalize(p[0].prop,$String),$makeMap($String.keyFor,[{k:"value",v:new Q((function(b,c,p){return function(q){var q;return $externalizeFunction(b[0][$externalize($internalize(p[0].prop,$String),$String)],p[0].typ,$externalize(true,$Bool),H).apply(b[0],$externalize(q,P));};})(b,c,p))}]));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}o=o+(1)>>0;$s=3;continue;case 4:if(!(k===undefined)){$s=6;continue;}$s=7;continue;case 6:q=0;case 8:if(!(q<$parseInt(k.length))){$s=9;continue;}r=[r];r[0]=k[q];if(!!!(r[0].exported)){q=q+(1)>>0;$s=8;continue;}$r=e($internalize(r[0].prop,$String),$makeMap($String.keyFor,[{k:"get",v:new R((function(b,c,r){return function(){var s;s=$copyIfRequired(b[0].$val[$externalize($internalize(r[0].prop,$String),$String)],r[0].typ);return $externalize(s,r[0].typ,H);};})(b,c,r))},{k:"set",v:new S((function(b,c,r){return function(s){var s,t;t=$internalize(s,r[0].typ,H);b[0].$val[$externalize($internalize(r[0].prop,$String),$String)]=t;};})(b,c,r))}]));$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}q=q+(1)>>0;$s=8;continue;case 9:case 7:$s=-1;return c[0];}return;}var $f={$blk:H,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s};return $f;};$pkg.MakeFullWrapper=H;L=function(){var a;a=new B.ptr(null);$unused(a);};O.methods=[{prop:"Get",name:"Get",pkg:"",typ:$funcType([$String],[O],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String,$emptyInterface],[],false)},{prop:"Delete",name:"Delete",pkg:"",typ:$funcType([$String],[],false)},{prop:"Length",name:"Length",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Index",name:"Index",pkg:"",typ:$funcType([$Int],[O],false)},{prop:"SetIndex",name:"SetIndex",pkg:"",typ:$funcType([$Int,$emptyInterface],[],false)},{prop:"Call",name:"Call",pkg:"",typ:$funcType([$String,M],[O],true)},{prop:"Invoke",name:"Invoke",pkg:"",typ:$funcType([M],[O],true)},{prop:"New",name:"New",pkg:"",typ:$funcType([M],[O],true)},{prop:"Bool",name:"Bool",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Int",name:"Int",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Int64",name:"Int64",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Uint64",name:"Uint64",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"Float",name:"Float",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Interface",name:"Interface",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"Unsafe",name:"Unsafe",pkg:"",typ:$funcType([],[$Uintptr],false)}];T.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)},{prop:"Stack",name:"Stack",pkg:"",typ:$funcType([],[$String],false)}];A.init("github.com/gopherjs/gopherjs/js",[{prop:"object",name:"object",embedded:false,exported:false,typ:O,tag:""}]);B.init("",[{prop:"Object",name:"Object",embedded:true,exported:true,typ:O,tag:""}]);J.init($String,$emptyInterface);K.init($emptyInterface);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:L();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["github.com/gopherjs/gopherjs/js"]=(function(){var $pkg={},$init,A,B,J,K,M,O,P,Q,R,S,T,G,H,L;A=$pkg.Object=$newType(0,$kindStruct,"js.Object",true,"github.com/gopherjs/gopherjs/js",true,function(object_){this.$val=this;if(arguments.length===0){this.object=null;return;}this.object=object_;});B=$pkg.Error=$newType(0,$kindStruct,"js.Error",true,"github.com/gopherjs/gopherjs/js",true,function(Object_){this.$val=this;if(arguments.length===0){this.Object=null;return;}this.Object=Object_;});J=$pkg.M=$newType(4,$kindMap,"js.M",true,"github.com/gopherjs/gopherjs/js",true,null);K=$pkg.S=$newType(12,$kindSlice,"js.S",true,"github.com/gopherjs/gopherjs/js",true,null);M=$sliceType($emptyInterface);O=$ptrType(A);P=$sliceType(O);Q=$funcType([P],[O],true);R=$funcType([],[O],false);S=$funcType([O],[],false);T=$ptrType(B);A.ptr.prototype.Get=function(a){var a,b;b=this;return b.object[$externalize(a,$String)];};A.prototype.Get=function(a){return this.$val.Get(a);};A.ptr.prototype.Set=function(a,b){var a,b,c;c=this;c.object[$externalize(a,$String)]=$externalize(b,$emptyInterface);};A.prototype.Set=function(a,b){return this.$val.Set(a,b);};A.ptr.prototype.Delete=function(a){var a,b;b=this;delete b.object[$externalize(a,$String)];};A.prototype.Delete=function(a){return this.$val.Delete(a);};A.ptr.prototype.Length=function(){var a;a=this;return $parseInt(a.object.length);};A.prototype.Length=function(){return this.$val.Length();};A.ptr.prototype.Index=function(a){var a,b;b=this;return b.object[a];};A.prototype.Index=function(a){return this.$val.Index(a);};A.ptr.prototype.SetIndex=function(a,b){var a,b,c;c=this;c.object[a]=$externalize(b,$emptyInterface);};A.prototype.SetIndex=function(a,b){return this.$val.SetIndex(a,b);};A.ptr.prototype.Call=function(a,b){var a,b,c,d;c=this;return(d=c.object,d[$externalize(a,$String)].apply(d,$externalize(b,M)));};A.prototype.Call=function(a,b){return this.$val.Call(a,b);};A.ptr.prototype.Invoke=function(a){var a,b;b=this;return b.object.apply(undefined,$externalize(a,M));};A.prototype.Invoke=function(a){return this.$val.Invoke(a);};A.ptr.prototype.New=function(a){var a,b;b=this;return new($global.Function.prototype.bind.apply(b.object,[undefined].concat($externalize(a,M))));};A.prototype.New=function(a){return this.$val.New(a);};A.ptr.prototype.Bool=function(){var a;a=this;return!!(a.object);};A.prototype.Bool=function(){return this.$val.Bool();};A.ptr.prototype.String=function(){var a;a=this;return $internalize(a.object,$String);};A.prototype.String=function(){return this.$val.String();};A.ptr.prototype.Int=function(){var a;a=this;return $parseInt(a.object)>>0;};A.prototype.Int=function(){return this.$val.Int();};A.ptr.prototype.Int64=function(){var a;a=this;return $internalize(a.object,$Int64);};A.prototype.Int64=function(){return this.$val.Int64();};A.ptr.prototype.Uint64=function(){var a;a=this;return $internalize(a.object,$Uint64);};A.prototype.Uint64=function(){return this.$val.Uint64();};A.ptr.prototype.Float=function(){var a;a=this;return $parseFloat(a.object);};A.prototype.Float=function(){return this.$val.Float();};A.ptr.prototype.Interface=function(){var a;a=this;return $internalize(a.object,$emptyInterface);};A.prototype.Interface=function(){return this.$val.Interface();};A.ptr.prototype.Unsafe=function(){var a;a=this;return a.object;};A.prototype.Unsafe=function(){return this.$val.Unsafe();};B.ptr.prototype.Error=function(){var a;a=this;return"JavaScript error: "+$internalize(a.Object.message,$String);};B.prototype.Error=function(){return this.$val.Error();};B.ptr.prototype.Stack=function(){var a;a=this;return $internalize(a.Object.stack,$String);};B.prototype.Stack=function(){return this.$val.Stack();};G=function(a){var a,b,c,d,e,f;b=a;c=new($global.Object)();c.__internal_object__=b;d=b.constructor.methods;e=0;while(true){if(!(e<$parseInt(d.length))){break;}f=[f];f[0]=d[e];if(!($internalize(f[0].pkg,$String)==="")){e=e+(1)>>0;continue;}c[$externalize($internalize(f[0].name,$String),$String)]=$externalize((function(f){return function(g){var g;return $externalizeFunction(b[$externalize($internalize(f[0].prop,$String),$String)],f[0].typ,$externalize(true,$Bool)).apply(b,$externalize(g,P));};})(f),Q);e=e+(1)>>0;}return c;};$pkg.MakeWrapper=G;H=function(a){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=[b];c=[c];b[0]=a;d=b[0].constructor;c[0]=new($global.Object)();e=(function(b,c){return function(e,f){var e,f;$global.Object.defineProperty(c[0],$externalize(e,$String),$externalize(f,J));};})(b,c);$r=e("__internal_object__",$makeMap($String.keyFor,[{k:"value",v:new $jsObjectPtr(b[0])}]));$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=$internalize(d.string,$String);g=$internalize(d.pkg,$String);h="";if(f.charCodeAt(0)===42){h="*";}i=0;while(true){if(!(i>0));break;}i=i+(1)>>0;}j=g+"."+h+f;$r=e("$type",$makeMap($String.keyFor,[{k:"value",v:new $String(j)}]));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}k=null;l=new($global.Array)();m=d.methods;if(!(m===undefined)){l=l.concat(m);}n=d.elem;if(!(n===undefined)){k=n.fields;l=l.concat(n.methods);}else{k=d.fields;}o=0;case 3:if(!(o<$parseInt(l.length))){$s=4;continue;}p=[p];p[0]=l[o];if(!($internalize(p[0].pkg,$String)==="")){o=o+(1)>>0;$s=3;continue;}$r=e($internalize(p[0].prop,$String),$makeMap($String.keyFor,[{k:"value",v:new Q((function(b,c,p){return function(q){var q;return $externalizeFunction(b[0][$externalize($internalize(p[0].prop,$String),$String)],p[0].typ,$externalize(true,$Bool),H).apply(b[0],$externalize(q,P));};})(b,c,p))}]));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}o=o+(1)>>0;$s=3;continue;case 4:if(!(k===undefined)){$s=6;continue;}$s=7;continue;case 6:q=0;case 8:if(!(q<$parseInt(k.length))){$s=9;continue;}r=[r];r[0]=k[q];if(!!!(r[0].exported)){q=q+(1)>>0;$s=8;continue;}$r=e($internalize(r[0].prop,$String),$makeMap($String.keyFor,[{k:"get",v:new R((function(b,c,r){return function(){var s;s=$copyIfRequired(b[0].$val[$externalize($internalize(r[0].prop,$String),$String)],r[0].typ);return $externalize(s,r[0].typ,H);};})(b,c,r))},{k:"set",v:new S((function(b,c,r){return function(s){var s,t;t=$internalize(s,r[0].typ,H);b[0].$val[$externalize($internalize(r[0].prop,$String),$String)]=t;};})(b,c,r))}]));$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}q=q+(1)>>0;$s=8;continue;case 9:case 7:$s=-1;return c[0];}return;}var $f={$blk:H,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s};return $f;};$pkg.MakeFullWrapper=H;L=function(){var a;a=new B.ptr(null);$unused(a);};O.methods=[{prop:"Get",name:"Get",pkg:"",typ:$funcType([$String],[O],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String,$emptyInterface],[],false)},{prop:"Delete",name:"Delete",pkg:"",typ:$funcType([$String],[],false)},{prop:"Length",name:"Length",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Index",name:"Index",pkg:"",typ:$funcType([$Int],[O],false)},{prop:"SetIndex",name:"SetIndex",pkg:"",typ:$funcType([$Int,$emptyInterface],[],false)},{prop:"Call",name:"Call",pkg:"",typ:$funcType([$String,M],[O],true)},{prop:"Invoke",name:"Invoke",pkg:"",typ:$funcType([M],[O],true)},{prop:"New",name:"New",pkg:"",typ:$funcType([M],[O],true)},{prop:"Bool",name:"Bool",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Int",name:"Int",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Int64",name:"Int64",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Uint64",name:"Uint64",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"Float",name:"Float",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Interface",name:"Interface",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"Unsafe",name:"Unsafe",pkg:"",typ:$funcType([],[$Uintptr],false)}];T.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)},{prop:"Stack",name:"Stack",pkg:"",typ:$funcType([],[$String],false)}];A.init("github.com/gopherjs/gopherjs/js",[{prop:"object",name:"object",embedded:false,exported:false,typ:O,tag:""}]);B.init("",[{prop:"Object",name:"Object",embedded:true,exported:true,typ:O,tag:""}]);J.init($String,$emptyInterface);K.init($emptyInterface);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:L();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["runtime"]=(function(){var $pkg={},$init,A,C,D,AT,AZ,BD,AM,E,AU;A=$packages["github.com/gopherjs/gopherjs/js"];C=$pkg._type=$newType(0,$kindStruct,"runtime._type",true,"runtime",false,function(str_){this.$val=this;if(arguments.length===0){this.str="";return;}this.str=str_;});D=$pkg.TypeAssertionError=$newType(0,$kindStruct,"runtime.TypeAssertionError",true,"runtime",true,function(_interface_,concrete_,asserted_,missingMethod_){this.$val=this;if(arguments.length===0){this._interface=AZ.nil;this.concrete=AZ.nil;this.asserted=AZ.nil;this.missingMethod="";return;}this._interface=_interface_;this.concrete=concrete_;this.asserted=asserted_;this.missingMethod=missingMethod_;});AT=$pkg.errorString=$newType(8,$kindString,"runtime.errorString",true,"runtime",false,null);AZ=$ptrType(C);BD=$ptrType(D);C.ptr.prototype.string=function(){var a;a=this;return a.str;};C.prototype.string=function(){return this.$val.string();};C.ptr.prototype.pkgpath=function(){var a;a=this;return"";};C.prototype.pkgpath=function(){return this.$val.pkgpath();};D.ptr.prototype.RuntimeError=function(){};D.prototype.RuntimeError=function(){return this.$val.RuntimeError();};D.ptr.prototype.Error=function(){var a,b,c,d,e;a=this;b="interface";if(!(a._interface===AZ.nil)){b=a._interface.string();}c=a.asserted.string();if(a.concrete===AZ.nil){return"interface conversion: "+b+" is nil, not "+c;}d=a.concrete.string();if(a.missingMethod===""){e="interface conversion: "+b+" is "+d+", not "+c;if(d===c){if(!(a.concrete.pkgpath()===a.asserted.pkgpath())){e=e+(" (types from different packages)");}else{e=e+(" (types from different scopes)");}}return e;}return"interface conversion: "+d+" is not "+c+": missing method "+a.missingMethod;};D.prototype.Error=function(){return this.$val.Error();};E=function(){var a,b;a=$packages[$externalize("github.com/gopherjs/gopherjs/js",$String)];$jsObjectPtr=a.Object.ptr;$jsErrorPtr=a.Error.ptr;$throwRuntimeError=AU;AM=$internalize($goVersion,$String);b=$ifaceNil;b=new D.ptr(AZ.nil,AZ.nil,AZ.nil,"");$unused(b);};AT.prototype.RuntimeError=function(){var a;a=this.$val;};$ptrType(AT).prototype.RuntimeError=function(){return new AT(this.$get()).RuntimeError();};AT.prototype.Error=function(){var a;a=this.$val;return"runtime error: "+(a);};$ptrType(AT).prototype.Error=function(){return new AT(this.$get()).Error();};AU=function(a){var a;$panic(new AT((a)));};AZ.methods=[{prop:"string",name:"string",pkg:"runtime",typ:$funcType([],[$String],false)},{prop:"pkgpath",name:"pkgpath",pkg:"runtime",typ:$funcType([],[$String],false)}];BD.methods=[{prop:"RuntimeError",name:"RuntimeError",pkg:"",typ:$funcType([],[],false)},{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];AT.methods=[{prop:"RuntimeError",name:"RuntimeError",pkg:"",typ:$funcType([],[],false)},{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];C.init("runtime",[{prop:"str",name:"str",embedded:false,exported:false,typ:$String,tag:""}]);D.init("runtime",[{prop:"_interface",name:"_interface",embedded:false,exported:false,typ:AZ,tag:""},{prop:"concrete",name:"concrete",embedded:false,exported:false,typ:AZ,tag:""},{prop:"asserted",name:"asserted",embedded:false,exported:false,typ:AZ,tag:""},{prop:"missingMethod",name:"missingMethod",embedded:false,exported:false,typ:$String,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}AM="";E();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["math/bits"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["math"]=(function(){var $pkg={},$init,B,A,IT,IU,IV,IW,FL,FM,FN,FO,FP,HH,EX,EY,FK,GA,GH,GK,GL,GM,GS,GT,GW,GX,GZ,HA,HD,HI,HL,HM;B=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["math/bits"];IT=$arrayType($Uint32,2);IU=$arrayType($Float32,2);IV=$arrayType($Float64,1);IW=$structType("math",[{prop:"uint32array",name:"uint32array",embedded:false,exported:false,typ:IT,tag:""},{prop:"float32array",name:"float32array",embedded:false,exported:false,typ:IU,tag:""},{prop:"float64array",name:"float64array",embedded:false,exported:false,typ:IV,tag:""}]);EX=function(av,aw){var av,aw;if(GL(av,1)||GL(aw,1)){return GK(1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return aw;}return av;}if(av>aw){return av;}return aw;};EY=function(av,aw){var av,aw;if(GL(av,-1)||GL(aw,-1)){return GK(-1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return av;}return aw;}if(av>>0)));};$pkg.Abs=FK;GA=function(av){var av;return $parseFloat(FL.cos(av));};$pkg.Cos=GA;GH=function(av){var av;return $parseFloat(FL.floor(av));};$pkg.Floor=GH;GK=function(av){var av;if(av>=0){return FN;}else{return FO;}};$pkg.Inf=GK;GL=function(av,aw){var av,aw;if(av===FN){return aw>=0;}if(av===FO){return aw<=0;}return false;};$pkg.IsInf=GL;GM=function(av){var av,aw;aw=false;aw=!((av===av));return aw;};$pkg.IsNaN=GM;GS=function(av,aw){var av,aw;return EX(av,aw);};$pkg.Max=GS;GT=function(av,aw){var av,aw;return EY(av,aw);};$pkg.Min=GT;GW=function(){return FP;};$pkg.NaN=GW;GX=function(av,aw){var av,aw;if((av===1)||((av===-1)&&((aw===FN)||(aw===FO)))){return 1;}return $parseFloat(FL.pow(av,aw));};$pkg.Pow=GX;GZ=function(av){var av;return av<0||(1/av===FO);};$pkg.Signbit=GZ;HA=function(av){var av;return $parseFloat(FL.sin(av));};$pkg.Sin=HA;HD=function(av){var av;return $parseFloat(FL.sqrt(av));};$pkg.Sqrt=HD;HI=function(){var av;av=new($global.ArrayBuffer)(8);HH.uint32array=new($global.Uint32Array)(av);HH.float32array=new($global.Float32Array)(av);HH.float64array=new($global.Float64Array)(av);};HL=function(av){var av,aw,ax;HH.float64array[0]=av;return(aw=$shiftLeft64((new $Uint64(0,HH.uint32array[1])),32),ax=(new $Uint64(0,HH.uint32array[0])),new $Uint64(aw.$high+ax.$high,aw.$low+ax.$low));};$pkg.Float64bits=HL;HM=function(av){var av;HH.uint32array[0]=((av.$low>>>0));HH.uint32array[1]=(($shiftRightUint64(av,32).$low>>>0));return HH.float64array[0];};$pkg.Float64frombits=HM;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}HH=new IW.ptr(IT.zero(),IU.zero(),IV.zero());FL=$global.Math;FM=0;FN=1/FM;FO=-1/FM;FP=$parseFloat($NaN);HI();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["internal/goarch"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["internal/unsafeheader"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["internal/reflectlite"]=(function(){var $pkg={},$init,D,A,B,C,E,F,I,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AG,AH,AI,AT,AV,BL,BN,BO,BP,CU,CW,DU,DV,DW,DX,DY,DZ,EA,EC,ED,EE,EF,EG,EH,EI,EJ,EK,EL,EM,EN,EO,ES,ET,EU,EV,EW,EX,EY,EZ,AD,AR,BB,BD,BE,BF,BG,BH,BM,BQ,BS,BU,DH,DN,AK,AL,AM,AN,AP,AQ,AU,BA,BC,BI,BJ,BK,BR,BT,BV,BW,BX,BY,BZ,CB,CC,CF,CH,CJ,CM,CQ,CR,CV,CX,CY,CZ,DC,DD,DE,DF,DG,DI,DJ,DK,DL,DM;D=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["internal/goarch"];B=$packages["internal/unsafeheader"];C=$packages["runtime"];E=$pkg.Value=$newType(0,$kindStruct,"reflectlite.Value",true,"internal/reflectlite",true,function(typ_,ptr_,flag_){this.$val=this;if(arguments.length===0){this.typ=DU.nil;this.ptr=0;this.flag=0;return;}this.typ=typ_;this.ptr=ptr_;this.flag=flag_;});F=$pkg.flag=$newType(4,$kindUintptr,"reflectlite.flag",true,"internal/reflectlite",false,null);I=$pkg.ValueError=$newType(0,$kindStruct,"reflectlite.ValueError",true,"internal/reflectlite",true,function(Method_,Kind_){this.$val=this;if(arguments.length===0){this.Method="";this.Kind=0;return;}this.Method=Method_;this.Kind=Kind_;});O=$pkg.Type=$newType(8,$kindInterface,"reflectlite.Type",true,"internal/reflectlite",true,null);P=$pkg.Kind=$newType(4,$kindUint,"reflectlite.Kind",true,"internal/reflectlite",true,null);Q=$pkg.tflag=$newType(1,$kindUint8,"reflectlite.tflag",true,"internal/reflectlite",false,null);R=$pkg.rtype=$newType(0,$kindStruct,"reflectlite.rtype",true,"internal/reflectlite",false,function(size_,ptrdata_,hash_,tflag_,align_,fieldAlign_,kind_,equal_,gcdata_,str_,ptrToThis_){this.$val=this;if(arguments.length===0){this.size=0;this.ptrdata=0;this.hash=0;this.tflag=0;this.align=0;this.fieldAlign=0;this.kind=0;this.equal=$throwNilPointerError;this.gcdata=EG.nil;this.str=0;this.ptrToThis=0;return;}this.size=size_;this.ptrdata=ptrdata_;this.hash=hash_;this.tflag=tflag_;this.align=align_;this.fieldAlign=fieldAlign_;this.kind=kind_;this.equal=equal_;this.gcdata=gcdata_;this.str=str_;this.ptrToThis=ptrToThis_;});S=$pkg.method=$newType(0,$kindStruct,"reflectlite.method",true,"internal/reflectlite",false,function(name_,mtyp_,ifn_,tfn_){this.$val=this;if(arguments.length===0){this.name=0;this.mtyp=0;this.ifn=0;this.tfn=0;return;}this.name=name_;this.mtyp=mtyp_;this.ifn=ifn_;this.tfn=tfn_;});T=$pkg.chanDir=$newType(4,$kindInt,"reflectlite.chanDir",true,"internal/reflectlite",false,null);U=$pkg.arrayType=$newType(0,$kindStruct,"reflectlite.arrayType",true,"internal/reflectlite",false,function(rtype_,elem_,slice_,len_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;this.slice=DU.nil;this.len=0;return;}this.rtype=rtype_;this.elem=elem_;this.slice=slice_;this.len=len_;});V=$pkg.chanType=$newType(0,$kindStruct,"reflectlite.chanType",true,"internal/reflectlite",false,function(rtype_,elem_,dir_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;this.dir=0;return;}this.rtype=rtype_;this.elem=elem_;this.dir=dir_;});W=$pkg.imethod=$newType(0,$kindStruct,"reflectlite.imethod",true,"internal/reflectlite",false,function(name_,typ_){this.$val=this;if(arguments.length===0){this.name=0;this.typ=0;return;}this.name=name_;this.typ=typ_;});X=$pkg.interfaceType=$newType(0,$kindStruct,"reflectlite.interfaceType",true,"internal/reflectlite",false,function(rtype_,pkgPath_,methods_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.pkgPath=new BO.ptr(EG.nil);this.methods=EK.nil;return;}this.rtype=rtype_;this.pkgPath=pkgPath_;this.methods=methods_;});Y=$pkg.mapType=$newType(0,$kindStruct,"reflectlite.mapType",true,"internal/reflectlite",false,function(rtype_,key_,elem_,bucket_,hasher_,keysize_,valuesize_,bucketsize_,flags_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.key=DU.nil;this.elem=DU.nil;this.bucket=DU.nil;this.hasher=$throwNilPointerError;this.keysize=0;this.valuesize=0;this.bucketsize=0;this.flags=0;return;}this.rtype=rtype_;this.key=key_;this.elem=elem_;this.bucket=bucket_;this.hasher=hasher_;this.keysize=keysize_;this.valuesize=valuesize_;this.bucketsize=bucketsize_;this.flags=flags_;});Z=$pkg.ptrType=$newType(0,$kindStruct,"reflectlite.ptrType",true,"internal/reflectlite",false,function(rtype_,elem_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;return;}this.rtype=rtype_;this.elem=elem_;});AA=$pkg.sliceType=$newType(0,$kindStruct,"reflectlite.sliceType",true,"internal/reflectlite",false,function(rtype_,elem_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;return;}this.rtype=rtype_;this.elem=elem_;});AB=$pkg.structField=$newType(0,$kindStruct,"reflectlite.structField",true,"internal/reflectlite",false,function(name_,typ_,offsetEmbed_){this.$val=this;if(arguments.length===0){this.name=new BO.ptr(EG.nil);this.typ=DU.nil;this.offsetEmbed=0;return;}this.name=name_;this.typ=typ_;this.offsetEmbed=offsetEmbed_;});AC=$pkg.structType=$newType(0,$kindStruct,"reflectlite.structType",true,"internal/reflectlite",false,function(rtype_,pkgPath_,fields_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.pkgPath=new BO.ptr(EG.nil);this.fields=EL.nil;return;}this.rtype=rtype_;this.pkgPath=pkgPath_;this.fields=fields_;});AG=$pkg.nameOff=$newType(4,$kindInt32,"reflectlite.nameOff",true,"internal/reflectlite",false,null);AH=$pkg.typeOff=$newType(4,$kindInt32,"reflectlite.typeOff",true,"internal/reflectlite",false,null);AI=$pkg.textOff=$newType(4,$kindInt32,"reflectlite.textOff",true,"internal/reflectlite",false,null);AT=$pkg.errorString=$newType(0,$kindStruct,"reflectlite.errorString",true,"internal/reflectlite",false,function(s_){this.$val=this;if(arguments.length===0){this.s="";return;}this.s=s_;});AV=$pkg.Method=$newType(0,$kindStruct,"reflectlite.Method",true,"internal/reflectlite",true,function(Name_,PkgPath_,Type_,Func_,Index_){this.$val=this;if(arguments.length===0){this.Name="";this.PkgPath="";this.Type=$ifaceNil;this.Func=new E.ptr(DU.nil,0,0);this.Index=0;return;}this.Name=Name_;this.PkgPath=PkgPath_;this.Type=Type_;this.Func=Func_;this.Index=Index_;});BL=$pkg.uncommonType=$newType(0,$kindStruct,"reflectlite.uncommonType",true,"internal/reflectlite",false,function(pkgPath_,mcount_,xcount_,moff_,_methods_){this.$val=this;if(arguments.length===0){this.pkgPath=0;this.mcount=0;this.xcount=0;this.moff=0;this._methods=ED.nil;return;}this.pkgPath=pkgPath_;this.mcount=mcount_;this.xcount=xcount_;this.moff=moff_;this._methods=_methods_;});BN=$pkg.funcType=$newType(0,$kindStruct,"reflectlite.funcType",true,"internal/reflectlite",false,function(rtype_,inCount_,outCount_,_in_,_out_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.inCount=0;this.outCount=0;this._in=DW.nil;this._out=DW.nil;return;}this.rtype=rtype_;this.inCount=inCount_;this.outCount=outCount_;this._in=_in_;this._out=_out_;});BO=$pkg.name=$newType(0,$kindStruct,"reflectlite.name",true,"internal/reflectlite",false,function(bytes_){this.$val=this;if(arguments.length===0){this.bytes=EG.nil;return;}this.bytes=bytes_;});BP=$pkg.nameData=$newType(0,$kindStruct,"reflectlite.nameData",true,"internal/reflectlite",false,function(name_,tag_,exported_){this.$val=this;if(arguments.length===0){this.name="";this.tag="";this.exported=false;return;}this.name=name_;this.tag=tag_;this.exported=exported_;});CU=$pkg.mapIter=$newType(0,$kindStruct,"reflectlite.mapIter",true,"internal/reflectlite",false,function(t_,m_,keys_,i_,last_){this.$val=this;if(arguments.length===0){this.t=$ifaceNil;this.m=null;this.keys=null;this.i=0;this.last=null;return;}this.t=t_;this.m=m_;this.keys=keys_;this.i=i_;this.last=last_;});CW=$pkg.TypeEx=$newType(8,$kindInterface,"reflectlite.TypeEx",true,"internal/reflectlite",true,null);DU=$ptrType(R);DV=$sliceType(BO);DW=$sliceType(DU);DX=$sliceType($String);DY=$sliceType($emptyInterface);DZ=$ptrType(D.Object);EA=$funcType([DY],[DZ],true);EC=$ptrType(BL);ED=$sliceType(S);EE=$ptrType(BN);EF=$sliceType(E);EG=$ptrType($Uint8);EH=$ptrType($UnsafePointer);EI=$sliceType(O);EJ=$sliceType(DZ);EK=$sliceType(W);EL=$sliceType(AB);EM=$ptrType(BP);EN=$structType("internal/reflectlite",[{prop:"str",name:"str",embedded:false,exported:false,typ:$String,tag:""}]);EO=$ptrType(CU);ES=$arrayType($Uintptr,2);ET=$sliceType($Uint8);EU=$ptrType(I);EV=$funcType([$UnsafePointer,$UnsafePointer],[$Bool],false);EW=$ptrType(X);EX=$funcType([$UnsafePointer,$Uintptr],[$Uintptr],false);EY=$ptrType(AB);EZ=$ptrType(AT);F.prototype.kind=function(){var m;m=this.$val;return((((m&31)>>>0)>>>0));};$ptrType(F).prototype.kind=function(){return new F(this.$get()).kind();};F.prototype.ro=function(){var m;m=this.$val;if(!((((m&96)>>>0)===0))){return 32;}return 0;};$ptrType(F).prototype.ro=function(){return new F(this.$get()).ro();};E.ptr.prototype.pointer=function(){var m;m=this;if(!((m.typ.size===4))||!m.typ.pointers()){$panic(new $String("can't call pointer on a non-pointer Value"));}if(!((((m.flag&128)>>>0)===0))){return(m.ptr).$get();}return m.ptr;};E.prototype.pointer=function(){return this.$val.pointer();};I.ptr.prototype.Error=function(){var m;m=this;if(m.Kind===0){return"reflect: call of "+m.Method+" on zero Value";}return"reflect: call of "+m.Method+" on "+new P(m.Kind).String()+" Value";};I.prototype.Error=function(){return this.$val.Error();};F.prototype.mustBeExported=function(){var m;m=this.$val;if(m===0){$panic(new I.ptr(DF(),0));}if(!((((m&96)>>>0)===0))){$panic(new $String("reflect: "+DF()+" using value obtained using unexported field"));}};$ptrType(F).prototype.mustBeExported=function(){return new F(this.$get()).mustBeExported();};F.prototype.mustBeAssignable=function(){var m;m=this.$val;if(m===0){$panic(new I.ptr(DF(),0));}if(!((((m&96)>>>0)===0))){$panic(new $String("reflect: "+DF()+" using value obtained using unexported field"));}if(((m&256)>>>0)===0){$panic(new $String("reflect: "+DF()+" using unaddressable value"));}};$ptrType(F).prototype.mustBeAssignable=function(){return new F(this.$get()).mustBeAssignable();};E.ptr.prototype.CanSet=function(){var m;m=this;return((m.flag&352)>>>0)===256;};E.prototype.CanSet=function(){return this.$val.CanSet();};E.ptr.prototype.IsValid=function(){var m;m=this;return!((m.flag===0));};E.prototype.IsValid=function(){return this.$val.IsValid();};E.ptr.prototype.Kind=function(){var m;m=this;return new F(m.flag).kind();};E.prototype.Kind=function(){return this.$val.Kind();};E.ptr.prototype.Type=function(){var m,n;m=this;n=m.flag;if(n===0){$panic(new I.ptr("reflectlite.Value.Type",0));}return m.typ;};E.prototype.Type=function(){return this.$val.Type();};AB.ptr.prototype.embedded=function(){var m;m=this;return!((((m.offsetEmbed&1)>>>0)===0));};AB.prototype.embedded=function(){return this.$val.embedded();};P.prototype.String=function(){var m;m=this.$val;if(((m>>0))=AD.$length)?($throwRuntimeError("index out of range"),undefined):AD.$array[AD.$offset+m]);}return(0>=AD.$length?($throwRuntimeError("index out of range"),undefined):AD.$array[AD.$offset+0]);};$ptrType(P).prototype.String=function(){return new P(this.$get()).String();};R.ptr.prototype.String=function(){var m,n;m=this;n=$clone(m.nameOff(m.str),BO).name();if(!((((m.tflag&2)>>>0)===0))){return $substring(n,1);}return n;};R.prototype.String=function(){return this.$val.String();};R.ptr.prototype.Size=function(){var m;m=this;return m.size;};R.prototype.Size=function(){return this.$val.Size();};R.ptr.prototype.Kind=function(){var m;m=this;return((((m.kind&31)>>>0)>>>0));};R.prototype.Kind=function(){return this.$val.Kind();};R.ptr.prototype.pointers=function(){var m;m=this;return!((m.ptrdata===0));};R.prototype.pointers=function(){return this.$val.pointers();};R.ptr.prototype.common=function(){var m;m=this;return m;};R.prototype.common=function(){return this.$val.common();};R.ptr.prototype.exportedMethods=function(){var m,n;m=this;n=m.uncommon();if(n===EC.nil){return ED.nil;}return n.exportedMethods();};R.prototype.exportedMethods=function(){return this.$val.exportedMethods();};R.ptr.prototype.NumMethod=function(){var m,n;m=this;if(m.Kind()===20){n=(m.kindType);return n.NumMethod();}return m.exportedMethods().$length;};R.prototype.NumMethod=function(){return this.$val.NumMethod();};R.ptr.prototype.PkgPath=function(){var m,n;m=this;if(((m.tflag&4)>>>0)===0){return"";}n=m.uncommon();if(n===EC.nil){return"";}return $clone(m.nameOff(n.pkgPath),BO).name();};R.prototype.PkgPath=function(){return this.$val.PkgPath();};R.ptr.prototype.hasName=function(){var m;m=this;return!((((m.tflag&4)>>>0)===0));};R.prototype.hasName=function(){return this.$val.hasName();};R.ptr.prototype.Name=function(){var m,n,o;m=this;if(!m.hasName()){return"";}n=m.String();o=n.length-1>>0;while(true){if(!(o>=0&&!((n.charCodeAt(o)===46)))){break;}o=o-(1)>>0;}return $substring(n,(o+1>>0));};R.prototype.Name=function(){return this.$val.Name();};R.ptr.prototype.chanDir=function(){var m,n;m=this;if(!((m.Kind()===18))){$panic(new $String("reflect: chanDir of non-chan type"));}n=(m.kindType);return((n.dir>>0));};R.prototype.chanDir=function(){return this.$val.chanDir();};R.ptr.prototype.Elem=function(){var m,n,o,p,q,r,s;m=this;n=m.Kind();if(n===(17)){o=(m.kindType);return AP(o.elem);}else if(n===(18)){p=(m.kindType);return AP(p.elem);}else if(n===(21)){q=(m.kindType);return AP(q.elem);}else if(n===(22)){r=(m.kindType);return AP(r.elem);}else if(n===(23)){s=(m.kindType);return AP(s.elem);}$panic(new $String("reflect: Elem of invalid type"));};R.prototype.Elem=function(){return this.$val.Elem();};R.ptr.prototype.In=function(m){var m,n,o,p;n=this;if(!((n.Kind()===19))){$panic(new $String("reflect: In of non-func type"));}o=(n.kindType);return AP((p=o.in$(),((m<0||m>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+m])));};R.prototype.In=function(m){return this.$val.In(m);};R.ptr.prototype.Len=function(){var m,n;m=this;if(!((m.Kind()===17))){$panic(new $String("reflect: Len of non-array type"));}n=(m.kindType);return((n.len>>0));};R.prototype.Len=function(){return this.$val.Len();};R.ptr.prototype.NumIn=function(){var m,n;m=this;if(!((m.Kind()===19))){$panic(new $String("reflect: NumIn of non-func type"));}n=(m.kindType);return((n.inCount>>0));};R.prototype.NumIn=function(){return this.$val.NumIn();};R.ptr.prototype.NumOut=function(){var m,n;m=this;if(!((m.Kind()===19))){$panic(new $String("reflect: NumOut of non-func type"));}n=(m.kindType);return n.out().$length;};R.prototype.NumOut=function(){return this.$val.NumOut();};R.ptr.prototype.Out=function(m){var m,n,o,p;n=this;if(!((n.Kind()===19))){$panic(new $String("reflect: Out of non-func type"));}o=(n.kindType);return AP((p=o.out(),((m<0||m>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+m])));};R.prototype.Out=function(m){return this.$val.Out(m);};X.ptr.prototype.NumMethod=function(){var m;m=this;return m.methods.$length;};X.prototype.NumMethod=function(){return this.$val.NumMethod();};R.ptr.prototype.Implements=function(m){var{m,n,o,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;if($interfaceIsEqual(m,$ifaceNil)){$panic(new $String("reflect: nil type passed to Type.Implements"));}o=m.Kind();$s=3;case 3:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}if(!((o===20))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect: non-interface type passed to Type.Implements"));case 2:$s=-1;return AK($assertType(m,DU),n);}return;}var $f={$blk:R.ptr.prototype.Implements,$c:true,$r,m,n,o,$s};return $f;};R.prototype.Implements=function(m){return this.$val.Implements(m);};R.ptr.prototype.AssignableTo=function(m){var{m,n,o,p,q,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;if($interfaceIsEqual(m,$ifaceNil)){$panic(new $String("reflect: nil type passed to Type.AssignableTo"));}o=$assertType(m,DU);p=AL(o,n);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p||AK(o,n);$s=2;case 2:return q;}return;}var $f={$blk:R.ptr.prototype.AssignableTo,$c:true,$r,m,n,o,p,q,$s};return $f;};R.prototype.AssignableTo=function(m){return this.$val.AssignableTo(m);};AK=function(m,n){var aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,m,n,o,p,q,r,s,t,u,v,w,x,y,z;if(!((m.Kind()===20))){return false;}o=(m.kindType);if(o.methods.$length===0){return true;}if(n.Kind()===20){p=(n.kindType);q=0;r=0;while(true){if(!(r=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+q]));u=$clone(o.rtype.nameOff(t.name),BO);w=(v=p.methods,((r<0||r>=v.$length)?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+r]));x=$clone(n.nameOff(w.name),BO);if($clone(x,BO).name()===$clone(u,BO).name()&&n.typeOff(w.typ)===o.rtype.typeOff(t.typ)){if(!$clone(u,BO).isExported()){y=$clone(u,BO).pkgPath();if(y===""){y=$clone(o.pkgPath,BO).name();}z=$clone(x,BO).pkgPath();if(z===""){z=$clone(p.pkgPath,BO).name();}if(!(y===z)){r=r+(1)>>0;continue;}}q=q+(1)>>0;if(q>=o.methods.$length){return true;}}r=r+(1)>>0;}return false;}aa=n.uncommon();if(aa===EC.nil){return false;}ab=0;ac=aa.methods();ad=0;while(true){if(!(ad<((aa.mcount>>0)))){break;}af=(ae=o.methods,((ab<0||ab>=ae.$length)?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+ab]));ag=$clone(o.rtype.nameOff(af.name),BO);ah=$clone(((ad<0||ad>=ac.$length)?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+ad]),S);ai=$clone(n.nameOff(ah.name),BO);if($clone(ai,BO).name()===$clone(ag,BO).name()&&n.typeOff(ah.mtyp)===o.rtype.typeOff(af.typ)){if(!$clone(ag,BO).isExported()){aj=$clone(ag,BO).pkgPath();if(aj===""){aj=$clone(o.pkgPath,BO).name();}ak=$clone(ai,BO).pkgPath();if(ak===""){ak=$clone(n.nameOff(aa.pkgPath),BO).name();}if(!(aj===ak)){ad=ad+(1)>>0;continue;}}ab=ab+(1)>>0;if(ab>=o.methods.$length){return true;}}ad=ad+(1)>>0;}return false;};AL=function(m,n){var{m,n,o,p,$s,$r,$c}=$restore(this,{m,n});$s=$s||0;s:while(true){switch($s){case 0:if(m===n){$s=-1;return true;}if(m.hasName()&&n.hasName()||!((m.Kind()===n.Kind()))){$s=-1;return false;}o=AN(m,n,true);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}p=o;$s=2;case 2:return p;}return;}var $f={$blk:AL,$c:true,$r,m,n,o,p,$s};return $f;};AM=function(m,n,o){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:if(o){$s=-1;return $interfaceIsEqual(m,n);}q=m.Name();$s=4;case 4:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=n.Name();$s=5;case 5:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}if(!(q===r)){p=true;$s=3;continue s;}s=m.Kind();$s=6;case 6:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=n.Kind();$s=7;case 7:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}p=!((s===t));case 3:if(p){$s=1;continue;}$s=2;continue;case 1:$s=-1;return false;case 2:u=m.common();$s=8;case 8:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}v=u;w=n.common();$s=9;case 9:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=w;y=AN(v,x,false);$s=10;case 10:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=y;$s=11;case 11:return z;}return;}var $f={$blk:AM,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AN=function(m,n,o){var{aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:if(m===n){$s=-1;return true;}p=m.Kind();if(!((p===n.Kind()))){$s=-1;return false;}if(1<=p&&p<=16||(p===24)||(p===26)){$s=-1;return true;}q=p;if(q===(17)){$s=2;continue;}if(q===(18)){$s=3;continue;}if(q===(19)){$s=4;continue;}if(q===(20)){$s=5;continue;}if(q===(21)){$s=6;continue;}if((q===(22))||(q===(23))){$s=7;continue;}if(q===(25)){$s=8;continue;}$s=9;continue;case 2:if(!(m.Len()===n.Len())){r=false;$s=10;continue s;}s=AM(m.Elem(),n.Elem(),o);$s=11;case 11:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;case 10:t=r;$s=12;case 12:return t;case 3:if(!(n.chanDir()===3)){u=false;$s=15;continue s;}v=AM(m.Elem(),n.Elem(),o);$s=16;case 16:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}u=v;case 15:if(u){$s=13;continue;}$s=14;continue;case 13:$s=-1;return true;case 14:if(!(n.chanDir()===m.chanDir())){w=false;$s=17;continue s;}x=AM(m.Elem(),n.Elem(),o);$s=18;case 18:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}w=x;case 17:y=w;$s=19;case 19:return y;case 4:z=(m.kindType);aa=(n.kindType);if(!((z.outCount===aa.outCount))||!((z.inCount===aa.inCount))){$s=-1;return false;}ab=0;case 20:if(!(ab>0;$s=20;continue;case 21:ad=0;case 25:if(!(ad>0;$s=25;continue;case 26:$s=-1;return true;case 5:af=(m.kindType);ag=(n.kindType);if((af.methods.$length===0)&&(ag.methods.$length===0)){$s=-1;return true;}$s=-1;return false;case 6:ai=AM(m.Key(),n.Key(),o);$s=31;case 31:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}if(!(ai)){ah=false;$s=30;continue s;}aj=AM(m.Elem(),n.Elem(),o);$s=32;case 32:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ah=aj;case 30:ak=ah;$s=33;case 33:return ak;case 7:al=AM(m.Elem(),n.Elem(),o);$s=34;case 34:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=al;$s=35;case 35:return am;case 8:an=(m.kindType);ao=(n.kindType);if(!((an.fields.$length===ao.fields.$length))){$s=-1;return false;}if(!($clone(an.pkgPath,BO).name()===$clone(ao.pkgPath,BO).name())){$s=-1;return false;}ap=an.fields;aq=0;case 36:if(!(aq=as.$length)?($throwRuntimeError("index out of range"),undefined):as.$array[as.$offset+ar]));av=(au=ao.fields,((ar<0||ar>=au.$length)?($throwRuntimeError("index out of range"),undefined):au.$array[au.$offset+ar]));if(!($clone(at.name,BO).name()===$clone(av.name,BO).name())){$s=-1;return false;}aw=AM(at.typ,av.typ,o);$s=40;case 40:if($c){$c=false;aw=aw.$blk();}if(aw&&aw.$blk!==undefined){break s;}if(!aw){$s=38;continue;}$s=39;continue;case 38:$s=-1;return false;case 39:if(o&&!($clone(at.name,BO).tag()===$clone(av.name,BO).tag())){$s=-1;return false;}if(!((at.offsetEmbed===av.offsetEmbed))){$s=-1;return false;}aq++;$s=36;continue;case 37:$s=-1;return true;case 9:case 1:$s=-1;return false;}return;}var $f={$blk:AN,$c:true,$r,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AP=function(m){var m;if(m===DU.nil){return $ifaceNil;}return m;};AQ=function(m){var m;return((m.kind&32)>>>0)===0;};E.ptr.prototype.object=function(){var m,n,o,p;m=this;if((m.typ.Kind()===17)||(m.typ.Kind()===25)){return m.ptr;}if(!((((m.flag&128)>>>0)===0))){n=m.ptr.$get();if(!(n===$ifaceNil)&&!(n.constructor===BI(m.typ))){switch(0){default:o=m.typ.Kind();if((o===(11))||(o===(6))){n=new(BI(m.typ))(n.$high,n.$low);}else if((o===(15))||(o===(16))){n=new(BI(m.typ))(n.$real,n.$imag);}else if(o===(23)){if(n===n.constructor.nil){n=BI(m.typ).nil;break;}p=new(BI(m.typ))(n.$array);p.$offset=n.$offset;p.$length=n.$length;p.$capacity=n.$capacity;n=p;}}}return n;}return m.ptr;};E.prototype.object=function(){return this.$val.object();};E.ptr.prototype.assignTo=function(m,n,o){var{m,n,o,p,q,r,s,t,u,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:p=this;if(!((((p.flag&512)>>>0)===0))){$s=1;continue;}$s=2;continue;case 1:q=DG(m,$clone(p,E));$s=3;case 3:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}E.copy(p,q);case 2:r=AL(n,p.typ);$s=8;case 8:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}if(r){$s=5;continue;}if(AK(n,p.typ)){$s=6;continue;}$s=7;continue;case 5:s=(((p.flag&384)>>>0)|new F(p.flag).ro())>>>0;s=(s|(((n.Kind()>>>0))))>>>0;$s=-1;return new E.ptr(n,p.ptr,s);case 6:if(o===0){o=CJ(n);}t=DD($clone(p,E));$s=9;case 9:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}u=t;if(n.NumMethod()===0){(o).$set(u);}else{DE(n,u,o);}$s=-1;return new E.ptr(n,o,148);case 7:case 4:$panic(new $String(m+": value of type "+p.typ.String()+" is not assignable to type "+n.String()));$s=-1;return new E.ptr(DU.nil,0,0);}return;}var $f={$blk:E.ptr.prototype.assignTo,$c:true,$r,m,n,o,p,q,r,s,t,u,$s};return $f;};E.prototype.assignTo=function(m,n,o){return this.$val.assignTo(m,n,o);};E.ptr.prototype.Cap=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if(o===(17)){return m.typ.Len();}else if((o===(18))||(o===(23))){return $parseInt($clone(m,E).object().$capacity)>>0;}$panic(new I.ptr("reflect.Value.Cap",n));};E.prototype.Cap=function(){return this.$val.Cap();};E.ptr.prototype.Index=function(m){var{aa,ab,ac,ad,ae,af,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:m=[m];n=[n];o=[o];p=[p];q=[q];r=[r];s=this;t=new F(s.flag).kind();u=t;if(u===(17)){$s=2;continue;}if(u===(23)){$s=3;continue;}if(u===(24)){$s=4;continue;}$s=5;continue;case 2:v=(s.typ.kindType);if(m[0]<0||m[0]>((v.len>>0))){$panic(new $String("reflect: array index out of range"));}q[0]=v.elem;w=(((((s.flag&384)>>>0)|new F(s.flag).ro())>>>0)|((q[0].Kind()>>>0)))>>>0;n[0]=s.ptr;if(!((((w&128)>>>0)===0))&&!((q[0].Kind()===17))&&!((q[0].Kind()===25))){$s=7;continue;}$s=8;continue;case 7:$s=-1;return new E.ptr(q[0],(new(BI(DL(q[0])))((function(m,n,o,p,q,r){return function(){return DI(q[0],n[0][m[0]]);};})(m,n,o,p,q,r),(function(m,n,o,p,q,r){return function(x){var x;n[0][m[0]]=DJ(q[0],x);};})(m,n,o,p,q,r))),w);case 8:x=BZ(q[0],DI(q[0],n[0][m[0]]),w);$s=9;case 9:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}y=x;$s=10;case 10:return y;case 3:z=$clone(s,E).object();if(m[0]<0||m[0]>=($parseInt(z.$length)>>0)){$panic(new $String("reflect: slice index out of range"));}aa=(s.typ.kindType);r[0]=aa.elem;ab=(((384|new F(s.flag).ro())>>>0)|((r[0].Kind()>>>0)))>>>0;m[0]=m[0]+(($parseInt(z.$offset)>>0))>>0;o[0]=z.$array;if(!((((ab&128)>>>0)===0))&&!((r[0].Kind()===17))&&!((r[0].Kind()===25))){$s=11;continue;}$s=12;continue;case 11:$s=-1;return new E.ptr(r[0],(new(BI(DL(r[0])))((function(m,n,o,p,q,r){return function(){return DI(r[0],o[0][m[0]]);};})(m,n,o,p,q,r),(function(m,n,o,p,q,r){return function(ac){var ac;o[0][m[0]]=DJ(r[0],ac);};})(m,n,o,p,q,r))),ab);case 12:ac=BZ(r[0],DI(r[0],o[0][m[0]]),ab);$s=13;case 13:if($c){$c=false;ac=ac.$blk();}if(ac&&ac.$blk!==undefined){break s;}ad=ac;$s=14;case 14:return ad;case 4:ae=(s.ptr).$get();if(m[0]<0||m[0]>=ae.length){$panic(new $String("reflect: string index out of range"));}af=(((new F(s.flag).ro()|8)>>>0)|128)>>>0;p[0]=ae.charCodeAt(m[0]);$s=-1;return new E.ptr(BD,((p.$ptr||(p.$ptr=new EG(function(){return this.$target[0];},function($v){this.$target[0]=$v;},p)))),af);case 5:$panic(new I.ptr("reflect.Value.Index",t));case 6:case 1:$s=-1;return new E.ptr(DU.nil,0,0);}return;}var $f={$blk:E.ptr.prototype.Index,$c:true,$r,aa,ab,ac,ad,ae,af,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};E.prototype.Index=function(m){return this.$val.Index(m);};E.ptr.prototype.InterfaceData=function(){var m;m=this;$panic(new $String("InterfaceData is not supported by GopherJS"));};E.prototype.InterfaceData=function(){return this.$val.InterfaceData();};E.ptr.prototype.IsNil=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if((o===(22))||(o===(23))){return $clone(m,E).object()===BI(m.typ).nil;}else if(o===(18)){return $clone(m,E).object()===$chanNil;}else if(o===(19)){return $clone(m,E).object()===$throwNilPointerError;}else if(o===(21)){return $clone(m,E).object()===false;}else if(o===(20)){return $clone(m,E).object()===$ifaceNil;}else if(o===(26)){return $clone(m,E).object()===0;}else{$panic(new I.ptr("reflect.Value.IsNil",n));}};E.prototype.IsNil=function(){return this.$val.IsNil();};E.ptr.prototype.Len=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if((o===(17))||(o===(24))){return $parseInt($clone(m,E).object().length);}else if(o===(23)){return $parseInt($clone(m,E).object().$length)>>0;}else if(o===(18)){return $parseInt($clone(m,E).object().$buffer.length)>>0;}else if(o===(21)){return $parseInt($keys($clone(m,E).object()).length);}else{$panic(new I.ptr("reflect.Value.Len",n));}};E.prototype.Len=function(){return this.$val.Len();};E.ptr.prototype.Pointer=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if((o===(18))||(o===(21))||(o===(22))||(o===(26))){if($clone(m,E).IsNil()){return 0;}return $clone(m,E).object();}else if(o===(19)){if($clone(m,E).IsNil()){return 0;}return 1;}else if(o===(23)){if($clone(m,E).IsNil()){return 0;}return $clone(m,E).object().$array;}else{$panic(new I.ptr("reflect.Value.Pointer",n));}};E.prototype.Pointer=function(){return this.$val.Pointer();};E.ptr.prototype.Set=function(m){var{m,n,o,p,q,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;new F(n.flag).mustBeAssignable();new F(m.flag).mustBeExported();o=$clone(m,E).assignTo("reflect.Set",n.typ,0);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}E.copy(m,o);if(!((((n.flag&128)>>>0)===0))){$s=2;continue;}$s=3;continue;case 2:p=n.typ.Kind();if(p===(17)){$s=5;continue;}if(p===(20)){$s=6;continue;}if(p===(25)){$s=7;continue;}$s=8;continue;case 5:BI(n.typ).copy(n.ptr,m.ptr);$s=9;continue;case 6:q=DD($clone(m,E));$s=10;case 10:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}n.ptr.$set(q);$s=9;continue;case 7:BY(n.ptr,m.ptr,n.typ);$s=9;continue;case 8:n.ptr.$set($clone(m,E).object());case 9:case 4:$s=-1;return;case 3:n.ptr=m.ptr;$s=-1;return;}return;}var $f={$blk:E.ptr.prototype.Set,$c:true,$r,m,n,o,p,q,$s};return $f;};E.prototype.Set=function(m){return this.$val.Set(m);};E.ptr.prototype.SetBytes=function(m){var{m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;new F(n.flag).mustBeAssignable();new F(n.flag).mustBe(23);o=n.typ.Elem().Kind();$s=3;case 3:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}if(!((o===8))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.Value.SetBytes of non-byte slice"));case 2:p=m;if(!(n.typ.Name()==="")){q=true;$s=6;continue s;}r=n.typ.Elem().Name();$s=7;case 7:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}q=!(r==="");case 6:if(q){$s=4;continue;}$s=5;continue;case 4:s=new(BI(n.typ))(p.$array);s.$offset=p.$offset;s.$length=p.$length;s.$capacity=p.$capacity;p=s;case 5:n.ptr.$set(p);$s=-1;return;}return;}var $f={$blk:E.ptr.prototype.SetBytes,$c:true,$r,m,n,o,p,q,r,s,$s};return $f;};E.prototype.SetBytes=function(m){return this.$val.SetBytes(m);};E.ptr.prototype.SetCap=function(m){var m,n,o,p;n=this;new F(n.flag).mustBeAssignable();new F(n.flag).mustBe(23);o=n.ptr.$get();if(m<($parseInt(o.$length)>>0)||m>($parseInt(o.$capacity)>>0)){$panic(new $String("reflect: slice capacity out of range in SetCap"));}p=new(BI(n.typ))(o.$array);p.$offset=o.$offset;p.$length=o.$length;p.$capacity=m;n.ptr.$set(p);};E.prototype.SetCap=function(m){return this.$val.SetCap(m);};E.ptr.prototype.SetLen=function(m){var m,n,o,p;n=this;new F(n.flag).mustBeAssignable();new F(n.flag).mustBe(23);o=n.ptr.$get();if(m<0||m>($parseInt(o.$capacity)>>0)){$panic(new $String("reflect: slice length out of range in SetLen"));}p=new(BI(n.typ))(o.$array);p.$offset=o.$offset;p.$length=m;p.$capacity=o.$capacity;n.ptr.$set(p);};E.prototype.SetLen=function(m){return this.$val.SetLen(m);};E.ptr.prototype.Slice=function(m,n){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n});$s=$s||0;s:while(true){switch($s){case 0:o=this;p=0;q=$ifaceNil;r=null;s=new F(o.flag).kind();t=s;if(t===(17)){$s=2;continue;}if(t===(23)){$s=3;continue;}if(t===(24)){$s=4;continue;}$s=5;continue;case 2:if(((o.flag&256)>>>0)===0){$panic(new $String("reflect.Value.Slice: slice of unaddressable array"));}u=(o.typ.kindType);p=((u.len>>0));q=CH(u.elem);r=new(BI(q))($clone(o,E).object());$s=6;continue;case 3:q=o.typ;r=$clone(o,E).object();p=$parseInt(r.$capacity)>>0;$s=6;continue;case 4:v=(o.ptr).$get();if(m<0||nv.length){$panic(new $String("reflect.Value.Slice: string slice index out of bounds"));}w=CC(new $String($substring(v,m,n)));$s=7;case 7:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=w;$s=8;case 8:return x;case 5:$panic(new I.ptr("reflect.Value.Slice",s));case 6:case 1:if(m<0||np){$panic(new $String("reflect.Value.Slice: slice index out of bounds"));}y=BZ(q,$subslice(r,m,n),new F(o.flag).ro());$s=9;case 9:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=y;$s=10;case 10:return z;}return;}var $f={$blk:E.ptr.prototype.Slice,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};E.prototype.Slice=function(m,n){return this.$val.Slice(m,n);};E.ptr.prototype.Slice3=function(m,n,o){var{m,n,o,p,q,r,s,t,u,v,w,x,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:p=this;q=0;r=$ifaceNil;s=null;t=new F(p.flag).kind();u=t;if(u===(17)){if(((p.flag&256)>>>0)===0){$panic(new $String("reflect.Value.Slice: slice of unaddressable array"));}v=(p.typ.kindType);q=((v.len>>0));r=CH(v.elem);s=new(BI(r))($clone(p,E).object());}else if(u===(23)){r=p.typ;s=$clone(p,E).object();q=$parseInt(s.$capacity)>>0;}else{$panic(new I.ptr("reflect.Value.Slice3",t));}if(m<0||nq){$panic(new $String("reflect.Value.Slice3: slice index out of bounds"));}w=BZ(r,$subslice(s,m,n,o),new F(p.flag).ro());$s=1;case 1:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=w;$s=2;case 2:return x;}return;}var $f={$blk:E.ptr.prototype.Slice3,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,$s};return $f;};E.prototype.Slice3=function(m,n,o){return this.$val.Slice3(m,n,o);};E.ptr.prototype.Close=function(){var m;m=this;new F(m.flag).mustBe(18);new F(m.flag).mustBeExported();$close($clone(m,E).object());};E.prototype.Close=function(){return this.$val.Close();};E.ptr.prototype.Elem=function(){var{m,n,o,p,q,r,s,t,u,v,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=this;n=new F(m.flag).kind();o=n;if(o===(20)){$s=2;continue;}if(o===(22)){$s=3;continue;}$s=4;continue;case 2:p=$clone(m,E).object();if(p===$ifaceNil){$s=-1;return new E.ptr(DU.nil,0,0);}q=BJ(p.constructor);r=BZ(q,p.$val,new F(m.flag).ro());$s=6;case 6:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=r;$s=7;case 7:return s;case 3:if($clone(m,E).IsNil()){$s=-1;return new E.ptr(DU.nil,0,0);}t=$clone(m,E).object();u=(m.typ.kindType);v=(((((m.flag&96)>>>0)|128)>>>0)|256)>>>0;v=(v|(((u.elem.Kind()>>>0))))>>>0;$s=-1;return new E.ptr(u.elem,(DI(u.elem,t)),v);case 4:$panic(new I.ptr("reflect.Value.Elem",n));case 5:case 1:$s=-1;return new E.ptr(DU.nil,0,0);}return;}var $f={$blk:E.ptr.prototype.Elem,$c:true,$r,m,n,o,p,q,r,s,t,u,v,$s};return $f;};E.prototype.Elem=function(){return this.$val.Elem();};E.ptr.prototype.NumField=function(){var m,n;m=this;new F(m.flag).mustBe(25);n=(m.typ.kindType);return n.fields.$length;};E.prototype.NumField=function(){return this.$val.NumField();};E.ptr.prototype.MapKeys=function(){var{m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=this;new F(m.flag).mustBe(21);n=(m.typ.kindType);o=n.key;p=(new F(m.flag).ro()|((o.Kind()>>>0)))>>>0;q=$clone(m,E).pointer();r=0;if(!(q===0)){r=CZ(q);}s=CV(m.typ,q);t=$makeSlice(EF,r);u=0;u=0;case 1:if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]),DM(o,p,w));CY(s);u=u+(1)>>0;$s=1;continue;case 2:$s=-1;return $subslice(t,0,u);}return;}var $f={$blk:E.ptr.prototype.MapKeys,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};E.prototype.MapKeys=function(){return this.$val.MapKeys();};E.ptr.prototype.MapIndex=function(m){var{m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;new F(n.flag).mustBe(21);o=(n.typ.kindType);p=$clone(m,E).assignTo("reflect.Value.MapIndex",o.key,0);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}E.copy(m,p);q=0;if(!((((m.flag&128)>>>0)===0))){q=m.ptr;}else{q=((m.$ptr_ptr||(m.$ptr_ptr=new EH(function(){return this.$target.ptr;},function($v){this.$target.ptr=$v;},m))));}r=CR(n.typ,$clone(n,E).pointer(),q);if(r===0){$s=-1;return new E.ptr(DU.nil,0,0);}s=o.elem;t=new F((((n.flag|m.flag)>>>0))).ro();t=(t|(((s.Kind()>>>0))))>>>0;$s=-1;return DM(s,t,r);}return;}var $f={$blk:E.ptr.prototype.MapIndex,$c:true,$r,m,n,o,p,q,r,s,t,$s};return $f;};E.prototype.MapIndex=function(m){return this.$val.MapIndex(m);};E.ptr.prototype.Field=function(m){var{aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=[n];o=[o];p=[p];q=[q];r=this;if(!((new F(r.flag).kind()===25))){$panic(new I.ptr("reflect.Value.Field",new F(r.flag).kind()));}s=(r.typ.kindType);if(((m>>>0))>=((s.fields.$length>>>0))){$panic(new $String("reflect: Field index out of range"));}o[0]=$internalize(BI(r.typ).fields[m].prop,$String);u=(t=s.fields,((m<0||m>=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+m]));q[0]=u.typ;v=(((r.flag&416)>>>0)|((q[0].Kind()>>>0)))>>>0;if(!$clone(u.name,BO).isExported()){if(u.embedded()){v=(v|(64))>>>0;}else{v=(v|(32))>>>0;}}x=$clone((w=s.fields,((m<0||m>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+m])).name,BO).tag();if(!(x==="")&&!((m===0))){$s=1;continue;}$s=2;continue;case 1:n[0]=DK(x);if(!(n[0]==="")){$s=3;continue;}$s=4;continue;case 3:case 5:y=[y];z=$clone(r,E).Field(0);$s=7;case 7:if($c){$c=false;z=z.$blk();}if(z&&z.$blk!==undefined){break s;}E.copy(r,z);if(r.typ===DH){$s=8;continue;}$s=9;continue;case 8:y[0]=$clone(r,E).object().object;$s=-1;return new E.ptr(q[0],(new(BI(DL(q[0])))((function(n,o,p,q,y){return function(){return $internalize(y[0][$externalize(n[0],$String)],BI(q[0]));};})(n,o,p,q,y),(function(n,o,p,q,y){return function(aa){var aa;y[0][$externalize(n[0],$String)]=$externalize(aa,BI(q[0]));};})(n,o,p,q,y))),v);case 9:if(r.typ.Kind()===22){$s=10;continue;}$s=11;continue;case 10:aa=$clone(r,E).Elem();$s=12;case 12:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}E.copy(r,aa);case 11:$s=5;continue;case 6:case 4:case 2:p[0]=r.ptr;if(!((((v&128)>>>0)===0))&&!((q[0].Kind()===17))&&!((q[0].Kind()===25))){$s=13;continue;}$s=14;continue;case 13:$s=-1;return new E.ptr(q[0],(new(BI(DL(q[0])))((function(n,o,p,q){return function(){return DI(q[0],p[0][$externalize(o[0],$String)]);};})(n,o,p,q),(function(n,o,p,q){return function(ab){var ab;p[0][$externalize(o[0],$String)]=DJ(q[0],ab);};})(n,o,p,q))),v);case 14:ab=BZ(q[0],DI(q[0],p[0][$externalize(o[0],$String)]),v);$s=15;case 15:if($c){$c=false;ab=ab.$blk();}if(ab&&ab.$blk!==undefined){break s;}ac=ab;$s=16;case 16:return ac;}return;}var $f={$blk:E.ptr.prototype.Field,$c:true,$r,aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};E.prototype.Field=function(m){return this.$val.Field(m);};AT.ptr.prototype.Error=function(){var m;m=this;return m.s;};AT.prototype.Error=function(){return this.$val.Error();};AU=function(m){var m;if(m.length<2){return[m,$ifaceNil];}if((m.charCodeAt(0)===39)||(m.charCodeAt(0)===34)){if(m.charCodeAt((m.length-1>>0))===m.charCodeAt(0)){return[$substring(m,1,(m.length-1>>0)),$ifaceNil];}return["",$pkg.ErrSyntax];}return[m,$ifaceNil];};F.prototype.mustBe=function(m){var m,n;n=this.$val;if(!((((((n&31)>>>0)>>>0))===m))){$panic(new I.ptr(DF(),new F(n).kind()));}};$ptrType(F).prototype.mustBe=function(m){return new F(this.$get()).mustBe(m);};R.ptr.prototype.Comparable=function(){var{m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=this;n=m.Kind();if((n===(19))||(n===(23))||(n===(21))){$s=2;continue;}if(n===(17)){$s=3;continue;}if(n===(25)){$s=4;continue;}$s=5;continue;case 2:$s=-1;return false;case 3:o=m.Elem().Comparable();$s=6;case 6:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}p=o;$s=7;case 7:return p;case 4:q=0;case 8:if(!(q>0;$s=8;continue;case 9:case 5:case 1:$s=-1;return true;}return;}var $f={$blk:R.ptr.prototype.Comparable,$c:true,$r,m,n,o,p,q,r,s,$s};return $f;};R.prototype.Comparable=function(){return this.$val.Comparable();};R.ptr.prototype.IsVariadic=function(){var m,n;m=this;if(!((m.Kind()===19))){$panic(new $String("reflect: IsVariadic of non-func type"));}n=(m.kindType);return!((((n.outCount&32768)>>>0)===0));};R.prototype.IsVariadic=function(){return this.$val.IsVariadic();};R.ptr.prototype.Field=function(m){var m,n,o,p;n=this;if(!((n.Kind()===25))){$panic(new $String("reflect: Field of non-struct type"));}o=(n.kindType);if(m<0||m>=o.fields.$length){$panic(new $String("reflect: Field index out of bounds"));}return(p=o.fields,((m<0||m>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+m]));};R.prototype.Field=function(m){return this.$val.Field(m);};R.ptr.prototype.Key=function(){var m,n;m=this;if(!((m.Kind()===21))){$panic(new $String("reflect: Key of non-map type"));}n=(m.kindType);return AP(n.key);};R.prototype.Key=function(){return this.$val.Key();};R.ptr.prototype.NumField=function(){var m,n;m=this;if(!((m.Kind()===25))){$panic(new $String("reflect: NumField of non-struct type"));}n=(m.kindType);return n.fields.$length;};R.prototype.NumField=function(){return this.$val.NumField();};R.ptr.prototype.Method=function(m){var{aa,ab,ac,ad,ae,af,ag,ah,ai,aj,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=[n];o=new AV.ptr("","",$ifaceNil,new E.ptr(DU.nil,0,0),0);p=this;if(p.Kind()===20){$s=1;continue;}$s=2;continue;case 1:q=(p.kindType);r=q.rtype.Method(m);$s=3;case 3:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}AV.copy(o,r);s=o;$s=4;case 4:return s;case 2:t=p.exportedMethods();if(m<0||m>=t.$length){$panic(new $String("reflect: Method index out of range"));}u=$clone(((m<0||m>=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+m]),S);v=$clone(p.nameOff(u.name),BO);o.Name=$clone(v,BO).name();w=19;x=p.typeOff(u.mtyp);y=(x.kindType);z=$makeSlice(EI,0,(1+y.in$().$length>>0));z=$append(z,p);aa=y.in$();ab=0;while(true){if(!(ab=aa.$length)?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+ab]);z=$append(z,ac);ab++;}ad=$makeSlice(EI,0,y.out().$length);ae=y.out();af=0;while(true){if(!(af=ae.$length)?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+af]);ad=$append(ad,ag);af++;}ah=CF(z,ad,y.rtype.IsVariadic());$s=5;case 5:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}ai=ah;o.Type=ai;n[0]=$internalize($methodSet(p[$externalize(BE,$String)])[m].prop,$String);aj=D.MakeFunc((function(n){return function(aj,ak){var aj,ak,al;al=(0>=ak.$length?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+0]);return new $jsObjectPtr(al[$externalize(n[0],$String)].apply(al,$externalize($subslice(ak,1),EJ)));};})(n));E.copy(o.Func,new E.ptr($assertType(ai,DU),(aj),w));o.Index=m;AV.copy(o,o);$s=-1;return o;}return;}var $f={$blk:R.ptr.prototype.Method,$c:true,$r,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};R.prototype.Method=function(m){return this.$val.Method(m);};BA=function(m){var{m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=[n];o=[o];p=[p];q=CC(m);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=$clone(q,E);if(!(($clone(r,E).Kind()===23))){$panic(new I.ptr("Swapper",$clone(r,E).Kind()));}p[0]=(($clone(r,E).Len()>>>0));s=p[0];if(s===(0)){$s=-1;return(function(n,o,p){return function(t,u){var t,u;$panic(new $String("reflect: slice index out of range"));};})(n,o,p);}else if(s===(1)){$s=-1;return(function(n,o,p){return function(t,u){var t,u;if(!((t===0))||!((u===0))){$panic(new $String("reflect: slice index out of range"));}};})(n,o,p);}n[0]=m.$array;o[0]=$parseInt(m.$offset)>>0;$s=-1;return(function(n,o,p){return function(t,u){var t,u,v;if(((t>>>0))>=p[0]||((u>>>0))>=p[0]){$panic(new $String("reflect: slice index out of range"));}t=t+(o[0])>>0;u=u+(o[0])>>0;v=n[0][t];n[0][t]=n[0][u];n[0][u]=v;};})(n,o,p);}return;}var $f={$blk:BA,$c:true,$r,m,n,o,p,q,r,s,$s};return $f;};$pkg.Swapper=BA;BC=function(){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=(function(m){var m;});$r=m((n=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),new n.constructor.elem(n)));$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((o=new BL.ptr(0,0,0,0,ED.nil),new o.constructor.elem(o)));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((p=new S.ptr(0,0,0,0),new p.constructor.elem(p)));$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((q=new U.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil,DU.nil,0),new q.constructor.elem(q)));$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((r=new V.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil,0),new r.constructor.elem(r)));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((s=new BN.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),0,0,DW.nil,DW.nil),new s.constructor.elem(s)));$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((t=new X.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),new BO.ptr(EG.nil),EK.nil),new t.constructor.elem(t)));$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((u=new Y.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil,DU.nil,DU.nil,$throwNilPointerError,0,0,0,0),new u.constructor.elem(u)));$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((v=new Z.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil),new v.constructor.elem(v)));$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((w=new AA.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil),new w.constructor.elem(w)));$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((x=new AC.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),new BO.ptr(EG.nil),EL.nil),new x.constructor.elem(x)));$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((y=new W.ptr(0,0),new y.constructor.elem(y)));$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((z=new AB.ptr(new BO.ptr(EG.nil),DU.nil,0),new z.constructor.elem(z)));$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}BB=true;BD=$assertType(CB(new $Uint8(0)),DU);$s=-1;return;}return;}var $f={$blk:BC,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};BI=function(m){var m;return m[$externalize(BE,$String)];};BJ=function(m){var aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,m,n,o,p,q,r,s,t,u,v,w,x,y,z;if(m[$externalize(BF,$String)]===undefined){n=new R.ptr(((($parseInt(m.size)>>0)>>>0)),0,0,0,0,0,((($parseInt(m.kind)>>0)<<24>>>24)),$throwNilPointerError,EG.nil,BT($clone(BR(BW(m.string),"",!!(m.exported)),BO)),0);n[$externalize(BE,$String)]=m;m[$externalize(BF,$String)]=n;o=$methodSet(m);if(!(($parseInt(o.length)===0))||!!(m.named)){n.tflag=(n.tflag|(1))>>>0;if(!!(m.named)){n.tflag=(n.tflag|(4))>>>0;}p=ED.nil;q=0;while(true){if(!(q<$parseInt(o.length))){break;}r=o[q];s=BW(r.pkg)==="";if(!s){q=q+(1)>>0;continue;}p=$append(p,new S.ptr(BT($clone(BR(BW(r.name),"",s),BO)),BV(BJ(r.typ)),0,0));q=q+(1)>>0;}t=((p.$length<<16>>>16));u=0;while(true){if(!(u<$parseInt(o.length))){break;}v=o[u];w=BW(v.pkg)==="";if(w){u=u+(1)>>0;continue;}p=$append(p,new S.ptr(BT($clone(BR(BW(v.name),"",w),BO)),BV(BJ(v.typ)),0,0));u=u+(1)>>0;}x=new BL.ptr(BT($clone(BR(BW(m.pkg),"",false),BO)),(($parseInt(o.length)<<16>>>16)),t,0,p);y=n;(BM||$throwRuntimeError("assignment to entry in nil map"))[DU.keyFor(y)]={k:y,v:x};x[$externalize(BE,$String)]=m;}z=n.Kind();if(z===(17)){BK(n,new U.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem),DU.nil,((($parseInt(m.len)>>0)>>>0))));}else if(z===(18)){aa=3;if(!!(m.sendOnly)){aa=2;}if(!!(m.recvOnly)){aa=1;}BK(n,new V.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem),((aa>>>0))));}else if(z===(19)){ab=m.params;ac=$makeSlice(DW,$parseInt(ab.length));ad=ac;ae=0;while(true){if(!(ae=ac.$length)?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+af]=BJ(ab[af]));ae++;}ag=m.results;ah=$makeSlice(DW,$parseInt(ag.length));ai=ah;aj=0;while(true){if(!(aj=ah.$length)?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+ak]=BJ(ag[ak]));aj++;}al=(($parseInt(ag.length)<<16>>>16));if(!!(m.variadic)){al=(al|(32768))>>>0;}BK(n,new BN.ptr($clone(n,R),(($parseInt(ab.length)<<16>>>16)),al,ac,ah));}else if(z===(20)){am=m.methods;an=$makeSlice(EK,$parseInt(am.length));ao=an;ap=0;while(true){if(!(ap=an.$length)?($throwRuntimeError("index out of range"),undefined):an.$array[an.$offset+aq]),new W.ptr(BT($clone(BR(BW(ar.name),"",BW(ar.pkg)===""),BO)),BV(BJ(ar.typ))));ap++;}BK(n,new X.ptr($clone(n,R),$clone(BR(BW(m.pkg),"",false),BO),an));}else if(z===(21)){BK(n,new Y.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.key),BJ(m.elem),DU.nil,$throwNilPointerError,0,0,0,0));}else if(z===(22)){BK(n,new Z.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem)));}else if(z===(23)){BK(n,new AA.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem)));}else if(z===(25)){as=m.fields;at=$makeSlice(EL,$parseInt(as.length));au=at;av=0;while(true){if(!(av>>0))<<1>>>0;if(!!(ax.embedded)){ay=(ay|(1))>>>0;}AB.copy(((aw<0||aw>=at.$length)?($throwRuntimeError("index out of range"),undefined):at.$array[at.$offset+aw]),new AB.ptr($clone(BR(BW(ax.name),BW(ax.tag),!!(ax.exported)),BO),BJ(ax.typ),ay));av++;}BK(n,new AC.ptr($clone(n,R),$clone(BR(BW(m.pkgPath),"",false),BO),at));}}return((m[$externalize(BF,$String)]));};BK=function(m,n){var m,n;m[$externalize(BG,$String)]=n;n[$externalize(BH,$String)]=m;};BL.ptr.prototype.methods=function(){var m;m=this;return m._methods;};BL.prototype.methods=function(){return this.$val.methods();};BL.ptr.prototype.exportedMethods=function(){var m;m=this;return $subslice(m._methods,0,m.xcount,m.xcount);};BL.prototype.exportedMethods=function(){return this.$val.exportedMethods();};R.ptr.prototype.uncommon=function(){var m,n;m=this;return(n=BM[DU.keyFor(m)],n!==undefined?n.v:EC.nil);};R.prototype.uncommon=function(){return this.$val.uncommon();};BN.ptr.prototype.in$=function(){var m;m=this;return m._in;};BN.prototype.in$=function(){return this.$val.in$();};BN.ptr.prototype.out=function(){var m;m=this;return m._out;};BN.prototype.out=function(){return this.$val.out();};BO.ptr.prototype.name=function(){var m,n,o;m="";n=this;m=(o=BQ[EG.keyFor(n.bytes)],o!==undefined?o.v:EM.nil).name;return m;};BO.prototype.name=function(){return this.$val.name();};BO.ptr.prototype.tag=function(){var m,n,o;m="";n=this;m=(o=BQ[EG.keyFor(n.bytes)],o!==undefined?o.v:EM.nil).tag;return m;};BO.prototype.tag=function(){return this.$val.tag();};BO.ptr.prototype.pkgPath=function(){var m;m=this;return"";};BO.prototype.pkgPath=function(){return this.$val.pkgPath();};BO.ptr.prototype.isExported=function(){var m,n;m=this;return(n=BQ[EG.keyFor(m.bytes)],n!==undefined?n.v:EM.nil).exported;};BO.prototype.isExported=function(){return this.$val.isExported();};BR=function(m,n,o){var m,n,o,p,q;p=$newDataPointer(0,EG);q=p;(BQ||$throwRuntimeError("assignment to entry in nil map"))[EG.keyFor(q)]={k:q,v:new BP.ptr(m,n,o)};return new BO.ptr(p);};R.ptr.prototype.nameOff=function(m){var m,n,o;n=this;return(o=((m>>0)),((o<0||o>=BS.$length)?($throwRuntimeError("index out of range"),undefined):BS.$array[BS.$offset+o]));};R.prototype.nameOff=function(m){return this.$val.nameOff(m);};BT=function(m){var m,n;n=BS.$length;BS=$append(BS,m);return((n>>0));};R.ptr.prototype.typeOff=function(m){var m,n,o;n=this;return(o=((m>>0)),((o<0||o>=BU.$length)?($throwRuntimeError("index out of range"),undefined):BU.$array[BU.$offset+o]));};R.prototype.typeOff=function(m){return this.$val.typeOff(m);};BV=function(m){var m,n;n=BU.$length;BU=$append(BU,m);return((n>>0));};BW=function(m){var m,n;n=new EN.ptr("");n.str=m;return n.str;};BX=function(m){var m;return!!(BI(m).wrapped);};BY=function(m,n,o){var m,n,o,p,q,r;p=BI(o).fields;q=0;while(true){if(!(q<$parseInt(p.length))){break;}r=$internalize(p[q].prop,$String);m[$externalize(r,$String)]=n[$externalize(r,$String)];q=q+(1)>>0;}};BZ=function(m,n,o){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:p=m.common();$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;t=m.Kind();$s=6;case 6:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}if(t===17){s=true;$s=5;continue s;}u=m.Kind();$s=7;case 7:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}s=u===25;case 5:if(s){r=true;$s=4;continue s;}v=m.Kind();$s=8;case 8:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}r=v===22;case 4:if(r){$s=2;continue;}$s=3;continue;case 2:w=m.Kind();$s=9;case 9:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=new E.ptr(q,(n),(o|((w>>>0)))>>>0);$s=10;case 10:return x;case 3:y=m.Kind();$s=11;case 11:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=new E.ptr(q,($newDataPointer(n,BI(q.ptrTo()))),(((o|((y>>>0)))>>>0)|128)>>>0);$s=12;case 12:return z;}return;}var $f={$blk:BZ,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};CB=function(m){var m;if(!BB){return new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);}if($interfaceIsEqual(m,$ifaceNil)){return $ifaceNil;}return BJ(m.constructor);};$pkg.TypeOf=CB;CC=function(m){var{m,n,o,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:if($interfaceIsEqual(m,$ifaceNil)){$s=-1;return new E.ptr(DU.nil,0,0);}n=BZ(BJ(m.constructor),m.$val,0);$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;$s=2;case 2:return o;}return;}var $f={$blk:CC,$c:true,$r,m,n,o,$s};return $f;};$pkg.ValueOf=CC;CF=function(m,n,o){var{aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:if(!(o)){p=false;$s=3;continue s;}if(m.$length===0){q=true;$s=4;continue s;}s=(r=m.$length-1>>0,((r<0||r>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+r])).Kind();$s=5;case 5:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}q=!((s===23));case 4:p=q;case 3:if(p){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.FuncOf: last arg of variadic func must be slice"));case 2:t=$makeSlice(EJ,m.$length);u=m;v=0;while(true){if(!(v=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+v]);((w<0||w>=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+w]=BI(x));v++;}y=$makeSlice(EJ,n.$length);z=n;aa=0;while(true){if(!(aa=z.$length)?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+aa]);((ab<0||ab>=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+ab]=BI(ac));aa++;}$s=-1;return BJ($funcType($externalize(t,EJ),$externalize(y,EJ),$externalize(o,$Bool)));}return;}var $f={$blk:CF,$c:true,$r,aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.FuncOf=CF;R.ptr.prototype.ptrTo=function(){var m;m=this;return BJ($ptrType(BI(m)));};R.prototype.ptrTo=function(){return this.$val.ptrTo();};CH=function(m){var m;return BJ($sliceType(BI(m)));};$pkg.SliceOf=CH;CJ=function(m){var m,n;n=m.Kind();if(n===(25)){return(new(BI(m).ptr)());}else if(n===(17)){return(BI(m).zero());}else{return($newDataPointer(BI(m).zero(),BI(m.ptrTo())));}};CM=function(m,n,o){var m,n,o;n.$set(o.$get());};CQ=function(m,n){var m,n,o,p;o=n;if(!(o.$get===undefined)){o=o.$get();}p=$internalize(BI(m.Key()).keyFor(o),$String);return[o,p];};CR=function(m,n,o){var m,n,o,p,q,r;p=CQ(m,o);q=p[1];r=n[$externalize(q,$String)];if(r===undefined){return 0;}return($newDataPointer(r.v,BI(DL(m.Elem()))));};CU.ptr.prototype.skipUntilValidKey=function(){var m,n;m=this;while(true){if(!(m.i<$parseInt(m.keys.length))){break;}n=m.keys[m.i];if(!(m.m[$externalize($internalize(n,$String),$String)]===undefined)){break;}m.i=m.i+(1)>>0;}};CU.prototype.skipUntilValidKey=function(){return this.$val.skipUntilValidKey();};CV=function(m,n){var m,n;return(new CU.ptr(m,n,$keys(n),0,null));};CX=function(m){var{m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=($pointerOfStructConversion(m,EO));o=null;if(!(n.last===null)){o=n.last;}else{n.skipUntilValidKey();if(n.i===$parseInt(n.keys.length)){$s=-1;return 0;}p=n.keys[n.i];o=n.m[$externalize($internalize(p,$String),$String)];n.last=o;}q=$assertType(n.t,CW).Key();$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=DL(q);$s=2;case 2:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=BI(r);$s=3;case 3:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=($newDataPointer(o.k,s));$s=4;case 4:return t;}return;}var $f={$blk:CX,$c:true,$r,m,n,o,p,q,r,s,t,$s};return $f;};CY=function(m){var m,n;n=($pointerOfStructConversion(m,EO));n.last=null;n.i=n.i+(1)>>0;};CZ=function(m){var m;return $parseInt($keys(m).length);};DC=function(m,n,o){var m,n,o,p,q,r,s,t,u,v,w,x,y;p=DU.nil;q=EE.nil;r=0;s="";if(n.typ.Kind()===20){t=(n.typ.kindType);if(o<0||o>=t.methods.$length){$panic(new $String("reflect: internal error: invalid method index"));}v=(u=t.methods,((o<0||o>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+o]));if(!$clone(t.rtype.nameOff(v.name),BO).isExported()){$panic(new $String("reflect: "+m+" of unexported method"));}q=(t.rtype.typeOff(v.typ).kindType);s=$clone(t.rtype.nameOff(v.name),BO).name();}else{w=n.typ.exportedMethods();if(((o>>>0))>=((w.$length>>>0))){$panic(new $String("reflect: internal error: invalid method index"));}x=$clone(((o<0||o>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+o]),S);if(!$clone(n.typ.nameOff(x.name),BO).isExported()){$panic(new $String("reflect: "+m+" of unexported method"));}q=(n.typ.typeOff(x.mtyp).kindType);s=$internalize($methodSet(BI(n.typ))[o].prop,$String);}y=$clone(n,E).object();if(BX(n.typ)){y=new(BI(n.typ))(y);}r=(y[$externalize(s,$String)]);return[p,q,r];};DD=function(m){var{m,n,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:if(m.flag===0){$panic(new I.ptr("reflect.Value.Interface",0));}if(!((((m.flag&512)>>>0)===0))){$s=1;continue;}$s=2;continue;case 1:n=DG("Interface",$clone(m,E));$s=3;case 3:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}E.copy(m,n);case 2:if(BX(m.typ)){$s=-1;return((new(BI(m.typ))($clone(m,E).object())));}$s=-1;return(($clone(m,E).object()));}return;}var $f={$blk:DD,$c:true,$r,m,n,$s};return $f;};DE=function(m,n,o){var m,n,o;o.$set(n);};DF=function(){return"?FIXME?";};DG=function(m,n){var{m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{m,n});$s=$s||0;s:while(true){switch($s){case 0:o=[o];p=[p];if(((n.flag&512)>>>0)===0){$panic(new $String("reflect: internal error: invalid use of makePartialFunc"));}q=DC(m,$clone(n,E),((n.flag>>0))>>10>>0);o[0]=q[2];p[0]=$clone(n,E).object();if(BX(n.typ)){p[0]=new(BI(n.typ))(p[0]);}r=D.MakeFunc((function(o,p){return function(r,s){var r,s;return new $jsObjectPtr(o[0].apply(p[0],$externalize(s,EJ)));};})(o,p));s=$clone(n,E).Type().common();$s=1;case 1:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=new E.ptr(s,(r),(new F(n.flag).ro()|19)>>>0);$s=2;case 2:return t;}return;}var $f={$blk:DG,$c:true,$r,m,n,o,p,q,r,s,t,$s};return $f;};DI=function(m,n){var m,n;if($interfaceIsEqual(m,DH)){return new(BI(DH))(n);}return n;};DJ=function(m,n){var m,n;if($interfaceIsEqual(m,DH)){return n.object;}return n;};DK=function(m){var m,n,o,p,q,r;while(true){if(!(!(m===""))){break;}n=0;while(true){if(!(n>0;}m=$substring(m,n);if(m===""){break;}n=0;while(true){if(!(n>0;}if((n+1>>0)>=m.length||!((m.charCodeAt(n)===58))||!((m.charCodeAt((n+1>>0))===34))){break;}o=($substring(m,0,n));m=$substring(m,(n+1>>0));n=1;while(true){if(!(n>0;}n=n+(1)>>0;}if(n>=m.length){break;}p=($substring(m,0,(n+1>>0)));m=$substring(m,(n+1>>0));if(o==="js"){q=AU(p);r=q[0];return r;}}return"";};DL=function(m){var m;return $assertType(m,DU).ptrTo();};$pkg.PtrTo=DL;DM=function(m,n,o){var m,n,o,p;if(AQ(m)){p=CJ(m);CM(m,p,o);return new E.ptr(m,p,(n|128)>>>0);}return new E.ptr(m,(o).$get(),n);};E.methods=[{prop:"pointer",name:"pointer",pkg:"internal/reflectlite",typ:$funcType([],[$UnsafePointer],false)},{prop:"CanSet",name:"CanSet",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"IsValid",name:"IsValid",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"numMethod",name:"numMethod",pkg:"internal/reflectlite",typ:$funcType([],[$Int],false)},{prop:"Type",name:"Type",pkg:"",typ:$funcType([],[O],false)},{prop:"object",name:"object",pkg:"internal/reflectlite",typ:$funcType([],[DZ],false)},{prop:"assignTo",name:"assignTo",pkg:"internal/reflectlite",typ:$funcType([$String,DU,$UnsafePointer],[E],false)},{prop:"call",name:"call",pkg:"internal/reflectlite",typ:$funcType([$String,EF],[EF],false)},{prop:"Cap",name:"Cap",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Index",name:"Index",pkg:"",typ:$funcType([$Int],[E],false)},{prop:"InterfaceData",name:"InterfaceData",pkg:"",typ:$funcType([],[ES],false)},{prop:"IsNil",name:"IsNil",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Pointer",name:"Pointer",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([E],[],false)},{prop:"SetBytes",name:"SetBytes",pkg:"",typ:$funcType([ET],[],false)},{prop:"SetCap",name:"SetCap",pkg:"",typ:$funcType([$Int],[],false)},{prop:"SetLen",name:"SetLen",pkg:"",typ:$funcType([$Int],[],false)},{prop:"Slice",name:"Slice",pkg:"",typ:$funcType([$Int,$Int],[E],false)},{prop:"Slice3",name:"Slice3",pkg:"",typ:$funcType([$Int,$Int,$Int],[E],false)},{prop:"Close",name:"Close",pkg:"",typ:$funcType([],[],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[E],false)},{prop:"NumField",name:"NumField",pkg:"",typ:$funcType([],[$Int],false)},{prop:"MapKeys",name:"MapKeys",pkg:"",typ:$funcType([],[EF],false)},{prop:"MapIndex",name:"MapIndex",pkg:"",typ:$funcType([E],[E],false)},{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[E],false)}];F.methods=[{prop:"kind",name:"kind",pkg:"internal/reflectlite",typ:$funcType([],[P],false)},{prop:"ro",name:"ro",pkg:"internal/reflectlite",typ:$funcType([],[F],false)},{prop:"mustBeExported",name:"mustBeExported",pkg:"internal/reflectlite",typ:$funcType([],[],false)},{prop:"mustBeAssignable",name:"mustBeAssignable",pkg:"internal/reflectlite",typ:$funcType([],[],false)},{prop:"mustBe",name:"mustBe",pkg:"internal/reflectlite",typ:$funcType([P],[],false)}];EU.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];P.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];DU.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"pointers",name:"pointers",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)},{prop:"common",name:"common",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"exportedMethods",name:"exportedMethods",pkg:"internal/reflectlite",typ:$funcType([],[ED],false)},{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"hasName",name:"hasName",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"chanDir",name:"chanDir",pkg:"internal/reflectlite",typ:$funcType([],[T],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[O],false)},{prop:"In",name:"In",pkg:"",typ:$funcType([$Int],[O],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumIn",name:"NumIn",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumOut",name:"NumOut",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Out",name:"Out",pkg:"",typ:$funcType([$Int],[O],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"IsVariadic",name:"IsVariadic",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"kindType",name:"kindType",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[AB],false)},{prop:"Key",name:"Key",pkg:"",typ:$funcType([],[O],false)},{prop:"NumField",name:"NumField",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Method",name:"Method",pkg:"",typ:$funcType([$Int],[AV],false)},{prop:"uncommon",name:"uncommon",pkg:"internal/reflectlite",typ:$funcType([],[EC],false)},{prop:"nameOff",name:"nameOff",pkg:"internal/reflectlite",typ:$funcType([AG],[BO],false)},{prop:"typeOff",name:"typeOff",pkg:"internal/reflectlite",typ:$funcType([AH],[DU],false)},{prop:"ptrTo",name:"ptrTo",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)}];EW.methods=[{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)}];EY.methods=[{prop:"offset",name:"offset",pkg:"internal/reflectlite",typ:$funcType([],[$Uintptr],false)},{prop:"embedded",name:"embedded",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)}];EZ.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];EC.methods=[{prop:"methods",name:"methods",pkg:"internal/reflectlite",typ:$funcType([],[ED],false)},{prop:"exportedMethods",name:"exportedMethods",pkg:"internal/reflectlite",typ:$funcType([],[ED],false)}];EE.methods=[{prop:"in$",name:"in",pkg:"internal/reflectlite",typ:$funcType([],[DW],false)},{prop:"out",name:"out",pkg:"internal/reflectlite",typ:$funcType([],[DW],false)}];BO.methods=[{prop:"data",name:"data",pkg:"internal/reflectlite",typ:$funcType([$Int,$String],[EG],false)},{prop:"hasTag",name:"hasTag",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)},{prop:"readVarint",name:"readVarint",pkg:"internal/reflectlite",typ:$funcType([$Int],[$Int,$Int],false)},{prop:"name",name:"name",pkg:"internal/reflectlite",typ:$funcType([],[$String],false)},{prop:"tag",name:"tag",pkg:"internal/reflectlite",typ:$funcType([],[$String],false)},{prop:"pkgPath",name:"pkgPath",pkg:"internal/reflectlite",typ:$funcType([],[$String],false)},{prop:"isExported",name:"isExported",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)}];EO.methods=[{prop:"skipUntilValidKey",name:"skipUntilValidKey",pkg:"internal/reflectlite",typ:$funcType([],[],false)}];E.init("internal/reflectlite",[{prop:"typ",name:"typ",embedded:false,exported:false,typ:DU,tag:""},{prop:"ptr",name:"ptr",embedded:false,exported:false,typ:$UnsafePointer,tag:""},{prop:"flag",name:"flag",embedded:true,exported:false,typ:F,tag:""}]);I.init("",[{prop:"Method",name:"Method",embedded:false,exported:true,typ:$String,tag:""},{prop:"Kind",name:"Kind",embedded:false,exported:true,typ:P,tag:""}]);O.init([{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[O],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"common",name:"common",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"uncommon",name:"uncommon",pkg:"internal/reflectlite",typ:$funcType([],[EC],false)}]);R.init("internal/reflectlite",[{prop:"size",name:"size",embedded:false,exported:false,typ:$Uintptr,tag:""},{prop:"ptrdata",name:"ptrdata",embedded:false,exported:false,typ:$Uintptr,tag:""},{prop:"hash",name:"hash",embedded:false,exported:false,typ:$Uint32,tag:""},{prop:"tflag",name:"tflag",embedded:false,exported:false,typ:Q,tag:""},{prop:"align",name:"align",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"fieldAlign",name:"fieldAlign",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"kind",name:"kind",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"equal",name:"equal",embedded:false,exported:false,typ:EV,tag:""},{prop:"gcdata",name:"gcdata",embedded:false,exported:false,typ:EG,tag:""},{prop:"str",name:"str",embedded:false,exported:false,typ:AG,tag:""},{prop:"ptrToThis",name:"ptrToThis",embedded:false,exported:false,typ:AH,tag:""}]);S.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:AG,tag:""},{prop:"mtyp",name:"mtyp",embedded:false,exported:false,typ:AH,tag:""},{prop:"ifn",name:"ifn",embedded:false,exported:false,typ:AI,tag:""},{prop:"tfn",name:"tfn",embedded:false,exported:false,typ:AI,tag:""}]);U.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""},{prop:"slice",name:"slice",embedded:false,exported:false,typ:DU,tag:""},{prop:"len",name:"len",embedded:false,exported:false,typ:$Uintptr,tag:""}]);V.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""},{prop:"dir",name:"dir",embedded:false,exported:false,typ:$Uintptr,tag:""}]);W.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:AG,tag:""},{prop:"typ",name:"typ",embedded:false,exported:false,typ:AH,tag:""}]);X.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"pkgPath",name:"pkgPath",embedded:false,exported:false,typ:BO,tag:""},{prop:"methods",name:"methods",embedded:false,exported:false,typ:EK,tag:""}]);Y.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"key",name:"key",embedded:false,exported:false,typ:DU,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""},{prop:"bucket",name:"bucket",embedded:false,exported:false,typ:DU,tag:""},{prop:"hasher",name:"hasher",embedded:false,exported:false,typ:EX,tag:""},{prop:"keysize",name:"keysize",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"valuesize",name:"valuesize",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"bucketsize",name:"bucketsize",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"flags",name:"flags",embedded:false,exported:false,typ:$Uint32,tag:""}]);Z.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""}]);AA.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""}]);AB.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:BO,tag:""},{prop:"typ",name:"typ",embedded:false,exported:false,typ:DU,tag:""},{prop:"offsetEmbed",name:"offsetEmbed",embedded:false,exported:false,typ:$Uintptr,tag:""}]);AC.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"pkgPath",name:"pkgPath",embedded:false,exported:false,typ:BO,tag:""},{prop:"fields",name:"fields",embedded:false,exported:false,typ:EL,tag:""}]);AT.init("internal/reflectlite",[{prop:"s",name:"s",embedded:false,exported:false,typ:$String,tag:""}]);AV.init("",[{prop:"Name",name:"Name",embedded:false,exported:true,typ:$String,tag:""},{prop:"PkgPath",name:"PkgPath",embedded:false,exported:true,typ:$String,tag:""},{prop:"Type",name:"Type",embedded:false,exported:true,typ:O,tag:""},{prop:"Func",name:"Func",embedded:false,exported:true,typ:E,tag:""},{prop:"Index",name:"Index",embedded:false,exported:true,typ:$Int,tag:""}]);BL.init("internal/reflectlite",[{prop:"pkgPath",name:"pkgPath",embedded:false,exported:false,typ:AG,tag:""},{prop:"mcount",name:"mcount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"xcount",name:"xcount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"moff",name:"moff",embedded:false,exported:false,typ:$Uint32,tag:""},{prop:"_methods",name:"_methods",embedded:false,exported:false,typ:ED,tag:""}]);BN.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:"reflect:\"func\""},{prop:"inCount",name:"inCount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"outCount",name:"outCount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"_in",name:"_in",embedded:false,exported:false,typ:DW,tag:""},{prop:"_out",name:"_out",embedded:false,exported:false,typ:DW,tag:""}]);BO.init("internal/reflectlite",[{prop:"bytes",name:"bytes",embedded:false,exported:false,typ:EG,tag:""}]);BP.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:$String,tag:""},{prop:"tag",name:"tag",embedded:false,exported:false,typ:$String,tag:""},{prop:"exported",name:"exported",embedded:false,exported:false,typ:$Bool,tag:""}]);CU.init("internal/reflectlite",[{prop:"t",name:"t",embedded:false,exported:false,typ:O,tag:""},{prop:"m",name:"m",embedded:false,exported:false,typ:DZ,tag:""},{prop:"keys",name:"keys",embedded:false,exported:false,typ:DZ,tag:""},{prop:"i",name:"i",embedded:false,exported:false,typ:$Int,tag:""},{prop:"last",name:"last",embedded:false,exported:false,typ:DZ,tag:""}]);CW.init([{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[O],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Key",name:"Key",pkg:"",typ:$funcType([],[O],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"common",name:"common",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"uncommon",name:"uncommon",pkg:"internal/reflectlite",typ:$funcType([],[EC],false)}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=D.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}BD=DU.nil;BS=DV.nil;BU=DW.nil;AD=new DX(["invalid","bool","int","int8","int16","int32","int64","uint","uint8","uint16","uint32","uint64","uintptr","float32","float64","complex64","complex128","array","chan","func","interface","map","ptr","slice","string","struct","unsafe.Pointer"]);AR=$assertType($internalize($call,$emptyInterface),EA);$pkg.ErrSyntax=new AT.ptr("invalid syntax");BB=false;BE="_jsType";BF="_reflectType";BG="kindType";BH="_rtype";BM={};BQ={};DH=BJ($jsObjectPtr);DN=$assertType($internalize($select,$emptyInterface),EA);$r=BC();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["sort"]=(function(){var $pkg={},$init,A,V,AZ,BA,AN,AO,B,C,D,E,G,H,U,AP;A=$packages["internal/reflectlite"];V=$pkg.lessSwap=$newType(0,$kindStruct,"sort.lessSwap",true,"sort",false,function(Less_,Swap_){this.$val=this;if(arguments.length===0){this.Less=$throwNilPointerError;this.Swap=$throwNilPointerError;return;}this.Less=Less_;this.Swap=Swap_;});AZ=$funcType([$Int,$Int],[$Bool],false);BA=$funcType([$Int,$Int],[],false);B=function(a,b,c){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=b+1>>0;case 1:if(!(db)){f=false;$s=5;continue s;}g=a.Less(e,e-1>>0);$s=6;case 6:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}f=g;case 5:if(!(f)){$s=4;continue;}$r=a.Swap(e,e-1>>0);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}e=e-(1)>>0;$s=3;continue;case 4:d=d+(1)>>0;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:B,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};C=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:e=b;case 1:f=($imul(2,e))+1>>0;if(f>=c){$s=2;continue;}if(!((f+1>>0)>0,(d+f>>0)+1>>0);$s=6;case 6:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}g=h;case 5:if(g){$s=3;continue;}$s=4;continue;case 3:f=f+(1)>>0;case 4:i=a.Less(d+e>>0,d+f>>0);$s=9;case 9:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}if(!i){$s=7;continue;}$s=8;continue;case 7:$s=-1;return;case 8:$r=a.Swap(d+e>>0,d+f>>0);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}e=f;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:C,$c:true,$r,a,b,c,d,e,f,g,h,i,$s};return $f;};D=function(a,b,c){var{a,b,c,d,e,f,g,h,i,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=b;e=0;f=c-b>>0;h=(g=((f-1>>0))/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"));case 1:if(!(h>=0)){$s=2;continue;}$r=C($clone(a,V),h,f,d);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}h=h-(1)>>0;$s=1;continue;case 2:i=f-1>>0;case 4:if(!(i>=0)){$s=5;continue;}$r=a.Swap(d,d+i>>0);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C($clone(a,V),e,i,d);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}i=i-(1)>>0;$s=4;continue;case 5:$s=-1;return;}return;}var $f={$blk:D,$c:true,$r,a,b,c,d,e,f,g,h,i,$s};return $f;};E=function(a,b,c,d){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:e=a.Less(b,c);$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}if(e){$s=1;continue;}$s=2;continue;case 1:$r=a.Swap(b,c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:f=a.Less(d,b);$s=7;case 7:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}if(f){$s=5;continue;}$s=6;continue;case 5:$r=a.Swap(d,b);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g=a.Less(b,c);$s=11;case 11:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}if(g){$s=9;continue;}$s=10;continue;case 9:$r=a.Swap(b,c);$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 10:case 6:$s=-1;return;}return;}var $f={$blk:E,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};G=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=0;e=0;f=((((((b+c>>0)>>>0))>>>1>>>0)>>0));if((c-b>>0)>40){$s=1;continue;}$s=2;continue;case 1:h=(g=((c-b>>0))/8,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"));$r=E($clone(a,V),b,b+h>>0,b+($imul(2,h))>>0);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E($clone(a,V),f,f-h>>0,f+h>>0);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E($clone(a,V),c-1>>0,(c-1>>0)-h>>0,(c-1>>0)-($imul(2,h))>>0);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$r=E($clone(a,V),b,f,c-1>>0);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}i=b;j=b+1>>0;k=c-1>>0;l=j;m=k;case 7:if(!(l>0;$s=7;continue;case 8:p=l;case 11:case 13:if(!(p>0;$s=13;continue;case 14:case 17:if(!(p>0);$s=20;case 20:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}s=t;case 19:if(!(s)){$s=18;continue;}m=m-(1)>>0;$s=17;continue;case 18:if(p>=m){$s=12;continue;}$r=a.Swap(p,m-1>>0);$s=21;case 21:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}p=p+(1)>>0;m=m-(1)>>0;$s=11;continue;case 12:u=(c-m>>0)<5;if(!u&&(c-m>>0)<(v=((c-b>>0))/4,(v===v&&v!==1/0&&v!==-1/0)?v>>0:$throwRuntimeError("integer divide by zero"))){$s=22;continue;}$s=23;continue;case 22:w=0;x=a.Less(i,c-1>>0);$s=26;case 26:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}if(!x){$s=24;continue;}$s=25;continue;case 24:$r=a.Swap(m,c-1>>0);$s=27;case 27:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}m=m+(1)>>0;w=w+(1)>>0;case 25:y=a.Less(p-1>>0,i);$s=30;case 30:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}if(!y){$s=28;continue;}$s=29;continue;case 28:p=p-(1)>>0;w=w+(1)>>0;case 29:z=a.Less(f,i);$s=33;case 33:if($c){$c=false;z=z.$blk();}if(z&&z.$blk!==undefined){break s;}if(!z){$s=31;continue;}$s=32;continue;case 31:$r=a.Swap(f,p-1>>0);$s=34;case 34:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}p=p-(1)>>0;w=w+(1)>>0;case 32:u=w>1;case 23:if(u){$s=35;continue;}$s=36;continue;case 35:case 37:case 39:if(!(l>0,i);$s=42;case 42:if($c){$c=false;ab=ab.$blk();}if(ab&&ab.$blk!==undefined){break s;}aa=!ab;case 41:if(!(aa)){$s=40;continue;}p=p-(1)>>0;$s=39;continue;case 40:case 43:if(!(l>0;$s=43;continue;case 44:if(l>=p){$s=38;continue;}$r=a.Swap(l,p-1>>0);$s=47;case 47:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}l=l+(1)>>0;p=p-(1)>>0;$s=37;continue;case 38:case 36:$r=a.Swap(i,p-1>>0);$s=48;case 48:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}ae=p-1>>0;af=m;d=ae;e=af;$s=-1;return[d,e];}return;}var $f={$blk:G,$c:true,$r,a,aa,ab,ac,ad,ae,af,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};H=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:case 1:if(!((c-b>>0)>12)){$s=2;continue;}if(d===0){$s=3;continue;}$s=4;continue;case 3:$r=D($clone(a,V),b,c);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;case 4:d=d-(1)>>0;f=G($clone(a,V),b,c);$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}e=f;g=e[0];h=e[1];if((g-b>>0)<(c-h>>0)){$s=7;continue;}$s=8;continue;case 7:$r=H($clone(a,V),b,g,d);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}b=h;$s=9;continue;case 8:$r=H($clone(a,V),h,c,d);$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}c=g;case 9:$s=1;continue;case 2:if((c-b>>0)>1){$s=12;continue;}$s=13;continue;case 12:i=b+6>>0;case 14:if(!(i>0);$s=18;case 18:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}if(j){$s=16;continue;}$s=17;continue;case 16:$r=a.Swap(i,i-6>>0);$s=19;case 19:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 17:i=i+(1)>>0;$s=14;continue;case 15:$r=B($clone(a,V),b,c);$s=20;case 20:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 13:$s=-1;return;}return;}var $f={$blk:H,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};U=function(a){var a,b,c;b=0;c=a;while(true){if(!(c>0)){break;}b=b+(1)>>0;c=(c>>$min((1),31))>>0;}return $imul(b,2);};AP=function(a,b){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=AN(a);$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=$clone(c,A.Value);e=AO(a);$s=2;case 2:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;g=$clone(d,A.Value).Len();$r=H(new V.ptr(b,f),0,g,U(g));$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;}return;}var $f={$blk:AP,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};$pkg.Slice=AP;V.init("",[{prop:"Less",name:"Less",embedded:false,exported:true,typ:AZ,tag:""},{prop:"Swap",name:"Swap",embedded:false,exported:true,typ:BA,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}AN=A.ValueOf;AO=A.Swapper;}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["resolv"]=(function(){var $pkg={},$init,A,B,C,D,O,Q,R,T,V,Y,AA,AB,AF,AH,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,AZ,L,P,S,U,W,X,Z,AC,AD,AE,AG,AI;A=$packages["math"];B=$packages["sort"];C=$pkg.Vector=$newType(12,$kindSlice,"resolv.Vector",true,"resolv",true,null);D=$pkg.Axis=$newType(4,$kindInt,"resolv.Axis",true,"resolv",true,null);O=$pkg.Space=$newType(0,$kindStruct,"resolv.Space",true,"resolv",true,function(Cells_,CellWidth_,CellHeight_){this.$val=this;if(arguments.length===0){this.Cells=AM.nil;this.CellWidth=0;this.CellHeight=0;return;}this.Cells=Cells_;this.CellWidth=CellWidth_;this.CellHeight=CellHeight_;});Q=$pkg.Shape=$newType(8,$kindInterface,"resolv.Shape",true,"resolv",true,null);R=$pkg.Line=$newType(0,$kindStruct,"resolv.Line",true,"resolv",true,function(Start_,End_){this.$val=this;if(arguments.length===0){this.Start=C.nil;this.End=C.nil;return;}this.Start=Start_;this.End=End_;});T=$pkg.ConvexPolygon=$newType(0,$kindStruct,"resolv.ConvexPolygon",true,"resolv",true,function(Points_,X_,Y_,Closed_){this.$val=this;if(arguments.length===0){this.Points=AQ.nil;this.X=0;this.Y=0;this.Closed=false;return;}this.Points=Points_;this.X=X_;this.Y=Y_;this.Closed=Closed_;});V=$pkg.ContactSet=$newType(0,$kindStruct,"resolv.ContactSet",true,"resolv",true,function(Points_,MTV_,Center_){this.$val=this;if(arguments.length===0){this.Points=AQ.nil;this.MTV=C.nil;this.Center=C.nil;return;}this.Points=Points_;this.MTV=MTV_;this.Center=Center_;});Y=$pkg.Circle=$newType(0,$kindStruct,"resolv.Circle",true,"resolv",true,function(X_,Y_,Radius_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Radius=0;return;}this.X=X_;this.Y=Y_;this.Radius=Radius_;});AA=$pkg.Projection=$newType(0,$kindStruct,"resolv.Projection",true,"resolv",true,function(Min_,Max_){this.$val=this;if(arguments.length===0){this.Min=0;this.Max=0;return;}this.Min=Min_;this.Max=Max_;});AB=$pkg.Object=$newType(0,$kindStruct,"resolv.Object",true,"resolv",true,function(Shape_,Space_,X_,Y_,W_,H_,TouchingCells_,Data_,ignoreList_,tags_){this.$val=this;if(arguments.length===0){this.Shape=$ifaceNil;this.Space=AN.nil;this.X=0;this.Y=0;this.W=0;this.H=0;this.TouchingCells=AL.nil;this.Data=$ifaceNil;this.ignoreList=false;this.tags=AW.nil;return;}this.Shape=Shape_;this.Space=Space_;this.X=X_;this.Y=Y_;this.W=W_;this.H=H_;this.TouchingCells=TouchingCells_;this.Data=Data_;this.ignoreList=ignoreList_;this.tags=tags_;});AF=$pkg.Collision=$newType(0,$kindStruct,"resolv.Collision",true,"resolv",true,function(checkingObject_,dx_,dy_,Objects_,Cells_){this.$val=this;if(arguments.length===0){this.checkingObject=AO.nil;this.dx=0;this.dy=0;this.Objects=AP.nil;this.Cells=AL.nil;return;}this.checkingObject=checkingObject_;this.dx=dx_;this.dy=dy_;this.Objects=Objects_;this.Cells=Cells_;});AH=$pkg.Cell=$newType(0,$kindStruct,"resolv.Cell",true,"resolv",true,function(X_,Y_,Objects_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Objects=AP.nil;return;}this.X=X_;this.Y=Y_;this.Objects=Objects_;});AJ=$sliceType($Float64);AK=$ptrType(AH);AL=$sliceType(AK);AM=$sliceType(AL);AN=$ptrType(O);AO=$ptrType(AB);AP=$sliceType(AO);AQ=$sliceType(C);AR=$ptrType(R);AS=$sliceType(AR);AT=$ptrType(Y);AU=$ptrType(T);AV=$ptrType(V);AW=$sliceType($String);AX=$ptrType(AF);AY=$sliceType(D);AZ=$mapType(AO,$Bool);C.prototype.Clone=function(){var a,b;a=this;b=$makeSlice(C,a.$length);$copySlice(b,a);return b;};$ptrType(C).prototype.Clone=function(){return this.$get().Clone();};C.prototype.Add=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AD($convertSliceType(b,AJ),1,$convertSliceType(b,AJ),$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AJ));}else{AD($convertSliceType(b,AJ),1,$convertSliceType(b,AJ),$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AJ));}e++;}return b;};$ptrType(C).prototype.Add=function(a){return this.$get().Add(a);};C.prototype.Sub=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AD($convertSliceType(b,AJ),-1,$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AJ),$convertSliceType(b,AJ));}else{AD($convertSliceType(b,AJ),-1,$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AJ),$convertSliceType(b,AJ));}e++;}return b;};$ptrType(C).prototype.Sub=function(a){return this.$get().Sub(a);};C.prototype.Scale=function(a){var a,b;b=this;AE($convertSliceType(b,AJ),a,$convertSliceType(b,AJ));return b;};$ptrType(C).prototype.Scale=function(a){return this.$get().Scale(a);};C.prototype.Equal=function(a){var a,b,c,d,e;b=this;if(!((b.$length===a.$length))){return false;}c=b;d=0;while(true){if(!(d=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e])-((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]))>1e-08){return false;}d++;}return true;};$ptrType(C).prototype.Equal=function(a){return this.$get().Equal(a);};C.prototype.Magnitude=function(){var a;a=this;return A.Sqrt(a.Magnitude2());};$ptrType(C).prototype.Magnitude=function(){return this.$get().Magnitude();};C.prototype.Magnitude2=function(){var a,b,c,d,e;a=this;b=0;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=b+(e*e);d++;}return b;};$ptrType(C).prototype.Magnitude2=function(){return this.$get().Magnitude2();};C.prototype.Unit=function(){var a,b,c,d,e;a=this;b=a.Magnitude();if(b<1e-08){return a;}c=a;d=0;while(true){if(!(d=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]=((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e])/b);d++;}return a;};$ptrType(C).prototype.Unit=function(){return this.$get().Unit();};L=function(a,b){var a,b,c,d,e,f,g,h,i,j,k;c=0;d=a.$length;e=b.$length;f=c;g=d;h=e;if(g>h){b=$appendSlice(b,$convertSliceType($makeSlice(C,(g-h>>0)),AJ));}if(g>0)),AJ));}i=a;j=0;while(true){if(!(j=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+k])*((k<0||k>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+k]));j++;}return f;};$pkg.Dot=L;C.prototype.Dot=function(a){var a,b;b=this;return L(b,a);};$ptrType(C).prototype.Dot=function(a){return this.$get().Dot(a);};C.prototype.Cross=function(a){var a,b;b=this;if(!((b.$length===3))||!((a.$length===3))){return C.nil;}return new C([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]),(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])]);};$ptrType(C).prototype.Cross=function(a){return this.$get().Cross(a);};C.prototype.Rotate=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;c=this;d=2;e=c.$length;f=d;g=e;if(g===0){return c;}if(b.$length>0){f=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]);}if((g===1)&&!((f===2))){c=$append(c,0,0);}if((g<2&&(f===2))||((g===2)&&!((f===2)))){c=$append(c,0);}h=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);i=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);j=h;k=i;l=A.Cos(a);m=A.Sin(a);n=l;o=m;p=f;if(p===(0)){q=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=k*n-q*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=k*o+q*n);}else if(p===(1)){r=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n+r*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=-j*o+r*n);}else if(p===(2)){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n-k*o);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=j*o+k*n);}if(g>3){return $subslice(c,0,3);}return c;};$ptrType(C).prototype.Rotate=function(a,b){return this.$get().Rotate(a,b);};C.prototype.X=function(){var a;a=this;if(a.$length<1){return 0;}return(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);};$ptrType(C).prototype.X=function(){return this.$get().X();};C.prototype.Y=function(){var a;a=this;if(a.$length<2){return 0;}return(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);};$ptrType(C).prototype.Y=function(){return this.$get().Y();};C.prototype.Z=function(){var a;a=this;if(a.$length<3){return 0;}return(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]);};$ptrType(C).prototype.Z=function(){return this.$get().Z();};P=function(a,b,c,d){var a,b,c,d,e,f,g;e=new O.ptr(AM.nil,c,d);e.Resize((f=a/c,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero")),(g=b/d,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero")));return e;};$pkg.NewSpace=P;O.ptr.prototype.Add=function(a){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(b===AN.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);e.Space=b;$r=e.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d++;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:O.ptr.prototype.Add,$c:true,$r,a,b,c,d,e,$s};return $f;};O.prototype.Add=function(a){return this.$val.Add(a);};O.ptr.prototype.Remove=function(a){var a,b,c,d,e,f,g,h;b=this;if(b===AN.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=e.TouchingCells;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);h.unregister(e);g++;}e.TouchingCells=new AL([]);e.Space=AN.nil;d++;}};O.prototype.Remove=function(a){return this.$val.Remove(a);};O.ptr.prototype.Objects=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;a=this;b=$makeMap(AO.keyFor,[]);c=new AP([]);d=a.Cells;e=0;while(true){if(!(e=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+f]));i=0;while(true){if(!(i=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+f])),((j<0||j>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+j])).Objects;n=0;while(true){if(!(n=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+n]);p=(q=b[AO.keyFor(o)],q!==undefined?[q.v,true]:[false,false]);r=p[1];if(!r){c=$append(c,o);s=o;(b||$throwRuntimeError("assignment to entry in nil map"))[AO.keyFor(s)]={k:s,v:true};}n++;}i++;}e++;}return c;};O.prototype.Objects=function(){return this.$val.Objects();};O.ptr.prototype.Resize=function(a,b){var a,b,c,d,e,f,g;c=this;c.Cells=new AM([]);d=0;while(true){if(!(d=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+d]=$append((f=c.Cells,((d<0||d>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+d])),AI(e,d))));e=e+(1)>>0;}d=d+(1)>>0;}};O.prototype.Resize=function(a,b){return this.$val.Resize(a,b);};O.ptr.prototype.Cell=function(a,b){var a,b,c,d,e,f;c=this;if(b>=0&&b=0&&a<(d=c.Cells,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length){return(e=(f=c.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((a<0||a>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+a]));}return AK.nil;};O.prototype.Cell=function(a,b){return this.$val.Cell(a,b);};O.ptr.prototype.CheckCells=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l,m;f=this;g=a;while(true){if(!(g<(a+c>>0))){break;}h=b;while(true){if(!(h<(b+d>>0))){break;}i=f.Cell(g,h);if(!(i===AK.nil)){if(e.$length>0){if(i.ContainsTags(e)){j=i.Objects;k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);if(l.HasTags(e)){return l;}k++;}}}else if(i.Occupied()){return(m=i.Objects,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]));}}h=h+(1)>>0;}g=g+(1)>>0;}return AO.nil;};O.prototype.CheckCells=function(a,b,c,d,e){return this.$val.CheckCells(a,b,c,d,e);};O.ptr.prototype.CheckCellsWorld=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l;f=this;g=f.WorldToSpace(a,b);h=g[0];i=g[1];j=f.WorldToSpace(c,d);k=j[0];l=j[1];return f.CheckCells(h,i,k,l,e);};O.prototype.CheckCellsWorld=function(a,b,c,d,e){return this.$val.CheckCellsWorld(a,b,c,d,e);};O.ptr.prototype.UnregisterAllObjects=function(){var a,b,c,d,e,f,g;a=this;b=0;while(true){if(!(b=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length)){break;}g=(e=(f=a.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((c<0||c>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+c]));a.Remove(g.Objects);c=c+(1)>>0;}b=b+(1)>>0;}};O.prototype.UnregisterAllObjects=function(){return this.$val.UnregisterAllObjects();};O.ptr.prototype.WorldToSpace=function(a,b){var a,b,c,d,e;c=this;d=((A.Floor(a/(c.CellWidth))>>0));e=((A.Floor(b/(c.CellHeight))>>0));return[d,e];};O.prototype.WorldToSpace=function(a,b){return this.$val.WorldToSpace(a,b);};O.ptr.prototype.SpaceToWorld=function(a,b){var a,b,c,d,e;c=this;d=(($imul(a,c.CellWidth)));e=(($imul(b,c.CellHeight)));return[d,e];};O.prototype.SpaceToWorld=function(a,b){return this.$val.SpaceToWorld(a,b);};O.ptr.prototype.Height=function(){var a;a=this;return a.Cells.$length;};O.prototype.Height=function(){return this.$val.Height();};O.ptr.prototype.Width=function(){var a,b;a=this;if(a.Cells.$length>0){return(b=a.Cells,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])).$length;}return 0;};O.prototype.Width=function(){return this.$val.Width();};O.ptr.prototype.CellsInLine=function(a,b,c,d){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;e=this;f=new AL([]);g=e.Cell(a,b);h=e.Cell(c,d);if(!(g===AK.nil)&&!(h===AK.nil)){i=new C([((c-a>>0)),((d-b>>0))]).Unit();(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]=(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])*(((j=e.CellWidth/2,(j===j&&j!==1/0&&j!==-1/0)?j>>0:$throwRuntimeError("integer divide by zero")))));(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]=(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])*(((k=e.CellHeight/2,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero")))));l=e.SpaceToWorld(a,b);m=l[0];n=l[1];q=new C([m+((o=e.CellWidth/2,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero"))),n+((p=e.CellHeight/2,(p===p&&p!==1/0&&p!==-1/0)?p>>0:$throwRuntimeError("integer divide by zero")))]);r=false;while(true){if(!(!(g===AK.nil))){break;}if(g===h){f=$append(f,g);break;}f=$append(f,g);if(r){(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]=(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1])+((1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])));}else{(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])+((0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])));}s=e.WorldToSpace((0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]),(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]));t=s[0];u=s[1];v=e.Cell(t,u);if(!(v===g)){g=v;}r=!r;}}return f;};O.prototype.CellsInLine=function(a,b,c,d){return this.$val.CellsInLine(a,b,c,d);};S=function(a,b,c,d){var a,b,c,d;return new R.ptr(new C([a,b]),new C([c,d]));};$pkg.NewLine=S;R.ptr.prototype.Project=function(a){var a,b;b=this;return b.Vector().Scale(a.Dot(b.Start.Sub(new AQ([b.End]))));};R.prototype.Project=function(a){return this.$val.Project(a);};R.ptr.prototype.Normal=function(){var a,b;a=this;b=a.Vector();return new C([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]),-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])]).Unit();};R.prototype.Normal=function(){return this.$val.Normal();};R.ptr.prototype.Vector=function(){var a;a=this;return a.End.Clone().Sub(new AQ([a.Start])).Unit();};R.prototype.Vector=function(){return this.$val.Vector();};R.ptr.prototype.IntersectionPointsLine=function(a){var a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=this;k=((c=b.End,(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]))-(d=b.Start,(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])))*((e=a.End,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(f=a.Start,(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])))-((g=a.End,(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]))-(h=a.Start,(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])))*((i=b.End,(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]))-(j=b.Start,(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1])));if(!((k===0))){t=((((l=b.Start,(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))-(m=a.Start,(1>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+1])))*((n=a.End,(0>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0]))-(o=a.Start,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))))-(((p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))-(q=a.Start,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])))*((r=a.End,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))-(s=a.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))))+1)/k;ac=((((u=b.Start,(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]))-(v=a.Start,(1>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+1])))*((w=b.End,(0>=w.$length?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+0]))-(x=b.Start,(0>=x.$length?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+0]))))-(((y=b.Start,(0>=y.$length?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+0]))-(z=a.Start,(0>=z.$length?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+0])))*((aa=b.End,(1>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+1]))-(ab=b.Start,(1>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+1]))))+1)/k;if((0=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+0]))-(ae=b.Start,(0>=ae.$length?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+0]));ai=(ag=b.End,(1>=ag.$length?($throwRuntimeError("index out of range"),undefined):ag.$array[ag.$offset+1]))-(ah=b.Start,(1>=ah.$length?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+1]));return new C([(aj=b.Start,(0>=aj.$length?($throwRuntimeError("index out of range"),undefined):aj.$array[aj.$offset+0]))+(t*af),(ak=b.Start,(1>=ak.$length?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+1]))+(t*ai)]);}}return C.nil;};R.prototype.IntersectionPointsLine=function(a){return this.$val.IntersectionPointsLine(a);};R.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;b=this;c=new AQ([]);d=new C([a.X,a.Y]);e=b.Start.Sub(new AQ([d]));f=b.End.Sub(new AQ([d]));g=f.Sub(new AQ([e]));h=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])+(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]);i=2*(((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])));j=((0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(a.Radius*a.Radius);k=i*i-(4*h*j);if(k<0){}else if(k===0){l=-i/(2*h);if(l>=0&&l<=1){c=$append(c,new C([(m=b.Start,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]))+l*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(n=b.Start,(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1]))+l*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}else{o=(-i+A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new C([(p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(q=b.Start,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}o=(-i-A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new C([(r=b.Start,(0>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(s=b.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}return c;};R.prototype.IntersectionPointsCircle=function(a){return this.$val.IntersectionPointsCircle(a);};U=function(a){var a,b;b=new T.ptr(new AQ([]),0,0,true);b.AddPoints(a);return b;};$pkg.NewConvexPolygon=U;T.ptr.prototype.Clone=function(){var a,b,c,d,e,f;a=this;b=new AQ([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Clone());d++;}f=U(AJ.nil);f.X=a.X;f.Y=a.Y;f.AddPointsVec(b);f.Closed=a.Closed;return f;};T.prototype.Clone=function(){return this.$val.Clone();};T.ptr.prototype.AddPointsVec=function(a){var a,b;b=this;b.Points=$appendSlice(b.Points,a);};T.prototype.AddPointsVec=function(a){return this.$val.AddPointsVec(a);};T.ptr.prototype.AddPoints=function(a){var a,b,c,d;b=this;c=0;while(true){if(!(c=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+c]),(d=c+1>>0,((d<0||d>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+d]))]));c=c+(2)>>0;}};T.prototype.AddPoints=function(a){return this.$val.AddPoints(a);};T.ptr.prototype.Lines=function(){var a,b,c,d,e,f,g,h,i,j;a=this;b=new AS([]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);g=e;h=f;if(d<(c.$length-1>>0)){h=(i=d+1>>0,((i<0||i>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+i]));}else if(!a.Closed){break;}j=S((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));b=$append(b,j);d=d+(1)>>0;}return b;};T.prototype.Lines=function(){return this.$val.Lines();};T.ptr.prototype.Transformed=function(){var a,b,c,d,e;a=this;b=new AQ([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,new C([(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])+a.X,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])+a.Y]));d++;}return b;};T.prototype.Transformed=function(){return this.$val.Transformed();};T.ptr.prototype.Bounds=function(){var a,b,c,d,e,f,g,h;a=this;b=a.Transformed();e=new C([(c=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])),(d=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]))]);f=e.Clone();g=0;while(true){if(!(g=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+g]);if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])<(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])){(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}else if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])>(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0])){(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])<(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])){(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}else if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])>(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])){(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}g=g+(1)>>0;}return[e,f];};T.prototype.Bounds=function(){return this.$val.Bounds();};T.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};T.prototype.Position=function(){return this.$val.Position();};T.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};T.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};T.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};T.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};T.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};T.prototype.Move=function(a,b){return this.$val.Move(a,b);};T.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};T.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};T.ptr.prototype.Center=function(){var a,b,c,d,e;a=this;b=new C([0,0]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b.Add(new AQ([e]));d++;}(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])/((a.Transformed().$length)));(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])/((a.Transformed().$length)));return b;};T.prototype.Center=function(){return this.$val.Center();};T.ptr.prototype.Project=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=this;a=a.Unit();c=b.Transformed();f=a.Dot(new C([(d=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])),(e=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))]));g=f;h=1;while(true){if(!(h=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(j=((h<0||h>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1]))]));if(kg){g=k;}h=h+(1)>>0;}return new AA.ptr(f,g);};T.prototype.Project=function(a){return this.$val.Project(a);};T.ptr.prototype.SATAxes=function(){var a,b,c,d,e;a=this;b=new AQ([]);c=a.Lines();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Normal());d++;}return b;};T.prototype.SATAxes=function(){return this.$val.SATAxes();};T.ptr.prototype.PointInside=function(a){var a,b,c,d,e,f,g;b=this;c=S((0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]),(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])+9.99999999999e+11,(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]));d=0;e=b.Lines();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!(g.IntersectionPointsLine(c)===C.nil)){d=d+(1)>>0;}f++;}return d===1;};T.prototype.PointInside=function(a){return this.$val.PointInside(a);};W=function(){return new V.ptr(new AQ([]),new C([0,0]),new C([0,0]));};$pkg.NewContactSet=W;V.ptr.prototype.LeftmostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])<(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};V.prototype.LeftmostPoint=function(){return this.$val.LeftmostPoint();};V.ptr.prototype.RightmostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])>(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};V.prototype.RightmostPoint=function(){return this.$val.RightmostPoint();};V.ptr.prototype.TopmostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])<(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};V.prototype.TopmostPoint=function(){return this.$val.TopmostPoint();};V.ptr.prototype.BottommostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])>(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};V.prototype.BottommostPoint=function(){return this.$val.BottommostPoint();};T.ptr.prototype.Intersection=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=W();f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=$assertType(c,AT,true);i=h[0];j=h[1];if(j){k=d.Lines();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);e.Points=$appendSlice(e.Points,m.IntersectionPointsCircle(i));l++;}}else{n=$assertType(c,AU,true);o=n[0];p=n[1];if(p){q=d.Lines();r=0;while(true){if(!(r=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=o.Lines();u=0;while(true){if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);w=s.IntersectionPointsLine(v);if(!(w===C.nil)){e.Points=$append(e.Points,w);}u++;}r++;}}}if(e.Points.$length>0){$s=1;continue;}$s=2;continue;case 1:x=e.Points;y=0;while(true){if(!(y=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+y]);e.Center=e.Center.Add(new AQ([z]));y++;}(ab=e.Center,(0>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0]=(aa=e.Center,(0>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+0]))/((e.Points.$length))));(ad=e.Center,(1>=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+1]=(ac=e.Center,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))/((e.Points.$length))));ae=d.calculateMTV(e,c);$s=4;case 4:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}af=ae;if(!(af===C.nil)){e.MTV=af;}$s=3;continue;case 2:e=AV.nil;case 3:if(!(e===AV.nil)&&(!((a===0))||!((b===0)))){ag=new C([a,b]).Magnitude();ah=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(ah-ag);}d.X=f;d.Y=g;$s=-1;return e;}return;}var $f={$blk:T.ptr.prototype.Intersection,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};T.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};T.ptr.prototype.calculateMTV=function(a,b){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=[c];d=[d];e=this;f=new C([0,0]);g=new C([1.7976931348623157e+308,0]);h=b;if($assertType(h,AU,true)[1]){$s=1;continue;}if($assertType(h,AT,true)[1]){$s=2;continue;}$s=3;continue;case 1:i=h.$val;k=e.SATAxes();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);if(!$clone(e.Project(m),AA).Overlapping($clone(i.Project(m),AA))){$s=-1;return C.nil;}n=$clone(e.Project(m),AA).Overlap($clone(i.Project(m),AA));if(g.Magnitude()>n){g=m.Scale(n);}l++;}o=i.SATAxes();p=0;while(true){if(!(p=o.$length)?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+p]);if(!$clone(e.Project(q),AA).Overlapping($clone(i.Project(q),AA))){$s=-1;return C.nil;}r=$clone(e.Project(q),AA).Overlap($clone(i.Project(q),AA));if(g.Magnitude()>r){g=q.Scale(r);}p++;}$s=3;continue;case 2:j=h.$val;d[0]=$appendSlice(new AQ([]),e.Transformed());d[0]=$append(d[0],a.Center);c[0]=new C([j.X,j.Y]);$r=B.Slice(d[0],(function(c,d){return function(s,t){var s,t;return((s<0||s>=d[0].$length)?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+s]).Sub(new AQ([c[0]])).Magnitude()<((t<0||t>=d[0].$length)?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+t]).Sub(new AQ([c[0]])).Magnitude();};})(c,d));$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g=new C([(0>=c[0].$length?($throwRuntimeError("index out of range"),undefined):c[0].$array[c[0].$offset+0])-(s=(0>=d[0].$length?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+0]),(0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])),(1>=c[0].$length?($throwRuntimeError("index out of range"),undefined):c[0].$array[c[0].$offset+1])-(t=(0>=d[0].$length?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+0]),(1>=t.$length?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+1]))]);g=g.Unit().Scale(g.Magnitude()-j.Radius);case 3:(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]));(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]));$s=-1;return f;}return;}var $f={$blk:T.ptr.prototype.calculateMTV,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s};return $f;};T.prototype.calculateMTV=function(a,b){return this.$val.calculateMTV(a,b);};T.ptr.prototype.ContainedBy=function(a){var a,b,c,d,e,f,g,h,i,j;b=this;c=a;if($assertType(c,AU,true)[1]){d=c.$val;e=b.SATAxes();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!$clone(b.Project(g),AA).IsInside($clone(d.Project(g),AA))){return false;}f++;}h=d.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(b.Project(j),AA).IsInside($clone(d.Project(j),AA))){return false;}i++;}}return true;};T.prototype.ContainedBy=function(a){return this.$val.ContainedBy(a);};T.ptr.prototype.FlipH=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=-(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]));c++;}a.ReverseVertexOrder();};T.prototype.FlipH=function(){return this.$val.FlipH();};T.ptr.prototype.FlipV=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=-(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]));c++;}a.ReverseVertexOrder();};T.prototype.FlipV=function(){return this.$val.FlipV();};T.ptr.prototype.ReverseVertexOrder=function(){var a,b,c,d,e;a=this;c=new AQ([(b=a.Points,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]))]);d=a.Points.$length-1>>0;while(true){if(!(d>=1)){break;}c=$append(c,(e=a.Points,((d<0||d>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+d])));d=d-(1)>>0;}a.Points=c;};T.prototype.ReverseVertexOrder=function(){return this.$val.ReverseVertexOrder();};X=function(a,b,c,d){var a,b,c,d;return U(new AJ([a,b,a+c,b,a+c,b+d,a,b+d]));};$pkg.NewRectangle=X;Z=function(a,b,c){var a,b,c,d;d=new Y.ptr(a,b,c);return d;};$pkg.NewCircle=Z;Y.ptr.prototype.Clone=function(){var a;a=this;return Z(a.X,a.Y,a.Radius);};Y.prototype.Clone=function(){return this.$val.Clone();};Y.ptr.prototype.Bounds=function(){var a;a=this;return[new C([a.X-a.Radius,a.Y-a.Radius]),new C([a.X+a.Radius,a.Y+a.Radius])];};Y.prototype.Bounds=function(){return this.$val.Bounds();};Y.ptr.prototype.Intersection=function(a,b,c){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=AV.nil;f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=c;if($assertType(h,AU,true)[1]){$s=1;continue;}if($assertType(h,AT,true)[1]){$s=2;continue;}$s=3;continue;case 1:i=h.$val;k=i.Intersection(-a,-b,d);$s=4;case 4:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}e=k;if(!(e===AV.nil)){e.MTV=e.MTV.Scale(-1);}$s=3;continue;case 2:j=h.$val;e=W();e.Points=d.IntersectionPointsCircle(j);if(e.Points.$length===0){$s=-1;return AV.nil;}e.MTV=new C([d.X-j.X,d.Y-j.Y]);l=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(d.Radius+j.Radius-l);m=e.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);e.Center=e.Center.Add(new AQ([o]));n++;}(q=e.Center,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(p=e.Center,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))/((e.Points.$length))));(s=e.Center,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]=(r=e.Center,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))/((e.Points.$length))));case 3:d.X=f;d.Y=g;$s=-1;return e;}return;}var $f={$blk:Y.ptr.prototype.Intersection,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};Y.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};Y.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};Y.prototype.Move=function(a,b){return this.$val.Move(a,b);};Y.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};Y.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};Y.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};Y.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};Y.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};Y.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};Y.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};Y.prototype.Position=function(){return this.$val.Position();};Y.ptr.prototype.PointInside=function(a){var a,b;b=this;return a.Sub(new AQ([new C([b.X,b.Y])])).Magnitude()<=b.Radius;};Y.prototype.PointInside=function(a){return this.$val.PointInside(a);};Y.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g;b=this;c=A.Sqrt(A.Pow(a.X-b.X,2)+A.Pow(a.Y-b.Y,2));if(c>b.Radius+a.Radius||c0;};AA.prototype.Overlapping=function(a){return this.$val.Overlapping(a);};AA.ptr.prototype.Overlap=function(a){var a,b;b=this;return A.Min(b.Max,a.Max)-A.Max(b.Min,a.Min);};AA.prototype.Overlap=function(a){return this.$val.Overlap(a);};AA.ptr.prototype.IsInside=function(a){var a,b;b=this;return b.Min>=a.Min&&b.Max<=a.Max;};AA.prototype.IsInside=function(a){return this.$val.IsInside(a);};AC=function(a,b,c,d,e){var a,b,c,d,e,f;f=new AB.ptr($ifaceNil,AN.nil,a,b,c,d,AL.nil,$ifaceNil,$makeMap(AO.keyFor,[]),new AW([]));if(e.$length>0){f.AddTags(e);}return f;};$pkg.NewObject=AC;AB.ptr.prototype.Clone=function(){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=this;b=AC(a.X,a.Y,a.W,a.H,a.Tags());b.Data=a.Data;if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:c=a.Shape.Clone();$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$r=b.SetShape(c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:d=a.ignoreList;e=0;f=$keys(d);while(true){if(!(e>0;}h=h+(1)>>0;}}if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:$r=a.Shape.SetPosition(a.X,a.Y);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AB.ptr.prototype.Update,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};AB.prototype.Update=function(){return this.$val.Update();};AB.ptr.prototype.AddTags=function(a){var a,b;b=this;b.tags=$appendSlice(b.tags,a);};AB.prototype.AddTags=function(a){return this.$val.AddTags(a);};AB.ptr.prototype.RemoveTags=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(i===e){b.tags=$appendSlice($subslice(b.tags,0,h),$subslice(b.tags,(h+1>>0)));break;}g++;}d++;}};AB.prototype.RemoveTags=function(a){return this.$val.RemoveTags(a);};AB.ptr.prototype.HasTags=function(a){var a,b,c,d,e,f,g,h;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return true;}g++;}d++;}return false;};AB.prototype.HasTags=function(a){return this.$val.HasTags(a);};AB.ptr.prototype.Tags=function(){var a;a=this;return $appendSlice(new AW([]),a.tags);};AB.prototype.Tags=function(){return this.$val.Tags();};AB.ptr.prototype.SetShape=function(a){var{a,b,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(!($interfaceIsEqual(b.Shape,a))){$s=1;continue;}$s=2;continue;case 1:b.Shape=a;$r=b.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AB.ptr.prototype.SetShape,$c:true,$r,a,b,$s};return $f;};AB.prototype.SetShape=function(a){return this.$val.SetShape(a);};AB.ptr.prototype.BoundsToSpace=function(a,b){var a,b,c,d,e,f,g,h,i;c=this;d=c.Space.WorldToSpace(c.X+a,c.Y+b);e=d[0];f=d[1];g=c.Space.WorldToSpace(c.X+c.W+a-1,c.Y+c.H+b-1);h=g[0];i=g[1];return[e,f,h,i];};AB.prototype.BoundsToSpace=function(a,b){return this.$val.BoundsToSpace(a,b);};AB.ptr.prototype.SharesCells=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.Contains(a)){return true;}d++;}return false;};AB.prototype.SharesCells=function(a){return this.$val.SharesCells(a);};AB.ptr.prototype.SharesCellsTags=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.ContainsTags(a)){return true;}d++;}return false;};AB.prototype.SharesCellsTags=function(a){return this.$val.SharesCellsTags(a);};AB.ptr.prototype.Center=function(){var a;a=this;return[a.X+(a.W/2),a.Y+(a.H/2)];};AB.prototype.Center=function(){return this.$val.Center();};AB.ptr.prototype.SetCenter=function(a,b){var a,b,c;c=this;c.X=a-(c.W/2);c.Y=b-(c.H/2);};AB.prototype.SetCenter=function(a,b){return this.$val.SetCenter(a,b);};AB.ptr.prototype.CellPosition=function(){var a,b;a=this;b=a.Center();return a.Space.WorldToSpace(b[0],b[1]);};AB.prototype.CellPosition=function(){return this.$val.CellPosition();};AB.ptr.prototype.SetRight=function(a){var a,b;b=this;b.X=a-b.W;};AB.prototype.SetRight=function(a){return this.$val.SetRight(a);};AB.ptr.prototype.SetBottom=function(a){var a,b;b=this;b.Y=a-b.H;};AB.prototype.SetBottom=function(a){return this.$val.SetBottom(a);};AB.ptr.prototype.Bottom=function(){var a;a=this;return a.Y+a.H;};AB.prototype.Bottom=function(){return this.$val.Bottom();};AB.ptr.prototype.Right=function(){var a;a=this;return a.X+a.W;};AB.prototype.Right=function(){return this.$val.Right();};AB.ptr.prototype.SetBounds=function(a,b){var a,b,c;c=this;c.X=(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);c.Y=(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);c.W=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])-c.X;c.H=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])-c.Y;};AB.prototype.SetBounds=function(a,b){return this.$val.SetBounds(a,b);};AB.ptr.prototype.Check=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=[d];e=[e];f=[f];g=[g];h=this;if(h.Space===AN.nil){$s=-1;return AX.nil;}d[0]=AG();d[0].checkingObject=h;if(a<0){a=A.Min(a,-1);}else if(a>0){a=A.Max(a,1);}if(b<0){b=A.Min(b,-1);}else if(b>0){b=A.Max(b,1);}d[0].dx=a;d[0].dy=b;i=h.BoundsToSpace(a,b);j=i[0];k=i[1];l=i[2];m=i[3];n=$makeMap(AO.keyFor,[]);o=$makeMap(AK.keyFor,[]);p=k;while(true){if(!(p<=m)){break;}q=j;while(true){if(!(q<=l)){break;}r=h.Space.Cell(q,p);if(!(r===AK.nil)){s=r.Objects;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);w=(v=h.ignoreList[AO.keyFor(u)],v!==undefined?v.v:false);if(u===h||w){t++;continue;}x=(y=n[AO.keyFor(u)],y!==undefined?[y.v,true]:[false,false]);z=x[1];if(((c.$length===0)||u.HasTags(c))&&!z){d[0].Objects=$append(d[0].Objects,u);aa=u;(n||$throwRuntimeError("assignment to entry in nil map"))[AO.keyFor(aa)]={k:aa,v:true};ab=(ac=o[AK.keyFor(r)],ac!==undefined?[ac.v,true]:[false,false]);ad=ab[1];if(!ad){d[0].Cells=$append(d[0].Cells,r);ae=r;(o||$throwRuntimeError("assignment to entry in nil map"))[AK.keyFor(ae)]={k:ae,v:true};}t++;continue;}t++;}}q=q+(1)>>0;}p=p+(1)>>0;}if(d[0].Objects.$length===0){$s=-1;return AX.nil;}af=d[0].checkingObject.Center();ag=af[0];ah=af[1];g[0]=new C([ag,ah]);$r=B.Slice(d[0].Objects,(function(d,e,f,g){return function(ai,aj){var ai,aj,ak,al,am,an,ao,ap,aq,ar;ak=(al=d[0].Objects,((ai<0||ai>=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+ai])).Center();am=ak[0];an=ak[1];ao=(ap=d[0].Objects,((aj<0||aj>=ap.$length)?($throwRuntimeError("index out of range"),undefined):ap.$array[ap.$offset+aj])).Center();aq=ao[0];ar=ao[1];return new C([am,an]).Sub(new AQ([g[0]])).Magnitude2()=ak.$length)?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+ai])).X,f[0]))+((al=f[0]/2,(al===al&&al!==1/0&&al!==-1/0)?al>>0:$throwRuntimeError("integer divide by zero")))>>0)),((($imul((am=d[0].Cells,((ai<0||ai>=am.$length)?($throwRuntimeError("index out of range"),undefined):am.$array[am.$offset+ai])).Y,e[0]))+((an=e[0]/2,(an===an&&an!==1/0&&an!==-1/0)?an>>0:$throwRuntimeError("integer divide by zero")))>>0))]).Sub(new AQ([g[0]])).Magnitude2()=ao.$length)?($throwRuntimeError("index out of range"),undefined):ao.$array[ao.$offset+aj])).X,f[0]))+((ap=f[0]/2,(ap===ap&&ap!==1/0&&ap!==-1/0)?ap>>0:$throwRuntimeError("integer divide by zero")))>>0)),((($imul((aq=d[0].Cells,((aj<0||aj>=aq.$length)?($throwRuntimeError("index out of range"),undefined):aq.$array[aq.$offset+aj])).Y,e[0]))+((ar=e[0]/2,(ar===ar&&ar!==1/0&&ar!==-1/0)?ar>>0:$throwRuntimeError("integer divide by zero")))>>0))]).Sub(new AQ([g[0]])).Magnitude2();};})(d,e,f,g));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return d[0];}return;}var $f={$blk:AB.ptr.prototype.Check,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AB.prototype.Check=function(a,b,c){return this.$val.Check(a,b,c);};AB.ptr.prototype.Overlaps=function(a){var a,b;b=this;return a.X<=b.X+b.W&&a.X+a.W>=b.X&&a.Y<=b.Y+b.H&&a.Y+a.H>=b.Y;};AB.prototype.Overlaps=function(a){return this.$val.Overlaps(a);};AB.ptr.prototype.AddToIgnoreList=function(a){var a,b,c;b=this;c=a;(b.ignoreList||$throwRuntimeError("assignment to entry in nil map"))[AO.keyFor(c)]={k:c,v:true};};AB.prototype.AddToIgnoreList=function(a){return this.$val.AddToIgnoreList(a);};AB.ptr.prototype.RemoveFromIgnoreList=function(a){var a,b;b=this;delete b.ignoreList[AO.keyFor(a)];};AB.prototype.RemoveFromIgnoreList=function(a){return this.$val.RemoveFromIgnoreList(a);};AD=function(a,b,c,d){var a,b,c,d,e,f,g,h,i;e=d.$length;f=c;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return;}((h<0||h>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+h]=b*i+((h<0||h>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+h]));g++;}};AE=function(a,b,c){var a,b,c,d,e,f;d=c;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]=((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f])*(b));e++;}};AG=function(){return new AF.ptr(AO.nil,0,0,new AP([]),AL.nil);};$pkg.NewCollision=AG;AF.ptr.prototype.HasTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===b.checkingObject){d++;continue;}if(e.HasTags(a)){return true;}d++;}return false;};AF.prototype.HasTags=function(a){return this.$val.HasTags(a);};AF.ptr.prototype.ObjectsByTags=function(a){var a,b,c,d,e,f;b=this;c=new AP([]);d=b.Objects;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);if(f===b.checkingObject){e++;continue;}if(f.HasTags(a)){c=$append(c,f);}e++;}return c;};AF.prototype.ObjectsByTags=function(a){return this.$val.ObjectsByTags(a);};AF.ptr.prototype.ContactWithObject=function(a){var a,b,c;b=this;c=new C([0,0]);if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X+a.W-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y+a.H-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y-b.checkingObject.H-b.checkingObject.Y);}return c;};AF.prototype.ContactWithObject=function(a){return this.$val.ContactWithObject(a);};AF.ptr.prototype.ContactWithCell=function(a){var a,b,c,d,e;b=this;c=new C([0,0]);d=(($imul(a.X,b.checkingObject.Space.CellWidth)));e=(($imul(a.Y,b.checkingObject.Space.CellHeight)));if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d+(b.checkingObject.Space.CellWidth)-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e+(b.checkingObject.Space.CellHeight)-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e-b.checkingObject.H-b.checkingObject.Y);}return c;};AF.prototype.ContactWithCell=function(a){return this.$val.ContactWithCell(a);};AF.ptr.prototype.SlideAgainstCell=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;c=this;d=c.checkingObject.Space;f=(e=c.Cells,(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));g=d.SpaceToWorld(f.X,f.Y);h=g[0];i=g[1];j=(d.CellWidth)/2;k=(d.CellHeight)/2;h=h+(j);i=i+(k);l=c.checkingObject.Center();m=l[0];n=l[1];o=m-h;p=n-i;q=d.Cell(f.X-1>>0,f.Y);r=d.Cell(f.X+1>>0,f.Y);s=d.Cell(f.X,f.Y-1>>0);t=d.Cell(f.X,f.Y+1>>0);u=new C([0,0]);if(!((c.dy===0))){if(o>0&&(r===AK.nil||!r.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h+j-c.checkingObject.X);}else if(o<0&&(q===AK.nil||!q.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h-j-(c.checkingObject.X+c.checkingObject.W));}else{return C.nil;}}if(!((c.dx===0))){if(p>0&&(t===AK.nil||!t.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i+k-c.checkingObject.Y);}else if(p<0&&(s===AK.nil||!s.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i-k-(c.checkingObject.Y+c.checkingObject.H));}else{return C.nil;}}return u;};AF.prototype.SlideAgainstCell=function(a,b){return this.$val.SlideAgainstCell(a,b);};AI=function(a,b){var a,b;return new AH.ptr(a,b,new AP([]));};AH.ptr.prototype.register=function(a){var a,b;b=this;if(!b.Contains(a)){b.Objects=$append(b.Objects,a);}};AH.prototype.register=function(a){return this.$val.register(a);};AH.ptr.prototype.unregister=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(f===a){(i=b.Objects,((e<0||e>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+e]=(g=b.Objects,h=b.Objects.$length-1>>0,((h<0||h>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]))));b.Objects=$subslice(b.Objects,0,(b.Objects.$length-1>>0));break;}d++;}};AH.prototype.unregister=function(a){return this.$val.unregister(a);};AH.ptr.prototype.Contains=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===a){return true;}d++;}return false;};AH.prototype.Contains=function(a){return this.$val.Contains(a);};AH.ptr.prototype.ContainsTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.HasTags(a)){return true;}d++;}return false;};AH.prototype.ContainsTags=function(a){return this.$val.ContainsTags(a);};AH.ptr.prototype.Occupied=function(){var a;a=this;return a.Objects.$length>0;};AH.prototype.Occupied=function(){return this.$val.Occupied();};C.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[C],false)},{prop:"Add",name:"Add",pkg:"",typ:$funcType([AQ],[C],true)},{prop:"Sub",name:"Sub",pkg:"",typ:$funcType([AQ],[C],true)},{prop:"Scale",name:"Scale",pkg:"",typ:$funcType([$Float64],[C],false)},{prop:"Equal",name:"Equal",pkg:"",typ:$funcType([C],[$Bool],false)},{prop:"Magnitude",name:"Magnitude",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Magnitude2",name:"Magnitude2",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Unit",name:"Unit",pkg:"",typ:$funcType([],[C],false)},{prop:"Dot",name:"Dot",pkg:"",typ:$funcType([C],[$Float64],false)},{prop:"Cross",name:"Cross",pkg:"",typ:$funcType([C],[C],false)},{prop:"Rotate",name:"Rotate",pkg:"",typ:$funcType([$Float64,AY],[C],true)},{prop:"X",name:"X",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Y",name:"Y",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Z",name:"Z",pkg:"",typ:$funcType([],[$Float64],false)}];AN.methods=[{prop:"Add",name:"Add",pkg:"",typ:$funcType([AP],[],true)},{prop:"Remove",name:"Remove",pkg:"",typ:$funcType([AP],[],true)},{prop:"Objects",name:"Objects",pkg:"",typ:$funcType([],[AP],false)},{prop:"Resize",name:"Resize",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Cell",name:"Cell",pkg:"",typ:$funcType([$Int,$Int],[AK],false)},{prop:"CheckCells",name:"CheckCells",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int,AW],[AO],true)},{prop:"CheckCellsWorld",name:"CheckCellsWorld",pkg:"",typ:$funcType([$Float64,$Float64,$Float64,$Float64,AW],[AO],true)},{prop:"UnregisterAllObjects",name:"UnregisterAllObjects",pkg:"",typ:$funcType([],[],false)},{prop:"WorldToSpace",name:"WorldToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int],false)},{prop:"SpaceToWorld",name:"SpaceToWorld",pkg:"",typ:$funcType([$Int,$Int],[$Float64,$Float64],false)},{prop:"Height",name:"Height",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int],false)},{prop:"CellsInLine",name:"CellsInLine",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int],[AL],false)}];AR.methods=[{prop:"Project",name:"Project",pkg:"",typ:$funcType([C],[C],false)},{prop:"Normal",name:"Normal",pkg:"",typ:$funcType([],[C],false)},{prop:"Vector",name:"Vector",pkg:"",typ:$funcType([],[C],false)},{prop:"IntersectionPointsLine",name:"IntersectionPointsLine",pkg:"",typ:$funcType([AR],[C],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AT],[AQ],false)}];AU.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[Q],false)},{prop:"AddPointsVec",name:"AddPointsVec",pkg:"",typ:$funcType([AQ],[],true)},{prop:"AddPoints",name:"AddPoints",pkg:"",typ:$funcType([AJ],[],true)},{prop:"Lines",name:"Lines",pkg:"",typ:$funcType([],[AS],false)},{prop:"Transformed",name:"Transformed",pkg:"",typ:$funcType([],[AQ],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[C,C],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([C],[],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([C],[],false)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[C],false)},{prop:"Project",name:"Project",pkg:"",typ:$funcType([C],[AA],false)},{prop:"SATAxes",name:"SATAxes",pkg:"",typ:$funcType([],[AQ],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([C],[$Bool],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,Q],[AV],false)},{prop:"calculateMTV",name:"calculateMTV",pkg:"resolv",typ:$funcType([AV,Q],[C],false)},{prop:"ContainedBy",name:"ContainedBy",pkg:"",typ:$funcType([Q],[$Bool],false)},{prop:"FlipH",name:"FlipH",pkg:"",typ:$funcType([],[],false)},{prop:"FlipV",name:"FlipV",pkg:"",typ:$funcType([],[],false)},{prop:"ReverseVertexOrder",name:"ReverseVertexOrder",pkg:"",typ:$funcType([],[],false)}];AV.methods=[{prop:"LeftmostPoint",name:"LeftmostPoint",pkg:"",typ:$funcType([],[C],false)},{prop:"RightmostPoint",name:"RightmostPoint",pkg:"",typ:$funcType([],[C],false)},{prop:"TopmostPoint",name:"TopmostPoint",pkg:"",typ:$funcType([],[C],false)},{prop:"BottommostPoint",name:"BottommostPoint",pkg:"",typ:$funcType([],[C],false)}];AT.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[Q],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[C,C],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,Q],[AV],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([C],[],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([C],[],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([C],[$Bool],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AT],[AQ],false)}];AA.methods=[{prop:"Overlapping",name:"Overlapping",pkg:"",typ:$funcType([AA],[$Bool],false)},{prop:"Overlap",name:"Overlap",pkg:"",typ:$funcType([AA],[$Float64],false)},{prop:"IsInside",name:"IsInside",pkg:"",typ:$funcType([AA],[$Bool],false)}];AO.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[AO],false)},{prop:"Update",name:"Update",pkg:"",typ:$funcType([],[],false)},{prop:"AddTags",name:"AddTags",pkg:"",typ:$funcType([AW],[],true)},{prop:"RemoveTags",name:"RemoveTags",pkg:"",typ:$funcType([AW],[],true)},{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"Tags",name:"Tags",pkg:"",typ:$funcType([],[AW],false)},{prop:"SetShape",name:"SetShape",pkg:"",typ:$funcType([Q],[],false)},{prop:"BoundsToSpace",name:"BoundsToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int,$Int,$Int],false)},{prop:"SharesCells",name:"SharesCells",pkg:"",typ:$funcType([AO],[$Bool],false)},{prop:"SharesCellsTags",name:"SharesCellsTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetCenter",name:"SetCenter",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"CellPosition",name:"CellPosition",pkg:"",typ:$funcType([],[$Int,$Int],false)},{prop:"SetRight",name:"SetRight",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"SetBottom",name:"SetBottom",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"Bottom",name:"Bottom",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Right",name:"Right",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"SetBounds",name:"SetBounds",pkg:"",typ:$funcType([C,C],[],false)},{prop:"Check",name:"Check",pkg:"",typ:$funcType([$Float64,$Float64,AW],[AX],true)},{prop:"Overlaps",name:"Overlaps",pkg:"",typ:$funcType([AO],[$Bool],false)},{prop:"AddToIgnoreList",name:"AddToIgnoreList",pkg:"",typ:$funcType([AO],[],false)},{prop:"RemoveFromIgnoreList",name:"RemoveFromIgnoreList",pkg:"",typ:$funcType([AO],[],false)}];AX.methods=[{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"ObjectsByTags",name:"ObjectsByTags",pkg:"",typ:$funcType([AW],[AP],true)},{prop:"ContactWithObject",name:"ContactWithObject",pkg:"",typ:$funcType([AO],[C],false)},{prop:"ContactWithCell",name:"ContactWithCell",pkg:"",typ:$funcType([AK],[C],false)},{prop:"SlideAgainstCell",name:"SlideAgainstCell",pkg:"",typ:$funcType([AK,AW],[C],true)}];AK.methods=[{prop:"register",name:"register",pkg:"resolv",typ:$funcType([AO],[],false)},{prop:"unregister",name:"unregister",pkg:"resolv",typ:$funcType([AO],[],false)},{prop:"Contains",name:"Contains",pkg:"",typ:$funcType([AO],[$Bool],false)},{prop:"ContainsTags",name:"ContainsTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"Occupied",name:"Occupied",pkg:"",typ:$funcType([],[$Bool],false)}];C.init($Float64);O.init("",[{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AM,tag:""},{prop:"CellWidth",name:"CellWidth",embedded:false,exported:true,typ:$Int,tag:""},{prop:"CellHeight",name:"CellHeight",embedded:false,exported:true,typ:$Int,tag:""}]);Q.init([{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[C,C],false)},{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[Q],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,Q],[AV],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)}]);R.init("",[{prop:"Start",name:"Start",embedded:false,exported:true,typ:C,tag:""},{prop:"End",name:"End",embedded:false,exported:true,typ:C,tag:""}]);T.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AQ,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Closed",name:"Closed",embedded:false,exported:true,typ:$Bool,tag:""}]);V.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AQ,tag:""},{prop:"MTV",name:"MTV",embedded:false,exported:true,typ:C,tag:""},{prop:"Center",name:"Center",embedded:false,exported:true,typ:C,tag:""}]);Y.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Radius",name:"Radius",embedded:false,exported:true,typ:$Float64,tag:""}]);AA.init("",[{prop:"Min",name:"Min",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Max",name:"Max",embedded:false,exported:true,typ:$Float64,tag:""}]);AB.init("resolv",[{prop:"Shape",name:"Shape",embedded:false,exported:true,typ:Q,tag:""},{prop:"Space",name:"Space",embedded:false,exported:true,typ:AN,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"W",name:"W",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"H",name:"H",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"TouchingCells",name:"TouchingCells",embedded:false,exported:true,typ:AL,tag:""},{prop:"Data",name:"Data",embedded:false,exported:true,typ:$emptyInterface,tag:""},{prop:"ignoreList",name:"ignoreList",embedded:false,exported:false,typ:AZ,tag:""},{prop:"tags",name:"tags",embedded:false,exported:false,typ:AW,tag:""}]);AF.init("resolv",[{prop:"checkingObject",name:"checkingObject",embedded:false,exported:false,typ:AO,tag:""},{prop:"dx",name:"dx",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"dy",name:"dy",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AP,tag:""},{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AL,tag:""}]);AH.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AP,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["jsexport/battle"]=(function(){var $pkg={},$init,A,B,C,D,E,F,H,I,J,M,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,L,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB;A=$packages["math"];B=$packages["resolv"];C=$pkg.Vec2D=$newType(0,$kindStruct,"battle.Vec2D",true,"jsexport/battle",true,function(X_,Y_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;return;}this.X=X_;this.Y=Y_;});D=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=AS.nil;this.Points=AT.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});E=$pkg.PlayerDownsync=$newType(0,$kindStruct,"battle.PlayerDownsync",true,"jsexport/battle",true,function(Id_,VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BattleState_,JoinIndex_,ColliderRadius_,Removed_,Score_,LastMoveGmtMillis_,FramesToRecover_,Hp_,MaxHp_,CharacterState_,InAir_){this.$val=this;if(arguments.length===0){this.Id=0;this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BattleState=0;this.JoinIndex=0;this.ColliderRadius=0;this.Removed=false;this.Score=0;this.LastMoveGmtMillis=0;this.FramesToRecover=0;this.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;return;}this.Id=Id_;this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BattleState=BattleState_;this.JoinIndex=JoinIndex_;this.ColliderRadius=ColliderRadius_;this.Removed=Removed_;this.Score=Score_;this.LastMoveGmtMillis=LastMoveGmtMillis_;this.FramesToRecover=FramesToRecover_;this.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;});F=$pkg.InputFrameDecoded=$newType(0,$kindStruct,"battle.InputFrameDecoded",true,"jsexport/battle",true,function(Dx_,Dy_,BtnALevel_,BtnBLevel_){this.$val=this;if(arguments.length===0){this.Dx=0;this.Dy=0;this.BtnALevel=0;this.BtnBLevel=0;return;}this.Dx=Dx_;this.Dy=Dy_;this.BtnALevel=BtnALevel_;this.BtnBLevel=BtnBLevel_;});H=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=AU.nil;return;}this.Boundary=Boundary_;});I=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BattleLocalId_,StartupFrames_,ActiveFrames_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,HitboxOffset_,OriginatedRenderFrameId_,HitStunFrames_,BlockStunFrames_,Pushback_,ReleaseTriggerType_,Damage_,OffenderJoinIndex_,OffenderPlayerId_,SelfMoveforwardX_,SelfMoveforwardY_,HitboxSizeX_,HitboxSizeY_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.StartupFrames=0;this.ActiveFrames=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.HitboxOffset=0;this.OriginatedRenderFrameId=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.Pushback=0;this.ReleaseTriggerType=0;this.Damage=0;this.OffenderJoinIndex=0;this.OffenderPlayerId=0;this.SelfMoveforwardX=0;this.SelfMoveforwardY=0;this.HitboxSizeX=0;this.HitboxSizeY=0;return;}this.BattleLocalId=BattleLocalId_;this.StartupFrames=StartupFrames_;this.ActiveFrames=ActiveFrames_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.HitboxOffset=HitboxOffset_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.Pushback=Pushback_;this.ReleaseTriggerType=ReleaseTriggerType_;this.Damage=Damage_;this.OffenderJoinIndex=OffenderJoinIndex_;this.OffenderPlayerId=OffenderPlayerId_;this.SelfMoveforwardX=SelfMoveforwardX_;this.SelfMoveforwardY=SelfMoveforwardY_;this.HitboxSizeX=HitboxSizeX_;this.HitboxSizeY=HitboxSizeY_;});J=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,BackendUnconfirmedMask_,ShouldForceResync_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=AM.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=AQ.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;});M=$pkg.SatResult=$newType(0,$kindStruct,"battle.SatResult",true,"jsexport/battle",true,function(Overlap_,OverlapX_,OverlapY_,AContainedInB_,BContainedInA_,Axis_){this.$val=this;if(arguments.length===0){this.Overlap=0;this.OverlapX=0;this.OverlapY=0;this.AContainedInB=false;this.BContainedInA=false;this.Axis=B.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});AC=$sliceType($Int32);AD=$sliceType(AC);AE=$ptrType(M);AF=$sliceType(C);AG=$sliceType($String);AH=$ptrType(B.Collision);AI=$ptrType(AF);AJ=$ptrType(E);AK=$ptrType(I);AL=$ptrType(B.ConvexPolygon);AM=$sliceType(AJ);AN=$sliceType(AI);AO=$sliceType($Uint64);AP=$ptrType(B.Object);AQ=$sliceType(AK);AR=$sliceType($Float64);AS=$ptrType(C);AT=$sliceType(AS);AU=$ptrType(D);L=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};N=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new M.ptr(0,0,0,true,true,new B.Vector([0,0]));i=O(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,AE.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,AE.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:N,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};$pkg.CalcPushbacks=N;O=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(AE.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(P(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(P(a,b,u.Unit(),c)){return false;}t++;}}return true;};P=function(a,b,c,d){var a,aa,ab,ac,ad,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};Q=function(a,b,c){var a,b,c,d,e;d=((A.Floor(a*c)>>0));e=((A.Floor(b*c)>>0));return[d,e];};$pkg.WorldToVirtualGridPos=Q;R=function(a,b,c){var a,b,c,d,e;d=(a)*c;e=(b)*c;return[d,e];};$pkg.VirtualGridToWorldPos=R;S=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=S;T=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=T;U=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=T(a,b,c,d,e,f,g,h,i,j);m=l[0];n=l[1];return Q(m,n,k);};$pkg.PolygonColliderBLToVirtualGridPos=U;V=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=R(a,b,k);m=l[0];n=l[1];return S(m,n,c,d,e,f,g,h,i,j);};$pkg.VirtualGridToPolygonColliderBLPos=V;W=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=[f];f[0]=$makeSlice(AF,0,10);g=b.Check(0,0,new AG([]));$s=1;case 1:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;if(AH.nil===h){$s=-1;return(f.$ptr||(f.$ptr=new AI(function(){return this.$target[0];},function($v){this.$target[0]=$v;},f)));}i=h.Objects;j=0;case 2:if(!(j=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+j]);l=false;m=k.Data;if($assertType(m,AJ,true)[1]){}else if($assertType(m,AK,true)[1]){}else{l=true;}if(!l){j++;$s=2;continue;}n=$assertType(k.Shape,AL);p=N(0,0,c,n);$s=4;case 4:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}o=p;q=o[0];r=o[1];s=o[2];t=o[3];if(!q){j++;$s=2;continue;}u=(t.Overlap-d)*t.OverlapX;v=(t.Overlap-d)*t.OverlapY;r=u;s=v;f[0]=$append(f[0],new C.ptr(t.OverlapX,t.OverlapY));e.X=e.X+(r);e.Y=e.Y+(s);j++;$s=2;continue;case 3:$s=-1;return(f.$ptr||(f.$ptr=new AI(function(){return this.$target[0];},function($v){this.$target[0]=$v;},f)));}return;}var $f={$blk:W,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,$s};return $f;};X=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=c.PlayersArr.$length;r=$makeSlice(AM,q);s=c.PlayersArr;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]=new E.ptr(v.Id,v.VirtualGridX,v.VirtualGridY,v.DirX,v.DirY,v.VelX,v.VelY,v.Speed,v.BattleState,v.JoinIndex,0,v.Removed,v.Score,0,v.FramesToRecover-1>>0,v.Hp,v.MaxHp,v.CharacterState,true));if(((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover<0){((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover=0;}t++;}w=$makeSlice(AF,q);x=$makeSlice(AN,q);if(!(AO.nil===a)){y=c.PlayersArr;z=0;while(true){if(!(z=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+z]);ac=ab.JoinIndex;ad=((aa<0||aa>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+aa]);if(0>0,((ae<0||ae>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+ae])));ag=0;if(!(AO.nil===b)){ai=L((ah=ac-1>>0,((ah<0||ah>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+ah])));ag=ai.BtnBLevel;}if(af.BtnBLevel>ag){aj=false;if((4===ad.CharacterState)||(5===ad.CharacterState)||(6===ad.CharacterState)){aj=true;}ak=false;if((0===ad.CharacterState)||(1===ad.CharacterState)||(4===ad.CharacterState)){ak=true;}if(!aj&&ak){ad.VelY=h;}}if(!((0===af.Dx))||!((0===af.Dy))){ad.DirX=af.Dx;ad.DirY=af.Dy;ad.VelX=$imul(af.Dx,ab.Speed);ad.CharacterState=1;}else{ad.CharacterState=0;ad.VelX=0;}z++;}}al=c.PlayersArr;am=0;case 1:if(!(am=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+am]);ap=ao.JoinIndex;aq=0;ar=0;(as=ap-1>>0,((as<0||as>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+as])).X=aq;(at=ap-1>>0,((at<0||at>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+at])).Y=ar;au=131072+ap>>0;aw=(av=e[$Int32.keyFor(au)],av!==undefined?av.v:AP.nil);ax=((an<0||an>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+an]);ay=ao.VirtualGridX+ao.VelX>>0;az=ao.VirtualGridY+ao.VelY>>0;ba=ay;bb=az;if(ax.VelY===h){bb=bb+(ax.VelY)>>0;}bc=V(ba,bb,aw.W*0.5,aw.H*0.5,0,0,0,0,k,l,p);aw.X=bc[0];aw.Y=bc[1];$r=aw.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(ao.InAir){ax.VelX=ax.VelX+(f)>>0;ax.VelY=ax.VelY+(g)>>0;}am++;$s=1;continue;case 2:bd=c.PlayersArr;be=0;case 4:if(!(be=bd.$length)?($throwRuntimeError("index out of range"),undefined):bd.$array[bd.$offset+be]);bh=bg.JoinIndex;bi=131072+bh>>0;bk=(bj=e[$Int32.keyFor(bi)],bj!==undefined?bj.v:AP.nil);bl=$assertType(bk.Shape,AL);bn=W(bh,bk,bl,m,(bm=bh-1>>0,((bm<0||bm>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+bm])));$s=6;case 6:if($c){$c=false;bn=bn.$blk();}if(bn&&bn.$blk!==undefined){break s;}(bo=bh-1>>0,((bo<0||bo>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+bo]=bn));bp=((bf<0||bf>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+bf]);bq=false;br=bk.Check(0,0,new AG([]));$s=7;case 7:if($c){$c=false;br=br.$blk();}if(br&&br.$blk!==undefined){break s;}bs=br;if(!(AH.nil===bs)){$s=8;continue;}$s=9;continue;case 8:bt=bs.Objects;bu=0;case 10:if(!(bu=bt.$length)?($throwRuntimeError("index out of range"),undefined):bt.$array[bt.$offset+bu]);bw=false;bx=false;by=false;bz=bw;ca=bx;cb=by;cc=bv.Data;if($assertType(cc,AJ,true)[1]){ca=true;}else if($assertType(cc,AK,true)[1]){cb=true;}else{bz=true;}if(cb){bu++;$s=10;continue;}cd=$assertType(bv.Shape,AL);cf=N(0,0,bl,cd);$s=12;case 12:if($c){$c=false;cf=cf.$blk();}if(cf&&cf.$blk!==undefined){break s;}ce=cf;cg=ce[0];ch=ce[1];ci=ce[2];cj=ce[3];if(!cg){bu++;$s=10;continue;}ck=cj.OverlapX*0+cj.OverlapY*-1;if(ca){cl=(cj.Overlap-m*2)*cj.OverlapX;cm=(cj.Overlap-m*2)*cj.OverlapY;ch=cl;ci=cm;}cn=(co=bh-1>>0,((co<0||co>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+co])).$get();cp=0;while(true){if(!(cp=cn.$length)?($throwRuntimeError("index out of range"),undefined):cn.$array[cn.$offset+cp]),C);cr=ch*cq.X+ci*cq.Y;if(bz||(ca&&0>cr)){ch=ch-(cr*cq.X);ci=ci-(cr*cq.Y);}cp++;}cs=bh-1>>0;((cs<0||cs>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cs]).X=((cs<0||cs>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cs]).X+(ch);ct=bh-1>>0;((ct<0||ct>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+ct]).Y=((ct<0||ct>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+ct]).Y+(ci);if(n=cw.$length)?($throwRuntimeError("index out of range"),undefined):cw.$array[cw.$offset+cx]);da=cz.JoinIndex;db=131072+da>>0;dd=(dc=e[$Int32.keyFor(db)],dc!==undefined?dc.v:AP.nil);de=((cy<0||cy>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+cy]);df=U(dd.X-(dg=da-1>>0,((dg<0||dg>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dg])).X,dd.Y-(dh=da-1>>0,((dh<0||dh>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dh])).Y,dd.W*0.5,dd.H*0.5,0,0,0,0,k,l,o);de.VirtualGridX=df[0];de.VirtualGridY=df[1];cx++;}$s=-1;return new J.ptr(c.Id+1>>0,r,new $Int64(0,0),AQ.nil,new $Uint64(0,0),false);}return;}var $f={$blk:X,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=X;Y=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=S(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=Z(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:Y,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=Y;Z=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObject(a,b,c,d,new AG([f]));h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:Z,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AA=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=AB(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(AR.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new AR([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new AG([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:AA,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=AA;AB=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=AB;C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:AS,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:AT,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:AU,tag:""}]);I.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffset",name:"HitboxOffset",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Pushback",name:"Pushback",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderPlayerId",name:"OffenderPlayerId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfMoveforwardX",name:"SelfMoveforwardX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"SelfMoveforwardY",name:"SelfMoveforwardY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Float64,tag:""}]);J.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:AM,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:AQ,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""}]);M.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new AD([new AC([0,0]),new AC([0,2]),new AC([0,-2]),new AC([2,0]),new AC([-2,0]),new AC([1,1]),new AC([-1,-1]),new AC([1,-1]),new AC([-1,1])]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["resolv"]=(function(){var $pkg={},$init,A,B,C,N,P,Q,S,U,X,Z,AA,AE,AG,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,K,O,R,T,V,W,Y,AB,AC,AD,AF,AH;A=$packages["math"];B=$pkg.Vector=$newType(12,$kindSlice,"resolv.Vector",true,"resolv",true,null);C=$pkg.Axis=$newType(4,$kindInt,"resolv.Axis",true,"resolv",true,null);N=$pkg.Space=$newType(0,$kindStruct,"resolv.Space",true,"resolv",true,function(Cells_,CellWidth_,CellHeight_){this.$val=this;if(arguments.length===0){this.Cells=AL.nil;this.CellWidth=0;this.CellHeight=0;return;}this.Cells=Cells_;this.CellWidth=CellWidth_;this.CellHeight=CellHeight_;});P=$pkg.Shape=$newType(8,$kindInterface,"resolv.Shape",true,"resolv",true,null);Q=$pkg.Line=$newType(0,$kindStruct,"resolv.Line",true,"resolv",true,function(Start_,End_){this.$val=this;if(arguments.length===0){this.Start=B.nil;this.End=B.nil;return;}this.Start=Start_;this.End=End_;});S=$pkg.ConvexPolygon=$newType(0,$kindStruct,"resolv.ConvexPolygon",true,"resolv",true,function(Points_,X_,Y_,Closed_){this.$val=this;if(arguments.length===0){this.Points=AP.nil;this.X=0;this.Y=0;this.Closed=false;return;}this.Points=Points_;this.X=X_;this.Y=Y_;this.Closed=Closed_;});U=$pkg.ContactSet=$newType(0,$kindStruct,"resolv.ContactSet",true,"resolv",true,function(Points_,MTV_,Center_){this.$val=this;if(arguments.length===0){this.Points=AP.nil;this.MTV=B.nil;this.Center=B.nil;return;}this.Points=Points_;this.MTV=MTV_;this.Center=Center_;});X=$pkg.Circle=$newType(0,$kindStruct,"resolv.Circle",true,"resolv",true,function(X_,Y_,Radius_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Radius=0;return;}this.X=X_;this.Y=Y_;this.Radius=Radius_;});Z=$pkg.Projection=$newType(0,$kindStruct,"resolv.Projection",true,"resolv",true,function(Min_,Max_){this.$val=this;if(arguments.length===0){this.Min=0;this.Max=0;return;}this.Min=Min_;this.Max=Max_;});AA=$pkg.Object=$newType(0,$kindStruct,"resolv.Object",true,"resolv",true,function(Shape_,Space_,X_,Y_,W_,H_,TouchingCells_,Data_,ignoreList_,tags_){this.$val=this;if(arguments.length===0){this.Shape=$ifaceNil;this.Space=AM.nil;this.X=0;this.Y=0;this.W=0;this.H=0;this.TouchingCells=AK.nil;this.Data=$ifaceNil;this.ignoreList=false;this.tags=AV.nil;return;}this.Shape=Shape_;this.Space=Space_;this.X=X_;this.Y=Y_;this.W=W_;this.H=H_;this.TouchingCells=TouchingCells_;this.Data=Data_;this.ignoreList=ignoreList_;this.tags=tags_;});AE=$pkg.Collision=$newType(0,$kindStruct,"resolv.Collision",true,"resolv",true,function(checkingObject_,dx_,dy_,Objects_,Cells_){this.$val=this;if(arguments.length===0){this.checkingObject=AN.nil;this.dx=0;this.dy=0;this.Objects=AO.nil;this.Cells=AK.nil;return;}this.checkingObject=checkingObject_;this.dx=dx_;this.dy=dy_;this.Objects=Objects_;this.Cells=Cells_;});AG=$pkg.Cell=$newType(0,$kindStruct,"resolv.Cell",true,"resolv",true,function(X_,Y_,Objects_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Objects=AO.nil;return;}this.X=X_;this.Y=Y_;this.Objects=Objects_;});AI=$sliceType($Float64);AJ=$ptrType(AG);AK=$sliceType(AJ);AL=$sliceType(AK);AM=$ptrType(N);AN=$ptrType(AA);AO=$sliceType(AN);AP=$sliceType(B);AQ=$ptrType(Q);AR=$sliceType(AQ);AS=$ptrType(X);AT=$ptrType(S);AU=$ptrType(U);AV=$sliceType($String);AW=$ptrType(AE);AX=$sliceType(C);AY=$mapType(AN,$Bool);B.prototype.Clone=function(){var a,b;a=this;b=$makeSlice(B,a.$length);$copySlice(b,a);return b;};$ptrType(B).prototype.Clone=function(){return this.$get().Clone();};B.prototype.Add=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AC($convertSliceType(b,AI),1,$convertSliceType(b,AI),$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AI));}else{AC($convertSliceType(b,AI),1,$convertSliceType(b,AI),$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AI));}e++;}return b;};$ptrType(B).prototype.Add=function(a){return this.$get().Add(a);};B.prototype.Sub=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AC($convertSliceType(b,AI),-1,$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AI),$convertSliceType(b,AI));}else{AC($convertSliceType(b,AI),-1,$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AI),$convertSliceType(b,AI));}e++;}return b;};$ptrType(B).prototype.Sub=function(a){return this.$get().Sub(a);};B.prototype.Scale=function(a){var a,b;b=this;AD($convertSliceType(b,AI),a,$convertSliceType(b,AI));return b;};$ptrType(B).prototype.Scale=function(a){return this.$get().Scale(a);};B.prototype.Equal=function(a){var a,b,c,d,e;b=this;if(!((b.$length===a.$length))){return false;}c=b;d=0;while(true){if(!(d=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e])-((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]))>1e-08){return false;}d++;}return true;};$ptrType(B).prototype.Equal=function(a){return this.$get().Equal(a);};B.prototype.Magnitude=function(){var a;a=this;return A.Sqrt(a.Magnitude2());};$ptrType(B).prototype.Magnitude=function(){return this.$get().Magnitude();};B.prototype.Magnitude2=function(){var a,b,c,d,e;a=this;b=0;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=b+(e*e);d++;}return b;};$ptrType(B).prototype.Magnitude2=function(){return this.$get().Magnitude2();};B.prototype.Unit=function(){var a,b,c,d,e;a=this;b=a.Magnitude();if(b<1e-08){return a;}c=a;d=0;while(true){if(!(d=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]=((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e])/b);d++;}return a;};$ptrType(B).prototype.Unit=function(){return this.$get().Unit();};K=function(a,b){var a,b,c,d,e,f,g,h,i,j,k;c=0;d=a.$length;e=b.$length;f=c;g=d;h=e;if(g>h){b=$appendSlice(b,$convertSliceType($makeSlice(B,(g-h>>0)),AI));}if(g>0)),AI));}i=a;j=0;while(true){if(!(j=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+k])*((k<0||k>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+k]));j++;}return f;};$pkg.Dot=K;B.prototype.Dot=function(a){var a,b;b=this;return K(b,a);};$ptrType(B).prototype.Dot=function(a){return this.$get().Dot(a);};B.prototype.Cross=function(a){var a,b;b=this;if(!((b.$length===3))||!((a.$length===3))){return B.nil;}return new B([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]),(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])]);};$ptrType(B).prototype.Cross=function(a){return this.$get().Cross(a);};B.prototype.Rotate=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;c=this;d=2;e=c.$length;f=d;g=e;if(g===0){return c;}if(b.$length>0){f=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]);}if((g===1)&&!((f===2))){c=$append(c,0,0);}if((g<2&&(f===2))||((g===2)&&!((f===2)))){c=$append(c,0);}h=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);i=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);j=h;k=i;l=A.Cos(a);m=A.Sin(a);n=l;o=m;p=f;if(p===(0)){q=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=k*n-q*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=k*o+q*n);}else if(p===(1)){r=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n+r*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=-j*o+r*n);}else if(p===(2)){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n-k*o);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=j*o+k*n);}if(g>3){return $subslice(c,0,3);}return c;};$ptrType(B).prototype.Rotate=function(a,b){return this.$get().Rotate(a,b);};B.prototype.X=function(){var a;a=this;if(a.$length<1){return 0;}return(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);};$ptrType(B).prototype.X=function(){return this.$get().X();};B.prototype.Y=function(){var a;a=this;if(a.$length<2){return 0;}return(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);};$ptrType(B).prototype.Y=function(){return this.$get().Y();};B.prototype.Z=function(){var a;a=this;if(a.$length<3){return 0;}return(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]);};$ptrType(B).prototype.Z=function(){return this.$get().Z();};O=function(a,b,c,d){var a,b,c,d,e,f,g;e=new N.ptr(AL.nil,c,d);e.Resize((f=a/c,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero")),(g=b/d,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero")));return e;};$pkg.NewSpace=O;N.ptr.prototype.Add=function(a){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(b===AM.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);e.Space=b;$r=e.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d++;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:N.ptr.prototype.Add,$c:true,$r,a,b,c,d,e,$s};return $f;};N.prototype.Add=function(a){return this.$val.Add(a);};N.ptr.prototype.Remove=function(a){var a,b,c,d,e,f,g,h;b=this;if(b===AM.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=e.TouchingCells;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);h.unregister(e);g++;}e.TouchingCells=new AK([]);e.Space=AM.nil;d++;}};N.prototype.Remove=function(a){return this.$val.Remove(a);};N.ptr.prototype.Objects=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;a=this;b=$makeMap(AN.keyFor,[]);c=new AO([]);d=a.Cells;e=0;while(true){if(!(e=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+f]));i=0;while(true){if(!(i=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+f])),((j<0||j>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+j])).Objects;n=0;while(true){if(!(n=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+n]);p=(q=b[AN.keyFor(o)],q!==undefined?[q.v,true]:[false,false]);r=p[1];if(!r){c=$append(c,o);s=o;(b||$throwRuntimeError("assignment to entry in nil map"))[AN.keyFor(s)]={k:s,v:true};}n++;}i++;}e++;}return c;};N.prototype.Objects=function(){return this.$val.Objects();};N.ptr.prototype.Resize=function(a,b){var a,b,c,d,e,f,g;c=this;c.Cells=new AL([]);d=0;while(true){if(!(d=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+d]=$append((f=c.Cells,((d<0||d>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+d])),AH(e,d))));e=e+(1)>>0;}d=d+(1)>>0;}};N.prototype.Resize=function(a,b){return this.$val.Resize(a,b);};N.ptr.prototype.Cell=function(a,b){var a,b,c,d,e,f;c=this;if(b>=0&&b=0&&a<(d=c.Cells,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length){return(e=(f=c.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((a<0||a>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+a]));}return AJ.nil;};N.prototype.Cell=function(a,b){return this.$val.Cell(a,b);};N.ptr.prototype.CheckCells=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l,m;f=this;g=a;while(true){if(!(g<(a+c>>0))){break;}h=b;while(true){if(!(h<(b+d>>0))){break;}i=f.Cell(g,h);if(!(i===AJ.nil)){if(e.$length>0){if(i.ContainsTags(e)){j=i.Objects;k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);if(l.HasTags(e)){return l;}k++;}}}else if(i.Occupied()){return(m=i.Objects,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]));}}h=h+(1)>>0;}g=g+(1)>>0;}return AN.nil;};N.prototype.CheckCells=function(a,b,c,d,e){return this.$val.CheckCells(a,b,c,d,e);};N.ptr.prototype.CheckCellsWorld=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l;f=this;g=f.WorldToSpace(a,b);h=g[0];i=g[1];j=f.WorldToSpace(c,d);k=j[0];l=j[1];return f.CheckCells(h,i,k,l,e);};N.prototype.CheckCellsWorld=function(a,b,c,d,e){return this.$val.CheckCellsWorld(a,b,c,d,e);};N.ptr.prototype.UnregisterAllObjects=function(){var a,b,c,d,e,f,g;a=this;b=0;while(true){if(!(b=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length)){break;}g=(e=(f=a.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((c<0||c>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+c]));a.Remove(g.Objects);c=c+(1)>>0;}b=b+(1)>>0;}};N.prototype.UnregisterAllObjects=function(){return this.$val.UnregisterAllObjects();};N.ptr.prototype.WorldToSpace=function(a,b){var a,b,c,d,e;c=this;d=((A.Floor(a/(c.CellWidth))>>0));e=((A.Floor(b/(c.CellHeight))>>0));return[d,e];};N.prototype.WorldToSpace=function(a,b){return this.$val.WorldToSpace(a,b);};N.ptr.prototype.SpaceToWorld=function(a,b){var a,b,c,d,e;c=this;d=(($imul(a,c.CellWidth)));e=(($imul(b,c.CellHeight)));return[d,e];};N.prototype.SpaceToWorld=function(a,b){return this.$val.SpaceToWorld(a,b);};N.ptr.prototype.Height=function(){var a;a=this;return a.Cells.$length;};N.prototype.Height=function(){return this.$val.Height();};N.ptr.prototype.Width=function(){var a,b;a=this;if(a.Cells.$length>0){return(b=a.Cells,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])).$length;}return 0;};N.prototype.Width=function(){return this.$val.Width();};N.ptr.prototype.CellsInLine=function(a,b,c,d){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;e=this;f=new AK([]);g=e.Cell(a,b);h=e.Cell(c,d);if(!(g===AJ.nil)&&!(h===AJ.nil)){i=new B([((c-a>>0)),((d-b>>0))]).Unit();(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]=(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])*(((j=e.CellWidth/2,(j===j&&j!==1/0&&j!==-1/0)?j>>0:$throwRuntimeError("integer divide by zero")))));(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]=(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])*(((k=e.CellHeight/2,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero")))));l=e.SpaceToWorld(a,b);m=l[0];n=l[1];q=new B([m+((o=e.CellWidth/2,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero"))),n+((p=e.CellHeight/2,(p===p&&p!==1/0&&p!==-1/0)?p>>0:$throwRuntimeError("integer divide by zero")))]);r=false;while(true){if(!(!(g===AJ.nil))){break;}if(g===h){f=$append(f,g);break;}f=$append(f,g);if(r){(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]=(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1])+((1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])));}else{(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])+((0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])));}s=e.WorldToSpace((0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]),(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]));t=s[0];u=s[1];v=e.Cell(t,u);if(!(v===g)){g=v;}r=!r;}}return f;};N.prototype.CellsInLine=function(a,b,c,d){return this.$val.CellsInLine(a,b,c,d);};R=function(a,b,c,d){var a,b,c,d;return new Q.ptr(new B([a,b]),new B([c,d]));};$pkg.NewLine=R;Q.ptr.prototype.Project=function(a){var a,b;b=this;return b.Vector().Scale(a.Dot(b.Start.Sub(new AP([b.End]))));};Q.prototype.Project=function(a){return this.$val.Project(a);};Q.ptr.prototype.Normal=function(){var a,b;a=this;b=a.Vector();return new B([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]),-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])]).Unit();};Q.prototype.Normal=function(){return this.$val.Normal();};Q.ptr.prototype.Vector=function(){var a;a=this;return a.End.Clone().Sub(new AP([a.Start])).Unit();};Q.prototype.Vector=function(){return this.$val.Vector();};Q.ptr.prototype.IntersectionPointsLine=function(a){var a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=this;k=((c=b.End,(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]))-(d=b.Start,(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])))*((e=a.End,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(f=a.Start,(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])))-((g=a.End,(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]))-(h=a.Start,(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])))*((i=b.End,(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]))-(j=b.Start,(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1])));if(!((k===0))){t=((((l=b.Start,(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))-(m=a.Start,(1>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+1])))*((n=a.End,(0>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0]))-(o=a.Start,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))))-(((p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))-(q=a.Start,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])))*((r=a.End,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))-(s=a.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))))+1)/k;ac=((((u=b.Start,(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]))-(v=a.Start,(1>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+1])))*((w=b.End,(0>=w.$length?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+0]))-(x=b.Start,(0>=x.$length?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+0]))))-(((y=b.Start,(0>=y.$length?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+0]))-(z=a.Start,(0>=z.$length?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+0])))*((aa=b.End,(1>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+1]))-(ab=b.Start,(1>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+1]))))+1)/k;if((0=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+0]))-(ae=b.Start,(0>=ae.$length?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+0]));ai=(ag=b.End,(1>=ag.$length?($throwRuntimeError("index out of range"),undefined):ag.$array[ag.$offset+1]))-(ah=b.Start,(1>=ah.$length?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+1]));return new B([(aj=b.Start,(0>=aj.$length?($throwRuntimeError("index out of range"),undefined):aj.$array[aj.$offset+0]))+(t*af),(ak=b.Start,(1>=ak.$length?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+1]))+(t*ai)]);}}return B.nil;};Q.prototype.IntersectionPointsLine=function(a){return this.$val.IntersectionPointsLine(a);};Q.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;b=this;c=new AP([]);d=new B([a.X,a.Y]);e=b.Start.Sub(new AP([d]));f=b.End.Sub(new AP([d]));g=f.Sub(new AP([e]));h=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])+(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]);i=2*(((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])));j=((0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(a.Radius*a.Radius);k=i*i-(4*h*j);if(k<0){}else if(k===0){l=-i/(2*h);if(l>=0&&l<=1){c=$append(c,new B([(m=b.Start,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]))+l*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(n=b.Start,(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1]))+l*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}else{o=(-i+A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new B([(p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(q=b.Start,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}o=(-i-A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new B([(r=b.Start,(0>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(s=b.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}return c;};Q.prototype.IntersectionPointsCircle=function(a){return this.$val.IntersectionPointsCircle(a);};T=function(a){var a,b;b=new S.ptr(new AP([]),0,0,true);b.AddPoints(a);return b;};$pkg.NewConvexPolygon=T;S.ptr.prototype.Clone=function(){var a,b,c,d,e,f;a=this;b=new AP([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Clone());d++;}f=T(AI.nil);f.X=a.X;f.Y=a.Y;f.AddPointsVec(b);f.Closed=a.Closed;return f;};S.prototype.Clone=function(){return this.$val.Clone();};S.ptr.prototype.AddPointsVec=function(a){var a,b;b=this;b.Points=$appendSlice(b.Points,a);};S.prototype.AddPointsVec=function(a){return this.$val.AddPointsVec(a);};S.ptr.prototype.AddPoints=function(a){var a,b,c,d;b=this;c=0;while(true){if(!(c=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+c]),(d=c+1>>0,((d<0||d>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+d]))]));c=c+(2)>>0;}};S.prototype.AddPoints=function(a){return this.$val.AddPoints(a);};S.ptr.prototype.Lines=function(){var a,b,c,d,e,f,g,h,i,j;a=this;b=new AR([]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);g=e;h=f;if(d<(c.$length-1>>0)){h=(i=d+1>>0,((i<0||i>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+i]));}else if(!a.Closed){break;}j=R((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));b=$append(b,j);d=d+(1)>>0;}return b;};S.prototype.Lines=function(){return this.$val.Lines();};S.ptr.prototype.Transformed=function(){var a,b,c,d,e;a=this;b=new AP([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,new B([(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])+a.X,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])+a.Y]));d++;}return b;};S.prototype.Transformed=function(){return this.$val.Transformed();};S.ptr.prototype.Bounds=function(){var a,b,c,d,e,f,g,h;a=this;b=a.Transformed();e=new B([(c=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])),(d=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]))]);f=e.Clone();g=0;while(true){if(!(g=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+g]);if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])<(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])){(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}else if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])>(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0])){(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])<(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])){(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}else if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])>(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])){(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}g=g+(1)>>0;}return[e,f];};S.prototype.Bounds=function(){return this.$val.Bounds();};S.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};S.prototype.Position=function(){return this.$val.Position();};S.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};S.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};S.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};S.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};S.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};S.prototype.Move=function(a,b){return this.$val.Move(a,b);};S.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};S.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};S.ptr.prototype.Center=function(){var a,b,c,d,e;a=this;b=new B([0,0]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b.Add(new AP([e]));d++;}(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])/((a.Transformed().$length)));(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])/((a.Transformed().$length)));return b;};S.prototype.Center=function(){return this.$val.Center();};S.ptr.prototype.Project=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=this;a=a.Unit();c=b.Transformed();f=a.Dot(new B([(d=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])),(e=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))]));g=f;h=1;while(true){if(!(h=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(j=((h<0||h>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1]))]));if(kg){g=k;}h=h+(1)>>0;}return new Z.ptr(f,g);};S.prototype.Project=function(a){return this.$val.Project(a);};S.ptr.prototype.SATAxes=function(){var a,b,c,d,e;a=this;b=new AP([]);c=a.Lines();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Normal());d++;}return b;};S.prototype.SATAxes=function(){return this.$val.SATAxes();};S.ptr.prototype.PointInside=function(a){var a,b,c,d,e,f,g;b=this;c=R((0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]),(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])+9.99999999999e+11,(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]));d=0;e=b.Lines();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!(g.IntersectionPointsLine(c)===B.nil)){d=d+(1)>>0;}f++;}return d===1;};S.prototype.PointInside=function(a){return this.$val.PointInside(a);};V=function(){return new U.ptr(new AP([]),new B([0,0]),new B([0,0]));};$pkg.NewContactSet=V;U.ptr.prototype.LeftmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])<(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};U.prototype.LeftmostPoint=function(){return this.$val.LeftmostPoint();};U.ptr.prototype.RightmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])>(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};U.prototype.RightmostPoint=function(){return this.$val.RightmostPoint();};U.ptr.prototype.TopmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])<(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};U.prototype.TopmostPoint=function(){return this.$val.TopmostPoint();};U.ptr.prototype.BottommostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])>(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};U.prototype.BottommostPoint=function(){return this.$val.BottommostPoint();};S.ptr.prototype.Intersection=function(a,b,c){var a,aa,ab,ac,ad,ae,af,ag,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=this;e=V();f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=$assertType(c,AS,true);i=h[0];j=h[1];if(j){k=d.Lines();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);e.Points=$appendSlice(e.Points,m.IntersectionPointsCircle(i));l++;}}else{n=$assertType(c,AT,true);o=n[0];p=n[1];if(p){q=d.Lines();r=0;while(true){if(!(r=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=o.Lines();u=0;while(true){if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);w=s.IntersectionPointsLine(v);if(!(w===B.nil)){e.Points=$append(e.Points,w);}u++;}r++;}}}if(e.Points.$length>0){x=e.Points;y=0;while(true){if(!(y=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+y]);e.Center=e.Center.Add(new AP([z]));y++;}(ab=e.Center,(0>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0]=(aa=e.Center,(0>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+0]))/((e.Points.$length))));(ad=e.Center,(1>=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+1]=(ac=e.Center,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))/((e.Points.$length))));ae=d.calculateMTV(e,c);if(!(ae===B.nil)){e.MTV=ae;}}else{e=AU.nil;}if(!(e===AU.nil)&&(!((a===0))||!((b===0)))){af=new B([a,b]).Magnitude();ag=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(ag-af);}d.X=f;d.Y=g;return e;};S.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};S.ptr.prototype.calculateMTV=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;c=this;d=new B([0,0]);e=new B([1.7976931348623157e+308,0]);f=b;if($assertType(f,AT,true)[1]){g=f.$val;h=c.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(c.Project(j),Z).Overlapping($clone(g.Project(j),Z))){return B.nil;}k=$clone(c.Project(j),Z).Overlap($clone(g.Project(j),Z));if(e.Magnitude()>k){e=j.Scale(k);}i++;}l=g.SATAxes();m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);if(!$clone(c.Project(n),Z).Overlapping($clone(g.Project(n),Z))){return B.nil;}o=$clone(c.Project(n),Z).Overlap($clone(g.Project(n),Z));if(e.Magnitude()>o){e=n.Scale(o);}m++;}}(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]));return d;};S.prototype.calculateMTV=function(a,b){return this.$val.calculateMTV(a,b);};S.ptr.prototype.ContainedBy=function(a){var a,b,c,d,e,f,g,h,i,j;b=this;c=a;if($assertType(c,AT,true)[1]){d=c.$val;e=b.SATAxes();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!$clone(b.Project(g),Z).IsInside($clone(d.Project(g),Z))){return false;}f++;}h=d.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(b.Project(j),Z).IsInside($clone(d.Project(j),Z))){return false;}i++;}}return true;};S.prototype.ContainedBy=function(a){return this.$val.ContainedBy(a);};S.ptr.prototype.FlipH=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=-(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]));c++;}a.ReverseVertexOrder();};S.prototype.FlipH=function(){return this.$val.FlipH();};S.ptr.prototype.FlipV=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=-(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]));c++;}a.ReverseVertexOrder();};S.prototype.FlipV=function(){return this.$val.FlipV();};S.ptr.prototype.ReverseVertexOrder=function(){var a,b,c,d,e;a=this;c=new AP([(b=a.Points,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]))]);d=a.Points.$length-1>>0;while(true){if(!(d>=1)){break;}c=$append(c,(e=a.Points,((d<0||d>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+d])));d=d-(1)>>0;}a.Points=c;};S.prototype.ReverseVertexOrder=function(){return this.$val.ReverseVertexOrder();};W=function(a,b,c,d){var a,b,c,d;return T(new AI([a,b,a+c,b,a+c,b+d,a,b+d]));};$pkg.NewRectangle=W;Y=function(a,b,c){var a,b,c,d;d=new X.ptr(a,b,c);return d;};$pkg.NewCircle=Y;X.ptr.prototype.Clone=function(){var a;a=this;return Y(a.X,a.Y,a.Radius);};X.prototype.Clone=function(){return this.$val.Clone();};X.ptr.prototype.Bounds=function(){var a;a=this;return[new B([a.X-a.Radius,a.Y-a.Radius]),new B([a.X+a.Radius,a.Y+a.Radius])];};X.prototype.Bounds=function(){return this.$val.Bounds();};X.ptr.prototype.Intersection=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;d=this;e=AU.nil;f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=c;if($assertType(h,AT,true)[1]){i=h.$val;e=i.Intersection(-a,-b,d);if(!(e===AU.nil)){e.MTV=e.MTV.Scale(-1);}}else if($assertType(h,AS,true)[1]){j=h.$val;e=V();e.Points=d.IntersectionPointsCircle(j);if(e.Points.$length===0){return AU.nil;}e.MTV=new B([d.X-j.X,d.Y-j.Y]);k=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(d.Radius+j.Radius-k);l=e.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);e.Center=e.Center.Add(new AP([n]));m++;}(p=e.Center,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]=(o=e.Center,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))/((e.Points.$length))));(r=e.Center,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]=(q=e.Center,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))/((e.Points.$length))));}d.X=f;d.Y=g;return e;};X.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};X.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};X.prototype.Move=function(a,b){return this.$val.Move(a,b);};X.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};X.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};X.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};X.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};X.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};X.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};X.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};X.prototype.Position=function(){return this.$val.Position();};X.ptr.prototype.PointInside=function(a){var a,b;b=this;return a.Sub(new AP([new B([b.X,b.Y])])).Magnitude()<=b.Radius;};X.prototype.PointInside=function(a){return this.$val.PointInside(a);};X.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g;b=this;c=A.Sqrt(A.Pow(a.X-b.X,2)+A.Pow(a.Y-b.Y,2));if(c>b.Radius+a.Radius||c0;};Z.prototype.Overlapping=function(a){return this.$val.Overlapping(a);};Z.ptr.prototype.Overlap=function(a){var a,b;b=this;return A.Min(b.Max,a.Max)-A.Max(b.Min,a.Min);};Z.prototype.Overlap=function(a){return this.$val.Overlap(a);};Z.ptr.prototype.IsInside=function(a){var a,b;b=this;return b.Min>=a.Min&&b.Max<=a.Max;};Z.prototype.IsInside=function(a){return this.$val.IsInside(a);};AB=function(a,b,c,d,e){var a,b,c,d,e,f;f=new AA.ptr($ifaceNil,AM.nil,a,b,c,d,AK.nil,$ifaceNil,$makeMap(AN.keyFor,[]),new AV([]));if(e.$length>0){f.AddTags(e);}return f;};$pkg.NewObject=AB;AA.ptr.prototype.Clone=function(){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=this;b=AB(a.X,a.Y,a.W,a.H,a.Tags());b.Data=a.Data;if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:c=a.Shape.Clone();$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$r=b.SetShape(c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:d=a.ignoreList;e=0;f=$keys(d);while(true){if(!(e>0;}h=h+(1)>>0;}}if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:$r=a.Shape.SetPosition(a.X,a.Y);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AA.ptr.prototype.Update,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};AA.prototype.Update=function(){return this.$val.Update();};AA.ptr.prototype.AddTags=function(a){var a,b;b=this;b.tags=$appendSlice(b.tags,a);};AA.prototype.AddTags=function(a){return this.$val.AddTags(a);};AA.ptr.prototype.RemoveTags=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(i===e){b.tags=$appendSlice($subslice(b.tags,0,h),$subslice(b.tags,(h+1>>0)));break;}g++;}d++;}};AA.prototype.RemoveTags=function(a){return this.$val.RemoveTags(a);};AA.ptr.prototype.HasTags=function(a){var a,b,c,d,e,f,g,h;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return true;}g++;}d++;}return false;};AA.prototype.HasTags=function(a){return this.$val.HasTags(a);};AA.ptr.prototype.Tags=function(){var a;a=this;return $appendSlice(new AV([]),a.tags);};AA.prototype.Tags=function(){return this.$val.Tags();};AA.ptr.prototype.SetShape=function(a){var{a,b,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(!($interfaceIsEqual(b.Shape,a))){$s=1;continue;}$s=2;continue;case 1:b.Shape=a;$r=b.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AA.ptr.prototype.SetShape,$c:true,$r,a,b,$s};return $f;};AA.prototype.SetShape=function(a){return this.$val.SetShape(a);};AA.ptr.prototype.BoundsToSpace=function(a,b){var a,b,c,d,e,f,g,h,i;c=this;d=c.Space.WorldToSpace(c.X+a,c.Y+b);e=d[0];f=d[1];g=c.Space.WorldToSpace(c.X+c.W+a-1,c.Y+c.H+b-1);h=g[0];i=g[1];return[e,f,h,i];};AA.prototype.BoundsToSpace=function(a,b){return this.$val.BoundsToSpace(a,b);};AA.ptr.prototype.SharesCells=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.Contains(a)){return true;}d++;}return false;};AA.prototype.SharesCells=function(a){return this.$val.SharesCells(a);};AA.ptr.prototype.SharesCellsTags=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.ContainsTags(a)){return true;}d++;}return false;};AA.prototype.SharesCellsTags=function(a){return this.$val.SharesCellsTags(a);};AA.ptr.prototype.Center=function(){var a;a=this;return[a.X+(a.W/2),a.Y+(a.H/2)];};AA.prototype.Center=function(){return this.$val.Center();};AA.ptr.prototype.SetCenter=function(a,b){var a,b,c;c=this;c.X=a-(c.W/2);c.Y=b-(c.H/2);};AA.prototype.SetCenter=function(a,b){return this.$val.SetCenter(a,b);};AA.ptr.prototype.CellPosition=function(){var a,b;a=this;b=a.Center();return a.Space.WorldToSpace(b[0],b[1]);};AA.prototype.CellPosition=function(){return this.$val.CellPosition();};AA.ptr.prototype.SetRight=function(a){var a,b;b=this;b.X=a-b.W;};AA.prototype.SetRight=function(a){return this.$val.SetRight(a);};AA.ptr.prototype.SetBottom=function(a){var a,b;b=this;b.Y=a-b.H;};AA.prototype.SetBottom=function(a){return this.$val.SetBottom(a);};AA.ptr.prototype.Bottom=function(){var a;a=this;return a.Y+a.H;};AA.prototype.Bottom=function(){return this.$val.Bottom();};AA.ptr.prototype.Right=function(){var a;a=this;return a.X+a.W;};AA.prototype.Right=function(){return this.$val.Right();};AA.ptr.prototype.SetBounds=function(a,b){var a,b,c;c=this;c.X=(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);c.Y=(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);c.W=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])-c.X;c.H=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])-c.Y;};AA.prototype.SetBounds=function(a,b){return this.$val.SetBounds(a,b);};AA.ptr.prototype.Check=function(a,b,c){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=this;if(d.Space===AM.nil){return AW.nil;}e=AF();e.checkingObject=d;if(a<0){a=A.Min(a,-1);}else if(a>0){a=A.Max(a,1);}if(b<0){b=A.Min(b,-1);}else if(b>0){b=A.Max(b,1);}e.dx=a;e.dy=b;f=d.BoundsToSpace(a,b);g=f[0];h=f[1];i=f[2];j=f[3];k=$makeMap(AN.keyFor,[]);l=$makeMap(AJ.keyFor,[]);m=h;while(true){if(!(m<=j)){break;}n=g;while(true){if(!(n<=i)){break;}o=d.Space.Cell(n,m);if(!(o===AJ.nil)){p=o.Objects;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);t=(s=d.ignoreList[AN.keyFor(r)],s!==undefined?s.v:false);if(r===d||t){q++;continue;}u=(v=k[AN.keyFor(r)],v!==undefined?[v.v,true]:[false,false]);w=u[1];if(((c.$length===0)||r.HasTags(c))&&!w){e.Objects=$append(e.Objects,r);x=r;(k||$throwRuntimeError("assignment to entry in nil map"))[AN.keyFor(x)]={k:x,v:true};y=(z=l[AJ.keyFor(o)],z!==undefined?[z.v,true]:[false,false]);aa=y[1];if(!aa){e.Cells=$append(e.Cells,o);ab=o;(l||$throwRuntimeError("assignment to entry in nil map"))[AJ.keyFor(ab)]={k:ab,v:true};}q++;continue;}q++;}}n=n+(1)>>0;}m=m+(1)>>0;}if(e.Objects.$length===0){return AW.nil;}return e;};AA.prototype.Check=function(a,b,c){return this.$val.Check(a,b,c);};AA.ptr.prototype.Overlaps=function(a){var a,b;b=this;return a.X<=b.X+b.W&&a.X+a.W>=b.X&&a.Y<=b.Y+b.H&&a.Y+a.H>=b.Y;};AA.prototype.Overlaps=function(a){return this.$val.Overlaps(a);};AA.ptr.prototype.AddToIgnoreList=function(a){var a,b,c;b=this;c=a;(b.ignoreList||$throwRuntimeError("assignment to entry in nil map"))[AN.keyFor(c)]={k:c,v:true};};AA.prototype.AddToIgnoreList=function(a){return this.$val.AddToIgnoreList(a);};AA.ptr.prototype.RemoveFromIgnoreList=function(a){var a,b;b=this;delete b.ignoreList[AN.keyFor(a)];};AA.prototype.RemoveFromIgnoreList=function(a){return this.$val.RemoveFromIgnoreList(a);};AC=function(a,b,c,d){var a,b,c,d,e,f,g,h,i;e=d.$length;f=c;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return;}((h<0||h>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+h]=b*i+((h<0||h>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+h]));g++;}};AD=function(a,b,c){var a,b,c,d,e,f;d=c;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]=((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f])*(b));e++;}};AF=function(){return new AE.ptr(AN.nil,0,0,new AO([]),AK.nil);};$pkg.NewCollision=AF;AE.ptr.prototype.HasTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===b.checkingObject){d++;continue;}if(e.HasTags(a)){return true;}d++;}return false;};AE.prototype.HasTags=function(a){return this.$val.HasTags(a);};AE.ptr.prototype.ObjectsByTags=function(a){var a,b,c,d,e,f;b=this;c=new AO([]);d=b.Objects;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);if(f===b.checkingObject){e++;continue;}if(f.HasTags(a)){c=$append(c,f);}e++;}return c;};AE.prototype.ObjectsByTags=function(a){return this.$val.ObjectsByTags(a);};AE.ptr.prototype.ContactWithObject=function(a){var a,b,c;b=this;c=new B([0,0]);if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X+a.W-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y+a.H-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y-b.checkingObject.H-b.checkingObject.Y);}return c;};AE.prototype.ContactWithObject=function(a){return this.$val.ContactWithObject(a);};AE.ptr.prototype.ContactWithCell=function(a){var a,b,c,d,e;b=this;c=new B([0,0]);d=(($imul(a.X,b.checkingObject.Space.CellWidth)));e=(($imul(a.Y,b.checkingObject.Space.CellHeight)));if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d+(b.checkingObject.Space.CellWidth)-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e+(b.checkingObject.Space.CellHeight)-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e-b.checkingObject.H-b.checkingObject.Y);}return c;};AE.prototype.ContactWithCell=function(a){return this.$val.ContactWithCell(a);};AE.ptr.prototype.SlideAgainstCell=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;c=this;d=c.checkingObject.Space;f=(e=c.Cells,(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));g=d.SpaceToWorld(f.X,f.Y);h=g[0];i=g[1];j=(d.CellWidth)/2;k=(d.CellHeight)/2;h=h+(j);i=i+(k);l=c.checkingObject.Center();m=l[0];n=l[1];o=m-h;p=n-i;q=d.Cell(f.X-1>>0,f.Y);r=d.Cell(f.X+1>>0,f.Y);s=d.Cell(f.X,f.Y-1>>0);t=d.Cell(f.X,f.Y+1>>0);u=new B([0,0]);if(!((c.dy===0))){if(o>0&&(r===AJ.nil||!r.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h+j-c.checkingObject.X);}else if(o<0&&(q===AJ.nil||!q.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h-j-(c.checkingObject.X+c.checkingObject.W));}else{return B.nil;}}if(!((c.dx===0))){if(p>0&&(t===AJ.nil||!t.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i+k-c.checkingObject.Y);}else if(p<0&&(s===AJ.nil||!s.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i-k-(c.checkingObject.Y+c.checkingObject.H));}else{return B.nil;}}return u;};AE.prototype.SlideAgainstCell=function(a,b){return this.$val.SlideAgainstCell(a,b);};AH=function(a,b){var a,b;return new AG.ptr(a,b,new AO([]));};AG.ptr.prototype.register=function(a){var a,b;b=this;if(!b.Contains(a)){b.Objects=$append(b.Objects,a);}};AG.prototype.register=function(a){return this.$val.register(a);};AG.ptr.prototype.unregister=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(f===a){(i=b.Objects,((e<0||e>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+e]=(g=b.Objects,h=b.Objects.$length-1>>0,((h<0||h>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]))));b.Objects=$subslice(b.Objects,0,(b.Objects.$length-1>>0));break;}d++;}};AG.prototype.unregister=function(a){return this.$val.unregister(a);};AG.ptr.prototype.Contains=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===a){return true;}d++;}return false;};AG.prototype.Contains=function(a){return this.$val.Contains(a);};AG.ptr.prototype.ContainsTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.HasTags(a)){return true;}d++;}return false;};AG.prototype.ContainsTags=function(a){return this.$val.ContainsTags(a);};AG.ptr.prototype.Occupied=function(){var a;a=this;return a.Objects.$length>0;};AG.prototype.Occupied=function(){return this.$val.Occupied();};B.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[B],false)},{prop:"Add",name:"Add",pkg:"",typ:$funcType([AP],[B],true)},{prop:"Sub",name:"Sub",pkg:"",typ:$funcType([AP],[B],true)},{prop:"Scale",name:"Scale",pkg:"",typ:$funcType([$Float64],[B],false)},{prop:"Equal",name:"Equal",pkg:"",typ:$funcType([B],[$Bool],false)},{prop:"Magnitude",name:"Magnitude",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Magnitude2",name:"Magnitude2",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Unit",name:"Unit",pkg:"",typ:$funcType([],[B],false)},{prop:"Dot",name:"Dot",pkg:"",typ:$funcType([B],[$Float64],false)},{prop:"Cross",name:"Cross",pkg:"",typ:$funcType([B],[B],false)},{prop:"Rotate",name:"Rotate",pkg:"",typ:$funcType([$Float64,AX],[B],true)},{prop:"X",name:"X",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Y",name:"Y",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Z",name:"Z",pkg:"",typ:$funcType([],[$Float64],false)}];AM.methods=[{prop:"Add",name:"Add",pkg:"",typ:$funcType([AO],[],true)},{prop:"Remove",name:"Remove",pkg:"",typ:$funcType([AO],[],true)},{prop:"Objects",name:"Objects",pkg:"",typ:$funcType([],[AO],false)},{prop:"Resize",name:"Resize",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Cell",name:"Cell",pkg:"",typ:$funcType([$Int,$Int],[AJ],false)},{prop:"CheckCells",name:"CheckCells",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int,AV],[AN],true)},{prop:"CheckCellsWorld",name:"CheckCellsWorld",pkg:"",typ:$funcType([$Float64,$Float64,$Float64,$Float64,AV],[AN],true)},{prop:"UnregisterAllObjects",name:"UnregisterAllObjects",pkg:"",typ:$funcType([],[],false)},{prop:"WorldToSpace",name:"WorldToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int],false)},{prop:"SpaceToWorld",name:"SpaceToWorld",pkg:"",typ:$funcType([$Int,$Int],[$Float64,$Float64],false)},{prop:"Height",name:"Height",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int],false)},{prop:"CellsInLine",name:"CellsInLine",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int],[AK],false)}];AQ.methods=[{prop:"Project",name:"Project",pkg:"",typ:$funcType([B],[B],false)},{prop:"Normal",name:"Normal",pkg:"",typ:$funcType([],[B],false)},{prop:"Vector",name:"Vector",pkg:"",typ:$funcType([],[B],false)},{prop:"IntersectionPointsLine",name:"IntersectionPointsLine",pkg:"",typ:$funcType([AQ],[B],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AS],[AP],false)}];AT.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[P],false)},{prop:"AddPointsVec",name:"AddPointsVec",pkg:"",typ:$funcType([AP],[],true)},{prop:"AddPoints",name:"AddPoints",pkg:"",typ:$funcType([AI],[],true)},{prop:"Lines",name:"Lines",pkg:"",typ:$funcType([],[AR],false)},{prop:"Transformed",name:"Transformed",pkg:"",typ:$funcType([],[AP],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B,B],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([B],[],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([B],[],false)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[B],false)},{prop:"Project",name:"Project",pkg:"",typ:$funcType([B],[Z],false)},{prop:"SATAxes",name:"SATAxes",pkg:"",typ:$funcType([],[AP],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([B],[$Bool],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,P],[AU],false)},{prop:"calculateMTV",name:"calculateMTV",pkg:"resolv",typ:$funcType([AU,P],[B],false)},{prop:"ContainedBy",name:"ContainedBy",pkg:"",typ:$funcType([P],[$Bool],false)},{prop:"FlipH",name:"FlipH",pkg:"",typ:$funcType([],[],false)},{prop:"FlipV",name:"FlipV",pkg:"",typ:$funcType([],[],false)},{prop:"ReverseVertexOrder",name:"ReverseVertexOrder",pkg:"",typ:$funcType([],[],false)}];AU.methods=[{prop:"LeftmostPoint",name:"LeftmostPoint",pkg:"",typ:$funcType([],[B],false)},{prop:"RightmostPoint",name:"RightmostPoint",pkg:"",typ:$funcType([],[B],false)},{prop:"TopmostPoint",name:"TopmostPoint",pkg:"",typ:$funcType([],[B],false)},{prop:"BottommostPoint",name:"BottommostPoint",pkg:"",typ:$funcType([],[B],false)}];AS.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[P],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B,B],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,P],[AU],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([B],[],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([B],[],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([B],[$Bool],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AS],[AP],false)}];Z.methods=[{prop:"Overlapping",name:"Overlapping",pkg:"",typ:$funcType([Z],[$Bool],false)},{prop:"Overlap",name:"Overlap",pkg:"",typ:$funcType([Z],[$Float64],false)},{prop:"IsInside",name:"IsInside",pkg:"",typ:$funcType([Z],[$Bool],false)}];AN.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[AN],false)},{prop:"Update",name:"Update",pkg:"",typ:$funcType([],[],false)},{prop:"AddTags",name:"AddTags",pkg:"",typ:$funcType([AV],[],true)},{prop:"RemoveTags",name:"RemoveTags",pkg:"",typ:$funcType([AV],[],true)},{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"Tags",name:"Tags",pkg:"",typ:$funcType([],[AV],false)},{prop:"SetShape",name:"SetShape",pkg:"",typ:$funcType([P],[],false)},{prop:"BoundsToSpace",name:"BoundsToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int,$Int,$Int],false)},{prop:"SharesCells",name:"SharesCells",pkg:"",typ:$funcType([AN],[$Bool],false)},{prop:"SharesCellsTags",name:"SharesCellsTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetCenter",name:"SetCenter",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"CellPosition",name:"CellPosition",pkg:"",typ:$funcType([],[$Int,$Int],false)},{prop:"SetRight",name:"SetRight",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"SetBottom",name:"SetBottom",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"Bottom",name:"Bottom",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Right",name:"Right",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"SetBounds",name:"SetBounds",pkg:"",typ:$funcType([B,B],[],false)},{prop:"Check",name:"Check",pkg:"",typ:$funcType([$Float64,$Float64,AV],[AW],true)},{prop:"Overlaps",name:"Overlaps",pkg:"",typ:$funcType([AN],[$Bool],false)},{prop:"AddToIgnoreList",name:"AddToIgnoreList",pkg:"",typ:$funcType([AN],[],false)},{prop:"RemoveFromIgnoreList",name:"RemoveFromIgnoreList",pkg:"",typ:$funcType([AN],[],false)}];AW.methods=[{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"ObjectsByTags",name:"ObjectsByTags",pkg:"",typ:$funcType([AV],[AO],true)},{prop:"ContactWithObject",name:"ContactWithObject",pkg:"",typ:$funcType([AN],[B],false)},{prop:"ContactWithCell",name:"ContactWithCell",pkg:"",typ:$funcType([AJ],[B],false)},{prop:"SlideAgainstCell",name:"SlideAgainstCell",pkg:"",typ:$funcType([AJ,AV],[B],true)}];AJ.methods=[{prop:"register",name:"register",pkg:"resolv",typ:$funcType([AN],[],false)},{prop:"unregister",name:"unregister",pkg:"resolv",typ:$funcType([AN],[],false)},{prop:"Contains",name:"Contains",pkg:"",typ:$funcType([AN],[$Bool],false)},{prop:"ContainsTags",name:"ContainsTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"Occupied",name:"Occupied",pkg:"",typ:$funcType([],[$Bool],false)}];B.init($Float64);N.init("",[{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AL,tag:""},{prop:"CellWidth",name:"CellWidth",embedded:false,exported:true,typ:$Int,tag:""},{prop:"CellHeight",name:"CellHeight",embedded:false,exported:true,typ:$Int,tag:""}]);P.init([{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B,B],false)},{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[P],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,P],[AU],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)}]);Q.init("",[{prop:"Start",name:"Start",embedded:false,exported:true,typ:B,tag:""},{prop:"End",name:"End",embedded:false,exported:true,typ:B,tag:""}]);S.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AP,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Closed",name:"Closed",embedded:false,exported:true,typ:$Bool,tag:""}]);U.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AP,tag:""},{prop:"MTV",name:"MTV",embedded:false,exported:true,typ:B,tag:""},{prop:"Center",name:"Center",embedded:false,exported:true,typ:B,tag:""}]);X.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Radius",name:"Radius",embedded:false,exported:true,typ:$Float64,tag:""}]);Z.init("",[{prop:"Min",name:"Min",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Max",name:"Max",embedded:false,exported:true,typ:$Float64,tag:""}]);AA.init("resolv",[{prop:"Shape",name:"Shape",embedded:false,exported:true,typ:P,tag:""},{prop:"Space",name:"Space",embedded:false,exported:true,typ:AM,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"W",name:"W",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"H",name:"H",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"TouchingCells",name:"TouchingCells",embedded:false,exported:true,typ:AK,tag:""},{prop:"Data",name:"Data",embedded:false,exported:true,typ:$emptyInterface,tag:""},{prop:"ignoreList",name:"ignoreList",embedded:false,exported:false,typ:AY,tag:""},{prop:"tags",name:"tags",embedded:false,exported:false,typ:AV,tag:""}]);AE.init("resolv",[{prop:"checkingObject",name:"checkingObject",embedded:false,exported:false,typ:AN,tag:""},{prop:"dx",name:"dx",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"dy",name:"dy",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AO,tag:""},{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AK,tag:""}]);AG.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AO,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["jsexport/battle"]=(function(){var $pkg={},$init,A,B,C,D,E,F,H,I,J,M,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,L,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB;A=$packages["math"];B=$packages["resolv"];C=$pkg.Vec2D=$newType(0,$kindStruct,"battle.Vec2D",true,"jsexport/battle",true,function(X_,Y_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;return;}this.X=X_;this.Y=Y_;});D=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=AS.nil;this.Points=AT.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});E=$pkg.PlayerDownsync=$newType(0,$kindStruct,"battle.PlayerDownsync",true,"jsexport/battle",true,function(Id_,VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BattleState_,JoinIndex_,ColliderRadius_,Removed_,Score_,LastMoveGmtMillis_,FramesToRecover_,Hp_,MaxHp_,CharacterState_,InAir_){this.$val=this;if(arguments.length===0){this.Id=0;this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BattleState=0;this.JoinIndex=0;this.ColliderRadius=0;this.Removed=false;this.Score=0;this.LastMoveGmtMillis=0;this.FramesToRecover=0;this.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;return;}this.Id=Id_;this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BattleState=BattleState_;this.JoinIndex=JoinIndex_;this.ColliderRadius=ColliderRadius_;this.Removed=Removed_;this.Score=Score_;this.LastMoveGmtMillis=LastMoveGmtMillis_;this.FramesToRecover=FramesToRecover_;this.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;});F=$pkg.InputFrameDecoded=$newType(0,$kindStruct,"battle.InputFrameDecoded",true,"jsexport/battle",true,function(Dx_,Dy_,BtnALevel_,BtnBLevel_){this.$val=this;if(arguments.length===0){this.Dx=0;this.Dy=0;this.BtnALevel=0;this.BtnBLevel=0;return;}this.Dx=Dx_;this.Dy=Dy_;this.BtnALevel=BtnALevel_;this.BtnBLevel=BtnBLevel_;});H=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=AU.nil;return;}this.Boundary=Boundary_;});I=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BattleLocalId_,StartupFrames_,ActiveFrames_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,HitboxOffset_,OriginatedRenderFrameId_,HitStunFrames_,BlockStunFrames_,Pushback_,ReleaseTriggerType_,Damage_,OffenderJoinIndex_,OffenderPlayerId_,SelfMoveforwardX_,SelfMoveforwardY_,HitboxSizeX_,HitboxSizeY_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.StartupFrames=0;this.ActiveFrames=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.HitboxOffset=0;this.OriginatedRenderFrameId=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.Pushback=0;this.ReleaseTriggerType=0;this.Damage=0;this.OffenderJoinIndex=0;this.OffenderPlayerId=0;this.SelfMoveforwardX=0;this.SelfMoveforwardY=0;this.HitboxSizeX=0;this.HitboxSizeY=0;return;}this.BattleLocalId=BattleLocalId_;this.StartupFrames=StartupFrames_;this.ActiveFrames=ActiveFrames_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.HitboxOffset=HitboxOffset_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.Pushback=Pushback_;this.ReleaseTriggerType=ReleaseTriggerType_;this.Damage=Damage_;this.OffenderJoinIndex=OffenderJoinIndex_;this.OffenderPlayerId=OffenderPlayerId_;this.SelfMoveforwardX=SelfMoveforwardX_;this.SelfMoveforwardY=SelfMoveforwardY_;this.HitboxSizeX=HitboxSizeX_;this.HitboxSizeY=HitboxSizeY_;});J=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,BackendUnconfirmedMask_,ShouldForceResync_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=AM.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=AQ.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;});M=$pkg.SatResult=$newType(0,$kindStruct,"battle.SatResult",true,"jsexport/battle",true,function(Overlap_,OverlapX_,OverlapY_,AContainedInB_,BContainedInA_,Axis_){this.$val=this;if(arguments.length===0){this.Overlap=0;this.OverlapX=0;this.OverlapY=0;this.AContainedInB=false;this.BContainedInA=false;this.Axis=B.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});AC=$sliceType($Int32);AD=$sliceType(AC);AE=$ptrType(M);AF=$sliceType(C);AG=$sliceType($String);AH=$ptrType(B.Collision);AI=$ptrType(AF);AJ=$ptrType(E);AK=$ptrType(I);AL=$ptrType(B.ConvexPolygon);AM=$sliceType(AJ);AN=$sliceType(AI);AO=$sliceType($Uint64);AP=$ptrType(B.Object);AQ=$sliceType(AK);AR=$sliceType($Float64);AS=$ptrType(C);AT=$sliceType(AS);AU=$ptrType(D);L=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};N=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new M.ptr(0,0,0,true,true,new B.Vector([0,0]));i=O(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,AE.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,AE.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:N,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};$pkg.CalcPushbacks=N;O=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(AE.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(P(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(P(a,b,u.Unit(),c)){return false;}t++;}}return true;};P=function(a,b,c,d){var a,aa,ab,ac,ad,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};Q=function(a,b,c){var a,b,c,d,e;d=((A.Floor(a*c)>>0));e=((A.Floor(b*c)>>0));return[d,e];};$pkg.WorldToVirtualGridPos=Q;R=function(a,b,c){var a,b,c,d,e;d=(a)*c;e=(b)*c;return[d,e];};$pkg.VirtualGridToWorldPos=R;S=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=S;T=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=T;U=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=T(a,b,c,d,e,f,g,h,i,j);m=l[0];n=l[1];return Q(m,n,k);};$pkg.PolygonColliderBLToVirtualGridPos=U;V=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=R(a,b,k);m=l[0];n=l[1];return S(m,n,c,d,e,f,g,h,i,j);};$pkg.VirtualGridToPolygonColliderBLPos=V;W=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=[f];f[0]=$makeSlice(AF,0,10);g=b.Check(0,0,new AG([]));if(AH.nil===g){$s=-1;return(f.$ptr||(f.$ptr=new AI(function(){return this.$target[0];},function($v){this.$target[0]=$v;},f)));}h=g.Objects;i=0;case 1:if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);k=false;l=j.Data;if($assertType(l,AJ,true)[1]){}else if($assertType(l,AK,true)[1]){}else{k=true;}if(!k){i++;$s=1;continue;}m=$assertType(j.Shape,AL);o=N(0,0,c,m);$s=3;case 3:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}n=o;p=n[0];q=n[1];r=n[2];s=n[3];if(!p){i++;$s=1;continue;}t=(s.Overlap-d)*s.OverlapX;u=(s.Overlap-d)*s.OverlapY;q=t;r=u;f[0]=$append(f[0],new C.ptr(s.OverlapX,s.OverlapY));e.X=e.X+(q);e.Y=e.Y+(r);i++;$s=1;continue;case 2:$s=-1;return(f.$ptr||(f.$ptr=new AI(function(){return this.$target[0];},function($v){this.$target[0]=$v;},f)));}return;}var $f={$blk:W,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,$s};return $f;};X=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=c.PlayersArr.$length;r=$makeSlice(AM,q);s=c.PlayersArr;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]=new E.ptr(v.Id,v.VirtualGridX,v.VirtualGridY,v.DirX,v.DirY,v.VelX,v.VelY,v.Speed,v.BattleState,v.JoinIndex,0,v.Removed,v.Score,0,v.FramesToRecover-1>>0,v.Hp,v.MaxHp,v.CharacterState,true));if(((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover<0){((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover=0;}t++;}w=$makeSlice(AF,q);x=$makeSlice(AN,q);if(!(AO.nil===a)){y=c.PlayersArr;z=0;while(true){if(!(z=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+z]);ac=ab.JoinIndex;ad=((aa<0||aa>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+aa]);if(0>0,((ae<0||ae>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+ae])));ag=0;if(!(AO.nil===b)){ai=L((ah=ac-1>>0,((ah<0||ah>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+ah])));ag=ai.BtnBLevel;}if(af.BtnBLevel>ag){aj=false;if((4===ad.CharacterState)||(5===ad.CharacterState)||(6===ad.CharacterState)){aj=true;}ak=false;if((0===ad.CharacterState)||(1===ad.CharacterState)||(4===ad.CharacterState)){ak=true;}if(!aj&&ak){ad.VelY=h;}}if(!((0===af.Dx))||!((0===af.Dy))){ad.DirX=af.Dx;ad.DirY=af.Dy;ad.VelX=$imul(af.Dx,ab.Speed);ad.CharacterState=1;}else{ad.CharacterState=0;ad.VelX=0;}z++;}}al=c.PlayersArr;am=0;case 1:if(!(am=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+am]);ap=ao.JoinIndex;aq=0;ar=0;(as=ap-1>>0,((as<0||as>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+as])).X=aq;(at=ap-1>>0,((at<0||at>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+at])).Y=ar;au=131072+ap>>0;aw=(av=e[$Int32.keyFor(au)],av!==undefined?av.v:AP.nil);ax=((an<0||an>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+an]);ay=ao.VirtualGridX+ao.VelX>>0;az=ao.VirtualGridY+ao.VelY>>0;ba=ay;bb=az;if(ax.VelY===h){bb=bb+(ax.VelY)>>0;}bc=V(ba,bb,aw.W*0.5,aw.H*0.5,0,0,0,0,k,l,p);aw.X=bc[0];aw.Y=bc[1];$r=aw.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(ao.InAir){ax.VelX=ax.VelX+(f)>>0;ax.VelY=ax.VelY+(g)>>0;}am++;$s=1;continue;case 2:bd=c.PlayersArr;be=0;case 4:if(!(be=bd.$length)?($throwRuntimeError("index out of range"),undefined):bd.$array[bd.$offset+be]);bh=bg.JoinIndex;bi=131072+bh>>0;bk=(bj=e[$Int32.keyFor(bi)],bj!==undefined?bj.v:AP.nil);bl=$assertType(bk.Shape,AL);bn=W(bh,bk,bl,m,(bm=bh-1>>0,((bm<0||bm>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+bm])));$s=6;case 6:if($c){$c=false;bn=bn.$blk();}if(bn&&bn.$blk!==undefined){break s;}(bo=bh-1>>0,((bo<0||bo>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+bo]=bn));bp=((bf<0||bf>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+bf]);bq=false;br=bk.Check(0,0,new AG([]));if(!(AH.nil===br)){$s=7;continue;}$s=8;continue;case 7:bs=br.Objects;bt=0;case 9:if(!(bt=bs.$length)?($throwRuntimeError("index out of range"),undefined):bs.$array[bs.$offset+bt]);bv=false;bw=false;bx=false;by=bv;bz=bw;ca=bx;cb=bu.Data;if($assertType(cb,AJ,true)[1]){bz=true;}else if($assertType(cb,AK,true)[1]){ca=true;}else{by=true;}if(ca){bt++;$s=9;continue;}cc=$assertType(bu.Shape,AL);ce=N(0,0,bl,cc);$s=11;case 11:if($c){$c=false;ce=ce.$blk();}if(ce&&ce.$blk!==undefined){break s;}cd=ce;cf=cd[0];cg=cd[1];ch=cd[2];ci=cd[3];if(!cf){bt++;$s=9;continue;}cj=ci.OverlapX*0+ci.OverlapY*-1;if(bz){ck=(ci.Overlap-m*2)*ci.OverlapX;cl=(ci.Overlap-m*2)*ci.OverlapY;cg=ck;ch=cl;}cm=(cn=bh-1>>0,((cn<0||cn>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+cn])).$get();co=0;while(true){if(!(co=cm.$length)?($throwRuntimeError("index out of range"),undefined):cm.$array[cm.$offset+co]),C);cq=cg*cp.X+ch*cp.Y;if(by||(bz&&0>cq)){cg=cg-(cq*cp.X);ch=ch-(cq*cp.Y);}co++;}cr=bh-1>>0;((cr<0||cr>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cr]).X=((cr<0||cr>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cr]).X+(cg);cs=bh-1>>0;((cs<0||cs>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cs]).Y=((cs<0||cs>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cs]).Y+(ch);if(n=cv.$length)?($throwRuntimeError("index out of range"),undefined):cv.$array[cv.$offset+cw]);cz=cy.JoinIndex;da=131072+cz>>0;dc=(db=e[$Int32.keyFor(da)],db!==undefined?db.v:AP.nil);dd=((cx<0||cx>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+cx]);de=U(dc.X-(df=cz-1>>0,((df<0||df>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+df])).X,dc.Y-(dg=cz-1>>0,((dg<0||dg>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dg])).Y,dc.W*0.5,dc.H*0.5,0,0,0,0,k,l,o);dd.VirtualGridX=de[0];dd.VirtualGridY=de[1];cw++;}$s=-1;return new J.ptr(c.Id+1>>0,r,new $Int64(0,0),AQ.nil,new $Uint64(0,0),false);}return;}var $f={$blk:X,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=X;Y=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=S(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=Z(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:Y,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=Y;Z=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObject(a,b,c,d,new AG([f]));h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:Z,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AA=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=AB(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(AR.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new AR([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new AG([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:AA,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=AA;AB=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=AB;C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:AS,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:AT,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:AU,tag:""}]);I.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffset",name:"HitboxOffset",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Pushback",name:"Pushback",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderPlayerId",name:"OffenderPlayerId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfMoveforwardX",name:"SelfMoveforwardX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"SelfMoveforwardY",name:"SelfMoveforwardY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Float64,tag:""}]);J.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:AM,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:AQ,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""}]);M.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new AD([new AC([0,0]),new AC([0,2]),new AC([0,-2]),new AC([2,0]),new AC([-2,0]),new AC([1,1]),new AC([-1,-1]),new AC([1,-1]),new AC([-1,1])]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["jsexport"]=(function(){var $pkg={},$init,A,B,C,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,D,E,F,G,H,J,K,L,M,N,O;A=$packages["github.com/gopherjs/gopherjs/js"];B=$packages["jsexport/battle"];C=$packages["resolv"];P=$ptrType(B.Vec2D);Q=$sliceType(P);R=$ptrType(B.Polygon2D);S=$ptrType(B.PlayerDownsync);T=$sliceType(S);U=$ptrType(B.MeleeBullet);V=$sliceType(U);W=$ptrType(A.Object);X=$sliceType(W);Y=$funcType([$Float64,$Float64],[W],false);Z=$funcType([P,Q],[W],false);AA=$funcType([R],[W],false);AB=$funcType([$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Bool,$Float64],[W],false);AC=$funcType([$Int32,T,V],[W],false);AD=$funcType([$Int,$Int,$Int,$Int],[W],false);AE=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$emptyInterface,$String],[W],false);AF=$funcType([R,$Float64,$Float64,$emptyInterface,$String],[W],false);AG=$ptrType(C.Space);AH=$funcType([AG],[X],false);AI=$sliceType($Uint64);AJ=$ptrType(B.RoomDownsyncFrame);AK=$ptrType(C.Object);AL=$mapType($Int32,AK);AM=$funcType([AI,AI,AJ,AG,AL,$Int32,$Int32,$Int32,$Int32,$Uint32,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[W],false);AN=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[$Float64,$Float64],false);AO=$mapType($String,$emptyInterface);D=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(C.NewSpace(a,b,c,d));};$pkg.NewCollisionSpaceJs=D;E=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new B.Vec2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:E,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewVec2DJs=E;F=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new B.Polygon2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:F,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewPolygon2DJs=F;G=function(a){var a;return A.MakeWrapper(new B.Barrier.ptr(a));};$pkg.NewBarrierJs=G;H=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;return A.MakeWrapper(new B.PlayerDownsync.ptr(a,b,c,d,e,f,g,h,i,k,o,false,0,0,0,l,m,j,n));};$pkg.NewPlayerDownsyncJs=H;J=function(a,b,c){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=A.MakeFullWrapper(new B.RoomDownsyncFrame.ptr(a,b,new $Int64(0,0),c,new $Uint64(0,0),false));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;$s=2;case 2:return e;}return;}var $f={$blk:J,$c:true,$r,a,b,c,d,e,$s};return $f;};$pkg.NewRoomDownsyncFrameJs=J;K=function(a){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=a.Objects();c=$makeSlice(X,0,b.$length);d=b;e=0;case 1:if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);g=A.MakeFullWrapper(f);$s=3;case 3:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}c=$append(c,g);e++;$s=1;continue;case 2:$s=-1;return c;}return;}var $f={$blk:K,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};$pkg.GetCollisionSpaceObjsJs=K;L=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=B.GenerateRectCollider(a,b,c,d,e,f,g,h,i,j,k,l);$s=1;case 1:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}n=A.MakeFullWrapper(m);$s=2;case 2:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;$s=3;case 3:return o;}return;}var $f={$blk:L,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s};return $f;};$pkg.GenerateRectColliderJs=L;M=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=B.GenerateConvexPolygonCollider(a,b,c,d,e);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=A.MakeFullWrapper(f);$s=2;case 2:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;$s=3;case 3:return h;}return;}var $f={$blk:M,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GenerateConvexPolygonColliderJs=M;N=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=B.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=A.MakeFullWrapper(q);$s=2;case 2:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=r;$s=3;case 3:return s;}return;}var $f={$blk:N,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs=N;O=function(){$global.gopkgs=$externalize($makeMap($String.keyFor,[{k:"NewVec2DJs",v:new Y(E)},{k:"NewPolygon2DJs",v:new Z(F)},{k:"NewBarrierJs",v:new AA(G)},{k:"NewPlayerDownsyncJs",v:new AB(H)},{k:"NewRoomDownsyncFrameJs",v:new AC(J)},{k:"NewCollisionSpaceJs",v:new AD(D)},{k:"GenerateRectColliderJs",v:new AE(L)},{k:"GenerateConvexPolygonColliderJs",v:new AF(M)},{k:"GetCollisionSpaceObjsJs",v:new AH(K)},{k:"ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs",v:new AM(N)},{k:"WorldToPolygonColliderBLPos",v:new AN(B.WorldToPolygonColliderBLPos)},{k:"PolygonColliderBLToWorldPos",v:new AN(B.PolygonColliderBLToWorldPos)}]),AO);};$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if($pkg===$mainPkg){O();$mainFinished=true;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $synthesizeMethods(); $initAllLinknames(); diff --git a/frontend/assets/resources/pbfiles/room_downsync_frame.proto b/frontend/assets/resources/pbfiles/room_downsync_frame.proto index a1e58c3..26f32a6 100644 --- a/frontend/assets/resources/pbfiles/room_downsync_frame.proto +++ b/frontend/assets/resources/pbfiles/room_downsync_frame.proto @@ -147,6 +147,8 @@ message BattleColliderInfo { int32 gravityX = 28; int32 gravityY = 29; int32 collisionMinStep = 30; + + bool frameDataLoggingEnabled = 999; } message RoomDownsyncFrame { diff --git a/frontend/assets/scripts/Map.js b/frontend/assets/scripts/Map.js index db3b0b0..628d97a 100644 --- a/frontend/assets/scripts/Map.js +++ b/frontend/assets/scripts/Map.js @@ -1,7 +1,6 @@ const i18n = require('LanguageData'); i18n.init(window.language); // languageID should be equal to the one we input in New Language ID input field -const collisions = require('./modules/Collisions'); const RingBuffer = require('./RingBuffer'); window.ALL_MAP_STATES = { @@ -1112,13 +1111,15 @@ othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame const jPrev = self._convertToInputFrameId(i - 1, self.inputDelayFrames); const delayedInputFrameForPrevRenderFrame = self.recentInputCache.getByFrameId(jPrev); - const actuallyUsedInputClone = delayedInputFrame.inputList.slice(); - const inputFrameDownsyncClone = { - inputFrameId: delayedInputFrame.inputFrameId, - inputList: actuallyUsedInputClone, - confirmedList: delayedInputFrame.confirmedList, - }; - self.rdfIdToActuallyUsedInput.set(currRdf.Id, inputFrameDownsyncClone); + if (self.frameDataLoggingEnabled) { + const actuallyUsedInputClone = delayedInputFrame.inputList.slice(); + const inputFrameDownsyncClone = { + inputFrameId: delayedInputFrame.inputFrameId, + inputList: actuallyUsedInputClone, + confirmedList: delayedInputFrame.confirmedList, + }; + self.rdfIdToActuallyUsedInput.set(currRdf.Id, inputFrameDownsyncClone); + } const nextRdf = gopkgs.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(delayedInputFrame.inputList, (null == delayedInputFrameForPrevRenderFrame ? null : delayedInputFrameForPrevRenderFrame.inputList), currRdf, collisionSys, collisionSysMap, self.gravityX, self.gravityY, self.jumpingInitVelY, self.inputDelayFrames, self.inputScaleFrames, self.spaceOffsetX, self.spaceOffsetY, self.snapIntoPlatformOverlap, self.snapIntoPlatformThreshold, self.worldToVirtualGridRatio, self.virtualGridToWorldRatio); if (true == isChasing) { diff --git a/frontend/assets/scripts/WsSessionMgr.js b/frontend/assets/scripts/WsSessionMgr.js index 353aad8..7559608 100644 --- a/frontend/assets/scripts/WsSessionMgr.js +++ b/frontend/assets/scripts/WsSessionMgr.js @@ -197,7 +197,9 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) { break; case constants.RET_CODE.BATTLE_STOPPED: // deliberately do nothing - //console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); + if (mapIns.frameDataLoggingEnabled) { + console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); + } break; case constants.RET_CODE.PLAYER_NOT_ADDABLE_TO_ROOM: case constants.RET_CODE.PLAYER_NOT_READDABLE_TO_ROOM: @@ -212,7 +214,9 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) { case constants.RET_CODE.PLAYER_NOT_FOUND: case constants.RET_CODE.PLAYER_CHEATING: case 1006: // Peer(i.e. the backend) gone unexpectedly - //console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); + if (mapIns.frameDataLoggingEnabled) { + console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); + } window.clearLocalStorageAndBackToLoginScene(true); break; default: diff --git a/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js b/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js index 0970951..c757a40 100644 --- a/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js +++ b/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js @@ -4608,6 +4608,7 @@ $root.protos = (function() { * @property {number|null} [gravityX] BattleColliderInfo gravityX * @property {number|null} [gravityY] BattleColliderInfo gravityY * @property {number|null} [collisionMinStep] BattleColliderInfo collisionMinStep + * @property {boolean|null} [frameDataLoggingEnabled] BattleColliderInfo frameDataLoggingEnabled */ /** @@ -4866,6 +4867,14 @@ $root.protos = (function() { */ BattleColliderInfo.prototype.collisionMinStep = 0; + /** + * BattleColliderInfo frameDataLoggingEnabled. + * @member {boolean} frameDataLoggingEnabled + * @memberof protos.BattleColliderInfo + * @instance + */ + BattleColliderInfo.prototype.frameDataLoggingEnabled = false; + /** * Creates a new BattleColliderInfo instance using the specified properties. * @function create @@ -4953,6 +4962,8 @@ $root.protos = (function() { writer.uint32(/* id 29, wireType 0 =*/232).int32(message.gravityY); if (message.collisionMinStep != null && Object.hasOwnProperty.call(message, "collisionMinStep")) writer.uint32(/* id 30, wireType 0 =*/240).int32(message.collisionMinStep); + if (message.frameDataLoggingEnabled != null && Object.hasOwnProperty.call(message, "frameDataLoggingEnabled")) + writer.uint32(/* id 999, wireType 0 =*/7992).bool(message.frameDataLoggingEnabled); return writer; }; @@ -5126,6 +5137,10 @@ $root.protos = (function() { message.collisionMinStep = reader.int32(); break; } + case 999: { + message.frameDataLoggingEnabled = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -5262,6 +5277,9 @@ $root.protos = (function() { if (message.collisionMinStep != null && message.hasOwnProperty("collisionMinStep")) if (!$util.isInteger(message.collisionMinStep)) return "collisionMinStep: integer expected"; + if (message.frameDataLoggingEnabled != null && message.hasOwnProperty("frameDataLoggingEnabled")) + if (typeof message.frameDataLoggingEnabled !== "boolean") + return "frameDataLoggingEnabled: boolean expected"; return null; }; @@ -5359,6 +5377,8 @@ $root.protos = (function() { message.gravityY = object.gravityY | 0; if (object.collisionMinStep != null) message.collisionMinStep = object.collisionMinStep | 0; + if (object.frameDataLoggingEnabled != null) + message.frameDataLoggingEnabled = Boolean(object.frameDataLoggingEnabled); return message; }; @@ -5415,6 +5435,7 @@ $root.protos = (function() { object.gravityX = 0; object.gravityY = 0; object.collisionMinStep = 0; + object.frameDataLoggingEnabled = false; } if (message.stageName != null && message.hasOwnProperty("stageName")) object.stageName = message.stageName; @@ -5486,6 +5507,8 @@ $root.protos = (function() { object.gravityY = message.gravityY; if (message.collisionMinStep != null && message.hasOwnProperty("collisionMinStep")) object.collisionMinStep = message.collisionMinStep; + if (message.frameDataLoggingEnabled != null && message.hasOwnProperty("frameDataLoggingEnabled")) + object.frameDataLoggingEnabled = message.frameDataLoggingEnabled; return object; }; diff --git a/jsexport/Makefile b/jsexport/Makefile index 2152701..2087ef6 100644 --- a/jsexport/Makefile +++ b/jsexport/Makefile @@ -11,9 +11,11 @@ serve: build: gopherjs build $(PROJECTNAME) + rm ../frontend/assets/plugin_scripts/jsexport.js && mv ./jsexport.js ../frontend/assets/plugin_scripts/jsexport.js build-min: gopherjs build -m $(PROJECTNAME) + rm ../frontend/assets/plugin_scripts/jsexport.js && mv ./jsexport.js ../frontend/assets/plugin_scripts/jsexport.js .PHONY: help diff --git a/resolv_tailored/asm_stubs_amd64.go b/resolv_tailored/asm_stubs_amd64.go index d041aba..9503c26 100644 --- a/resolv_tailored/asm_stubs_amd64.go +++ b/resolv_tailored/asm_stubs_amd64.go @@ -1,3 +1,4 @@ +//go:build !noasm // +build !noasm package resolv diff --git a/resolv_tailored/gonum.go b/resolv_tailored/gonum.go index 6d0f959..7d30026 100644 --- a/resolv_tailored/gonum.go +++ b/resolv_tailored/gonum.go @@ -1,3 +1,4 @@ +//go:build !amd64 || noasm // +build !amd64 noasm package resolv @@ -21,4 +22,3 @@ func scalUnitaryTo(dst []float64, alpha float64, x []float64) { dst[i] *= alpha } } - diff --git a/resolv_tailored/object.go b/resolv_tailored/object.go index 1f7d517..e990d44 100644 --- a/resolv_tailored/object.go +++ b/resolv_tailored/object.go @@ -2,7 +2,7 @@ package resolv import ( "math" - "sort" + //"sort" ) // Object represents an object that can be spread across one or more Cells in a Space. An Object is essentially an AABB (Axis-Aligned Bounding Box) Rectangle. @@ -284,26 +284,29 @@ func (obj *Object) Check(dx, dy float64, tags ...string) *Collision { return nil } - ox, oy := cc.checkingObject.Center() - oc := Vector{ox, oy} + /* + // In my use case, order of objects within a collision instance is not needed, and this also favors both runtime performance & size reduction of `jsexport.js`. - sort.Slice(cc.Objects, func(i, j int) bool { + ox, oy := cc.checkingObject.Center() + oc := Vector{ox, oy} + sort.Slice(cc.Objects, func(i, j int) bool { - ix, iy := cc.Objects[i].Center() - jx, jy := cc.Objects[j].Center() - return Vector{ix, iy}.Sub(oc).Magnitude2() < Vector{jx, jy}.Sub(oc).Magnitude2() + ix, iy := cc.Objects[i].Center() + jx, jy := cc.Objects[j].Center() + return Vector{ix, iy}.Sub(oc).Magnitude2() < Vector{jx, jy}.Sub(oc).Magnitude2() - }) + }) - cw := cc.checkingObject.Space.CellWidth - ch := cc.checkingObject.Space.CellHeight + cw := cc.checkingObject.Space.CellWidth + ch := cc.checkingObject.Space.CellHeight - sort.Slice(cc.Cells, func(i, j int) bool { + sort.Slice(cc.Cells, func(i, j int) bool { - return Vector{float64(cc.Cells[i].X*cw + (cw / 2)), float64(cc.Cells[i].Y*ch + (ch / 2))}.Sub(oc).Magnitude2() < - Vector{float64(cc.Cells[j].X*cw + (cw / 2)), float64(cc.Cells[j].Y*ch + (ch / 2))}.Sub(oc).Magnitude2() + return Vector{float64(cc.Cells[i].X*cw + (cw / 2)), float64(cc.Cells[i].Y*ch + (ch / 2))}.Sub(oc).Magnitude2() < + Vector{float64(cc.Cells[j].X*cw + (cw / 2)), float64(cc.Cells[j].Y*ch + (ch / 2))}.Sub(oc).Magnitude2() - }) + }) + */ return cc diff --git a/resolv_tailored/shape.go b/resolv_tailored/shape.go index b773357..975016f 100644 --- a/resolv_tailored/shape.go +++ b/resolv_tailored/shape.go @@ -2,7 +2,6 @@ package resolv import ( "math" - "sort" ) type Shape interface { @@ -518,18 +517,7 @@ func (cp *ConvexPolygon) calculateMTV(contactSet *ContactSet, otherShape Shape) } } - - case *Circle: - - verts := append([]Vector{}, cp.Transformed()...) - // The center point of a contact could also be closer than the verts, particularly if we're testing from a Circle to another Shape. - verts = append(verts, contactSet.Center) - center := Vector{other.X, other.Y} - sort.Slice(verts, func(i, j int) bool { return verts[i].Sub(center).Magnitude() < verts[j].Sub(center).Magnitude() }) - - smallest = Vector{center[0] - verts[0][0], center[1] - verts[0][1]} - smallest = smallest.Unit().Scale(smallest.Magnitude() - other.Radius) - + // Removed support of "Circle" to remove dependency of "sort" module } delta[0] = smallest[0]