From 7093bb30aea9fc42fc31d7054cd86b9602d24e05 Mon Sep 17 00:00:00 2001 From: sehugg Date: Wed, 5 Jun 2024 14:46:37 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20sehugg/8?= =?UTF-8?q?bitworkshop@a01cc6453a6f694c4ae4781805a9596e2c24b38c=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gen/apple2-EBLV7QZ6.js.map | 7 - ...{apple2-EBLV7QZ6.js => apple2-MW55YTTB.js} | 4 +- gen/apple2-MW55YTTB.js.map | 7 + gen/{basic-O4Z2JMQ2.js => basic-C7LUGP5U.js} | 4 +- ...-O4Z2JMQ2.js.map => basic-C7LUGP5U.js.map} | 0 gen/chunk-JNII2TLU.js | 48 - gen/chunk-JNII2TLU.js.map | 7 - gen/{chunk-IJD2K6VH.js => chunk-NRFMOEZ6.js} | 4 +- ...-IJD2K6VH.js.map => chunk-NRFMOEZ6.js.map} | 0 gen/chunk-UC2UKQOH.js | 6 - gen/chunk-UC2UKQOH.js.map | 7 - gen/chunk-VQAF227M.js | 45 + gen/chunk-VQAF227M.js.map | 7 + gen/chunk-XKNBXIHT.js | 6 + gen/chunk-XKNBXIHT.js.map | 7 + gen/common/analysis.js.map | 2 +- gen/common/audio.js.map | 2 +- gen/common/audio/CommodoreTape.js.map | 2 +- gen/common/baseplatform.js.map | 2 +- gen/common/basic/compiler.js | 74 +- gen/common/basic/compiler.js.map | 2 +- gen/common/basic/fuzz.js.map | 2 +- gen/common/basic/run.js.map | 2 +- gen/common/basic/runtime.js.map | 2 +- gen/common/binutils.js.map | 2 +- gen/common/cpu/6809.js | 90 +- gen/common/cpu/6809.js.map | 2 +- gen/common/cpu/ARM.js.map | 2 +- gen/common/cpu/MOS6502.js | 36 +- gen/common/cpu/MOS6502.js.map | 2 +- gen/common/cpu/ZilogZ80.js.map | 2 +- gen/common/cpu/disasm6502.js | 510 +- gen/common/cpu/disasm6502.js.map | 2 +- gen/common/cpu/disasmHuC6280.js | 510 +- gen/common/cpu/disasmHuC6280.js.map | 2 +- gen/common/cpu/disasmz80.js.map | 2 +- gen/common/devices.js.map | 2 +- gen/common/ecs/binpack.js.map | 2 +- gen/common/ecs/compiler.js | 8 +- gen/common/ecs/compiler.js.map | 2 +- gen/common/ecs/decoder.js.map | 2 +- gen/common/ecs/ecs.js.map | 2 +- gen/common/ecs/main.js.map | 2 +- gen/common/emu.js | 4 +- gen/common/emu.js.map | 2 +- gen/common/hdl/fuzz.js.map | 2 +- gen/common/hdl/hdlruntime.js | 2 +- gen/common/hdl/hdlruntime.js.map | 2 +- gen/common/hdl/hdlwasm.js | 2 +- gen/common/hdl/hdlwasm.js.map | 2 +- gen/common/hdl/vxmlparser.js.map | 2 +- gen/common/hdl/vxmltest.js.map | 2 +- gen/common/mameplatform.js.map | 2 +- gen/common/probe.js.map | 2 +- gen/common/recorder.js.map | 2 +- gen/common/teletype.js.map | 2 +- gen/common/tokenizer.js.map | 2 +- gen/common/util.js.map | 2 +- gen/common/video/tms9918a.js | 2 +- gen/common/video/tms9918a.js.map | 2 +- gen/common/vlist.js.map | 2 +- gen/common/wasi/wasishim.js.map | 2 +- gen/common/wasmplatform.js.map | 2 +- gen/common/workertypes.js.map | 2 +- gen/{devel-ZI5EIHUT.js => devel-7PHVO77Z.js} | 4 +- ...-ZI5EIHUT.js.map => devel-7PHVO77Z.js.map} | 0 gen/embedui.js | 2 +- gen/ide/analytics.js.map | 2 +- gen/ide/dialogs.js.map | 2 +- gen/ide/embedui.js.map | 2 +- gen/ide/pixeleditor.js.map | 2 +- gen/ide/project.js.map | 2 +- gen/ide/services.js | 2 +- gen/ide/services.js.map | 2 +- gen/ide/shareexport.js.map | 2 +- gen/ide/sync.js.map | 2 +- gen/ide/toolbar.js.map | 2 +- gen/ide/ui.js.map | 2 +- gen/ide/views/asseteditor.js.map | 2 +- gen/ide/views/debugviews.js.map | 2 +- gen/ide/views/editors.js | 6 +- gen/ide/views/editors.js.map | 2 +- gen/ide/views/treeviews.js.map | 2 +- gen/ide/waveform.js.map | 2 +- gen/ide/windows.js.map | 2 +- gen/machine/apple2.js | 3 +- gen/machine/apple2.js.map | 2 +- gen/machine/arm32.js.map | 2 +- gen/machine/astrocade.js | 6 +- gen/machine/astrocade.js.map | 2 +- gen/machine/atari7800.js | 10 +- gen/machine/atari7800.js.map | 2 +- gen/machine/atari8.js | 4 +- gen/machine/atari8.js.map | 2 +- gen/machine/c64.js.map | 2 +- gen/machine/chips/antic.js.map | 2 +- gen/machine/chips/gtia.js | 30 +- gen/machine/chips/gtia.js.map | 2 +- gen/machine/chips/pokey.js.map | 2 +- gen/machine/coleco.js.map | 2 +- gen/machine/cpc.js | 8 +- gen/machine/cpc.js.map | 2 +- gen/machine/devel.js.map | 2 +- gen/machine/exidy.js | 2 +- gen/machine/exidy.js.map | 2 +- gen/machine/galaxian.js | 22 +- gen/machine/galaxian.js.map | 2 +- gen/machine/kim1.js.map | 2 +- gen/machine/msx.js.map | 2 +- gen/machine/mw8080bw.js | 4 +- gen/machine/mw8080bw.js.map | 2 +- gen/machine/sms.js | 2 +- gen/machine/sms.js.map | 2 +- gen/machine/vdp_z80.js.map | 2 +- gen/machine/vic20.js | 2 +- gen/machine/vic20.js.map | 2 +- gen/machine/vicdual.js | 14 +- gen/machine/vicdual.js.map | 2 +- gen/machine/williams.js.map | 2 +- gen/machine/zx.js.map | 2 +- gen/platform/_index.js.map | 2 +- gen/platform/arm32.js.map | 2 +- gen/platform/atari7800.js | 2 +- gen/platform/atari7800.js.map | 2 +- gen/platform/atari8.js.map | 2 +- gen/platform/basic.js.map | 2 +- gen/platform/c64.js.map | 2 +- gen/platform/devel.js.map | 2 +- gen/platform/nes.js.map | 2 +- gen/platform/pce.js | 136 +- gen/platform/pce.js.map | 2 +- gen/platform/sound_konami.js.map | 2 +- gen/platform/sound_williams.js.map | 2 +- gen/platform/vcs.js.map | 2 +- gen/platform/vector.js | 2 +- gen/platform/vector.js.map | 2 +- gen/platform/vectrex.js | 4 +- gen/platform/vectrex.js.map | 2 +- gen/platform/verilog.js.map | 2 +- gen/platform/vic20.js.map | 2 +- gen/platform/williams.js.map | 2 +- gen/platform/x86.js.map | 2 +- gen/platform/zmachine.js.map | 2 +- gen/server/server.js | 4932 +------ gen/server/server.js.map | 6 +- gen/test/testecs.js.map | 2 +- gen/test/testutil.js.map | 2 +- gen/tools/runmachine.js.map | 2 +- gen/tools/sim6502.js.map | 2 +- gen/ui.js | 2 +- ...erilog-4TFY7N6R.js => verilog-6RAKO3V3.js} | 4 +- ...TFY7N6R.js.map => verilog-6RAKO3V3.js.map} | 0 gen/worker/assembler.js | 2 +- gen/worker/assembler.js.map | 2 +- gen/worker/builder.js.map | 2 +- gen/worker/listingutils.js.map | 2 +- gen/worker/platforms.js | 8 +- gen/worker/platforms.js.map | 2 +- gen/worker/server/buildenv.js | 2 +- gen/worker/server/buildenv.js.map | 2 +- gen/worker/server/clang.js.map | 2 +- gen/worker/server/server.js.map | 2 +- gen/worker/tools/acme.js.map | 2 +- gen/worker/tools/arm.js | 6 +- gen/worker/tools/arm.js.map | 2 +- gen/worker/tools/bataribasic.js.map | 2 +- gen/worker/tools/cc65.js | 2 +- gen/worker/tools/cc65.js.map | 2 +- gen/worker/tools/cc7800.js.map | 2 +- gen/worker/tools/dasm.js.map | 2 +- gen/worker/tools/ecs.js.map | 2 +- gen/worker/tools/m6502.js | 2 +- gen/worker/tools/m6502.js.map | 2 +- gen/worker/tools/m6809.js | 2 +- gen/worker/tools/m6809.js.map | 2 +- gen/worker/tools/mcpp.js.map | 2 +- gen/worker/tools/misc.js | 4 +- gen/worker/tools/misc.js.map | 2 +- gen/worker/tools/remote.js.map | 2 +- gen/worker/tools/sdcc.js | 4 +- gen/worker/tools/sdcc.js.map | 2 +- gen/worker/tools/verilog.js | 2 +- gen/worker/tools/verilog.js.map | 2 +- gen/worker/tools/x86.js | 2 +- gen/worker/tools/x86.js.map | 2 +- gen/worker/tools/z80.js.map | 2 +- gen/worker/wasiutils.js.map | 2 +- gen/worker/wasmutils.js | 2 +- gen/worker/wasmutils.js.map | 2 +- gen/worker/workermain.js.map | 2 +- gen/worker/workertools.js | 4 +- gen/worker/workertools.js.map | 2 +- package-lock.json | 10908 +++------------- src/ide/pixeleditor.ts | 2 +- src/machine/apple2.ts | 3 +- 195 files changed, 2866 insertions(+), 14951 deletions(-) delete mode 100644 gen/apple2-EBLV7QZ6.js.map rename gen/{apple2-EBLV7QZ6.js => apple2-MW55YTTB.js} (99%) create mode 100644 gen/apple2-MW55YTTB.js.map rename gen/{basic-O4Z2JMQ2.js => basic-C7LUGP5U.js} (99%) rename gen/{basic-O4Z2JMQ2.js.map => basic-C7LUGP5U.js.map} (100%) delete mode 100644 gen/chunk-JNII2TLU.js delete mode 100644 gen/chunk-JNII2TLU.js.map rename gen/{chunk-IJD2K6VH.js => chunk-NRFMOEZ6.js} (95%) rename gen/{chunk-IJD2K6VH.js.map => chunk-NRFMOEZ6.js.map} (100%) delete mode 100644 gen/chunk-UC2UKQOH.js delete mode 100644 gen/chunk-UC2UKQOH.js.map create mode 100644 gen/chunk-VQAF227M.js create mode 100644 gen/chunk-VQAF227M.js.map create mode 100644 gen/chunk-XKNBXIHT.js create mode 100644 gen/chunk-XKNBXIHT.js.map rename gen/{devel-ZI5EIHUT.js => devel-7PHVO77Z.js} (95%) rename gen/{devel-ZI5EIHUT.js.map => devel-7PHVO77Z.js.map} (100%) rename gen/{verilog-4TFY7N6R.js => verilog-6RAKO3V3.js} (99%) rename gen/{verilog-4TFY7N6R.js.map => verilog-6RAKO3V3.js.map} (100%) diff --git a/gen/apple2-EBLV7QZ6.js.map b/gen/apple2-EBLV7QZ6.js.map deleted file mode 100644 index cb53a13a..00000000 --- a/gen/apple2-EBLV7QZ6.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../src/machine/apple2.ts", "../src/platform/apple2.ts"], - "sourcesContent": ["\nimport { MOS6502, MOS6502State } from \"../common/cpu/MOS6502\";\nimport { Bus, BasicScanlineMachine, SavesState, AcceptsBIOS } from \"../common/devices\";\nimport { KeyFlags } from \"../common/emu\"; // TODO\nimport { hex, lzgmini, stringToByteArray, RGBA, printFlags, arrayCompare } from \"../common/util\";\n\ninterface AppleIIStateBase {\n ram : Uint8Array;\n soundstate : number;\n auxRAMselected,writeinhibit : boolean;\n auxRAMbank : number;\n}\n\ninterface AppleIIControlsState {\n inputs : Uint8Array; // unused?\n kbdlatch : number;\n}\n\ninterface AppleIIState extends AppleIIStateBase, AppleIIControlsState {\n c : MOS6502State;\n grswitch : number;\n slots: SlotDevice[];\n}\n\ninterface SlotDevice extends Bus {\n readROM(address: number) : number;\n readConst(address: number) : number;\n}\n\nexport class AppleII extends BasicScanlineMachine implements AcceptsBIOS {\n\n // approx: http://www.cs.columbia.edu/~sedwards/apple2fpga/\n cpuFrequency = 1022727;\n sampleRate = this.cpuFrequency;\n cpuCyclesPerLine = 65;\n cpuCyclesPerFrame = this.cpuCyclesPerLine * 262;\n canvasWidth = 280;\n numVisibleScanlines = 192;\n numTotalScanlines = 262;\n defaultROMSize = 0x13000; // we'll never need one that big, but...\n\n // these are set later\n LOAD_BASE = 0;\n HDR_SIZE = 0;\n\n ram = new Uint8Array(0x13000); // 64K + 16K LC RAM - 4K hardware + 12K ROM\n bios : Uint8Array;\n cpu = new MOS6502();\n grdirty = new Array(0xc000 >> 7);\n grparams = {dirty:this.grdirty, grswitch:GR_TXMODE, mem:this.ram};\n ap2disp;\n kbdlatch = 0;\n soundstate = 0;\n // language card switches\n auxRAMselected = false;\n auxRAMbank = 1;\n writeinhibit = true;\n // value to add when reading & writing each of these banks\n // bank 1 is E000-FFFF, bank 2 is D000-DFFF\n bank2rdoffset=0;\n bank2wroffset=0;\n // disk II\n slots : SlotDevice[] = new Array(8);\n // fake disk drive that loads program into RAM\n fakeDrive : SlotDevice = {\n readROM: (a) => {\n var pc = this.cpu.getPC();\n if (pc >= 0xC600 && pc < 0xC700) {\n // We're reading code to EXECUTE.\n // Load the built program directly into memory, and \"read\"\n // a JMP directly to it.\n //console.log(`fakeDrive (EXEC): ${a.toString(16)}`);\n switch (a) {\n // JMP VM_BASE\n case 0:\n // SHOULD load program into RAM here, but have to do it\n // below instead.\n return 0;\n case 1: return this.LOAD_BASE&0xff;\n case 2: return (this.LOAD_BASE>>8)&0xff;\n default: return 0;\n }\n }\n else {\n // We're reading code, but not executing it.\n // This is probably the Monitor routine to identify whether\n // this slot is a Disk ][ drive, so... give it what it wants.\n //console.log(`fakeDrive (NOEX): ${a.toString(16)}`);\n switch (a) {\n case 0:\n // Actually, if we get here, we probably ARE being\n // executed. For some reason, the instruction at $C600\n // gets read for execution, BEFORE the PC gets set to\n // the correct location. So we handle loading the program\n // into RAM and returning the JMP here, instead of above\n // where it would otherwise belong.\n if (this.rom) {\n this.loadRAMWithProgram();\n }\n return 0x4c; // JMP\n case 1: return 0x20;\n case 3: return 0x00;\n case 5: return 0x03;\n case 7: return 0x3c;\n default: return 0;\n }\n }\n },\n readConst: (a) => {\n return 0;\n },\n read: (a) => { return this.floatbus(); },\n write: (a,v) => { }\n };\n\n constructor() {\n super();\n this.loadBIOS(new lzgmini().decode(stringToByteArray(atob(APPLEIIGO_LZG))));\n this.connectCPUMemoryBus(this);\n // This line is inappropriate for real ROMs, but was there for\n // the APPLE][GO ROM, so keeping it only in the constructor, for\n // that special case (in case it really is important for this\n // address to be an RTS).\n this.bios[0xD39A - (0x10000 - this.bios.length)] = 0x60; // $d39a = RTS\n }\n saveState() : AppleIIState {\n // TODO: automagic\n return {\n c: this.cpu.saveState(),\n ram: this.ram.slice(),\n kbdlatch: this.kbdlatch,\n soundstate: this.soundstate,\n grswitch: this.grparams.grswitch,\n auxRAMselected: this.auxRAMselected,\n auxRAMbank: this.auxRAMbank,\n writeinhibit: this.writeinhibit,\n slots: this.slots.map((slot) => { return slot && slot['saveState'] && slot['saveState']() }),\n inputs: null\n };\n }\n loadState(s:AppleIIState) {\n this.cpu.loadState(s.c);\n this.ram.set(s.ram);\n this.kbdlatch = s.kbdlatch;\n this.soundstate = s.soundstate;\n this.grparams.grswitch = s.grswitch;\n this.auxRAMselected = s.auxRAMselected;\n this.auxRAMbank = s.auxRAMbank;\n this.writeinhibit = s.writeinhibit;\n this.setupLanguageCardConstants();\n for (var i=0; i>8) == 0xc6) break;\n }\n // get out of $c600 boot\n for (var i=0; i<2000000; i++) {\n this.cpu.advanceClock();\n if ((this.cpu.getPC()>>8) < 0xc6) break;\n }\n }\n readConst(address: number): number {\n if (address < 0xc000) {\n return this.ram[address];\n } else if (address >= 0xd000) {\n if (!this.auxRAMselected)\n return this.bios[address - (0x10000 - this.bios.length)];\n else if (address >= 0xe000)\n return this.ram[address];\n else\n return this.ram[address + this.bank2rdoffset];\n } else if (address >= 0xc100 && address < 0xc800) {\n var slot = (address >> 8) & 7;\n return (this.slots[slot] && this.slots[slot].readConst(address & 0xff)) | 0;\n } else {\n return 0;\n }\n }\n read(address:number) : number {\n address &= 0xffff;\n if (address < 0xc000 || address >= 0xd000) {\n return this.readConst(address);\n } else if (address < 0xc100) {\n this.probe.logIORead(address, 0); // TODO: value\n var slot = (address >> 4) & 0x0f;\n switch (slot)\n {\n case 0:\n return this.kbdlatch;\n case 1:\n this.kbdlatch &= 0x7f;\n break;\n case 3:\n this.soundstate = this.soundstate ^ 1;\n break;\n case 5:\n if ((address & 0x0f) < 8) {\n // graphics\n if ((address & 1) != 0)\n this.grparams.grswitch |= 1 << ((address >> 1) & 0x07);\n else\n this.grparams.grswitch &= ~(1 << ((address >> 1) & 0x07));\n }\n break;\n case 6:\n // tapein, joystick, buttons\n switch (address & 7) {\n // buttons (off)\n case 1:\n case 2:\n case 3:\n return this.floatbus() & 0x7f;\n // joystick\n case 4:\n case 5:\n return this.floatbus() | 0x80;\n default:\n return this.floatbus();\n }\n case 7:\n // joy reset\n if (address == 0xc070)\n return this.floatbus() | 0x80;\n case 8:\n return this.doLanguageCardIO(address);\n case 9: case 10: case 11: case 12: case 13: case 14: case 15:\n return (this.slots[slot-8] && this.slots[slot-8].read(address & 0xf)) | 0;\n }\n } else if (address >= 0xc100 && address < 0xc800) {\n var slot = (address >> 8) & 7;\n return (this.slots[slot] && this.slots[slot].readROM(address & 0xff)) | 0;\n }\n return this.floatbus();\n }\n write(address:number, val:number) : void {\n address &= 0xffff;\n val &= 0xff;\n if (address < 0xc000) {\n this.ram[address] = val;\n this.grdirty[address>>7] = 1;\n } else if (address < 0xc080) {\n this.read(address); // strobe address, discard result\n } else if (address < 0xc100) {\n var slot = (address >> 4) & 0x0f;\n this.slots[slot-8] && this.slots[slot-8].write(address & 0xf, val);\n this.probe.logIOWrite(address, val);\n } else if (address >= 0xd000 && !this.writeinhibit) {\n if (address >= 0xe000)\n this.ram[address] = val;\n else\n this.ram[address + this.bank2wroffset] = val;\n }\n }\n // http://www.deater.net/weave/vmwprod/megademo/vapor_lock.html\n // https://retrocomputing.stackexchange.com/questions/14012/what-is-dram-refresh-and-why-is-the-weird-apple-ii-video-memory-layout-affected\n // http://www.apple-iigs.info/doc/fichiers/TheappleIIcircuitdescription1.pdf\n // http://rich12345.tripod.com/aiivideo/softalk.html\n // https://github.com/MiSTer-devel/Apple-II_MiSTer/blob/master/rtl/timing_generator.vhd\n floatbus() : number {\n var fcyc = this.frameCycles;\n var yline = Math.floor(fcyc / 65);\n var xcyc = Math.floor(fcyc % 65);\n var addr = this.ap2disp.getAddressForScanline(yline);\n return this.readConst(addr + xcyc);\n }\n\n connectVideo(pixels:Uint32Array) {\n super.connectVideo(pixels);\n this.ap2disp = this.pixels && new Apple2Display(this.pixels, this.grparams);\n }\n startScanline() {\n }\n drawScanline() {\n // TODO: draw scanline via ap2disp\n }\n advanceFrame(trap) : number {\n var clocks = super.advanceFrame(trap);\n this.ap2disp && this.ap2disp.updateScreen();\n return clocks;\n }\n advanceCPU() {\n this.audio.feedSample(this.soundstate, 1);\n return super.advanceCPU();\n }\n\n setKeyInput(key:number, code:number, flags:number) : void {\n //console.log(`setKeyInput: ${key} ${code} ${flags}`);\n if (flags & KeyFlags.KeyDown) {\n code = 0;\n switch (key) {\n case 16: case 17: case 18:\n break; // ignore shift/ctrl/etc\n case 8:\n code=8; // left\n if (flags & KeyFlags.Shift) {\n // (possibly) soft reset\n this.cpu.reset();\n return;\n }\n break;\n case 13: code=13; break; // return\n case 27: code=27; break; // escape\n case 37: code=8; break; // left\n case 39: code=21; break; // right\n case 38: code=11; break; // up\n case 40: code=10; break; // down\n case 48: if (flags & KeyFlags.Shift) code = 0x29; break; // )\n case 49: if (flags & KeyFlags.Shift) code = 0x21; break; // !\n case 50: if (flags & KeyFlags.Shift) code = 0x40; break; // @\n case 51: if (flags & KeyFlags.Shift) code = 0x23; break; // #\n case 52: if (flags & KeyFlags.Shift) code = 0x24; break; // $\n case 53: if (flags & KeyFlags.Shift) code = 0x25; break; // %\n case 54: if (flags & KeyFlags.Shift) code = 0x5e; break; // ^\n case 55: if (flags & KeyFlags.Shift) code = 0x26; break; // &\n case 56: if (flags & KeyFlags.Shift) code = 0x2a; break; // *\n case 57: if (flags & KeyFlags.Shift) code = 0x28; break; // (\n case 61: code = (flags & KeyFlags.Shift) ? 0x2b : 0x3d; break; // +\n case 173: code = (flags & KeyFlags.Shift) ? 0x5f : 0x2d; break; // _\n case 59: code = (flags & KeyFlags.Shift) ? 0x3a : 0x3b; break;\n case 188: code = (flags & KeyFlags.Shift) ? 0x3c : 0x2c; break;\n case 190: code = (flags & KeyFlags.Shift) ? 0x3e : 0x2e; break;\n case 191: code = (flags & KeyFlags.Shift) ? 0x3f : 0x2f; break;\n case 222: code = (flags & KeyFlags.Shift) ? 0x22 : 0x27; break;\n default:\n code = key;\n // convert to uppercase for Apple ][\n if (code >= 0x61 && code <= 0x7a) code -= 32;\n // convert to control codes if Ctrl pressed\n if (code >= 65 && code < 65+26) {\n if (flags & KeyFlags.Ctrl) code -= 64; // ctrl\n }\n }\n if (code) {\n this.kbdlatch = (code | 0x80) & 0xff;\n }\n }\n }\n \n doLanguageCardIO(address:number) {\n switch (address & 0x0f) {\n // Select aux RAM bank 2, write protected.\n case 0x0:\n case 0x4:\n this.auxRAMselected = true;\n this.auxRAMbank = 2;\n this.writeinhibit = true;\n break;\n // Select ROM, write enable aux RAM bank 2.\n case 0x1:\n case 0x5:\n this.auxRAMselected = false;\n this.auxRAMbank = 2;\n this.writeinhibit = false;\n break;\n // Select ROM, write protect aux RAM (either bank).\n case 0x2:\n case 0x6:\n case 0xA:\n case 0xE:\n this.auxRAMselected = false;\n this.writeinhibit = true;\n break;\n // Select aux RAM bank 2, write enabled.\n case 0x3:\n case 0x7:\n this.auxRAMselected = true;\n this.auxRAMbank = 2;\n this.writeinhibit = false;\n break;\n // Select aux RAM bank 1, write protected.\n case 0x8:\n case 0xC:\n this.auxRAMselected = true;\n this.auxRAMbank = 1;\n this.writeinhibit = true;\n break;\n // Select ROM, write enable aux RAM bank 1.\n case 0x9:\n case 0xD:\n this.auxRAMselected = false;\n this.auxRAMbank = 1;\n this.writeinhibit = false;\n break;\n // Select aux RAM bank 1, write enabled.\n case 0xB:\n case 0xF:\n this.auxRAMselected = true;\n this.auxRAMbank = 1;\n this.writeinhibit = false;\n break;\n }\n this.setupLanguageCardConstants();\n return this.floatbus();\n }\n\n setupLanguageCardConstants() {\n // reset language card constants\n if (this.auxRAMbank == 2)\n this.bank2rdoffset = -0x1000; // map 0xd000-0xdfff -> 0xc000-0xcfff\n else\n this.bank2rdoffset = 0x3000; // map 0xd000-0xdfff -> 0x10000-0x10fff\n if (this.auxRAMbank == 2)\n this.bank2wroffset = -0x1000; // map 0xd000-0xdfff -> 0xc000-0xcfff\n else\n this.bank2wroffset = 0x3000; // map 0xd000-0xdfff -> 0x10000-0x10fff\n }\n\n getDebugCategories() {\n return ['CPU','Stack','I/O','Disk'];\n }\n getDebugInfo(category:string, state:AppleIIState) {\n switch (category) {\n case 'I/O': return \"AUX RAM Bank: \" + state.auxRAMbank + \n \"\\nAUX RAM Select: \" + state.auxRAMselected +\n \"\\nAUX RAM Write: \" + !state.writeinhibit +\n \"\\n\\nGR Switches: \" + printFlags(state.grswitch, [\"Graphics\",\"Mixed\",\"Page2\",\"Hires\"], false) +\n \"\\n\";\n case 'Disk': return (this.slots[6] && this.slots[6]['toLongString'] && this.slots[6]['toLongString']()) || \"\\n\";\n }\n }\n}\n\nconst GR_TXMODE = 1;\nconst GR_MIXMODE = 2;\nconst GR_PAGE1 = 4;\nconst GR_HIRES = 8;\n\ntype AppleGRParams = {dirty:boolean[], grswitch:number, mem:Uint8Array};\n\nvar Apple2Display = function(pixels : Uint32Array, apple : AppleGRParams) {\n var XSIZE = 280;\n var YSIZE = 192;\n var PIXELON = 0xffffffff;\n var PIXELOFF = 0xff000000;\n\n var oldgrmode = -1;\n var textbuf = new Array(40*24);\n\n const flashInterval = 250;\n\n // https://mrob.com/pub/xapple2/colors.html\n const loresColor = [\n RGBA(0, 0, 0),\n RGBA(227, 30, 96),\n RGBA(96, 78, 189),\n RGBA(255, 68, 253),\n RGBA(0, 163, 96),\n RGBA(156, 156, 156),\n RGBA(20, 207, 253),\n RGBA(208, 195, 255),\n RGBA(96, 114, 3),\n RGBA(255, 106, 60),\n RGBA(156, 156, 156),\n RGBA(255, 160, 208),\n RGBA(20, 245, 60),\n RGBA(208, 221, 141),\n RGBA(114, 255, 208),\n RGBA(255, 255, 255)\n ];\n\n const text_lut = [\n 0x000, 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380,\n 0x028, 0x0a8, 0x128, 0x1a8, 0x228, 0x2a8, 0x328, 0x3a8,\n 0x050, 0x0d0, 0x150, 0x1d0, 0x250, 0x2d0, 0x350, 0x3d0\n ];\n\n const hires_lut = [\n 0x0000, 0x0400, 0x0800, 0x0c00, 0x1000, 0x1400, 0x1800, 0x1c00,\n 0x0080, 0x0480, 0x0880, 0x0c80, 0x1080, 0x1480, 0x1880, 0x1c80,\n 0x0100, 0x0500, 0x0900, 0x0d00, 0x1100, 0x1500, 0x1900, 0x1d00,\n 0x0180, 0x0580, 0x0980, 0x0d80, 0x1180, 0x1580, 0x1980, 0x1d80,\n 0x0200, 0x0600, 0x0a00, 0x0e00, 0x1200, 0x1600, 0x1a00, 0x1e00,\n 0x0280, 0x0680, 0x0a80, 0x0e80, 0x1280, 0x1680, 0x1a80, 0x1e80,\n 0x0300, 0x0700, 0x0b00, 0x0f00, 0x1300, 0x1700, 0x1b00, 0x1f00,\n 0x0380, 0x0780, 0x0b80, 0x0f80, 0x1380, 0x1780, 0x1b80, 0x1f80,\n 0x0028, 0x0428, 0x0828, 0x0c28, 0x1028, 0x1428, 0x1828, 0x1c28,\n 0x00a8, 0x04a8, 0x08a8, 0x0ca8, 0x10a8, 0x14a8, 0x18a8, 0x1ca8,\n 0x0128, 0x0528, 0x0928, 0x0d28, 0x1128, 0x1528, 0x1928, 0x1d28,\n 0x01a8, 0x05a8, 0x09a8, 0x0da8, 0x11a8, 0x15a8, 0x19a8, 0x1da8,\n 0x0228, 0x0628, 0x0a28, 0x0e28, 0x1228, 0x1628, 0x1a28, 0x1e28,\n 0x02a8, 0x06a8, 0x0aa8, 0x0ea8, 0x12a8, 0x16a8, 0x1aa8, 0x1ea8,\n 0x0328, 0x0728, 0x0b28, 0x0f28, 0x1328, 0x1728, 0x1b28, 0x1f28,\n 0x03a8, 0x07a8, 0x0ba8, 0x0fa8, 0x13a8, 0x17a8, 0x1ba8, 0x1fa8,\n 0x0050, 0x0450, 0x0850, 0x0c50, 0x1050, 0x1450, 0x1850, 0x1c50,\n 0x00d0, 0x04d0, 0x08d0, 0x0cd0, 0x10d0, 0x14d0, 0x18d0, 0x1cd0,\n 0x0150, 0x0550, 0x0950, 0x0d50, 0x1150, 0x1550, 0x1950, 0x1d50,\n 0x01d0, 0x05d0, 0x09d0, 0x0dd0, 0x11d0, 0x15d0, 0x19d0, 0x1dd0,\n 0x0250, 0x0650, 0x0a50, 0x0e50, 0x1250, 0x1650, 0x1a50, 0x1e50,\n 0x02d0, 0x06d0, 0x0ad0, 0x0ed0, 0x12d0, 0x16d0, 0x1ad0, 0x1ed0,\n 0x0350, 0x0750, 0x0b50, 0x0f50, 0x1350, 0x1750, 0x1b50, 0x1f50,\n 0x03d0, 0x07d0, 0x0bd0, 0x0fd0, 0x13d0, 0x17d0, 0x1bd0, 0x1fd0,\n // just for floating bus, y >= 192\n 0x0078, 0x0478, 0x0878, 0x0c78, 0x1078, 0x1478, 0x1878, 0x1c78,\n 0x00f8, 0x04f8, 0x08f8, 0x0cf8, 0x10f8, 0x14f8, 0x18f8, 0x1cf8,\n 0x0178, 0x0578, 0x0978, 0x0d78, 0x1178, 0x1578, 0x1978, 0x1d78, \n 0x01f8, 0x05f8, 0x09f8, 0x0df8, 0x11f8, 0x15f8, 0x19f8, 0x1df8, \n 0x0278, 0x0678, 0x0a78, 0x0e78, 0x1278, 0x1678, 0x1a78, 0x1e78, \n 0x02f8, 0x06f8, 0x0af8, 0x0ef8, 0x12f8, 0x16f8, 0x1af8, 0x1ef8, \n 0x0378, 0x0778, 0x0b78, 0x0f78, 0x1378, 0x1778, 0x1b78, 0x1f78, \n 0x03f8, 0x07f8, 0x0bf8, 0x0ff8, 0x13f8, 0x17f8, 0x1bf8, 0x1ff8, \n 0x0000, 0x0400, 0x0800, 0x0c00, 0x1000, 0x1400,\n ];\n\n var colors_lut;\n\n /**\n * This function makes the color lookup table for hires mode.\n * We make a table of 1024 * 2 * 7 entries.\n * Why? Because we assume each color byte has 10 bits\n * (8 real bits + 1 on each side) and we need different colors\n * for odd and even addresses (2) and each byte displays 7 pixels.\n */\n {\n colors_lut = new Array(256*4*2*7);\n var i,j;\n var c1,c2,c3 = 15;\n var base = 0;\n\n // go thru odd and even\n for (j=0; j<2; j++)\n {\n // go thru 1024 values\n for (var b1=0; b1<1024; b1++)\n {\n // see if the hi bit is set\n if ((b1 & 0x80) == 0)\n {\n c1 = 3; c2 = 12; // purple & green\n } else\n {\n c1 = 6; c2 = 9; // blue & orange\n }\n // make a value consisting of:\n // the 8th bit, then bits 0-7, then the 9th bit\n var b = ((b1 & 0x100) >> 8) | ((b1 & 0x7f) << 1) |\n ((b1 & 0x200) >> 1);\n // go through each pixel\n for (i=0; i<7; i++)\n {\n var c;\n // is this pixel lit?\n if (((2<> 4];\n for (i=0; i<4; i++)\n {\n pixels[base] =\n pixels[base+1] =\n pixels[base+2] =\n pixels[base+3] =\n pixels[base+4] =\n pixels[base+5] =\n pixels[base+6] = c;\n base += XSIZE;\n }\n }\n\n function drawTextChar(x, y, b, invert)\n {\n var base = (y<<3)*XSIZE + x*7; // (x<<2) + (x<<1) + x\n var on,off;\n if (invert)\n {\n on = PIXELOFF;\n off = PIXELON;\n } else\n {\n on = PIXELON;\n off = PIXELOFF;\n }\n\n for (var yy=0; yy<8; yy++)\n {\n var chr = apple2_charset[(b<<3)+yy];\n pixels[base] = ((chr & 64) > 0)?on:off;\n pixels[base+1] = ((chr & 32) > 0)?on:off;\n pixels[base+2] = ((chr & 16) > 0)?on:off;\n pixels[base+3] = ((chr & 8) > 0)?on:off;\n pixels[base+4] = ((chr & 4) > 0)?on:off;\n pixels[base+5] = ((chr & 2) > 0)?on:off;\n pixels[base+6] = ((chr & 1) > 0)?on:off;\n base += XSIZE;\n }\n }\n\n this.getAddressForScanline = function(y:number) : number {\n var base = hires_lut[y];\n if ((apple.grswitch & GR_HIRES) && (y < 160 || !(apple.grswitch & GR_MIXMODE)))\n base = base | ((apple.grswitch & GR_PAGE1) ? 0x4000 : 0x2000);\n else\n base = (base & 0x3ff) | ((apple.grswitch & GR_PAGE1) ? 0x800 : 0x400);\n return base;\n }\n\n function drawHiresLines(y, maxy)\n {\n var yb = y*XSIZE;\n for (; y < maxy; y++)\n {\n var base = hires_lut[y] + (((apple.grswitch & GR_PAGE1) != 0) ? 0x4000 : 0x2000);\n if (!apple.dirty[base >> 7])\n {\n yb += XSIZE;\n continue;\n }\n var c1, c2;\n var b = 0;\n var b1 = apple.mem[base] & 0xff;\n for (var x1=0; x1<20; x1++)\n {\n var b2 = apple.mem[base+1] & 0xff;\n var b3 = apple.mem[base+2] & 0xff;\n var d1 = (((b&0x40)<<2) | b1 | b2<<9) & 0x3ff;\n for (var i=0; i<7; i++)\n pixels[yb+i] = colors_lut[d1*7+i];\n var d2 = (((b1&0x40)<<2) | b2 | b3<<9) & 0x3ff;\n for (var i=0; i<7; i++)\n pixels[yb+7+i] = colors_lut[d2*7+7168+i];\n yb += 14;\n base += 2;\n b = b2;\n b1 = b3;\n }\n }\n }\n\n function drawLoresLine(y)\n {\n // get the base address of this line\n var base = text_lut[y] +\n (((apple.grswitch & GR_PAGE1) != 0) ? 0x800 : 0x400);\n //\t\tif (!dirty[base >> 7])\n //\t\t return;\n for (var x=0; x<40; x++)\n {\n var b = apple.mem[base+x] & 0xff;\n // if the char. changed, draw it\n if (b != textbuf[y*40+x])\n {\n drawLoresChar(x, y, b);\n textbuf[y*40+x] = b;\n }\n }\n }\n\n function drawTextLine(y, flash)\n {\n // get the base address of this line\n var base = text_lut[y] +\n (((apple.grswitch & GR_PAGE1) != 0) ? 0x800 : 0x400);\n //\t\tif (!dirty[base >> 7])\n //\t\t return;\n for (var x=0; x<40; x++)\n {\n var b = apple.mem[base+x] & 0xff;\n var invert;\n // invert flash characters 1/2 of the time\n if (b >= 0x80)\n {\n invert = false;\n } else if (b >= 0x40)\n {\n invert = flash;\n if (flash)\n b -= 0x40;\n else\n b += 0x40;\n } else\n invert = true;\n // if the char. changed, draw it\n if (b != textbuf[y*40+x])\n {\n drawTextChar(x, y, b & 0x7f, invert);\n textbuf[y*40+x] = b;\n }\n }\n }\n\n this.updateScreen = function(totalrepaint)\n {\n var y;\n var flash = (new Date().getTime() % (flashInterval<<1)) > flashInterval;\n\n // if graphics mode changed, repaint whole screen\n if (apple.grswitch != oldgrmode)\n {\n oldgrmode = apple.grswitch;\n totalrepaint = true;\n }\n if (totalrepaint)\n {\n // clear textbuf if in text mode\n if ((apple.grswitch & GR_TXMODE) != 0 || (apple.grswitch & GR_MIXMODE) != 0)\n {\n for (y=0; y<24; y++)\n for (var x=0; x<40; x++)\n textbuf[y*40+x] = -1;\n }\n for (var i=0; i {\n emu : AppleII;\n track_data : Uint8Array;\n \n constructor(emu : AppleII, image : Uint8Array) {\n super();\n this.emu = emu;\n this.data = new Array(NUM_TRACKS);\n for (var i=0; i>1];\n else\n this.track_data = null;\n }\n \n toLongString() {\n return \"Track: \" + (this.track / 2) +\n \"\\nOffset: \" + (this.track_index) +\n \"\\nMode: \" + (this.read_mode ? \"READ\" : \"WRITE\") +\n \"\\nMotor: \" + this.motor +\n \"\\nData: \" + (this.track_data ? hex(this.track_data[this.track_index]) : '-') +\n \"\\n\";\n }\n \n read_latch() : number {\n this.track_index = (this.track_index + 1) % TRACK_SIZE;\n if (this.track_data) {\n return (this.track_data[this.track_index] & 0xff);\n } else\n return this.emu.floatbus() | 0x80;\n }\n\n write_latch(value: number) {\n this.track_index = (this.track_index + 1) % TRACK_SIZE;\n if (this.track_data != null)\n this.track_data[this.track_index] = value;\n }\n \n readROM(address) { return DISKII_PROM[address]; }\n readConst(address) { return DISKII_PROM[address]; }\n read(address) { return this.doIO(address, 0); }\n write(address, value) { this.doIO(address, value); }\n\n doIO(address, value) : number \n {\n switch (address & 0x0f)\n {\n /*\n * Turn motor phases 0 to 3 on. Turning on the previous phase + 1\n * increments the track position, turning on the previous phase - 1\n * decrements the track position. In this scheme phase 0 and 3 are\n * considered to be adjacent. The previous phase number can be\n * computed as the track number % 4.\n */\n case 0x1:\n case 0x3:\n case 0x5:\n case 0x7:\n var phase, lastphase, new_track;\n new_track = this.track;\n phase = (address >> 1) & 3;\n\n // if new phase is even and current phase is odd\n if (phase == ((new_track - 1) & 3))\n {\n if (new_track > 0)\n new_track--;\n } else\n if (phase == ((new_track + 1) & 3))\n {\n if (new_track < NUM_TRACKS*2-1)\n new_track++;\n }\n if ((new_track & 1) == 0)\n {\n this.track_data = this.data[new_track>>1];\n console.log('track', new_track/2);\n } else\n this.track_data = null;\n this.track = new_track;\n break;\n /*\n * Turn drive motor off.\n */\n case 0x8:\n this.motor = false;\n break;\n /*\n * Turn drive motor on.\n */\n case 0x9:\n this.motor = true;\n break; \n /*\n * Select drive 1.\n */\n case 0xa:\n //drive = 0;\n break;\n /*\n * Select drive 2.\n */\n case 0xb:\n //drive = 1;\n break;\n /*\n * Select write mode.\n */\n case 0xf:\n this.read_mode = false;\n /*\n * Read a disk byte if read mode is active.\n */\n case 0xC:\n if (this.read_mode)\n return this.read_latch();\n break;\n /*\n * Select read mode and read the write protect status.\n */\n case 0xE:\n this.read_mode = true;\n /*\n * Write a disk byte if write mode is active and the disk is not\n * write protected.\n */\n case 0xD:\n if (value >= 0 && !this.read_mode && !this.write_protect)\n this.write_latch(value);\n /*\n * Read the write protect status only.\n */\n return this.write_protect ? 0x80 : 0x00;\n }\n return this.emu.floatbus();\n }\n\n}\n\n/* --------------- TRACK CONVERSION ROUTINES ---------------------- */\n\n /*\n * Normal byte (lower six bits only) -> disk byte translation table.\n */\n const byte_translation = [\n 0x96, 0x97, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa6,\n 0xa7, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb2, 0xb3,\n 0xb4, 0xb5, 0xb6, 0xb7, 0xb9, 0xba, 0xbb, 0xbc,\n 0xbd, 0xbe, 0xbf, 0xcb, 0xcd, 0xce, 0xcf, 0xd3,\n 0xd6, 0xd7, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde,\n 0xdf, 0xe5, 0xe6, 0xe7, 0xe9, 0xea, 0xeb, 0xec,\n 0xed, 0xee, 0xef, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,\n 0xf7, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff\n ];\n\n /*\n * Sector skewing table.\n */\n\n const skewing_table = [\n 0,7,14,6,13,5,12,4,11,3,10,2,9,1,8,15\n ];\n\n/*\n * Encode a 256-byte sector as SECTOR_SIZE disk bytes as follows:\n *\n * 14 sync bytes\n * 3 address header bytes\n * 8 address block bytes\n * 3 address trailer bytes\n * 6 sync bytes\n * 3 data header bytes\n * 343 data block bytes\n * 3 data trailer bytes\n */\n function nibblizeSector(vol, trk, sector, inn, in_ofs, out, i)\n {\n var loop, checksum, prev_value, value;\n var sector_buffer = new Uint8Array(258);\n value = 0;\n\n /*\n * Step 1: write 6 sync bytes (0xff's). Normally these would be\n * written as 10-bit bytes with two extra zero bits, but for the\n * purpose of emulation normal 8-bit bytes will do, since the\n * emulated drive will always be in sync.\n */\n for (loop = 0; loop < 14; loop++)\n out[i++] = 0xff;\n\n /*\n * Step 2: write the 3-byte address header (0xd5 0xaa 0x96).\n */\n out[i++] = 0xd5;\n out[i++] = 0xaa;\n out[i++] = 0x96;\n\n /*\n * Step 3: write the address block. Use 4-and-4 encoding to convert\n * the volume, track and sector and checksum into 2 disk bytes each.\n * The checksum is a simple exclusive OR of the first three values.\n */\n out[i++] = ((vol >> 1) | 0xaa);\n out[i++] = (vol | 0xaa);\n checksum = vol;\n out[i++] = ((trk >> 1) | 0xaa);\n out[i++] = (trk | 0xaa);\n checksum ^= trk;\n out[i++] = ((sector >> 1) | 0xaa);\n out[i++] = (sector | 0xaa);\n checksum ^= sector;\n out[i++] = ((checksum >> 1) | 0xaa);\n out[i++] = (checksum | 0xaa);\n\n /*\n * Step 4: write the 3-byte address trailer (0xde 0xaa 0xeb).\n */\n out[i++] = (0xde);\n out[i++] = (0xaa);\n out[i++] = (0xeb);\n\n /*\n * Step 5: write another 6 sync bytes.\n */\n for (loop = 0; loop < 6; loop++)\n out[i++] = (0xff);\n\n /*\n * Step 6: write the 3-byte data header.\n */\n out[i++] = (0xd5);\n out[i++] = (0xaa);\n out[i++] = (0xad);\n\n /*\n * Step 7: read the next 256-byte sector from the old disk image file,\n * and add two zero bytes to bring the number of bytes up to a multiple\n * of 3.\n */\n for (loop = 0; loop < 256; loop++)\n sector_buffer[loop] = inn[loop + in_ofs] & 0xff;\n sector_buffer[256] = 0;\n sector_buffer[257] = 0; \n\n /*\n * Step 8: write the first 86 disk bytes of the data block, which\n * encodes the bottom two bits of each sector byte into six-bit\n * values as follows:\n *\n * disk byte n, bit 0 = sector byte n, bit 1\n * disk byte n, bit 1 = sector byte n, bit 0\n * disk byte n, bit 2 = sector byte n + 86, bit 1\n * disk byte n, bit 3 = sector byte n + 86, bit 0\n * disk byte n, bit 4 = sector byte n + 172, bit 1\n * disk byte n, bit 5 = sector byte n + 172, bit 0\n *\n * The scheme allows each pair of bits to be shifted to the right out\n * of the disk byte, then shifted to the left into the sector byte.\n *\n * Before the 6-bit value is translated to a disk byte, it is exclusive\n * ORed with the previous 6-bit value, hence the values written are\n * really a running checksum.\n */\n prev_value = 0;\n for (loop = 0; loop < 86; loop++)\n {\n value = (sector_buffer[loop] & 0x01) << 1;\n value |= (sector_buffer[loop] & 0x02) >> 1;\n value |= (sector_buffer[loop + 86] & 0x01) << 3;\n value |= (sector_buffer[loop + 86] & 0x02) << 1;\n value |= (sector_buffer[loop + 172] & 0x01) << 5;\n value |= (sector_buffer[loop + 172] & 0x02) << 3;\n out[i++] = (byte_translation[value ^ prev_value]);\n prev_value = value;\n } \n\n /*\n * Step 9: write the last 256 disk bytes of the data block, which\n * encodes the top six bits of each sector byte. Again, each value\n * is exclusive ORed with the previous value to create a running\n * checksum (the first value is exclusive ORed with the last value of\n * the previous step).\n */\n\n for (loop = 0; loop < 256; loop++)\n {\n value = (sector_buffer[loop] >> 2);\n out[i++] = (byte_translation[value ^ prev_value]);\n prev_value = value;\n }\n\n /*\n * Step 10: write the last value as the checksum.\n */\n out[i++] = (byte_translation[value]);\n\n /*\n * Step 11: write the 3-byte data trailer.\n */\n out[i++] = (0xde);\n out[i++] = (0xaa);\n out[i++] = (0xeb);\n\n }\n\n function nibblizeTrack(vol, trk, inn)\n {\n var out = new Uint8Array(TRACK_SIZE);\n var out_pos = 0;\n for (var sector = 0; sector < 16; sector++) {\n nibblizeSector(vol, trk, sector,\n inn, skewing_table[sector] << 8,\n out, out_pos);\n out_pos += SECTOR_SIZE;\n }\n while (out_pos < TRACK_SIZE)\n out[out_pos++] = (0xff);\n return out;\n }\n\n\n", "\nimport { Platform, Preset, getOpcodeMetadata_6502, getToolForFilename_6502 } from \"../common/baseplatform\";\nimport { PLATFORMS } from \"../common/emu\";\nimport { AppleII } from \"../machine/apple2\";\nimport { Base6502MachinePlatform } from \"../common/baseplatform\";\nimport { CodeAnalyzer_apple2 } from \"../common/analysis\";\nimport { BaseMAME6502Platform } from \"../common/mameplatform\";\n\nconst APPLE2_PRESETS : Preset[] = [\n {id:'sieve.c', name:'Sieve', category:\"C\"},\n {id:'keyboardtest.c', name:'Keyboard Test'},\n {id:'mandel.c', name:'Mandelbrot'},\n {id:'tgidemo.c', name:'TGI Graphics Demo'},\n {id:'Eliza.c', name:'Eliza'},\n {id:'siegegame.c', name:'Siege Game'},\n {id:'cosmic.c', name:'Cosmic Impalas'},\n {id:'farmhouse.c', name:\"Farmhouse Adventure\"},\n {id:'yum.c', name:\"Yum Dice Game\"},\n {id:'lz4test.c', name:\"LZ4 Decompressor\"},\n {id:'hgrtest.a', name:\"HGR Test\", category:\"Assembly Language\"},\n {id:'conway.a', name:\"Conway's Game of Life\"},\n {id:'lz4fh.a', name:\"LZ4FH Decompressor\"},\n {id:'deltamod.dasm', name:\"Delta Modulation Audio\"},\n// {id:'zap.dasm', name:\"ZAP!\"},\n// {id:'tb_6502.s', name:'Tom Bombem (assembler game)'},\n];\n\n/// MAME support\n\nclass Apple2MAMEPlatform extends BaseMAME6502Platform implements Platform {\n\n start () {\n this.startModule(this.mainElement, {\n jsfile:'mame8bitpc.js',\n biosfile:['apple2e.zip'],\n //cfgfile:'nes.cfg',\n driver:'apple2e',\n width:280*2,\n height:192*2,\n //romfn:'/emulator/cart.nes',\n //romsize:romSize,\n //romdata:new lzgmini().decode(lzgRom).slice(0, romSize),\n preInit:function(_self) {\n },\n });\n }\n\n getOpcodeMetadata = getOpcodeMetadata_6502;\n getDefaultExtension () { return \".c\"; };\n getToolForFilename = getToolForFilename_6502;\n\n getPresets () { return APPLE2_PRESETS; }\n\n loadROM (title, data) {\n this.loadROMFile(data);\n // TODO\n }\n}\n\n///\n\nclass NewApple2Platform extends Base6502MachinePlatform implements Platform {\n\n newMachine() { return new AppleII(); }\n getPresets() { return APPLE2_PRESETS; }\n getDefaultExtension() { return \".c\"; };\n readAddress(a) { return this.machine.readConst(a); }\n // TODO loadBIOS(bios)\t{ this.machine.loadBIOS(a); }\n getMemoryMap = function() { return { main:[\n {name:'Zero Page RAM',start:0x0,size:0x100,type:'ram'},\n {name:'Line Input RAM',start:0x200,size:0x100,type:'ram'},\n {name:'RAM',start:0x300,size:0xc0,type:'ram'},\n {name:'DOS Vectors',start:0x3c0,size:0x40,type:'ram'},\n {name:'Text/Lores Page 1',start:0x400,size:0x400,type:'ram'},\n {name:'RAM',start:0x800,size:0x1800,type:'ram'},\n {name:'Hires Page 1',start:0x2000,size:0x2000,type:'ram'},\n {name:'Hires Page 2',start:0x4000,size:0x2000,type:'ram'},\n {name:'RAM',start:0x6000,size:0x6000,type:'ram'},\n {name:'I/O',start:0xc000,size:0x1000,type:'io'},\n {name:'ROM',start:0xd000,size:0x3000,type:'rom'},\n ] } };\n getROMExtension(rom:Uint8Array) {\n if (rom && rom.length == 35*16*256) return \".dsk\"; // DSK image\n return \".bin\";\n };\n getToolForFilename = (fn:string) : string => {\n if (fn.endsWith(\".lnk\")) return \"merlin32\";\n else return getToolForFilename_6502(fn);\n }\n /*\n newCodeAnalyzer() {\n return new CodeAnalyzer_apple2(this);\n }\n getOriginPC() {\n return 0x803; // TODO?\n }\n */\n}\n\nPLATFORMS['apple2.mame'] = Apple2MAMEPlatform;\nPLATFORMS['apple2'] = NewApple2Platform;\n"], - "mappings": "qOA6BO,mBAAsB,EAA4C,CAsFvE,aAAc,CACZ,QApFF,kBAAe,QACf,gBAAa,KAAK,aAClB,sBAAmB,GACnB,uBAAoB,KAAK,iBAAm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MAAO,CAAE,KAAK,CACtC,CAAC,KAAK,gBAAgB,MAAM,EAAI,KAAK,IAAM,KAAK,OAChD,CAAC,KAAK,iBAAiB,MAAM,IAAM,KAAK,IAAM,KAAK,OACnD,CAAC,KAAK,MAAM,MAAM,IAAM,KAAK,IAAK,KAAK,OACvC,CAAC,KAAK,cAAc,MAAM,IAAM,KAAK,GAAK,KAAK,OAC/C,CAAC,KAAK,oBAAoB,MAAM,KAAM,KAAK,KAAM,KAAK,OACtD,CAAC,KAAK,MAAM,MAAM,KAAM,KAAK,KAAO,KAAK,OACzC,CAAC,KAAK,eAAe,MAAM,KAAO,KAAK,KAAO,KAAK,OACnD,CAAC,KAAK,eAAe,MAAM,MAAO,KAAK,KAAO,KAAK,OACnD,CAAC,KAAK,MAAM,MAAM,MAAO,KAAK,MAAO,KAAK,OAC1C,CAAC,KAAK,MAAM,MAAM,MAAO,KAAK,KAAO,KAAK,MAC1C,CAAC,KAAK,MAAM,MAAM,MAAO,KAAK,MAAO,KAAK,UAM9C,wBAAqB,AAAC,GAChB,EAAG,SAAS,QAAgB,WACpB,EAAwB,GAxBtC,YAAsB,CAAE,MAAO,IAAI,GACnC,YAAsB,CAAE,MAAO,IAC/B,qBAAsB,CAAE,MAAO,KAC/B,YAAY,EAAU,CAAE,MAAO,MAAK,QAAQ,UAAU,GAetD,gBAAgB,EAAgB,CAC9B,MAAI,IAAO,EAAI,QAAU,GAAG,GAAG,IAAY,OACpC,SAgBX,EAAU,eAAiB,GAC3B,EAAU,OAAY", - "names": [] -} diff --git a/gen/apple2-EBLV7QZ6.js b/gen/apple2-MW55YTTB.js similarity index 99% rename from gen/apple2-EBLV7QZ6.js rename to gen/apple2-MW55YTTB.js index 5535c0d7..0cc54dd8 100644 --- a/gen/apple2-EBLV7QZ6.js +++ b/gen/apple2-MW55YTTB.js @@ -1,4 +1,4 @@ -import{a as t0}from"./chunk-ZE6LZV4I.js";import{B as a0,I as e0,q as $,t as x0,y as U}from"./chunk-ULPRULB6.js";import{J as O,O as b,g as q,i as j,l as W,m as X,s as V,u as l}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var z=class extends ${constructor(){super();this.cpuFrequency=1022727;this.sampleRate=this.cpuFrequency;this.cpuCyclesPerLine=65;this.cpuCyclesPerFrame=this.cpuCyclesPerLine*262;this.canvasWidth=280;this.numVisibleScanlines=192;this.numTotalScanlines=262;this.defaultROMSize=77824;this.LOAD_BASE=0;this.HDR_SIZE=0;this.ram=new Uint8Array(77824);this.cpu=new x0;this.grdirty=new Array(49152>>7);this.grparams={dirty:this.grdirty,grswitch:F,mem:this.ram};this.kbdlatch=0;this.soundstate=0;this.auxRAMselected=!1;this.auxRAMbank=1;this.writeinhibit=!0;this.bank2rdoffset=0;this.bank2wroffset=0;this.slots=new Array(8);this.fakeDrive={readROM:x=>{var a=this.cpu.getPC();if(a>=50688&&a<50944)switch(x){case 0:return 0;case 1:return this.LOAD_BASE&255;case 2:return this.LOAD_BASE>>8&255;default:return 0}else switch(x){case 0:return this.rom&&this.loadRAMWithProgram(),76;case 1:return 32;case 3:return 0;case 5:return 3;case 7:return 60;default:return 0}},readConst:x=>0,read:x=>this.floatbus(),write:(x,a)=>{}};this.loadBIOS(new W().decode(X(atob(u0)))),this.connectCPUMemoryBus(this),this.bios[54170-(65536-this.bios.length)]=96}saveState(){return{c:this.cpu.saveState(),ram:this.ram.slice(),kbdlatch:this.kbdlatch,soundstate:this.soundstate,grswitch:this.grparams.grswitch,auxRAMselected:this.auxRAMselected,auxRAMbank:this.auxRAMbank,writeinhibit:this.writeinhibit,slots:this.slots.map(x=>x&&x.saveState&&x.saveState()),inputs:null}}loadState(x){this.cpu.loadState(x.c),this.ram.set(x.ram),this.kbdlatch=x.kbdlatch,this.soundstate=x.soundstate,this.grparams.grswitch=x.grswitch,this.auxRAMselected=x.auxRAMselected,this.auxRAMbank=x.auxRAMbank,this.writeinhibit=x.writeinhibit,this.setupLanguageCardConstants();for(var a=0;a>8!=198);x++);for(var x=0;x<2e6&&(this.cpu.advanceClock(),!(this.cpu.getPC()>>8<198));x++);}readConst(x){if(x<49152)return this.ram[x];if(x>=53248)return this.auxRAMselected?x>=57344?this.ram[x]:this.ram[x+this.bank2rdoffset]:this.bios[x-(65536-this.bios.length)];if(x>=49408&&x<51200){var a=x>>8&7;return(this.slots[a]&&this.slots[a].readConst(x&255))|0}else return 0}read(x){if(x&=65535,x<49152||x>=53248)return this.readConst(x);if(x<49408){this.probe.logIORead(x,0);var a=x>>4&15;switch(a){case 0:return this.kbdlatch;case 1:this.kbdlatch&=127;break;case 3:this.soundstate=this.soundstate^1;break;case 5:(x&15)<8&&((x&1)!=0?this.grparams.grswitch|=1<<(x>>1&7):this.grparams.grswitch&=~(1<<(x>>1&7)));break;case 6:switch(x&7){case 1:case 2:case 3:return this.floatbus()&127;case 4:case 5:return this.floatbus()|128;default:return this.floatbus()}case 7:if(x==49264)return this.floatbus()|128;case 8:return this.doLanguageCardIO(x);case 9:case 10:case 11:case 12:case 13:case 14:case 15:return(this.slots[a-8]&&this.slots[a-8].read(x&15))|0}}else if(x>=49408&&x<51200){var a=x>>8&7;return(this.slots[a]&&this.slots[a].readROM(x&255))|0}return this.floatbus()}write(x,a){if(x&=65535,a&=255,x<49152)this.ram[x]=a,this.grdirty[x>>7]=1;else if(x<49280)this.read(x);else if(x<49408){var e=x>>4&15;this.slots[e-8]&&this.slots[e-8].write(x&15,a),this.probe.logIOWrite(x,a)}else x>=53248&&!this.writeinhibit&&(x>=57344?this.ram[x]=a:this.ram[x+this.bank2wroffset]=a)}floatbus(){var x=this.frameCycles,a=Math.floor(x/65),e=Math.floor(x%65),m=this.ap2disp.getAddressForScanline(a);return this.readConst(m+e)}connectVideo(x){super.connectVideo(x),this.ap2disp=this.pixels&&new A0(this.pixels,this.grparams)}startScanline(){}drawScanline(){}advanceFrame(x){var a=super.advanceFrame(x);return this.ap2disp&&this.ap2disp.updateScreen(),a}advanceCPU(){return this.audio.feedSample(this.soundstate,1),super.advanceCPU()}setKeyInput(x,a,e){if(e&b.KeyDown){switch(a=0,x){case 16:case 17:case 18:break;case 8:if(a=8,e&b.Shift){this.cpu.reset();return}break;case 13:a=13;break;case 27:a=27;break;case 37:a=8;break;case 39:a=21;break;case 38:a=11;break;case 40:a=10;break;case 48:e&b.Shift&&(a=41);break;case 49:e&b.Shift&&(a=33);break;case 50:e&b.Shift&&(a=64);break;case 51:e&b.Shift&&(a=35);break;case 52:e&b.Shift&&(a=36);break;case 53:e&b.Shift&&(a=37);break;case 54:e&b.Shift&&(a=94);break;case 55:e&b.Shift&&(a=38);break;case 56:e&b.Shift&&(a=42);break;case 57:e&b.Shift&&(a=40);break;case 61:a=e&b.Shift?43:61;break;case 173:a=e&b.Shift?95:45;break;case 59:a=e&b.Shift?58:59;break;case 188:a=e&b.Shift?60:44;break;case 190:a=e&b.Shift?62:46;break;case 191:a=e&b.Shift?63:47;break;case 222:a=e&b.Shift?34:39;break;default:a=x,a>=97&&a<=122&&(a-=32),a>=65&&a<65+26&&e&b.Ctrl&&(a-=64)}a&&(this.kbdlatch=(a|128)&255)}}doLanguageCardIO(x){switch(x&15){case 0:case 4:this.auxRAMselected=!0,this.auxRAMbank=2,this.writeinhibit=!0;break;case 1:case 5:this.auxRAMselected=!1,this.auxRAMbank=2,this.writeinhibit=!1;break;case 2:case 6:case 10:case 14:this.auxRAMselected=!1,this.writeinhibit=!0;break;case 3:case 7:this.auxRAMselected=!0,this.auxRAMbank=2,this.writeinhibit=!1;break;case 8:case 12:this.auxRAMselected=!0,this.auxRAMbank=1,this.writeinhibit=!0;break;case 9:case 13:this.auxRAMselected=!1,this.auxRAMbank=1,this.writeinhibit=!1;break;case 11:case 15:this.auxRAMselected=!0,this.auxRAMbank=1,this.writeinhibit=!1;break}return this.setupLanguageCardConstants(),this.floatbus()}setupLanguageCardConstants(){this.auxRAMbank==2?this.bank2rdoffset=-4096:this.bank2rdoffset=12288,this.auxRAMbank==2?this.bank2wroffset=-4096:this.bank2wroffset=12288}getDebugCategories(){return["CPU","Stack","I/O","Disk"]}getDebugInfo(x,a){switch(x){case"I/O":return"AUX RAM Bank: "+a.auxRAMbank+` +import{a as t0}from"./chunk-ZE6LZV4I.js";import{B as a0,I as e0,q as $,t as x0,y as U}from"./chunk-ULPRULB6.js";import{J as O,O as b,g as q,i as j,l as W,m as X,s as V,u as l}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var z=class extends ${constructor(){super();this.cpuFrequency=1022727;this.sampleRate=this.cpuFrequency;this.cpuCyclesPerLine=65;this.cpuCyclesPerFrame=this.cpuCyclesPerLine*262;this.canvasWidth=280;this.numVisibleScanlines=192;this.numTotalScanlines=262;this.defaultROMSize=77824;this.LOAD_BASE=0;this.HDR_SIZE=0;this.ram=new Uint8Array(77824);this.cpu=new x0;this.grdirty=new Array(49152>>7);this.grparams={dirty:this.grdirty,grswitch:F,mem:this.ram};this.kbdlatch=0;this.soundstate=0;this.auxRAMselected=!1;this.auxRAMbank=1;this.writeinhibit=!0;this.bank2rdoffset=0;this.bank2wroffset=0;this.slots=new Array(8);this.fakeDrive={readROM:x=>{var a=this.cpu.getPC();if(a>=50688&&a<50944)switch(x){case 0:return 0;case 1:return this.LOAD_BASE&255;case 2:return this.LOAD_BASE>>8&255;default:return 0}else switch(x){case 0:return this.rom&&this.loadRAMWithProgram(),76;case 1:return 32;case 3:return 0;case 5:return 3;case 7:return 60;default:return 0}},readConst:x=>0,read:x=>this.floatbus(),write:(x,a)=>{}};this.loadBIOS(new W().decode(X(atob(u0)))),this.connectCPUMemoryBus(this),this.bios[54170-(65536-this.bios.length)]=96}saveState(){return{c:this.cpu.saveState(),ram:this.ram.slice(),kbdlatch:this.kbdlatch,soundstate:this.soundstate,grswitch:this.grparams.grswitch,auxRAMselected:this.auxRAMselected,auxRAMbank:this.auxRAMbank,writeinhibit:this.writeinhibit,slots:this.slots.map(x=>x&&x.saveState&&x.saveState()),inputs:null}}loadState(x){this.cpu.loadState(x.c),this.ram.set(x.ram),this.kbdlatch=x.kbdlatch,this.soundstate=x.soundstate,this.grparams.grswitch=x.grswitch,this.auxRAMselected=x.auxRAMselected,this.auxRAMbank=x.auxRAMbank,this.writeinhibit=x.writeinhibit,this.setupLanguageCardConstants();for(var a=0;a>8!=198);x++);for(var x=0;x<2e6&&(this.cpu.advanceClock(),!(this.cpu.getPC()>>8<198));x++);}readConst(x){if(x<49152)return this.ram[x];if(x>=53248)return this.auxRAMselected?x>=57344?this.ram[x]:this.ram[x+this.bank2rdoffset]:this.bios[x-(65536-this.bios.length)];if(x>=49408&&x<51200){var a=x>>8&7;return(this.slots[a]&&this.slots[a].readConst(x&255))|0}else return 0}read(x){if(x&=65535,x<49152||x>=53248)return this.readConst(x);if(x<49408){this.probe.logIORead(x,0);var a=x>>4&15;switch(a){case 0:return this.kbdlatch;case 1:this.kbdlatch&=127;break;case 3:this.soundstate=this.soundstate^1;break;case 5:(x&15)<8&&((x&1)!=0?this.grparams.grswitch|=1<<(x>>1&7):this.grparams.grswitch&=~(1<<(x>>1&7)));break;case 6:switch(x&7){case 1:case 2:case 3:return this.floatbus()&127;case 4:case 5:return this.floatbus()|128;default:return this.floatbus()}case 7:if(x==49264)return this.floatbus()|128;case 8:return this.doLanguageCardIO(x);case 9:case 10:case 11:case 12:case 13:case 14:case 15:return(this.slots[a-8]&&this.slots[a-8].read(x&15))|0}}else if(x>=49408&&x<51200){var a=x>>8&7;return(this.slots[a]&&this.slots[a].readROM(x&255))|0}return this.floatbus()}write(x,a){if(x&=65535,a&=255,x<49152)this.ram[x]=a,this.grdirty[x>>7]=1;else if(x<49296)this.read(x);else if(x<49408){var e=x>>4&15;this.slots[e-8]&&this.slots[e-8].write(x&15,a),this.probe.logIOWrite(x,a)}else x>=53248&&!this.writeinhibit&&(x>=57344?this.ram[x]=a:this.ram[x+this.bank2wroffset]=a)}floatbus(){var x=this.frameCycles,a=Math.floor(x/65),e=Math.floor(x%65),m=this.ap2disp.getAddressForScanline(a);return this.readConst(m+e)}connectVideo(x){super.connectVideo(x),this.ap2disp=this.pixels&&new A0(this.pixels,this.grparams)}startScanline(){}drawScanline(){}advanceFrame(x){var a=super.advanceFrame(x);return this.ap2disp&&this.ap2disp.updateScreen(),a}advanceCPU(){return this.audio.feedSample(this.soundstate,1),super.advanceCPU()}setKeyInput(x,a,e){if(e&b.KeyDown){switch(a=0,x){case 16:case 17:case 18:break;case 8:if(a=8,e&b.Shift){this.cpu.reset();return}break;case 13:a=13;break;case 27:a=27;break;case 37:a=8;break;case 39:a=21;break;case 38:a=11;break;case 40:a=10;break;case 48:e&b.Shift&&(a=41);break;case 49:e&b.Shift&&(a=33);break;case 50:e&b.Shift&&(a=64);break;case 51:e&b.Shift&&(a=35);break;case 52:e&b.Shift&&(a=36);break;case 53:e&b.Shift&&(a=37);break;case 54:e&b.Shift&&(a=94);break;case 55:e&b.Shift&&(a=38);break;case 56:e&b.Shift&&(a=42);break;case 57:e&b.Shift&&(a=40);break;case 61:a=e&b.Shift?43:61;break;case 173:a=e&b.Shift?95:45;break;case 59:a=e&b.Shift?58:59;break;case 188:a=e&b.Shift?60:44;break;case 190:a=e&b.Shift?62:46;break;case 191:a=e&b.Shift?63:47;break;case 222:a=e&b.Shift?34:39;break;default:a=x,a>=97&&a<=122&&(a-=32),a>=65&&a<65+26&&e&b.Ctrl&&(a-=64)}a&&(this.kbdlatch=(a|128)&255)}}doLanguageCardIO(x){switch(x&15){case 0:case 4:this.auxRAMselected=!0,this.auxRAMbank=2,this.writeinhibit=!0;break;case 1:case 5:this.auxRAMselected=!1,this.auxRAMbank=2,this.writeinhibit=!1;break;case 2:case 6:case 10:case 14:this.auxRAMselected=!1,this.writeinhibit=!0;break;case 3:case 7:this.auxRAMselected=!0,this.auxRAMbank=2,this.writeinhibit=!1;break;case 8:case 12:this.auxRAMselected=!0,this.auxRAMbank=1,this.writeinhibit=!0;break;case 9:case 13:this.auxRAMselected=!1,this.auxRAMbank=1,this.writeinhibit=!1;break;case 11:case 15:this.auxRAMselected=!0,this.auxRAMbank=1,this.writeinhibit=!1;break}return this.setupLanguageCardConstants(),this.floatbus()}setupLanguageCardConstants(){this.auxRAMbank==2?this.bank2rdoffset=-4096:this.bank2rdoffset=12288,this.auxRAMbank==2?this.bank2wroffset=-4096:this.bank2wroffset=12288}getDebugCategories(){return["CPU","Stack","I/O","Disk"]}getDebugInfo(x,a){switch(x){case"I/O":return"AUX RAM Bank: "+a.auxRAMbank+` AUX RAM Select: `+a.auxRAMselected+` AUX RAM Write: `+!a.writeinhibit+` @@ -10,4 +10,4 @@ Mode: `+(this.read_mode?"READ":"WRITE")+` Motor: `+this.motor+` Data: `+(this.track_data?q(this.track_data[this.track_index]):"-")+` `}read_latch(){return this.track_index=(this.track_index+1)%_,this.track_data?this.track_data[this.track_index]&255:this.emu.floatbus()|128}write_latch(x){this.track_index=(this.track_index+1)%_,this.track_data!=null&&(this.track_data[this.track_index]=x)}readROM(x){return r0[x]}readConst(x){return r0[x]}read(x){return this.doIO(x,0)}write(x,a){this.doIO(x,a)}doIO(x,a){switch(x&15){case 1:case 3:case 5:case 7:var e,m,t;t=this.track,e=x>>1&3,e==(t-1&3)?t>0&&t--:e==(t+1&3)&&t>1],console.log("track",t/2)):this.track_data=null,this.track=t;break;case 8:this.motor=!1;break;case 9:this.motor=!0;break;case 10:break;case 11:break;case 15:this.read_mode=!1;case 12:if(this.read_mode)return this.read_latch();break;case 14:this.read_mode=!0;case 13:return a>=0&&!this.read_mode&&!this.write_protect&&this.write_latch(a),this.write_protect?128:0}return this.emu.floatbus()}},N=[150,151,154,155,157,158,159,166,167,171,172,173,174,175,178,179,180,181,182,183,185,186,187,188,189,190,191,203,205,206,207,211,214,215,217,218,219,220,221,222,223,229,230,231,233,234,235,236,237,238,239,242,243,244,245,246,247,249,250,251,252,253,254,255],g0=[0,7,14,6,13,5,12,4,11,3,10,2,9,1,8,15];function k0(s,x,a,e,m,t,n){var c,D,C,u,g=new Uint8Array(258);for(u=0,c=0;c<14;c++)t[n++]=255;for(t[n++]=213,t[n++]=170,t[n++]=150,t[n++]=s>>1|170,t[n++]=s|170,D=s,t[n++]=x>>1|170,t[n++]=x|170,D^=x,t[n++]=a>>1|170,t[n++]=a|170,D^=a,t[n++]=D>>1|170,t[n++]=D|170,t[n++]=222,t[n++]=170,t[n++]=235,c=0;c<6;c++)t[n++]=255;for(t[n++]=213,t[n++]=170,t[n++]=173,c=0;c<256;c++)g[c]=e[c+m]&255;for(g[256]=0,g[257]=0,C=0,c=0;c<86;c++)u=(g[c]&1)<<1,u|=(g[c]&2)>>1,u|=(g[c+86]&1)<<3,u|=(g[c+86]&2)<<1,u|=(g[c+172]&1)<<5,u|=(g[c+172]&2)<<3,t[n++]=N[u^C],C=u;for(c=0;c<256;c++)u=g[c]>>2,t[n++]=N[u^C],C=u;t[n++]=N[u],t[n++]=222,t[n++]=170,t[n++]=235}function S0(s,x,a){for(var e=new Uint8Array(_),m=0,t=0;t<16;t++)k0(s,x,t,a,g0[t]<<8,e,m),m+=d0;for(;m<_;)e[m++]=255;return e}var c0=[{id:"sieve.c",name:"Sieve",category:"C"},{id:"keyboardtest.c",name:"Keyboard Test"},{id:"mandel.c",name:"Mandelbrot"},{id:"tgidemo.c",name:"TGI Graphics Demo"},{id:"Eliza.c",name:"Eliza"},{id:"siegegame.c",name:"Siege Game"},{id:"cosmic.c",name:"Cosmic Impalas"},{id:"farmhouse.c",name:"Farmhouse Adventure"},{id:"yum.c",name:"Yum Dice Game"},{id:"lz4test.c",name:"LZ4 Decompressor"},{id:"hgrtest.a",name:"HGR Test",category:"Assembly Language"},{id:"conway.a",name:"Conway's Game of Life"},{id:"lz4fh.a",name:"LZ4FH Decompressor"},{id:"deltamod.dasm",name:"Delta Modulation Audio"}],n0=class extends t0{constructor(){super(...arguments);this.getOpcodeMetadata=a0;this.getToolForFilename=U}start(){this.startModule(this.mainElement,{jsfile:"mame8bitpc.js",biosfile:["apple2e.zip"],driver:"apple2e",width:280*2,height:192*2,preInit:function(x){}})}getDefaultExtension(){return".c"}getPresets(){return c0}loadROM(x,a){this.loadROMFile(a)}},f0=class extends e0{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"Zero Page RAM",start:0,size:256,type:"ram"},{name:"Line Input RAM",start:512,size:256,type:"ram"},{name:"RAM",start:768,size:192,type:"ram"},{name:"DOS Vectors",start:960,size:64,type:"ram"},{name:"Text/Lores Page 1",start:1024,size:1024,type:"ram"},{name:"RAM",start:2048,size:6144,type:"ram"},{name:"Hires Page 1",start:8192,size:8192,type:"ram"},{name:"Hires Page 2",start:16384,size:8192,type:"ram"},{name:"RAM",start:24576,size:24576,type:"ram"},{name:"I/O",start:49152,size:4096,type:"io"},{name:"ROM",start:53248,size:12288,type:"rom"}]}};this.getToolForFilename=x=>x.endsWith(".lnk")?"merlin32":U(x)}newMachine(){return new z}getPresets(){return c0}getDefaultExtension(){return".c"}readAddress(x){return this.machine.readConst(x)}getROMExtension(x){return x&&x.length==35*16*256?".dsk":".bin"}};O["apple2.mame"]=n0;O.apple2=f0; -//# sourceMappingURL=apple2-EBLV7QZ6.js.map +//# sourceMappingURL=apple2-MW55YTTB.js.map diff --git a/gen/apple2-MW55YTTB.js.map b/gen/apple2-MW55YTTB.js.map new file mode 100644 index 00000000..9c8cd2a8 --- /dev/null +++ b/gen/apple2-MW55YTTB.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/machine/apple2.ts", "../src/platform/apple2.ts"], + "sourcesContent": ["\nimport { MOS6502, MOS6502State } from \"../common/cpu/MOS6502\";\nimport { Bus, BasicScanlineMachine, SavesState, AcceptsBIOS } from \"../common/devices\";\nimport { KeyFlags } from \"../common/emu\"; // TODO\nimport { hex, lzgmini, stringToByteArray, RGBA, printFlags, arrayCompare } from \"../common/util\";\n\ninterface AppleIIStateBase {\n ram : Uint8Array;\n soundstate : number;\n auxRAMselected,writeinhibit : boolean;\n auxRAMbank : number;\n}\n\ninterface AppleIIControlsState {\n inputs : Uint8Array; // unused?\n kbdlatch : number;\n}\n\ninterface AppleIIState extends AppleIIStateBase, AppleIIControlsState {\n c : MOS6502State;\n grswitch : number;\n slots: SlotDevice[];\n}\n\ninterface SlotDevice extends Bus {\n readROM(address: number) : number;\n readConst(address: number) : number;\n}\n\nexport class AppleII extends BasicScanlineMachine implements AcceptsBIOS {\n\n // approx: http://www.cs.columbia.edu/~sedwards/apple2fpga/\n cpuFrequency = 1022727;\n sampleRate = this.cpuFrequency;\n cpuCyclesPerLine = 65;\n cpuCyclesPerFrame = this.cpuCyclesPerLine * 262;\n canvasWidth = 280;\n numVisibleScanlines = 192;\n numTotalScanlines = 262;\n defaultROMSize = 0x13000; // we'll never need one that big, but...\n\n // these are set later\n LOAD_BASE = 0;\n HDR_SIZE = 0;\n\n ram = new Uint8Array(0x13000); // 64K + 16K LC RAM - 4K hardware + 12K ROM\n bios : Uint8Array;\n cpu = new MOS6502();\n grdirty = new Array(0xc000 >> 7);\n grparams = {dirty:this.grdirty, grswitch:GR_TXMODE, mem:this.ram};\n ap2disp;\n kbdlatch = 0;\n soundstate = 0;\n // language card switches\n auxRAMselected = false;\n auxRAMbank = 1;\n writeinhibit = true;\n // value to add when reading & writing each of these banks\n // bank 1 is E000-FFFF, bank 2 is D000-DFFF\n bank2rdoffset=0;\n bank2wroffset=0;\n // disk II\n slots : SlotDevice[] = new Array(8);\n // fake disk drive that loads program into RAM\n fakeDrive : SlotDevice = {\n readROM: (a) => {\n var pc = this.cpu.getPC();\n if (pc >= 0xC600 && pc < 0xC700) {\n // We're reading code to EXECUTE.\n // Load the built program directly into memory, and \"read\"\n // a JMP directly to it.\n //console.log(`fakeDrive (EXEC): ${a.toString(16)}`);\n switch (a) {\n // JMP VM_BASE\n case 0:\n // SHOULD load program into RAM here, but have to do it\n // below instead.\n return 0;\n case 1: return this.LOAD_BASE&0xff;\n case 2: return (this.LOAD_BASE>>8)&0xff;\n default: return 0;\n }\n }\n else {\n // We're reading code, but not executing it.\n // This is probably the Monitor routine to identify whether\n // this slot is a Disk ][ drive, so... give it what it wants.\n //console.log(`fakeDrive (NOEX): ${a.toString(16)}`);\n switch (a) {\n case 0:\n // Actually, if we get here, we probably ARE being\n // executed. For some reason, the instruction at $C600\n // gets read for execution, BEFORE the PC gets set to\n // the correct location. So we handle loading the program\n // into RAM and returning the JMP here, instead of above\n // where it would otherwise belong.\n if (this.rom) {\n this.loadRAMWithProgram();\n }\n return 0x4c; // JMP\n case 1: return 0x20;\n case 3: return 0x00;\n case 5: return 0x03;\n case 7: return 0x3c;\n default: return 0;\n }\n }\n },\n readConst: (a) => {\n return 0;\n },\n read: (a) => { return this.floatbus(); },\n write: (a,v) => { }\n };\n\n constructor() {\n super();\n this.loadBIOS(new lzgmini().decode(stringToByteArray(atob(APPLEIIGO_LZG))));\n this.connectCPUMemoryBus(this);\n // This line is inappropriate for real ROMs, but was there for\n // the APPLE][GO ROM, so keeping it only in the constructor, for\n // that special case (in case it really is important for this\n // address to be an RTS).\n this.bios[0xD39A - (0x10000 - this.bios.length)] = 0x60; // $d39a = RTS\n }\n saveState() : AppleIIState {\n // TODO: automagic\n return {\n c: this.cpu.saveState(),\n ram: this.ram.slice(),\n kbdlatch: this.kbdlatch,\n soundstate: this.soundstate,\n grswitch: this.grparams.grswitch,\n auxRAMselected: this.auxRAMselected,\n auxRAMbank: this.auxRAMbank,\n writeinhibit: this.writeinhibit,\n slots: this.slots.map((slot) => { return slot && slot['saveState'] && slot['saveState']() }),\n inputs: null\n };\n }\n loadState(s:AppleIIState) {\n this.cpu.loadState(s.c);\n this.ram.set(s.ram);\n this.kbdlatch = s.kbdlatch;\n this.soundstate = s.soundstate;\n this.grparams.grswitch = s.grswitch;\n this.auxRAMselected = s.auxRAMselected;\n this.auxRAMbank = s.auxRAMbank;\n this.writeinhibit = s.writeinhibit;\n this.setupLanguageCardConstants();\n for (var i=0; i>8) == 0xc6) break;\n }\n // get out of $c600 boot\n for (var i=0; i<2000000; i++) {\n this.cpu.advanceClock();\n if ((this.cpu.getPC()>>8) < 0xc6) break;\n }\n }\n readConst(address: number): number {\n if (address < 0xc000) {\n return this.ram[address];\n } else if (address >= 0xd000) {\n if (!this.auxRAMselected)\n return this.bios[address - (0x10000 - this.bios.length)];\n else if (address >= 0xe000)\n return this.ram[address];\n else\n return this.ram[address + this.bank2rdoffset];\n } else if (address >= 0xc100 && address < 0xc800) {\n var slot = (address >> 8) & 7;\n return (this.slots[slot] && this.slots[slot].readConst(address & 0xff)) | 0;\n } else {\n return 0;\n }\n }\n read(address:number) : number {\n address &= 0xffff;\n if (address < 0xc000 || address >= 0xd000) {\n return this.readConst(address);\n } else if (address < 0xc100) {\n this.probe.logIORead(address, 0); // TODO: value\n var slot = (address >> 4) & 0x0f;\n switch (slot)\n {\n case 0:\n return this.kbdlatch;\n case 1:\n this.kbdlatch &= 0x7f;\n break;\n case 3:\n this.soundstate = this.soundstate ^ 1;\n break;\n case 5:\n if ((address & 0x0f) < 8) {\n // graphics\n if ((address & 1) != 0)\n this.grparams.grswitch |= 1 << ((address >> 1) & 0x07);\n else\n this.grparams.grswitch &= ~(1 << ((address >> 1) & 0x07));\n }\n break;\n case 6:\n // tapein, joystick, buttons\n switch (address & 7) {\n // buttons (off)\n case 1:\n case 2:\n case 3:\n return this.floatbus() & 0x7f;\n // joystick\n case 4:\n case 5:\n return this.floatbus() | 0x80;\n default:\n return this.floatbus();\n }\n case 7:\n // joy reset\n if (address == 0xc070)\n return this.floatbus() | 0x80;\n case 8:\n return this.doLanguageCardIO(address);\n case 9: case 10: case 11: case 12: case 13: case 14: case 15:\n return (this.slots[slot-8] && this.slots[slot-8].read(address & 0xf)) | 0;\n }\n } else if (address >= 0xc100 && address < 0xc800) {\n var slot = (address >> 8) & 7;\n return (this.slots[slot] && this.slots[slot].readROM(address & 0xff)) | 0;\n }\n return this.floatbus();\n }\n write(address:number, val:number) : void {\n address &= 0xffff;\n val &= 0xff;\n if (address < 0xc000) {\n this.ram[address] = val;\n this.grdirty[address>>7] = 1;\n } else if (address < 0xc090) {\n this.read(address); // strobe address, discard result\n } else if (address < 0xc100) {\n var slot = (address >> 4) & 0x0f;\n this.slots[slot-8] && this.slots[slot-8].write(address & 0xf, val);\n this.probe.logIOWrite(address, val);\n } else if (address >= 0xd000 && !this.writeinhibit) {\n if (address >= 0xe000)\n this.ram[address] = val;\n else\n this.ram[address + this.bank2wroffset] = val;\n }\n }\n // http://www.deater.net/weave/vmwprod/megademo/vapor_lock.html\n // https://retrocomputing.stackexchange.com/questions/14012/what-is-dram-refresh-and-why-is-the-weird-apple-ii-video-memory-layout-affected\n // http://www.apple-iigs.info/doc/fichiers/TheappleIIcircuitdescription1.pdf\n // http://rich12345.tripod.com/aiivideo/softalk.html\n // https://github.com/MiSTer-devel/Apple-II_MiSTer/blob/master/rtl/timing_generator.vhd\n floatbus() : number {\n var fcyc = this.frameCycles;\n var yline = Math.floor(fcyc / 65);\n var xcyc = Math.floor(fcyc % 65);\n var addr = this.ap2disp.getAddressForScanline(yline);\n return this.readConst(addr + xcyc);\n }\n\n connectVideo(pixels:Uint32Array) {\n super.connectVideo(pixels);\n this.ap2disp = this.pixels && new Apple2Display(this.pixels, this.grparams);\n }\n startScanline() {\n }\n drawScanline() {\n // TODO: draw scanline via ap2disp\n }\n advanceFrame(trap) : number {\n var clocks = super.advanceFrame(trap);\n this.ap2disp && this.ap2disp.updateScreen();\n return clocks;\n }\n advanceCPU() {\n this.audio.feedSample(this.soundstate, 1);\n return super.advanceCPU();\n }\n\n setKeyInput(key:number, code:number, flags:number) : void {\n //console.log(`setKeyInput: ${key} ${code} ${flags}`);\n if (flags & KeyFlags.KeyDown) {\n code = 0;\n switch (key) {\n case 16: case 17: case 18:\n break; // ignore shift/ctrl/etc\n case 8:\n code=8; // left\n if (flags & KeyFlags.Shift) {\n // (possibly) soft reset\n this.cpu.reset();\n return;\n }\n break;\n case 13: code=13; break; // return\n case 27: code=27; break; // escape\n case 37: code=8; break; // left\n case 39: code=21; break; // right\n case 38: code=11; break; // up\n case 40: code=10; break; // down\n case 48: if (flags & KeyFlags.Shift) code = 0x29; break; // )\n case 49: if (flags & KeyFlags.Shift) code = 0x21; break; // !\n case 50: if (flags & KeyFlags.Shift) code = 0x40; break; // @\n case 51: if (flags & KeyFlags.Shift) code = 0x23; break; // #\n case 52: if (flags & KeyFlags.Shift) code = 0x24; break; // $\n case 53: if (flags & KeyFlags.Shift) code = 0x25; break; // %\n case 54: if (flags & KeyFlags.Shift) code = 0x5e; break; // ^\n case 55: if (flags & KeyFlags.Shift) code = 0x26; break; // &\n case 56: if (flags & KeyFlags.Shift) code = 0x2a; break; // *\n case 57: if (flags & KeyFlags.Shift) code = 0x28; break; // (\n case 61: code = (flags & KeyFlags.Shift) ? 0x2b : 0x3d; break; // +\n case 173: code = (flags & KeyFlags.Shift) ? 0x5f : 0x2d; break; // _\n case 59: code = (flags & KeyFlags.Shift) ? 0x3a : 0x3b; break;\n case 188: code = (flags & KeyFlags.Shift) ? 0x3c : 0x2c; break;\n case 190: code = (flags & KeyFlags.Shift) ? 0x3e : 0x2e; break;\n case 191: code = (flags & KeyFlags.Shift) ? 0x3f : 0x2f; break;\n case 222: code = (flags & KeyFlags.Shift) ? 0x22 : 0x27; break;\n default:\n code = key;\n // convert to uppercase for Apple ][\n if (code >= 0x61 && code <= 0x7a) code -= 32;\n // convert to control codes if Ctrl pressed\n if (code >= 65 && code < 65+26) {\n if (flags & KeyFlags.Ctrl) code -= 64; // ctrl\n }\n }\n if (code) {\n this.kbdlatch = (code | 0x80) & 0xff;\n }\n }\n }\n \n doLanguageCardIO(address:number) {\n // TODO: require two writes in a row for some things\n switch (address & 0x0f) {\n // Select aux RAM bank 2, write protected.\n case 0x0:\n case 0x4:\n this.auxRAMselected = true;\n this.auxRAMbank = 2;\n this.writeinhibit = true;\n break;\n // Select ROM, write enable aux RAM bank 2.\n case 0x1:\n case 0x5:\n this.auxRAMselected = false;\n this.auxRAMbank = 2;\n this.writeinhibit = false;\n break;\n // Select ROM, write protect aux RAM (either bank).\n case 0x2:\n case 0x6:\n case 0xA:\n case 0xE:\n this.auxRAMselected = false;\n this.writeinhibit = true;\n break;\n // Select aux RAM bank 2, write enabled.\n case 0x3:\n case 0x7:\n this.auxRAMselected = true;\n this.auxRAMbank = 2;\n this.writeinhibit = false;\n break;\n // Select aux RAM bank 1, write protected.\n case 0x8:\n case 0xC:\n this.auxRAMselected = true;\n this.auxRAMbank = 1;\n this.writeinhibit = true;\n break;\n // Select ROM, write enable aux RAM bank 1.\n case 0x9:\n case 0xD:\n this.auxRAMselected = false;\n this.auxRAMbank = 1;\n this.writeinhibit = false;\n break;\n // Select aux RAM bank 1, write enabled.\n case 0xB:\n case 0xF:\n this.auxRAMselected = true;\n this.auxRAMbank = 1;\n this.writeinhibit = false;\n break;\n }\n this.setupLanguageCardConstants();\n return this.floatbus();\n }\n\n setupLanguageCardConstants() {\n // reset language card constants\n if (this.auxRAMbank == 2)\n this.bank2rdoffset = -0x1000; // map 0xd000-0xdfff -> 0xc000-0xcfff\n else\n this.bank2rdoffset = 0x3000; // map 0xd000-0xdfff -> 0x10000-0x10fff\n if (this.auxRAMbank == 2)\n this.bank2wroffset = -0x1000; // map 0xd000-0xdfff -> 0xc000-0xcfff\n else\n this.bank2wroffset = 0x3000; // map 0xd000-0xdfff -> 0x10000-0x10fff\n }\n\n getDebugCategories() {\n return ['CPU','Stack','I/O','Disk'];\n }\n getDebugInfo(category:string, state:AppleIIState) {\n switch (category) {\n case 'I/O': return \"AUX RAM Bank: \" + state.auxRAMbank + \n \"\\nAUX RAM Select: \" + state.auxRAMselected +\n \"\\nAUX RAM Write: \" + !state.writeinhibit +\n \"\\n\\nGR Switches: \" + printFlags(state.grswitch, [\"Graphics\",\"Mixed\",\"Page2\",\"Hires\"], false) +\n \"\\n\";\n case 'Disk': return (this.slots[6] && this.slots[6]['toLongString'] && this.slots[6]['toLongString']()) || \"\\n\";\n }\n }\n}\n\nconst GR_TXMODE = 1;\nconst GR_MIXMODE = 2;\nconst GR_PAGE1 = 4;\nconst GR_HIRES = 8;\n\ntype AppleGRParams = {dirty:boolean[], grswitch:number, mem:Uint8Array};\n\nvar Apple2Display = function(pixels : Uint32Array, apple : AppleGRParams) {\n var XSIZE = 280;\n var YSIZE = 192;\n var PIXELON = 0xffffffff;\n var PIXELOFF = 0xff000000;\n\n var oldgrmode = -1;\n var textbuf = new Array(40*24);\n\n const flashInterval = 250;\n\n // https://mrob.com/pub/xapple2/colors.html\n const loresColor = [\n RGBA(0, 0, 0),\n RGBA(227, 30, 96),\n RGBA(96, 78, 189),\n RGBA(255, 68, 253),\n RGBA(0, 163, 96),\n RGBA(156, 156, 156),\n RGBA(20, 207, 253),\n RGBA(208, 195, 255),\n RGBA(96, 114, 3),\n RGBA(255, 106, 60),\n RGBA(156, 156, 156),\n RGBA(255, 160, 208),\n RGBA(20, 245, 60),\n RGBA(208, 221, 141),\n RGBA(114, 255, 208),\n RGBA(255, 255, 255)\n ];\n\n const text_lut = [\n 0x000, 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380,\n 0x028, 0x0a8, 0x128, 0x1a8, 0x228, 0x2a8, 0x328, 0x3a8,\n 0x050, 0x0d0, 0x150, 0x1d0, 0x250, 0x2d0, 0x350, 0x3d0\n ];\n\n const hires_lut = [\n 0x0000, 0x0400, 0x0800, 0x0c00, 0x1000, 0x1400, 0x1800, 0x1c00,\n 0x0080, 0x0480, 0x0880, 0x0c80, 0x1080, 0x1480, 0x1880, 0x1c80,\n 0x0100, 0x0500, 0x0900, 0x0d00, 0x1100, 0x1500, 0x1900, 0x1d00,\n 0x0180, 0x0580, 0x0980, 0x0d80, 0x1180, 0x1580, 0x1980, 0x1d80,\n 0x0200, 0x0600, 0x0a00, 0x0e00, 0x1200, 0x1600, 0x1a00, 0x1e00,\n 0x0280, 0x0680, 0x0a80, 0x0e80, 0x1280, 0x1680, 0x1a80, 0x1e80,\n 0x0300, 0x0700, 0x0b00, 0x0f00, 0x1300, 0x1700, 0x1b00, 0x1f00,\n 0x0380, 0x0780, 0x0b80, 0x0f80, 0x1380, 0x1780, 0x1b80, 0x1f80,\n 0x0028, 0x0428, 0x0828, 0x0c28, 0x1028, 0x1428, 0x1828, 0x1c28,\n 0x00a8, 0x04a8, 0x08a8, 0x0ca8, 0x10a8, 0x14a8, 0x18a8, 0x1ca8,\n 0x0128, 0x0528, 0x0928, 0x0d28, 0x1128, 0x1528, 0x1928, 0x1d28,\n 0x01a8, 0x05a8, 0x09a8, 0x0da8, 0x11a8, 0x15a8, 0x19a8, 0x1da8,\n 0x0228, 0x0628, 0x0a28, 0x0e28, 0x1228, 0x1628, 0x1a28, 0x1e28,\n 0x02a8, 0x06a8, 0x0aa8, 0x0ea8, 0x12a8, 0x16a8, 0x1aa8, 0x1ea8,\n 0x0328, 0x0728, 0x0b28, 0x0f28, 0x1328, 0x1728, 0x1b28, 0x1f28,\n 0x03a8, 0x07a8, 0x0ba8, 0x0fa8, 0x13a8, 0x17a8, 0x1ba8, 0x1fa8,\n 0x0050, 0x0450, 0x0850, 0x0c50, 0x1050, 0x1450, 0x1850, 0x1c50,\n 0x00d0, 0x04d0, 0x08d0, 0x0cd0, 0x10d0, 0x14d0, 0x18d0, 0x1cd0,\n 0x0150, 0x0550, 0x0950, 0x0d50, 0x1150, 0x1550, 0x1950, 0x1d50,\n 0x01d0, 0x05d0, 0x09d0, 0x0dd0, 0x11d0, 0x15d0, 0x19d0, 0x1dd0,\n 0x0250, 0x0650, 0x0a50, 0x0e50, 0x1250, 0x1650, 0x1a50, 0x1e50,\n 0x02d0, 0x06d0, 0x0ad0, 0x0ed0, 0x12d0, 0x16d0, 0x1ad0, 0x1ed0,\n 0x0350, 0x0750, 0x0b50, 0x0f50, 0x1350, 0x1750, 0x1b50, 0x1f50,\n 0x03d0, 0x07d0, 0x0bd0, 0x0fd0, 0x13d0, 0x17d0, 0x1bd0, 0x1fd0,\n // just for floating bus, y >= 192\n 0x0078, 0x0478, 0x0878, 0x0c78, 0x1078, 0x1478, 0x1878, 0x1c78,\n 0x00f8, 0x04f8, 0x08f8, 0x0cf8, 0x10f8, 0x14f8, 0x18f8, 0x1cf8,\n 0x0178, 0x0578, 0x0978, 0x0d78, 0x1178, 0x1578, 0x1978, 0x1d78, \n 0x01f8, 0x05f8, 0x09f8, 0x0df8, 0x11f8, 0x15f8, 0x19f8, 0x1df8, \n 0x0278, 0x0678, 0x0a78, 0x0e78, 0x1278, 0x1678, 0x1a78, 0x1e78, \n 0x02f8, 0x06f8, 0x0af8, 0x0ef8, 0x12f8, 0x16f8, 0x1af8, 0x1ef8, \n 0x0378, 0x0778, 0x0b78, 0x0f78, 0x1378, 0x1778, 0x1b78, 0x1f78, \n 0x03f8, 0x07f8, 0x0bf8, 0x0ff8, 0x13f8, 0x17f8, 0x1bf8, 0x1ff8, \n 0x0000, 0x0400, 0x0800, 0x0c00, 0x1000, 0x1400,\n ];\n\n var colors_lut;\n\n /**\n * This function makes the color lookup table for hires mode.\n * We make a table of 1024 * 2 * 7 entries.\n * Why? Because we assume each color byte has 10 bits\n * (8 real bits + 1 on each side) and we need different colors\n * for odd and even addresses (2) and each byte displays 7 pixels.\n */\n {\n colors_lut = new Array(256*4*2*7);\n var i,j;\n var c1,c2,c3 = 15;\n var base = 0;\n\n // go thru odd and even\n for (j=0; j<2; j++)\n {\n // go thru 1024 values\n for (var b1=0; b1<1024; b1++)\n {\n // see if the hi bit is set\n if ((b1 & 0x80) == 0)\n {\n c1 = 3; c2 = 12; // purple & green\n } else\n {\n c1 = 6; c2 = 9; // blue & orange\n }\n // make a value consisting of:\n // the 8th bit, then bits 0-7, then the 9th bit\n var b = ((b1 & 0x100) >> 8) | ((b1 & 0x7f) << 1) |\n ((b1 & 0x200) >> 1);\n // go through each pixel\n for (i=0; i<7; i++)\n {\n var c;\n // is this pixel lit?\n if (((2<> 4];\n for (i=0; i<4; i++)\n {\n pixels[base] =\n pixels[base+1] =\n pixels[base+2] =\n pixels[base+3] =\n pixels[base+4] =\n pixels[base+5] =\n pixels[base+6] = c;\n base += XSIZE;\n }\n }\n\n function drawTextChar(x, y, b, invert)\n {\n var base = (y<<3)*XSIZE + x*7; // (x<<2) + (x<<1) + x\n var on,off;\n if (invert)\n {\n on = PIXELOFF;\n off = PIXELON;\n } else\n {\n on = PIXELON;\n off = PIXELOFF;\n }\n\n for (var yy=0; yy<8; yy++)\n {\n var chr = apple2_charset[(b<<3)+yy];\n pixels[base] = ((chr & 64) > 0)?on:off;\n pixels[base+1] = ((chr & 32) > 0)?on:off;\n pixels[base+2] = ((chr & 16) > 0)?on:off;\n pixels[base+3] = ((chr & 8) > 0)?on:off;\n pixels[base+4] = ((chr & 4) > 0)?on:off;\n pixels[base+5] = ((chr & 2) > 0)?on:off;\n pixels[base+6] = ((chr & 1) > 0)?on:off;\n base += XSIZE;\n }\n }\n\n this.getAddressForScanline = function(y:number) : number {\n var base = hires_lut[y];\n if ((apple.grswitch & GR_HIRES) && (y < 160 || !(apple.grswitch & GR_MIXMODE)))\n base = base | ((apple.grswitch & GR_PAGE1) ? 0x4000 : 0x2000);\n else\n base = (base & 0x3ff) | ((apple.grswitch & GR_PAGE1) ? 0x800 : 0x400);\n return base;\n }\n\n function drawHiresLines(y, maxy)\n {\n var yb = y*XSIZE;\n for (; y < maxy; y++)\n {\n var base = hires_lut[y] + (((apple.grswitch & GR_PAGE1) != 0) ? 0x4000 : 0x2000);\n if (!apple.dirty[base >> 7])\n {\n yb += XSIZE;\n continue;\n }\n var c1, c2;\n var b = 0;\n var b1 = apple.mem[base] & 0xff;\n for (var x1=0; x1<20; x1++)\n {\n var b2 = apple.mem[base+1] & 0xff;\n var b3 = apple.mem[base+2] & 0xff;\n var d1 = (((b&0x40)<<2) | b1 | b2<<9) & 0x3ff;\n for (var i=0; i<7; i++)\n pixels[yb+i] = colors_lut[d1*7+i];\n var d2 = (((b1&0x40)<<2) | b2 | b3<<9) & 0x3ff;\n for (var i=0; i<7; i++)\n pixels[yb+7+i] = colors_lut[d2*7+7168+i];\n yb += 14;\n base += 2;\n b = b2;\n b1 = b3;\n }\n }\n }\n\n function drawLoresLine(y)\n {\n // get the base address of this line\n var base = text_lut[y] +\n (((apple.grswitch & GR_PAGE1) != 0) ? 0x800 : 0x400);\n //\t\tif (!dirty[base >> 7])\n //\t\t return;\n for (var x=0; x<40; x++)\n {\n var b = apple.mem[base+x] & 0xff;\n // if the char. changed, draw it\n if (b != textbuf[y*40+x])\n {\n drawLoresChar(x, y, b);\n textbuf[y*40+x] = b;\n }\n }\n }\n\n function drawTextLine(y, flash)\n {\n // get the base address of this line\n var base = text_lut[y] +\n (((apple.grswitch & GR_PAGE1) != 0) ? 0x800 : 0x400);\n //\t\tif (!dirty[base >> 7])\n //\t\t return;\n for (var x=0; x<40; x++)\n {\n var b = apple.mem[base+x] & 0xff;\n var invert;\n // invert flash characters 1/2 of the time\n if (b >= 0x80)\n {\n invert = false;\n } else if (b >= 0x40)\n {\n invert = flash;\n if (flash)\n b -= 0x40;\n else\n b += 0x40;\n } else\n invert = true;\n // if the char. changed, draw it\n if (b != textbuf[y*40+x])\n {\n drawTextChar(x, y, b & 0x7f, invert);\n textbuf[y*40+x] = b;\n }\n }\n }\n\n this.updateScreen = function(totalrepaint)\n {\n var y;\n var flash = (new Date().getTime() % (flashInterval<<1)) > flashInterval;\n\n // if graphics mode changed, repaint whole screen\n if (apple.grswitch != oldgrmode)\n {\n oldgrmode = apple.grswitch;\n totalrepaint = true;\n }\n if (totalrepaint)\n {\n // clear textbuf if in text mode\n if ((apple.grswitch & GR_TXMODE) != 0 || (apple.grswitch & GR_MIXMODE) != 0)\n {\n for (y=0; y<24; y++)\n for (var x=0; x<40; x++)\n textbuf[y*40+x] = -1;\n }\n for (var i=0; i {\n emu : AppleII;\n track_data : Uint8Array;\n \n constructor(emu : AppleII, image : Uint8Array) {\n super();\n this.emu = emu;\n this.data = new Array(NUM_TRACKS);\n for (var i=0; i>1];\n else\n this.track_data = null;\n }\n \n toLongString() {\n return \"Track: \" + (this.track / 2) +\n \"\\nOffset: \" + (this.track_index) +\n \"\\nMode: \" + (this.read_mode ? \"READ\" : \"WRITE\") +\n \"\\nMotor: \" + this.motor +\n \"\\nData: \" + (this.track_data ? hex(this.track_data[this.track_index]) : '-') +\n \"\\n\";\n }\n \n read_latch() : number {\n this.track_index = (this.track_index + 1) % TRACK_SIZE;\n if (this.track_data) {\n return (this.track_data[this.track_index] & 0xff);\n } else\n return this.emu.floatbus() | 0x80;\n }\n\n write_latch(value: number) {\n this.track_index = (this.track_index + 1) % TRACK_SIZE;\n if (this.track_data != null)\n this.track_data[this.track_index] = value;\n }\n \n readROM(address) { return DISKII_PROM[address]; }\n readConst(address) { return DISKII_PROM[address]; }\n read(address) { return this.doIO(address, 0); }\n write(address, value) { this.doIO(address, value); }\n\n doIO(address, value) : number \n {\n switch (address & 0x0f)\n {\n /*\n * Turn motor phases 0 to 3 on. Turning on the previous phase + 1\n * increments the track position, turning on the previous phase - 1\n * decrements the track position. In this scheme phase 0 and 3 are\n * considered to be adjacent. The previous phase number can be\n * computed as the track number % 4.\n */\n case 0x1:\n case 0x3:\n case 0x5:\n case 0x7:\n var phase, lastphase, new_track;\n new_track = this.track;\n phase = (address >> 1) & 3;\n\n // if new phase is even and current phase is odd\n if (phase == ((new_track - 1) & 3))\n {\n if (new_track > 0)\n new_track--;\n } else\n if (phase == ((new_track + 1) & 3))\n {\n if (new_track < NUM_TRACKS*2-1)\n new_track++;\n }\n if ((new_track & 1) == 0)\n {\n this.track_data = this.data[new_track>>1];\n console.log('track', new_track/2);\n } else\n this.track_data = null;\n this.track = new_track;\n break;\n /*\n * Turn drive motor off.\n */\n case 0x8:\n this.motor = false;\n break;\n /*\n * Turn drive motor on.\n */\n case 0x9:\n this.motor = true;\n break; \n /*\n * Select drive 1.\n */\n case 0xa:\n //drive = 0;\n break;\n /*\n * Select drive 2.\n */\n case 0xb:\n //drive = 1;\n break;\n /*\n * Select write mode.\n */\n case 0xf:\n this.read_mode = false;\n /*\n * Read a disk byte if read mode is active.\n */\n case 0xC:\n if (this.read_mode)\n return this.read_latch();\n break;\n /*\n * Select read mode and read the write protect status.\n */\n case 0xE:\n this.read_mode = true;\n /*\n * Write a disk byte if write mode is active and the disk is not\n * write protected.\n */\n case 0xD:\n if (value >= 0 && !this.read_mode && !this.write_protect)\n this.write_latch(value);\n /*\n * Read the write protect status only.\n */\n return this.write_protect ? 0x80 : 0x00;\n }\n return this.emu.floatbus();\n }\n\n}\n\n/* --------------- TRACK CONVERSION ROUTINES ---------------------- */\n\n /*\n * Normal byte (lower six bits only) -> disk byte translation table.\n */\n const byte_translation = [\n 0x96, 0x97, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa6,\n 0xa7, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb2, 0xb3,\n 0xb4, 0xb5, 0xb6, 0xb7, 0xb9, 0xba, 0xbb, 0xbc,\n 0xbd, 0xbe, 0xbf, 0xcb, 0xcd, 0xce, 0xcf, 0xd3,\n 0xd6, 0xd7, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde,\n 0xdf, 0xe5, 0xe6, 0xe7, 0xe9, 0xea, 0xeb, 0xec,\n 0xed, 0xee, 0xef, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,\n 0xf7, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff\n ];\n\n /*\n * Sector skewing table.\n */\n\n const skewing_table = [\n 0,7,14,6,13,5,12,4,11,3,10,2,9,1,8,15\n ];\n\n/*\n * Encode a 256-byte sector as SECTOR_SIZE disk bytes as follows:\n *\n * 14 sync bytes\n * 3 address header bytes\n * 8 address block bytes\n * 3 address trailer bytes\n * 6 sync bytes\n * 3 data header bytes\n * 343 data block bytes\n * 3 data trailer bytes\n */\n function nibblizeSector(vol, trk, sector, inn, in_ofs, out, i)\n {\n var loop, checksum, prev_value, value;\n var sector_buffer = new Uint8Array(258);\n value = 0;\n\n /*\n * Step 1: write 6 sync bytes (0xff's). Normally these would be\n * written as 10-bit bytes with two extra zero bits, but for the\n * purpose of emulation normal 8-bit bytes will do, since the\n * emulated drive will always be in sync.\n */\n for (loop = 0; loop < 14; loop++)\n out[i++] = 0xff;\n\n /*\n * Step 2: write the 3-byte address header (0xd5 0xaa 0x96).\n */\n out[i++] = 0xd5;\n out[i++] = 0xaa;\n out[i++] = 0x96;\n\n /*\n * Step 3: write the address block. Use 4-and-4 encoding to convert\n * the volume, track and sector and checksum into 2 disk bytes each.\n * The checksum is a simple exclusive OR of the first three values.\n */\n out[i++] = ((vol >> 1) | 0xaa);\n out[i++] = (vol | 0xaa);\n checksum = vol;\n out[i++] = ((trk >> 1) | 0xaa);\n out[i++] = (trk | 0xaa);\n checksum ^= trk;\n out[i++] = ((sector >> 1) | 0xaa);\n out[i++] = (sector | 0xaa);\n checksum ^= sector;\n out[i++] = ((checksum >> 1) | 0xaa);\n out[i++] = (checksum | 0xaa);\n\n /*\n * Step 4: write the 3-byte address trailer (0xde 0xaa 0xeb).\n */\n out[i++] = (0xde);\n out[i++] = (0xaa);\n out[i++] = (0xeb);\n\n /*\n * Step 5: write another 6 sync bytes.\n */\n for (loop = 0; loop < 6; loop++)\n out[i++] = (0xff);\n\n /*\n * Step 6: write the 3-byte data header.\n */\n out[i++] = (0xd5);\n out[i++] = (0xaa);\n out[i++] = (0xad);\n\n /*\n * Step 7: read the next 256-byte sector from the old disk image file,\n * and add two zero bytes to bring the number of bytes up to a multiple\n * of 3.\n */\n for (loop = 0; loop < 256; loop++)\n sector_buffer[loop] = inn[loop + in_ofs] & 0xff;\n sector_buffer[256] = 0;\n sector_buffer[257] = 0; \n\n /*\n * Step 8: write the first 86 disk bytes of the data block, which\n * encodes the bottom two bits of each sector byte into six-bit\n * values as follows:\n *\n * disk byte n, bit 0 = sector byte n, bit 1\n * disk byte n, bit 1 = sector byte n, bit 0\n * disk byte n, bit 2 = sector byte n + 86, bit 1\n * disk byte n, bit 3 = sector byte n + 86, bit 0\n * disk byte n, bit 4 = sector byte n + 172, bit 1\n * disk byte n, bit 5 = sector byte n + 172, bit 0\n *\n * The scheme allows each pair of bits to be shifted to the right out\n * of the disk byte, then shifted to the left into the sector byte.\n *\n * Before the 6-bit value is translated to a disk byte, it is exclusive\n * ORed with the previous 6-bit value, hence the values written are\n * really a running checksum.\n */\n prev_value = 0;\n for (loop = 0; loop < 86; loop++)\n {\n value = (sector_buffer[loop] & 0x01) << 1;\n value |= (sector_buffer[loop] & 0x02) >> 1;\n value |= (sector_buffer[loop + 86] & 0x01) << 3;\n value |= (sector_buffer[loop + 86] & 0x02) << 1;\n value |= (sector_buffer[loop + 172] & 0x01) << 5;\n value |= (sector_buffer[loop + 172] & 0x02) << 3;\n out[i++] = (byte_translation[value ^ prev_value]);\n prev_value = value;\n } \n\n /*\n * Step 9: write the last 256 disk bytes of the data block, which\n * encodes the top six bits of each sector byte. Again, each value\n * is exclusive ORed with the previous value to create a running\n * checksum (the first value is exclusive ORed with the last value of\n * the previous step).\n */\n\n for (loop = 0; loop < 256; loop++)\n {\n value = (sector_buffer[loop] >> 2);\n out[i++] = (byte_translation[value ^ prev_value]);\n prev_value = value;\n }\n\n /*\n * Step 10: write the last value as the checksum.\n */\n out[i++] = (byte_translation[value]);\n\n /*\n * Step 11: write the 3-byte data trailer.\n */\n out[i++] = (0xde);\n out[i++] = (0xaa);\n out[i++] = (0xeb);\n\n }\n\n function nibblizeTrack(vol, trk, inn)\n {\n var out = new Uint8Array(TRACK_SIZE);\n var out_pos = 0;\n for (var sector = 0; sector < 16; sector++) {\n nibblizeSector(vol, trk, sector,\n inn, skewing_table[sector] << 8,\n out, out_pos);\n out_pos += SECTOR_SIZE;\n }\n while (out_pos < TRACK_SIZE)\n out[out_pos++] = (0xff);\n return out;\n }\n\n\n", "\nimport { Platform, Preset, getOpcodeMetadata_6502, getToolForFilename_6502 } from \"../common/baseplatform\";\nimport { PLATFORMS } from \"../common/emu\";\nimport { AppleII } from \"../machine/apple2\";\nimport { Base6502MachinePlatform } from \"../common/baseplatform\";\nimport { CodeAnalyzer_apple2 } from \"../common/analysis\";\nimport { BaseMAME6502Platform } from \"../common/mameplatform\";\n\nconst APPLE2_PRESETS : Preset[] = [\n {id:'sieve.c', name:'Sieve', category:\"C\"},\n {id:'keyboardtest.c', name:'Keyboard Test'},\n {id:'mandel.c', name:'Mandelbrot'},\n {id:'tgidemo.c', name:'TGI Graphics Demo'},\n {id:'Eliza.c', name:'Eliza'},\n {id:'siegegame.c', name:'Siege Game'},\n {id:'cosmic.c', name:'Cosmic Impalas'},\n {id:'farmhouse.c', name:\"Farmhouse Adventure\"},\n {id:'yum.c', name:\"Yum Dice Game\"},\n {id:'lz4test.c', name:\"LZ4 Decompressor\"},\n {id:'hgrtest.a', name:\"HGR Test\", category:\"Assembly Language\"},\n {id:'conway.a', name:\"Conway's Game of Life\"},\n {id:'lz4fh.a', name:\"LZ4FH Decompressor\"},\n {id:'deltamod.dasm', name:\"Delta Modulation Audio\"},\n// {id:'zap.dasm', name:\"ZAP!\"},\n// {id:'tb_6502.s', name:'Tom Bombem (assembler game)'},\n];\n\n/// MAME support\n\nclass Apple2MAMEPlatform extends BaseMAME6502Platform implements Platform {\n\n start () {\n this.startModule(this.mainElement, {\n jsfile:'mame8bitpc.js',\n biosfile:['apple2e.zip'],\n //cfgfile:'nes.cfg',\n driver:'apple2e',\n width:280*2,\n height:192*2,\n //romfn:'/emulator/cart.nes',\n //romsize:romSize,\n //romdata:new lzgmini().decode(lzgRom).slice(0, romSize),\n preInit:function(_self) {\n },\n });\n }\n\n getOpcodeMetadata = getOpcodeMetadata_6502;\n getDefaultExtension () { return \".c\"; };\n getToolForFilename = getToolForFilename_6502;\n\n getPresets () { return APPLE2_PRESETS; }\n\n loadROM (title, data) {\n this.loadROMFile(data);\n // TODO\n }\n}\n\n///\n\nclass NewApple2Platform extends Base6502MachinePlatform implements Platform {\n\n newMachine() { return new AppleII(); }\n getPresets() { return APPLE2_PRESETS; }\n getDefaultExtension() { return \".c\"; };\n readAddress(a) { return this.machine.readConst(a); }\n // TODO loadBIOS(bios)\t{ this.machine.loadBIOS(a); }\n getMemoryMap = function() { return { main:[\n {name:'Zero Page RAM',start:0x0,size:0x100,type:'ram'},\n {name:'Line Input RAM',start:0x200,size:0x100,type:'ram'},\n {name:'RAM',start:0x300,size:0xc0,type:'ram'},\n {name:'DOS Vectors',start:0x3c0,size:0x40,type:'ram'},\n {name:'Text/Lores Page 1',start:0x400,size:0x400,type:'ram'},\n {name:'RAM',start:0x800,size:0x1800,type:'ram'},\n {name:'Hires Page 1',start:0x2000,size:0x2000,type:'ram'},\n {name:'Hires Page 2',start:0x4000,size:0x2000,type:'ram'},\n {name:'RAM',start:0x6000,size:0x6000,type:'ram'},\n {name:'I/O',start:0xc000,size:0x1000,type:'io'},\n {name:'ROM',start:0xd000,size:0x3000,type:'rom'},\n ] } };\n getROMExtension(rom:Uint8Array) {\n if (rom && rom.length == 35*16*256) return \".dsk\"; // DSK image\n return \".bin\";\n };\n getToolForFilename = (fn:string) : string => {\n if (fn.endsWith(\".lnk\")) return \"merlin32\";\n else return getToolForFilename_6502(fn);\n }\n /*\n newCodeAnalyzer() {\n return new CodeAnalyzer_apple2(this);\n }\n getOriginPC() {\n return 0x803; // TODO?\n }\n */\n}\n\nPLATFORMS['apple2.mame'] = Apple2MAMEPlatform;\nPLATFORMS['apple2'] = NewApple2Platform;\n"], + "mappings": "qOA6BO,mBAAsB,EAA4C,CAsFvE,aAAc,CACZ,QApFF,kBAAe,QACf,gBAAa,KAAK,aAClB,sBAAmB,GACnB,uBAAoB,KAAK,iBAAmB,IAC5C,iBAAc,IACd,yBAAsB,IACtB,uBAAoB,IACpB,oBAAiB,MAGjB,eAAY,EACZ,cAAW,EAEX,SAAM,GAAI,YAAW,OAErB,SAAM,GAAI,IACV,aAAU,GAAI,OAAM,OAAU,GAC9B,cAAW,CAAC,MAAM,KAAK,QAAS,SAAS,EAAW,IAAI,KAAK,KAE7D,cAAW,EACX,gBAAa,EAEb,oBAAiB,GACjB,gBAAa,EACb,kBAAe,GAGf,mBAAc,EACd,mBAAc,EAEd,WAAuB,GAAI,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M,KAAM,KAAK,KAAO,KAAK,OACzC,CAAC,KAAK,eAAe,MAAM,KAAO,KAAK,KAAO,KAAK,OACnD,CAAC,KAAK,eAAe,MAAM,MAAO,KAAK,KAAO,KAAK,OACnD,CAAC,KAAK,MAAM,MAAM,MAAO,KAAK,MAAO,KAAK,OAC1C,CAAC,KAAK,MAAM,MAAM,MAAO,KAAK,KAAO,KAAK,MAC1C,CAAC,KAAK,MAAM,MAAM,MAAO,KAAK,MAAO,KAAK,UAM9C,wBAAqB,AAAC,GAChB,EAAG,SAAS,QAAgB,WACpB,EAAwB,GAxBtC,YAAsB,CAAE,MAAO,IAAI,GACnC,YAAsB,CAAE,MAAO,IAC/B,qBAAsB,CAAE,MAAO,KAC/B,YAAY,EAAU,CAAE,MAAO,MAAK,QAAQ,UAAU,GAetD,gBAAgB,EAAgB,CAC9B,MAAI,IAAO,EAAI,QAAU,GAAG,GAAG,IAAY,OACpC,SAgBX,EAAU,eAAiB,GAC3B,EAAU,OAAY", + "names": [] +} diff --git a/gen/basic-O4Z2JMQ2.js b/gen/basic-C7LUGP5U.js similarity index 99% rename from gen/basic-O4Z2JMQ2.js rename to gen/basic-C7LUGP5U.js index 76fb108b..229ba035 100644 --- a/gen/basic-O4Z2JMQ2.js +++ b/gen/basic-C7LUGP5U.js @@ -1,4 +1,4 @@ -import{b as v}from"./chunk-3XE5YOCV.js";import{a as d,t as S}from"./chunk-JNII2TLU.js";import"./chunk-UC2UKQOH.js";import"./chunk-B2GOFULO.js";import"./chunk-IJD2K6VH.js";import"./chunk-ULPRULB6.js";import{B as c,J as b,T as g,U as f,a as p}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";function O(o){return o.value!=null}function E(o){return o.name!=null}function N(o){return o.op!=null&&o.left!=null&&o.right!=null}function I(o){return o.op!=null&&o.expr!=null}var y=class{randomize(){this.seed(Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647)}constructor(){(()=>{var r,e,i,n;this.seed=function(s,a,u,h){r=s,e=a,i=u,n=h},this.seedfloat=function(s){this.seed(s,s*4294,s*429496,s*4294967296),this.next(),this.next(),this.next()},this.next=function(){r>>>=0,e>>>=0,i>>>=0,n>>>=0;var s=r+e|0;return r=e^e>>>9,e=i+(i<<3)|0,i=i<<21|i>>>11,n=n+1|0,s=s+n|0,i=i+s|0,(s>>>0)/4294967296}})(),this.seedfloat(-1)}},L=1024*1024,l=class{constructor(){this.margin=80;this.running=!1;this.exited=!0;this.trace=!1}load(t){let r=null,e=0;if(this.pc2label!=null){let s=this.curpc;for(;s>0&&(r=this.pc2label.get(s))==null;)s--;e=this.curpc-s,console.log("oldpc=",this.curpc,"restart @ label",r,"+",e)}this.program=t,this.opts=t.opts,this.opts.maxArrayElements||(this.opts.maxArrayElements=L),this.allstmts=t.stmts,this.label2pc=t.labels,this.label2dataptr={},this.pc2label=new Map,this.datums=[],this.subroutines={},this.builtins=this.getBuiltinFunctions();for(var i in t.labels){var n=t.labels[i];this.pc2label.set(n,i)}return this.allstmts.forEach((s,a)=>{this.curpc=a+1,this.compileStatement(s),s.command=="DATA"&&(this.label2dataptr[s.$loc.label]=this.datums.length,s.datums.forEach(u=>{this.curpc=s.$loc.offset,this.datums.push(u)}))}),this.label2pc[r]!=null?(this.curpc=this.label2pc[r]+e,!0):(this.curpc=0,!1)}reset(){this.curpc=0,this.dataptr=0,this.clearVars(),this.returnStack=[],this.column=0,this.running=!0,this.exited=!1}clearVars(){this.globals=this.vars={},this.arrays={},this.defs={},this.forLoops={},this.forLoopStack=[],this.whileLoops=[],this.rng=new y,this.opts&&this.opts.staticArrays&&this.allstmts.filter(t=>t.command=="DIM").forEach(t=>{t.args.forEach(r=>this.compileJS(this._DIM(r))())})}saveState(){return $.extend(!0,{},this)}loadState(t){$.extend(!0,this,t)}getBuiltinFunctions(){var t=this.program&&this.opts.validFunctions;t||(t=Object.getOwnPropertyNames(l.prototype).filter(i=>/^[A-Z]{3,}[$]?$/.test(i)));var r={};for(var e of t)this.supportsFunction(e)&&(r[e]=this[e].bind(this));return r}supportsFunction(t){return typeof this[t]=="function"}runtimeError(t){throw this.curpc--,new g(t,this.getCurrentSourceLocation())}dialectError(t){this.runtimeError(`I can't ${t} in this dialect of BASIC.`)}getLineForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.line}getLabelForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.label}getCurrentSourceLocation(){var t=this.getStatement();return t&&t.$loc}getCurrentLabel(){var t=this.getCurrentSourceLocation();return t&&t.label}getStatement(){return this.allstmts[this.curpc]}step(){if(!this.running)return!1;var t=this.getStatement();return t?(this.trace&&console.log(this.curpc,t,this.vars,Object.keys(this.arrays)),this.curpc++,this.executeStatement(t),this.running):(this.running=!1,this.exited=!0,!1)}compileStatement(t){if(t.$run==null)try{var r=this["do__"+t.command];r==null&&this.runtimeError(`I don't know how to "${t.command}".`);var e=r.bind(this)(t);this.trace&&console.log(e),t.$run=this.compileJS(e)}catch(i){throw e&&console.log(e),i}}compileJS(t){return new Function(t).bind(this)}executeStatement(t){this.compileStatement(t),t.$run()}skipToEOL(){do this.curpc++;while(this.curpc=0?this.curpc=r:this.runtimeError(`I tried to go to the label "${t}" but couldn't find it.`)}newLocalScope(){this.vars=Object.create(this.vars)}popLocalScope(){this.vars!==this.globals&&(this.vars=Object.getPrototypeOf(this.vars))}gosubLabel(t){this.returnStack.length>32767&&this.runtimeError("I did too many GOSUBs without a RETURN."),this.returnStack.push(this.curpc),this.gotoLabel(t)}returnFromGosub(){this.returnStack.length==0&&this.runtimeError("I tried to RETURN, but there wasn't a corresponding GOSUB.");var t=this.returnStack.pop();this.curpc=t,this.popLocalScope()}popReturnStack(){this.returnStack.length==0&&this.runtimeError("I tried to POP, but there wasn't a corresponding GOSUB."),this.returnStack.pop()}valueToString(t,r){var e;if(typeof t=="number"){var i=this.float2str(t,this.opts.printZoneLength-4);return r?i.startsWith("-")?`${i} `:` ${i} `:i}else if(t==` +import{b as v}from"./chunk-3XE5YOCV.js";import{a as d,t as S}from"./chunk-VQAF227M.js";import"./chunk-XKNBXIHT.js";import"./chunk-B2GOFULO.js";import"./chunk-NRFMOEZ6.js";import"./chunk-ULPRULB6.js";import{B as c,J as b,T as g,U as f,a as p}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";function O(o){return o.value!=null}function E(o){return o.name!=null}function N(o){return o.op!=null&&o.left!=null&&o.right!=null}function I(o){return o.op!=null&&o.expr!=null}var y=class{randomize(){this.seed(Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647)}constructor(){(()=>{var r,e,i,n;this.seed=function(s,a,u,h){r=s,e=a,i=u,n=h},this.seedfloat=function(s){this.seed(s,s*4294,s*429496,s*4294967296),this.next(),this.next(),this.next()},this.next=function(){r>>>=0,e>>>=0,i>>>=0,n>>>=0;var s=r+e|0;return r=e^e>>>9,e=i+(i<<3)|0,i=i<<21|i>>>11,n=n+1|0,s=s+n|0,i=i+s|0,(s>>>0)/4294967296}})(),this.seedfloat(-1)}},L=1024*1024,l=class{constructor(){this.margin=80;this.running=!1;this.exited=!0;this.trace=!1}load(t){let r=null,e=0;if(this.pc2label!=null){let s=this.curpc;for(;s>0&&(r=this.pc2label.get(s))==null;)s--;e=this.curpc-s,console.log("oldpc=",this.curpc,"restart @ label",r,"+",e)}this.program=t,this.opts=t.opts,this.opts.maxArrayElements||(this.opts.maxArrayElements=L),this.allstmts=t.stmts,this.label2pc=t.labels,this.label2dataptr={},this.pc2label=new Map,this.datums=[],this.subroutines={},this.builtins=this.getBuiltinFunctions();for(var i in t.labels){var n=t.labels[i];this.pc2label.set(n,i)}return this.allstmts.forEach((s,a)=>{this.curpc=a+1,this.compileStatement(s),s.command=="DATA"&&(this.label2dataptr[s.$loc.label]=this.datums.length,s.datums.forEach(u=>{this.curpc=s.$loc.offset,this.datums.push(u)}))}),this.label2pc[r]!=null?(this.curpc=this.label2pc[r]+e,!0):(this.curpc=0,!1)}reset(){this.curpc=0,this.dataptr=0,this.clearVars(),this.returnStack=[],this.column=0,this.running=!0,this.exited=!1}clearVars(){this.globals=this.vars={},this.arrays={},this.defs={},this.forLoops={},this.forLoopStack=[],this.whileLoops=[],this.rng=new y,this.opts&&this.opts.staticArrays&&this.allstmts.filter(t=>t.command=="DIM").forEach(t=>{t.args.forEach(r=>this.compileJS(this._DIM(r))())})}saveState(){return $.extend(!0,{},this)}loadState(t){$.extend(!0,this,t)}getBuiltinFunctions(){var t=this.program&&this.opts.validFunctions;t||(t=Object.getOwnPropertyNames(l.prototype).filter(i=>/^[A-Z]{3,}[$]?$/.test(i)));var r={};for(var e of t)this.supportsFunction(e)&&(r[e]=this[e].bind(this));return r}supportsFunction(t){return typeof this[t]=="function"}runtimeError(t){throw this.curpc--,new g(t,this.getCurrentSourceLocation())}dialectError(t){this.runtimeError(`I can't ${t} in this dialect of BASIC.`)}getLineForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.line}getLabelForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.label}getCurrentSourceLocation(){var t=this.getStatement();return t&&t.$loc}getCurrentLabel(){var t=this.getCurrentSourceLocation();return t&&t.label}getStatement(){return this.allstmts[this.curpc]}step(){if(!this.running)return!1;var t=this.getStatement();return t?(this.trace&&console.log(this.curpc,t,this.vars,Object.keys(this.arrays)),this.curpc++,this.executeStatement(t),this.running):(this.running=!1,this.exited=!0,!1)}compileStatement(t){if(t.$run==null)try{var r=this["do__"+t.command];r==null&&this.runtimeError(`I don't know how to "${t.command}".`);var e=r.bind(this)(t);this.trace&&console.log(e),t.$run=this.compileJS(e)}catch(i){throw e&&console.log(e),i}}compileJS(t){return new Function(t).bind(this)}executeStatement(t){this.compileStatement(t),t.$run()}skipToEOL(){do this.curpc++;while(this.curpc=0?this.curpc=r:this.runtimeError(`I tried to go to the label "${t}" but couldn't find it.`)}newLocalScope(){this.vars=Object.create(this.vars)}popLocalScope(){this.vars!==this.globals&&(this.vars=Object.getPrototypeOf(this.vars))}gosubLabel(t){this.returnStack.length>32767&&this.runtimeError("I did too many GOSUBs without a RETURN."),this.returnStack.push(this.curpc),this.gotoLabel(t)}returnFromGosub(){this.returnStack.length==0&&this.runtimeError("I tried to RETURN, but there wasn't a corresponding GOSUB.");var t=this.returnStack.pop();this.curpc=t,this.popLocalScope()}popReturnStack(){this.returnStack.length==0&&this.runtimeError("I tried to POP, but there wasn't a corresponding GOSUB."),this.returnStack.pop()}valueToString(t,r){var e;if(typeof t=="number"){var i=this.float2str(t,this.opts.printZoneLength-4);return r?i.startsWith("-")?`${i} `:` ${i} `:i}else if(t==` `)this.column=0,e=t;else if(t==" "){var n=this.opts.printZoneLength,s=Math.floor(this.column/n),a=(s+1)*this.opts.printZoneLength;a+n>this.margin?(this.column=0,e=` `):e=this.TAB(a)}else e=`${t}`;return e}float2str(t,r){var e=t.toString().toUpperCase();if(r>0){for(var i=r;e.length>r;)e=t.toPrecision(i--);e.startsWith("0.")?e=e.substr(1):e.startsWith("-0.")&&(e="-"+e.substr(2))}return e}printExpr(t){var r=this.valueToString(t,this.opts.numericPadding);this.column+=r.length,this.print(r)}print(t){console.log(t)}async input(t,r){return{line:"",vals:[]}}resume(){}expr2js(t,r){if(r||(r={}),O(t))return JSON.stringify(t.value);if(E(t)){if(!t.args&&r.locals&&r.locals.indexOf(t.name)>=0)return t.name;{r.isconst&&this.runtimeError("I expected a constant value here.");var e="",i=JSON.stringify(t.name);let u=t.args?t.args.map(h=>this.expr2js(h,r)).join(", "):[];return t.name.startsWith("FN")?e+=`this.getDef(${i})(${u})`:this.builtins[t.name]?(this.checkFuncArgs(t,this.builtins[t.name]),e+=`this.builtins.${t.name}(${u})`):t.args?this.opts.arraysContainChars&&t.name.endsWith("$")?e+=`this.getStringSlice(this.vars.${t.name}, ${u})`:e+=`this.arrayGet(${i}, ${u})`:e+=`this.vars.${t.name}`,r.novalid?e:`this.checkValue(${e}, ${i})`}}else if(N(t)){var n=this.expr2js(t.left,r),s=this.expr2js(t.right,r);return`this.${t.op}(${n}, ${s})`}else if(I(t)){var a=this.expr2js(t.expr,r);return`this.${t.op}(${a})`}}assign2js(t,r){r||(r={});var e="";return(t.name.startsWith("FN")||this.builtins[t.name])&&this.runtimeError("I can't call a function here."),t.args?this.opts.arraysContainChars&&t.name.endsWith("$")?this.runtimeError("I can't set array slices via this command yet."):e+=this.array2js(t,r):e=`this.globals.${t.name}`,e}array2js(t,r){var e=JSON.stringify(t.name),i=t.args||[];return this.expr2js(t,{novalid:!0})+`;this.getArray(${e}, ${i.length})`+i.map(n=>"[this.ROUND("+this.expr2js(n,r)+")]").join("")}checkFuncArgs(t,r){var e=t.args?t.args.length:0;t.name=="RND"&&e==0||t.name=="MID$"&&e==2||t.name=="INSTR"&&e==2||r.length!=e&&this.runtimeError(`I expected ${r.length} arguments for the ${t.name} function, but I got ${e}.`)}startForLoop(t,r,e,i,n){var s=this.curpc-1,a=this.pc2label.get(s);i||(i=1),this.vars[t]=r,this.trace&&console.log(`FOR ${t} = ${r} TO ${e} STEP ${i}`);var u=()=>i>=0?this.vars[t]>e:this.vars[t]h==t)),this.forLoopStack.push(t),this.forLoops[t]={$next:h=>{h&&t!=h&&this.runtimeError(`I executed NEXT "${h}", but the last FOR was for "${t}".`),this.vars[t]+=i;var m=u();m?(this.forLoopStack.pop(),delete this.forLoops[t]):this.curpc=(a!=null&&this.label2pc[a]||s)+1,this.trace&&console.log(`NEXT ${t}: ${this.vars[t]} TO ${e} STEP ${i} DONE=${m}`)}}}nextForLoop(t){var r=this.forLoops[t||this.opts.optionalNextVar&&this.forLoopStack[this.forLoopStack.length-1]];r||this.runtimeError("I couldn't find a matching FOR for this NEXT."),r.$next(t)}whileLoop(t){t?this.whileLoops.push(this.curpc-1):this.skipToAfterWend()}nextWhileLoop(){var t=this.whileLoops.pop();t==null?this.runtimeError("I couldn't find a matching WHILE for this WEND."):this.curpc=t}assign(t,r,e){return e&&t.endsWith("$")?this.checkValue(this.convert(t,r),t):t.endsWith("$")?this.convertToString(r,t):this.convertToNumber(r,t)}convert(t,r){return t.endsWith("$")?r==null?"":r.toString():typeof r=="number"?r:parseFloat(r+"")}convertToString(t,r){if(typeof t!="string")this.runtimeError(`I can't convert ${t} to a string.`);else return t}convertToNumber(t,r){if(typeof t!="number")this.runtimeError(`I can't convert ${t} to a number.`);else return this.checkNum(t)}dimArray(t,...r){if(r=r.map(Math.round),this.arrays[t]!=null){if(this.opts.staticArrays)return;this.runtimeError(`I already dimensioned this array (${t}) earlier.`)}var e=this.getTotalArrayLength(r);e>this.opts.maxArrayElements&&this.runtimeError("I can't create an array with this many elements.");var i=t.endsWith("$"),n=i?Array:Float64Array;if(r.length==1)this.arrays[t]=new n(r[0]+1);else if(r.length==2){this.arrays[t]=new Array(r[0]+1);for(var s=0;s=i.length&&this.runtimeError(`I tried to lookup ${t}(${r}) but it exceeded the dimensions of the array.`),i=i[r[n]]}return c(i)&&this.runtimeError(`I tried to lookup ${t}(${r}) but used too few dimensions.`),i}modifyStringSlice(t,r,e,i){return t=t||"",this.checkString(t),this.checkString(r),i||(i=e),e=this.ROUND(e),i=this.ROUND(i),e<1&&this.dialectError("accept a string slice index less than 1"),ir.length)&&this.runtimeError(`I needed a number between 1 and ${r.length}, but I got ${t}.`),t<1||t>r.length?0:t}onGotoLabel(t,...r){t=this.checkOnGoto(t,r),t&&this.gotoLabel(r[t-1])}onGosubLabel(t,...r){t=this.checkOnGoto(t,r),t&&this.gosubLabel(r[t-1])}nextDatum(){return this.dataptr>=this.datums.length&&this.runtimeError("I tried to READ, but ran out of data."),this.datums[this.dataptr++].value}do__PRINT(t){var r="";for(var e of t.args){var i=this.expr2js(e),n=i.name;r+=`this.printExpr(this.checkValue(${i}, ${JSON.stringify(n)}));`}return r}preInput(){this.running=!1,this.curpc--}postInput(t){t&&this.curpc++,this.running=!0,this.resume()}do__INPUT(t){var r=t.prompt!=null?this.expr2js(t.prompt):'""',e=t.elapsed!=null?this.assign2js(t.elapsed):"let ___",i="";return t.args.forEach((n,s)=>{var a=this.assign2js(n);i+=` var value = this.convert(${JSON.stringify(n.name)}, response.vals[${s}]); @@ -34,4 +34,4 @@ import{b as v}from"./chunk-3XE5YOCV.js";import{a as d,t as S}from"./chunk-JNII2T `),this.tty.addtext("*** END OF PROGRAM ***",1),this.tty.showPrintHead(!1)}loadROM(t,r){var e=this.runtime.exited;this.program=r;var i=this.runtime.load(r);this.tty.uppercaseOnly=!0,d.input=this.program.opts.uppercaseOnly?n=>n.toUpperCase():null,(!this.hotReload||e||!i)&&this.reset()}getROMExtension(){return".json"}reset(){this.tty.clear(),this.runtime.reset(),this.clock=0,this.transcript=[]}pause(){this.timer.stop()}resume(){this.isBlocked()||(this.animcount=0,this.timer.start())}isBlocked(){return this.tty.waitingfor!=null||this.runtime.exited}isRunning(){return this.timer.isRunning()}getDefaultExtension(){return".bas"}getToolForFilename(){return"basic"}getPresets(){return T}getPC(){return this.runtime.curpc}getSP(){return 4096-this.runtime.returnStack.length}isStable(){return!0}getCPUState(){return{PC:this.getPC(),SP:this.getSP()}}saveState(){return{c:this.getCPUState(),rt:this.runtime.saveState()}}loadState(t){this.runtime.loadState(t)}getDebugTree(){return{CurrentLine:this.runtime.getCurrentLabel(),Variables:this.runtime.vars,Arrays:this.runtime.arrays,Functions:this.runtime.defs,ForLoops:this.runtime.forLoops,WhileLoops:this.runtime.whileLoops,ReturnStack:this.runtime.returnStack,NextDatum:this.runtime.datums[this.runtime.dataptr],Clock:this.clock,Options:this.runtime.opts,Internals:this.runtime}}inspect(t){let r=this.runtime.vars[t];if(r!=null)return`${t} = ${r}`}showHelp(){return"https://8bitworkshop.com/docs/platforms/basic/"}getDebugCategories(){return["Variables"]}getDebugInfo(t,r){switch(t){case"Variables":return this.varsToLongString()}}varsToLongString(){var t="",r=Object.keys(this.runtime.vars);r.sort();for(var e of r){var i=this.runtime.vars[e],n=JSON.stringify(i);n.length>24&&(n=`${n.substr(0,24)}...(${n.length})`),t+=p(e,3)+" = "+n+` `}return t}setupDebug(t){this.onBreakpointHit=t}clearDebug(){this.onBreakpointHit=null,this.debugTrap=null}checkDebugTrap(){return this.debugTrap&&this.debugTrap()?(this.pause(),this.break(),!0):!1}break(){this.onBreakpointHit&&this.onBreakpointHit(this.saveState())}step(){var t=this.clock;this.debugTrap=()=>this.clock>t,this.resume()}stepOver(){var t=this.runtime.getStatement();if(t&&(t.command=="GOSUB"||t.command=="ONGOSUB")){var r=this.getPC()+1;this.runEval(()=>this.getPC()==r)}else this.step()}runUntilReturn(){var t=this.getSP();this.runEval(()=>this.getSP()>t)}runEval(t){this.debugTrap=()=>t(this.getCPUState()),this.resume()}restartAtPC(t){return t=Math.round(t),t>=0&&t{(function(l){if(typeof Hs=="object"&&typeof xa!="undefined")xa.exports=l();else if(typeof define=="function"&&define.amd)define([],l);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=l()}})(function(){var l,t,r;return function a(u,d,m){function y(W,ue){if(!d[W]){if(!u[W]){var z=typeof di=="function"&&di;if(!ue&&z)return z(W,!0);if(b)return b(W,!0);var H=new Error("Cannot find module '"+W+"'");throw H.code="MODULE_NOT_FOUND",H}var V=d[W]={exports:{}};u[W][0].call(V.exports,function(de){var K=u[W][1][de];return y(K||de)},V,V.exports,a,u,d,m)}return d[W].exports}for(var b=typeof di=="function"&&di,F=0;F=43)}}).catch(function(){return!1})}function Se(p){return typeof Ce=="boolean"?z.resolve(Ce):oe(p).then(function(_){return Ce=_,Ce})}function ze(p){var _=be[p.name],v={};v.promise=new z(function(C,k){v.resolve=C,v.reject=k}),_.deferredOperations.push(v),_.dbReady?_.dbReady=_.dbReady.then(function(){return v.promise}):_.dbReady=v.promise}function Ne(p){var _=be[p.name],v=_.deferredOperations.pop();if(v)return v.resolve(),v.promise}function it(p,_){var v=be[p.name],C=v.deferredOperations.pop();if(C)return C.reject(_),C.promise}function Je(p,_){return new z(function(v,C){if(be[p.name]=be[p.name]||ar(),p.db)if(_)ze(p),p.db.close();else return v(p.db);var k=[p.name];_&&k.push(p.version);var S=F.open.apply(F,k);_&&(S.onupgradeneeded=function(N){var j=S.result;try{j.createObjectStore(p.storeName),N.oldVersion<=1&&j.createObjectStore(xe)}catch(G){if(G.name==="ConstraintError")console.warn('The database "'+p.name+'" has been upgraded from version '+N.oldVersion+" to version "+N.newVersion+', but the storage "'+p.storeName+'" already exists.');else throw G}}),S.onerror=function(N){N.preventDefault(),C(S.error)},S.onsuccess=function(){var N=S.result;N.onversionchange=function(j){j.target.close()},v(N),Ne(p)}})}function bt(p){return Je(p,!1)}function nr(p){return Je(p,!0)}function Pr(p,_){if(!p.db)return!0;var v=!p.db.objectStoreNames.contains(p.storeName),C=p.versionp.db.version;if(C&&(p.version!==_&&console.warn('The database "'+p.name+`" can't be downgraded from version `+p.db.version+" to version "+p.version+"."),p.version=p.db.version),k||v){if(v){var S=p.db.version+1;S>p.version&&(p.version=S)}return!0}return!1}function jr(p){return new z(function(_,v){var C=new FileReader;C.onerror=v,C.onloadend=function(k){var S=btoa(k.target.result||"");_({__local_forage_encoded_blob:!0,data:S,type:p.type})},C.readAsBinaryString(p)})}function Xt(p){var _=ne(atob(p.data));return ue([_],{type:p.type})}function Br(p){return p&&p.__local_forage_encoded_blob}function yt(p){var _=this,v=_._initReady().then(function(){var C=be[_._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return V(v,p,p),v}function Nn(p){ze(p);for(var _=be[p.name],v=_.forages,C=0;C0&&(!p.db||S.name==="InvalidStateError"||S.name==="NotFoundError"))return z.resolve().then(function(){if(!p.db||S.name==="NotFoundError"&&!p.db.objectStoreNames.contains(p.storeName)&&p.version<=p.db.version)return p.db&&(p.version=p.db.version+1),nr(p)}).then(function(){return Nn(p).then(function(){Ke(p,_,v,C-1)})}).catch(v);v(S)}}function ar(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ii(p){var _=this,v={db:null};if(p)for(var C in p)v[C]=p[C];var k=be[v.name];k||(k=ar(),be[v.name]=k),k.forages.push(_),_._initReady||(_._initReady=_.ready,_.ready=yt);var S=[];function N(){return z.resolve()}for(var j=0;j>4,Y[k++]=(N&15)<<4|j>>2,Y[k++]=(j&3)<<6|G&63;return q}function Ze(p){var _=new Uint8Array(p),v="",C;for(C=0;C<_.length;C+=3)v+=$e[_[C]>>2],v+=$e[(_[C]&3)<<4|_[C+1]>>4],v+=$e[(_[C+1]&15)<<2|_[C+2]>>6],v+=$e[_[C+2]&63];return _.length%3==2?v=v.substring(0,v.length-1)+"=":_.length%3==1&&(v=v.substring(0,v.length-2)+"=="),v}function et(p,_){var v="";if(p&&(v=Vr.call(p)),p&&(v==="[object ArrayBuffer]"||p.buffer&&Vr.call(p.buffer)==="[object ArrayBuffer]")){var C,k=Ar;p instanceof ArrayBuffer?(C=p,k+=Fr):(C=p.buffer,v==="[object Int8Array]"?k+=wt:v==="[object Uint8Array]"?k+=Lt:v==="[object Uint8ClampedArray]"?k+=Ot:v==="[object Int16Array]"?k+=Ni:v==="[object Uint16Array]"?k+=Hr:v==="[object Int32Array]"?k+=lr:v==="[object Uint32Array]"?k+=zr:v==="[object Float32Array]"?k+=Oi:v==="[object Float64Array]"?k+=$t:_(new Error("Failed to get type for BinaryArray"))),_(k+Ze(C))}else if(v==="[object Blob]"){var S=new FileReader;S.onload=function(){var N=Bn+p.type+"~"+Ze(this.result);_(Ar+Nt+N)},S.readAsArrayBuffer(p)}else try{_(JSON.stringify(p))}catch(N){console.error("Couldn't convert value into a JSON string: ",p),_(null,N)}}function qr(p){if(p.substring(0,Dr)!==Ar)return JSON.parse(p);var _=p.substring(Qt),v=p.substring(Dr,Qt),C;if(v===Nt&&Mi.test(_)){var k=_.match(Mi);C=k[1],_=_.substring(k[0].length)}var S=Gr(_);switch(v){case Fr:return S;case Nt:return ue([S],{type:C});case wt:return new Int8Array(S);case Lt:return new Uint8Array(S);case Ot:return new Uint8ClampedArray(S);case Ni:return new Int16Array(S);case Hr:return new Uint16Array(S);case lr:return new Int32Array(S);case zr:return new Uint32Array(S);case Oi:return new Float32Array(S);case $t:return new Float64Array(S);default:throw new Error("Unkown type: "+v)}}var Yr={serialize:et,deserialize:qr,stringToBuffer:Gr,bufferToString:Ze};function Xr(p,_,v,C){p.executeSql("CREATE TABLE IF NOT EXISTS "+_.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],v,C)}function $i(p){var _=this,v={db:null};if(p)for(var C in p)v[C]=typeof p[C]!="string"?p[C].toString():p[C];var k=new z(function(S,N){try{v.db=openDatabase(v.name,String(v.version),v.description,v.size)}catch(j){return N(j)}v.db.transaction(function(j){Xr(j,v,function(){_._dbInfo=v,S()},function(G,q){N(q)})},N)});return v.serializer=Yr,k}function nt(p,_,v,C,k,S){p.executeSql(v,C,k,function(N,j){j.code===j.SYNTAX_ERR?N.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[_.storeName],function(G,q){q.rows.length?S(G,j):Xr(G,_,function(){G.executeSql(v,C,k,S)},S)},S):S(N,j)},S)}function Jt(p,_){var v=this;p=de(p);var C=new z(function(k,S){v.ready().then(function(){var N=v._dbInfo;N.db.transaction(function(j){nt(j,N,"SELECT * FROM "+N.storeName+" WHERE key = ? LIMIT 1",[p],function(G,q){var Y=q.rows.length?q.rows.item(0).value:null;Y&&(Y=N.serializer.deserialize(Y)),k(Y)},function(G,q){S(q)})})}).catch(S)});return H(C,_),C}function Un(p,_){var v=this,C=new z(function(k,S){v.ready().then(function(){var N=v._dbInfo;N.db.transaction(function(j){nt(j,N,"SELECT * FROM "+N.storeName,[],function(G,q){for(var Y=q.rows,Z=Y.length,ye=0;ye0){N(Wi.apply(k,[p,G,v,C-1]));return}j(ye)}})})}).catch(j)});return H(S,v),S}function Qr(p,_,v){return Wi.apply(this,[p,_,v,1])}function Lr(p,_){var v=this;p=de(p);var C=new z(function(k,S){v.ready().then(function(){var N=v._dbInfo;N.db.transaction(function(j){nt(j,N,"DELETE FROM "+N.storeName+" WHERE key = ?",[p],function(){k()},function(G,q){S(q)})})}).catch(S)});return H(C,_),C}function Hn(p){var _=this,v=new z(function(C,k){_.ready().then(function(){var S=_._dbInfo;S.db.transaction(function(N){nt(N,S,"DELETE FROM "+S.storeName,[],function(){C()},function(j,G){k(G)})})}).catch(k)});return H(v,p),v}function zn(p){var _=this,v=new z(function(C,k){_.ready().then(function(){var S=_._dbInfo;S.db.transaction(function(N){nt(N,S,"SELECT COUNT(key) as c FROM "+S.storeName,[],function(j,G){var q=G.rows.item(0).c;C(q)},function(j,G){k(G)})})}).catch(k)});return H(v,p),v}function Vn(p,_){var v=this,C=new z(function(k,S){v.ready().then(function(){var N=v._dbInfo;N.db.transaction(function(j){nt(j,N,"SELECT key FROM "+N.storeName+" WHERE id = ? LIMIT 1",[p+1],function(G,q){var Y=q.rows.length?q.rows.item(0).key:null;k(Y)},function(G,q){S(q)})})}).catch(S)});return H(C,_),C}function ji(p){var _=this,v=new z(function(C,k){_.ready().then(function(){var S=_._dbInfo;S.db.transaction(function(N){nt(N,S,"SELECT key FROM "+S.storeName,[],function(j,G){for(var q=[],Y=0;Y '__WebKitDatabaseInfoTable__'",[],function(k,S){for(var N=[],j=0;j0}function Kr(p){var _=this,v={};if(p)for(var C in p)v[C]=p[C];return v.keyPrefix=Wt(p,_._defaultConfig),Jr()?(_._dbInfo=v,v.serializer=Yr,z.resolve()):z.reject()}function Rr(p){var _=this,v=_.ready().then(function(){for(var C=_._dbInfo.keyPrefix,k=localStorage.length-1;k>=0;k--){var S=localStorage.key(k);S.indexOf(C)===0&&localStorage.removeItem(S)}});return H(v,p),v}function Hi(p,_){var v=this;p=de(p);var C=v.ready().then(function(){var k=v._dbInfo,S=localStorage.getItem(k.keyPrefix+p);return S&&(S=k.serializer.deserialize(S)),S});return H(C,_),C}function Xn(p,_){var v=this,C=v.ready().then(function(){for(var k=v._dbInfo,S=k.keyPrefix,N=S.length,j=localStorage.length,G=1,q=0;q=0;N--){var j=localStorage.key(N);j.indexOf(S)===0&&localStorage.removeItem(j)}}):k=z.reject("Invalid arguments"),H(k,_),k}var Yi={_driver:"localStorageWrapper",_initStorage:Kr,_support:Yn(),iterate:Xn,getItem:Hi,setItem:Gi,removeItem:Vi,clear:Rr,length:ur,key:zi,keys:Qn,dropInstance:qi},Jn=function(_,v){return _===v||typeof _=="number"&&typeof v=="number"&&isNaN(_)&&isNaN(v)},Zr=function(_,v){for(var C=_.length,k=0;k{(function(l,t){"use strict";typeof mn=="object"&&typeof mn.exports=="object"?mn.exports=l.document?t(l,!0):function(r){if(!r.document)throw new Error("jQuery requires a window with a document");return t(r)}:t(l)})(typeof window!="undefined"?window:qs,function(l,t){"use strict";var r=[],a=Object.getPrototypeOf,u=r.slice,d=r.flat?function(e){return r.flat.call(e)}:function(e){return r.concat.apply([],e)},m=r.push,y=r.indexOf,b={},F=b.toString,W=b.hasOwnProperty,ue=W.toString,z=ue.call(Object),H={},V=function(i){return typeof i=="function"&&typeof i.nodeType!="number"&&typeof i.item!="function"},de=function(i){return i!=null&&i===i.window},K=l.document,xe={type:!0,src:!0,nonce:!0,noModule:!0};function Ce(e,i,n){n=n||K;var s,c,f=n.createElement("script");if(f.text=e,i)for(s in xe)c=i[s]||i.getAttribute&&i.getAttribute(s),c&&f.setAttribute(s,c);n.head.appendChild(f).parentNode.removeChild(f)}function be(e){return e==null?e+"":typeof e=="object"||typeof e=="function"?b[F.call(e)]||"object":typeof e}var _e="3.6.3",o=function(e,i){return new o.fn.init(e,i)};o.fn=o.prototype={jquery:_e,constructor:o,length:0,toArray:function(){return u.call(this)},get:function(e){return e==null?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var i=o.merge(this.constructor(),e);return i.prevObject=this,i},each:function(e){return o.each(this,e)},map:function(e){return this.pushStack(o.map(this,function(i,n){return e.call(i,n,i)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(o.grep(this,function(e,i){return(i+1)%2}))},odd:function(){return this.pushStack(o.grep(this,function(e,i){return i%2}))},eq:function(e){var i=this.length,n=+e+(e<0?i:0);return this.pushStack(n>=0&&n0&&i-1 in e}var ne=function(e){var i,n,s,c,f,h,E,x,D,R,B,L,I,ie,ve,re,Ge,Ve,ht,Fe="sizzle"+1*new Date,ge=e.document,ut=0,Te=0,je=tn(),li=tn(),Ki=tn(),pt=tn(),dr=function(g,w){return g===w&&(B=!0),0},hr={}.hasOwnProperty,ct=[],Zt=ct.pop,Et=ct.push,er=ct.push,ws=ct.slice,pr=function(g,w){for(var T=0,M=g.length;T+~]|"+Ae+")"+Ae+"*"),gl=new RegExp(Ae+"|>"),ml=new RegExp(aa),vl=new RegExp("^"+gr+"$"),en={ID:new RegExp("^#("+gr+")"),CLASS:new RegExp("^\\.("+gr+")"),TAG:new RegExp("^("+gr+"|[*])"),ATTR:new RegExp("^"+Es),PSEUDO:new RegExp("^"+aa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Ae+"*(even|odd|(([+-]|)(\\d*)n|)"+Ae+"*(?:([+-]|)"+Ae+"*(\\d+)|))"+Ae+"*\\)|)","i"),bool:new RegExp("^(?:"+na+")$","i"),needsContext:new RegExp("^"+Ae+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Ae+"*((?:-\\d)?\\d*)"+Ae+"*\\)|)(?=[^-]|$)","i")},bl=/HTML$/i,yl=/^(?:input|select|textarea|button)$/i,xl=/^h\d$/i,ui=/^[^{]+\{\s*\[native \w/,wl=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,sa=/[+~]/,Ut=new RegExp("\\\\[\\da-fA-F]{1,6}"+Ae+"?|\\\\([^\\r\\n\\f])","g"),Ht=function(g,w){var T="0x"+g.slice(1)-65536;return w||(T<0?String.fromCharCode(T+65536):String.fromCharCode(T>>10|55296,T&1023|56320))},Ss=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Ts=function(g,w){return w?g==="\0"?"\uFFFD":g.slice(0,-1)+"\\"+g.charCodeAt(g.length-1).toString(16)+" ":"\\"+g},Cs=function(){L()},El=nn(function(g){return g.disabled===!0&&g.nodeName.toLowerCase()==="fieldset"},{dir:"parentNode",next:"legend"});try{er.apply(ct=ws.call(ge.childNodes),ge.childNodes),ct[ge.childNodes.length].nodeType}catch(g){er={apply:ct.length?function(w,T){Et.apply(w,ws.call(T))}:function(w,T){for(var M=w.length,A=0;w[M++]=T[A++];);w.length=M-1}}}function Re(g,w,T,M){var A,O,U,Q,J,ce,se,he=w&&w.ownerDocument,Ee=w?w.nodeType:9;if(T=T||[],typeof g!="string"||!g||Ee!==1&&Ee!==9&&Ee!==11)return T;if(!M&&(L(w),w=w||I,ve)){if(Ee!==11&&(J=wl.exec(g)))if(A=J[1]){if(Ee===9)if(U=w.getElementById(A)){if(U.id===A)return T.push(U),T}else return T;else if(he&&(U=he.getElementById(A))&&ht(w,U)&&U.id===A)return T.push(U),T}else{if(J[2])return er.apply(T,w.getElementsByTagName(g)),T;if((A=J[3])&&n.getElementsByClassName&&w.getElementsByClassName)return er.apply(T,w.getElementsByClassName(A)),T}if(n.qsa&&!pt[g+" "]&&(!re||!re.test(g))&&(Ee!==1||w.nodeName.toLowerCase()!=="object")){if(se=g,he=w,Ee===1&&(gl.test(g)||_s.test(g))){for(he=sa.test(g)&&la(w.parentNode)||w,(he!==w||!n.scope)&&((Q=w.getAttribute("id"))?Q=Q.replace(Ss,Ts):w.setAttribute("id",Q=Fe)),ce=h(g),O=ce.length;O--;)ce[O]=(Q?"#"+Q:":scope")+" "+rn(ce[O]);se=ce.join(",")}try{if(n.cssSupportsSelector&&!CSS.supports("selector(:is("+se+"))"))throw new Error;return er.apply(T,he.querySelectorAll(se)),T}catch(Ie){pt(g,!0)}finally{Q===Fe&&w.removeAttribute("id")}}}return x(g.replace(Zi,"$1"),w,T,M)}function tn(){var g=[];function w(T,M){return g.push(T+" ")>s.cacheLength&&delete w[g.shift()],w[T+" "]=M}return w}function kt(g){return g[Fe]=!0,g}function _t(g){var w=I.createElement("fieldset");try{return!!g(w)}catch(T){return!1}finally{w.parentNode&&w.parentNode.removeChild(w),w=null}}function oa(g,w){for(var T=g.split("|"),M=T.length;M--;)s.attrHandle[T[M]]=w}function Ps(g,w){var T=w&&g,M=T&&g.nodeType===1&&w.nodeType===1&&g.sourceIndex-w.sourceIndex;if(M)return M;if(T){for(;T=T.nextSibling;)if(T===w)return-1}return g?1:-1}function _l(g){return function(w){var T=w.nodeName.toLowerCase();return T==="input"&&w.type===g}}function Sl(g){return function(w){var T=w.nodeName.toLowerCase();return(T==="input"||T==="button")&&w.type===g}}function ks(g){return function(w){return"form"in w?w.parentNode&&w.disabled===!1?"label"in w?"label"in w.parentNode?w.parentNode.disabled===g:w.disabled===g:w.isDisabled===g||w.isDisabled!==!g&&El(w)===g:w.disabled===g:"label"in w?w.disabled===g:!1}}function mr(g){return kt(function(w){return w=+w,kt(function(T,M){for(var A,O=g([],T.length,w),U=O.length;U--;)T[A=O[U]]&&(T[A]=!(M[A]=T[A]))})})}function la(g){return g&&typeof g.getElementsByTagName!="undefined"&&g}n=Re.support={},f=Re.isXML=function(g){var w=g&&g.namespaceURI,T=g&&(g.ownerDocument||g).documentElement;return!bl.test(w||T&&T.nodeName||"HTML")},L=Re.setDocument=function(g){var w,T,M=g?g.ownerDocument||g:ge;return M==I||M.nodeType!==9||!M.documentElement||(I=M,ie=I.documentElement,ve=!f(I),ge!=I&&(T=I.defaultView)&&T.top!==T&&(T.addEventListener?T.addEventListener("unload",Cs,!1):T.attachEvent&&T.attachEvent("onunload",Cs)),n.scope=_t(function(A){return ie.appendChild(A).appendChild(I.createElement("div")),typeof A.querySelectorAll!="undefined"&&!A.querySelectorAll(":scope fieldset div").length}),n.cssSupportsSelector=_t(function(){return CSS.supports("selector(*)")&&I.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))")}),n.attributes=_t(function(A){return A.className="i",!A.getAttribute("className")}),n.getElementsByTagName=_t(function(A){return A.appendChild(I.createComment("")),!A.getElementsByTagName("*").length}),n.getElementsByClassName=ui.test(I.getElementsByClassName),n.getById=_t(function(A){return ie.appendChild(A).id=Fe,!I.getElementsByName||!I.getElementsByName(Fe).length}),n.getById?(s.filter.ID=function(A){var O=A.replace(Ut,Ht);return function(U){return U.getAttribute("id")===O}},s.find.ID=function(A,O){if(typeof O.getElementById!="undefined"&&ve){var U=O.getElementById(A);return U?[U]:[]}}):(s.filter.ID=function(A){var O=A.replace(Ut,Ht);return function(U){var Q=typeof U.getAttributeNode!="undefined"&&U.getAttributeNode("id");return Q&&Q.value===O}},s.find.ID=function(A,O){if(typeof O.getElementById!="undefined"&&ve){var U,Q,J,ce=O.getElementById(A);if(ce){if(U=ce.getAttributeNode("id"),U&&U.value===A)return[ce];for(J=O.getElementsByName(A),Q=0;ce=J[Q++];)if(U=ce.getAttributeNode("id"),U&&U.value===A)return[ce]}return[]}}),s.find.TAG=n.getElementsByTagName?function(A,O){if(typeof O.getElementsByTagName!="undefined")return O.getElementsByTagName(A);if(n.qsa)return O.querySelectorAll(A)}:function(A,O){var U,Q=[],J=0,ce=O.getElementsByTagName(A);if(A==="*"){for(;U=ce[J++];)U.nodeType===1&&Q.push(U);return Q}return ce},s.find.CLASS=n.getElementsByClassName&&function(A,O){if(typeof O.getElementsByClassName!="undefined"&&ve)return O.getElementsByClassName(A)},Ge=[],re=[],(n.qsa=ui.test(I.querySelectorAll))&&(_t(function(A){var O;ie.appendChild(A).innerHTML="",A.querySelectorAll("[msallowcapture^='']").length&&re.push("[*^$]="+Ae+`*(?:''|"")`),A.querySelectorAll("[selected]").length||re.push("\\["+Ae+"*(?:value|"+na+")"),A.querySelectorAll("[id~="+Fe+"-]").length||re.push("~="),O=I.createElement("input"),O.setAttribute("name",""),A.appendChild(O),A.querySelectorAll("[name='']").length||re.push("\\["+Ae+"*name"+Ae+"*="+Ae+`*(?:''|"")`),A.querySelectorAll(":checked").length||re.push(":checked"),A.querySelectorAll("a#"+Fe+"+*").length||re.push(".#.+[+~]"),A.querySelectorAll("\\\f"),re.push("[\\r\\n\\f]")}),_t(function(A){A.innerHTML="";var O=I.createElement("input");O.setAttribute("type","hidden"),A.appendChild(O).setAttribute("name","D"),A.querySelectorAll("[name=d]").length&&re.push("name"+Ae+"*[*^$|!~]?="),A.querySelectorAll(":enabled").length!==2&&re.push(":enabled",":disabled"),ie.appendChild(A).disabled=!0,A.querySelectorAll(":disabled").length!==2&&re.push(":enabled",":disabled"),A.querySelectorAll("*,:x"),re.push(",.*:")})),(n.matchesSelector=ui.test(Ve=ie.matches||ie.webkitMatchesSelector||ie.mozMatchesSelector||ie.oMatchesSelector||ie.msMatchesSelector))&&_t(function(A){n.disconnectedMatch=Ve.call(A,"*"),Ve.call(A,"[s!='']:x"),Ge.push("!=",aa)}),n.cssSupportsSelector||re.push(":has"),re=re.length&&new RegExp(re.join("|")),Ge=Ge.length&&new RegExp(Ge.join("|")),w=ui.test(ie.compareDocumentPosition),ht=w||ui.test(ie.contains)?function(A,O){var U=A.nodeType===9&&A.documentElement||A,Q=O&&O.parentNode;return A===Q||!!(Q&&Q.nodeType===1&&(U.contains?U.contains(Q):A.compareDocumentPosition&&A.compareDocumentPosition(Q)&16))}:function(A,O){if(O){for(;O=O.parentNode;)if(O===A)return!0}return!1},dr=w?function(A,O){if(A===O)return B=!0,0;var U=!A.compareDocumentPosition-!O.compareDocumentPosition;return U||(U=(A.ownerDocument||A)==(O.ownerDocument||O)?A.compareDocumentPosition(O):1,U&1||!n.sortDetached&&O.compareDocumentPosition(A)===U?A==I||A.ownerDocument==ge&&ht(ge,A)?-1:O==I||O.ownerDocument==ge&&ht(ge,O)?1:R?pr(R,A)-pr(R,O):0:U&4?-1:1)}:function(A,O){if(A===O)return B=!0,0;var U,Q=0,J=A.parentNode,ce=O.parentNode,se=[A],he=[O];if(!J||!ce)return A==I?-1:O==I?1:J?-1:ce?1:R?pr(R,A)-pr(R,O):0;if(J===ce)return Ps(A,O);for(U=A;U=U.parentNode;)se.unshift(U);for(U=O;U=U.parentNode;)he.unshift(U);for(;se[Q]===he[Q];)Q++;return Q?Ps(se[Q],he[Q]):se[Q]==ge?-1:he[Q]==ge?1:0}),I},Re.matches=function(g,w){return Re(g,null,null,w)},Re.matchesSelector=function(g,w){if(L(g),n.matchesSelector&&ve&&!pt[w+" "]&&(!Ge||!Ge.test(w))&&(!re||!re.test(w)))try{var T=Ve.call(g,w);if(T||n.disconnectedMatch||g.document&&g.document.nodeType!==11)return T}catch(M){pt(w,!0)}return Re(w,I,null,[g]).length>0},Re.contains=function(g,w){return(g.ownerDocument||g)!=I&&L(g),ht(g,w)},Re.attr=function(g,w){(g.ownerDocument||g)!=I&&L(g);var T=s.attrHandle[w.toLowerCase()],M=T&&hr.call(s.attrHandle,w.toLowerCase())?T(g,w,!ve):void 0;return M!==void 0?M:n.attributes||!ve?g.getAttribute(w):(M=g.getAttributeNode(w))&&M.specified?M.value:null},Re.escape=function(g){return(g+"").replace(Ss,Ts)},Re.error=function(g){throw new Error("Syntax error, unrecognized expression: "+g)},Re.uniqueSort=function(g){var w,T=[],M=0,A=0;if(B=!n.detectDuplicates,R=!n.sortStable&&g.slice(0),g.sort(dr),B){for(;w=g[A++];)w===g[A]&&(M=T.push(A));for(;M--;)g.splice(T[M],1)}return R=null,g},c=Re.getText=function(g){var w,T="",M=0,A=g.nodeType;if(A){if(A===1||A===9||A===11){if(typeof g.textContent=="string")return g.textContent;for(g=g.firstChild;g;g=g.nextSibling)T+=c(g)}else if(A===3||A===4)return g.nodeValue}else for(;w=g[M++];)T+=c(w);return T},s=Re.selectors={cacheLength:50,createPseudo:kt,match:en,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(g){return g[1]=g[1].replace(Ut,Ht),g[3]=(g[3]||g[4]||g[5]||"").replace(Ut,Ht),g[2]==="~="&&(g[3]=" "+g[3]+" "),g.slice(0,4)},CHILD:function(g){return g[1]=g[1].toLowerCase(),g[1].slice(0,3)==="nth"?(g[3]||Re.error(g[0]),g[4]=+(g[4]?g[5]+(g[6]||1):2*(g[3]==="even"||g[3]==="odd")),g[5]=+(g[7]+g[8]||g[3]==="odd")):g[3]&&Re.error(g[0]),g},PSEUDO:function(g){var w,T=!g[6]&&g[2];return en.CHILD.test(g[0])?null:(g[3]?g[2]=g[4]||g[5]||"":T&&ml.test(T)&&(w=h(T,!0))&&(w=T.indexOf(")",T.length-w)-T.length)&&(g[0]=g[0].slice(0,w),g[2]=T.slice(0,w)),g.slice(0,3))}},filter:{TAG:function(g){var w=g.replace(Ut,Ht).toLowerCase();return g==="*"?function(){return!0}:function(T){return T.nodeName&&T.nodeName.toLowerCase()===w}},CLASS:function(g){var w=je[g+" "];return w||(w=new RegExp("(^|"+Ae+")"+g+"("+Ae+"|$)"))&&je(g,function(T){return w.test(typeof T.className=="string"&&T.className||typeof T.getAttribute!="undefined"&&T.getAttribute("class")||"")})},ATTR:function(g,w,T){return function(M){var A=Re.attr(M,g);return A==null?w==="!=":w?(A+="",w==="="?A===T:w==="!="?A!==T:w==="^="?T&&A.indexOf(T)===0:w==="*="?T&&A.indexOf(T)>-1:w==="$="?T&&A.slice(-T.length)===T:w==="~="?(" "+A.replace(hl," ")+" ").indexOf(T)>-1:w==="|="?A===T||A.slice(0,T.length+1)===T+"-":!1):!0}},CHILD:function(g,w,T,M,A){var O=g.slice(0,3)!=="nth",U=g.slice(-4)!=="last",Q=w==="of-type";return M===1&&A===0?function(J){return!!J.parentNode}:function(J,ce,se){var he,Ee,Ie,fe,qe,tt,gt=O!==U?"nextSibling":"previousSibling",Oe=J.parentNode,ci=Q&&J.nodeName.toLowerCase(),fi=!se&&!Q,mt=!1;if(Oe){if(O){for(;gt;){for(fe=J;fe=fe[gt];)if(Q?fe.nodeName.toLowerCase()===ci:fe.nodeType===1)return!1;tt=gt=g==="only"&&!tt&&"nextSibling"}return!0}if(tt=[U?Oe.firstChild:Oe.lastChild],U&&fi){for(fe=Oe,Ie=fe[Fe]||(fe[Fe]={}),Ee=Ie[fe.uniqueID]||(Ie[fe.uniqueID]={}),he=Ee[g]||[],qe=he[0]===ut&&he[1],mt=qe&&he[2],fe=qe&&Oe.childNodes[qe];fe=++qe&&fe&&fe[gt]||(mt=qe=0)||tt.pop();)if(fe.nodeType===1&&++mt&&fe===J){Ee[g]=[ut,qe,mt];break}}else if(fi&&(fe=J,Ie=fe[Fe]||(fe[Fe]={}),Ee=Ie[fe.uniqueID]||(Ie[fe.uniqueID]={}),he=Ee[g]||[],qe=he[0]===ut&&he[1],mt=qe),mt===!1)for(;(fe=++qe&&fe&&fe[gt]||(mt=qe=0)||tt.pop())&&!((Q?fe.nodeName.toLowerCase()===ci:fe.nodeType===1)&&++mt&&(fi&&(Ie=fe[Fe]||(fe[Fe]={}),Ee=Ie[fe.uniqueID]||(Ie[fe.uniqueID]={}),Ee[g]=[ut,mt]),fe===J)););return mt-=A,mt===M||mt%M==0&&mt/M>=0}}},PSEUDO:function(g,w){var T,M=s.pseudos[g]||s.setFilters[g.toLowerCase()]||Re.error("unsupported pseudo: "+g);return M[Fe]?M(w):M.length>1?(T=[g,g,"",w],s.setFilters.hasOwnProperty(g.toLowerCase())?kt(function(A,O){for(var U,Q=M(A,w),J=Q.length;J--;)U=pr(A,Q[J]),A[U]=!(O[U]=Q[J])}):function(A){return M(A,0,T)}):M}},pseudos:{not:kt(function(g){var w=[],T=[],M=E(g.replace(Zi,"$1"));return M[Fe]?kt(function(A,O,U,Q){for(var J,ce=M(A,null,Q,[]),se=A.length;se--;)(J=ce[se])&&(A[se]=!(O[se]=J))}):function(A,O,U){return w[0]=A,M(w,null,U,T),w[0]=null,!T.pop()}}),has:kt(function(g){return function(w){return Re(g,w).length>0}}),contains:kt(function(g){return g=g.replace(Ut,Ht),function(w){return(w.textContent||c(w)).indexOf(g)>-1}}),lang:kt(function(g){return vl.test(g||"")||Re.error("unsupported lang: "+g),g=g.replace(Ut,Ht).toLowerCase(),function(w){var T;do if(T=ve?w.lang:w.getAttribute("xml:lang")||w.getAttribute("lang"))return T=T.toLowerCase(),T===g||T.indexOf(g+"-")===0;while((w=w.parentNode)&&w.nodeType===1);return!1}}),target:function(g){var w=e.location&&e.location.hash;return w&&w.slice(1)===g.id},root:function(g){return g===ie},focus:function(g){return g===I.activeElement&&(!I.hasFocus||I.hasFocus())&&!!(g.type||g.href||~g.tabIndex)},enabled:ks(!1),disabled:ks(!0),checked:function(g){var w=g.nodeName.toLowerCase();return w==="input"&&!!g.checked||w==="option"&&!!g.selected},selected:function(g){return g.parentNode&&g.parentNode.selectedIndex,g.selected===!0},empty:function(g){for(g=g.firstChild;g;g=g.nextSibling)if(g.nodeType<6)return!1;return!0},parent:function(g){return!s.pseudos.empty(g)},header:function(g){return xl.test(g.nodeName)},input:function(g){return yl.test(g.nodeName)},button:function(g){var w=g.nodeName.toLowerCase();return w==="input"&&g.type==="button"||w==="button"},text:function(g){var w;return g.nodeName.toLowerCase()==="input"&&g.type==="text"&&((w=g.getAttribute("type"))==null||w.toLowerCase()==="text")},first:mr(function(){return[0]}),last:mr(function(g,w){return[w-1]}),eq:mr(function(g,w,T){return[T<0?T+w:T]}),even:mr(function(g,w){for(var T=0;Tw?w:T;--M>=0;)g.push(M);return g}),gt:mr(function(g,w,T){for(var M=T<0?T+w:T;++M1?function(w,T,M){for(var A=g.length;A--;)if(!g[A](w,T,M))return!1;return!0}:g[0]}function Tl(g,w,T){for(var M=0,A=w.length;M-1&&(U[se]=!(Q[se]=Ee))}}else Oe=an(Oe===Q?Oe.splice(qe,Oe.length):Oe),A?A(null,Q,Oe,ce):er.apply(Q,Oe)})}function fa(g){for(var w,T,M,A=g.length,O=s.relative[g[0].type],U=O||s.relative[" "],Q=O?1:0,J=nn(function(he){return he===w},U,!0),ce=nn(function(he){return pr(w,he)>-1},U,!0),se=[function(he,Ee,Ie){var fe=!O&&(Ie||Ee!==D)||((w=Ee).nodeType?J(he,Ee,Ie):ce(he,Ee,Ie));return w=null,fe}];Q1&&ua(se),Q>1&&rn(g.slice(0,Q-1).concat({value:g[Q-2].type===" "?"*":""})).replace(Zi,"$1"),T,Q0,M=g.length>0,A=function(O,U,Q,J,ce){var se,he,Ee,Ie=0,fe="0",qe=O&&[],tt=[],gt=D,Oe=O||M&&s.find.TAG("*",ce),ci=ut+=gt==null?1:Math.random()||.1,fi=Oe.length;for(ce&&(D=U==I||U||ce);fe!==fi&&(se=Oe[fe])!=null;fe++){if(M&&se){for(he=0,!U&&se.ownerDocument!=I&&(L(se),Q=!ve);Ee=g[he++];)if(Ee(se,U||I,Q)){J.push(se);break}ce&&(ut=ci)}T&&((se=!Ee&&se)&&Ie--,O&&qe.push(se))}if(Ie+=fe,T&&fe!==Ie){for(he=0;Ee=w[he++];)Ee(qe,tt,U,Q);if(O){if(Ie>0)for(;fe--;)qe[fe]||tt[fe]||(tt[fe]=Zt.call(J));tt=an(tt)}er.apply(J,tt),ce&&!O&&tt.length>0&&Ie+w.length>1&&Re.uniqueSort(J)}return ce&&(ut=ci,D=gt),qe};return T?kt(A):A}return E=Re.compile=function(g,w){var T,M=[],A=[],O=Ki[g+" "];if(!O){for(w||(w=h(g)),T=w.length;T--;)O=fa(w[T]),O[Fe]?M.push(O):A.push(O);O=Ki(g,Cl(A,M)),O.selector=g}return O},x=Re.select=function(g,w,T,M){var A,O,U,Q,J,ce=typeof g=="function"&&g,se=!M&&h(g=ce.selector||g);if(T=T||[],se.length===1){if(O=se[0]=se[0].slice(0),O.length>2&&(U=O[0]).type==="ID"&&w.nodeType===9&&ve&&s.relative[O[1].type]){if(w=(s.find.ID(U.matches[0].replace(Ut,Ht),w)||[])[0],w)ce&&(w=w.parentNode);else return T;g=g.slice(O.shift().value.length)}for(A=en.needsContext.test(g)?0:O.length;A--&&(U=O[A],!s.relative[Q=U.type]);)if((J=s.find[Q])&&(M=J(U.matches[0].replace(Ut,Ht),sa.test(O[0].type)&&la(w.parentNode)||w))){if(O.splice(A,1),g=M.length&&rn(O),!g)return er.apply(T,M),T;break}}return(ce||E(g,se))(M,w,!ve,T,!w||sa.test(g)&&la(w.parentNode)||w),T},n.sortStable=Fe.split("").sort(dr).join("")===Fe,n.detectDuplicates=!!B,L(),n.sortDetached=_t(function(g){return g.compareDocumentPosition(I.createElement("fieldset"))&1}),_t(function(g){return g.innerHTML="",g.firstChild.getAttribute("href")==="#"})||oa("type|href|height|width",function(g,w,T){if(!T)return g.getAttribute(w,w.toLowerCase()==="type"?1:2)}),(!n.attributes||!_t(function(g){return g.innerHTML="",g.firstChild.setAttribute("value",""),g.firstChild.getAttribute("value")===""}))&&oa("value",function(g,w,T){if(!T&&g.nodeName.toLowerCase()==="input")return g.defaultValue}),_t(function(g){return g.getAttribute("disabled")==null})||oa(na,function(g,w,T){var M;if(!T)return g[w]===!0?w.toLowerCase():(M=g.getAttributeNode(w))&&M.specified?M.value:null}),Re}(l);o.find=ne,o.expr=ne.selectors,o.expr[":"]=o.expr.pseudos,o.uniqueSort=o.unique=ne.uniqueSort,o.text=ne.getText,o.isXMLDoc=ne.isXML,o.contains=ne.contains,o.escapeSelector=ne.escape;var oe=function(e,i,n){for(var s=[],c=n!==void 0;(e=e[i])&&e.nodeType!==9;)if(e.nodeType===1){if(c&&o(e).is(n))break;s.push(e)}return s},Se=function(e,i){for(var n=[];e;e=e.nextSibling)e.nodeType===1&&e!==i&&n.push(e);return n},ze=o.expr.match.needsContext;function Ne(e,i){return e.nodeName&&e.nodeName.toLowerCase()===i.toLowerCase()}var it=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function Je(e,i,n){return V(i)?o.grep(e,function(s,c){return!!i.call(s,c,s)!==n}):i.nodeType?o.grep(e,function(s){return s===i!==n}):typeof i!="string"?o.grep(e,function(s){return y.call(i,s)>-1!==n}):o.filter(i,e,n)}o.filter=function(e,i,n){var s=i[0];return n&&(e=":not("+e+")"),i.length===1&&s.nodeType===1?o.find.matchesSelector(s,e)?[s]:[]:o.find.matches(e,o.grep(i,function(c){return c.nodeType===1}))},o.fn.extend({find:function(e){var i,n,s=this.length,c=this;if(typeof e!="string")return this.pushStack(o(e).filter(function(){for(i=0;i1?o.uniqueSort(n):n},filter:function(e){return this.pushStack(Je(this,e||[],!1))},not:function(e){return this.pushStack(Je(this,e||[],!0))},is:function(e){return!!Je(this,typeof e=="string"&&ze.test(e)?o(e):e||[],!1).length}});var bt,nr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,Pr=o.fn.init=function(e,i,n){var s,c;if(!e)return this;if(n=n||bt,typeof e=="string")if(e[0]==="<"&&e[e.length-1]===">"&&e.length>=3?s=[null,e,null]:s=nr.exec(e),s&&(s[1]||!i))if(s[1]){if(i=i instanceof o?i[0]:i,o.merge(this,o.parseHTML(s[1],i&&i.nodeType?i.ownerDocument||i:K,!0)),it.test(s[1])&&o.isPlainObject(i))for(s in i)V(this[s])?this[s](i[s]):this.attr(s,i[s]);return this}else return c=K.getElementById(s[2]),c&&(this[0]=c,this.length=1),this;else return!i||i.jquery?(i||n).find(e):this.constructor(i).find(e);else{if(e.nodeType)return this[0]=e,this.length=1,this;if(V(e))return n.ready!==void 0?n.ready(e):e(o)}return o.makeArray(e,this)};Pr.prototype=o.fn,bt=o(K);var jr=/^(?:parents|prev(?:Until|All))/,Xt={children:!0,contents:!0,next:!0,prev:!0};o.fn.extend({has:function(e){var i=o(e,this),n=i.length;return this.filter(function(){for(var s=0;s-1:n.nodeType===1&&o.find.matchesSelector(n,e))){f.push(n);break}}return this.pushStack(f.length>1?o.uniqueSort(f):f)},index:function(e){return e?typeof e=="string"?y.call(o(e),this[0]):y.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,i){return this.pushStack(o.uniqueSort(o.merge(this.get(),o(e,i))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});function Br(e,i){for(;(e=e[i])&&e.nodeType!==1;);return e}o.each({parent:function(e){var i=e.parentNode;return i&&i.nodeType!==11?i:null},parents:function(e){return oe(e,"parentNode")},parentsUntil:function(e,i,n){return oe(e,"parentNode",n)},next:function(e){return Br(e,"nextSibling")},prev:function(e){return Br(e,"previousSibling")},nextAll:function(e){return oe(e,"nextSibling")},prevAll:function(e){return oe(e,"previousSibling")},nextUntil:function(e,i,n){return oe(e,"nextSibling",n)},prevUntil:function(e,i,n){return oe(e,"previousSibling",n)},siblings:function(e){return Se((e.parentNode||{}).firstChild,e)},children:function(e){return Se(e.firstChild)},contents:function(e){return e.contentDocument!=null&&a(e.contentDocument)?e.contentDocument:(Ne(e,"template")&&(e=e.content||e),o.merge([],e.childNodes))}},function(e,i){o.fn[e]=function(n,s){var c=o.map(this,i,n);return e.slice(-5)!=="Until"&&(s=n),s&&typeof s=="string"&&(c=o.filter(s,c)),this.length>1&&(Xt[e]||o.uniqueSort(c),jr.test(e)&&c.reverse()),this.pushStack(c)}});var yt=/[^\x20\t\r\n\f]+/g;function Nn(e){var i={};return o.each(e.match(yt)||[],function(n,s){i[s]=!0}),i}o.Callbacks=function(e){e=typeof e=="string"?Nn(e):o.extend({},e);var i,n,s,c,f=[],h=[],E=-1,x=function(){for(c=c||e.once,s=i=!0;h.length;E=-1)for(n=h.shift();++E-1;)f.splice(L,1),L<=E&&E--}),this},has:function(R){return R?o.inArray(R,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return c=h=[],f=n="",this},disabled:function(){return!f},lock:function(){return c=h=[],!n&&!i&&(f=n=""),this},locked:function(){return!!c},fireWith:function(R,B){return c||(B=B||[],B=[R,B.slice?B.slice():B],h.push(B),i||x()),this},fire:function(){return D.fireWith(this,arguments),this},fired:function(){return!!s}};return D};function Ke(e){return e}function ar(e){throw e}function Ii(e,i,n,s){var c;try{e&&V(c=e.promise)?c.call(e).done(i).fail(n):e&&V(c=e.then)?c.call(e,i,n):i.apply(void 0,[e].slice(s))}catch(f){n.apply(void 0,[f])}}o.extend({Deferred:function(e){var i=[["notify","progress",o.Callbacks("memory"),o.Callbacks("memory"),2],["resolve","done",o.Callbacks("once memory"),o.Callbacks("once memory"),0,"resolved"],["reject","fail",o.Callbacks("once memory"),o.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return c.done(arguments).fail(arguments),this},catch:function(f){return s.then(null,f)},pipe:function(){var f=arguments;return o.Deferred(function(h){o.each(i,function(E,x){var D=V(f[x[4]])&&f[x[4]];c[x[1]](function(){var R=D&&D.apply(this,arguments);R&&V(R.promise)?R.promise().progress(h.notify).done(h.resolve).fail(h.reject):h[x[0]+"With"](this,D?[R]:arguments)})}),f=null}).promise()},then:function(f,h,E){var x=0;function D(R,B,L,I){return function(){var ie=this,ve=arguments,re=function(){var Ve,ht;if(!(R=x&&(L!==ar&&(ie=void 0,ve=[Ve]),B.rejectWith(ie,ve))}};R?Ge():(o.Deferred.getStackHook&&(Ge.stackTrace=o.Deferred.getStackHook()),l.setTimeout(Ge))}}return o.Deferred(function(R){i[0][3].add(D(0,R,V(E)?E:Ke,R.notifyWith)),i[1][3].add(D(0,R,V(f)?f:Ke)),i[2][3].add(D(0,R,V(h)?h:ar))}).promise()},promise:function(f){return f!=null?o.extend(f,s):s}},c={};return o.each(i,function(f,h){var E=h[2],x=h[5];s[h[1]]=E.add,x&&E.add(function(){n=x},i[3-f][2].disable,i[3-f][3].disable,i[0][2].lock,i[0][3].lock),E.add(h[3].fire),c[h[0]]=function(){return c[h[0]+"With"](this===c?void 0:this,arguments),this},c[h[0]+"With"]=E.fireWith}),s.promise(c),e&&e.call(c,c),c},when:function(e){var i=arguments.length,n=i,s=Array(n),c=u.call(arguments),f=o.Deferred(),h=function(E){return function(x){s[E]=this,c[E]=arguments.length>1?u.call(arguments):x,--i||f.resolveWith(s,c)}};if(i<=1&&(Ii(e,f.done(h(n)).resolve,f.reject,!i),f.state()==="pending"||V(c[n]&&c[n].then)))return f.then();for(;n--;)Ii(c[n],h(n),f.reject);return f.promise()}});var On=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;o.Deferred.exceptionHook=function(e,i){l.console&&l.console.warn&&e&&On.test(e.name)&&l.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},o.readyException=function(e){l.setTimeout(function(){throw e})};var Ur=o.Deferred();o.fn.ready=function(e){return Ur.then(e).catch(function(i){o.readyException(i)}),this},o.extend({isReady:!1,readyWait:1,ready:function(e){(e===!0?--o.readyWait:o.isReady)||(o.isReady=!0,!(e!==!0&&--o.readyWait>0)&&Ur.resolveWith(K,[o]))}}),o.ready.then=Ur.then;function kr(){K.removeEventListener("DOMContentLoaded",kr),l.removeEventListener("load",kr),o.ready()}K.readyState==="complete"||K.readyState!=="loading"&&!K.documentElement.doScroll?l.setTimeout(o.ready):(K.addEventListener("DOMContentLoaded",kr),l.addEventListener("load",kr));var Pt=function(e,i,n,s,c,f,h){var E=0,x=e.length,D=n==null;if(be(n)==="object"){c=!0;for(E in n)Pt(e,i,E,n[E],!0,f,h)}else if(s!==void 0&&(c=!0,V(s)||(h=!0),D&&(h?(i.call(e,s),i=null):(D=i,i=function(R,B,L){return D.call(o(R),L)})),i))for(;E1,null,!0)},removeData:function(e){return this.each(function(){$e.remove(this,e)})}}),o.extend({queue:function(e,i,n){var s;if(e)return i=(i||"fx")+"queue",s=le.get(e,i),n&&(!s||Array.isArray(n)?s=le.access(e,i,o.makeArray(n)):s.push(n)),s||[]},dequeue:function(e,i){i=i||"fx";var n=o.queue(e,i),s=n.length,c=n.shift(),f=o._queueHooks(e,i),h=function(){o.dequeue(e,i)};c==="inprogress"&&(c=n.shift(),s--),c&&(i==="fx"&&n.unshift("inprogress"),delete f.stop,c.call(e,h,f)),!s&&f&&f.empty.fire()},_queueHooks:function(e,i){var n=i+"queueHooks";return le.get(e,n)||le.access(e,n,{empty:o.Callbacks("once memory").add(function(){le.remove(e,[i+"queue",n])})})}}),o.fn.extend({queue:function(e,i){var n=2;return typeof e!="string"&&(i=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Gr=/^$|^module$|\/(?:java|ecma)script/i;(function(){var e=K.createDocumentFragment(),i=e.appendChild(K.createElement("div")),n=K.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),i.appendChild(n),H.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,i.innerHTML="",H.noCloneChecked=!!i.cloneNode(!0).lastChild.defaultValue,i.innerHTML="",H.option=!!i.lastChild})();var Ze={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Ze.tbody=Ze.tfoot=Ze.colgroup=Ze.caption=Ze.thead,Ze.th=Ze.td,H.option||(Ze.optgroup=Ze.option=[1,""]);function et(e,i){var n;return typeof e.getElementsByTagName!="undefined"?n=e.getElementsByTagName(i||"*"):typeof e.querySelectorAll!="undefined"?n=e.querySelectorAll(i||"*"):n=[],i===void 0||i&&Ne(e,i)?o.merge([e],n):n}function qr(e,i){for(var n=0,s=e.length;n-1){c&&c.push(f);continue}if(D=Ot(f),h=et(B.appendChild(f),"script"),D&&qr(h),n)for(R=0;f=h[R++];)Gr.test(f.type||"")&&n.push(f)}return B}var $i=/^([^.]*)(?:\.(.+)|)/;function nt(){return!0}function Jt(){return!1}function Un(e,i){return e===Wi()==(i==="focus")}function Wi(){try{return K.activeElement}catch(e){}}function Qr(e,i,n,s,c,f){var h,E;if(typeof i=="object"){typeof n!="string"&&(s=s||n,n=void 0);for(E in i)Qr(e,E,n,s,i[E],f);return e}if(s==null&&c==null?(c=n,s=n=void 0):c==null&&(typeof n=="string"?(c=s,s=void 0):(c=s,s=n,n=void 0)),c===!1)c=Jt;else if(!c)return e;return f===1&&(h=c,c=function(x){return o().off(x),h.apply(this,arguments)},c.guid=h.guid||(h.guid=o.guid++)),e.each(function(){o.event.add(this,i,c,s,n)})}o.event={global:{},add:function(e,i,n,s,c){var f,h,E,x,D,R,B,L,I,ie,ve,re=le.get(e);if(!!sr(e))for(n.handler&&(f=n,n=f.handler,c=f.selector),c&&o.find.matchesSelector(Lt,c),n.guid||(n.guid=o.guid++),(x=re.events)||(x=re.events=Object.create(null)),(h=re.handle)||(h=re.handle=function(Ge){return typeof o!="undefined"&&o.event.triggered!==Ge.type?o.event.dispatch.apply(e,arguments):void 0}),i=(i||"").match(yt)||[""],D=i.length;D--;)E=$i.exec(i[D])||[],I=ve=E[1],ie=(E[2]||"").split(".").sort(),!!I&&(B=o.event.special[I]||{},I=(c?B.delegateType:B.bindType)||I,B=o.event.special[I]||{},R=o.extend({type:I,origType:ve,data:s,handler:n,guid:n.guid,selector:c,needsContext:c&&o.expr.match.needsContext.test(c),namespace:ie.join(".")},f),(L=x[I])||(L=x[I]=[],L.delegateCount=0,(!B.setup||B.setup.call(e,s,ie,h)===!1)&&e.addEventListener&&e.addEventListener(I,h)),B.add&&(B.add.call(e,R),R.handler.guid||(R.handler.guid=n.guid)),c?L.splice(L.delegateCount++,0,R):L.push(R),o.event.global[I]=!0)},remove:function(e,i,n,s,c){var f,h,E,x,D,R,B,L,I,ie,ve,re=le.hasData(e)&&le.get(e);if(!(!re||!(x=re.events))){for(i=(i||"").match(yt)||[""],D=i.length;D--;){if(E=$i.exec(i[D])||[],I=ve=E[1],ie=(E[2]||"").split(".").sort(),!I){for(I in x)o.event.remove(e,I+i[D],n,s,!0);continue}for(B=o.event.special[I]||{},I=(s?B.delegateType:B.bindType)||I,L=x[I]||[],E=E[2]&&new RegExp("(^|\\.)"+ie.join("\\.(?:.*\\.|)")+"(\\.|$)"),h=f=L.length;f--;)R=L[f],(c||ve===R.origType)&&(!n||n.guid===R.guid)&&(!E||E.test(R.namespace))&&(!s||s===R.selector||s==="**"&&R.selector)&&(L.splice(f,1),R.selector&&L.delegateCount--,B.remove&&B.remove.call(e,R));h&&!L.length&&((!B.teardown||B.teardown.call(e,ie,re.handle)===!1)&&o.removeEvent(e,I,re.handle),delete x[I])}o.isEmptyObject(x)&&le.remove(e,"handle events")}},dispatch:function(e){var i,n,s,c,f,h,E=new Array(arguments.length),x=o.event.fix(e),D=(le.get(this,"events")||Object.create(null))[x.type]||[],R=o.event.special[x.type]||{};for(E[0]=x,i=1;i=1)){for(;D!==this;D=D.parentNode||this)if(D.nodeType===1&&!(e.type==="click"&&D.disabled===!0)){for(f=[],h={},n=0;n-1:o.find(c,this,null,[D]).length),h[c]&&f.push(s);f.length&&E.push({elem:D,handlers:f})}}return D=this,x\s*$/g;function ji(e,i){return Ne(e,"table")&&Ne(i.nodeType!==11?i:i.firstChild,"tr")&&o(e).children("tbody")[0]||e}function Gn(e){return e.type=(e.getAttribute("type")!==null)+"/"+e.type,e}function qn(e){return(e.type||"").slice(0,5)==="true/"?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Bi(e,i){var n,s,c,f,h,E,x;if(i.nodeType===1){if(le.hasData(e)&&(f=le.get(e),x=f.events,x)){le.remove(i,"handle events");for(c in x)for(n=0,s=x[c].length;n1&&typeof I=="string"&&!H.checkClone&&zn.test(I))return e.each(function(ve){var re=e.eq(ve);ie&&(i[0]=I.call(this,ve,re.html())),Wt(re,i,n,s)});if(B&&(c=Xr(i,e[0].ownerDocument,!1,e,s),f=c.firstChild,c.childNodes.length===1&&(c=f),f||s)){for(h=o.map(et(c,"script"),Gn),E=h.length;R0&&qr(h,!x&&et(e,"script")),E},cleanData:function(e){for(var i,n,s,c=o.event.special,f=0;(n=e[f])!==void 0;f++)if(sr(n)){if(i=n[le.expando]){if(i.events)for(s in i.events)c[s]?o.event.remove(n,s):o.removeEvent(n,s,i.handle);n[le.expando]=void 0}n[$e.expando]&&(n[$e.expando]=void 0)}}}),o.fn.extend({detach:function(e){return Ui(this,e,!0)},remove:function(e){return Ui(this,e)},text:function(e){return Pt(this,function(i){return i===void 0?o.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=i)})},null,e,arguments.length)},append:function(){return Wt(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var i=ji(this,e);i.appendChild(e)}})},prepend:function(){return Wt(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var i=ji(this,e);i.insertBefore(e,i.firstChild)}})},before:function(){return Wt(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Wt(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,i=0;(e=this[i])!=null;i++)e.nodeType===1&&(o.cleanData(et(e,!1)),e.textContent="");return this},clone:function(e,i){return e=e==null?!1:e,i=i==null?e:i,this.map(function(){return o.clone(this,e,i)})},html:function(e){return Pt(this,function(i){var n=this[0]||{},s=0,c=this.length;if(i===void 0&&n.nodeType===1)return n.innerHTML;if(typeof i=="string"&&!Hn.test(i)&&!Ze[(Vr.exec(i)||["",""])[1].toLowerCase()]){i=o.htmlPrefilter(i);try{for(;s=0&&(x+=Math.max(0,Math.ceil(e["offset"+i[0].toUpperCase()+i.slice(1)]-f-x-E-.5))||0),x}function fr(e,i,n){var s=Rr(e),c=!H.boxSizingReliable()||n,f=c&&o.css(e,"boxSizing",!1,s)==="border-box",h=f,E=ur(e,i,s),x="offset"+i[0].toUpperCase()+i.slice(1);if(Jr.test(E)){if(!n)return E;E="auto"}return(!H.boxSizingReliable()&&f||!H.reliableTrDimensions()&&Ne(e,"tr")||E==="auto"||!parseFloat(E)&&o.css(e,"display",!1,s)==="inline")&&e.getClientRects().length&&(f=o.css(e,"boxSizing",!1,s)==="border-box",h=x in e,h&&(E=e[x])),E=parseFloat(E)||0,E+ti(e,i,n||(f?"border":"content"),h,s,E)+"px"}o.extend({cssHooks:{opacity:{get:function(e,i){if(i){var n=ur(e,"opacity");return n===""?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,i,n,s){if(!(!e||e.nodeType===3||e.nodeType===8||!e.style)){var c,f,h,E=xt(i),x=Kr.test(i),D=e.style;if(x||(i=Zr(E)),h=o.cssHooks[i]||o.cssHooks[E],n!==void 0){if(f=typeof n,f==="string"&&(c=Nt.exec(n))&&c[1]&&(n=Hr(e,i,c),f="number"),n==null||n!==n)return;f==="number"&&!x&&(n+=c&&c[3]||(o.cssNumber[E]?"":"px")),!H.clearCloneStyle&&n===""&&i.indexOf("background")===0&&(D[i]="inherit"),(!h||!("set"in h)||(n=h.set(e,n,s))!==void 0)&&(x?D.setProperty(i,n):D[i]=n)}else return h&&"get"in h&&(c=h.get(e,!1,s))!==void 0?c:D[i]}},css:function(e,i,n,s){var c,f,h,E=xt(i),x=Kr.test(i);return x||(i=Zr(E)),h=o.cssHooks[i]||o.cssHooks[E],h&&"get"in h&&(c=h.get(e,!0,n)),c===void 0&&(c=ur(e,i,s)),c==="normal"&&i in ei&&(c=ei[i]),n===""||n?(f=parseFloat(c),n===!0||isFinite(f)?f||0:c):c}}),o.each(["height","width"],function(e,i){o.cssHooks[i]={get:function(n,s,c){if(s)return Xi.test(o.css(n,"display"))&&(!n.getClientRects().length||!n.getBoundingClientRect().width)?Hi(n,cr,function(){return fr(n,i,c)}):fr(n,i,c)},set:function(n,s,c){var f,h=Rr(n),E=!H.scrollboxSize()&&h.position==="absolute",x=E||c,D=x&&o.css(n,"boxSizing",!1,h)==="border-box",R=c?ti(n,i,c,D,h):0;return D&&E&&(R-=Math.ceil(n["offset"+i[0].toUpperCase()+i.slice(1)]-parseFloat(h[i])-ti(n,i,"border",!1,h)-.5)),R&&(f=Nt.exec(s))&&(f[3]||"px")!=="px"&&(n.style[i]=s,s=o.css(n,i)),jt(n,s,R)}}}),o.cssHooks.marginLeft=Vi(H.reliableMarginLeft,function(e,i){if(i)return(parseFloat(ur(e,"marginLeft"))||e.getBoundingClientRect().left-Hi(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),o.each({margin:"",padding:"",border:"Width"},function(e,i){o.cssHooks[e+i]={expand:function(n){for(var s=0,c={},f=typeof n=="string"?n.split(" "):[n];s<4;s++)c[e+wt[s]+i]=f[s]||f[s-2]||f[0];return c}},e!=="margin"&&(o.cssHooks[e+i].set=jt)}),o.fn.extend({css:function(e,i){return Pt(this,function(n,s,c){var f,h,E={},x=0;if(Array.isArray(s)){for(f=Rr(n),h=s.length;x1)}});function Xe(e,i,n,s,c){return new Xe.prototype.init(e,i,n,s,c)}o.Tween=Xe,Xe.prototype={constructor:Xe,init:function(e,i,n,s,c,f){this.elem=e,this.prop=n,this.easing=c||o.easing._default,this.options=i,this.start=this.now=this.cur(),this.end=s,this.unit=f||(o.cssNumber[n]?"":"px")},cur:function(){var e=Xe.propHooks[this.prop];return e&&e.get?e.get(this):Xe.propHooks._default.get(this)},run:function(e){var i,n=Xe.propHooks[this.prop];return this.options.duration?this.pos=i=o.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=i=e,this.now=(this.end-this.start)*i+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Xe.propHooks._default.set(this),this}},Xe.prototype.init.prototype=Xe.prototype,Xe.propHooks={_default:{get:function(e){var i;return e.elem.nodeType!==1||e.elem[e.prop]!=null&&e.elem.style[e.prop]==null?e.elem[e.prop]:(i=o.css(e.elem,e.prop,""),!i||i==="auto"?0:i)},set:function(e){o.fx.step[e.prop]?o.fx.step[e.prop](e):e.elem.nodeType===1&&(o.cssHooks[e.prop]||e.elem.style[Zr(e.prop)]!=null)?o.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Xe.propHooks.scrollTop=Xe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},o.easing={linear:function(e){return e},swing:function(e){return .5-Math.cos(e*Math.PI)/2},_default:"swing"},o.fx=Xe.prototype.init,o.fx.step={};var Kt,Ir,ri=/^(?:toggle|show|hide)$/,Kn=/queueHooks$/;function ii(){Ir&&(K.hidden===!1&&l.requestAnimationFrame?l.requestAnimationFrame(ii):l.setTimeout(ii,o.fx.interval),o.fx.tick())}function p(){return l.setTimeout(function(){Kt=void 0}),Kt=Date.now()}function _(e,i){var n,s=0,c={height:e};for(i=i?1:0;s<4;s+=2-i)n=wt[s],c["margin"+n]=c["padding"+n]=e;return i&&(c.opacity=c.width=e),c}function v(e,i,n){for(var s,c=(S.tweeners[i]||[]).concat(S.tweeners["*"]),f=0,h=c.length;f1)},removeAttr:function(e){return this.each(function(){o.removeAttr(this,e)})}}),o.extend({attr:function(e,i,n){var s,c,f=e.nodeType;if(!(f===3||f===8||f===2)){if(typeof e.getAttribute=="undefined")return o.prop(e,i,n);if((f!==1||!o.isXMLDoc(e))&&(c=o.attrHooks[i.toLowerCase()]||(o.expr.match.bool.test(i)?N:void 0)),n!==void 0){if(n===null){o.removeAttr(e,i);return}return c&&"set"in c&&(s=c.set(e,n,i))!==void 0?s:(e.setAttribute(i,n+""),n)}return c&&"get"in c&&(s=c.get(e,i))!==null?s:(s=o.find.attr(e,i),s==null?void 0:s)}},attrHooks:{type:{set:function(e,i){if(!H.radioValue&&i==="radio"&&Ne(e,"input")){var n=e.value;return e.setAttribute("type",i),n&&(e.value=n),i}}}},removeAttr:function(e,i){var n,s=0,c=i&&i.match(yt);if(c&&e.nodeType===1)for(;n=c[s++];)e.removeAttribute(n)}}),N={set:function(e,i,n){return i===!1?o.removeAttr(e,n):e.setAttribute(n,n),n}},o.each(o.expr.match.bool.source.match(/\w+/g),function(e,i){var n=j[i]||o.find.attr;j[i]=function(s,c,f){var h,E,x=c.toLowerCase();return f||(E=j[x],j[x]=h,h=n(s,c,f)!=null?x:null,j[x]=E),h}});var G=/^(?:input|select|textarea|button)$/i,q=/^(?:a|area)$/i;o.fn.extend({prop:function(e,i){return Pt(this,o.prop,e,i,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[o.propFix[e]||e]})}}),o.extend({prop:function(e,i,n){var s,c,f=e.nodeType;if(!(f===3||f===8||f===2))return(f!==1||!o.isXMLDoc(e))&&(i=o.propFix[i]||i,c=o.propHooks[i]),n!==void 0?c&&"set"in c&&(s=c.set(e,n,i))!==void 0?s:e[i]=n:c&&"get"in c&&(s=c.get(e,i))!==null?s:e[i]},propHooks:{tabIndex:{get:function(e){var i=o.find.attr(e,"tabindex");return i?parseInt(i,10):G.test(e.nodeName)||q.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),H.optSelected||(o.propHooks.selected={get:function(e){var i=e.parentNode;return i&&i.parentNode&&i.parentNode.selectedIndex,null},set:function(e){var i=e.parentNode;i&&(i.selectedIndex,i.parentNode&&i.parentNode.selectedIndex)}}),o.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){o.propFix[this.toLowerCase()]=this});function Y(e){var i=e.match(yt)||[];return i.join(" ")}function Z(e){return e.getAttribute&&e.getAttribute("class")||""}function ye(e){return Array.isArray(e)?e:typeof e=="string"?e.match(yt)||[]:[]}o.fn.extend({addClass:function(e){var i,n,s,c,f,h;return V(e)?this.each(function(E){o(this).addClass(e.call(this,E,Z(this)))}):(i=ye(e),i.length?this.each(function(){if(s=Z(this),n=this.nodeType===1&&" "+Y(s)+" ",n){for(f=0;f-1;)n=n.replace(" "+c+" "," ");h=Y(n),s!==h&&this.setAttribute("class",h)}}):this):this.attr("class","")},toggleClass:function(e,i){var n,s,c,f,h=typeof e,E=h==="string"||Array.isArray(e);return V(e)?this.each(function(x){o(this).toggleClass(e.call(this,x,Z(this),i),i)}):typeof i=="boolean"&&E?i?this.addClass(e):this.removeClass(e):(n=ye(e),this.each(function(){if(E)for(f=o(this),c=0;c-1)return!0;return!1}});var Pe=/\r/g;o.fn.extend({val:function(e){var i,n,s,c=this[0];return arguments.length?(s=V(e),this.each(function(f){var h;this.nodeType===1&&(s?h=e.call(this,f,o(this).val()):h=e,h==null?h="":typeof h=="number"?h+="":Array.isArray(h)&&(h=o.map(h,function(E){return E==null?"":E+""})),i=o.valHooks[this.type]||o.valHooks[this.nodeName.toLowerCase()],(!i||!("set"in i)||i.set(this,h,"value")===void 0)&&(this.value=h))})):c?(i=o.valHooks[c.type]||o.valHooks[c.nodeName.toLowerCase()],i&&"get"in i&&(n=i.get(c,"value"))!==void 0?n:(n=c.value,typeof n=="string"?n.replace(Pe,""):n==null?"":n)):void 0}}),o.extend({valHooks:{option:{get:function(e){var i=o.find.attr(e,"value");return i!=null?i:Y(o.text(e))}},select:{get:function(e){var i,n,s,c=e.options,f=e.selectedIndex,h=e.type==="select-one",E=h?null:[],x=h?f+1:c.length;for(f<0?s=x:s=h?f:0;s-1)&&(n=!0);return n||(e.selectedIndex=-1),f}}}}),o.each(["radio","checkbox"],function(){o.valHooks[this]={set:function(e,i){if(Array.isArray(i))return e.checked=o.inArray(o(e).val(),i)>-1}},H.checkOn||(o.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})}),H.focusin="onfocusin"in l;var ke=/^(?:focusinfocus|focusoutblur)$/,We=function(e){e.stopPropagation()};o.extend(o.event,{trigger:function(e,i,n,s){var c,f,h,E,x,D,R,B,L=[n||K],I=W.call(e,"type")?e.type:e,ie=W.call(e,"namespace")?e.namespace.split("."):[];if(f=B=h=n=n||K,!(n.nodeType===3||n.nodeType===8)&&!ke.test(I+o.event.triggered)&&(I.indexOf(".")>-1&&(ie=I.split("."),I=ie.shift(),ie.sort()),x=I.indexOf(":")<0&&"on"+I,e=e[o.expando]?e:new o.Event(I,typeof e=="object"&&e),e.isTrigger=s?2:3,e.namespace=ie.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+ie.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=i==null?[e]:o.makeArray(i,[e]),R=o.event.special[I]||{},!(!s&&R.trigger&&R.trigger.apply(n,i)===!1))){if(!s&&!R.noBubble&&!de(n)){for(E=R.delegateType||I,ke.test(E+I)||(f=f.parentNode);f;f=f.parentNode)L.push(f),h=f;h===(n.ownerDocument||K)&&L.push(h.defaultView||h.parentWindow||l)}for(c=0;(f=L[c++])&&!e.isPropagationStopped();)B=f,e.type=c>1?E:R.bindType||I,D=(le.get(f,"events")||Object.create(null))[e.type]&&le.get(f,"handle"),D&&D.apply(f,i),D=x&&f[x],D&&D.apply&&sr(f)&&(e.result=D.apply(f,i),e.result===!1&&e.preventDefault());return e.type=I,!s&&!e.isDefaultPrevented()&&(!R._default||R._default.apply(L.pop(),i)===!1)&&sr(n)&&x&&V(n[I])&&!de(n)&&(h=n[x],h&&(n[x]=null),o.event.triggered=I,e.isPropagationStopped()&&B.addEventListener(I,We),n[I](),e.isPropagationStopped()&&B.removeEventListener(I,We),o.event.triggered=void 0,h&&(n[x]=h)),e.result}},simulate:function(e,i,n){var s=o.extend(new o.Event,n,{type:e,isSimulated:!0});o.event.trigger(s,null,i)}}),o.fn.extend({trigger:function(e,i){return this.each(function(){o.event.trigger(e,i,this)})},triggerHandler:function(e,i){var n=this[0];if(n)return o.event.trigger(e,i,n,!0)}}),H.focusin||o.each({focus:"focusin",blur:"focusout"},function(e,i){var n=function(s){o.event.simulate(i,s.target,o.event.fix(s))};o.event.special[i]={setup:function(){var s=this.ownerDocument||this.document||this,c=le.access(s,i);c||s.addEventListener(e,n,!0),le.access(s,i,(c||0)+1)},teardown:function(){var s=this.ownerDocument||this.document||this,c=le.access(s,i)-1;c?le.access(s,i,c):(s.removeEventListener(e,n,!0),le.remove(s,i))}}});var Le=l.location,at={guid:Date.now()},Bt=/\?/;o.parseXML=function(e){var i,n;if(!e||typeof e!="string")return null;try{i=new l.DOMParser().parseFromString(e,"text/xml")}catch(s){}return n=i&&i.getElementsByTagName("parsererror")[0],(!i||n)&&o.error("Invalid XML: "+(n?o.map(n.childNodes,function(s){return s.textContent}).join(` -`):e)),i};var ni=/\[\]$/,Qi=/\r?\n/g,ai=/^(?:submit|button|image|reset|file)$/i,gs=/^(?:input|select|textarea|keygen)/i;function si(e,i,n,s){var c;if(Array.isArray(i))o.each(i,function(f,h){n||ni.test(e)?s(e,h):si(e+"["+(typeof h=="object"&&h!=null?f:"")+"]",h,n,s)});else if(!n&&be(i)==="object")for(c in i)si(e+"["+c+"]",i[c],n,s);else s(e,i)}o.param=function(e,i){var n,s=[],c=function(f,h){var E=V(h)?h():h;s[s.length]=encodeURIComponent(f)+"="+encodeURIComponent(E==null?"":E)};if(e==null)return"";if(Array.isArray(e)||e.jquery&&!o.isPlainObject(e))o.each(e,function(){c(this.name,this.value)});else for(n in e)si(n,e[n],i,c);return s.join("&")},o.fn.extend({serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=o.prop(this,"elements");return e?o.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!o(this).is(":disabled")&&gs.test(this.nodeName)&&!ai.test(e)&&(this.checked||!Qt.test(e))}).map(function(e,i){var n=o(this).val();return n==null?null:Array.isArray(n)?o.map(n,function(s){return{name:i.name,value:s.replace(Qi,`\r -`)}}):{name:i.name,value:n.replace(Qi,`\r -`)}}).get()}});var Zn=/%20/g,Ji=/#.*$/,rl=/([?&])_=[^&]*/,il=/^(.*?):[ \t]*([^\r\n]*)$/mg,nl=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,al=/^(?:GET|HEAD)$/,sl=/^\/\//,ms={},ea={},vs="*/".concat("*"),ta=K.createElement("a");ta.href=Le.href;function bs(e){return function(i,n){typeof i!="string"&&(n=i,i="*");var s,c=0,f=i.toLowerCase().match(yt)||[];if(V(n))for(;s=f[c++];)s[0]==="+"?(s=s.slice(1)||"*",(e[s]=e[s]||[]).unshift(n)):(e[s]=e[s]||[]).push(n)}}function ys(e,i,n,s){var c={},f=e===ea;function h(E){var x;return c[E]=!0,o.each(e[E]||[],function(D,R){var B=R(i,n,s);if(typeof B=="string"&&!f&&!c[B])return i.dataTypes.unshift(B),h(B),!1;if(f)return!(x=B)}),x}return h(i.dataTypes[0])||!c["*"]&&h("*")}function ra(e,i){var n,s,c=o.ajaxSettings.flatOptions||{};for(n in i)i[n]!==void 0&&((c[n]?e:s||(s={}))[n]=i[n]);return s&&o.extend(!0,e,s),e}function ol(e,i,n){for(var s,c,f,h,E=e.contents,x=e.dataTypes;x[0]==="*";)x.shift(),s===void 0&&(s=e.mimeType||i.getResponseHeader("Content-Type"));if(s){for(c in E)if(E[c]&&E[c].test(s)){x.unshift(c);break}}if(x[0]in n)f=x[0];else{for(c in n){if(!x[0]||e.converters[c+" "+x[0]]){f=c;break}h||(h=c)}f=f||h}if(f)return f!==x[0]&&x.unshift(f),n[f]}function ll(e,i,n,s){var c,f,h,E,x,D={},R=e.dataTypes.slice();if(R[1])for(h in e.converters)D[h.toLowerCase()]=e.converters[h];for(f=R.shift();f;)if(e.responseFields[f]&&(n[e.responseFields[f]]=i),!x&&s&&e.dataFilter&&(i=e.dataFilter(i,e.dataType)),x=f,f=R.shift(),f){if(f==="*")f=x;else if(x!=="*"&&x!==f){if(h=D[x+" "+f]||D["* "+f],!h){for(c in D)if(E=c.split(" "),E[1]===f&&(h=D[x+" "+E[0]]||D["* "+E[0]],h)){h===!0?h=D[c]:D[c]!==!0&&(f=E[0],R.unshift(E[1]));break}}if(h!==!0)if(h&&e.throws)i=h(i);else try{i=h(i)}catch(B){return{state:"parsererror",error:h?B:"No conversion from "+x+" to "+f}}}}return{state:"success",data:i}}o.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Le.href,type:"GET",isLocal:nl.test(Le.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vs,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":o.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,i){return i?ra(ra(e,o.ajaxSettings),i):ra(o.ajaxSettings,e)},ajaxPrefilter:bs(ms),ajaxTransport:bs(ea),ajax:function(e,i){typeof e=="object"&&(i=e,e=void 0),i=i||{};var n,s,c,f,h,E,x,D,R,B,L=o.ajaxSetup({},i),I=L.context||L,ie=L.context&&(I.nodeType||I.jquery)?o(I):o.event,ve=o.Deferred(),re=o.Callbacks("once memory"),Ge=L.statusCode||{},Ve={},ht={},Fe="canceled",ge={readyState:0,getResponseHeader:function(Te){var je;if(x){if(!f)for(f={};je=il.exec(c);)f[je[1].toLowerCase()+" "]=(f[je[1].toLowerCase()+" "]||[]).concat(je[2]);je=f[Te.toLowerCase()+" "]}return je==null?null:je.join(", ")},getAllResponseHeaders:function(){return x?c:null},setRequestHeader:function(Te,je){return x==null&&(Te=ht[Te.toLowerCase()]=ht[Te.toLowerCase()]||Te,Ve[Te]=je),this},overrideMimeType:function(Te){return x==null&&(L.mimeType=Te),this},statusCode:function(Te){var je;if(Te)if(x)ge.always(Te[ge.status]);else for(je in Te)Ge[je]=[Ge[je],Te[je]];return this},abort:function(Te){var je=Te||Fe;return n&&n.abort(je),ut(0,je),this}};if(ve.promise(ge),L.url=((e||L.url||Le.href)+"").replace(sl,Le.protocol+"//"),L.type=i.method||i.type||L.method||L.type,L.dataTypes=(L.dataType||"*").toLowerCase().match(yt)||[""],L.crossDomain==null){E=K.createElement("a");try{E.href=L.url,E.href=E.href,L.crossDomain=ta.protocol+"//"+ta.host!=E.protocol+"//"+E.host}catch(Te){L.crossDomain=!0}}if(L.data&&L.processData&&typeof L.data!="string"&&(L.data=o.param(L.data,L.traditional)),ys(ms,L,i,ge),x)return ge;D=o.event&&L.global,D&&o.active++==0&&o.event.trigger("ajaxStart"),L.type=L.type.toUpperCase(),L.hasContent=!al.test(L.type),s=L.url.replace(Ji,""),L.hasContent?L.data&&L.processData&&(L.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(L.data=L.data.replace(Zn,"+")):(B=L.url.slice(s.length),L.data&&(L.processData||typeof L.data=="string")&&(s+=(Bt.test(s)?"&":"?")+L.data,delete L.data),L.cache===!1&&(s=s.replace(rl,"$1"),B=(Bt.test(s)?"&":"?")+"_="+at.guid+++B),L.url=s+B),L.ifModified&&(o.lastModified[s]&&ge.setRequestHeader("If-Modified-Since",o.lastModified[s]),o.etag[s]&&ge.setRequestHeader("If-None-Match",o.etag[s])),(L.data&&L.hasContent&&L.contentType!==!1||i.contentType)&&ge.setRequestHeader("Content-Type",L.contentType),ge.setRequestHeader("Accept",L.dataTypes[0]&&L.accepts[L.dataTypes[0]]?L.accepts[L.dataTypes[0]]+(L.dataTypes[0]!=="*"?", "+vs+"; q=0.01":""):L.accepts["*"]);for(R in L.headers)ge.setRequestHeader(R,L.headers[R]);if(L.beforeSend&&(L.beforeSend.call(I,ge,L)===!1||x))return ge.abort();if(Fe="abort",re.add(L.complete),ge.done(L.success),ge.fail(L.error),n=ys(ea,L,i,ge),!n)ut(-1,"No Transport");else{if(ge.readyState=1,D&&ie.trigger("ajaxSend",[ge,L]),x)return ge;L.async&&L.timeout>0&&(h=l.setTimeout(function(){ge.abort("timeout")},L.timeout));try{x=!1,n.send(Ve,ut)}catch(Te){if(x)throw Te;ut(-1,Te)}}function ut(Te,je,li,Ki){var pt,dr,hr,ct,Zt,Et=je;x||(x=!0,h&&l.clearTimeout(h),n=void 0,c=Ki||"",ge.readyState=Te>0?4:0,pt=Te>=200&&Te<300||Te===304,li&&(ct=ol(L,ge,li)),!pt&&o.inArray("script",L.dataTypes)>-1&&o.inArray("json",L.dataTypes)<0&&(L.converters["text script"]=function(){}),ct=ll(L,ct,ge,pt),pt?(L.ifModified&&(Zt=ge.getResponseHeader("Last-Modified"),Zt&&(o.lastModified[s]=Zt),Zt=ge.getResponseHeader("etag"),Zt&&(o.etag[s]=Zt)),Te===204||L.type==="HEAD"?Et="nocontent":Te===304?Et="notmodified":(Et=ct.state,dr=ct.data,hr=ct.error,pt=!hr)):(hr=Et,(Te||!Et)&&(Et="error",Te<0&&(Te=0))),ge.status=Te,ge.statusText=(je||Et)+"",pt?ve.resolveWith(I,[dr,Et,ge]):ve.rejectWith(I,[ge,Et,hr]),ge.statusCode(Ge),Ge=void 0,D&&ie.trigger(pt?"ajaxSuccess":"ajaxError",[ge,L,pt?dr:hr]),re.fireWith(I,[ge,Et]),D&&(ie.trigger("ajaxComplete",[ge,L]),--o.active||o.event.trigger("ajaxStop")))}return ge},getJSON:function(e,i,n){return o.get(e,i,n,"json")},getScript:function(e,i){return o.get(e,void 0,i,"script")}}),o.each(["get","post"],function(e,i){o[i]=function(n,s,c,f){return V(s)&&(f=f||c,c=s,s=void 0),o.ajax(o.extend({url:n,type:i,dataType:f,data:s,success:c},o.isPlainObject(n)&&n))}}),o.ajaxPrefilter(function(e){var i;for(i in e.headers)i.toLowerCase()==="content-type"&&(e.contentType=e.headers[i]||"")}),o._evalUrl=function(e,i,n){return o.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(s){o.globalEval(s,i,n)}})},o.fn.extend({wrapAll:function(e){var i;return this[0]&&(V(e)&&(e=e.call(this[0])),i=o(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&i.insertBefore(this[0]),i.map(function(){for(var n=this;n.firstElementChild;)n=n.firstElementChild;return n}).append(this)),this},wrapInner:function(e){return V(e)?this.each(function(i){o(this).wrapInner(e.call(this,i))}):this.each(function(){var i=o(this),n=i.contents();n.length?n.wrapAll(e):i.append(e)})},wrap:function(e){var i=V(e);return this.each(function(n){o(this).wrapAll(i?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){o(this).replaceWith(this.childNodes)}),this}}),o.expr.pseudos.hidden=function(e){return!o.expr.pseudos.visible(e)},o.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},o.ajaxSettings.xhr=function(){try{return new l.XMLHttpRequest}catch(e){}};var ul={0:200,1223:204},oi=o.ajaxSettings.xhr();H.cors=!!oi&&"withCredentials"in oi,H.ajax=oi=!!oi,o.ajaxTransport(function(e){var i,n;if(H.cors||oi&&!e.crossDomain)return{send:function(s,c){var f,h=e.xhr();if(h.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(f in e.xhrFields)h[f]=e.xhrFields[f];e.mimeType&&h.overrideMimeType&&h.overrideMimeType(e.mimeType),!e.crossDomain&&!s["X-Requested-With"]&&(s["X-Requested-With"]="XMLHttpRequest");for(f in s)h.setRequestHeader(f,s[f]);i=function(E){return function(){i&&(i=n=h.onload=h.onerror=h.onabort=h.ontimeout=h.onreadystatechange=null,E==="abort"?h.abort():E==="error"?typeof h.status!="number"?c(0,"error"):c(h.status,h.statusText):c(ul[h.status]||h.status,h.statusText,(h.responseType||"text")!=="text"||typeof h.responseText!="string"?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=i(),n=h.onerror=h.ontimeout=i("error"),h.onabort!==void 0?h.onabort=n:h.onreadystatechange=function(){h.readyState===4&&l.setTimeout(function(){i&&n()})},i=i("abort");try{h.send(e.hasContent&&e.data||null)}catch(E){if(i)throw E}},abort:function(){i&&i()}}}),o.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),o.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return o.globalEval(e),e}}}),o.ajaxPrefilter("script",function(e){e.cache===void 0&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),o.ajaxTransport("script",function(e){if(e.crossDomain||e.scriptAttrs){var i,n;return{send:function(s,c){i=o("