{"version":3,"file":"ngx-chessground.mjs","sources":["../../../projects/ngx-chessground/src/lib/ngx-chessground.service.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground/ngx-chessground.component.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground/ngx-chessground.component.html","../../../projects/ngx-chessground/src/units/util.ts","../../../projects/ngx-chessground/src/units/play.ts","../../../projects/ngx-chessground/src/lib/promotion-dialog/promotion-dialog.component.ts","../../../projects/ngx-chessground/src/lib/promotion-dialog/promotion.service.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground-table/ngx-chessground-table.component.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground-table/ngx-chessground-table.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/eco-moves.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer-engine.service.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer.component.html","../../../projects/ngx-chessground/src/units/anim.ts","../../../projects/ngx-chessground/src/units/basics.ts","../../../projects/ngx-chessground/src/units/fen.ts","../../../projects/ngx-chessground/src/units/in3d.ts","../../../projects/ngx-chessground/src/units/perf.ts","../../../projects/ngx-chessground/src/units/pgn.ts","../../../projects/ngx-chessground/src/units/svg.ts","../../../projects/ngx-chessground/src/units/viewOnly.ts","../../../projects/ngx-chessground/src/units/zh.ts","../../../projects/ngx-chessground/src/public-api.ts","../../../projects/ngx-chessground/src/ngx-chessground.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Chessground } from 'chessground';\nimport type { Api } from 'chessground/api';\nimport type { VNode } from 'snabbdom';\nimport {\n\tattributesModule,\n\tclassModule,\n\teventListenersModule,\n\th,\n\tinit,\n} from 'snabbdom';\n\n/**\n * Service to manage the Chessground instance and its rendering.\n *\n * Wraps snabbdom patching and chessground lifecycle. Each {@link NgxChessgroundComponent}\n * instance creates its own service instance (provided at component level).\n * Public methods (`redraw`, `toggleOrientation`) are called by the component;\n * private helpers manage the virtual DOM tree and the chessground `Api` handle.\n */\n@Injectable()\nexport class NgxChessgroundService {\n\t/**\n\t * Initializes the patch function with the necessary modules.\n\t * @private\n\t */\n\tprivate readonly patch = init([\n\t\tclassModule,\n\t\tattributesModule,\n\t\teventListenersModule,\n\t]);\n\n\t/**\n\t * Virtual node representing the current state of the DOM.\n\t * @private\n\t */\n\tprivate vnode!: VNode;\n\n\t/**\n\t * Chessground API instance.\n\t * @private\n\t */\n\tprivate cg!: Api;\n\n\t/**\n\t * Function to run on the HTMLElement.\n\t * @private\n\t */\n\tprivate runFn!: (el: HTMLElement) => Api;\n\n\t/**\n\t * Redraws the Chessground board on the given element.\n\t * @param element - The HTML element to render the Chessground board on.\n\t * @param runFn - The function to run on the HTMLElement.\n\t */\n\tpublic redraw(element: HTMLElement, runFn: (el: HTMLElement) => Api) {\n\t\tthis.cg = Chessground(element);\n\t\tthis.runFn = runFn;\n\t\tthis.vnode = this.patch(this.vnode || element, this.render());\n\t}\n\n\t/**\n\t * Toggles the orientation of the Chessground board.\n\t */\n\tpublic toggleOrientation() {\n\t\tthis.cg.toggleOrientation();\n\t}\n\n\t/**\n\t * Renders the virtual node for the Chessground board.\n\t * @returns The virtual node representing the Chessground board.\n\t * @private\n\t */\n\tprivate render(): VNode {\n\t\treturn h('div#chessground-examples', [\n\t\t\th('section.blue.merida', [\n\t\t\t\th('div.cg-wrap', {\n\t\t\t\t\thook: {\n\t\t\t\t\t\tinsert: this.runUnit,\n\t\t\t\t\t\tpostpatch: this.runUnit,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t]),\n\t\t]);\n\t}\n\n\t/**\n\t * Runs the provided function on the virtual node's element.\n\t * @param vnode - The virtual node.\n\t * @param _ignore - An optional parameter to ignore.\n\t * @returns The result of the run function.\n\t * @private\n\t */\n\tprivate readonly runUnit = (vnode: VNode, _ignore?: VNode) => {\n\t\tconst el = vnode.elm as HTMLElement;\n\t\tel.className = 'cg-wrap';\n\t\tthis.cg = Chessground(el);\n\t\treturn this.runFn(el);\n\t};\n}\n","import {\n\ttype AfterViewInit,\n\tChangeDetectionStrategy,\n\tComponent,\n\ttype ElementRef,\n\teffect,\n\tmodel,\n\tviewChild,\n\tinject,\n} from '@angular/core';\nimport type { Api } from 'chessground/api';\nimport { NgxChessgroundService } from '../ngx-chessground.service';\n\n/**\n * Core chessboard component wrapping the chessground library via snabbdom.\n *\n * Accepts a `runFunction` signal-model input that receives the mounted DOM element\n * and must return a chessground `Api` instance. The component manages lifecycle:\n * - Uses an Angular `effect()` to watch `runFunction` changes and redraw the board.\n * - Calls `redraw()` on `ngAfterViewInit` so the board appears as soon as the view is ready.\n * - Provides a `toggleOrientation()` method to flip the board.\n *\n * Uses {@link NgxChessgroundService} (provided at component level) for snabbdom patching\n * and chessground instance management.\n *\n * @example\n * ```html\n * <ngx-chessground [runFunction]=\"myRunFn()\" />\n * ```\n *\n * @example\n * ```typescript\n * myRunFn = signal<(el: HTMLElement) => Api>((el) => {\n *   return Chessground(el, { fen: 'start' });\n * });\n * ```\n */\n@Component({\n\tselector: 'ngx-chessground',\n\ttemplateUrl: './ngx-chessground.component.html',\n\tstyleUrls: ['./ngx-chessground.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tproviders: [NgxChessgroundService],\n})\nexport class NgxChessgroundComponent implements AfterViewInit {\n\t/**\n\t * Signal-based view query for the board container element.\n\t *\n\t * References the DOM element with template variable `#chessboard`.\n\t * Used by {@link redraw} to pass the native element to chessground.\n\t */\n\treadonly elementView = viewChild.required<ElementRef>('chessboard');\n\n\t/**\n\t * Signal-model function that constructs the chessground instance on a given element.\n\t *\n\t * This is the primary input mechanism of the component. Changes to this signal\n\t * trigger a board redraw via the internal `effect()`.\n\t *\n\t * @param el — The board container `HTMLElement` mounted in the DOM.\n\t * @returns A chessground `Api` instance configured as desired.\n\t */\n\trunFunction = model<(el: HTMLElement) => Api>();\n\n\t/** Service managing the chessground instance and snabbdom patching lifecycle. */\n\tprivate readonly ngxChessgroundService = inject(NgxChessgroundService);\n\n\t/**\n\t * Sets up a reactive effect that redraws the board whenever {@link runFunction} changes.\n\t *\n\t * This is the wiring that makes dynamic board configuration (switching FEN, orientation, etc.)\n\t * work seamlessly — just update the signal and the board reacts.\n\t */\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tthis.redraw();\n\t\t});\n\t}\n\n\t/**\n\t * Redraws the board once the view is initialized.\n\t *\n\t * Ensures the board is rendered on first load. Subsequent redraws\n\t * are handled by the `effect()` watching `runFunction`.\n\t */\n\tngAfterViewInit() {\n\t\tthis.redraw();\n\t}\n\n\t/**\n\t * Flips the board orientation (white ↔ black).\n\t *\n\t * Delegates to {@link NgxChessgroundService.toggleOrientation}.\n\t */\n\tpublic toggleOrientation() {\n\t\tthis.ngxChessgroundService.toggleOrientation();\n\t}\n\n\t/**\n\t * Re-renders the chessboard via the snabbdom patching service.\n\t *\n\t * Retrieves the board element and current run function, then delegates\n\t * to {@link NgxChessgroundService.redraw}.\n\t */\n\tprivate redraw() {\n\t\tconst elementView = this.elementView();\n\t\tconst fn = this.runFunction();\n\t\tif (elementView.nativeElement && fn) {\n\t\t\tthis.ngxChessgroundService.redraw(elementView.nativeElement, fn);\n\t\t}\n\t}\n}\n","<div #chessboard id=\"chessground-examples\"></div>\n","import type { Chess as ChessInstance, Move, Square } from 'chess.js';\nimport * as ChessJS from 'chess.js';\nimport type { Api } from 'chessground/api';\nimport type { Color, Key } from 'chessground/types';\nimport type { PromotionService } from '../lib/promotion-dialog/promotion.service';\n\n/**\n * Generates a map of possible destination squares for each piece on the board.\n *\n * @param chess - An instance of the Chess game.\n * @returns A map where the keys are the squares with pieces that have legal moves,\n * and the values are arrays of destination squares for those pieces.\n */\nexport function toDests(chess: ChessInstance): Map<Key, Key[]> {\n\tconst dests = new Map();\n\n\tfor (const s of ChessJS.SQUARES) {\n\t\tconst ms = chess.moves({ square: s, verbose: true });\n\t\tif (ms.length) {\n\t\t\tdests.set(\n\t\t\t\ts,\n\t\t\t\tms.map((m: Move) => m.to),\n\t\t\t);\n\t\t}\n\t}\n\treturn dests;\n}\n\n/**\n * Converts the current turn of a chess game to a color string.\n *\n * @param chess - An instance of a chess game.\n * @returns The color string \"white\" if it's white's turn, otherwise \"black\".\n */\nexport function toColor(chess: ChessInstance): Color {\n\treturn chess.turn() === 'w' ? 'white' : 'black';\n}\n\n/**\n * Converts chess.js promotion character to chessground piece role.\n *\n * @param promotion - The chess.js promotion character ('q', 'r', 'b', 'n')\n * @returns The corresponding chessground piece role ('queen', 'rook', 'bishop', 'knight')\n */\nfunction promotionToRole(\n\tpromotion: string,\n): 'queen' | 'rook' | 'bishop' | 'knight' {\n\tswitch (promotion) {\n\t\tcase 'q':\n\t\t\treturn 'queen';\n\t\tcase 'r':\n\t\t\treturn 'rook';\n\t\tcase 'b':\n\t\t\treturn 'bishop';\n\t\tcase 'n':\n\t\t\treturn 'knight';\n\t\tdefault:\n\t\t\treturn 'queen'; // Default to queen\n\t}\n}\n\n/**\n * Creates a function that makes a move on the chessboard and updates the state of the chess game.\n * Uses window.prompt for pawn promotion (legacy method).\n *\n * @param cg - The chessground API instance.\n * @param chess - The chess.js instance representing the current state of the chess game.\n * @returns A function that takes the origin and destination squares of a move, makes the move on the chessboard,\n *          and updates the turn color and movable destinations in the chessground instance.\n */\nexport function playOtherSide(cg: Api, chess: ChessInstance) {\n\treturn (orig: Key, dest: Key) => {\n\t\t// Check if this is a pawn promotion move (pawn reaching the first or eighth row)\n\t\tconst piece = chess.get(orig as Square);\n\t\tconst isPawn = piece && piece.type === 'p';\n\t\tconst isPromotionMove =\n\t\t\tisPawn && (dest.charAt(1) === '8' || dest.charAt(1) === '1');\n\n\t\tif (isPromotionMove) {\n\t\t\t// Ask user what piece to promote to\n\t\t\tconst promotionPiece = window.prompt(\n\t\t\t\t'Promote pawn to: q (Queen), r (Rook), b (Bishop), n (Knight)',\n\t\t\t\t'q',\n\t\t\t);\n\t\t\tconst validPromotions = ['q', 'r', 'b', 'n'];\n\t\t\tconst promotion = validPromotions.includes(\n\t\t\t\tpromotionPiece?.toLowerCase() ?? '',\n\t\t\t)\n\t\t\t\t? promotionPiece?.toLowerCase()\n\t\t\t\t: 'q'; // Default to queen if invalid input\n\n\t\t\t// Make the move with promotion\n\t\t\tconst moveResult = chess.move({\n\t\t\t\tfrom: orig,\n\t\t\t\tto: dest,\n\t\t\t\tpromotion: promotion as 'q' | 'r' | 'n' | 'b',\n\t\t\t});\n\n\t\t\t// For promotion moves, we need to manually update the board to show the promoted piece\n\t\t\tif (moveResult) {\n\t\t\t\t// First move the pawn on the board\n\t\t\t\tcg.move(orig, dest);\n\n\t\t\t\t// Then update the piece on the destination square with the promoted piece\n\t\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\n\t\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\t\tconst pieceRole = promotionToRole(promotion as string);\n\n\t\t\t\t// Update the piece on the board with the proper promoted piece\n\t\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t\t}\n\t\t} else {\n\t\t\t// Regular move\n\t\t\tchess.move({ from: orig as Square, to: dest as Square });\n\t\t\t// For regular moves, just perform the move on the board\n\t\t\tcg.move(orig, dest);\n\t\t}\n\n\t\t// Update the board state (turn, movable pieces)\n\t\tcg.set({\n\t\t\tturnColor: toColor(chess),\n\t\t\tmovable: {\n\t\t\t\tcolor: toColor(chess),\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t};\n}\n\n/**\n * Creates an async function that makes a move on the chessboard and updates the state of the chess game.\n * Uses a promotion service for pawn promotion (modern method with dialog).\n *\n * @param cg - The chessground API instance.\n * @param chess - The chess.js instance representing the current state of the chess game.\n * @param promotionService - The promotion service to handle pawn promotion dialog.\n * @returns A function that takes the origin and destination squares of a move, makes the move on the chessboard,\n *          and updates the turn color and movable destinations in the chessground instance.\n */\nexport function playOtherSideWithDialog(\n\tcg: Api,\n\tchess: ChessInstance,\n\tpromotionService: PromotionService,\n) {\n\treturn async (orig: Key, dest: Key) => {\n\t\t// Check if this is a pawn promotion move (pawn reaching the first or eighth row)\n\t\tconst piece = chess.get(orig as Square);\n\t\tconst isPawn = piece && piece.type === 'p';\n\t\tconst isPromotionMove =\n\t\t\tisPawn && (dest.charAt(1) === '8' || dest.charAt(1) === '1');\n\n\t\tif (isPromotionMove) {\n\t\t\ttry {\n\t\t\t\t// Show promotion dialog and get user's choice\n\t\t\t\tconst promotion = await promotionService.showPromotionDialog(\n\t\t\t\t\tpiece.color === 'w' ? 'white' : 'black',\n\t\t\t\t);\n\n\t\t\t\t// Make the move with promotion\n\t\t\t\tconst moveResult = chess.move({\n\t\t\t\t\tfrom: orig,\n\t\t\t\t\tto: dest,\n\t\t\t\t\tpromotion: promotion as 'q' | 'r' | 'n' | 'b',\n\t\t\t\t});\n\n\t\t\t\t// For promotion moves, we need to manually update the board to show the promoted piece\n\t\t\t\tif (moveResult) {\n\t\t\t\t\t// First move the pawn on the board\n\t\t\t\t\tcg.move(orig, dest);\n\n\t\t\t\t\t// Then update the piece on the destination square with the promoted piece\n\t\t\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\n\t\t\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\t\t\tconst pieceRole = promotionToRole(promotion);\n\n\t\t\t\t\t// Update the piece on the board with the proper promoted piece\n\t\t\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Promotion dialog cancelled or error occurred:', error);\n\t\t\t\t// If dialog is cancelled or error occurs, default to queen\n\t\t\t\tconst promotion = 'q';\n\n\t\t\t\t// Make the move with default promotion\n\t\t\t\tconst moveResult = chess.move({\n\t\t\t\t\tfrom: orig,\n\t\t\t\t\tto: dest,\n\t\t\t\t\tpromotion: promotion as 'q' | 'r' | 'n' | 'b',\n\t\t\t\t});\n\n\t\t\t\tif (moveResult) {\n\t\t\t\t\tcg.move(orig, dest);\n\t\t\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\t\t\t\t\tconst pieceRole = promotionToRole(promotion);\n\t\t\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Regular move\n\t\t\tchess.move({ from: orig as Square, to: dest as Square });\n\t\t\t// For regular moves, just perform the move on the board\n\t\t\tcg.move(orig, dest);\n\t\t}\n\n\t\t// Update the board state (turn, movable pieces)\n\t\tcg.set({\n\t\t\tturnColor: toColor(chess),\n\t\t\tmovable: {\n\t\t\t\tcolor: toColor(chess),\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t};\n}\n\n/**\n * Executes an AI move in a chess game after a specified delay.\n *\n * @param cg - The chessground API instance.\n * @param chess - The chess.js instance.\n * @param delay - The delay in milliseconds before the AI makes a move.\n * @param firstMove - A boolean indicating if this is the first move of the game.\n * @returns A function that takes the origin and destination squares of the player's move.\n */\nexport function aiPlay(\n\tcg: Api,\n\tchess: ChessInstance,\n\tdelay: number,\n\tfirstMove: boolean,\n) {\n\treturn (orig: Key, dest: Key) => {\n\t\t// Check if this is a pawn promotion move\n\t\tconst piece = chess.get(orig as Square);\n\t\tconst isPawn = piece && piece.type === 'p';\n\t\tconst isPromotionMove =\n\t\t\tisPawn && (dest.charAt(1) === '8' || dest.charAt(1) === '1');\n\n\t\tif (isPromotionMove) {\n\t\t\t// For player's move, automatically promote to queen\n\t\t\tconst promotion = 'q';\n\t\t\tchess.move({\n\t\t\t\tfrom: orig as Square,\n\t\t\t\tto: dest as Square,\n\t\t\t\tpromotion: promotion,\n\t\t\t});\n\n\t\t\t// Get the color of the piece\n\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\n\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\tconst pieceRole = promotionToRole(promotion);\n\n\t\t\t// Update the piece on the board with the promoted piece\n\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t} else {\n\t\t\t// Regular move\n\t\t\tchess.move({ from: orig as Square, to: dest as Square });\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = firstMove\n\t\t\t\t? moves[0]\n\t\t\t\t: moves[Math.floor(Math.random() * moves.length)];\n\n\t\t\t// Check if this is a promotion move by looking at the destination square and piece type\n\t\t\tconst aiMovePiece = chess.get(move.from);\n\t\t\tconst isAIPawn = aiMovePiece?.type === 'p';\n\t\t\tconst isAIPromotionMove =\n\t\t\t\tisAIPawn && (move.to.charAt(1) === '8' || move.to.charAt(1) === '1');\n\n\t\t\t// AI always promotes to queen\n\t\t\tif (isAIPromotionMove) {\n\t\t\t\tconst promotion = 'q'; // AI always promotes to queen\n\t\t\t\tchess.move({\n\t\t\t\t\tfrom: move.from,\n\t\t\t\t\tto: move.to,\n\t\t\t\t\tpromotion: promotion,\n\t\t\t\t});\n\n\t\t\t\t// Move piece on board\n\t\t\t\tcg.move(move.from, move.to);\n\n\t\t\t\t// Get piece color\n\t\t\t\tconst pieceColor = chess.turn() === 'w' ? 'black' : 'white'; // The color is opposite of current turn\n\n\t\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\t\tconst pieceRole = promotionToRole(promotion);\n\n\t\t\t\t// Update the piece on the board with the promoted piece\n\t\t\t\tcg.setPieces(\n\t\t\t\t\tnew Map([[move.to, { role: pieceRole, color: pieceColor }]]),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchess.move(move.san);\n\t\t\t\tcg.move(move.from, move.to);\n\t\t\t}\n\t\t\tcg.set({\n\t\t\t\tturnColor: toColor(chess),\n\t\t\t\tmovable: {\n\t\t\t\t\tcolor: toColor(chess),\n\t\t\t\t\tdests: toDests(chess),\n\t\t\t\t},\n\t\t\t});\n\t\t\tcg.playPremove();\n\t\t}, delay);\n\t};\n}\n","import { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Key, Piece } from 'chessground/types';\nimport type { PromotionService } from '../lib/promotion-dialog/promotion.service';\nimport type { Unit } from './unit';\nimport {\n\taiPlay,\n\tplayOtherSide,\n\tplayOtherSideWithDialog,\n\ttoColor,\n\ttoDests,\n} from './util';\n\n/**\n * Factory function to create units that use dialog-based promotion.\n * This allows the components to pass in the PromotionService dependency.\n */\nexport function createPlayUnitsWithDialog(promotionService?: PromotionService) {\n\t// If no promotion service is provided, fall back to the legacy prompt-based units\n\tif (!promotionService) {\n\t\treturn {\n\t\t\tinitial,\n\t\t\tcastling,\n\t\t\tplayVsRandom,\n\t\t\tplayFullRandom,\n\t\t\tslowAnim,\n\t\t\tconflictingHold,\n\t\t};\n\t}\n\n\t// Return enhanced units that use the promotion dialog\n\treturn {\n\t\tinitial: {\n\t\t\t...initial,\n\t\t\tname: 'Play legal moves from initial position (with promotion dialog)',\n\t\t\trun(el: HTMLElement) {\n\t\t\t\tconst chess = new Chess();\n\t\t\t\tconst cg = Chessground(el, {\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tcolor: 'white',\n\t\t\t\t\t\tfree: false,\n\t\t\t\t\t\tdests: toDests(chess),\n\t\t\t\t\t},\n\t\t\t\t\tdraggable: {\n\t\t\t\t\t\tshowGhost: true,\n\t\t\t\t\t},\n\t\t\t\t\tevents: {\n\t\t\t\t\t\tmove: (_orig: Key, _dest: Key, _capturedPiece?: Piece) => {\n\t\t\t\t\t\t\t// console.log(_orig);\n\t\t\t\t\t\t\t// console.log(_dest);\n\t\t\t\t\t\t\t// console.log(_capturedPiece);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tcg.set({\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tevents: {\n\t\t\t\t\t\t\tafter: playOtherSideWithDialog(cg, chess, promotionService),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\treturn cg;\n\t\t\t},\n\t\t},\n\t\tcastling: {\n\t\t\t...castling,\n\t\t\tname: 'Castling (with promotion dialog)',\n\t\t\trun(el: HTMLElement) {\n\t\t\t\tconst fen =\n\t\t\t\t\t'rnbqk2r/pppp1ppp/5n2/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4';\n\n\t\t\t\tconst chess = new Chess(fen);\n\t\t\t\tconst cg = Chessground(el, {\n\t\t\t\t\tfen,\n\t\t\t\t\tturnColor: toColor(chess),\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tcolor: 'white',\n\t\t\t\t\t\tfree: false,\n\t\t\t\t\t\tdests: toDests(chess),\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tcg.set({\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tevents: {\n\t\t\t\t\t\t\tafter: playOtherSideWithDialog(cg, chess, promotionService),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\treturn cg;\n\t\t\t},\n\t\t},\n\t\tplayVsRandom, // AI vs player doesn't need dialog as AI handles promotion automatically\n\t\tplayFullRandom, // AI vs AI doesn't need dialog\n\t\tslowAnim, // AI vs player doesn't need dialog as AI handles promotion automatically\n\t\tconflictingHold,\n\t};\n}\n\n// Export the existing units for backward compatibility\n\n/**\n * The `initial` constant represents a unit that sets up a chessboard with the initial position\n * and allows playing legal moves from that position.\n *\n * @constant\n * @type {Unit}\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard and sets up the game.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n *\n * The `run` function performs the following tasks:\n * - Creates a new instance of the Chess game.\n * - Initializes the Chessground with the given HTML element and configuration options.\n * - Sets up the chessboard to allow only legal moves for the white player.\n * - Enables draggable pieces with ghost images.\n * - Defines an event handler for the move event.\n * - Updates the Chessground configuration to handle moves for the other side after a move is made.\n */\nexport const initial: Unit = {\n\tname: 'Play legal moves from initial position',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t\tdraggable: {\n\t\t\t\tshowGhost: true,\n\t\t\t},\n\t\t\tevents: {\n\t\t\t\tmove: (_orig: Key, _dest: Key, _capturedPiece?: Piece) => {\n\t\t\t\t\t// console.log(_orig);\n\t\t\t\t\t// console.log(_dest);\n\t\t\t\t\t// console.log(_capturedPiece);\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: { events: { after: playOtherSide(cg, chess) } },\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents the castling unit in a chess game.\n *\n * @constant\n * @type {Unit}\n * @name castling\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to execute the castling logic.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance with the castling configuration.\n *\n * The `run` function initializes a chessboard with a given FEN string representing the board state.\n * It sets up the Chessground instance with the appropriate configuration for castling moves.\n * The function also sets up an event to handle moves after the current move.\n */\nexport const castling: Unit = {\n\tname: 'Castling',\n\trun(el) {\n\t\tconst fen =\n\t\t\t'rnbqk2r/pppp1ppp/5n2/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4';\n\n\t\tconst chess = new Chess(fen);\n\t\tconst cg = Chessground(el, {\n\t\t\tfen,\n\t\t\tturnColor: toColor(chess),\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: { events: { after: playOtherSide(cg, chess) } },\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that allows playing against a random AI.\n *\n * @constant\n * @type {Unit}\n * @name playVsRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to initialize the chess game against the random AI.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const playVsRandom: Unit = {\n\tname: 'Play vs random AI',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: {\n\t\t\t\tevents: {\n\t\t\t\t\tafter: aiPlay(cg, chess, 1000, false),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that simulates a chess game between two random AIs.\n * The game is displayed on a Chessground board with animations.\n *\n * @constant\n * @type {Unit}\n * @name playFullRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes and runs the unit.\n * @param {HTMLElement} el - The HTML element where the Chessground board will be rendered.\n * @returns {Chessground} - The Chessground instance displaying the game.\n */\nexport const playFullRandom: Unit = {\n\tname: 'Watch 2 random AIs',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 1000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tfunction makeMove() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = moves[Math.floor(Math.random() * moves.length)];\n\t\t\tchess.move(move.san);\n\t\t\tcg.move(move.from, move.to);\n\t\t\tsetTimeout(makeMove, 700);\n\t\t}\n\t\tsetTimeout(makeMove, 700);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit configuration for playing against a random AI with slow animations.\n *\n * @constant\n * @type {Unit}\n * @name slowAnim\n *\n * @property {string} name - The name of the unit configuration.\n * @property {Function} run - The function to execute the unit configuration.\n *\n * @param {HTMLElement} el - The HTML element to initialize the chessground on.\n *\n * @returns {Chessground} - The initialized chessground instance.\n */\nexport const slowAnim: Unit = {\n\tname: 'Play vs random AI; slow animations',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 5000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: {\n\t\t\t\tevents: {\n\t\t\t\t\tafter: aiPlay(cg, chess, 1000, false),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that demonstrates a conflicting hold/premove scenario in a chess game.\n *\n * This unit sets up a chessboard with a specific FEN position and simulates a move conflict\n * where a black pawn moves to a square that a white pawn is attempting to move to.\n *\n * @constant\n * @type {Unit}\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard and runs the scenario.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} The Chessground instance representing the chessboard.\n */\nexport const conflictingHold: Unit = {\n\tname: 'Conflicting hold/premove',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tfen: '8/8/5p2/4P3/8/8/8/8',\n\t\t\tturnColor: 'black',\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: new Map([['e5', ['f6']]]),\n\t\t\t},\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('f6', 'e5');\n\t\t\tcg.playPremove();\n\t\t\tcg.set({\n\t\t\t\tturnColor: 'white',\n\t\t\t\tmovable: {\n\t\t\t\t\tdests: undefined,\n\t\t\t\t},\n\t\t\t});\n\t\t}, 1000);\n\t\treturn cg;\n\t},\n};\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport {\n\tMAT_DIALOG_DATA,\n\tMatDialogModule,\n\tMatDialogRef,\n} from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\n\n/**\n * Data passed to the promotion dialog.\n */\nexport interface PromotionDialogData {\n\t/** The color of the promoting pawn — determines piece set rendering. */\n\tcolor: 'white' | 'black';\n}\n\n/**\n * Legal promotion piece choices.\n * - `'q'` — Queen\n * - `'r'` — Rook\n * - `'b'` — Bishop\n * - `'n'` — Knight\n */\nexport type PromotionPiece = 'q' | 'r' | 'b' | 'n';\n\n/**\n * A Material dialog that lets the user choose a piece for pawn promotion.\n *\n * Displays four buttons (Queen, Rook, Bishop, Knight) styled with Unicode\n * chess piece characters. On selection, the dialog closes with the chosen\n * {@link PromotionPiece} string. If dismissed without selection, defaults to `'q'`.\n *\n * @remarks The component uses `ChangeDetectionStrategy.Default` for zoneless compatibility\n *          but has been partially migrated and may be switched to `OnPush` after testing.\n */\n@Component({\n\tselector: 'ngx-promotion-dialog',\n\timports: [CommonModule, MatDialogModule, MatButtonModule, MatIconModule],\n  // TODO: This component has been partially migrated to be zoneless-compatible.\n  // After testing, this should be updated to ChangeDetectionStrategy.OnPush.\n  changeDetection: ChangeDetectionStrategy.Default,\n\ttemplate: `\n    <div class=\"promotion-dialog\">\n      <h2 mat-dialog-title>Choose Promotion Piece</h2>\n      <mat-dialog-content>\n        <div class=\"promotion-pieces\">\n          <button \n            mat-button \n            class=\"piece-button queen-btn\"\n            (click)=\"selectPiece('q')\"\n            [attr.aria-label]=\"'Promote to Queen'\"\n          >\n            <div class=\"piece-icon queen {{ data().color }}\"></div>\n            <span class=\"piece-label\">Queen</span>\n          </button>\n          \n          <button \n            mat-button \n            class=\"piece-button rook-btn\"\n            (click)=\"selectPiece('r')\"\n            [attr.aria-label]=\"'Promote to Rook'\"\n          >\n            <div class=\"piece-icon rook {{ data().color }}\"></div>\n            <span class=\"piece-label\">Rook</span>\n          </button>\n          \n          <button \n            mat-button \n            class=\"piece-button bishop-btn\"\n            (click)=\"selectPiece('b')\"\n            [attr.aria-label]=\"'Promote to Bishop'\"\n          >\n            <div class=\"piece-icon bishop {{ data().color }}\"></div>\n            <span class=\"piece-label\">Bishop</span>\n          </button>\n          \n          <button \n            mat-button \n            class=\"piece-button knight-btn\"\n            (click)=\"selectPiece('n')\"\n            [attr.aria-label]=\"'Promote to Knight'\"\n          >\n            <div class=\"piece-icon knight {{ data().color }}\"></div>\n            <span class=\"piece-label\">Knight</span>\n          </button>\n        </div>\n      </mat-dialog-content>\n    </div>\n  `,\n\tstyles: [\n\t\t`\n    :host {\n      --promo-primary: #0369A1;\n      --promo-text: #0C4A6E;\n      --promo-border: #d0dde6;\n    }\n\n    .promotion-dialog {\n      padding: 0;\n      min-width: 300px;\n    }\n\n    .promotion-pieces {\n      display: grid;\n      grid-template-columns: repeat(2, 1fr);\n      gap: 16px;\n      padding: 20px;\n    }\n\n    .piece-button {\n      display: flex;\n      flex-direction: column;\n      align-items: center;\n      padding: 20px 16px;\n      border: 2px solid var(--promo-border);\n      border-radius: 12px;\n      background: white;\n      cursor: pointer;\n      transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;\n      min-height: 100px;\n    }\n\n    .piece-button:hover {\n      border-color: var(--promo-primary);\n      background: #e0f4ff;\n      box-shadow: 0 4px 12px rgba(3, 105, 161, 0.15);\n    }\n\n    .piece-button:focus-visible {\n      outline: 3px solid var(--promo-primary);\n      outline-offset: 2px;\n    }\n\n    .piece-button:active {\n      transform: scale(0.97);\n    }\n\n    .piece-icon {\n      width: 40px;\n      height: 40px;\n      margin-bottom: 8px;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n    }\n\n    .piece-label {\n      font-size: 14px;\n      font-weight: 600;\n      color: var(--promo-text);\n    }\n\n    .piece-icon.queen.white::before {\n      content: '♕';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.queen.black::before {\n      content: '♛';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.rook.white::before {\n      content: '♖';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.rook.black::before {\n      content: '♜';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.bishop.white::before {\n      content: '♗';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.bishop.black::before {\n      content: '♝';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.knight.white::before {\n      content: '♘';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.knight.black::before {\n      content: '♞';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    h2[mat-dialog-title] {\n      text-align: center;\n      margin: 0;\n      padding: 20px 20px 0 20px;\n      color: var(--promo-text);\n      font-size: 18px;\n      font-weight: 600;\n      font-family: \"Poppins\", \"Segoe UI\", system-ui, sans-serif;\n    }\n  `,\n\t],\n})\nexport class PromotionDialogComponent {\n\t/** Reference to this dialog instance, used to close it with the selection result. */\n\treadonly dialogRef = inject(MatDialogRef<PromotionDialogComponent>);\n\t/** Dialog input data (reactive signal) containing the promoting pawn's color. */\n  readonly data = signal(inject<PromotionDialogData>(MAT_DIALOG_DATA));\n\n\t/**\n\t * Closes the dialog with the user's chosen promotion piece.\n\t *\n\t * @param piece — The selected piece: `'q'`, `'r'`, `'b'`, or `'n'`.\n\t */\n\tselectPiece(piece: PromotionPiece): void {\n\t\tthis.dialogRef.close(piece);\n\t}\n}\n","import { Injectable, inject } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { firstValueFrom } from 'rxjs';\nimport {\n\tPromotionDialogComponent,\n\ttype PromotionDialogData,\n\ttype PromotionPiece,\n} from './promotion-dialog.component';\n\n/**\n * Service that opens a Material dialog for pawn promotion selection.\n *\n * Used by chess units and components when a pawn reaches the eighth rank.\n * The dialog presents Queen, Rook, Bishop, and Knight options.\n *\n * Provided at root level so any component can inject it.\n *\n * @example\n * ```typescript\n * const promotionService = inject(PromotionService);\n * const piece = await promotionService.showPromotionDialog('white');\n * // piece is 'q', 'r', 'b', or 'n'\n * ```\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class PromotionService {\n\t/** Material dialog service used to open the promotion dialog. */\n\tprivate readonly dialog = inject(MatDialog);\n\n\t/**\n\t * Opens the promotion dialog and returns the user's selection.\n\t *\n\t * The dialog is modal (disableClose) with a backdrop.\n\t * Defaults to Queen ('q') if the dialog is dismissed without selection.\n\t *\n\t * @param color — The color of the promoting pawn ('white' or 'black').\n\t * @returns A Promise resolving to the chosen piece: `'q'` (Queen), `'r'` (Rook),\n\t *          `'b'` (Bishop), or `'n'` (Knight).\n\t */\n\tasync showPromotionDialog(color: 'white' | 'black'): Promise<PromotionPiece> {\n\t\tconst dialogRef = this.dialog.open(PromotionDialogComponent, {\n\t\t\twidth: '350px',\n\t\t\tdisableClose: true,\n\t\t\thasBackdrop: true,\n\t\t\tdata: { color } as PromotionDialogData,\n\t\t});\n\n\t\tconst result = await firstValueFrom(dialogRef.afterClosed());\n\t\treturn result ?? 'q'; // Default to queen if dialog is closed without selection\n\t}\n}\n","import {\n\ttype AfterViewInit,\n\tChangeDetectionStrategy,\n\tComponent,\n\tinject,\n\tviewChild,\n} from '@angular/core';\nimport * as play from '../../units/play';\nimport { NgxChessgroundComponent } from '../ngx-chessground/ngx-chessground.component';\nimport { PromotionService } from '../promotion-dialog/promotion.service';\n\n/**\n * A table-style chessboard demo component.\n *\n * Displays a single chessboard initialized with the \"Play legal moves from initial position\"\n * unit preset, enhanced with dialog-based pawn promotion via {@link PromotionService}.\n *\n * Implements {@link AfterViewInit} to set the run function on the child\n * {@link NgxChessgroundComponent} once the view is ready.\n *\n * @example\n * ```html\n * <ngx-chessground-table />\n * ```\n */\n@Component({\n\tselector: 'ngx-chessground-table',\n\ttemplateUrl: './ngx-chessground-table.component.html',\n\tstyleUrls: ['./ngx-chessground-table.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\timports: [NgxChessgroundComponent],\n})\nexport class NgxChessgroundTableComponent implements AfterViewInit {\n\t/**\n\t * Signal-based view query for the child chessboard component.\n\t *\n\t * References the `NgxChessgroundComponent` with template variable `#chess`.\n\t * Used in {@link ngAfterViewInit} to set the initial board configuration.\n\t */\n\treadonly ngxChessgroundComponent =\n\t\tviewChild.required<NgxChessgroundComponent>('chess');\n\n\t/** Injected promotion dialog service for pawn promotion UX. */\n\tprivate readonly promotionService = inject(PromotionService);\n\n\t/**\n\t * Initializes the chessboard after the view is rendered.\n\t *\n\t * Creates unit presets enhanced with dialog-based promotion and assigns\n\t * the \"initial\" unit's run function to the child chessground component.\n\t */\n\tngAfterViewInit(): void {\n\t\tconst enhancedUnits = play.createPlayUnitsWithDialog(this.promotionService);\n\t\tthis.ngxChessgroundComponent().runFunction.set(enhancedUnits.initial.run);\n\t}\n}\n","<ngx-chessground #chess></ngx-chessground>\n","/**\n * Mapping from ECO (Encyclopedia of Chess Openings) codes to their defining move sequences.\n *\n * Each entry maps an ECO code (e.g. `'A00'`, `'B33'`) to the pipe-separated sequence of\n * standard algebraic notation (SAN) moves that identify the opening.\n *\n * Generated from a curated ECO database. Used by the PGN viewer for opening classification\n * and filtering by specific opening lines.\n *\n * | Category | ECO Range |\n * |----------|-----------|\n * | A        | Flank openings (A00–A99) |\n * | B        | Semi-open games (B00–B99) |\n * | C        | Open games / French (C00–C99) |\n * | D        | Closed / Semi-closed games (D00–D99) |\n * | E        | Indian defenses (E00–E99) |\n *\n * @example\n * ```typescript\n * import { ECO_MOVES } from 'ngx-chessground';\n *\n * const opening = ECO_MOVES['B33']; // \"1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5\"\n * ```\n */\nexport const ECO_MOVES: Record<string, string> = {\n\tA00: '1. a3 | 1. g3 | 1. b4 | 1. c3 | 1. Nc3',\n\tA01: '1. b3',\n\tA02: '1. f4',\n\tA03: '1. f4 d5',\n\tA04: '1. Nf3',\n\tA05: '1. Nf3 Nf6',\n\tA06: '1. Nf3 d5',\n\tA07: '1. Nf3 d5 2. g3',\n\tA08: '1. Nf3 d5 2. g3 c5 3. Bg2',\n\tA09: '1. Nf3 d5 2. c4',\n\tA10: '1. c4',\n\tA11: '1. c4 c6',\n\tA12: '1. Nf3 d5 2. c4 c6 3. b3',\n\tA13: '1. c4 e6',\n\tA14: '1. Nf3 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. O-O',\n\tA15: '1. c4 Nf6',\n\tA16: '1. c4 Nf6 2. Nc3',\n\tA17: '1. c4 Nf6 2. Nc3 e6',\n\tA18: '1. c4 Nf6 2. Nc3 e6 3. e4',\n\tA19: '1. c4 Nf6 2. Nc3 e6 3. e4 c5',\n\tA20: '1. c4 e5',\n\tA21: '1. c4 e5 2. Nc3',\n\tA22: '1. c4 e5 2. Nc3 Nf6',\n\tA23: '1. c4 e5 2. Nc3 Nf6 3. g3 c6',\n\tA24: '1. c4 e5 2. Nc3 Nf6 3. g3 g6',\n\tA25: '1. c4 e5 2. Nc3 Nc6',\n\tA26: '1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6',\n\tA27: '1. c4 e5 2. Nc3 Nc6 3. Nf3',\n\tA28: '1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6',\n\tA29: '1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3',\n\tA30: '1. c4 c5',\n\tA31: '1. d4 Nf6 2. c4 c5 3. Nf3',\n\tA32: '1. d4 Nf6 2. c4 c5 3. Nf3 cxd4 4. Nxd4 e6',\n\tA33: '1. Nf3 Nf6 2. c4 c5 3. Nc3 Nc6 4. d4 cxd4 5. Nxd4 e6',\n\tA34: '1. c4 c5 2. Nc3',\n\tA35: '1. c4 c5 2. Nc3 Nc6',\n\tA36: '1. c4 c5 2. Nc3 Nc6 3. g3',\n\tA37: '1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3',\n\tA38: '1. Nf3 Nf6 2. c4 c5 3. Nc3 Nc6 4. g3 g6 5. Bg2 Bg7',\n\tA39: '1. Nf3 Nf6 2. c4 c5 3. Nc3 Nc6 4. g3 g6 5. Bg2 Bg7 6. O-O O-O 7. d4',\n\tA40: '1. d4',\n\tA41: '1. d4 d6',\n\tA42: '1. d4 g6 2. c4 Bg7 3. Nc3 d6 4. e4',\n\tA43: '1. d4 c5',\n\tA44: '1. d4 c5 2. d5 e5',\n\tA45: '1. d4 Nf6',\n\tA46: '1. d4 Nf6 2. Nf3',\n\tA47: '1. d4 Nf6 2. Nf3 b6',\n\tA48: '1. d4 Nf6 2. Nf3 g6',\n\tA49: '1. d4 Nf6 2. Nf3 g6 3. g3',\n\tA50: '1. d4 Nf6 2. c4',\n\tA51: '1. d4 Nf6 2. c4 e5',\n\tA52: '1. d4 Nf6 2. c4 e5 3. dxe5 Ng4',\n\tA53: '1. d4 Nf6 2. c4 d6',\n\tA54: '1. d4 Nf6 2. c4 d6 3. Nc3 e5',\n\tA55: '1. d4 Nf6 2. c4 d6 3. Nc3 Nbd7 4. e4 e5 5. Nf3',\n\tA56: '1. d4 Nf6 2. c4 c5',\n\tA57: '1. d4 Nf6 2. c4 c5 3. d5 b5',\n\tA58: '1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6',\n\tA59: '1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 Bxa6 6. Nc3 d6 7. e4',\n\tA60: '1. d4 Nf6 2. c4 c5 3. d5 e6',\n\tA61: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6',\n\tA62: '1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O',\n\tA63: '1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O 9. O-O Nbd7',\n\tA64: '1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O 9. O-O a6 10. a4 Nbd7 11. Nd2 Re8',\n\tA65: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4',\n\tA66: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4',\n\tA67: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Bb5+',\n\tA68: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3',\n\tA69: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Nf3 c5 7. d5 e6 8. Be2 exd5 9. cxd5 Re8',\n\tA70: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4',\n\tA71: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Bg5',\n\tA72: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O',\n\tA73: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O',\n\tA74: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O a6 10. a4',\n\tA75: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Be2 O-O 9. O-O a6 10. a4 Bg4',\n\tA76: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8',\n\tA77: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2',\n\tA78: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 Na6',\n\tA79: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 Na6 11. f3',\n\tA80: '1. d4 f5',\n\tA81: '1. d4 f5 2. g3',\n\tA82: '1. d4 f5 2. e4',\n\tA83: '1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. Bg5',\n\tA84: '1. d4 f5 2. c4',\n\tA85: '1. d4 f5 2. c4 Nf6 3. Nc3',\n\tA86: '1. d4 f5 2. c4 Nf6 3. g3',\n\tA87: '1. d4 f5 2. c4 Nf6 3. g3 g6 4. Bg2 Bg7 5. Nf3',\n\tA88: '1. d4 f5 2. g3 Nf6 3. Bg2 g6 4. Nf3 Bg7 5. O-O O-O 6. c4 d6 7. Nc3 c6',\n\tA89: '1. d4 f5 2. g3 Nf6 3. Bg2 g6 4. Nf3 Bg7 5. O-O O-O 6. c4 d6 7. Nc3 Nc6',\n\tA90: '1. d4 f5 2. c4 Nf6 3. g3 e6',\n\tA91: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7',\n\tA92: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O',\n\tA93: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. b3',\n\tA94: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. b3 c6 8. Ba3',\n\tA95: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. Nc3 c6',\n\tA96: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6',\n\tA97: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8',\n\tA98: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 8. Qc2',\n\tA99: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 8. b3',\n\tB00: '1. e4',\n\tB07: '1. e4 d6',\n\tB01: '1. e4 d5',\n\tB02: '1. e4 Nf6',\n\tB03: '1. e4 Nf6 2. e5 Nd5 3. d4',\n\tB04: '1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3',\n\tB05: '1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Bg4',\n\tB06: '1. e4 g6',\n\tB08: '1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3',\n\tB09: '1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4',\n\tB10: '1. e4 c6',\n\tB11: '1. e4 c6 2. Nc3 d5 3. Nf3 Bg4',\n\tB12: '1. e4 c6 2. d4',\n\tB13: '1. e4 c6 2. d4 d5 3. exd5',\n\tB14: '1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 e6',\n\tB15: '1. e4 c6 2. d4 d5 3. Nc3',\n\tB16: '1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nx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 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Be7',\n\tB99: '1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Be7 8. Qf3 Qc7 9. O-O-O Nbd7',\n\tC00: '1. e4 e6',\n\tC01: '1. e4 e6 2. d4 d5 3. exd5',\n\tC02: '1. e4 e6 2. d4 d5 3. e5',\n\tC03: '1. e4 e6 2. d4 d5 3. Nd2',\n\tC04: '1. e4 e6 2. d4 d5 3. Nd2 Nc6 4. Ngf3 Nf6',\n\tC05: '1. e4 e6 2. d4 d5 3. Nd2 Nf6',\n\tC06: '1. e4 e6 2. d4 d5 3. Nd2 Nf6 4. e5 Nfd7 5. Bd3 c5 6. c3 Nc6 7. Ne2 cxd4 8. cxd4',\n\tC07: '1. e4 e6 2. d4 d5 3. Nd2 c5',\n\tC08: '1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5',\n\tC09: '1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5 5. Ngf3 Nc6',\n\tC10: '1. e4 e6 2. d4 d5 3. Nc3',\n\tC11: '1. e4 e6 2. d4 d5 3. Nc3 Nf6',\n\tC12: '1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4',\n\tC13: '1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7',\n\tC14: '1. e4 e6 2. d4 d5 3. Nc3 a6 4. Nf3 Nf6 5. e5 Nfd7 6. Bg5',\n\tC15: '1. e4 e6 2. d4 d5 3. Nc3 Bb4',\n\tC16: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5',\n\tC17: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5',\n\tC18: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+',\n\tC19: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7',\n\tC20: '1. e4 e5',\n\tC21: '1. e4 e5 2. d4 exd4',\n\tC22: '1. e4 e5 2. d4 exd4 3. Qxd4 Nc6',\n\tC23: '1. e4 e5 2. Bc4',\n\tC24: '1. e4 e5 2. Bc4 Nf6',\n\tC25: '1. e4 e5 2. Nc3',\n\tC26: '1. e4 e5 2. Nc3 Nf6',\n\tC27: '1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4',\n\tC28: '1. e4 e5 2. Nc3 Nc6 3. Bc4 Nf6',\n\tC29: '1. e4 e5 2. Nc3 Nf6 3. f4',\n\tC30: '1. e4 e5 2. f4',\n\tC31: '1. e4 e5 2. f4 d5',\n\tC32: '1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6',\n\tC33: '1. e4 e5 2. f4 exf4',\n\tC34: '1. e4 e5 2. f4 exf4 3. Nf3',\n\tC35: '1. e4 e5 2. f4 exf4 3. Nf3 Be7',\n\tC36: '1. e4 e5 2. f4 exf4 3. Nf3 d5',\n\tC37: '1. e4 e5 2. f4 exf4 3. Nf3 g5 4. d4',\n\tC38: '1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 Bg7',\n\tC39: '1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4',\n\tC40: '1. e4 e5 2. Nf3',\n\tC41: '1. e4 e5 2. Nf3 d6',\n\tC42: '1. e4 e5 2. Nf3 Nf6',\n\tC43: '1. e4 e5 2. Nf3 Nf6 3. d4',\n\tC44: '1. e4 e5 2. Nf3 Nc6',\n\tC45: '1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4',\n\tC46: '1. e4 e5 2. Nf3 Nc6 3. Nc3',\n\tC47: '1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6',\n\tC48: '1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5',\n\tC49: '1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4',\n\tC50: '1. e4 e5 2. Nf3 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2. c4 Nc6',\n\tD08: '1. d4 d5 2. c4 e5',\n\tD09: '1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. g3',\n\tD10: '1. d4 d5 2. c4 c6',\n\tD11: '1. d4 d5 2. c4 c6 3. Nf3',\n\tD12: '1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5',\n\tD13: '1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. cxd5',\n\tD14: '1. d4 d5 2. c4 c6 3. cxd5 cxd5 4. Nc3 Nf6 5. Nf3 Nc6 6. Bf4 Bf5',\n\tD15: '1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3',\n\tD16: '1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4',\n\tD17: '1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5',\n\tD18: '1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. e3',\n\tD19: '1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. e3 e6 7. Bxc4 Bb4 8. O-O',\n\tD20: '1. d4 d5 2. c4 dxc4',\n\tD21: '1. d4 d5 2. c4 dxc4 3. Nf3',\n\tD22: '1. d4 d5 2. c4 dxc4 3. Nf3 a6',\n\tD23: '1. d4 d5 2. c4 dxc4 3. Nf3 Nf6',\n\tD24: '1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Nc3',\n\tD25: '1. d4 d5 2. Nf3 Nf6 3. c4 dxc4',\n\tD26: '1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6',\n\tD27: '1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6',\n\tD28: '1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Qe2',\n\tD29: '1. d4 d5 2. c4 d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c8 12.Rd1 Bd6 ',\n\t'E80 ':\n\t\t'1.d4 Nf6 2.c4 g6 3.Nc3 Bg7 4.e4 d6 5.f3 e5 6.d5 Nh5 7.Be3 Na6 8.Qd2 Qh4+ 9.g3 Nxg3 10.Qf2 Nxf1 11.Qxh4 Nxe3 12.Kf2 Nxc4 ',\n};\n","import { Injectable } from '@angular/core';\nimport type {\n\tFilterCriteria,\n\tWorkerResponse,\n} from './pgn-processor.worker';\n\n/**\n * Callback interface for PGN viewer engine events.\n * Consumer components implement these handlers to react to worker messages.\n */\ninterface PgnViewerEngineCallbacks {\n\t/** Called when the PGN processor worker sends a response (parse, filter, load results). */\n\tonPgnMessage: (data: WorkerResponse) => void;\n\t/** Called when the Stockfish worker sends analysis output (UCI protocol messages). */\n\tonStockfishMessage: (event: MessageEvent) => void;\n\t/** Optional error handler for worker initialization failures. */\n\tonError?: (message: string, error?: unknown) => void;\n}\n\n/**\n * Service that manages Web Workers for background PGN processing and Stockfish analysis.\n *\n * Maintains two workers:\n * - **PGN processor** — parses/filters PGN data off the main thread using `pgn-processor.worker`.\n * - **Stockfish** — runs the Stockfish chess engine for position analysis via UCI protocol.\n *\n * Provided at root level so a single instance is shared across the application.\n * Callers must call {@link initialize} before using the service and {@link dispose} when done.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class PgnViewerEngineService {\n\t/** Web Worker for PGN parsing and filtering. */\n\tprivate pgnWorker: Worker | null = null;\n\t/** Web Worker running the Stockfish chess engine. */\n\tprivate stockfishWorker: Worker | null = null;\n\n\t/**\n\t * Creates and initializes both Web Workers.\n\t *\n\t * Disposes any existing workers first, then spawns new ones.\n\t * The Stockfish worker is started in UCI mode immediately.\n\t *\n\t * @param callbacks — Event handlers for worker messages and errors.\n\t * @returns `true` if workers were created successfully, `false` if Web Workers are unsupported.\n\t */\n\tinitialize(callbacks: PgnViewerEngineCallbacks): boolean {\n\t\tif (typeof Worker === 'undefined') {\n\t\t\tcallbacks.onError?.('Web Workers are not supported in this environment.');\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.dispose();\n\n\t\tthis.pgnWorker = new Worker(new URL('./pgn-processor.worker', import.meta.url));\n\t\tthis.pgnWorker.onmessage = ({ data }: MessageEvent<WorkerResponse>) => {\n\t\t\tcallbacks.onPgnMessage(data);\n\t\t};\n\n\t\ttry {\n\t\t\tthis.stockfishWorker = new Worker('assets/stockfish/stockfish.js');\n\t\t\tthis.stockfishWorker.onmessage = callbacks.onStockfishMessage;\n\t\t\tthis.stockfishWorker.postMessage('uci');\n\t\t} catch (error) {\n\t\t\tcallbacks.onError?.('Failed to load Stockfish worker.', error);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Sends raw PGN text to the parser worker for processing.\n\t *\n\t * @param pgn — Raw PGN string (supports multi-game, compressed formats).\n\t * @param id — Correlation ID echoed back in the worker response for matching requests.\n\t */\n\tloadPgn(pgn: string, id: number): void {\n\t\tthis.pgnWorker?.postMessage({ type: 'load', payload: pgn, id });\n\t}\n\n\t/**\n\t * Filters the parsed game list by the given criteria.\n\t *\n\t * @param payload — Filter criteria (player names, ECO, draw inclusion, opening moves, ratings).\n\t * @param id — Correlation ID echoed back in the worker response.\n\t */\n\tfilterGames(payload: FilterCriteria, id: number): void {\n\t\tthis.pgnWorker?.postMessage({ type: 'filter', payload, id });\n\t}\n\n\t/**\n\t * Loads the full move data for a specific game by its index in the parsed list.\n\t *\n\t * @param index — Zero-based index of the game to load.\n\t * @param id — Correlation ID echoed back in the worker response.\n\t */\n\tloadGame(index: number, id: number): void {\n\t\tthis.pgnWorker?.postMessage({ type: 'loadGame', payload: index, id });\n\t}\n\n\t/**\n\t * Sends a FEN position to Stockfish for analysis at the given search depth.\n\t *\n\t * Stops any in-progress analysis before starting the new one.\n\t *\n\t * @param fen — FEN string of the position to analyze.\n\t * @param depth — Search depth in plies.\n\t * @returns `false` if the Stockfish worker is not available, `true` otherwise.\n\t */\n\tanalyzePosition(fen: string, depth: number): boolean {\n\t\tif (!this.stockfishWorker) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.stockfishWorker.postMessage('stop');\n\t\tthis.stockfishWorker.postMessage(`position fen ${fen}`);\n\t\tthis.stockfishWorker.postMessage(`go depth ${depth}`);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Terminates both workers and releases resources.\n\t *\n\t * Sends a 'quit' command to Stockfish before terminating to allow\n\t * the engine to shut down gracefully.\n\t */\n\tdispose(): void {\n\t\tthis.pgnWorker?.terminate();\n\t\tthis.pgnWorker = null;\n\n\t\tif (this.stockfishWorker) {\n\t\t\tthis.stockfishWorker.postMessage('quit');\n\t\t\tthis.stockfishWorker.terminate();\n\t\t\tthis.stockfishWorker = null;\n\t\t}\n\t}\n}","import { CommonModule } from '@angular/common';\nimport { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tcomputed,\n\teffect,\n\ttype ElementRef,\n\tinject,\n\tinput,\n\tmodel,\n\ttype OnDestroy,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { Chess, Move } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport { Api } from 'chessground/api';\nimport { Key } from 'chessground/types';\nimport { parsePgn } from 'chessops/pgn';\nimport { loadAsync as loadZipAsync } from 'jszip';\nimport { decompress as decompressZst } from 'fzstd';\nimport { NgxChessgroundComponent } from '../ngx-chessground/ngx-chessground.component';\nimport type {\n\tFilterCriteria,\n\tGameMetadata,\n\tWorkerResponse,\n} from './pgn-processor.worker';\nimport { ECO_MOVES } from './eco-moves';\nimport { PgnViewerEngineService } from './pgn-viewer-engine.service';\n\n/**\n * A full-featured PGN viewer component for Angular applications.\n *\n * Supports loading single or multi-game PGN files, navigating moves, auto-replay\n * with configurable timing modes, Stockfish-powered position analysis (\"stop on error\"),\n * filtering by player/ECO/opening moves, and batch replay across multiple games.\n *\n * All components used are standalone. Import this component directly:\n * ```typescript\n * imports: [NgxPgnViewerComponent]\n * ```\n *\n * @example Basic usage\n * ```html\n * <ngx-pgn-viewer [pgn]=\"pgnString\" [highlightLastMove]=\"true\" />\n * ```\n */\n@Component({\n\tselector: 'ngx-pgn-viewer',\n\timports: [CommonModule, MatSnackBarModule, NgxChessgroundComponent],\n\ttemplateUrl: './pgn-viewer.component.html',\n\tstyleUrls: ['./pgn-viewer.component.css'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxPgnViewerComponent implements OnDestroy {\n\t/** Service managing the PGN processor and Stockfish Web Workers. */\n\tprivate readonly pgnViewerEngine = inject(PgnViewerEngineService);\n\t/** Material snackbar service for user notifications. */\n\tprivate readonly snackBar = inject(MatSnackBar);\n\n\t// ---- Inputs ----\n\n\t/**\n\t * PGN string to load and display.\n\t * Supports plain PGN, multi-game PGN, gzip-compressed (`.pgn.gz`), and ZIP archives.\n\t */\n\tpgn = input<string>('');\n\t/**\n\t * Whether to highlight the last played move on the board with colored squares.\n\t * @default true\n\t */\n\thighlightLastMove = input<boolean>(true);\n\n\t/**\n\t * Updates the white player name filter from an input event.\n\t * @param event — Input event from the white filter text field.\n\t */\n\tupdateFilterWhite(event: Event) {\n\t\tthis.filterWhite.set((event.target as HTMLInputElement).value);\n\t}\n\n\t/**\n\t * Updates the black player name filter from an input event.\n\t * @param event — Input event from the black filter text field.\n\t */\n\tupdateFilterBlack(event: Event) {\n\t\tthis.filterBlack.set((event.target as HTMLInputElement).value);\n\t}\n\n\t// ---- Typeahead Methods ----\n\n\t/**\n\t * Opens the white player typeahead dropdown and resets the selection index.\n\t */\n\topenWhiteTypeahead() {\n\t\tthis.whiteTypeaheadOpen.set(true);\n\t\tthis.whiteTypeaheadIndex.set(0);\n\t}\n\n\t/**\n\t * Opens the black player typeahead dropdown and resets the selection index.\n\t */\n\topenBlackTypeahead() {\n\t\tthis.blackTypeaheadOpen.set(true);\n\t\tthis.blackTypeaheadIndex.set(0);\n\t}\n\n\t/**\n\t * Closes the white player typeahead dropdown after a 200ms delay\n\t * (allows mousedown on dropdown items to fire before close).\n\t */\n\tcloseWhiteTypeahead() {\n\t\t// Cancel any existing close timeout\n\t\tif (this.whiteTypeaheadCloseTimeout) {\n\t\t\tclearTimeout(this.whiteTypeaheadCloseTimeout);\n\t\t\tthis.pendingTimeouts.delete(this.whiteTypeaheadCloseTimeout);\n\t\t}\n\t\t// Delay to allow mousedown on dropdown item to fire first\n\t\tthis.whiteTypeaheadCloseTimeout = this.setDeferredTimeout(() => {\n\t\t\tthis.whiteTypeaheadOpen.set(false);\n\t\t\tthis.whiteTypeaheadCloseTimeout = null;\n\t\t}, 200);\n\t}\n\n\t/**\n\t * Closes the black player typeahead dropdown after a 200ms delay\n\t * (allows mousedown on dropdown items to fire before close).\n\t */\n\tcloseBlackTypeahead() {\n\t\tif (this.blackTypeaheadCloseTimeout) {\n\t\t\tclearTimeout(this.blackTypeaheadCloseTimeout);\n\t\t\tthis.pendingTimeouts.delete(this.blackTypeaheadCloseTimeout);\n\t\t}\n\t\tthis.blackTypeaheadCloseTimeout = this.setDeferredTimeout(() => {\n\t\t\tthis.blackTypeaheadOpen.set(false);\n\t\t\tthis.blackTypeaheadCloseTimeout = null;\n\t\t}, 200);\n\t}\n\n\t/**\n\t * Handles input events on the white player typeahead, updating the filter\n\t * and keeping the dropdown open.\n\t * @param event — Input event from the white filter typeahead field.\n\t */\n\tonWhiteTypeaheadInput(event: Event) {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.filterWhite.set(value);\n\t\t// Cancel pending close when user types\n\t\tif (this.whiteTypeaheadCloseTimeout) {\n\t\t\tclearTimeout(this.whiteTypeaheadCloseTimeout);\n\t\t\tthis.pendingTimeouts.delete(this.whiteTypeaheadCloseTimeout);\n\t\t\tthis.whiteTypeaheadCloseTimeout = null;\n\t\t}\n\t\tthis.whiteTypeaheadOpen.set(true);\n\t\tthis.whiteTypeaheadIndex.set(0);\n\t}\n\n\t/**\n\t * Handles input events on the black player typeahead.\n\t * @param event — Input event from the black filter typeahead field.\n\t */\n\tonBlackTypeaheadInput(event: Event) {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.filterBlack.set(value);\n\t\tif (this.blackTypeaheadCloseTimeout) {\n\t\t\tclearTimeout(this.blackTypeaheadCloseTimeout);\n\t\t\tthis.pendingTimeouts.delete(this.blackTypeaheadCloseTimeout);\n\t\t\tthis.blackTypeaheadCloseTimeout = null;\n\t\t}\n\t\tthis.blackTypeaheadOpen.set(true);\n\t\tthis.blackTypeaheadIndex.set(0);\n\t}\n\n\t/**\n\t * Selects a player from the white typeahead dropdown and closes it.\n\t * @param player — The selected player name.\n\t */\n\tselectWhiteTypeahead(player: string) {\n\t\t// Cancel pending close timeout first\n\t\tif (this.whiteTypeaheadCloseTimeout) {\n\t\t\tclearTimeout(this.whiteTypeaheadCloseTimeout);\n\t\t\tthis.pendingTimeouts.delete(this.whiteTypeaheadCloseTimeout);\n\t\t\tthis.whiteTypeaheadCloseTimeout = null;\n\t\t}\n\t\tthis.filterWhite.set(player);\n\t\tthis.whiteTypeaheadOpen.set(false);\n\t\tthis.whiteTypeaheadIndex.set(0);\n\t}\n\n\t/**\n\t * Selects a player from the black typeahead dropdown and closes it.\n\t * @param player — The selected player name.\n\t */\n\tselectBlackTypeahead(player: string) {\n\t\tif (this.blackTypeaheadCloseTimeout) {\n\t\t\tclearTimeout(this.blackTypeaheadCloseTimeout);\n\t\t\tthis.pendingTimeouts.delete(this.blackTypeaheadCloseTimeout);\n\t\t\tthis.blackTypeaheadCloseTimeout = null;\n\t\t}\n\t\tthis.filterBlack.set(player);\n\t\tthis.blackTypeaheadOpen.set(false);\n\t\tthis.blackTypeaheadIndex.set(0);\n\t}\n\n\t/**\n\t * Handles keyboard navigation in the white player typeahead dropdown.\n\t *\n\t * Arrow keys navigate the list, Enter selects, Escape closes.\n\t * If the dropdown is closed, ArrowDown/ArrowUp reopen it.\n\t *\n\t * @param event — Keyboard event from the white typeahead input field.\n\t */\n\tonWhiteTypeaheadKeydown(event: KeyboardEvent) {\n\t\tconst items = this.filteredWhiteSuggestions();\n\t\tif (!this.whiteTypeaheadOpen() || items.length === 0) {\n\t\t\tif (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n\t\t\t\tthis.whiteTypeaheadOpen.set(true);\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (event.key) {\n\t\t\tcase 'ArrowDown':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.whiteTypeaheadIndex.update((i) =>\n\t\t\t\t\ti < items.length - 1 ? i + 1 : 0,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.whiteTypeaheadIndex.update((i) =>\n\t\t\t\t\ti > 0 ? i - 1 : items.length - 1,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'Enter':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst selected = items[this.whiteTypeaheadIndex()];\n\t\t\t\tif (selected) {\n\t\t\t\t\tthis.selectWhiteTypeahead(selected);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Escape':\n\t\t\t\tthis.whiteTypeaheadOpen.set(false);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Handles keyboard navigation in the black player typeahead dropdown.\n\t *\n\t * Arrow keys navigate the list, Enter selects, Escape closes.\n\t * If the dropdown is closed, ArrowDown/ArrowUp reopen it.\n\t *\n\t * @param event — Keyboard event from the black typeahead input field.\n\t */\n\tonBlackTypeaheadKeydown(event: KeyboardEvent) {\n\t\tconst items = this.filteredBlackSuggestions();\n\t\tif (!this.blackTypeaheadOpen() || items.length === 0) {\n\t\t\tif (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n\t\t\t\tthis.blackTypeaheadOpen.set(true);\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (event.key) {\n\t\t\tcase 'ArrowDown':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.blackTypeaheadIndex.update((i) =>\n\t\t\t\t\ti < items.length - 1 ? i + 1 : 0,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.blackTypeaheadIndex.update((i) =>\n\t\t\t\t\ti > 0 ? i - 1 : items.length - 1,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'Enter':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst selected = items[this.blackTypeaheadIndex()];\n\t\t\t\tif (selected) {\n\t\t\t\t\tthis.selectBlackTypeahead(selected);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Escape':\n\t\t\t\tthis.blackTypeaheadOpen.set(false);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Splits text into match/non-match segments for typeahead highlighting.\n\t *\n\t * Used to render bold matching portions of player names in the typeahead dropdown.\n\t *\n\t * @param text — Full text to segment (e.g. a player name).\n\t * @param query — Search query string to match against.\n\t * @returns Array of `{ text, match }` objects for template rendering.\n\t */\n\thighlightText(\n\t\ttext: string,\n\t\tquery: string,\n\t): { text: string; match: boolean }[] {\n\t\tconst q = query.toLowerCase().trim();\n\t\tif (!q) {\n\t\t\treturn [{ text, match: false }];\n\t\t}\n\t\tconst idx = text.toLowerCase().indexOf(q);\n\t\tif (idx === -1) {\n\t\t\treturn [{ text, match: false }];\n\t\t}\n\t\tconst segments: { text: string; match: boolean }[] = [];\n\t\tif (idx > 0) {\n\t\t\tsegments.push({ text: text.substring(0, idx), match: false });\n\t\t}\n\t\tsegments.push({\n\t\t\ttext: text.substring(idx, idx + q.length),\n\t\t\tmatch: true,\n\t\t});\n\t\tif (idx + q.length < text.length) {\n\t\t\tsegments.push({ text: text.substring(idx + q.length), match: false });\n\t\t}\n\t\treturn segments;\n\t}\n\n\t/**\n\t * Updates the result filter from a multi-select dropdown change event.\n\t *\n\t * @param event — Change event from the result `<select>` element.\n\t */\n\tupdateFilterResult(event: Event) {\n\t\tconst select = event.target as HTMLSelectElement;\n\t\tconst selectedOptions = Array.from(select.selectedOptions).map(\n\t\t\t(option) => option.value,\n\t\t);\n\t\tthis.filterResult.set(selectedOptions);\n\t}\n\n\t/**\n\t * Updates the ECO code filter from a dropdown change event.\n\t *\n\t * @param event — Change event from the ECO `<select>` element.\n\t */\n\tupdateFilterEco(event: Event) {\n\t\tthis.filterEco.set((event.target as HTMLSelectElement).value);\n\t}\n\n\t/**\n\t * Updates the time control filter from a dropdown change event.\n\t *\n\t * @param event — Change event from the time control `<select>` element.\n\t */\n\tupdateFilterTimeControl(event: Event) {\n\t\tthis.filterTimeControl.set((event.target as HTMLSelectElement).value);\n\t}\n\n\t/**\n\t * Updates the minimum white rating filter from an input event.\n\t *\n\t * @param event — Input event from the white rating `<input>` field.\n\t */\n\tupdateFilterWhiteRating(event: Event) {\n\t\tthis.filterWhiteRating.set((event.target as HTMLInputElement).value);\n\t}\n\n\t/**\n\t * Updates the maximum white rating filter from an input event.\n\t *\n\t * @param event — Input event from the white rating max `<input>` field.\n\t */\n\tupdateFilterWhiteRatingMax(event: Event) {\n\t\tthis.filterWhiteRatingMax.set((event.target as HTMLInputElement).value);\n\t}\n\n\t/**\n\t * Updates the minimum black rating filter from an input event.\n\t *\n\t * @param event — Input event from the black rating `<input>` field.\n\t */\n\tupdateFilterBlackRating(event: Event) {\n\t\tthis.filterBlackRating.set((event.target as HTMLInputElement).value);\n\t}\n\n\t/**\n\t * Updates the maximum black rating filter from an input event.\n\t *\n\t * @param event — Input event from the black rating max `<input>` field.\n\t */\n\tupdateFilterBlackRatingMax(event: Event) {\n\t\tthis.filterBlackRatingMax.set((event.target as HTMLInputElement).value);\n\t}\n\n\t/**\n\t * Toggles the \"ignore color\" checkbox — when enabled, player name filters\n\t * match either white or black fields interchangeably.\n\t *\n\t * @param event — Change event from the ignore-color checkbox.\n\t */\n\ttoggleIgnoreColor(event: Event) {\n\t\tthis.ignoreColor.set((event.target as HTMLInputElement).checked);\n\t}\n\n\t/**\n\t * Toggles interactive opening-move filtering mode.\n\t *\n\t * When enabled, the board becomes editable so the user can play moves\n\t * to define an opening sequence filter. The current game position is\n\t * saved and restored when the mode is exited.\n\t *\n\t * @param event — Change event from the filter-moves checkbox.\n\t */\n\ttoggleFilterMoves(event: Event) {\n\t\tconst checked = (event.target as HTMLInputElement).checked;\n\t\tthis.filterMoves.set(checked);\n\t\tthis.interactiveMoves.set([]);\n\t\tthis.activeFilterMoves = [];\n\n\t\tif (checked) {\n\t\t\tthis.savedGameMoveIndex = this.currentMoveIndex();\n\t\t\tthis.chess.reset();\n\t\t\tthis.currentMoveIndex.set(-1);\n\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t} else if (this.savedGameMoveIndex !== null) {\n\t\t\tthis.jumpToMove(this.savedGameMoveIndex);\n\t\t\tthis.savedGameMoveIndex = null;\n\t\t}\n\t}\n\n\t/**\n\t * Looks up the defining move sequence for an ECO opening code.\n\t *\n\t * @param code — ECO code (e.g. `\"B33\"`).\n\t * @returns Pipe-separated SAN move sequence, or empty string if not found.\n\t */\n\tgetOpeningMoves(code: string): string {\n\t\treturn ECO_MOVES[code] || '';\n\t}\n\n\t// ---- State Signals ----\n\n\t/** Parsed game metadata for all games in the loaded PGN. */\n\tgamesMetadata = signal<GameMetadata[]>([]);\n\t/** Zero-based index of the currently active game. */\n\tcurrentGameIndex = signal<number>(0);\n\t/** Array of SAN move strings for the loaded game. */\n\tmoves = signal<string[]>([]);\n\t/** Zero-based index of the current move (-1 means start position, before any move). */\n\tcurrentMoveIndex = signal<number>(-1);\n\t/** Current board position in FEN notation. */\n\tcurrentFen = signal<string>(\n\t\t'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',\n\t);\n\t/** Whether PGN data is being loaded/parsed. */\n\tisLoading = signal<boolean>(false);\n\t/** Loading progress percentage (0–100). */\n\tloadingProgress = signal<number>(0);\n\t/** Human-readable loading status message. */\n\tloadingStatus = signal<string>('');\n\t/** Set of selected game indices for batch operations like replay-all. */\n\tselectedGames = signal<Set<number>>(new Set());\n\n\t// ---- Filter Signals ----\n\n\t/** Current white player filter text. */\n\tfilterWhite = signal<string>('');\n\t/** Current black player filter text. */\n\tfilterBlack = signal<string>('');\n\t/** Selected result filters (e.g. `[\"1-0\", \"draw\"]`). */\n\tfilterResult = signal<string[]>([]);\n\t/** Whether opening-move filtering is active. */\n\tfilterMoves = signal<boolean>(false);\n\t/** Whether to swap white/black when filtering (match either color). */\n\tignoreColor = signal<boolean>(false);\n\t/** Whether Elo rating filter fields are enabled. */\n\tfilterRatingEnabled = signal<boolean>(false);\n\t/** Minimum white Elo rating filter value (as string for input binding). */\n\tfilterWhiteRating = signal<string>('2000');\n\t/** Minimum black Elo rating filter value (as string for input binding). */\n\tfilterBlackRating = signal<string>('2000');\n\t/** Maximum white Elo rating filter value (as string for input binding). */\n\tfilterWhiteRatingMax = signal<string>('2900');\n\t/** Maximum black Elo rating filter value (as string for input binding). */\n\tfilterBlackRatingMax = signal<string>('2900');\n\t/** ECO code filter value. */\n\tfilterEco = signal<string>('');\n\t/** Time control filter value (e.g. `\"180+2\"`). */\n\tfilterTimeControl = signal<string>('');\n\t/** Event/tournament name filter value. */\n\tfilterEvent = signal<string>('');\n\n\t// ---- Autocomplete Signals ----\n\n\t/** Unique white player names from the loaded PGN (for typeahead). */\n\tuniqueWhitePlayers = signal<string[]>([]);\n\t/** Unique black player names from the loaded PGN (for typeahead). */\n\tuniqueBlackPlayers = signal<string[]>([]);\n\n\t// ---- Typeahead State ----\n\n\t/** Whether the white player typeahead dropdown is open. */\n\twhiteTypeaheadOpen = signal<boolean>(false);\n\t/** Whether the black player typeahead dropdown is open. */\n\tblackTypeaheadOpen = signal<boolean>(false);\n\t/** Currently highlighted index in the white typeahead dropdown. */\n\twhiteTypeaheadIndex = signal<number>(0);\n\t/** Currently highlighted index in the black typeahead dropdown. */\n\tblackTypeaheadIndex = signal<number>(0);\n\t/** Timeout handle for delayed closing of the white typeahead dropdown. */\n\tprivate whiteTypeaheadCloseTimeout: ReturnType<typeof setTimeout> | null = null;\n\t/** Timeout handle for delayed closing of the black typeahead dropdown. */\n\tprivate blackTypeaheadCloseTimeout: ReturnType<typeof setTimeout> | null = null;\n\n\t// ---- Typeahead Filtered Suggestions ----\n\n\t/** Filtered white player suggestions based on current filter text. */\n\tfilteredWhiteSuggestions = computed(() => {\n\t\tconst query = this.filterWhite().toLowerCase().trim();\n\t\tif (!query) return this.uniqueWhitePlayers();\n\t\treturn this.uniqueWhitePlayers().filter((p) =>\n\t\t\tp.toLowerCase().includes(query),\n\t\t);\n\t});\n\n\t/** Filtered black player suggestions based on current filter text. */\n\tfilteredBlackSuggestions = computed(() => {\n\t\tconst query = this.filterBlack().toLowerCase().trim();\n\t\tif (!query) return this.uniqueBlackPlayers();\n\t\treturn this.uniqueBlackPlayers().filter((p) =>\n\t\t\tp.toLowerCase().includes(query),\n\t\t);\n\t});\n\n\t/** Unique ECO codes mapped to occurrence counts in the loaded PGN. */\n\tuniqueEcoCodes = signal<Map<string, number>>(new Map());\n\t/** Unique time controls mapped to occurrence counts and original format strings. */\n\tuniqueTimeControls = signal<\n\t\tMap<string, { count: number; originals: Map<string, number> }>\n\t>(new Map());\n\t/** Unique event/tournament names mapped to occurrence counts. */\n\tuniqueEvents = signal<Map<string, number>>(new Map());\n\n\t/** ECO codes sorted by popularity (most frequent first). */\n\tsortedEcoCodes = computed(() => {\n\t\tconst ecoMap = this.uniqueEcoCodes();\n\t\treturn Array.from(ecoMap.entries())\n\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t.map(([code, count]) => ({ code, count }));\n\t});\n\n\t/** Time controls sorted by popularity with human-readable labels and original summaries. */\n\tsortedTimeControls = computed(() => {\n\t\tconst tcMap = this.uniqueTimeControls();\n\t\treturn Array.from(tcMap.entries())\n\t\t\t.sort((a, b) => b[1].count - a[1].count)\n\t\t\t.map(([key, data]) => ({\n\t\t\t\tkey,\n\t\t\t\tcount: data.count,\n\t\t\t\tlabel: this.formatTimeControlKey(key),\n\t\t\t\toriginalsSummary: this.formatOriginalsSummary(data.originals),\n\t\t\t}));\n\t});\n\n\t/** Events sorted by popularity (most frequent first). */\n\tsortedEvents = computed(() => {\n\t\tconst eventMap = this.uniqueEvents();\n\t\treturn Array.from(eventMap.entries())\n\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t.map(([event, count]) => ({ event, count }));\n\t});\n\n\t// ---- Filtering State ----\n\n\t/** Indices of games matching the current filter criteria. */\n\tfilteredGamesIndices = signal<number[]>([]);\n\t/** Whether a filter operation is in progress. */\n\tisFiltering = signal<boolean>(false);\n\t/** Monotonic counter used as correlation ID for filter requests to the worker. */\n\tprivate currentFilterId = 0;\n\t/** When `true`, auto-select the first matching game after filtering completes. */\n\tprivate autoSelectOnFinish = false;\n\t/** View query for the move list scroll container. */\n\treadonly moveList = viewChild<ElementRef<HTMLElement>>('moveList');\n\t/** Currently active opening move sequence for interactive mode filtering. */\n\tprivate activeFilterMoves: string[] = [];\n\t/** Saved move index before entering filter-moves mode (restored when exiting). */\n\tprivate savedGameMoveIndex: number | null = null;\n\t/** Active deferred timeout handles that should be cancelled on destroy. */\n\tprivate readonly pendingTimeouts = new Set<ReturnType<typeof setTimeout>>();\n\n\t/** Moves made by the user during interactive opening-move filtering mode. */\n\tprivate interactiveMoves = signal<string[]>([]);\n\n\t/** Flag to uncheck the filter-moves toggle after a filter operation completes. */\n\tprivate shouldUncheckFilterMoves = false;\n\n\t// ---- Computed Values ----\n\n\t/** Number of currently selected games for batch operations. */\n\tselectedGamesCount = computed(() => this.selectedGames().size);\n\t/** Whether the replay-all button should be visible (multiple games + selection). */\n\tcanShowReplayAll = computed(\n\t\t() => this.gamesMetadata().length > 1 && this.selectedGamesCount() > 0,\n\t);\n\t/** Display string: \"Game X of Y\". */\n\tcurrentGameInfo = computed(\n\t\t() =>\n\t\t\t`Game ${this.currentGameIndex() + 1} of ${this.gamesMetadata().length} `,\n\t);\n\n\t/** Display name of the white player for the current game. */\n\tcurrentWhitePlayer = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst currentIndex = this.currentGameIndex();\n\t\tif (\n\t\t\tmetadata.length === 0 ||\n\t\t\tcurrentIndex < 0 ||\n\t\t\tcurrentIndex >= metadata.length\n\t\t)\n\t\t\treturn 'Unknown';\n\t\treturn metadata[currentIndex].white;\n\t});\n\n\t/** Display name of the black player for the current game. */\n\tcurrentBlackPlayer = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst currentIndex = this.currentGameIndex();\n\t\tif (\n\t\t\tmetadata.length === 0 ||\n\t\t\tcurrentIndex < 0 ||\n\t\t\tcurrentIndex >= metadata.length\n\t\t)\n\t\t\treturn 'Unknown';\n\t\treturn metadata[currentIndex].black;\n\t});\n\n\t/** Formatted result string for the current game. */\n\tcurrentGameResult = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst currentIndex = this.currentGameIndex();\n\t\tif (\n\t\t\tmetadata.length === 0 ||\n\t\t\tcurrentIndex < 0 ||\n\t\t\tcurrentIndex >= metadata.length\n\t\t)\n\t\t\treturn '*';\n\t\treturn metadata[currentIndex].result;\n\t});\n\n\t/**\n\t * Computed from-to squares of the last move for board highlighting.\n\t * Returns `undefined` when highlighting is disabled or no move has been played.\n\t */\n\tlastMoveSquares = computed<[Key, Key] | undefined>(() => {\n\t\tif (!this.highlightLastMove()) return undefined;\n\t\tthis.currentMoveIndex();\n\t\tthis.currentFen();\n\t\tconst history = this.chess.history({ verbose: true });\n\t\tif (history.length === 0) return undefined;\n\t\tconst lastMove = history[history.length - 1];\n\t\treturn [lastMove.from as Key, lastMove.to as Key];\n\t});\n\n\t/** Filtered game metadata for the current filter results. */\n\tfilteredGameInfos = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst indices = this.filteredGamesIndices();\n\t\treturn indices.map((i) => metadata[i]);\n\t});\n\n\t// ---- Replay State ----\n\n\t/** Replay timing mode: fixed, realtime (clock-based), or proportional scaling. */\n\treplayMode = signal<'realtime' | 'proportional' | 'fixed'>('fixed');\n\t/** Total duration in minutes when `replayMode` is `'proportional'`. */\n\tproportionalDuration = signal<number>(1);\n\t/** Minimum seconds between moves in `'proportional'` and `'realtime'` modes. */\n\tminSecondsBetweenMoves = signal<number>(1);\n\t/** Fixed seconds between moves when `replayMode` is `'fixed'`. */\n\tfixedTime = signal<number>(1);\n\t/** Whether to pause replay when a large evaluation change is detected. */\n\tstopOnError = signal<boolean>(false);\n\t/** Evaluation change threshold (in pawns) that triggers a stop. */\n\tstopOnErrorThreshold = signal<number>(1.0);\n\n\t// ---- Clock State ----\n\n\t/** Display string for white's remaining clock time. */\n\twhiteTimeRemaining = signal<string>('');\n\t/** Display string for black's remaining clock time. */\n\tblackTimeRemaining = signal<string>('');\n\t/** Whether either clock has been populated (controls clock display visibility). */\n\tshowClocks = computed(\n\t\t() => this.whiteTimeRemaining() !== '' || this.blackTimeRemaining() !== '',\n\t);\n\n\t/** Whether a replay is currently in progress. */\n\tisReplaying = signal<boolean>(false);\n\t/** Whether the replay can be continued from the current move. */\n\tcanContinueReplay = computed(\n\t\t() =>\n\t\t\t!this.isReplaying() && this.currentMoveIndex() < this.moves().length - 1,\n\t);\n\n\t// ---- Stockfish State ----\n\n\t/** Whether Stockfish is currently analyzing a position. */\n\tisAnalyzing = signal<boolean>(false);\n\t/** Stockfish analysis result: best move, PV line, and optional score. */\n\tbestMoveInfo = signal<{\n\t\tmove: string;\n\t\tpv: { san: string; fen: string }[];\n\t\tscore?: string;\n\t} | null>(null);\n\t/** Whether to show the \"Show Better Move\" button after a stop-on-error event. */\n\tshowBetterMoveBtn = signal<boolean>(false);\n\t/** Whether the Stockfish analysis panel is currently visible. */\n\tanalysisVisible = signal<boolean>(false);\n\n\t/**\n\t * Converts UCI move strings to SAN notation with resulting FENs.\n\t *\n\t * Used by Stockfish message handling to convert the engine's UCI PV line\n\t * into human-readable SAN for display.\n\t *\n\t * @param fen — Starting FEN position.\n\t * @param uciMoves — Array of UCI move strings (e.g. `[\"e2e4\", \"e7e5\"]`).\n\t * @returns Array of `{ san, fen }` objects, one per successful move.\n\t */\n\tprivate uciToSan(\n\t\tfen: string,\n\t\tuciMoves: string[],\n\t): { san: string; fen: string }[] {\n\t\ttry {\n\t\t\tconst tempChess = new Chess(fen);\n\t\t\tconst output: { san: string; fen: string }[] = [];\n\n\t\t\tfor (let i = 0; i < uciMoves.length; i++) {\n\t\t\t\tconst uci = uciMoves[i];\n\t\t\t\tconst from = uci.substring(0, 2);\n\t\t\t\tconst to = uci.substring(2, 4);\n\t\t\t\tconst promotion = uci.length > 4 ? uci.substring(4, 5) : undefined;\n\n\t\t\t\tconst move = tempChess.move({ from, to, promotion });\n\t\t\t\tif (!move) break;\n\n\t\t\t\toutput.push({ san: move.san, fen: tempChess.fen() });\n\t\t\t}\n\t\t\treturn output;\n\t\t} catch (e) {\n\t\t\tconsole.error('SAN conversion failed', e);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Handles UCI protocol messages from the Stockfish Web Worker.\n\t *\n\t * Parses `info ... pv ...` lines to extract the best move, PV line,\n\t * and score (centipawns or mate). Updates {@link bestMoveInfo} and\n\t * sets {@link isAnalyzing} to `false` on `bestmove`.\n\t *\n\t * @param event — Message event from the Stockfish worker.\n\t */\n\tprivate handleStockfishMessage(event: MessageEvent) {\n\t\tconst line = event.data;\n\t\tif (typeof line !== 'string') return;\n\n\t\tif (line.startsWith('bestmove')) {\n\t\t\tthis.isAnalyzing.set(false);\n\t\t} else if (line.startsWith('info') && line.includes(' pv ')) {\n\t\t\tconst pvIndex = line.indexOf(' pv ');\n\t\t\tconst pvString = line.substring(pvIndex + 4);\n\t\t\tconst moves = pvString.split(' ');\n\t\t\tif (moves.length > 0) {\n\t\t\t\tconst bestMove = moves[0];\n\n\t\t\t\t// Optional: Extract score if needed for display\n\t\t\t\tlet scoreText = '';\n\t\t\t\tconst cpMatch = line.match(/score cp (-?\\d+)/);\n\t\t\t\tconst mateMatch = line.match(/score mate (-?\\d+)/);\n\n\t\t\t\t// Determine active color for perspective adjustment\n\t\t\t\tlet isBlackToMove = false;\n\t\t\t\tif (this.analyzedFen) {\n\t\t\t\t\tconst parts = this.analyzedFen.split(' ');\n\t\t\t\t\tif (parts.length > 1 && parts[1] === 'b') {\n\t\t\t\t\t\tisBlackToMove = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (mateMatch) {\n\t\t\t\t\tlet mate = parseInt(mateMatch[1], 10);\n\t\t\t\t\tif (isBlackToMove) mate = -mate;\n\t\t\t\t\tscoreText = `#${mate}`;\n\t\t\t\t} else if (cpMatch) {\n\t\t\t\t\tlet cp = parseInt(cpMatch[1], 10);\n\t\t\t\t\tif (isBlackToMove) cp = -cp;\n\t\t\t\t\tscoreText = (cp / 100).toFixed(2);\n\t\t\t\t\t// Add + sign for positive scores for clarity\n\t\t\t\t\tif (cp > 0) scoreText = `+${scoreText}`;\n\t\t\t\t}\n\n\t\t\t\t// Convert PV to SAN objects\n\t\t\t\tconst sanPv = this.analyzedFen\n\t\t\t\t\t? this.uciToSan(this.analyzedFen, moves)\n\t\t\t\t\t: [];\n\n\t\t\t\tlet bestMoveSan = bestMove;\n\t\t\t\tif (this.analyzedFen) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst temp = new Chess(this.analyzedFen);\n\t\t\t\t\t\tconst u = bestMove;\n\t\t\t\t\t\tconst m = temp.move({\n\t\t\t\t\t\t\tfrom: u.substring(0, 2),\n\t\t\t\t\t\t\tto: u.substring(2, 4),\n\t\t\t\t\t\t\tpromotion: u.length > 4 ? u.substring(4, 5) : undefined,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (m) bestMoveSan = m.san;\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.bestMoveInfo.set({\n\t\t\t\t\tmove: bestMoveSan,\n\t\t\t\t\tpv: sanPv,\n\t\t\t\t\tscore: scoreText,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Jumps the board display to a given FEN (used for PV preview in analysis).\n\t *\n\t * @param fen — FEN string to display on the board.\n\t */\n\tpreviewPvMove(fen: string) {\n\t\tthis.currentFen.set(fen);\n\t}\n\n\t/** FEN position currently being analyzed by Stockfish. */\n\tprivate analyzedFen: string | null = null;\n\n\t// ---- Stockfish Analysis Config ----\n\n\t/** Stockfish search depth in plies. */\n\tstockfishDepth = signal<number>(18);\n\n\t/**\n\t * Sends a FEN position to Stockfish for analysis at the configured depth.\n\t *\n\t * Stops any in-progress analysis before starting. Sets {@link isAnalyzing}\n\t * and clears any previous {@link bestMoveInfo}.\n\t *\n\t * @param fen — FEN string of the position to analyze.\n\t */\n\tanalyzePosition(fen: string) {\n\t\tif (!this.pgnViewerEngine.analyzePosition(fen, this.stockfishDepth())) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isAnalyzing.set(true);\n\t\tthis.bestMoveInfo.set(null);\n\t\tthis.analyzedFen = fen;\n\t}\n\n\t/**\n\t * Auto-plays the Stockfish best line on the board with 1-second delays.\n\t *\n\t * Iterates through the PV (principal variation) moves stored in\n\t * {@link bestMoveInfo} and displays each resulting FEN.\n\t */\n\tasync autoplayBestLine() {\n\t\tconst info = this.bestMoveInfo();\n\t\tif (!info || !info.pv || info.pv.length === 0) return;\n\n\t\tfor (const move of info.pv) {\n\t\t\tthis.currentFen.set(move.fen);\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\t\t}\n\t}\n\n\t// ---- UI State ----\n\n\t/** Raw PGN text bound to the PGN textarea. */\n\tpgnInput = signal<string>('');\n\t/** URL input for fetching remote PGN files. */\n\turlInput = signal<string>('');\n\n\t// ---- Evaluation State ----\n\n\t/** Per-move evaluation strings from `[%eval ...]` PGN comments. */\n\tevaluations = signal<(string | null)[]>([]);\n\t/** Evaluation string at the current move index, or `null` at start position. */\n\tcurrentEvaluation = computed(() => {\n\t\tconst evals = this.evaluations();\n\t\tconst index = this.currentMoveIndex();\n\t\tif (index >= 0 && index < evals.length) {\n\t\t\treturn evals[index];\n\t\t}\n\t\treturn null;\n\t});\n\n\t/**\n\t * Computed height percentage (0–100) for the evaluation bar.\n\t *\n\t * Maps centipawn scores linearly from -5.0 (0%) to +5.0 (100%).\n\t * Mate scores force 0% or 100%.\n\t */\n\tevaluationBarHeight = computed(() => {\n\t\tconst evalStr = this.currentEvaluation();\n\t\tif (!evalStr) return 50;\n\n\t\tif (evalStr.startsWith('#')) {\n\t\t\tconst mateIn = parseInt(evalStr.substring(1), 10);\n\t\t\tif (mateIn > 0) return 100;\n\t\t\tif (mateIn < 0) return 0;\n\t\t\treturn 50;\n\t\t}\n\n\t\tconst evalNum = parseFloat(evalStr);\n\t\tif (Number.isNaN(evalNum)) return 50;\n\n\t\tconst maxEval = 5.0;\n\t\tconst clampedEval = Math.max(-maxEval, Math.min(maxEval, evalNum));\n\t\tconst percentage = 50 + (clampedEval / maxEval) * 50;\n\t\treturn percentage;\n\t});\n\n\t/** Active side to move: `'w'` or `'b'` parsed from the current FEN. */\n\tactiveColor = computed(() => {\n\t\tconst fen = this.currentFen();\n\t\tconst parts = fen.split(' ');\n\t\treturn parts.length > 1 ? parts[1] : 'w';\n\t});\n\n\t// ---- Lichess Database Date Picker State ----\n\n\t/** Selected year for Lichess database queries (two-way bound via `model`). */\n\tlichessYear = model<number>(new Date().getFullYear());\n\t/** Selected month (1–12) for Lichess database queries (two-way bound via `model`). */\n\tlichessMonth = model<number>(1);\n\n\t// ---- Internal Objects ----\n\n\t/** chess.js instance used for move validation and board state management. */\n\tprivate chess = new Chess();\n\t/** Active replay timeout handles (cleared when replay stops). */\n\tprivate replayTimeouts: ReturnType<typeof setTimeout>[] = [];\n\t/** Resolve function for the replay-async Promise (called when replay completes). */\n\tprivate replayResolve: (() => void) | null = null;\n\t/** Whether a batch replay sequence across multiple games is in progress. */\n\tprivate isReplayingSequence = false;\n\n\t/**\n\t * Computed run function for the child {@link NgxChessgroundComponent}.\n\t *\n\t * Reacts to changes in FEN, filter-moves mode, and last-move squares.\n\t * In filter-moves mode the board is editable with legal-move highlighting;\n\t * otherwise it is view-only. This is the primary binding between the\n\t * PGN viewer state and the chessboard display.\n\t */\n\trunFunction = computed<(el: HTMLElement) => Api>(() => {\n\t\tconst fen = this.currentFen();\n\t\tconst isEditable = this.filterMoves();\n\t\tconst lastMove = this.lastMoveSquares();\n\t\treturn (el: HTMLElement) => {\n\t\t\treturn Chessground(el, {\n\t\t\t\tfen: fen,\n\t\t\t\tviewOnly: !isEditable,\n\t\t\t\tlastMove: lastMove,\n\t\t\t\tmovable: {\n\t\t\t\t\tfree: false,\n\t\t\t\t\tcolor: isEditable ? 'both' : undefined,\n\t\t\t\t\tdests: isEditable ? this.getMovableDests() : undefined,\n\t\t\t\t\tevents: {\n\t\t\t\t\t\tafter: (orig, dest) => {\n\t\t\t\t\t\t\tif (isEditable) {\n\t\t\t\t\t\t\t\tthis.handleBoardMove(orig, dest);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\t\t};\n\t});\n\n\t/**\n\t * Computes legal move destinations for the current chess.js position.\n\t *\n\t * Returns a `Map<fromSquare, toSquare[]>` suitable for chessground's\n\t * `movable.dests` configuration in interactive filter-moves mode.\n\t *\n\t * @returns Map of legal destination squares keyed by origin square.\n\t */\n\tprivate getMovableDests(): Map<Key, Key[]> {\n\t\tconst dests = new Map<Key, Key[]>();\n\t\tconst moves = this.chess.moves({ verbose: true });\n\n\t\tfor (const move of moves) {\n\t\t\tconst from = move.from as Key;\n\t\t\tif (!dests.has(from)) {\n\t\t\t\tdests.set(from, []);\n\t\t\t}\n\t\t\tconst destArray = dests.get(from);\n\t\t\tif (destArray) {\n\t\t\t\tdestArray.push(move.to as Key);\n\t\t\t}\n\t\t}\n\n\t\treturn dests;\n\t}\n\n\t/**\n\t * Processes a move made by the user on the interactive board during filter-moves mode.\n\t *\n\t * If the move is legal, it's appended to {@link interactiveMoves} and the\n\t * board is updated via chess.js. The move is added to {@link activeFilterMoves}\n\t * if it belongs to the opening line being filtered.\n\t *\n\t * @param orig — Origin square (e.g. `\"e2\"`).\n\t * @param dest — Destination square (e.g. `\"e4\"`).\n\t */\n\tprivate handleBoardMove(orig: string, dest: string) {\n\t\ttry {\n\t\t\t// Try to make the move\n\t\t\tconst move = this.chess.move({ from: orig, to: dest });\n\n\t\t\tif (move) {\n\t\t\t\t// Update the current FEN to reflect the new position\n\t\t\t\tthis.currentFen.set(this.chess.fen());\n\n\t\t\t\t// Track the move in SAN notation for filtering\n\t\t\t\tthis.interactiveMoves.update((moves) => [...moves, move.san]);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error('Invalid move:', e);\n\t\t\t// Reset to current position if move was invalid\n\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the PGN viewer engine workers and sets up reactive effects.\n\t *\n\t * Three effects are registered:\n\t * 1. Auto-updates the Lichess URL when year/month selection changes.\n\t * 2. Loads the initial PGN from the bound input when provided.\n\t * 3. Auto-scrolls the move list when the current move index changes.\n\t */\n\tconstructor() {\n\t\tthis.pgnViewerEngine.initialize({\n\t\t\tonPgnMessage: (data) => this.handleWorkerMessage(data),\n\t\t\tonStockfishMessage: (event) => this.handleStockfishMessage(event),\n\t\t\tonError: (message, error) => console.error(message, error),\n\t\t});\n\n\t\t// Initialize Lichess database date picker with previous month\n\t\tconst now = new Date();\n\t\tconst prevMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);\n\t\tconst year = prevMonth.getFullYear();\n\t\tconst month = prevMonth.getMonth() + 1; // getMonth() is 0-indexed, we want 1-indexed\n\n\t\t// Set initial values using update\n\t\tthis.lichessYear.update(() => year);\n\t\tthis.lichessMonth.update(() => month);\n\n\t\t// Effect to update URL when date selection changes\n\t\teffect(\n\t\t\t() => {\n\t\t\t\tconst year = this.lichessYear();\n\t\t\t\tconst month = this.lichessMonth();\n\t\t\t\tif (year && month) {\n\t\t\t\t\tconst monthStr = month.toString().padStart(2, '0');\n\t\t\t\t\t// Use relative path so it respects the base href\n\t\t\t\t\tthis.urlInput.set(\n\t\t\t\t\t\t`lichess/broadcast/lichess_db_broadcast_${year}-${monthStr}.pgn.zst`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ allowSignalWrites: true },\n\t\t);\n\n\t\t// Effect to load initial PGN if provided\n\t\teffect(() => {\n\t\t\tconst pgn = this.pgn();\n\t\t\tif (pgn) {\n\t\t\t\tthis.loadPgnString(pgn);\n\t\t\t\t// Loading is now async via worker, so we don't loadGame(0) here immediately\n\t\t\t\t// It will be handled in handleWorkerMessage\n\t\t\t}\n\t\t});\n\n\t\t// Effect to auto-scroll move list when currentMoveIndex changes\n\t\teffect(() => {\n\t\t\tthis.currentMoveIndex(); // Depend on currentMoveIndex\n\t\t\tthis.setDeferredTimeout(() => {\n\t\t\t\tthis.scrollToActiveMove();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Cleans up replay timeouts, workers, and all pending deferred timeouts.\n\t *\n\t * Called automatically by Angular when the component is destroyed.\n\t */\n\tngOnDestroy(): void {\n\t\tthis.stopReplay();\n\t\tthis.pgnViewerEngine.dispose();\n\n\t\tfor (const timeoutId of this.pendingTimeouts) {\n\t\t\tclearTimeout(timeoutId);\n\t\t}\n\t\tthis.pendingTimeouts.clear();\n\t}\n\n\t/**\n\t * Updates the Stockfish search depth from an input event.\n\t *\n\t * @param event — Input event from the depth slider/number input.\n\t */\n\tonStockfishDepthChange(event: Event) {\n\t\tconst value = Number((event.target as HTMLInputElement).value);\n\t\tthis.stockfishDepth.set(Number.isFinite(value) ? value : 1);\n\t}\n\n\t/**\n\t * Creates a tracked `setTimeout` that is automatically cancelled on destroy.\n\t *\n\t * All timeout handles are stored in {@link pendingTimeouts} and cleared\n\t * in {@link ngOnDestroy} to prevent memory leaks.\n\t *\n\t * @param callback — Function to execute after the delay.\n\t * @param delay — Delay in milliseconds (default 0).\n\t * @returns The timeout handle.\n\t */\n\tprivate setDeferredTimeout(\n\t\tcallback: () => void,\n\t\tdelay = 0,\n\t): ReturnType<typeof setTimeout> {\n\t\tconst timeoutId = setTimeout(() => {\n\t\t\tthis.pendingTimeouts.delete(timeoutId);\n\t\t\tcallback();\n\t\t}, delay);\n\n\t\tthis.pendingTimeouts.add(timeoutId);\n\t\treturn timeoutId;\n\t}\n\n\t/**\n\t * Shows a Material snackbar notification to the user.\n\t *\n\t * @param message — Text to display in the snackbar.\n\t * @param duration — Auto-dismiss duration in milliseconds (default 4000).\n\t */\n\tprivate showMessage(message: string, duration = 4000): void {\n\t\tthis.snackBar.open(message, 'Dismiss', {\n\t\t\tduration,\n\t\t\thorizontalPosition: 'end',\n\t\t\tverticalPosition: 'top',\n\t\t});\n\t}\n\n\t/**\n\t * Routes PGN processor worker responses to the appropriate handler logic.\n\t *\n\t * Handles `'load'` (populate metadata, unique players, ECO codes),\n\t * `'filter'` (update filtered indices, auto-select game),\n\t * `'loadGame'` (display moves, evaluations, clocks), and `'error'` messages.\n\t *\n\t * @param data — Response from the PGN processor worker.\n\t */\n\tprivate handleWorkerMessage(data: WorkerResponse) {\n\t\tconst { type, payload, id } = data;\n\t\tif (type === 'load') {\n\t\t\tthis.gamesMetadata.set(payload.metadata);\n\t\t\tthis.isLoading.set(false);\n\n\t\t\t// Populate unique players with ELO sorting\n\t\t\tconst whitePlayerElos = new Map<string, number>();\n\t\t\tconst blackPlayerElos = new Map<string, number>();\n\t\t\tconst ecoCodes = new Map<string, number>();\n\n\t\t\tfor (const meta of payload.metadata) {\n\t\t\t\tif (\n\t\t\t\t\tmeta.white &&\n\t\t\t\t\tmeta.white !== 'Unknown' &&\n\t\t\t\t\t!meta.white.startsWith('BOT ')\n\t\t\t\t) {\n\t\t\t\t\tconst currentMax = whitePlayerElos.get(meta.white) || 0;\n\t\t\t\t\twhitePlayerElos.set(\n\t\t\t\t\t\tmeta.white,\n\t\t\t\t\t\tMath.max(currentMax, meta.whiteElo || 0),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tmeta.black &&\n\t\t\t\t\tmeta.black !== 'Unknown' &&\n\t\t\t\t\t!meta.black.startsWith('BOT ')\n\t\t\t\t) {\n\t\t\t\t\tconst currentMax = blackPlayerElos.get(meta.black) || 0;\n\t\t\t\t\tblackPlayerElos.set(\n\t\t\t\t\t\tmeta.black,\n\t\t\t\t\t\tMath.max(currentMax, meta.blackElo || 0),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Exclude ECO codes with '?' as they are likely non-standard games\n\t\t\t\tif (meta.eco && !meta.eco.includes('?')) {\n\t\t\t\t\tecoCodes.set(meta.eco, (ecoCodes.get(meta.eco) || 0) + 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Count Time Controls (normalized with originals mapping)\n\t\t\tconst timeControls = new Map<\n\t\t\t\tstring,\n\t\t\t\t{ count: number; originals: Map<string, number> }\n\t\t\t>();\n\t\t\tconst events = new Map<string, number>();\n\t\t\tfor (const meta of payload.metadata) {\n\t\t\t\tconst normalized = meta.timeControlNormalized;\n\t\t\t\tconst original = meta.timeControl?.trim();\n\t\t\t\tif (normalized) {\n\t\t\t\t\tconst existing = timeControls.get(normalized) || {\n\t\t\t\t\t\tcount: 0,\n\t\t\t\t\t\toriginals: new Map<string, number>(),\n\t\t\t\t\t};\n\t\t\t\t\texisting.count += 1;\n\t\t\t\t\tif (original) {\n\t\t\t\t\t\texisting.originals.set(\n\t\t\t\t\t\t\toriginal,\n\t\t\t\t\t\t\t(existing.originals.get(original) || 0) + 1,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\ttimeControls.set(normalized, existing);\n\t\t\t\t}\n\t\t\t\tif (meta.event && !meta.event.includes('?')) {\n\t\t\t\t\tevents.set(meta.event, (events.get(meta.event) || 0) + 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Sort players by ELO descending\n\t\t\tconst sortedWhitePlayers = Array.from(whitePlayerElos.entries())\n\t\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t\t.map(([name]) => name);\n\n\t\t\tconst sortedBlackPlayers = Array.from(blackPlayerElos.entries())\n\t\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t\t.map(([name]) => name);\n\n\t\t\tthis.uniqueWhitePlayers.set(sortedWhitePlayers);\n\t\t\tthis.uniqueBlackPlayers.set(sortedBlackPlayers);\n\t\t\tthis.uniqueEcoCodes.set(ecoCodes);\n\t\t\tthis.uniqueTimeControls.set(timeControls);\n\t\t\tthis.uniqueEvents.set(events);\n\n\t\t\t// Auto-select first game if available\n\t\t\tif (payload.count > 0) {\n\t\t\t\tthis.loadGame(0);\n\t\t\t}\n\n\t\t\t// Clear filters\n\t\t\tthis.clearFilters();\n\t\t} else if (type === 'filter') {\n\t\t\tif (id === this.currentFilterId) {\n\t\t\t\tthis.filteredGamesIndices.set(payload);\n\t\t\t\tthis.isFiltering.set(false);\n\t\t\t\tif (this.autoSelectOnFinish) {\n\t\t\t\t\tthis.selectAllGames();\n\t\t\t\t\tthis.autoSelectOnFinish = false;\n\t\t\t\t}\n\n\t\t\t\t// Load first game from filtered results\n\t\t\t\tif (payload.length > 0) {\n\t\t\t\t\tthis.loadGame(payload[0]);\n\t\t\t\t}\n\n\t\t\t\t// Uncheck filterMoves after filtering completes if flag is set\n\t\t\t\tif (this.shouldUncheckFilterMoves) {\n\t\t\t\t\tthis.filterMoves.set(false);\n\t\t\t\t\tthis.shouldUncheckFilterMoves = false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (type === 'loadGame') {\n\t\t\tconst { moves, pgn, evaluations, error } = payload;\n\n\t\t\tif (error) {\n\t\t\t\tconsole.error('Worker failed to parse game:', error);\n\t\t\t\tthis.pgnInput.set(\n\t\t\t\t\t`Error parsing game: ${error} \\n\\nRaw PGN: \\n${pgn} `,\n\t\t\t\t);\n\t\t\t\tthis.moves.set([]);\n\t\t\t\tthis.evaluations.set([]);\n\t\t\t} else {\n\t\t\t\tthis.moves.set(moves);\n\t\t\t\tthis.evaluations.set(evaluations || []);\n\t\t\t\tthis.chess.reset();\n\t\t\t\tthis.currentMoveIndex.set(-1);\n\t\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t\t\tthis.stopReplay();\n\t\t\t\tthis.pgnInput.set(pgn);\n\n\t\t\t\t// If filtering by moves is active, jump to the filtered position\n\t\t\t\tif (this.filterMoves() && this.activeFilterMoves.length > 0) {\n\t\t\t\t\tif (moves.length >= this.activeFilterMoves.length) {\n\t\t\t\t\t\tthis.jumpToMove(this.activeFilterMoves.length - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.isLoading.set(false);\n\t\t} else if (type === 'error') {\n\t\t\tconsole.error('Worker error:', payload);\n\t\t\tthis.isLoading.set(false);\n\t\t}\n\t}\n\n\t/**\n\t * Formats a normalized time control key for display.\n\t *\n\t * Converts `\"seconds+increment\"` (e.g. `\"5400+30\"`) to a human-readable\n\t * form using minutes when divisible by 60 and ≤ 180 (e.g. `\"90+30\"`).\n\t *\n\t * @param key — Normalized time control string like `\"5400+30\"`.\n\t * @returns Display-friendly time control string.\n\t */\n\tprivate formatTimeControlKey(key: string): string {\n\t\tconst match = key.match(/^(\\d+)\\+(\\d+)$/);\n\t\tif (!match) return key;\n\t\tconst baseSeconds = parseInt(match[1], 10);\n\t\tconst incrementSeconds = parseInt(match[2], 10);\n\t\tif (Number.isNaN(baseSeconds) || Number.isNaN(incrementSeconds)) {\n\t\t\treturn key;\n\t\t}\n\t\tif (baseSeconds % 60 === 0) {\n\t\t\tconst baseMinutes = baseSeconds / 60;\n\t\t\tif (baseMinutes <= 180) {\n\t\t\t\treturn `${baseMinutes}+${incrementSeconds}`;\n\t\t\t}\n\t\t}\n\t\treturn `${baseSeconds}+${incrementSeconds}`;\n\t}\n\n\t/**\n\t * Builds a summary string of the most common original time control formats.\n\t *\n\t * @param originals — Map of original format strings to occurrence counts.\n\t * @param maxItems — Maximum number of entries to include (default 6).\n\t * @returns Summary string like `\"Originals: 90+30 (500), 180+2 (300) +3 more\"`.\n\t */\n\tprivate formatOriginalsSummary(\n\t\toriginals: Map<string, number>,\n\t\tmaxItems = 6,\n\t): string {\n\t\tconst entries = Array.from(originals.entries()).sort((a, b) => b[1] - a[1]);\n\t\tconst head = entries\n\t\t\t.slice(0, maxItems)\n\t\t\t.map(([value, count]) => `${value} (${count})`)\n\t\t\t.join(', ');\n\t\tconst rest =\n\t\t\tentries.length > maxItems ? ` +${entries.length - maxItems} more` : '';\n\t\treturn head ? `Originals: ${head}${rest}` : '';\n\t}\n\n\t/**\n\t * Applies the current filter criteria and re-runs game filtering.\n\t *\n\t * Stops any in-progress replay and delegates to {@link runFilterLogic}\n\t * with the values from the filter signal state. Auto-selects the first\n\t * matching game when filtering completes.\n\t */\n\tapplyFilter() {\n\t\t// Stop any ongoing replay when filter is applied\n\t\tthis.stopReplay();\n\t\tthis.isReplayingSequence = false;\n\n\t\t// const games = this.games(); // REMOVED\n\t\tconst fWhite = this.filterWhite();\n\t\tconst fBlack = this.filterBlack();\n\t\tconst fResult = this.filterResult().join(',');\n\t\tconst fMoves = this.filterMoves();\n\t\tconst fIgnoreColor = this.ignoreColor();\n\t\tconst fRatingEnabled = this.filterRatingEnabled();\n\t\tconst fWhiteRating = fRatingEnabled\n\t\t\t? parseInt(this.filterWhiteRating(), 10) || 0\n\t\t\t: 0;\n\t\tconst fBlackRating = fRatingEnabled\n\t\t\t? parseInt(this.filterBlackRating(), 10) || 0\n\t\t\t: 0;\n\t\tconst fWhiteRatingMax = fRatingEnabled\n\t\t\t? parseInt(this.filterWhiteRatingMax(), 10) || 0\n\t\t\t: 0;\n\t\tconst fBlackRatingMax = fRatingEnabled\n\t\t\t? parseInt(this.filterBlackRatingMax(), 10) || 0\n\t\t\t: 0;\n\t\tconst fEco = this.filterEco();\n\t\tconst fTimeControl = this.filterTimeControl();\n\t\tconst fEvent = this.filterEvent();\n\n\t\t// Use interactive moves if filtering by moves, otherwise use current game moves\n\t\tconst currentMoves = fMoves\n\t\t\t? this.interactiveMoves()\n\t\t\t: this.moves().slice(0, this.currentMoveIndex() + 1);\n\t\tthis.activeFilterMoves = currentMoves;\n\n\t\tthis.autoSelectOnFinish = true;\n\t\tthis.runFilterLogic(\n\t\t\tfWhite,\n\t\t\tfBlack,\n\t\t\tfResult,\n\t\t\tfMoves,\n\t\t\tfIgnoreColor,\n\t\t\tfWhiteRating,\n\t\t\tfBlackRating,\n\t\t\tfWhiteRatingMax,\n\t\t\tfBlackRatingMax,\n\t\t\tfEco,\n\t\t\tfTimeControl,\n\t\t\tfEvent,\n\t\t\tcurrentMoves,\n\t\t);\n\n\t\t// Set flag to uncheck \"Filter by Starting Moves\" after filtering completes\n\t\tif (fMoves) {\n\t\t\tthis.shouldUncheckFilterMoves = true;\n\t\t}\n\t}\n\n\t/**\n\t * Resets all filter fields to their default values and stops any in-progress replay.\n\t *\n\t * If the filter-moves mode was active, it's exited and the saved position is restored.\n\t */\n\tclearFilters() {\n\t\t// Stop any ongoing replay\n\t\tthis.stopReplay();\n\t\tthis.isReplayingSequence = false;\n\t\tthis.showBetterMoveBtn.set(false);\n\t\tthis.analysisVisible.set(false);\n\t\tconst hadFilterMoves = this.filterMoves();\n\n\t\t// Clear all filter fields\n\t\tthis.filterWhite.set('');\n\t\tthis.filterBlack.set('');\n\t\tthis.filterResult.set([]);\n\t\tthis.filterMoves.set(false);\n\t\tthis.ignoreColor.set(false);\n\t\tthis.filterRatingEnabled.set(false);\n\t\tthis.filterWhiteRating.set('2000');\n\t\tthis.filterBlackRating.set('2000');\n\t\tthis.filterWhiteRatingMax.set('4000');\n\t\tthis.filterBlackRatingMax.set('4000');\n\t\tthis.filterEco.set('');\n\t\tthis.filterTimeControl.set('');\n\t\tthis.filterEvent.set('');\n\t\tthis.autoSelectOnFinish = true; // Explicitly ensure auto-select\n\t\tthis.interactiveMoves.set([]);\n\t\tthis.activeFilterMoves = [];\n\t\tif (hadFilterMoves && this.savedGameMoveIndex !== null) {\n\t\t\tthis.jumpToMove(this.savedGameMoveIndex);\n\t\t\tthis.savedGameMoveIndex = null;\n\t\t}\n\n\t\t// Apply filter to reset view\n\t\tthis.applyFilter();\n\t}\n\n\t/**\n\t * Sends filter criteria to the PGN processor worker and tracks the request.\n\t *\n\t * Increments a monotonic filter ID to detect stale responses.\n\t * Called by {@link applyFilter} after collecting current signal values.\n\t *\n\t * @param fWhite — White player filter text.\n\t * @param fBlack — Black player filter text.\n\t * @param fResult — Comma-separated result filter string.\n\t * @param fMoves — Whether opening-move filtering is enabled.\n\t * @param fIgnoreColor — Whether to swap white/black matching.\n\t * @param fWhiteRating — Minimum white Elo.\n\t * @param fBlackRating — Minimum black Elo.\n\t * @param fWhiteRatingMax — Maximum white Elo.\n\t * @param fBlackRatingMax — Maximum black Elo.\n\t * @param fEco — ECO code filter.\n\t * @param fTimeControl — Time control filter.\n\t * @param fEvent — Event name filter.\n\t * @param targetMoves — SAN move sequence to match.\n\t */\n\tprivate runFilterLogic(\n\t\tfWhite: string,\n\t\tfBlack: string,\n\t\tfResult: string,\n\t\tfMoves: boolean,\n\t\tfIgnoreColor: boolean,\n\t\tfWhiteRating: number,\n\t\tfBlackRating: number,\n\t\tfWhiteRatingMax: number,\n\t\tfBlackRatingMax: number,\n\t\tfEco: string,\n\t\tfTimeControl: string,\n\t\tfEvent: string,\n\t\ttargetMoves: string[],\n\t) {\n\t\tthis.currentFilterId++;\n\t\tconst myFilterId = this.currentFilterId;\n\t\tthis.isFiltering.set(true);\n\n\t\tconst filterCriteria: FilterCriteria = {\n\t\t\twhite: fWhite,\n\t\t\tblack: fBlack,\n\t\t\tresult: fResult,\n\t\t\tmoves: fMoves,\n\t\t\tignoreColor: fIgnoreColor,\n\t\t\tminWhiteRating: fWhiteRating,\n\t\t\tminBlackRating: fBlackRating,\n\t\t\tmaxWhiteRating: fWhiteRatingMax,\n\t\t\tmaxBlackRating: fBlackRatingMax,\n\t\t\teco: fEco,\n\t\t\ttimeControl: fTimeControl,\n\t\t\tevent: fEvent,\n\t\t\ttargetMoves: targetMoves,\n\t\t};\n\n\t\tthis.pgnViewerEngine.filterGames(filterCriteria, myFilterId);\n\t}\n\n\t// --- PGN Loading Logic ---\n\n\t/**\n\t * Loads a raw PGN string into the viewer, resetting current game state.\n\t *\n\t * Delegates to {@link PgnViewerEngineService.loadPgn} for background parsing.\n\t * The worker response (via {@link handleWorkerMessage}) populates metadata\n\t * and triggers the first game load.\n\t *\n\t * @param pgn — Raw PGN text (supports multi-game, compressed formats).\n\t */\n\tloadPgnString(pgn: string) {\n\t\t// Reset state to ensure UI updates\n\t\tthis.moves.set([]);\n\t\tthis.interactiveMoves.set([]);\n\t\tthis.currentMoveIndex.set(-1);\n\t\tthis.currentGameIndex.set(-1); // Force change detection when setting to 0 later\n\t\tthis.currentFen.set(\n\t\t\t'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',\n\t\t);\n\n\t\tthis.pgnViewerEngine.loadPgn(pgn, Date.now());\n\t}\n\n\t/**\n\t * Reads PGN text from the system clipboard and loads it into the viewer.\n\t *\n\t * Uses the Clipboard API. On failure, shows an error snackbar.\n\t */\n\tasync loadFromClipboard() {\n\t\ttry {\n\t\t\tconst text = await navigator.clipboard.readText();\n\t\t\tif (text) {\n\t\t\t\tthis.pgnInput.set(text);\n\t\t\t\tthis.loadPgnString(text);\n\t\t\t\tthis.loadGame(0);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error('Failed to read clipboard contents: ', err);\n\t\t\tthis.showMessage('Failed to read clipboard.', 5000);\n\t\t}\n\t}\n\n\t/**\n\t * Copies the current PGN text to the system clipboard.\n\t *\n\t * Uses the Clipboard API. On failure, shows an error snackbar.\n\t */\n\tasync copyToClipboard() {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(this.pgnInput());\n\t\t\t// Optional: You could add a temporary \"Copied!\" state here if desired\n\t\t} catch (err) {\n\t\t\tconsole.error('Failed to copy to clipboard: ', err);\n\t\t\tthis.showMessage('Failed to copy to clipboard.', 5000);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the proportional replay duration from an input event.\n\t *\n\t * @param event — Change event from the proportional duration input.\n\t */\n\tonProportionalDurationChange(event: Event) {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.proportionalDuration.set(parseFloat(value) || 1);\n\t}\n\n\t/**\n\t * Updates the minimum-seconds-between-moves setting from an input event.\n\t *\n\t * @param event — Change event from the minimum seconds input.\n\t */\n\tonMinSecondsBetweenMovesChange(event: Event) {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.minSecondsBetweenMoves.set(parseFloat(value) || 0.1);\n\t}\n\n\t/**\n\t * Updates the fixed-time replay setting from an input event.\n\t *\n\t * @param event — Change event from the fixed time input.\n\t */\n\tonFixedTimeChange(event: Event) {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.fixedTime.set(parseFloat(value) || 1);\n\t}\n\n\t/**\n\t * Updates the PGN input text from a textarea change event.\n\t *\n\t * @param event — Change event from the PGN textarea input.\n\t */\n\tonPgnInputChange(event: Event) {\n\t\tconst value = (event.target as HTMLTextAreaElement).value;\n\t\tthis.pgnInput.set(value);\n\t}\n\n\t/**\n\t * Updates the URL input from a text input change event.\n\t *\n\t * @param event — Change event from the URL text input.\n\t */\n\tonUrlInputChange(event: Event) {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.urlInput.set(value);\n\t}\n\n\t/**\n\t * Updates the event filter from a select element change event.\n\t *\n\t * @param event — Change event from the event filter `<select>` element.\n\t */\n\tupdateFilterEvent(event: Event) {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tthis.filterEvent.set(value);\n\t}\n\n\t/**\n\t * Returns the list of years available in the Lichess database picker.\n\t *\n\t * Years range from 2020 to the current year.\n\t *\n\t * @returns Array of available year numbers.\n\t */\n\tgetLichessYears(): number[] {\n\t\tconst currentYear = new Date().getFullYear();\n\t\tconst years: number[] = [];\n\t\tfor (let year = 2020; year <= currentYear; year++) {\n\t\t\tyears.push(year);\n\t\t}\n\t\treturn years;\n\t}\n\n\t/**\n\t * Returns the list of months available for the currently selected Lichess year.\n\t *\n\t * For past years, all 12 months are available. For the current year,\n\t * only months up to (current month - 1) are available.\n\t *\n\t * @returns Array of available month numbers (1–12).\n\t */\n\tgetLichessMonths(): number[] {\n\t\tconst selectedYear = this.lichessYear();\n\t\tconst now = new Date();\n\t\tconst currentYear = now.getFullYear();\n\t\tconst currentMonth = now.getMonth(); // 0-indexed\n\n\t\tif (selectedYear < currentYear) {\n\t\t\t// For past years, all 12 months are available\n\t\t\treturn [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\t\t} else if (selectedYear === currentYear) {\n\t\t\t// For current year, only up to current month - 1\n\t\t\tconst maxMonth = currentMonth; // currentMonth is already 0-indexed, so this gives us current month - 1 in 1-indexed\n\t\t\tconst months: number[] = [];\n\t\t\tfor (let m = 1; m <= maxMonth; m++) {\n\t\t\t\tmonths.push(m);\n\t\t\t}\n\t\t\treturn months;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Updates the Lichess year selection and adjusts the month if needed.\n\t *\n\t * If the currently selected month is not available for the new year,\n\t * it falls back to the last available month.\n\t *\n\t * @param event — Change event from the year `<select>` element.\n\t */\n\tonLichessYearChange(event: Event) {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tconst year = parseInt(value, 10);\n\t\tthis.lichessYear.set(year);\n\n\t\t// Adjust month if current selection is invalid for new year\n\t\tconst availableMonths = this.getLichessMonths();\n\t\tif (!availableMonths.includes(this.lichessMonth())) {\n\t\t\tthis.lichessMonth.set(availableMonths[availableMonths.length - 1] || 1);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the Lichess month selection from a select element change event.\n\t *\n\t * @param event — Change event from the month `<select>` element.\n\t */\n\tonLichessMonthChange(event: Event) {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tconst month = parseInt(value, 10);\n\t\tthis.lichessMonth.set(month);\n\t}\n\n\t/**\n\t * Loads a PGN file from the Lichess broadcast database.\n\t *\n\t * Constructs the URL from the selected year and month\n\t * (`lichess_db_broadcast_YYYY-MM.pgn.zst`) and delegates to {@link loadFromUrl}.\n\t */\n\tloadFromLichess() {\n\t\tconst year = this.lichessYear();\n\t\tconst month = this.lichessMonth();\n\n\t\tif (!year || !month) {\n\t\t\tthis.showMessage('Please select a valid year and month.');\n\t\t\treturn;\n\t\t}\n\n\t\t// Format: lichess_db_broadcast_YYYY-MM.pgn.zst\n\t\tconst monthStr = month.toString().padStart(2, '0');\n\t\t// Use relative path so it respects the base href (e.g. /ngx-chessground/ on GitHub Pages)\n\t\tconst url = `lichess/broadcast/lichess_db_broadcast_${year}-${monthStr}.pgn.zst`;\n\n\t\tthis.urlInput.set(url);\n\t\tthis.loadFromUrl();\n\t}\n\n\t/**\n\t * Fetches a PGN file from the URL in {@link urlInput} and loads it into the viewer.\n\t *\n\t * Supports plain `.pgn`, gzip-compressed `.pgn.gz`, and zstd-compressed `.pgn.zst`.\n\t * Shows a progress bar during download and delegates decompression/parsing.\n\t */\n\tasync loadFromUrl() {\n\t\tconst url = this.urlInput();\n\t\tif (!url) return;\n\n\t\tthis.isLoading.set(true);\n\t\tthis.loadingProgress.set(0);\n\t\tthis.loadingStatus.set('Starting download...');\n\n\t\ttry {\n\t\t\tconst response = await fetch(url);\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new Error(`HTTP error! status: ${response.status} `);\n\t\t\t}\n\n\t\t\tconst contentLength = response.headers.get('content-length');\n\t\t\tconst total = contentLength ? parseInt(contentLength, 10) : 0;\n\n\t\t\tif (!response.body) {\n\t\t\t\tthrow new Error('Response body is null');\n\t\t\t}\n\n\t\t\tconst reader = response.body.getReader();\n\t\t\tconst chunks: Uint8Array[] = [];\n\t\t\tlet receivedLength = 0;\n\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\n\t\t\t\tif (done) break;\n\n\t\t\t\tchunks.push(value);\n\t\t\t\treceivedLength += value.length;\n\n\t\t\t\tif (total > 0) {\n\t\t\t\t\tconst progress = Math.round((receivedLength / total) * 100);\n\t\t\t\t\tthis.loadingProgress.set(progress);\n\t\t\t\t\tthis.loadingStatus.set(\n\t\t\t\t\t\t`Downloading: ${(receivedLength / 1024 / 1024).toFixed(2)} MB / ${(total / 1024 / 1024).toFixed(2)} MB`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.loadingStatus.set(\n\t\t\t\t\t\t`Downloading: ${(receivedLength / 1024 / 1024).toFixed(2)} MB`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Combine chunks into single array\n\t\t\tconst buffer = new Uint8Array(receivedLength);\n\t\t\tlet position = 0;\n\t\t\tfor (const chunk of chunks) {\n\t\t\t\tbuffer.set(chunk, position);\n\t\t\t\tposition += chunk.length;\n\t\t\t}\n\n\t\t\tthis.loadingStatus.set('Decompressing...');\n\t\t\tlet content: string;\n\n\t\t\t// Check for ZST magic bytes (0xFD2FB528) or extension\n\t\t\tconst isZst = url.toLowerCase().endsWith('.zst');\n\n\t\t\tif (isZst) {\n\t\t\t\tconst decompressed = decompressZst(buffer);\n\t\t\t\tcontent = new TextDecoder().decode(decompressed);\n\t\t\t} else {\n\t\t\t\tcontent = new TextDecoder().decode(buffer);\n\t\t\t}\n\n\t\t\tthis.loadingStatus.set('Processing games...');\n\t\t\tthis.setDeferredTimeout(() => {\n\t\t\t\tthis.loadPgnString(content);\n\t\t\t\tthis.loadGame(0);\n\t\t\t\tthis.isLoading.set(false);\n\t\t\t\tthis.loadingProgress.set(0);\n\t\t\t\tthis.loadingStatus.set('');\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error('Error loading from URL:', e);\n\t\t\tthis.showMessage(`Error loading from URL: ${String(e)}`, 6000);\n\t\t\tthis.isLoading.set(false);\n\t\t\tthis.loadingProgress.set(0);\n\t\t\tthis.loadingStatus.set('');\n\t\t}\n\t}\n\n\t/**\n\t * Reads a user-selected ZIP file containing PGN files and loads the first\n\t * `.pgn` entry found.\n\t *\n\t * Uses jszip to extract the archive.\n\t *\n\t * @param event — Change event from the ZIP file `<input>` element.\n\t */\n\tasync onPgnZipSelected(event: Event) {\n\t\tconst input = event.target as HTMLInputElement;\n\t\tif (!input.files || input.files.length === 0) return;\n\n\t\tconst file = input.files[0];\n\t\tthis.isLoading.set(true);\n\n\t\ttry {\n\t\t\tconst zip = await loadZipAsync(file);\n\t\t\tconst pgnFile = Object.values(zip.files).find((f) =>\n\t\t\t\tf.name.endsWith('.pgn'),\n\t\t\t);\n\n\t\t\tif (pgnFile) {\n\t\t\t\tconst content = await pgnFile.async('string');\n\t\t\t\tthis.setDeferredTimeout(() => {\n\t\t\t\t\tthis.loadPgnString(content);\n\t\t\t\t\tthis.loadGame(0);\n\t\t\t\t\tthis.isLoading.set(false);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.showMessage('No PGN file found in the zip archive.');\n\t\t\t\tthis.isLoading.set(false);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error('Error loading zip file:', e);\n\t\t\tthis.showMessage('Error loading zip file.', 5000);\n\t\t\tthis.isLoading.set(false);\n\t\t}\n\t}\n\n\t/**\n\t * Reads a user-selected PGN file from a file input and loads it into the viewer.\n\t *\n\t * Handles `.pgn` and `.pgn.gz` files via the browser's FileReader API.\n\t *\n\t * @param event — Change event from the file `<input>` element.\n\t */\n\tonPgnFileSelected(event: Event) {\n\t\tconst input = event.target as HTMLInputElement;\n\t\tif (!input.files || input.files.length === 0) return;\n\n\t\tconst file = input.files[0];\n\t\tthis.isLoading.set(true);\n\n\t\tconst reader = new FileReader();\n\t\treader.onload = (e) => {\n\t\t\tconst content = e.target?.result as string;\n\t\t\tif (content) {\n\t\t\t\tthis.setDeferredTimeout(() => {\n\t\t\t\t\tthis.loadPgnString(content);\n\t\t\t\t\tthis.loadGame(0);\n\t\t\t\t\tthis.isLoading.set(false);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.isLoading.set(false);\n\t\t\t}\n\t\t};\n\t\treader.onerror = () => {\n\t\t\tthis.isLoading.set(false);\n\t\t\tthis.showMessage('Error reading file.', 5000);\n\t\t};\n\t\treader.readAsText(file);\n\t}\n\n\t// --- Game Logic ---\n\n\t/**\n\t * Loads a specific game by its index in the parsed game list.\n\t *\n\t * Delegates parsing to the PGN processor worker. The response\n\t * (via {@link handleWorkerMessage}) updates moves, evaluations, and clocks.\n\t *\n\t * @param index — Zero-based game index.\n\t */\n\tloadGame(index: number) {\n\t\tconst count = this.gamesMetadata().length;\n\t\tif (index >= 0 && index < count) {\n\t\t\tthis.currentGameIndex.set(index);\n\t\t\tthis.moves.set([]);\n\t\t\tthis.pgnInput.set('Loading...');\n\t\t\tthis.isLoading.set(true);\n\t\t\tthis.pgnViewerEngine.loadGame(index, Date.now());\n\t\t}\n\t}\n\n\t/**\n\t * Toggles a game's selection state for batch replay operations.\n\t *\n\t * @param index — Zero-based game index to toggle.\n\t */\n\ttoggleGameSelection(index: number) {\n\t\tconst selected = new Set(this.selectedGames());\n\t\tif (selected.has(index)) {\n\t\t\tselected.delete(index);\n\t\t} else {\n\t\t\tselected.add(index);\n\t\t}\n\t\tthis.selectedGames.set(selected);\n\t}\n\n\t/** Selects all games in the current filtered list for batch replay. */\n\tselectAllGames() {\n\t\tconst indices = this.filteredGamesIndices();\n\t\tconst selected = new Set<number>();\n\t\tfor (const i of indices) {\n\t\t\tselected.add(i);\n\t\t}\n\t\tthis.selectedGames.set(selected);\n\t}\n\n\t/** Clears all game selections. */\n\tclearSelection() {\n\t\tthis.selectedGames.set(new Set());\n\t}\n\n\t/** Advances to the next game in the list, if available. */\n\tnextGame() {\n\t\tif (this.currentGameIndex() < this.gamesMetadata().length - 1) {\n\t\t\tthis.loadGame(this.currentGameIndex() + 1);\n\t\t}\n\t}\n\n\t/** Moves to the previous game in the list, if available. */\n\tprevGame() {\n\t\tif (this.currentGameIndex() > 0) {\n\t\t\tthis.loadGame(this.currentGameIndex() - 1);\n\t\t}\n\t}\n\n\t// --- Navigation Logic ---\n\n\t/**\n\t * Jumps the board to a specific move index, replaying all moves up to that point.\n\t *\n\t * `-1` resets to the starting position before any moves.\n\t *\n\t * @param index — The target move index (-1 for start position).\n\t */\n\tjumpToMove(index: number) {\n\t\tconst moves = this.moves();\n\t\tif (index >= -1 && index < moves.length) {\n\t\t\tthis.chess.reset();\n\t\t\tfor (let i = 0; i <= index; i++) {\n\t\t\t\tthis.chess.move(moves[i]);\n\t\t\t}\n\t\t\tthis.currentMoveIndex.set(index);\n\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t}\n\t}\n\n\t/** Scrolls the move list container to keep the active move visible. */\n\tprivate scrollToActiveMove() {\n\t\tconst moveList = this.moveList();\n\t\tif (!moveList) return;\n\t\tconst container = moveList.nativeElement;\n\t\tconst activeElement = container.querySelector(\n\t\t\t'.move-btn.active',\n\t\t) as HTMLElement;\n\t\tif (activeElement) {\n\t\t\tactiveElement.scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tinline: 'nearest',\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Advances to the next move in the current game.\n\t *\n\t * Updates the board, move index, and clock display.\n\t */\n\tnext() {\n\t\tconst moves = this.moves();\n\t\tconst currentIdx = this.currentMoveIndex();\n\t\tif (currentIdx < moves.length - 1) {\n\t\t\tconst nextMove = moves[currentIdx + 1];\n\t\t\tthis.chess.move(nextMove);\n\t\t\tthis.currentMoveIndex.set(currentIdx + 1);\n\t\t\tthis.currentFen.set(this.chess.fen());\n\n\t\t\tconst nextMoveIdx = currentIdx + 1;\n\t\t\tif (nextMoveIdx + 1 < this.clockHistory.length) {\n\t\t\t\tconst clocks = this.clockHistory[nextMoveIdx + 1];\n\t\t\t\tthis.whiteTimeRemaining.set(this.formatTime(clocks.white));\n\t\t\t\tthis.blackTimeRemaining.set(this.formatTime(clocks.black));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Goes back one move in the current game.\n\t *\n\t * Undoes the last move on the board and updates the clock display.\n\t */\n\tprev() {\n\t\tif (this.currentMoveIndex() >= 0) {\n\t\t\tthis.chess.undo();\n\t\t\tthis.currentMoveIndex.update((i) => i - 1);\n\t\t\tthis.currentFen.set(this.chess.fen());\n\n\t\t\tconst currentIdx = this.currentMoveIndex();\n\t\t\tif (currentIdx + 1 >= 0 && currentIdx + 1 < this.clockHistory.length) {\n\t\t\t\tconst clocks = this.clockHistory[currentIdx + 1];\n\t\t\t\tthis.whiteTimeRemaining.set(this.formatTime(clocks.white));\n\t\t\t\tthis.blackTimeRemaining.set(this.formatTime(clocks.black));\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Stops any in-progress replay sequence and cancels pending timeouts. */\n\tstopSequence() {\n\t\tthis.isReplayingSequence = false;\n\t\tthis.stopReplay();\n\t}\n\n\t/**\n\t * Toggles the rating filter enable/disable checkbox.\n\t *\n\t * @param event — Change event from the rating-filter checkbox.\n\t */\n\ttoggleFilterRatingEnabled(event: Event) {\n\t\tconst checked = (event.target as HTMLInputElement).checked;\n\t\tthis.filterRatingEnabled.set(checked);\n\t}\n\n\t/**\n\t * Applies a rating preset (e.g. \"2000+\", \"2500+\", \"3000+\") from a dropdown.\n\t *\n\t * Sets the minimum rating to the selected value and the maximum to 3000\n\t * (or 4000 for the \"3000+\" tier).\n\t *\n\t * @param event — Change event from the rating preset `<select>` element.\n\t */\n\tapplyRatingPreset(event: Event) {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tif (!value) return;\n\n\t\tconst min = value;\n\t\tconst max = value === '3000' ? '4000' : '3000';\n\n\t\tthis.filterRatingEnabled.set(true);\n\t\tthis.filterWhiteRating.set(min);\n\t\tthis.filterBlackRating.set(min);\n\t\tthis.filterWhiteRatingMax.set(max);\n\t\tthis.filterBlackRatingMax.set(max);\n\t}\n\n\t/**\n\t * Toggles the \"stop on error\" replay option.\n\t *\n\t * @param event — Change event from the stop-on-error checkbox.\n\t */\n\ttoggleStopOnError(event: Event) {\n\t\tconst checked = (event.target as HTMLInputElement).checked;\n\t\tthis.stopOnError.set(checked);\n\t}\n\n\t/**\n\t * Updates the stop-on-error evaluation threshold from an input event.\n\t *\n\t * @param event — Input event from the threshold number field.\n\t */\n\tupdateStopOnErrorThreshold(event: Event) {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.stopOnErrorThreshold.set(parseFloat(value) || 1.0);\n\t}\n\n\t/**\n\t * Resets the board to the starting position (before any moves).\n\t *\n\t * Also restores initial clock times if clock history data is available.\n\t */\n\tstart() {\n\t\tthis.chess.reset();\n\t\tthis.currentMoveIndex.set(-1);\n\t\tthis.currentFen.set(this.chess.fen());\n\n\t\tif (this.clockHistory.length > 0) {\n\t\t\tconst startClocks = this.clockHistory[0];\n\t\t\tif (startClocks) {\n\t\t\t\tthis.whiteTimeRemaining.set(this.formatTime(startClocks.white));\n\t\t\t\tthis.blackTimeRemaining.set(this.formatTime(startClocks.black));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Jumps to the final position of the current game.\n\t *\n\t * Replays all moves from the start to reach the end-of-game position.\n\t */\n\tend() {\n\t\tthis.chess.reset();\n\t\tconst moves = this.moves();\n\t\tfor (const move of moves) {\n\t\t\tthis.chess.move(move);\n\t\t}\n\t\tthis.currentMoveIndex.set(moves.length - 1);\n\t\tthis.currentFen.set(this.chess.fen());\n\t}\n\n\t// --- Replay Logic ---\n\n\t/**\n\t * Starts an auto-replay of the current game from the beginning.\n\t *\n\t * Stops any in-progress replay, resets to the start position,\n\t * then runs the replay logic with timing based on the selected mode.\n\t */\n\treplayGame() {\n\t\tthis.stopReplay();\n\t\tthis.start();\n\t\tthis.runReplayLogic();\n\t}\n\n\t/**\n\t * Continues an auto-replay from the current move position.\n\t *\n\t * Preserves the replay Promise (doesn't resolve it prematurely)\n\t * so batch replay sequences can resume from where they left off.\n\t */\n\tcontinueReplay() {\n\t\tthis.stopReplay(false);\n\t\tthis.runReplayLogic();\n\t}\n\n\t/**\n\t * Executes the replay logic for the currently loaded game.\n\t *\n\t * Parses the game PGN, calculates move timing based on the selected\n\t * {@link replayMode}, and schedules the replay via {@link scheduleReplay}.\n\t */\n\tprivate runReplayLogic() {\n\t\t// Use the currently loaded PGN from the input area\n\t\tconst gamePgn = this.pgnInput();\n\t\tconst onComplete = this.replayResolve\n\t\t\t? () => {\n\t\t\t\t\tif (this.replayResolve) {\n\t\t\t\t\t\tthis.replayResolve();\n\t\t\t\t\t\tthis.replayResolve = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t: undefined;\n\n\t\ttry {\n\t\t\tconst tempChess = new Chess();\n\t\t\ttempChess.loadPgn(gamePgn);\n\t\t\tconst history = tempChess.history({ verbose: true });\n\n\t\t\tconst timeOuts = this.calculateReplayTimeouts(history);\n\t\t\tthis.scheduleReplay(timeOuts, history.length, onComplete);\n\t\t} catch (_e) {\n\t\t\t// console.warn(\"Replay PGN parsing failed with chess.js, trying chessops\", e);\n\t\t\ttry {\n\t\t\t\tconst timeOuts = this.calculateReplayTimeoutsChessops(gamePgn);\n\t\t\t\tthis.scheduleReplay(timeOuts, timeOuts.length, onComplete);\n\t\t\t} catch (_e2) {\n\t\t\t\t// console.warn(\"Replay PGN parsing failed with chessops, falling back to simple replay\", e2);\n\t\t\t\t// Fallback: use moves list length and fixed time\n\t\t\t\tconst moveCount = this.moves().length;\n\t\t\t\tconst timeOuts = Array(moveCount)\n\t\t\t\t\t.fill(0)\n\t\t\t\t\t.map((_, i) => (i + 1) * this.fixedTime());\n\t\t\t\tthis.scheduleReplay(timeOuts, moveCount);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sequentially replays all selected games in the filtered game list.\n\t *\n\t * Each game is loaded, replayed from start to finish, then a 2-second pause\n\t * is inserted before the next game. Respects the current filter sort order.\n\t */\n\tasync replayAllSelectedGames() {\n\t\tthis.stopReplay();\n\t\tthis.isReplayingSequence = true;\n\n\t\t// Use filteredGamesIndices to maintain the sort order (by Elo sum)\n\t\t// Filter this list to include only selected games\n\t\tconst selectedSet = this.selectedGames();\n\t\tconst selected = this.filteredGamesIndices().filter((idx) =>\n\t\t\tselectedSet.has(idx),\n\t\t);\n\n\t\tif (selected.length === 0) {\n\t\t\tthis.showMessage('No games selected. Please select games to replay.');\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = 0; i < selected.length; i++) {\n\t\t\tif (!this.isReplayingSequence) break;\n\t\t\tconst gameIndex = selected[i];\n\t\t\tthis.loadGame(gameIndex);\n\n\t\t\t// Wait for the game to load\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 100));\n\n\t\t\t// Replay the current game\n\t\t\tawait this.replayGameAsync();\n\n\t\t\t// Wait a bit between games (2 seconds)\n\t\t\tif (i < selected.length - 1) {\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 2000));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a Promise that resolves when the current game's replay completes.\n\t *\n\t * Used by batch replay sequences to await each game's auto-play before\n\t * moving to the next selected game.\n\t *\n\t * @returns Promise resolved by {@link scheduleReplay} via {@link replayResolve}.\n\t */\n\tprivate replayGameAsync(): Promise<void> {\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.stopReplay();\n\t\t\tthis.replayResolve = resolve;\n\t\t\tthis.start();\n\n\t\t\tconst gamePgn = this.pgnInput();\n\n\t\t\ttry {\n\t\t\t\tconst tempChess = new Chess();\n\t\t\t\ttempChess.loadPgn(gamePgn);\n\t\t\t\tconst history = tempChess.history({ verbose: true });\n\n\t\t\t\tconst timeOuts = this.calculateReplayTimeouts(history);\n\n\t\t\t\t// Actually schedule the replay\n\t\t\t\tthis.scheduleReplay(timeOuts, history.length, () => {\n\t\t\t\t\tresolve();\n\t\t\t\t\tthis.replayResolve = null;\n\t\t\t\t});\n\t\t\t} catch (_e) {\n\t\t\t\t// console.warn(\"Replay PGN parsing failed with chess.js, trying chessops\", e);\n\t\t\t\ttry {\n\t\t\t\t\tconst timeOuts = this.calculateReplayTimeoutsChessops(gamePgn);\n\t\t\t\t\tthis.scheduleReplay(timeOuts, timeOuts.length, () => {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tthis.replayResolve = null;\n\t\t\t\t\t});\n\t\t\t\t} catch (_e2) {\n\t\t\t\t\t// console.warn(\"Replay PGN parsing failed with chessops, falling back to simple replay\", e2);\n\t\t\t\t\t// Fallback\n\t\t\t\t\tconst moveCount = this.moves().length;\n\t\t\t\t\tconst timeOuts = Array(moveCount)\n\t\t\t\t\t\t.fill(0)\n\t\t\t\t\t\t.map((_, i) => (i + 1) * this.fixedTime());\n\n\t\t\t\t\tthis.scheduleReplay(timeOuts, moveCount, () => {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tthis.replayResolve = null;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Stops any in-progress replay, clears scheduled timeouts, and optionally\n\t * resolves the replay Promise used by batch replay sequences.\n\t *\n\t * @param resolvePromise — When `true` (default), resolve any pending replay Promise.\n\t */\n\tstopReplay(resolvePromise = true) {\n\t\tthis.isReplaying.set(false);\n\t\tthis.replayTimeouts.forEach((t) => {\n\t\t\tclearTimeout(t);\n\t\t\tthis.pendingTimeouts.delete(t);\n\t\t});\n\t\tthis.replayTimeouts = [];\n\n\t\tif (resolvePromise && this.replayResolve) {\n\t\t\tthis.replayResolve();\n\t\t\tthis.replayResolve = null;\n\t\t}\n\t}\n\n\t/**\n\t * Calculates replay timeouts by parsing clock comments from the PGN via chessops.\n\t *\n\t * Fallback used when chess.js parsing fails. Reads `[%clk h:m:s]` comments\n\t * to determine think time per move in `'realtime'` and `'proportional'` modes.\n\t *\n\t * @param pgn — Raw PGN string for the game.\n\t * @returns Array of seconds delays, one per move.\n\t */\n\tprivate calculateReplayTimeoutsChessops(pgn: string): number[] {\n\t\tconst games = parsePgn(pgn);\n\t\tif (games.length === 0) throw new Error('No games found by chessops');\n\n\t\tconst game = games[0];\n\t\tconst timeOuts: number[] = [];\n\t\tthis.clockHistory = [];\n\n\t\t// Try to parse time control from headers\n\t\tlet timeControlSeconds = 0;\n\t\tif (game.headers.has('TimeControl')) {\n\t\t\tconst tc = game.headers.get('TimeControl')?.split('+');\n\t\t\tif (tc) timeControlSeconds = parseInt(tc[0], 10);\n\t\t}\n\n\t\tlet whiteTime = timeControlSeconds;\n\t\tlet blackTime = timeControlSeconds;\n\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\n\t\tconst thinkTimes: number[] = [];\n\t\tlet node = game.moves;\n\t\tlet isWhite = true;\n\n\t\twhile (node.children.length > 0) {\n\t\t\tconst child = node.children[0]; // Main line\n\t\t\tlet moveTime = 0;\n\t\t\tlet hasClockComment = false;\n\n\t\t\t// Check comments for clock\n\t\t\tif (child.data?.comments) {\n\t\t\t\tfor (const comment of child.data.comments) {\n\t\t\t\t\tconst clkMatch = comment.match(/%clk\\s+(?:(\\d+):)?(\\d+):(\\d+)/);\n\t\t\t\t\tif (clkMatch) {\n\t\t\t\t\t\thasClockComment = true;\n\t\t\t\t\t\tlet h = 0,\n\t\t\t\t\t\t\tm = 0,\n\t\t\t\t\t\t\ts = 0;\n\t\t\t\t\t\tif (clkMatch[1]) h = parseInt(clkMatch[1], 10);\n\t\t\t\t\t\tm = parseInt(clkMatch[2], 10);\n\t\t\t\t\t\ts = parseInt(clkMatch[3], 10);\n\n\t\t\t\t\t\tconst timeInSeconds = h * 3600 + m * 60 + s;\n\n\t\t\t\t\t\tif (isWhite) {\n\t\t\t\t\t\t\tmoveTime = Math.max(0.1, whiteTime - timeInSeconds);\n\t\t\t\t\t\t\twhiteTime = timeInSeconds;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmoveTime = Math.max(0.1, blackTime - timeInSeconds);\n\t\t\t\t\t\t\tblackTime = timeInSeconds;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak; // Found clock, stop looking\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!hasClockComment) {\n\t\t\t\tmoveTime = this.fixedTime();\n\t\t\t}\n\n\t\t\tthinkTimes.push(moveTime);\n\t\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\n\t\t\tnode = child;\n\t\t\tisWhite = !isWhite;\n\t\t}\n\n\t\t// Calculate timeouts based on mode (reuse logic if possible, or duplicate for now)\n\t\tif (this.replayMode() === 'fixed') {\n\t\t\treturn thinkTimes.map((_, i) => (i + 1) * this.fixedTime());\n\t\t}\n\n\t\tif (this.replayMode() === 'realtime') {\n\t\t\tlet totalTime = 0;\n\t\t\tfor (let i = 0; i < thinkTimes.length; i++) {\n\t\t\t\ttotalTime += thinkTimes[i];\n\t\t\t\ttimeOuts.push(totalTime);\n\t\t\t}\n\t\t\treturn timeOuts;\n\t\t}\n\n\t\tif (this.replayMode() === 'proportional') {\n\t\t\tconst totalGameDuration = thinkTimes.reduce((a, b) => a + b, 0);\n\t\t\tconst targetDurationSeconds = this.proportionalDuration() * 60;\n\t\t\tconst scaleFactor =\n\t\t\t\ttotalGameDuration > 0 ? targetDurationSeconds / totalGameDuration : 1;\n\t\t\tconst minSeconds = this.minSecondsBetweenMoves();\n\n\t\t\tlet currentScaledTime = 0;\n\t\t\tfor (let i = 0; i < thinkTimes.length; i++) {\n\t\t\t\tlet scaledMoveTime = thinkTimes[i] * scaleFactor;\n\t\t\t\tif (scaledMoveTime < minSeconds) {\n\t\t\t\t\tscaledMoveTime = minSeconds;\n\t\t\t\t}\n\t\t\t\tcurrentScaledTime += scaledMoveTime;\n\t\t\t\ttimeOuts.push(currentScaledTime);\n\t\t\t}\n\t\t\treturn timeOuts;\n\t\t}\n\n\t\treturn thinkTimes.map((_, i) => (i + 1) * 1);\n\t}\n\n\t/**\n\t * Clock state at each half-move: remaining seconds for white and black.\n\t * Index 0 is the initial clock state. Populated by {@link calculateReplayTimeouts}.\n\t */\n\tprivate clockHistory: { white: number; black: number }[] = [];\n\n\t/**\n\t * Calculates per-move replay delays from game history and clock comments.\n\t *\n\t * Parses `[%clk h:m:s]` comments to compute think times. Supports three modes:\n\t * `'fixed'` (constant delay), `'realtime'` (actual think time), and\n\t * `'proportional'` (scaled to fit {@link proportionalDuration}).\n\t *\n\t * @param history — Verbose move history from chess.js.\n\t * @returns Array of seconds delays, one per move.\n\t */\n\tprivate calculateReplayTimeouts(history: Move[]): number[] {\n\t\tconst timeOuts: number[] = [];\n\t\tthis.clockHistory = [];\n\n\t\t// Get comments and header to parse clocks\n\t\tconst comments = this.chess.getComments();\n\t\tconst header = this.chess.header();\n\n\t\t// Try to parse time control\n\t\tlet timeControlSeconds = 0;\n\t\tif (header.TimeControl) {\n\t\t\tconst tc = header.TimeControl.split('+');\n\t\t\ttimeControlSeconds = parseInt(tc[0], 10);\n\t\t}\n\n\t\t// Initialize clocks\n\t\tlet whiteTime = timeControlSeconds;\n\t\tlet blackTime = timeControlSeconds;\n\n\t\t// If we have clock comments, use them as source of truth\n\t\t// Check first few moves for clock comments\n\t\tlet hasClockComments = false;\n\t\tfor (let i = 0; i < Math.min(history.length, 10); i++) {\n\t\t\tconst _comment = comments.find(\n\t\t\t\t(c) => c.fen === history[i].after || c.fen === history[i].before,\n\t\t\t); // Approximate check\n\t\t\t// Actually chess.js getComments returns array of objects with fen and comment.\n\t\t\t// We need to match moves to comments.\n\t\t\t// A simpler way is to iterate moves and get comments for the position.\n\t\t}\n\n\t\t// Re-simulate game to extract clocks correctly\n\t\tconst tempChess = new Chess();\n\t\t// Use the raw PGN input to ensure we have comments\n\t\ttempChess.loadPgn(this.pgnInput());\n\t\tconst moves = tempChess.history({ verbose: true });\n\t\tconst moveComments = tempChess.getComments();\n\n\t\t// Map FEN to comment for easier lookup\n\t\tconst fenToComment = new Map<string, string>();\n\t\tmoveComments.forEach((c) => {\n\t\t\tfenToComment.set(c.fen, c.comment);\n\t\t});\n\n\t\t// Initial clock state\n\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\n\t\t// Calculate think times\n\t\tconst thinkTimes: number[] = [];\n\n\t\tfor (let i = 0; i < moves.length; i++) {\n\t\t\tconst move = moves[i];\n\t\t\tconst isWhite = move.color === 'w';\n\t\t\t// chess.js attaches comments to the position AFTER the move\n\t\t\tconst comment = fenToComment.get(move.after);\n\n\t\t\tlet moveTime = 0;\n\n\t\t\tif (comment) {\n\t\t\t\t// Try to parse %clk\n\t\t\t\t// Matches: [%clk 0:03:02] or [%clk 03:02] or [%clk 3:02]\n\t\t\t\tconst clkMatch = comment.match(/%clk\\s+(?:(\\d+):)?(\\d+):(\\d+)/);\n\t\t\t\tif (clkMatch) {\n\t\t\t\t\thasClockComments = true;\n\t\t\t\t\tlet h = 0,\n\t\t\t\t\t\tm = 0,\n\t\t\t\t\t\ts = 0;\n\n\t\t\t\t\tif (clkMatch[1]) {\n\t\t\t\t\t\th = parseInt(clkMatch[1], 10);\n\t\t\t\t\t}\n\t\t\t\t\tm = parseInt(clkMatch[2], 10);\n\t\t\t\t\ts = parseInt(clkMatch[3], 10);\n\n\t\t\t\t\tconst timeInSeconds = h * 3600 + m * 60 + s;\n\n\t\t\t\t\tif (isWhite) {\n\t\t\t\t\t\tmoveTime = Math.max(0.1, whiteTime - timeInSeconds);\n\t\t\t\t\t\twhiteTime = timeInSeconds;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmoveTime = Math.max(0.1, blackTime - timeInSeconds);\n\t\t\t\t\t\tblackTime = timeInSeconds;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback if no clock comment or parsing failed\n\t\t\tif (moveTime === 0 && !hasClockComments) {\n\t\t\t\tmoveTime = this.fixedTime(); // Default to fixed time setting\n\t\t\t} else if (moveTime === 0 && hasClockComments) {\n\t\t\t\t// If we have clock comments generally but missed this one, assume small time\n\t\t\t\tmoveTime = 1;\n\t\t\t}\n\n\t\t\tthinkTimes.push(moveTime);\n\t\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\t\t}\n\n\t\t// If no clock comments found at all, clear clock history so we don't show empty clocks\n\t\tif (!hasClockComments) {\n\t\t\tthis.clockHistory = [];\n\t\t\tthis.whiteTimeRemaining.set('');\n\t\t\tthis.blackTimeRemaining.set('');\n\t\t} else {\n\t\t\t// Set initial clocks for display\n\t\t\tif (this.clockHistory.length > 0) {\n\t\t\t\tthis.whiteTimeRemaining.set(\n\t\t\t\t\tthis.formatTime(this.clockHistory[0].white),\n\t\t\t\t);\n\t\t\t\tthis.blackTimeRemaining.set(\n\t\t\t\t\tthis.formatTime(this.clockHistory[0].black),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (this.replayMode() === 'fixed') {\n\t\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\t\ttimeOuts.push((i + 1) * this.fixedTime());\n\t\t\t}\n\t\t\treturn timeOuts;\n\t\t}\n\n\t\tif (this.replayMode() === 'realtime') {\n\t\t\tlet totalTime = 0;\n\t\t\tfor (let i = 0; i < thinkTimes.length; i++) {\n\t\t\t\ttotalTime += thinkTimes[i];\n\t\t\t\ttimeOuts.push(totalTime);\n\t\t\t}\n\t\t\treturn timeOuts;\n\t\t}\n\n\t\tif (this.replayMode() === 'proportional') {\n\t\t\t// Calculate total game duration\n\t\t\tconst totalGameDuration = thinkTimes.reduce((a, b) => a + b, 0);\n\t\t\tconst targetDurationSeconds = this.proportionalDuration() * 60;\n\t\t\tconst scaleFactor =\n\t\t\t\ttotalGameDuration > 0 ? targetDurationSeconds / totalGameDuration : 1;\n\t\t\tconst minSeconds = this.minSecondsBetweenMoves();\n\n\t\t\tlet currentScaledTime = 0;\n\t\t\tfor (let i = 0; i < thinkTimes.length; i++) {\n\t\t\t\tlet scaledMoveTime = thinkTimes[i] * scaleFactor;\n\t\t\t\tif (scaledMoveTime < minSeconds) {\n\t\t\t\t\tscaledMoveTime = minSeconds;\n\t\t\t\t}\n\t\t\t\tcurrentScaledTime += scaledMoveTime;\n\t\t\t\ttimeOuts.push(currentScaledTime);\n\t\t\t}\n\t\t\treturn timeOuts;\n\t\t}\n\n\t\t// Fallback\n\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\ttimeOuts.push((i + 1) * 1);\n\t\t}\n\n\t\treturn timeOuts;\n\t}\n\n\t/**\n\t * Formats a duration in seconds as a clock display string.\n\t *\n\t * @param seconds — Duration in seconds.\n\t * @returns Formatted string: `\"h:mm:ss\"` or `\"m:ss\"`.\n\t */\n\tprivate formatTime(seconds: number): string {\n\t\tconst h = Math.floor(seconds / 3600);\n\t\tconst m = Math.floor((seconds % 3600) / 60);\n\t\tconst s = Math.floor(seconds % 60);\n\n\t\tif (h > 0) {\n\t\t\treturn `${h}:${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')} `;\n\t\t}\n\t\treturn `${m}:${s.toString().padStart(2, '0')} `;\n\t}\n\n\t/**\n\t * Parses a `[%eval ...]` PGN comment value into a numeric score.\n\t *\n\t * Mate scores (`#3`, `#-2`) are converted to large values near ±20.\n\t * Centipawn scores are parsed as floats.\n\t *\n\t * @param evalStr — Raw evaluation string, or `null`.\n\t * @returns Numeric evaluation score, or `null` if unparseable.\n\t */\n\tprivate parseEval(evalStr: string | null): number | null {\n\t\tif (!evalStr) return null;\n\t\tif (evalStr.startsWith('#')) {\n\t\t\tconst val = parseInt(evalStr.substring(1), 10);\n\t\t\treturn val > 0 ? 20 + 10 / Math.abs(val) : -(20 + 10 / Math.abs(val));\n\t\t}\n\t\treturn parseFloat(evalStr);\n\t}\n\n\t/**\n\t * Schedules timed callbacks to auto-play moves during replay.\n\t *\n\t * Uses the selected replay mode timing, handles the \"stop on error\" feature\n\t * (pauses when evaluation change exceeds {@link stopOnErrorThreshold}),\n\t * and calls the optional `onComplete` callback after the last move.\n\t *\n\t * @param timeOuts — Per-move delays in seconds.\n\t * @param totalMoves — Total number of moves in the game.\n\t * @param onComplete — Optional callback when replay finishes.\n\t */\n\tprivate scheduleReplay(\n\t\ttimeOuts: number[],\n\t\ttotalMoves: number,\n\t\tonComplete?: () => void,\n\t) {\n\t\tconst _totalGameTime = timeOuts[timeOuts.length - 1] || 1;\n\t\tthis.isReplaying.set(true);\n\t\tthis.showBetterMoveBtn.set(false);\n\t\tthis.analysisVisible.set(false);\n\t\tthis.bestMoveInfo.set(null);\n\n\t\tconst startMoveIndex = this.currentMoveIndex() + 1; // Start from next move\n\n\t\tif (startMoveIndex >= totalMoves) {\n\t\t\tthis.isReplaying.set(false);\n\t\t\tif (onComplete) onComplete();\n\t\t\treturn;\n\t\t}\n\n\t\tconst startTime = startMoveIndex > 0 ? timeOuts[startMoveIndex - 1] : 0;\n\n\t\tfor (let i = startMoveIndex; i < totalMoves; i++) {\n\t\t\tlet delay = 0;\n\t\t\tif (\n\t\t\t\tthis.replayMode() === 'fixed' ||\n\t\t\t\tthis.replayMode() === 'realtime' ||\n\t\t\t\tthis.replayMode() === 'proportional'\n\t\t\t) {\n\t\t\t\t// Calculate relative delay from \"now\" (which corresponds to startTime in the game)\n\t\t\t\tdelay = (timeOuts[i] - startTime) * 1000;\n\t\t\t} else {\n\t\t\t\t// Fallback\n\t\t\t\tdelay = (i - startMoveIndex + 1) * 1000;\n\t\t\t}\n\n\t\t\t// Ensure non-negative delay\n\t\t\tdelay = Math.max(0, delay);\n\n\t\t\tconst isLast = i === totalMoves - 1;\n\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\tthis.next();\n\n\t\t\t\t// Stop on Error Check\n\t\t\t\tif (this.stopOnError()) {\n\t\t\t\t\tconst currentIdx = this.currentMoveIndex();\n\t\t\t\t\tconst evals = this.evaluations();\n\t\t\t\t\tif (currentIdx > 0 && currentIdx < evals.length) {\n\t\t\t\t\t\tconst currentEval = this.parseEval(evals[currentIdx]);\n\t\t\t\t\t\tconst prevEval = this.parseEval(evals[currentIdx - 1]);\n\n\t\t\t\t\t\tif (currentEval !== null && prevEval !== null) {\n\t\t\t\t\t\t\t// If diff > threshold\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tMath.abs(currentEval - prevEval) > this.stopOnErrorThreshold()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tthis.stopReplay(false);\n\n\t\t\t\t\t\t\t\tconst prevFen = this.getFenBeforeMove(currentIdx);\n\t\t\t\t\t\t\t\tif (prevFen) {\n\t\t\t\t\t\t\t\t\tthis.showBetterMoveBtn.set(true);\n\t\t\t\t\t\t\t\t\tthis.analyzePosition(prevFen);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isLast && onComplete && this.isReplaying()) {\n\t\t\t\t\t// Give a small buffer for the last animation\n\t\t\t\t\tconst completionTimeoutId = this.setDeferredTimeout(() => {\n\t\t\t\t\t\t// Only call onComplete if we didn't stop manually (check isReplaying?)\n\t\t\t\t\t\t// stopReplay() sets isReplaying to false.\n\t\t\t\t\t\t// If we stopped on error, we don't proceed to next game in sequence.\n\t\t\t\t\t\tif (onComplete) onComplete();\n\t\t\t\t\t}, 500);\n\t\t\t\t\tthis.replayTimeouts.push(completionTimeoutId);\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t\tthis.replayTimeouts.push(timeoutId);\n\t\t}\n\t}\n\n\t/**\n\t * Returns the FEN string representing the position before a given move.\n\t *\n\t * Used by the \"stop on error\" feature to determine the position where\n\t * a large evaluation swing occurred.\n\t *\n\t * @param moveIndex — The 0-based move index. Returns the FEN before this move.\n\t * @returns FEN string, or `null` on error.\n\t */\n\tprivate getFenBeforeMove(moveIndex: number): string | null {\n\t\ttry {\n\t\t\tconst tempChess = new Chess();\n\t\t\ttempChess.loadPgn(this.pgnInput());\n\t\t\t// Navigate to moveIndex - 1\n\t\t\t// history returns array of moves.\n\t\t\tconst moves = tempChess.history();\n\t\t\ttempChess.reset();\n\t\t\tfor (let i = 0; i < moveIndex; i++) {\n\t\t\t\ttempChess.move(moves[i]);\n\t\t\t}\n\t\t\treturn tempChess.fen();\n\t\t} catch (e) {\n\t\t\tconsole.error('Error generating previous FEN', e);\n\t\t\treturn null;\n\t\t}\n\t}\n}","<div class=\"pgn-viewer-container\">\n  <div class=\"main-content\">\n    <!-- Left Panel: Game Browser -->\n    <div class=\"panel left-panel\">\n      <h3>Game Browser</h3>\n\n      <!-- Filters -->\n      <div class=\"filter-section\">\n        <div class=\"filter-row\">\n          <div class=\"typeahead-wrapper\">\n            <input\n              type=\"text\"\n              placeholder=\"White\"\n              aria-label=\"Filter by White player\"\n              [value]=\"filterWhite()\"\n              (input)=\"onWhiteTypeaheadInput($event)\"\n              (focus)=\"openWhiteTypeahead()\"\n              (blur)=\"closeWhiteTypeahead()\"\n              (keydown)=\"onWhiteTypeaheadKeydown($event)\"\n              autocomplete=\"off\"\n            />\n            @if (whiteTypeaheadOpen() && filteredWhiteSuggestions().length > 0) {\n              <div class=\"typeahead-dropdown\" role=\"listbox\">\n                @for (player of filteredWhiteSuggestions(); track player; let i = $index) {\n                  <div\n                    class=\"typeahead-item\"\n                    [class.active]=\"i === whiteTypeaheadIndex()\"\n                    role=\"option\"\n                    [attr.aria-selected]=\"i === whiteTypeaheadIndex()\"\n                    (mousedown)=\"selectWhiteTypeahead(player)\"\n                  >\n                    @for (segment of highlightText(player, filterWhite()); track $index) {\n                      @if (segment.match) {\n                        <span class=\"match-highlight\">{{ segment.text }}</span>\n                      } @else {\n                        <span>{{ segment.text }}</span>\n                      }\n                    }\n                  </div>\n                }\n              </div>\n            }\n            @if (whiteTypeaheadOpen() && filterWhite() && filteredWhiteSuggestions().length === 0) {\n              <div class=\"typeahead-dropdown\">\n                <div class=\"typeahead-no-results\">No matching players</div>\n              </div>\n            }\n          </div>\n        </div>\n        <div class=\"filter-row\">\n          <div class=\"typeahead-wrapper\">\n            <input\n              type=\"text\"\n              placeholder=\"Black\"\n              aria-label=\"Filter by Black player\"\n              [value]=\"filterBlack()\"\n              (input)=\"onBlackTypeaheadInput($event)\"\n              (focus)=\"openBlackTypeahead()\"\n              (blur)=\"closeBlackTypeahead()\"\n              (keydown)=\"onBlackTypeaheadKeydown($event)\"\n              autocomplete=\"off\"\n            />\n            @if (blackTypeaheadOpen() && filteredBlackSuggestions().length > 0) {\n              <div class=\"typeahead-dropdown\" role=\"listbox\">\n                @for (player of filteredBlackSuggestions(); track player; let i = $index) {\n                  <div\n                    class=\"typeahead-item\"\n                    [class.active]=\"i === blackTypeaheadIndex()\"\n                    role=\"option\"\n                    [attr.aria-selected]=\"i === blackTypeaheadIndex()\"\n                    (mousedown)=\"selectBlackTypeahead(player)\"\n                  >\n                    @for (segment of highlightText(player, filterBlack()); track $index) {\n                      @if (segment.match) {\n                        <span class=\"match-highlight\">{{ segment.text }}</span>\n                      } @else {\n                        <span>{{ segment.text }}</span>\n                      }\n                    }\n                  </div>\n                }\n              </div>\n            }\n            @if (blackTypeaheadOpen() && filterBlack() && filteredBlackSuggestions().length === 0) {\n              <div class=\"typeahead-dropdown\">\n                <div class=\"typeahead-no-results\">No matching players</div>\n              </div>\n            }\n          </div>\n        </div>\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"ignoreColor()\"\n              (change)=\"toggleIgnoreColor($event)\"\n            />\n            Ignore Color\n          </label>\n        </div>\n        <div class=\"filter-row\">\n          <select\n            multiple\n            aria-label=\"Filter by Result\"\n            (change)=\"updateFilterResult($event)\"\n          >\n            <option value=\"1-0\" [selected]=\"filterResult().includes('1-0')\">\n              White wins (1-0)\n            </option>\n            <option\n              value=\"1/2-1/2\"\n              [selected]=\"filterResult().includes('1/2-1/2')\"\n            >\n              Draw (1/2-1/2)\n            </option>\n            <option value=\"0-1\" [selected]=\"filterResult().includes('0-1')\">\n              Black wins (0-1)\n            </option>\n          </select>\n        </div>\n        <div class=\"filter-row\">\n          <select\n            [value]=\"filterEco()\"\n            (change)=\"updateFilterEco($event)\"\n            aria-label=\"Filter by ECO Opening\"\n          >\n            <option value=\"\">All Openings</option>\n            @for (ecoData of sortedEcoCodes(); track ecoData.code) {\n              <option [value]=\"ecoData.code\">\n                {{ ecoData.code }}\n                @if (getOpeningMoves(ecoData.code)) {\n                  - {{ getOpeningMoves(ecoData.code) }}\n                }\n                ({{ ecoData.count }} games)\n              </option>\n            }\n          </select>\n        </div>\n        <div class=\"filter-row\">\n          <select\n            [value]=\"filterTimeControl()\"\n            (change)=\"updateFilterTimeControl($event)\"\n            aria-label=\"Filter by Time Control\"\n          >\n            <option value=\"\">All Time Controls</option>\n            @for (tcData of sortedTimeControls(); track tcData.key) {\n              <option\n                [value]=\"tcData.key\"\n                [attr.title]=\"tcData.originalsSummary\"\n              >\n                {{ tcData.label }} ({{ tcData.count }} games)\n              </option>\n            }\n          </select>\n        </div>\n        <div class=\"filter-row\">\n          <select\n            [value]=\"filterEvent()\"\n            (change)=\"updateFilterEvent($event)\"\n            aria-label=\"Filter by Event\"\n          >\n            <option value=\"\">All Events</option>\n            @for (evtData of sortedEvents(); track evtData.event) {\n              <option [value]=\"evtData.event\">\n                {{ evtData.event }} ({{ evtData.count }} games)\n              </option>\n            }\n          </select>\n        </div>\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterRatingEnabled()\"\n              (change)=\"toggleFilterRatingEnabled($event)\"\n            />\n            Rating\n          </label>\n          <select\n            (change)=\"applyRatingPreset($event)\"\n            class=\"preset-select\"\n            aria-label=\"Rating Presets\"\n          >\n            <option value=\"\">Select Level...</option>\n            <option value=\"2000\">Candidate Master (2000+)</option>\n            <option value=\"2200\">National Master (2200+)</option>\n            <option value=\"2300\">FIDE Master (2300+)</option>\n            <option value=\"2400\">Intl. Master (2400+)</option>\n            <option value=\"2500\">Grandmaster (2500+)</option>\n            <option value=\"2700\">Super GM (2700+)</option>\n            <option value=\"3000\">Chess engines (3000 - 4000)</option>\n          </select>\n        </div>\n        <div class=\"filter-row\">\n          <input\n            type=\"number\"\n            placeholder=\"White Rating >\"\n            aria-label=\"Filter by White Rating Min\"\n            [value]=\"filterWhiteRating()\"\n            (input)=\"updateFilterWhiteRating($event)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n          <input\n            type=\"number\"\n            placeholder=\"White Rating <\"\n            aria-label=\"Filter by White Rating Max\"\n            [value]=\"filterWhiteRatingMax()\"\n            (input)=\"updateFilterWhiteRatingMax($event)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n        </div>\n        <div class=\"filter-row\">\n          <input\n            type=\"number\"\n            placeholder=\"Black Rating >\"\n            aria-label=\"Filter by Black Rating Min\"\n            [value]=\"filterBlackRating()\"\n            (input)=\"updateFilterBlackRating($event)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n          <input\n            type=\"number\"\n            placeholder=\"Black Rating <\"\n            aria-label=\"Filter by Black Rating Max\"\n            [value]=\"filterBlackRatingMax()\"\n            (input)=\"updateFilterBlackRatingMax($event)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n        </div>\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterMoves()\"\n              (change)=\"toggleFilterMoves($event)\"\n            />\n            Enter Starting Moves\n          </label>\n        </div>\n        <div class=\"filter-actions\">\n          <button (click)=\"clearFilters()\" class=\"secondary-button small\">\n            Clear\n          </button>\n          <button (click)=\"applyFilter()\" class=\"primary-button small\">\n            Filter\n          </button>\n        </div>\n      </div>\n\n      <!-- Game List -->\n      @if (gamesMetadata().length > 0) {\n        <div class=\"game-list-header\">\n          <span>Games: {{ filteredGameInfos().length }}</span>\n          <div class=\"game-nav-buttons\">\n            <button\n              (click)=\"prevGame()\"\n              [disabled]=\"currentGameIndex() === 0\"\n              class=\"icon-btn\"\n              aria-label=\"Previous Game\"\n            >\n              ◀\n            </button>\n            <button\n              (click)=\"nextGame()\"\n              [disabled]=\"currentGameIndex() === gamesMetadata().length - 1\"\n              class=\"icon-btn\"\n              aria-label=\"Next Game\"\n            >\n              ▶\n            </button>\n          </div>\n        </div>\n\n        @if (isFiltering()) {\n          <div class=\"filtering-indicator\" role=\"status\" aria-live=\"polite\">\n            Filtering...\n          </div>\n        }\n\n        <div class=\"game-list\" role=\"list\">\n          @for (gameInfo of filteredGameInfos(); track gameInfo.number) {\n            <div\n              class=\"game-item\"\n              role=\"listitem\"\n              [class.active]=\"currentGameIndex() === gameInfo.number - 1\"\n            >\n              <label>\n                <input\n                  type=\"checkbox\"\n                  [checked]=\"selectedGames().has(gameInfo.number - 1)\"\n                  (change)=\"toggleGameSelection(gameInfo.number - 1)\"\n                  [attr.aria-label]=\"'Select Game ' + gameInfo.number\"\n                />\n                <div\n                  class=\"game-info\"\n                  (click)=\"\n                    loadGame(gameInfo.number - 1); $event.preventDefault()\n                  \"\n                  (keydown.enter)=\"\n                    loadGame(gameInfo.number - 1); $event.preventDefault()\n                  \"\n                  (keydown.space)=\"\n                    loadGame(gameInfo.number - 1); $event.preventDefault()\n                  \"\n                  tabindex=\"0\"\n                  role=\"button\"\n                  [attr.aria-label]=\"\n                    'Load Game ' +\n                    gameInfo.number +\n                    ': ' +\n                    gameInfo.white +\n                    ' vs ' +\n                    gameInfo.black\n                  \"\n                >\n                  <div class=\"players\">\n                    <span class=\"game-number\">#{{ gameInfo.number }}</span>\n                    {{ gameInfo.white }} vs {{ gameInfo.black }}\n                  </div>\n                  <div class=\"result\">{{ gameInfo.result }}</div>\n                </div>\n              </label>\n            </div>\n          }\n          @if (filteredGameInfos().length === 0) {\n            <div class=\"no-games\">No games match filters</div>\n          }\n        </div>\n\n        <div class=\"selection-controls\">\n          <div class=\"selection-controls\">\n            <span class=\"selection-count\"\n              >{{ selectedGamesCount() }} selected</span\n            >\n          </div>\n        </div>\n      } @else {\n        <div class=\"empty-state\">No games loaded</div>\n      }\n    </div>\n\n    <!-- Center Panel: Board -->\n    <div class=\"panel center-panel\">\n      <div class=\"board-wrapper\">\n        <div class=\"player-info top\">\n          <div class=\"player-name-group\">\n            <span class=\"name\">{{ currentBlackPlayer() }}</span>\n            <span\n              class=\"turn-indicator black-turn\"\n              [class.active]=\"activeColor() === 'b'\"\n              title=\"Black to move\"\n            ></span>\n          </div>\n          @if (showClocks()) {\n            <span class=\"clock\">{{ blackTimeRemaining() }}</span>\n          }\n        </div>\n\n        <div class=\"board-container\">\n          <ngx-chessground [runFunction]=\"runFunction()\"></ngx-chessground>\n\n          @if (currentEvaluation()) {\n            <div class=\"evaluation-bar-container\">\n              <div\n                class=\"evaluation-fill\"\n                [style.height.%]=\"evaluationBarHeight()\"\n              ></div>\n              <div\n                class=\"evaluation-text\"\n                [style.top.%]=\"100 - evaluationBarHeight()\"\n              >\n                {{ currentEvaluation() }}\n              </div>\n            </div>\n          }\n        </div>\n\n        <div class=\"player-info bottom\">\n          <div class=\"player-details\">\n            <div class=\"player-name-group\">\n              <span class=\"name\">{{ currentWhitePlayer() }}</span>\n              <span\n                class=\"turn-indicator white-turn\"\n                [class.active]=\"activeColor() === 'w'\"\n                title=\"White to move\"\n              ></span>\n            </div>\n          </div>\n          @if (showClocks()) {\n            <span class=\"clock\">{{ whiteTimeRemaining() }}</span>\n          }\n        </div>\n      </div>\n\n      <!-- Game Result -->\n      <div class=\"game-result-display\">{{ currentGameResult() }}</div>\n\n      <!-- Stockfish Analysis -->\n      @if (showBetterMoveBtn()) {\n        <div class=\"analysis-container\">\n          <div class=\"analysis-controls\">\n            @if (!analysisVisible()) {\n              <label class=\"depth-label\">\n                Depth:\n                <input\n                  type=\"number\"\n                  [value]=\"stockfishDepth()\"\n                  (input)=\"onStockfishDepthChange($event)\"\n                  min=\"1\"\n                  max=\"50\"\n                  class=\"small-input depth-input\"\n                />\n              </label>\n              <button\n                (click)=\"analysisVisible.set(true)\"\n                class=\"primary-button small\"\n              >\n                Show Better Move\n              </button>\n            }\n          </div>\n\n          @if (analysisVisible()) {\n            <div class=\"analysis-result\">\n              @if (isAnalyzing()) {\n                <span class=\"analyzing-text\">Thinking...</span>\n              } @else if (bestMoveInfo(); as info) {\n                <div class=\"best-move\">\n                  <div class=\"best-move-header\">\n                    <strong\n                      >Best: {{ info.move }}\n                      @if (info.score) {\n                        <span class=\"eval-score\">({{ info.score }})</span>\n                      }\n                    </strong>\n                    <button\n                      (click)=\"autoplayBestLine()\"\n                      class=\"primary-button xsmall\"\n                      title=\"Play Best Line\"\n                    >\n                      ▶ Play\n                    </button>\n                  </div>\n                  <div class=\"pv-line\">\n                    @for (pvMove of info.pv; track $index) {\n                      <button\n                        class=\"pv-move-btn\"\n                        (click)=\"previewPvMove(pvMove.fen)\"\n                      >\n                        {{ pvMove.san }}\n                      </button>\n                    }\n                  </div>\n                </div>\n              }\n            </div>\n          }\n        </div>\n      }\n\n      <!-- Move Navigation -->\n      <div class=\"move-navigation\">\n        <button\n          (click)=\"start()\"\n          [disabled]=\"currentMoveIndex() === -1\"\n          class=\"nav-btn\"\n          aria-label=\"First Move\"\n        >\n          |&lt;\n        </button>\n        <button\n          (click)=\"prev()\"\n          [disabled]=\"currentMoveIndex() === -1\"\n          class=\"nav-btn\"\n          aria-label=\"Previous Move\"\n        >\n          &lt;\n        </button>\n        <span class=\"move-status\" aria-live=\"polite\"\n          >{{ currentMoveIndex() + 1 }} / {{ moves().length }}</span\n        >\n        <button\n          (click)=\"next()\"\n          [disabled]=\"currentMoveIndex() >= moves().length - 1\"\n          class=\"nav-btn\"\n          aria-label=\"Next Move\"\n        >\n          &gt;\n        </button>\n        <button\n          (click)=\"end()\"\n          [disabled]=\"currentMoveIndex() >= moves().length - 1\"\n          class=\"nav-btn\"\n          aria-label=\"Last Move\"\n        >\n          &gt;|\n        </button>\n      </div>\n    </div>\n\n    <!-- Right Panel: Moves & Tools -->\n    <div class=\"panel right-panel\">\n      <!-- Move List -->\n      <div class=\"move-list-section\">\n        <h3>Moves</h3>\n        <div class=\"move-list\" role=\"list\" #moveList>\n          @for (move of moves(); track $index) {\n            @if ($index % 2 === 0) {\n              <span class=\"move-number\">{{ $index / 2 + 1 }}.</span>\n            }\n            <button\n              class=\"move-btn\"\n              [class.active]=\"$index === currentMoveIndex()\"\n              [class.last-move]=\"\n                highlightLastMove() && $index === moves().length - 1\n              \"\n              (click)=\"jumpToMove($index)\"\n              [attr.aria-label]=\"\n                'Jump to move ' +\n                ($index / 2 + 1) +\n                ($index % 2 === 0 ? ' White ' : ' Black ') +\n                move\n              \"\n            >\n              {{ move }}\n            </button>\n          }\n        </div>\n      </div>\n\n      <!-- Replay Controls -->\n      <div class=\"replay-section\">\n        <h3>Replay</h3>\n        <div class=\"replay-options\">\n          <label\n            ><input\n              type=\"radio\"\n              name=\"mode\"\n              [value]=\"'realtime'\"\n              [checked]=\"replayMode() === 'realtime'\"\n              (change)=\"replayMode.set('realtime')\"\n            />\n            Real Time</label\n          >\n          <label\n            ><input\n              type=\"radio\"\n              name=\"mode\"\n              [value]=\"'proportional'\"\n              [checked]=\"replayMode() === 'proportional'\"\n              (change)=\"replayMode.set('proportional')\"\n            />\n            Proportional</label\n          >\n          <label\n            ><input\n              type=\"radio\"\n              name=\"mode\"\n              [value]=\"'fixed'\"\n              [checked]=\"replayMode() === 'fixed'\"\n              (change)=\"replayMode.set('fixed')\"\n            />\n            Fixed</label\n          >\n        </div>\n\n        @if (replayMode() === \"proportional\") {\n          <div class=\"option-input\">\n            <input\n              type=\"number\"\n              [value]=\"proportionalDuration()\"\n              (input)=\"onProportionalDurationChange($event)\"\n              step=\"0.1\"\n              class=\"small-input\"\n              aria-label=\"Proportional Duration in Minutes\"\n            />\n            min/game\n          </div>\n          <div class=\"option-input\">\n            <input\n              type=\"number\"\n              [value]=\"minSecondsBetweenMoves()\"\n              (input)=\"onMinSecondsBetweenMovesChange($event)\"\n              step=\"0.1\"\n              class=\"small-input\"\n              aria-label=\"Min Seconds Between Moves\"\n            />\n            min sec/move\n          </div>\n        }\n\n        @if (replayMode() === \"fixed\") {\n          <div class=\"option-input\">\n            <input\n              type=\"number\"\n              [value]=\"fixedTime()\"\n              (input)=\"onFixedTimeChange($event)\"\n              step=\"0.1\"\n              class=\"small-input\"\n              aria-label=\"Fixed Time per Move in Seconds\"\n            />\n            sec/move\n          </div>\n        }\n\n        <div\n          class=\"option-row\"\n          style=\"margin-top: 8px; display: flex; align-items: center; gap: 4px\"\n        >\n          <label class=\"checkbox-label\"\n            style=\"display: flex; align-items: center; gap: 4px; white-space: nowrap\"\n          >\n            <input\n              type=\"checkbox\"\n              [checked]=\"stopOnError()\"\n              (change)=\"toggleStopOnError($event)\"\n            />\n            Stop on Error (&gt;\n            <input\n              type=\"number\"\n              [value]=\"stopOnErrorThreshold()\"\n              (input)=\"updateStopOnErrorThreshold($event)\"\n              step=\"0.1\"\n              class=\"small-input\"\n              [disabled]=\"!stopOnError()\"\n              aria-label=\"Stop on error threshold in centipawns\"\n            />\n            )\n          </label>\n        </div>\n\n        <div class=\"replay-actions\">\n          <button (click)=\"replayGame()\" class=\"action-btn\">Replay</button>\n          @if (canContinueReplay()) {\n            <button (click)=\"continueReplay()\" class=\"action-btn\">\n              Continue\n            </button>\n          }\n          <button (click)=\"stopSequence()\" class=\"action-btn stop\">Stop</button>\n        </div>\n        @if (canShowReplayAll()) {\n          <button\n            (click)=\"replayAllSelectedGames()\"\n            class=\"action-btn full-width\"\n          >\n            Replay Selected ({{ selectedGamesCount() }})\n          </button>\n        }\n      </div>\n\n      <!-- PGN Input (Collapsible-ish) -->\n      <div class=\"pgn-input-section\">\n        <textarea\n          [value]=\"pgnInput()\"\n          (input)=\"onPgnInputChange($event)\"\n          rows=\"3\"\n          placeholder=\"Paste PGN...\"\n          aria-label=\"PGN Input\"\n        ></textarea>\n        <div class=\"clipboard-buttons\">\n          <button (click)=\"loadFromClipboard()\" class=\"small-btn\">\n            Load from Clipboard\n          </button>\n          <button (click)=\"copyToClipboard()\" class=\"small-btn\">\n            Copy to Clipboard\n          </button>\n        </div>\n      </div>\n\n      <!-- Load Section -->\n      <div class=\"load-section\">\n        <h3>Load Games</h3>\n        <!-- Sample buttons removed, controlled by parent -->\n        <div class=\"file-inputs\">\n          <label class=\"file-input-label\">\n            Zip\n            <input\n              type=\"file\"\n              accept=\".zip\"\n              (change)=\"onPgnZipSelected($event)\"\n              [disabled]=\"isLoading()\"\n            />\n          </label>\n          <label class=\"file-input-label\">\n            PGN\n            <input\n              type=\"file\"\n              accept=\".pgn\"\n              (change)=\"onPgnFileSelected($event)\"\n              [disabled]=\"isLoading()\"\n            />\n          </label>\n        </div>\n        <div class=\"lichess-date-picker\">\n          <label>Lichess Database:</label>\n          <div class=\"date-selectors\">\n            <select\n              (change)=\"onLichessYearChange($event)\"\n              aria-label=\"Select Year\"\n            >\n              @for (year of getLichessYears(); track year) {\n                <option [value]=\"year\" [selected]=\"year === lichessYear()\">\n                  {{ year }}\n                </option>\n              }\n            </select>\n            <select\n              (change)=\"onLichessMonthChange($event)\"\n              aria-label=\"Select Month\"\n            >\n              @for (month of getLichessMonths(); track month) {\n                <option [value]=\"month\" [selected]=\"month === lichessMonth()\">\n                  {{ month.toString().padStart(2, \"0\") }}\n                </option>\n              }\n            </select>\n            <button\n              (click)=\"loadFromLichess()\"\n              [disabled]=\"isLoading()\"\n              class=\"action-btn\"\n            >\n              Load\n            </button>\n          </div>\n          <div class=\"license-info\">\n            <small\n              >Licensed under\n              <a\n                href=\"https://tldrlegal.com/license/creative-commons-cc0-1.0-universal\"\n                target=\"_blank\"\n                rel=\"noopener noreferrer\"\n                >CC0</a\n              >\n              by\n              <a\n                href=\"https://database.lichess.org\"\n                target=\"_blank\"\n                rel=\"noopener noreferrer\"\n                >Lichess</a\n              ></small\n            >\n          </div>\n        </div>\n        <div class=\"url-input-section\">\n          <input\n            type=\"text\"\n            [value]=\"urlInput()\"\n            (input)=\"onUrlInputChange($event)\"\n            placeholder=\"Enter PGN URL (supports .zst)\"\n            class=\"url-input\"\n            aria-label=\"PGN URL\"\n          />\n          <button\n            (click)=\"loadFromUrl()\"\n            [disabled]=\"isLoading() || !urlInput()\"\n            class=\"action-btn\"\n          >\n            Load URL\n          </button>\n        </div>\n        @if (isLoading()) {\n          <div class=\"loading-indicator\" role=\"status\" aria-live=\"polite\">\n            @if (loadingProgress() > 0) {\n              <div class=\"progress-bar-container\">\n                <div\n                  class=\"progress-bar\"\n                  [style.width.%]=\"loadingProgress()\"\n                ></div>\n                <span class=\"progress-text\">{{ loadingProgress() }}%</span>\n              </div>\n            }\n            <div class=\"loading-status\">\n              {{ loadingStatus() || \"Loading...\" }}\n            </div>\n          </div>\n        }\n      </div>\n    </div>\n  </div>\n</div>\n","import { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit of animation for a chess conflict scenario.\n *\n * @constant\n * @type {Unit}\n * @name conflictingAnim\n *\n * @property {string} name - The name of the animation unit.\n * @property {Function} run - The function to execute the animation.\n * @param {HTMLElement} el - The HTML element to attach the Chessground instance to.\n * @returns {Chessground} The Chessground instance with the specified configuration.\n *\n * The animation runs with the following configuration:\n * - Duration: 500ms\n * - Initial FEN: \"8/8/5p2/4P3/4K3/8/8/8\"\n * - Turn color: Black\n * - Movable color: White\n * - Movable pieces are not free to move initially\n *\n * After 2 seconds, the black pawn on f6 moves to e5, and the turn color changes to white.\n * The white king on e4 can then move to e5, d5, or f5.\n */\nexport const conflictingAnim: Unit = {\n\tname: 'Animation: conflict',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tfen: '8/8/5p2/4P3/4K3/8/8/8',\n\t\t\tturnColor: 'black',\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('f6', 'e5');\n\t\t\tcg.set({\n\t\t\t\tturnColor: 'white',\n\t\t\t\tmovable: {\n\t\t\t\t\tdests: new Map([['e4', ['e5', 'd5', 'f5']]]),\n\t\t\t\t},\n\t\t\t});\n\t\t\tcg.playPremove();\n\t\t}, 2000);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit test for animating chess moves with the same role.\n *\n * This unit test initializes a Chessground instance with a specific FEN position\n * and animates two moves sequentially with a delay between them.\n *\n * @constant\n * @type {Unit}\n * @name withSameRole\n * @property {string} name - The name of the unit test.\n * @property {function} run - The function that runs the unit test.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground instance on.\n * @returns {Chessground} The initialized Chessground instance.\n */\nexport const withSameRole: Unit = {\n\tname: 'Animation: same role',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 2000,\n\t\t\t},\n\t\t\thighlight: {\n\t\t\t\tlastMove: false,\n\t\t\t},\n\t\t\tfen: '8/8/4p3/5p2/4B3/8/8/8',\n\t\t\tturnColor: 'white',\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('e4', 'f5');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.move('e6', 'f5');\n\t\t\t}, 500);\n\t\t}, 200);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit test for an animation where pieces of different roles are moved.\n *\n * @constant\n * @type {Unit}\n * @name notSameRole\n * @property {string} name - The name of the unit test.\n * @property {function} run - The function that runs the unit test.\n * @param {HTMLElement} el - The HTML element where the Chessground instance will be initialized.\n * @returns {Chessground} - The Chessground instance after performing the moves.\n *\n * The test initializes a Chessground instance with a specific FEN position and turn color.\n * It then performs a sequence of moves with a delay to test the animation of pieces with different roles.\n */\nexport const notSameRole: Unit = {\n\tname: 'Animation: different role',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 2000,\n\t\t\t},\n\t\t\thighlight: {\n\t\t\t\tlastMove: false,\n\t\t\t},\n\t\t\tfen: '8/8/4n3/5p2/4P3/8/8/8',\n\t\t\tturnColor: 'white',\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('e4', 'f5');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.move('e6', 'f5');\n\t\t\t}, 500);\n\t\t}, 200);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that performs an animation while holding a piece on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name whileHolding\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that executes the animation.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The Chessground instance with the specified configuration.\n *\n * The `run` function initializes a Chessground instance with a specific FEN position and configuration.\n * It sets the turn color to black and specifies an animation duration of 5000 milliseconds.\n * After a timeout of 3000 milliseconds, it moves a piece from f6 to e5, changes the turn color to white,\n * and sets the movable destinations for the white piece on e4. Finally, it plays any premoves.\n */\nexport const whileHolding: Unit = {\n\tname: 'Animation: while holding',\n\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tfen: '8/8/5p2/4P3/4K3/8/8/8',\n\t\t\tturnColor: 'black',\n\t\t\tanimation: {\n\t\t\t\tduration: 5000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tshowDests: false,\n\t\t\t},\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('f6', 'e5');\n\t\t\tcg.set({\n\t\t\t\tturnColor: 'white',\n\t\t\t\tmovable: {\n\t\t\t\t\tdests: new Map([['e4', ['e5', 'd5', 'f5']]]),\n\t\t\t\t},\n\t\t\t});\n\t\t\tcg.playPremove();\n\t\t}, 3000);\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Default configuration for a unit.\n *\n * @constant\n * @type {Unit}\n * @property {string} name - The name of the configuration.\n * @property {function} run - Function to initialize Chessground with the given element.\n * @param {HTMLElement} el - The HTML element to initialize Chessground on.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const defaults: Unit = {\n\tname: 'Default configuration',\n\trun(el) {\n\t\treturn Chessground(el);\n\t},\n};\n\n/**\n * Represents a unit that initializes a chessboard from a FEN string with the black player's perspective.\n *\n * @constant\n * @type {Unit}\n * @name fromFen\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that initializes the chessboard.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const fromFen: Unit = {\n\tname: 'From FEN, from black POV',\n\trun(el) {\n\t\treturn Chessground(el, {\n\t\t\tfen: '2r3k1/pp2Qpbp/4b1p1/3p4/3n1PP1/2N4P/Pq6/R2K1B1R w -',\n\t\t\torientation: 'black',\n\t\t});\n\t},\n};\n\n/**\n * Represents a unit that simulates the last move in a Crazyhouse chess game.\n *\n * @constant\n * @type {Unit}\n * @name lastMoveCrazyhouse\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the Chessground instance and sets the last moves.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground on.\n * @returns {Chessground} The initialized Chessground instance with the last moves set.\n */\nexport const lastMoveCrazyhouse: Unit = {\n\tname: 'Last move: crazyhouse',\n\trun(el) {\n\t\tconst cg = Chessground(el);\n\t\tsetTimeout(() => {\n\t\t\tcg.set({ lastMove: ['e2', 'e4'] });\n\t\t\tsetTimeout(() => cg.set({ lastMove: ['g6'] }), 1000);\n\t\t\tsetTimeout(() => cg.set({ lastMove: ['e1'] }), 2000);\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that highlights the king in check on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name checkHighlight\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard with the specified FEN and highlights the king in check.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance with the king in check highlighted.\n */\nexport const checkHighlight: Unit = {\n\tname: 'Highlight king in check',\n\trun(el) {\n\t\tconst fen = 'r1bqkbnr/1ppppBpp/p1n5/8/4P3/8/PPPP1PPP/RNBQK1NR b KQkq - 0 1';\n\t\tconst cg = Chessground(el, {\n\t\t\tfen,\n\t\t\tturnColor: 'black',\n\t\t\thighlight: {\n\t\t\t\tcheck: true,\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tcheck: true,\n\t\t});\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { Key } from 'chessground/types.d';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit that automatically switches between different FEN configurations\n * to demonstrate a puzzle bug in a chess game.\n *\n * @constant\n * @type {Unit}\n * @name autoSwitch\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that runs the unit.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance.\n *\n * The `run` function initializes a Chessground instance with the first configuration\n * and then switches between the configurations every 2000 milliseconds.\n *\n * The configurations are defined as an array of functions, each returning an object\n * with the following properties:\n * - `orientation`: The orientation of the board (\"black\" or \"white\").\n * - `fen`: The FEN string representing the board position.\n * - `lastMove`: An array of keys representing the last move made.\n */\nexport const autoSwitch: Unit = {\n\tname: 'FEN: switch (puzzle bug)',\n\trun(cont) {\n\t\tconst configs: Array<() => { fen: string; lastMove: Key[] }> = [\n\t\t\t() => ({\n\t\t\t\torientation: 'black',\n\t\t\t\tfen: 'rnbqkb1r/pp1ppppp/5n2/8/3N1B2/8/PPP1PPPP/RN1QKB1R b KQkq - 0 4',\n\t\t\t\tlastMove: ['f3', 'd4'],\n\t\t\t}),\n\t\t\t() => ({\n\t\t\t\torientation: 'white',\n\t\t\t\tfen: '2r2rk1/4bp1p/pp2p1p1/4P3/4bP2/PqN1B2Q/1P3RPP/2R3K1 w - - 1 23',\n\t\t\t\tlastMove: ['b4', 'b3'],\n\t\t\t}),\n\t\t];\n\t\tconst cg = Chessground(cont, configs[0]());\n\t\tconst delay = 2000;\n\t\tlet it = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.set(configs[++it % configs.length]());\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n","import { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Unit } from './unit';\nimport { aiPlay, toDests } from './util';\n\n/**\n * Default configuration for the 3D theme unit.\n *\n * @constant\n * @type {Unit}\n * @name in3dDefaults\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function to initialize and run the 3D theme.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance with 3D theme settings.\n */\nexport const in3dDefaults: Unit = {\n\tname: '3D theme',\n\trun(cont) {\n\t\tconst el = wrapped(cont);\n\t\tconst cg = Chessground(el, {\n\t\t\taddPieceZIndex: true,\n\t\t});\n\t\tcg.redrawAll();\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit for a 3D chess theme where the player plays against a random AI.\n *\n * @constant\n * @type {Unit}\n * @name vsRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to initialize and run the unit.\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const vsRandom: Unit = {\n\tname: '3D theme: play vs random AI',\n\trun(cont) {\n\t\tconst el = wrapped(cont);\n\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\torientation: 'black',\n\t\t\taddPieceZIndex: true,\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.redrawAll();\n\t\tcg.set({\n\t\t\tmovable: {\n\t\t\t\tevents: {\n\t\t\t\t\tafter: aiPlay(cg, chess, 1000, false),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a 3D theme where two random AIs play against each other.\n *\n * @constant\n * @type {Unit}\n * @name fullRandom\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function to execute the unit.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance.\n *\n * The `run` function initializes a Chessground instance with a 3D theme and sets up a game\n * where two random AIs play against each other. Moves are made at a fixed delay interval.\n */\nexport const fullRandom: Unit = {\n\tname: '3D theme: watch 2 random AIs',\n\trun(cont) {\n\t\tconst el = wrapped(cont);\n\n\t\tconst chess = new Chess();\n\t\tconst delay = 300;\n\t\tconst cg = Chessground(el, {\n\t\t\torientation: 'black',\n\t\t\taddPieceZIndex: true,\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tcg.redrawAll();\n\t\tfunction makeMove() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = moves[Math.floor(Math.random() * moves.length)];\n\t\t\tchess.move(move.san);\n\t\t\tcg.move(move.from, move.to);\n\t\t\tsetTimeout(makeMove, delay);\n\t\t}\n\t\tsetTimeout(makeMove, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Creates a new `div` element, sets the class name of the provided container element to \"in3d staunton\",\n * clears its inner HTML, and appends the new `div` element to it.\n *\n * @param cont - The container `HTMLElement` to be wrapped.\n * @returns The newly created `div` element.\n */\nfunction wrapped(cont: HTMLElement) {\n\tconst el = document.createElement('div');\n\tcont.className = 'in3d staunton';\n\tcont.innerHTML = '';\n\tcont.appendChild(el);\n\treturn el;\n}\n","import { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit test for the performance of a piece move in a chess game.\n *\n * @constant\n * @type {Unit}\n * @name move\n *\n * @property {string} name - The name of the performance test.\n * @property {function} run - The function that runs the performance test.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The Chessground instance used for the performance test.\n *\n * The `run` function initializes a Chessground instance with a specified animation duration.\n * It then defines a recursive function `run` that moves a piece from \"e2\" to \"a8\" and back\n * to \"e2\" with a delay between moves. The recursive function continues to run as long as\n * the chessboard is visible.\n */\nexport const move: Unit = {\n\tname: 'Perf: piece move',\n\trun(cont) {\n\t\tconst cg = Chessground(cont, {\n\t\t\tanimation: { duration: 500 },\n\t\t});\n\t\tconst delay = 400;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.move('e2', 'a8');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.move('a8', 'e2');\n\t\t\t\tsetTimeout(run, delay);\n\t\t\t}, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n/**\n * Represents a unit test for the performance of square selection in a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name select\n * @property {string} name - The name of the performance test.\n * @property {function} run - The function that runs the performance test.\n * @param {HTMLElement} cont - The container element for the chessboard.\n * @returns {Chessground} - The Chessground instance.\n *\n * The `run` function initializes a Chessground instance with specific movable\n * destinations for the square \"e2\". It then repeatedly selects the square \"e2\"\n * and \"d4\" with a delay of 500 milliseconds between each selection.\n */\nexport const select: Unit = {\n\tname: 'Perf: square select',\n\trun(cont) {\n\t\tconst cg = Chessground(cont, {\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t\tdests: new Map([['e2', ['e3', 'e4', 'd3', 'f3']]]),\n\t\t\t},\n\t\t});\n\t\tconst delay = 500;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.selectSquare('e2');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.selectSquare('d4');\n\t\t\t\tsetTimeout(run, delay);\n\t\t\t}, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n","import type { Chess as ChessInstance, Move } from 'chess.js';\nimport { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * A PGN (Portable Game Notation) string representing a chess game.\n *\n * The PGN includes metadata about the game such as event, site, date, players,\n * their ratings, and the result. It also contains the moves of the game along\n * with timestamps for each move.\n *\n * Example metadata:\n * - Event: Rated Blitz game\n * - Site: https://lichess.org/hvB20kxq\n * - Date: 2018.05.19\n * - White: topce\n * - Black: donateIIo\n * - Result: 1-0\n * - WhiteElo: 2342\n * - BlackElo: 2406\n * - WhiteRatingDiff: +12\n * - BlackRatingDiff: -12\n * - BlackTitle: GM\n * - Variant: Standard\n * - TimeControl: 180+0\n * - ECO: A00\n * - Opening: Anderssen Opening\n * - Termination: Normal\n *\n * Example moves:\n * 1. a3 { [%clk 0:03:00] } a6 { [%clk 0:03:00] }\n * 2. b3 { [%clk 0:02:59] } h6 { [%clk 0:03:00] }\n * 3. c3 { [%clk 0:02:59] } Nf6 { [%clk 0:02:57] }\n * ...\n * 39. Rd7# { [%clk 0:00:55] } 1-0\n */\nconst pgn = `[Event \"Rated Blitz game\"]\n[Site \"https://lichess.org/hvB20kxq\"]\n[Date \"2018.05.19\"]\n[White \"topce\"]\n[Black \"donateIIo\"]\n[Result \"1-0\"]\n[UTCDate \"2018.05.19\"]\n[UTCTime \"09:36:44\"]\n[WhiteElo \"2342\"]\n[BlackElo \"2406\"]\n[WhiteRatingDiff \"+12\"]\n[BlackRatingDiff \"-12\"]\n[BlackTitle \"GM\"]\n[Variant \"Standard\"]\n[TimeControl \"180+0\"]\n[ECO \"A00\"]\n[Opening \"Anderssen Opening\"]\n[Termination \"Normal\"]\n\n1. a3 { [%clk 0:03:00] } a6 { [%clk 0:03:00] } 2. b3 { [%clk 0:02:59] } h6 { [%clk 0:03:00] } 3. c3 { [%clk 0:02:59] } Nf6 { [%clk 0:02:57] } 4. d3 { [%clk 0:02:59] } d5 { [%clk 0:02:57] } 5. e3 { [%clk 0:02:59] } e5 { [%clk 0:02:56] } 6. f3 { [%clk 0:02:58] } c5 { [%clk 0:02:55] } 7. g3 { [%clk 0:02:58] } Nc6 { [%clk 0:02:55] } 8. h3 { [%clk 0:02:58] } Be7 { [%clk 0:02:54] } 9. Ra2 { [%clk 0:02:57] } O-O { [%clk 0:02:53] } 10. Rg2 { [%clk 0:02:55] } b5 { [%clk 0:02:52] } 11. g4 { [%clk 0:02:54] } e4 { [%clk 0:02:46] } 12. f4 { [%clk 0:02:49] } d4 { [%clk 0:02:42] } 13. g5 { [%clk 0:02:43] } hxg5 { [%clk 0:02:40] } 14. fxg5 { [%clk 0:02:42] } Nd5 { [%clk 0:02:39] } 15. dxe4 { [%clk 0:02:35] } Nxe3 { [%clk 0:02:36] } 16. Bxe3 { [%clk 0:02:34] } dxe3 { [%clk 0:02:36] } 17. Qxd8 { [%clk 0:02:33] } Rxd8 { [%clk 0:02:34] } 18. h4 { [%clk 0:02:25] } Be6 { [%clk 0:02:31] } 19. h5 { [%clk 0:02:19] } Bxb3 { [%clk 0:02:28] } 20. Be2 { [%clk 0:02:18] } Ne5 { [%clk 0:02:25] } 21. g6 { [%clk 0:02:16] } Nd3+ { [%clk 0:02:18] } 22. Bxd3 { [%clk 0:02:14] } Rxd3 { [%clk 0:02:18] } 23. h6 { [%clk 0:02:06] } Rd1+ { [%clk 0:02:07] } 24. Ke2 { [%clk 0:02:04] } Rxb1 { [%clk 0:02:07] } 25. gxf7+ { [%clk 0:01:59] } Kxf7 { [%clk 0:02:07] } 26. Rxg7+ { [%clk 0:01:53] } Ke6 { [%clk 0:02:06] } 27. h7 { [%clk 0:01:48] } Bc4+ { [%clk 0:01:36] } 28. Kxe3 { [%clk 0:01:46] } Rh8 { [%clk 0:01:07] } 29. Rh6+ { [%clk 0:01:34] } Bf6 { [%clk 0:00:59] } 30. Nf3 { [%clk 0:01:31] } Rf1 { [%clk 0:00:31] } 31. Rgg6 { [%clk 0:01:17] } Ke7 { [%clk 0:00:23] } 32. Rxf6 { [%clk 0:01:13] } Rxh7 { [%clk 0:00:22] } 33. Rxa6 { [%clk 0:01:05] } Rxh6 { [%clk 0:00:21] } 34. Rxh6 { [%clk 0:01:03] } Ra1 { [%clk 0:00:20] } 35. Ne5 { [%clk 0:01:01] } Rxa3 { [%clk 0:00:19] } 36. Kf4 { [%clk 0:01:00] } Rxc3 { [%clk 0:00:18] } 37. Kf5 { [%clk 0:00:58] } b4 { [%clk 0:00:17] } 38. Rh7+ { [%clk 0:00:58] } Kd6 { [%clk 0:00:16] } 39. Rd7# { [%clk 0:00:55] } 1-0\n\n\n`;\n/**\n * Unit to replay a PGN (Portable Game Notation) game in real time.\n *\n * @constant\n * @type {Unit}\n * @name loadPgnRealTime\n * @property {string} name - The name of the unit.\n * @property {Function} run - Function to execute the replay of the PGN game.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance used to render the chessboard and replay the game.\n *\n * The function performs the following steps:\n * 1. Initializes a new Chess instance and loads the PGN data.\n * 2. Creates a new Chessground instance with specific animation and movement settings.\n * 3. Retrieves the move history and comments from the PGN.\n * 4. Calculates the time control and think times for each move.\n * 5. Sets timeouts to replay each move on the chessboard in real time.\n */\nexport const loadPgnRealTime: Unit = {\n\tname: 'replay pgn game in real time',\n\trun(el) {\n\t\tconst chess: ChessInstance = new Chess();\n\t\tchess.loadPgn(pgn);\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tconst history: Move[] = chess.history({ verbose: true });\n\n\t\tconst comments: { fen: string; comment: string }[] = chess.getComments();\n\t\tconst header = chess.header();\n\t\tconst timeControl = header.TimeControl?.split('+');\n\t\tlet timeControlInSeconds = 180;\n\t\tif (timeControl) {\n\t\t\tconst total = Number.parseInt(timeControl[0], 10);\n\t\t\tconst increment = Number.parseInt(timeControl[1], 10);\n\t\t\ttimeControlInSeconds = total + increment * (comments.length / 2);\n\t\t}\n\n\t\tconst timeOuts: number[] = [];\n\n\t\tlet whiteThinkTime = 0;\n\t\tlet blackThinkTime = 0;\n\n\t\tfor (let j = 0; j < comments.length; j++) {\n\t\t\tconst minutes = Number.parseInt(comments[j].comment.substring(9, 11), 10);\n\t\t\tconst seconds = Number.parseInt(\n\t\t\t\tcomments[j].comment.substring(12, 14),\n\t\t\t\t10,\n\t\t\t);\n\t\t\tconst timeLeft = minutes * 60 + seconds;\n\t\t\tconst thinkTime = timeControlInSeconds - timeLeft;\n\n\t\t\tif (j % 2 === 0) {\n\t\t\t\tblackThinkTime = thinkTime;\n\t\t\t} else {\n\t\t\t\twhiteThinkTime = thinkTime;\n\t\t\t}\n\t\t\ttimeOuts.push(whiteThinkTime + blackThinkTime + j / 1000);\n\t\t}\n\n\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcg.move(history[i].from, history[i].to);\n\t\t\t}, timeOuts[i] * 1000);\n\t\t}\n\n\t\treturn cg;\n\t},\n};\n/**\n * Represents a unit that replays a PGN (Portable Game Notation) game with one second per move.\n *\n * @constant\n * @type {Unit}\n * @name loadPgnOneSecondPerMove\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that executes the unit.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance with the replayed game.\n *\n * The `run` function performs the following steps:\n * 1. Initializes a new Chess instance and loads the PGN.\n * 2. Creates a new Chessground instance with specific animation and movement settings.\n * 3. Retrieves the move history and comments from the Chess instance.\n * 4. Iterates through the move history and replays each move on the Chessground board with a one-second interval.\n */\nexport const loadPgnOneSecondPerMove: Unit = {\n\tname: 'replay pgn game one second per move',\n\trun(el) {\n\t\tconst chess: ChessInstance = new Chess();\n\t\tchess.loadPgn(pgn);\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tconst history: Move[] = chess.history({ verbose: true });\n\n\t\tconst _comments: { fen: string; comment: string }[] = chess.getComments();\n\t\tconst _header = chess.header();\n\n\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcg.move(history[i].from, history[i].to);\n\t\t\t}, i * 1000);\n\t\t}\n\n\t\treturn cg;\n\t},\n};\n/**\n * Unit to replay a PGN game in proportional time of 1 minute.\n *\n * @constant\n * @type {Unit}\n * @name loadPgnProportionalTime\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to execute the unit.\n *\n * @param {HTMLElement} el - The HTML element to attach the chessboard to.\n *\n * @returns {Chessground} - The Chessground instance with the replayed game.\n *\n * The `run` function performs the following steps:\n * 1. Initializes a new Chess instance and loads the PGN.\n * 2. Creates a new Chessground instance with specific animation and movement settings.\n * 3. Retrieves the move history and comments from the chess instance.\n * 4. Calculates the think time for each move based on the comments.\n * 5. Sets timeouts to replay each move on the Chessground instance in proportional time.\n */\nexport const loadPgnProportionalTime: Unit = {\n\tname: 'replay pgn game in proprtional time 1 minute',\n\trun(el) {\n\t\tconst chess: ChessInstance = new Chess();\n\t\tchess.loadPgn(pgn);\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tconst history: Move[] = chess.history({ verbose: true });\n\n\t\tconst comments: { fen: string; comment: string }[] = chess.getComments();\n\t\tconst _header = chess.header();\n\n\t\tconst timeOuts: number[] = [];\n\n\t\tlet whiteThinkTime = 0;\n\t\tlet blackThinkTime = 0;\n\n\t\tfor (let j = 0; j < comments.length; j++) {\n\t\t\tconst minutes = Number.parseInt(comments[j].comment.substring(9, 11), 10);\n\t\t\tconst seconds = Number.parseInt(\n\t\t\t\tcomments[j].comment.substring(12, 14),\n\t\t\t\t10,\n\t\t\t);\n\t\t\tconst timeLeft = minutes * 60 + seconds;\n\t\t\tconst thinkTime = 180 - timeLeft;\n\n\t\t\tif (j % 2 === 0) {\n\t\t\t\tblackThinkTime = thinkTime;\n\t\t\t} else {\n\t\t\t\twhiteThinkTime = thinkTime;\n\t\t\t}\n\t\t\ttimeOuts.push(whiteThinkTime + blackThinkTime + j / 1000);\n\t\t}\n\n\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\tsetTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcg.move(history[i].from, history[i].to);\n\t\t\t\t},\n\t\t\t\ttimeOuts[i] * (30 / 180) * 1000,\n\t\t\t);\n\t\t}\n\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { DrawShape } from 'chessground/draw';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit test case for preset user shapes in Chessground.\n * This unit initializes a Chessground instance with predefined drawable shapes.\n *\n * @type {Unit}\n * @property {string} name - The name of the unit test case\n * @property {(el: HTMLElement) => Api} run - Function that initializes Chessground with preset shapes\n */\nexport const presetUserShapes: Unit = {\n\tname: 'Preset user shapes',\n\trun: (el) => Chessground(el, { drawable: { shapes: shapeSet1 } }),\n};\n\n/**\n * Unit test for automatically changing shapes with high difference between states\n * Creates a Chessground instance that cycles through different shape sets at regular intervals\n *\n * @property {string} name - The name of the unit test\n * @property {function} run - Function that executes the shape changing logic\n * @param {HTMLElement} el - The DOM element where Chessground will be mounted\n * @returns {Api} The Chessground API instance\n *\n * @remarks\n * The function cycles through three predefined shape sets (shapeSet1, shapeSet2, shapeSet3)\n * with a delay of 1000ms between changes. The cycling continues until the board\n * is no longer in the DOM (checked via offsetParent).\n */\nexport const changingShapesHigh: Unit = {\n\tname: 'Automatically changing shapes (high diff)',\n\trun(el) {\n\t\tconst cg = Chessground(el, { drawable: { shapes: shapeSet1 } });\n\t\tconst delay = 1000;\n\t\tconst sets = [shapeSet1, shapeSet2, shapeSet3];\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setShapes(sets[++i % sets.length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that automatically changes shapes with a low difficulty level.\n *\n * @constant\n * @type {Unit}\n * @name changingShapesLow\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that initializes the Chessground instance and starts the automatic shape changing.\n *\n * @param {HTMLElement} el - The HTML element where the Chessground instance will be initialized.\n *\n * @returns {Chessground} The initialized Chessground instance.\n */\nexport const changingShapesLow: Unit = {\n\tname: 'Automatically changing shapes (low diff)',\n\trun(el) {\n\t\tconst cg = Chessground(el, { drawable: { shapes: shapeSet1 } });\n\t\tconst delay = 1000;\n\t\tconst sets = [shapeSet1, shapeSet2, shapeSet3];\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setShapes(sets[++i % sets.length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that applies brush modifiers to drawable shapes on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name brushModifiers\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the brush modifiers on the given element.\n *\n * @param {HTMLElement} el - The HTML element to which the brush modifiers will be applied.\n *\n * @returns {Chessground} - The Chessground instance with the applied brush modifiers.\n *\n * The `run` function:\n * - Generates sets of drawable shapes with random brush modifiers.\n * - Initializes a Chessground instance with the first set of shapes.\n * - Continuously updates the shapes on the chessboard at a specified interval.\n */\nexport const brushModifiers: Unit = {\n\tname: 'Brush modifiers',\n\trun(el) {\n\t\tfunction sets() {\n\t\t\treturn [shapeSet1, shapeSet2, shapeSet3].map((set: DrawShape[]) =>\n\t\t\t\tset.map((shape: DrawShape) => {\n\t\t\t\t\tshape.modifiers = Math.round(Math.random())\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tlineWidth: 2 + Math.round(Math.random() * 3) * 4,\n\t\t\t\t\t\t\t};\n\t\t\t\t\treturn shape;\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst cg = Chessground(el, { drawable: { shapes: sets()[0] } });\n\t\tconst delay = 1000;\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setShapes(sets()[++i % sets().length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that automatically generates and sets shapes on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name autoShapes\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that initializes and runs the auto shape generation.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The Chessground instance with auto shapes functionality.\n */\nexport const autoShapes: Unit = {\n\tname: 'Autoshapes',\n\trun(el) {\n\t\tfunction sets() {\n\t\t\treturn [shapeSet1, shapeSet2, shapeSet3].map((set: DrawShape[]) =>\n\t\t\t\tset.map((shape: DrawShape) => {\n\t\t\t\t\tshape.modifiers = Math.round(Math.random())\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tlineWidth: 2 + Math.round(Math.random() * 3) * 4,\n\t\t\t\t\t\t\t};\n\t\t\t\t\treturn shape;\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst cg = Chessground(el);\n\t\tconst delay = 1000;\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setAutoShapes(sets()[++i % sets().length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * A unit configuration for creating a Chessground instance with shapes not visible.\n *\n * @constant\n * @type {Unit}\n * @name visibleFalse\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - A function that initializes a Chessground instance with the specified element.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground instance on.\n *\n * @example\n * // Usage example:\n * visibleFalse.run(document.getElementById('chessboard'));\n */\nexport const visibleFalse: Unit = {\n\tname: 'Shapes not visible',\n\trun: (el) =>\n\t\tChessground(el, {\n\t\t\tdrawable: {\n\t\t\t\tvisible: false,\n\t\t\t\tshapes: shapeSet1,\n\t\t\t},\n\t\t}),\n};\n\n/**\n * A unit configuration object for a chessboard with shapes that are not enabled but still visible.\n *\n * @constant\n * @type {Unit}\n * @property {string} name - The name of the unit.\n * @property {function} run - A function that initializes a Chessground instance with the given element.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground instance on.\n * @returns {void}\n */\nexport const enabledFalse: Unit = {\n\tname: 'Shapes not enabled, but visible',\n\trun: (el) =>\n\t\tChessground(el, {\n\t\t\tdrawable: {\n\t\t\t\tenabled: false,\n\t\t\t\tshapes: shapeSet1,\n\t\t\t},\n\t\t}),\n};\n\n/**\n * A predefined set of drawing shapes for a chessboard.\n * Each shape can represent a square highlight, an arrow, or a piece on the board.\n *\n * @type {DrawShape[]}\n *\n * @property {string} orig - The origin square of the shape.\n * @property {string} [dest] - The destination square of the shape (for arrows).\n * @property {string} brush - The color of the shape.\n * @property {Object} [piece] - The piece to be drawn on the board.\n * @property {string} piece.color - The color of the piece (e.g., \"white\" or \"black\").\n * @property {string} piece.role - The role of the piece (e.g., \"knight\", \"queen\").\n * @property {number} [piece.scale] - The scale of the piece (optional).\n */\nconst shapeSet1: DrawShape[] = [\n\t{ orig: 'a3', brush: 'green' },\n\t{ orig: 'a4', brush: 'blue' },\n\t{ orig: 'a5', brush: 'yellow' },\n\t{ orig: 'a6', brush: 'red' },\n\t{ orig: 'e2', dest: 'e4', brush: 'green' },\n\t{ orig: 'a6', dest: 'c8', brush: 'blue' },\n\t{ orig: 'f8', dest: 'f4', brush: 'yellow' },\n\t{\n\t\torig: 'h5',\n\t\tbrush: 'green',\n\t\tpiece: {\n\t\t\tcolor: 'white',\n\t\t\trole: 'knight',\n\t\t},\n\t},\n\t{\n\t\torig: 'h6',\n\t\tbrush: 'red',\n\t\tpiece: {\n\t\t\tcolor: 'black',\n\t\t\trole: 'queen',\n\t\t\tscale: 0.6,\n\t\t},\n\t},\n];\n\n/**\n * A set of drawing shapes used for rendering on a chessboard.\n * Each shape can represent a square highlight or an arrow between two squares.\n *\n * @type {DrawShape[]}\n *\n * @property {string} orig - The origin square of the shape.\n * @property {string} [dest] - The destination square of the shape (for arrows).\n * @property {string} brush - The color of the shape.\n * @property {Object} [piece] - The piece to be drawn on the origin square.\n * @property {string} piece.color - The color of the piece (e.g., \"black\" or \"white\").\n * @property {string} piece.role - The role of the piece (e.g., \"bishop\", \"knight\").\n */\nconst shapeSet2: DrawShape[] = [\n\t{ orig: 'c1', brush: 'green' },\n\t{ orig: 'd1', brush: 'blue' },\n\t{ orig: 'e1', brush: 'yellow' },\n\t{ orig: 'e2', dest: 'e4', brush: 'green' },\n\t{ orig: 'h6', dest: 'h8', brush: 'blue' },\n\t{ orig: 'b3', dest: 'd6', brush: 'red' },\n\t{ orig: 'a1', dest: 'e1', brush: 'red' },\n\t{\n\t\torig: 'f5',\n\t\tbrush: 'green',\n\t\tpiece: {\n\t\t\tcolor: 'black',\n\t\t\trole: 'bishop',\n\t\t},\n\t},\n];\n\n/**\n * A constant array of DrawShape objects representing shapes to be drawn on a chessboard.\n *\n * @constant\n * @type {DrawShape[]}\n * @default\n * @property {string} orig - The origin square of the shape on the chessboard.\n * @property {string} brush - The color of the shape.\n *\n * Example usage:\n * ```\n * const shapeSet3: DrawShape[] = [{ orig: \"e5\", brush: \"blue\" }];\n * ```\n */\nconst shapeSet3: DrawShape[] = [{ orig: 'e5', brush: 'blue' }];\n\n/**\n * A set of drawing shapes for a chessboard.\n * Each shape can represent a square highlight or an arrow between two squares.\n * Shapes can also include a piece with specific attributes.\n *\n * @type {DrawShape[]}\n * @property {string} orig - The origin square of the shape.\n * @property {string} [dest] - The destination square of the shape (for arrows).\n * @property {string} brush - The color of the shape.\n * @property {Object} [piece] - The piece to be drawn on the square.\n * @property {string} piece.color - The color of the piece (e.g., \"white\" or \"black\").\n * @property {string} piece.role - The role of the piece (e.g., \"knight\", \"queen\").\n * @property {number} [piece.scale] - The scale of the piece (optional).\n */\n","import { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit configuration for a chessboard that is view-only and\n * features two random AIs making moves.\n *\n * @constant\n * @type {Unit}\n * @name viewOnlyFullRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard\n * and starts the random AI moves.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const viewOnlyFullRandom: Unit = {\n\tname: 'View only: 2 random AIs',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tviewOnly: true,\n\t\t\tanimation: {\n\t\t\t\tduration: 1000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t\tdrawable: {\n\t\t\t\tvisible: false,\n\t\t\t},\n\t\t});\n\t\tfunction makeMove() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = moves[Math.floor(Math.random() * moves.length)];\n\t\t\tchess.move(move.san);\n\t\t\tcg.move(move.from, move.to);\n\t\t\tsetTimeout(makeMove, 700);\n\t\t}\n\t\tsetTimeout(makeMove, 700);\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { Key } from 'chessground/types.d';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit for the Crazyhouse variant where the last move is a drop.\n * This unit runs a sequence of configurations on a chessboard, each with a specific FEN and last move.\n * The configurations are cycled through with a delay between each change.\n *\n * @constant\n * @type {Unit}\n * @name lastMoveDrop\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that runs the unit.\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance.\n */\nexport const lastMoveDrop: Unit = {\n\tname: 'Crazyhouse: lastMove = drop',\n\trun(cont) {\n\t\tconst configs: Array<() => { fen: string; lastMove: Key[] }> = [\n\t\t\t() => ({\n\t\t\t\tfen: 'Bn2kb1r/p1p2ppp/4q3/2Pp4/3p1NP1/2B2n2/PPP2P1P/R2KqB1R/RNpp w k - 42 22',\n\t\t\t\tlastMove: ['e5', 'd4'],\n\t\t\t}),\n\t\t\t() => ({\n\t\t\t\tfen: 'Bn2kb1r/p1p2ppp/4q3/2Pp4/3p1NP1/2B2n2/PPP2P1P/R2KqB1R/RNpp w k - 42 22',\n\t\t\t\tlastMove: ['f4'],\n\t\t\t}),\n\t\t\t() => ({\n\t\t\t\tfen: 'Bn2kb1r/p1p2ppp/4q3/2Pp4/3p1NP1/2B2n2/PPP2P1P/R2KqB1R/RNpp w k - 42 22',\n\t\t\t\tlastMove: ['e1'],\n\t\t\t}),\n\t\t];\n\t\tconst cg = Chessground(cont, configs[0]());\n\t\tconst delay = 2000;\n\t\tlet it = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst config = configs[++it % configs.length];\n\t\t\t//console.log(config);\n\t\t\tcg.set(config());\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n","/*\n * Public API Surface of ngx-chessground\n */\n\nexport * from './lib/ngx-chessground/ngx-chessground.component';\nexport * from './lib/ngx-chessground-table/ngx-chessground-table.component';\nexport * from './lib/pgn-viewer/pgn-viewer.component';\nexport * from './lib/pgn-viewer/pgn-viewer-engine.service';\nexport * from './lib/promotion-dialog/promotion.service';\nexport * from './lib/promotion-dialog/promotion-dialog.component';\n\nexport * from './units/anim';\nexport * from './units/basics';\nexport * from './units/fen';\nexport * from './units/in3d';\nexport * from './units/perf';\nexport * from './units/pgn';\nexport * from './units/play';\nexport * from './units/svg';\nexport * from './units/unit';\nexport * from './units/util';\nexport * from './units/viewOnly';\nexport * from './units/zh';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["play.createPlayUnitsWithDialog","decompressZst","loadZipAsync"],"mappings":";;;;;;;;;;;;;;;;;;AAYA;;;;;;;AAOG;MAEU,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;AAEC;;;AAGG;QACc,IAAA,CAAA,KAAK,GAAG,IAAI,CAAC;YAC7B,WAAW;YACX,gBAAgB;YAChB,oBAAoB;AACpB,SAAA,CAAC;AAwDF;;;;;;AAMG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,CAAC,KAAY,EAAE,OAAe,K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