usi-csa-bridge 1.15.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(()=>{"use strict";var e={3995:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Client=t.State=void 0;const n=o(2851),i=o(4725),a=o(3010),r=o(1869),s=o(8474),l=o(9169);var c;!function(e){e.IDLE="idle",e.CONNECTING="connecting",e.CONNECTED="connected",e.WAITING_GAME_SUMMARY="waitingGameSummary",e.GAME_SUMMARY="gameSummary",e.GAME_TIME="gameTime",e.GAME_TIME_B="gameTimeB",e.GAME_TIME_W="gameTimeW",e.GAME_POSITION="gamePosition",e.READY="ready",e.WAITING_START="waitingStart",e.WAITING_REJECT="waitingReject",e.PLAYING="playing",e.WAITING_LOGOUT="waitingLogout",e.WAITING_CLOSE="waitingClose",e.CLOSED="closed"}(c||(t.State=c={}));t.Client=class{sessionID;_setting;logger;_state=c.IDLE;gameSummaryCallback;rejectCallback;startCallback;moveCallback;gameResultCallback;closeCallback;errorCallback;commandCallback;socket;gameSummary=(0,i.emptyCSAGameSummary)();playerStates=(0,i.emptyCSAPlayerStates)();specialMove=i.CSASpecialMove.UNKNOWN;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};_createdMs=Date.now();_loggedInMs;blankLinePingTimeout=null;constructor(e,t,o){this.sessionID=e,this._setting=t,this.logger=o}get setting(){return this._setting}get state(){return this._state}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get createdMs(){return this._createdMs}get loggedInMs(){return this._loggedInMs}on(e,t){switch(e){case"gameSummary":this.gameSummaryCallback=t;break;case"reject":this.rejectCallback=t;break;case"start":this.startCallback=t;break;case"move":this.moveCallback=t;break;case"gameResult":this.gameResultCallback=t;break;case"close":this.closeCallback=t;break;case"error":this.errorCallback=t;break;case"command":this.commandCallback=t}return this}login(){this.logger.info("sid=%d: connecting to %s:%d",this.sessionID,this.setting.host,this.setting.port),this._state=c.CONNECTING,this.socket=new r.Socket(this.setting.host,this.setting.port,{onConnect:this.onConnect.bind(this),onError:this.onConnectionError.bind(this),onFIN:this.onFIN.bind(this),onClose:this.onClose.bind(this),onRead:this.onRead.bind(this)},{keepaliveInitialDelay:this.setting.tcpKeepalive.initialDelay})}logout(){if(this.setting.protocolVersion===a.CSAProtocolVersion.V121_FLOODGATE)this.socket&&(this.logger.info("sid=%d: disconnect",this.sessionID),this.socket.end(),this._state=c.WAITING_CLOSE);else this.state!==c.WAITING_GAME_SUMMARY&&this.state!==c.GAME_SUMMARY&&this.state!==c.GAME_TIME&&this.state!==c.GAME_TIME_B&&this.state!==c.GAME_TIME_W&&this.state!==c.GAME_POSITION&&this.state!==c.READY||(this.send("LOGOUT"),this._state=c.WAITING_LOGOUT)}agree(e){this.state===c.READY&&e===this.gameSummary.id&&(this._state=c.WAITING_START,this.send(`AGREE ${this.gameSummary.id}`))}reject(e){this.state===c.READY&&e===this.gameSummary.id&&(this._state=c.WAITING_REJECT,this.send(`REJECT ${this.gameSummary.id}`))}doMove(e,t,o){if(this.state!==c.PLAYING)return;let n=e;void 0!==t&&(n+=`,'* ${Math.round(t)}`,void 0!==o&&(n+=` ${o}`)),this.send(n)}resign(){this.state===c.PLAYING&&this.send("%TORYO")}win(){this.state===c.PLAYING&&this.send("%KACHI")}stop(){this.state===c.PLAYING&&this.send("%CHUDAN")}send(e){this.socket?(this.socket.write(e),this._lastSent=(0,l.newCommand)(l.CommandType.SEND,this.hideSecureValues(e)),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,this.hideSecureValues(e)),this.setBlankLinePing(e)):this.logger.error("sid=%d: failed to send command caused by invalid socket: %s",this.sessionID,e)}hideSecureValues(e){return this.setting.password&&(e=e.replaceAll(this.setting.password,"*****")),e}onConnect(){this.logger.info("sid=%d: connected",this.sessionID),this._state=c.CONNECTED;let e="";this.setting.protocolVersion===a.CSAProtocolVersion.V121_X1&&(e=" x1"),this.send(`LOGIN ${this.setting.id} ${this.setting.password}${e}`)}onConnectionError(e){if(this.state===c.CLOSED)return;this.onError(e),this._state=c.CLOSED,this.closeCallback?.();const t=(0,l.newCommand)(l.CommandType.SYSTEM,"connection error");this.updateCommendHistory(t),this.commandCallback?.(t)}onError(e){this.logger.error("sid=%d: error: %s %s",this.sessionID,e.name,e.message),this.errorCallback?.(e)}onFIN(){this.logger.info("sid=%d: FIN packet received",this.sessionID),this.clearBlankLinePing()}onClose(e){if(this.clearBlankLinePing(),this.state===c.CLOSED)return;switch(this.state){case c.WAITING_GAME_SUMMARY:case c.WAITING_LOGOUT:case c.WAITING_CLOSE:e?this.onError(new Error(s.t.errorOccuredWhileDisconnectingFromCSAServer)):this.logger.info("sid=%d: socket closed",this.sessionID);break;case c.CONNECTING:this.onError(new Error(s.t.failedToConnectToCSAServer));break;default:this.onError(new Error(s.t.disconnectedFromCSAServer))}this._state=c.CLOSED,this.closeCallback?.();const t=(0,l.newCommand)(l.CommandType.SYSTEM,e?"closed (error)":"closed");this.updateCommendHistory(t),this.commandCallback?.(t)}onRead(e){this.setBlankLinePing(),this._lastReceived=(0,l.newCommand)(l.CommandType.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),""!==e&&(this.state===c.GAME_SUMMARY?this.onGameSummary(e):this.state===c.GAME_TIME?this.onGameTime(e):this.state===c.GAME_TIME_B?this.onGameTime(e,n.Color.BLACK):this.state===c.GAME_TIME_W?this.onGameTime(e,n.Color.WHITE):this.state===c.GAME_POSITION?this.onGamePosition(e):this.state===c.PLAYING?this.onMove(e):e.match(/^LOGIN:.* OK$/)?this.onLoginOK():"LOGIN:incorrect"===e?this.onLoginIncorrect():"LOGOUT:completed"===e?this.onLogout():"BEGIN Game_Summary"===e?this.onBeginGameSummary():e.startsWith("REJECT:")?this.onReject():e.startsWith("START:")?this.onStart():this.logger.warn("sid=%d: unknown command received",this.sessionID))}onLoginOK(){this._loggedInMs=Date.now(),this.logger.info("sid=%d: login ok",this.sessionID),this._state=c.WAITING_GAME_SUMMARY}onLoginIncorrect(){this.onError(new Error(s.t.csaServerLoginDenied)),this.socket&&this.socket.end()}onLogout(){this.logger.info("sid=%d: logout",this.sessionID),this._state=c.WAITING_CLOSE}onBeginGameSummary(){this._state=c.GAME_SUMMARY,this.gameSummary=(0,i.emptyCSAGameSummary)()}onEndGameSummary(){const e=this.gameSummary.players.black.time,t=this.gameSummary.players.white.time;this.playerStates.black.time=e.totalTime+e.increment,this.playerStates.white.time=t.totalTime+t.increment;const o=(0,n.importCSA)(this.gameSummary.position);if(o instanceof Error)return this.onError(new Error("invalid game position received from CSA server")),void this.logout();for(const e of o.moves){if((0,n.isKnownSpecialMove)(e.move)&&e.move.type===n.SpecialMoveType.START)continue;const t=(0,n.reverseColor)(e.nextColor);this.updateTime(t,e.elapsedMs)}this._state=c.READY,this.gameSummaryCallback?.(this.gameSummary)}onGameSummary(e){switch(e){case"END Game_Summary":return void this.onEndGameSummary();case"BEGIN Time":return void(this._state=c.GAME_TIME);case"BEGIN Time+":return void(this._state=c.GAME_TIME_B);case"BEGIN Time-":return void(this._state=c.GAME_TIME_W);case"BEGIN Position":return void(this._state=c.GAME_POSITION)}const[t,o]=e.split(":",2);switch(t){case"Protocol_Version":case"Protocol_Mode":case"Format":case"Declaration":case"Rematch_On_Draw":case"Max_Moves":break;case"Game_ID":this.gameSummary.id=o;break;case"Name+":this.gameSummary.players.black.playerName=o;break;case"Name-":this.gameSummary.players.white.playerName=o;break;case"Your_Turn":this.gameSummary.myColor="+"===o?n.Color.BLACK:n.Color.WHITE;break;case"To_Move":this.gameSummary.toMove="+"===o?n.Color.BLACK:n.Color.WHITE;break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGameTime(e,t){switch(e){case"END Time":case"END Time+":case"END Time-":return void(this._state=c.GAME_SUMMARY)}const o=t?[this.gameSummary.players[t].time]:[this.gameSummary.players.black.time,this.gameSummary.players.white.time],[n,i]=e.split(":",2);switch(n){case"Least_Time_Per_Move":case"Time_Roundup":break;case"Time_Unit":for(const e of o)i.endsWith("msec")?e.timeUnitMs=Number(i.slice(0,-4)):i.endsWith("sec")?e.timeUnitMs=1e3*Number(i.slice(0,-3)):i.endsWith("min")&&(e.timeUnitMs=60*Number(i.slice(0,-3))*1e3);break;case"Total_Time":for(const e of o)e.totalTime=Number(i);break;case"Byoyomi":for(const e of o)e.byoyomi=Number(i);break;case"Delay":for(const e of o)e.delay=Number(i);break;case"Increment":for(const e of o)e.increment=Number(i);break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGamePosition(e){"END Position"!==e?this.gameSummary.position+=e+"\n":this._state=c.GAME_SUMMARY}onReject(){this._state=c.WAITING_GAME_SUMMARY,this.rejectCallback?.()}onStart(){this._state=c.PLAYING,this.startCallback?.(this.playerStates)}onMove(e){e.startsWith("+")?this.onMoveWithColor(e,n.Color.BLACK):e.startsWith("-")?this.onMoveWithColor(e,n.Color.WHITE):e.startsWith("#")?this.onEndingCommand(e):e.startsWith("%")||this.logger.warn("sid=%d: unknown move command received",this.sessionID)}onMoveWithColor(e,t){const o=/^.*,T([0-9]+)$/.exec(e);if(o){const e=Number(o[1]);this.updateTime(t,1e3*e)}else this.logger.error("sid=%d: invalid move format",this.sessionID);this.moveCallback?.(e,this.playerStates)}updateTime(e,t){const o=this.gameSummary.players[e].time,n=t/o.timeUnitMs,i=this.playerStates[e].time-n+o.increment;this.playerStates[e].time=Math.max(i,0)}onEndingCommand(e){switch(e){case"#RESIGN":this.specialMove=i.CSASpecialMove.RESIGN;break;case"#SENNICHITE":this.specialMove=i.CSASpecialMove.SENNICHITE;break;case"#OUTE_SENNICHITE":this.specialMove=i.CSASpecialMove.OUTE_SENNICHITE;break;case"#ILLEGAL_MOVE":this.specialMove=i.CSASpecialMove.ILLEGAL_MOVE;break;case"#ILLEGAL_ACTION":this.specialMove=i.CSASpecialMove.ILLEGAL_ACTION;break;case"#TIME_UP":this.specialMove=i.CSASpecialMove.TIME_UP;break;case"#JISHOGI":this.specialMove=i.CSASpecialMove.JISHOGI;break;case"#MAX_MOVES":this.specialMove=i.CSASpecialMove.MAX_MOVES;break;case"#WIN":this.onGameResult(i.CSAGameResult.WIN);break;case"#LOSE":this.onGameResult(i.CSAGameResult.LOSE);break;case"#DRAW":this.onGameResult(i.CSAGameResult.DRAW);break;case"#CENSORED":this.onGameResult(i.CSAGameResult.CENSORED);break;case"#CHUDAN":this.onGameResult(i.CSAGameResult.CHUDAN)}}onGameResult(e){this._state=c.WAITING_GAME_SUMMARY,this.gameResultCallback?.(this.specialMove,e)}invoke(e,t){switch(e){case l.CommandType.SEND:this.send(t);break;case l.CommandType.RECEIVE:this.onRead(t)}}setBlankLinePing(e){this.setting.blankLinePing&&(this.clearBlankLinePing(),this.blankLinePingTimeout=setTimeout((()=>{this.send("")}),1e3*(""===e?this.setting.blankLinePing.interval:this.setting.blankLinePing.initialDelay)))}clearBlankLinePing(){this.blankLinePingTimeout&&(clearTimeout(this.blankLinePingTimeout),this.blankLinePingTimeout=null)}updateCommendHistory(e){(0,l.addCommand)(this._commandHistory,e,100,10)}}},242:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.invokeCommand=t.getCommandHistory=t.collectSessionStates=t.stop=t.win=t.resign=t.doMove=t.agree=t.logout=t.login=t.setHandlers=void 0;const n=o(1626),i=o(3995);let a;t.setHandlers=function(e){if(a)throw new Error("handlers already set");a=e};let r=0;const s=new Map;t.login=function(e){const t=(r+=1,r),o=new i.Client(t,e,(0,n.getCSALogger)()).on("gameSummary",(e=>a.onCSAGameSummary(t,e))).on("reject",(()=>a.onCSAReject(t))).on("start",(e=>a.onCSAStart(t,e))).on("move",((e,o)=>a.onCSAMove(t,e,o))).on("gameResult",((e,o)=>a.onCSAGameResult(t,e,o))).on("close",(()=>{setTimeout((()=>{s.delete(t)}),1e4),a.onCSAClose(t)})).on("error",a.sendError).on("command",(e=>{a.sendPromptCommand(t,e)}));return s.set(t,o),o.login(),t},t.logout=function(e){s.get(e)?.logout()},t.agree=function(e,t){s.get(e)?.agree(t)},t.doMove=function(e,t,o,n){s.get(e)?.doMove(t,o,n)},t.resign=function(e){s.get(e)?.resign()},t.win=function(e){s.get(e)?.win()},t.stop=function(e){s.get(e)?.stop()},t.collectSessionStates=function(){return Array.from(s.entries()).map((([e,t])=>({sessionID:e,host:t.setting.host,port:t.setting.port,loginID:t.setting.id,protocolVersion:t.setting.protocolVersion,stateCode:t.state,lastReceived:t.lastReceived,lastSent:t.lastSent,createdMs:t.createdMs,loggedInMs:t.loggedInMs,updatedMs:Date.now(),closed:t.state===i.State.WAITING_CLOSE||t.state===i.State.CLOSED}))).sort(((e,t)=>t.sessionID-e.sessionID))},t.getCommandHistory=function(e){const t=s.get(e);if(t)return t.commandHistory;throw new Error(`session not found: ${e}`)},t.invokeCommand=function(e,t,o){s.get(e)?.invoke(t,o)}},1869:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const i=n(o(9427)),a=o(7558);t.Socket=class{socket;readline;constructor(e,t,o,n={keepaliveInitialDelay:0}){this.socket=i.default.createConnection({port:t,host:e},o.onConnect).setKeepAlive(!0,1e3*n.keepaliveInitialDelay).on("error",o.onError).on("end",o.onFIN).on("close",(e=>{this.closeReadline(),o.onClose(e)})),this.readline=(0,a.createInterface)(this.socket),this.readline.on("line",o.onRead)}write(e){this.socket.write(e+"\n")}end(){this.socket.end()}closeReadline(){this.readline&&(this.readline.close(),this.readline=null)}}},3746:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.listFiles=t.exists=void 0;const i=o(9971),a=n(o(6743));t.exists=async function(e){try{return await i.promises.lstat(e),!0}catch{return!1}},t.listFiles=async function e(t,o){const n=[],r=await i.promises.readdir(t);for(const s of r){const r=a.default.join(t,s),l=await i.promises.lstat(r);l.isFile()?n.push(r):o>0&&l.isDirectory()&&n.push(...await e(r,o-1))}return n}},6801:(e,t,o)=>{function n(){return o(1288)}Object.defineProperty(t,"__esModule",{value:!0}),t.getElectron=t.requireElectron=void 0,t.requireElectron=n,t.getElectron=function(){try{return n()}catch{return null}}},1626:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tailLogFile=t.getTailCommand=t.openLogFile=t.shutdownLoggers=t.getCSALogger=t.getUSILogger=t.getAppLogger=t.setLogDestinations=t.openLogsDirectory=void 0;const s=r(o(6743)),l=r(o(636)),c=a(o(983)),d=o(5746),u=o(3974),m=o(1219),h=o(6801),p=(0,u.getAppPath)("logs");t.openLogsDirectory=function(){(0,h.requireElectron)().shell.openPath(p)};const g=(0,d.getDateTimeString)().replaceAll(" ","_").replaceAll("/","").replaceAll(":",""),S=s.default.join(p,`app-${g}.log`),y=s.default.join(p,`usi-${g}.log`),f=s.default.join(p,`csa-${g}.log`),v={appenders:{stdout:{type:"stdout"},recording:{type:"recording"}},categories:{default:{appenders:["stdout"],level:"info"}}};function b(e){switch(e){case m.LogType.APP:return S;case m.LogType.USI:return y;case m.LogType.CSA:return f}}const I={[m.LogType.APP]:["stdout"],[m.LogType.USI]:["stdout"],[m.LogType.CSA]:["stdout"]},T={[m.LogType.APP]:m.LogLevel.INFO,[m.LogType.USI]:m.LogLevel.INFO,[m.LogType.CSA]:m.LogLevel.INFO};t.setLogDestinations=function(e,t,o){I[e]=t.map((t=>"file"===t?e:t)),T[e]=o};const E={};function C(e){if(E[e])return E[e];v.appenders[e]||(v.appenders[e]={type:"file",filename:b(e)},v.categories[e]={appenders:I[e],level:T[e]});const t=c.configure(v).getLogger(e);return E[e]=t,t}function A(e){const t=b(e);return"win32"===process.platform?`Get-Content -Path "${t}" -Wait -Tail 10`:`tail -f "${t}"`}t.getAppLogger=function(){return C(m.LogType.APP)},t.getUSILogger=function(){return C(m.LogType.USI)},t.getCSALogger=function(){return C(m.LogType.CSA)},t.shutdownLoggers=function(){c.shutdown((e=>{console.error("failed to shutdown loggers:",e)}))},t.openLogFile=function(e){(0,h.requireElectron)().shell.openPath(b(e))},t.getTailCommand=A,t.tailLogFile=function(e){const t=A(e).replaceAll('"','\\"');switch(process.platform){case"win32":l.default.spawn("powershell.exe",["-Command",`start-process powershell '-NoExit','-Command "${t}"'`]);break;case"darwin":l.default.spawn("osascript",["-e",`tell app "Terminal" to do script "${t}"`,"-e",'tell app "Terminal" to activate'])}}},3974:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAppPath=t.getTempPathForTesting=t.getPortableExeDir=t.isPortable=t.isProduction=t.isTest=t.isPreview=t.isDevelopment=void 0;const i=n(o(9971)),a=n(o(1258)),r=n(o(6743)),s=o(6801);function l(){return"electron:serve"===process.env.npm_lifecycle_event&&!0}function c(){return"electron:preview"===process.env.npm_lifecycle_event}function d(){return!1}let u;function m(){return u||(u=i.default.mkdtempSync(r.default.join(a.default.tmpdir(),"electron-shogi-test-"))),u}t.isDevelopment=l,t.isPreview=c,t.isTest=d,t.isProduction=function(){return!l()&&!c()&&!0},t.isPortable=function(){return void 0!==process.env.PORTABLE_EXECUTABLE_DIR},t.getPortableExeDir=function(){return process.env.PORTABLE_EXECUTABLE_DIR},t.getTempPathForTesting=m,t.getAppPath=function(e){const t=(0,s.getElectron)()?.app;if(t)return t.getPath(e);switch(e){case"logs":return r.default.join(process.cwd(),"logs");case"exe":return process.argv[1];default:return process.cwd()}}},2992:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EngineProcess=t.State=t.GameResult=void 0;const n=o(2040),i=o(7187),a=o(6797),r=o(9169);var s,l;function c(e){switch(e){case"+":case"+0":case"0":return+i.SCORE_MATE_INFINITE;case"-":case"-0":return-i.SCORE_MATE_INFINITE;default:return Number(e)}}function d(e){const t={},o=e.split(" ");for(let n=0;n<e.length;n+=1)switch(o[n]){case"depth":t.depth=Number(o[n+1]),n+=1;break;case"seldepth":t.seldepth=Number(o[n+1]),n+=1;break;case"time":t.timeMs=Number(o[n+1]),n+=1;break;case"nodes":t.nodes=Number(o[n+1]),n+=1;break;case"pv":t.pv=o.slice(n+1),n=o.length;break;case"multipv":t.multipv=Number(o[n+1]),n+=1;break;case"score":switch(o[n+1]){case"cp":t.scoreCP=Number(o[n+2]),n+=2;break;case"mate":t.scoreMate=c(o[n+2]),n+=2}break;case"lowerbound":t.lowerbound=!0;break;case"upperbound":t.upperbound=!0;break;case"currmove":t.currmove=o[n+1],n+=1;break;case"hashfull":t.hashfullPerMill=Number(o[n+1]),n+=1;break;case"nps":t.nps=Number(o[n+1]),n+=1;break;case"string":t.string=o.slice(n+1).join(" "),n=o.length}return t}function u(e){return e?`btime ${e.btime} wtime ${e.wtime} `+(0!==e.binc||0!==e.winc?`binc ${e.binc} winc ${e.winc}`:`byoyomi ${e.byoyomi}`):"infinite"}!function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(s||(t.GameResult=s={})),function(e){e.WaitingForUSIOK="waitingForUSIOK",e.NotReady="notReady",e.WaitingForReadyOK="waitingForReadyOK",e.Ready="ready",e.WaitingForBestMove="waitingForBestMove",e.Ponder="ponder",e.WaitingForPonderBestMove="waitingForPonderBestMove",e.WaitingForCheckmate="waitingForCheckmate",e.WillQuit="willQuit"}(l||(t.State=l={}));t.EngineProcess=class{_path;sessionID;logger;option;process=null;_name="NO NAME";_author="";_engineOptions={};_state=l.WaitingForUSIOK;_currentPosition="";invalidBestMoveCount=0;reservedGoCommand;launchTimeout;quitTimeout;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};timeoutCallback;errorCallback;usiOkCallback;readyCallback;bestMoveCallback;checkmateCallback;checkmateNotImplementedCallback;checkmateTimeoutCallback;noMateCallback;infoCallback;ponderInfoCallback;commandCallback;constructor(e,t,o,n){this._path=e,this.sessionID=t,this.logger=o,this.option=n}get path(){return this._path}get name(){return this._name}get author(){return this._author}get engineOptions(){return this._engineOptions}get state(){return this._state}get currentPosition(){return this._currentPosition}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get pid(){return this.process?.pid}on(e,t){switch(e){case"timeout":this.timeoutCallback=t;break;case"error":this.errorCallback=t;break;case"usiok":this.usiOkCallback=t;break;case"ready":this.readyCallback=t;break;case"bestmove":this.bestMoveCallback=t;break;case"checkmate":this.checkmateCallback=t;break;case"checkmateNotImplemented":this.checkmateNotImplementedCallback=t;break;case"checkmateTimeout":this.checkmateTimeoutCallback=t;break;case"noMate":this.noMateCallback=t;break;case"info":this.infoCallback=t;break;case"ponderInfo":this.ponderInfoCallback=t;break;case"command":this.commandCallback=t}return this}launch(){this.logger.info("sid=%d: launch: %s",this.sessionID,this.path),this.setLaunchTimeout(),this.process=new a.ChildProcess(this.path),this.process.on("error",this.onError.bind(this)),this.process.on("close",this.onClose.bind(this)),this.process.on("receive",this.onReceive.bind(this)),this.send("usi")}quit(){this.state!==l.WillQuit&&(this._state=l.WillQuit,this.clearLaunchTimeout(),this.logger.info("sid=%d: quit USI engine",this.sessionID),this.process&&(this.setQuitTimeout(),this.send("quit")))}setOption(e,t){void 0!==t?this.send(`setoption name ${e} value ${t}`):this.send(`setoption name ${e}`)}ready(){if(this.state!==l.WaitingForReadyOK){if(this.state!==l.Ready&&this.state!==l.WaitingForBestMove&&this.state!==l.Ponder&&this.state!==l.WaitingForPonderBestMove&&this.state!==l.WaitingForCheckmate||this.gameover(s.DRAW),this.state!==l.NotReady)return this.logger.warn("sid=%d: ready: unexpected state: %s",this.sessionID,this.state),new Error("unexpected state");this.send("isready"),this._state=l.WaitingForReadyOK}}go(e,t){switch(this.reservedGoCommand={position:e,timeState:t},this.state){case l.Ready:this.sendReservedGoCommands();break;case l.WaitingForBestMove:case l.Ponder:case l.WaitingForCheckmate:this.stop()}}goPonder(e,t){this.state===l.Ready?(this.reservedGoCommand={position:e,timeState:this.option.enableEarlyPonder?void 0:t,ponder:!0},this.sendReservedGoCommands()):this.logger.warn("sid=%d: goPonder: unexpected state: %s",this.sessionID,this.state)}goMate(e){this.state===l.Ready?(this.reservedGoCommand={position:e,mate:!0},this.sendReservedGoCommands()):this.logger.warn("sid=%d: goMate: unexpected state: %s",this.sessionID,this.state)}ponderHit(e){this.state===l.Ponder?(this.option.enableEarlyPonder?this.send("ponderhit "+u(e)):this.send("ponderhit"),this._state=l.WaitingForBestMove):this.logger.warn("sid=%d: ponderHit: unexpected state: %s",this.sessionID,this.state)}stop(){this.state===l.WaitingForBestMove||this.state===l.Ponder||this.state===l.WaitingForCheckmate?"stop"!==this.lastSent?.command&&(this.send("stop"),this.state===l.Ponder&&(this._state=l.WaitingForPonderBestMove)):this.logger.warn("sid=%d: stop: unexpected state: %s",this.sessionID,this.state)}gameover(e){switch(this.state){case l.WaitingForUSIOK:case l.NotReady:case l.WaitingForReadyOK:case l.WillQuit:return void this.logger.warn("sid=%d: gameover: unexpected state: %s",this.sessionID,this.state);case l.WaitingForBestMove:case l.Ponder:this.stop(),this.invalidBestMoveCount++;break;case l.WaitingForPonderBestMove:this.invalidBestMoveCount++;break;case l.WaitingForCheckmate:this.stop();case l.Ready:}this.send("gameover "+e),this._state=l.NotReady,this.reservedGoCommand=void 0}setLaunchTimeout(){this.launchTimeout=setTimeout((()=>{this.timeoutCallback?.(),this.quit()}),this.option.timeout||1e4)}clearLaunchTimeout(){this.launchTimeout&&(clearTimeout(this.launchTimeout),this.launchTimeout=void 0)}setQuitTimeout(){this.quitTimeout=setTimeout((()=>{this.process&&(this.process.kill(),this.process=null)}),5e3)}clearQuitTimeout(){this.quitTimeout&&(clearTimeout(this.quitTimeout),this.quitTimeout=void 0)}onError(e){this.errorCallback?.(e),this.quit()}onClose(e,t){this.logger.info("sid=%d: engine process closed: close=%s signal=%s",this.sessionID,e,t),this.state!==l.WillQuit&&this.errorCallback?.(new Error("closed unexpectedly")),this.clearLaunchTimeout(),this.clearQuitTimeout(),this.process=null;const o=(0,r.newCommand)(r.CommandType.SYSTEM,`closed: close=${e} signal=${t}`);this.updateCommendHistory(o),this.commandCallback?.(o)}sendReservedGoCommands(){if(!this.reservedGoCommand)return;this.send(this.reservedGoCommand.position);let e="",t="";var o;this.reservedGoCommand.ponder?(e="ponder",t=(o=this.reservedGoCommand.timeState)?u(o):""):this.reservedGoCommand.mate?(e="mate",t=u(this.reservedGoCommand.timeState)):t=u(this.reservedGoCommand.timeState),this.send("go"+(e?" "+e:"")+(t?" "+t:"")),this._currentPosition=this.reservedGoCommand.position,this._state=this.reservedGoCommand.ponder?l.Ponder:this.reservedGoCommand.mate?l.WaitingForCheckmate:l.WaitingForBestMove,this.reservedGoCommand=void 0}send(e){this.process&&(this.process.send(e),this._lastSent=(0,r.newCommand)(r.CommandType.SEND,e),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,e))}onReceive(e){this._lastReceived=(0,r.newCommand)(r.CommandType.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),this.state!==l.WillQuit&&(e.startsWith("id name ")?this.onIDName(e.substring(8)):e.startsWith("id author ")?this.onIDAuthor(e.substring(10)):e.startsWith("option ")?this.onOption(e.substring(7)):"usiok"===e?this.onUSIOk():"readyok"===e?this.onReadyOk():e.startsWith("bestmove ")?this.onBestMove(e.substring(9)):e.startsWith("checkmate ")?this.onCheckmate(e.substring(10)):e.startsWith("info ")&&this.onInfo(e.substring(5)))}onIDName(e){this._name=e}onIDAuthor(e){this._author=e}onOption(e){const t=e.split(" ");if(t.length<4||"name"!==t[0]||"type"!==t[2])return void this.logger.error("sid=%d: invalid option command",this.sessionID);const o=t[1],n=t[3],i=100+Object.keys(this._engineOptions).length,a="combo"===n?{name:o,type:n,order:i,vars:[]}:{name:o,type:n,order:i};if("button"!==a.type)for(let e=4;e+1<t.length;e+=2)switch(t[e]){case"default":a.default="spin"===a.type?Number(t[e+1]):t[e+1];break;case"min":"spin"===a.type&&(a.min=Number(t[e+1]));break;case"max":"spin"===a.type&&(a.max=Number(t[e+1]));break;case"var":"combo"===a.type&&a.vars.push(t[e+1])}this._engineOptions[a.name]=a}onUSIOk(){this.state===l.WaitingForUSIOK?(this.engineOptions[n.USIHash]||(this._engineOptions[n.USIHash]={name:n.USIHash,type:"spin",order:1,default:32}),this.engineOptions[n.USIPonder]||(this._engineOptions[n.USIPonder]={name:n.USIPonder,type:"check",order:2,default:"true"}),this.option.engineOptions&&this.option.engineOptions.forEach((e=>{const t=(0,n.getUSIEngineOptionCurrentValue)(e);void 0!==t&&this.setOption(e.name,t)})),this.clearLaunchTimeout(),this._state=l.NotReady,this.usiOkCallback?.()):this.logger.warn("sid=%d: onUSIOk: unexpected state: %s",this.sessionID,this.state)}onReadyOk(){this.state===l.WaitingForReadyOK?(this._state=l.Ready,this.readyCallback?.(),this.send("usinewgame"),this.sendReservedGoCommands()):this.logger.warn("sid=%d: onReadyOk: unexpected state: %s",this.sessionID,this.state)}onBestMove(e){if(this.invalidBestMoveCount>0)return this.invalidBestMoveCount--,void this.logger.warn("sid=%d: onBestMove: ignore bestmove: %s",this.sessionID,e);if(this.state===l.WaitingForBestMove||this.state===l.WaitingForPonderBestMove){if(this.bestMoveCallback&&this.state===l.WaitingForBestMove){const t=e.split(" "),o=t[0],n=t.length>=3&&"ponder"===t[1]&&t[2]||void 0;this.bestMoveCallback(this.currentPosition,o,n)}this._state=l.Ready,this._currentPosition="",this.sendReservedGoCommands()}else this.logger.warn("sid=%d: onBestMove: unexpected state: %s",this.sessionID,this.state)}onCheckmate(e){this.state===l.WaitingForCheckmate?(this._state=l.Ready,"notimplemented"!==e.trim()?"timeout"!==e.trim()?"nomate"!==e.trim()?this.checkmateCallback?.(this.currentPosition,e.trim().split(" ")):this.noMateCallback?.(this.currentPosition):this.checkmateTimeoutCallback?.(this.currentPosition):this.checkmateNotImplementedCallback?.()):this.logger.warn("sid=%d: onCheckmate: unexpected state: %s",this.sessionID,this.state)}onInfo(e){switch(this.state){case l.WaitingForBestMove:case l.WaitingForCheckmate:this.infoCallback?.(this.currentPosition,d(e));break;case l.Ponder:case l.WaitingForPonderBestMove:this.ponderInfoCallback?.(this.currentPosition,d(e))}}invoke(e,t){switch(e){case r.CommandType.SEND:this.send(t);break;case r.CommandType.RECEIVE:this.onReceive(t)}}updateCommendHistory(e){(0,r.addCommand)(this._commandHistory,e,100,10)}}},9336:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.invokeCommand=t.getCommandHistory=t.collectSessionStates=t.quitAll=t.quit=t.gameover=t.stop=t.ponderHit=t.goMate=t.goInfinite=t.goPonder=t.go=t.ready=t.setupPlayer=t.sendSetOptionCommand=t.getUSIEngineInfo=t.setHandlers=void 0;const r=o(2040),s=o(2992),l=a(o(7367)),c=o(3695),d=o(8474),u=o(9249),m=o(1626),h=o(2851);let p;function g(e){return new Error(d.t.noResponseFromEnginePleaseExtendTimeout(e))}t.setHandlers=function(e){if(p)throw new Error("handlers already set");p=e},t.getUSIEngineInfo=function(e,t){const o=y();return new Promise(((n,i)=>{const a=new s.EngineProcess((0,u.resolveEnginePath)(e),o,(0,m.getUSILogger)(),{timeout:1e3*t}).on("error",i).on("timeout",(()=>i(g(t)))).on("usiok",(()=>{n({...(0,r.emptyUSIEngineSetting)(),uri:l.issueEngineURI(),name:a.name,defaultName:a.name,author:a.author,path:e,options:a.engineOptions}),a.quit()})).on("command",(e=>{p.sendPromptCommand(o,e)}));a.launch()}))},t.sendSetOptionCommand=function(e,t,o){const n=y();return new Promise(((i,a)=>{const r=new s.EngineProcess((0,u.resolveEnginePath)(e),n,(0,m.getUSILogger)(),{timeout:1e3*o}).on("error",a).on("timeout",(()=>{a(g(o))})).on("usiok",(()=>{r.setOption(t),i(),r.quit()})).on("command",(e=>{p.sendPromptCommand(n,e)}));r.launch()}))};let S=0;function y(){return S+=1,S}const f=new Map;function v(e){const t=f.get(e);if(!t)throw new Error("No engine session: SessionID="+e);return t}function b(e,t){const o=t.black,n=t.white,i=t[e].byoyomi;return{btime:o.timeMs-1e3*o.increment,wtime:n.timeMs-1e3*n.increment,byoyomi:1e3*i,binc:0===i?1e3*o.increment:0,winc:0===i?1e3*n.increment:0}}t.setupPlayer=function(e,t){const o=y(),n=new s.EngineProcess((0,u.resolveEnginePath)(e.path),o,(0,m.getUSILogger)(),{timeout:1e3*t,engineOptions:Object.values(e.options),enableEarlyPonder:e.enableEarlyPonder});return f.set(o,{process:n,setting:e,createdMs:Date.now()}),new Promise(((e,i)=>{n.on("error",i).on("timeout",(()=>i(g(t)))).on("bestmove",((e,t,n)=>p.onUSIBestMove(o,e,t,n))).on("checkmate",((e,t)=>{p.onUSICheckmate(o,e,t)})).on("checkmateNotImplemented",(()=>{p.onUSICheckmateNotImplemented(o)})).on("checkmateTimeout",(e=>{p.onUSICheckmateTimeout(o,e)})).on("noMate",(e=>{p.onUSINoMate(o,e)})).on("usiok",(()=>e(o))).on("command",(e=>{p.sendPromptCommand(o,e)})),n.launch()}))},t.ready=function(e){const t=v(e);return new Promise(((e,o)=>{t.process.on("ready",e).on("error",o);const n=t.process.ready();n&&o(n)}))},t.go=function(e,t,o){const n=v(e),i=(0,h.getNextColorFromUSI)(t);n.process.go(t,b(i,o)),n.process.on("info",((t,o)=>p.onUSIInfo(e,t,o)))},t.goPonder=function(e,t,o){const n=v(e),i=(0,h.getNextColorFromUSI)(t);n.process.goPonder(t,b(i,o)),n.process.on("ponderInfo",((t,o)=>{p.onUSIPonderInfo(e,t,o)}))},t.goInfinite=function(e,t){const o=v(e);o.process.go(t),o.process.on("info",((t,o)=>p.onUSIInfo(e,t,o)))},t.goMate=function(e,t){const o=v(e);o.process.goMate(t),o.process.on("info",((t,o)=>p.onUSIInfo(e,t,o)))},t.ponderHit=function(e,t){const o=v(e),n=(0,h.getNextColorFromUSI)(o.process.currentPosition);o.process.ponderHit(b(n,t))},t.stop=function(e){v(e).process.stop()},t.gameover=function(e,t){const o=v(e);switch(t){case c.GameResult.WIN:o.process.gameover(s.GameResult.WIN);break;case c.GameResult.LOSE:o.process.gameover(s.GameResult.LOSE);break;case c.GameResult.DRAW:o.process.gameover(s.GameResult.DRAW)}},t.quit=function(e){if(!function(e){return f.has(e)}(e))return;v(e).process.quit(),setTimeout((()=>{f.delete(e)}),1e4)},t.quitAll=function(){f.forEach((e=>{e.process.quit()})),f.clear()},t.collectSessionStates=function(){return Array.from(f.entries()).map((([e,t])=>({sessionID:e,uri:t.setting.uri,name:t.setting.name,path:t.setting.path,pid:t.process.pid,stateCode:t.process.state,createdMs:t.createdMs,lastReceived:t.process.lastReceived,lastSent:t.process.lastSent,updatedMs:Date.now(),closed:t.process.state===s.State.WillQuit}))).sort(((e,t)=>t.sessionID-e.sessionID))},t.getCommandHistory=function(e){return v(e).process.commandHistory},t.invokeCommand=function(e,t,o){v(e).process.invoke(t,o)}},9249:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRelativeEnginePath=t.resolveEnginePath=void 0;const i=n(o(6743)),a=o(3974);t.resolveEnginePath=function(e){const t=(0,a.getPortableExeDir)();return t?i.default.resolve(t,e):e},t.getRelativeEnginePath=function(e){const t=(0,a.getPortableExeDir)();if(t){const o=i.default.relative(t,e);if(!o.startsWith(".."))return o}return e}},6797:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ChildProcess=void 0;const i=o(636),a=o(7558),r=n(o(6743)),s="win32"===process.platform;t.ChildProcess=class{handle;readline=null;constructor(e){const t={cwd:r.default.dirname(e)};s&&(e.endsWith(".bat")||e.endsWith(".cmd"))?this.handle=(0,i.spawn)("cmd.exe",["/c",e],t):this.handle=(0,i.spawn)(e,t),this.handle.on("close",this.onClose.bind(this))}get pid(){return this.handle.pid}on(e,t){switch(e){case"receive":null===this.readline&&(this.readline=(0,a.createInterface)(this.handle.stdout)),this.readline.on("line",t);break;case"close":this.handle.on("close",((e,o)=>{this.onClose(),t(e,o)}));break;default:this.handle.on(e,t)}return this}send(e){this.handle.stdin.write(e+"\n")}kill(){this.onClose(),this.handle.kill()}onClose(){null!==this.readline&&this.readline.close()}}},4659:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentsParser=void 0;t.ArgumentsParser=class{valueKeys=[];stringRestrictions=new Map;numberKeys=[];numberRestrictions=new Map;flagKeys=[];values=new Map;numbers=new Map;flags=new Map;bareArgs=[];help;constructor(e,t){"string"==typeof t&&(t=[t]),this.help="Usage:\n";for(const o of t||[""])this.help+=` ${e} [options] ${o}\n`;this.help+="\nOptions:\n"}value(e,t,o,n){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.valueKeys.push(i),n&&this.stringRestrictions.set(i,n),()=>{const e=this.values.get(i);return void 0!==e?e:o}}valueOrNull(e,t,o){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.valueKeys.push(n),o&&this.stringRestrictions.set(n,o),()=>{const e=this.values.get(n);return void 0!==e?e:null}}number(e,t,o,n){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.numberKeys.push(i),n&&this.numberRestrictions.set(i,n),()=>{const e=this.numbers.get(i);return void 0!==e?e:o}}numberOrNull(e,t,o){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.numberKeys.push(n),o&&this.numberRestrictions.set(n,o),()=>{const e=this.numbers.get(n);return void 0!==e?e:null}}flag(e,t){const o="--"+e;return this.help+=` ${o}\n`,this.help+=` ${t}\n`,this.flagKeys.push(o),()=>this.flags.get(o)||!1}parse(){let e=0;for(let t=2;t<process.argv.length;t++){const o=process.argv[t];if(t===e)this.bareArgs.push(o);else if(this.valueKeys.includes(o)){const e=process.argv[++t],n=this.stringRestrictions.get(o);n&&(n.includes(e)||this.onError(`${o} option must be one of: ${n.join(", ")}`)),this.values.set(o,e)}else if(this.numberKeys.includes(o)){const e=Number(process.argv[++t]);Number.isNaN(e)&&this.onError(`${o} option must be a number: ${process.argv[t]}`);const n=this.numberRestrictions.get(o);n?.min&&e<n.min&&this.onError(`${o} option must be greater than or equal to ${n.min}`),n?.max&&e>n.max&&this.onError(`${o} option must be less than or equal to ${n.max}`),this.numbers.set(o,e)}else this.flagKeys.includes(o)?this.flags.set(o,!0):"--"===o?e=t+1:"--help"===o?(this.showHelp(),process.exit(0)):o.startsWith("-")?this.onError(`Unknown option: ${o}`):this.bareArgs.push(o)}}get args(){return this.bareArgs}showHelp(){console.log(this.help)}onError(e){console.error(e),process.exit(1)}}},2526:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.preload=void 0;const n=o(1626),i=o(242),a=o(9336),r=o(1219),s=o(8474);t.preload=function(e){(0,s.setLanguage)(e.language);const t=e.stdoutLog?["file","stdout"]:["file"],l=e.appLogFile?t:["stdout"],c=e.usiLogFile?t:["stdout"],d=e.csaLogFile?t:["stdout"];(0,n.setLogDestinations)(r.LogType.APP,l,e.logLevel),(0,n.setLogDestinations)(r.LogType.USI,c,e.logLevel),(0,n.setLogDestinations)(r.LogType.CSA,d,e.logLevel);const u={updateAppState(){},onClosable(){},onClose(){},onSendError(){},onMenuEvent(){},async loadAppSetting(){throw new Error("This feature is not available on command line tool")},async saveAppSetting(){throw new Error("This feature is not available on command line tool")},async loadBatchConversionSetting(){throw new Error("This feature is not available on command line tool")},async saveBatchConversionSetting(){throw new Error("This feature is not available on command line tool")},async loadResearchSetting(){throw new Error("This feature is not available on command line tool")},async saveResearchSetting(){throw new Error("This feature is not available on command line tool")},async loadAnalysisSetting(){throw new Error("This feature is not available on command line tool")},async saveAnalysisSetting(){throw new Error("This feature is not available on command line tool")},async loadGameSetting(){throw new Error("This feature is not available on command line tool")},async saveGameSetting(){throw new Error("This feature is not available on command line tool")},async loadCSAGameSettingHistory(){throw new Error("This feature is not available on command line tool")},async saveCSAGameSettingHistory(){throw new Error("This feature is not available on command line tool")},async loadMateSearchSetting(){throw new Error("This feature is not available on command line tool")},async saveMateSearchSetting(){throw new Error("This feature is not available on command line tool")},async loadUSIEngineSetting(){throw new Error("This feature is not available on command line tool")},async saveUSIEngineSetting(){},onUpdateAppSetting(){},fetchInitialRecordFileRequest:async()=>"null",async showOpenRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveMergedRecordDialog(){throw new Error("This feature is not available on command line tool")},async openRecord(){throw new Error("This feature is not available on command line tool")},async saveRecord(){throw new Error("This feature is not available on command line tool")},async loadRecordFileHistory(){throw new Error("This feature is not available on command line tool")},addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error("This feature is not available on command line tool")},async loadRemoteRecordFile(){throw new Error("This feature is not available on command line tool")},async convertRecordFiles(){throw new Error("This feature is not available on command line tool")},onOpenRecord(){},async showSelectUSIEngineDialog(){throw new Error("This feature is not available on command line tool")},async getUSIEngineInfo(){throw new Error("This feature is not available on command line tool")},async sendUSISetOption(){},async usiLaunch(e,t){const o=JSON.parse(e);return await(0,a.setupPlayer)(o,t)},usiReady:async e=>await(0,a.ready)(e),async usiGo(e,t,o){(0,a.go)(e,t,JSON.parse(o))},async usiGoPonder(e,t,o){(0,a.goPonder)(e,t,JSON.parse(o))},async usiPonderHit(e,t){(0,a.ponderHit)(e,JSON.parse(t))},async usiGoInfinite(e,t){(0,a.goInfinite)(e,t)},async usiGoMate(e,t){(0,a.goMate)(e,t)},async usiStop(e){(0,a.stop)(e)},async usiGameover(e,t){(0,a.gameover)(e,t)},async usiQuit(e){(0,a.quit)(e)},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},onUSIPonderInfo(){},csaLogin:async e=>(0,i.login)(JSON.parse(e)),async csaLogout(e){(0,i.logout)(e)},async csaAgree(e,t){(0,i.agree)(e,t)},async csaMove(e,t,o,n){(0,i.doMove)(e,t,o,n)},async csaResign(e){(0,i.resign)(e)},async csaWin(e){(0,i.win)(e)},async csaStop(e){(0,i.stop)(e)},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},async collectSessionStates(){throw new Error("This feature is not available on command line tool")},async setupPrompt(){throw new Error("This feature is not available on command line tool")},async openPrompt(){throw new Error("This feature is not available on command line tool")},invokePromptCommand(){throw new Error("This feature is not available on command line tool")},onPromptCommand(){},async showSelectImageDialog(){throw new Error("This feature is not available on command line tool")},async cropPieceImage(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsPNG(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsJPEG(){throw new Error("This feature is not available on command line tool")},openLogFile(){},log(e,t){switch(e){case r.LogLevel.DEBUG:console.debug(t);break;case r.LogLevel.INFO:console.log(t);break;case r.LogLevel.WARN:console.warn(t);break;case r.LogLevel.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error("This feature is not available on command line tool")},async showSelectDirectoryDialog(){throw new Error("This feature is not available on command line tool")},openExplorer(){throw new Error("This feature is not available on command line tool")},openWebBrowser(){throw new Error("This feature is not available on command line tool")},isEncryptionAvailable:async()=>!1,async getVersionStatus(){throw new Error("This feature is not available on command line tool")},sendTestNotification(){throw new Error("This feature is not available on command line tool")}};global.window={...global,electronShogiAPI:u};const m=o(7769);(0,a.setHandlers)({onUSIBestMove:m.onUSIBestMove,onUSICheckmate:m.onUSICheckmate,onUSICheckmateNotImplemented:m.onUSICheckmateNotImplemented,onUSICheckmateTimeout:m.onUSICheckmateTimeout,onUSINoMate:m.onUSINoMate,onUSIInfo:m.onUSIInfo,onUSIPonderInfo:m.onUSIPonderInfo,sendPromptCommand:()=>{}});const h=o(7076);(0,i.setHandlers)({onCSAGameSummary:h.onCSAGameSummary,onCSAReject:h.onCSAReject,onCSAStart:h.onCSAStart,onCSAMove:h.onCSAMove,onCSAGameResult:h.onCSAGameResult,onCSAClose:h.onCSAClose,sendPromptCommand:()=>{},sendError:e=>{(0,n.getAppLogger)().error(e)}}),process.on("uncaughtException",((e,t)=>{(0,n.getAppLogger)().error(new Error(`${t} ${e}`))}))}},3965:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(4659),a=o(1219),r=o(8474),s=new i.ArgumentsParser("usi-csa-bridge",["path/to/csa_game_config.yaml","path/to/csa_game_config.json","--base64 <base64>"]),l=s.valueOrNull("base64","Base64 of gzip compressed JSON config."),c=s.number("engine-timeout","Maximum time[seconds] of USI engine execution.",180,{min:1}),d=s.valueOrNull("protocol-version","Overwrite server.protocolVersion setting."),u=s.valueOrNull("host","Overwrite server.host setting."),m=s.numberOrNull("port","Overwrite server.port setting.",{min:1024,max:49151}),h=s.valueOrNull("id","Overwrite server.id setting."),p=s.valueOrNull("password","Overwrite server.password setting."),g=s.flag("save-record","Save record file after game end."),S=s.value("record-dir","Directory to save records.","records"),y=s.valueOrNull("record-file-name-template","Overwrite recordFileNameTemplate setting."),f=s.valueOrNull("record-file-format","Overwrite recordFileFormat setting."),v=s.value("return-code","Return code which one of LF or CRLF. It is used for record file.","win32"===process.platform?"CRLF":"LF",["LF","CRLF"]),b=s.flag("csa-v3","Use CSA V3 format for record file."),I=s.numberOrNull("repeat","Overwrite repeat setting.",{min:1}),T=s.flag("app-log-file","Enable application log file."),E=s.flag("usi-log-file","Enable USI log file."),C=s.flag("csa-log-file","Enable CSA log file."),A=s.flag("all-log-file","Enable all log files."),M=s.flag("disable-stdout-log","Disable stdout log. Should be used with --XXX-log-file."),P=s.value("log-level",`Log level which one of: ${Object.values(a.LogLevel).join(", ")}`,a.LogLevel.INFO,[a.LogLevel.DEBUG,a.LogLevel.INFO,a.LogLevel.WARN,a.LogLevel.ERROR]),R=s.value("lang",`Language which one of: ${Object.values(r.Language).join(", ")}`,r.Language.JA,[r.Language.JA,r.Language.EN,r.Language.ZH_TW]);s.parse();(0,o(2526).preload)({appLogFile:T()||A(),usiLogFile:E()||A(),csaLogFile:C()||A(),stdoutLog:!M(),logLevel:P(),language:R()});const N=n(o(9971)),w=n(o(6743)),O=n(o(913)),_=o(3010),L=o(6255),k=o(7872),F=o(7076),D=o(3101),G=o(1626),U=o(8574),B=o(6059),H=o(9006),W=o(3746);!async function(){const e=s.args[0];let t;const o=l();if(o?t=await(0,_.decompressCSAGameSettingForCLI)(o):(e||((0,G.getAppLogger)().error("config file is not specified."),s.showHelp(),process.exit(1)),t=e.endsWith(".json")?JSON.parse(N.default.readFileSync(e,"utf-8")):O.default.parse(N.default.readFileSync(e,"utf-8"))),t.server.protocolVersion=d()||t.server.protocolVersion,t.server.host=u()||t.server.host,t.server.port=m()||t.server.port,t.server.id=h()||t.server.id,t.server.password=p()||t.server.password,t.saveRecordFile=g()||t.saveRecordFile,t.repeat=I()||t.repeat,e&&!await(0,W.exists)(t.usi.path)){const o=w.default.resolve(w.default.dirname(e),t.usi.path);await(0,W.exists)(o)||((0,G.getAppLogger)().error(`usi engine is not found: ${t.usi.path}`),process.exit(1)),t.usi.path=o}const n=(0,_.importCSAGameSettingForCLI)(t),i=(0,_.validateCSAGameSetting)(n);i&&((0,G.getAppLogger)().error(i),process.exit(1));const a=new k.RecordManager,r=new L.Clock,T=new L.Clock,E=new F.CSAGameManager(a,r,T),C=(0,D.defaultPlayerBuilder)(c());E.on("gameNext",(function(){(0,G.getAppLogger)().info("waiting for new game...")})).on("newGame",(function(e){(0,G.getAppLogger)().info(`${(0,H.ordinal)(e)} game started.`)})).on("gameEnd",(function(){(0,G.getAppLogger)().info("completed. will exit after some seconds...")})).on("saveRecord",(function(){const e=(0,U.generateRecordFileName)(a.record.metadata,y()||t.recordFileNameTemplate||U.defaultRecordFileNameTemplate,f()||t.recordFileFormat||B.RecordFileFormat.KIF),o=S(),n=w.default.join(o,e);N.default.promises.mkdir(o,{recursive:!0}).then((()=>{const e=a.exportRecordAsBuffer(n,{returnCode:A,csa:{v3:b()}});if(!(e instanceof Error))return N.default.promises.writeFile(n,e.data);(0,G.getAppLogger)().error(e)})).then((()=>{(0,G.getAppLogger)().info("record saved: %s",n)})).catch((e=>{(0,G.getAppLogger)().error(e)}))})).on("loginRetry",(function(){(0,G.getAppLogger)().warn(`Retry login after ${F.loginRetryIntervalSeconds} seconds...`)})).on("error",(function(e){(0,G.getAppLogger)().error(e)})).login(n,C).catch((function(e){(0,G.getAppLogger)().error(e),process.exit(1)}));const A="CRLF"===v()?"\r\n":"\n"}()},9169:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addCommand=t.newCommand=t.CommandType=void 0;const n=o(5746);var i;!function(e){e.SEND="send",e.RECEIVE="receive",e.SYSTEM="system"}(i||(t.CommandType=i={})),t.newCommand=function(e,t){const o=new Date;return{type:e,command:t,dateTime:(0,n.getDateTimeStringMs)(o),timeMs:o.getTime()}},t.addCommand=function(e,t,o,n){Array.isArray(t)||(t=[t]);for(const o of t)e.commands.push(o);if(e.commands.length>o){const t=Math.max(n,e.commands.length-o);e.discarded+=t,e.commands.splice(0,t)}}},7892:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.getEmptyHistory=t.HistoryClass=void 0,function(e){e.USER="user",e.BACKUP="backup"}(o||(t.HistoryClass=o={})),t.getEmptyHistory=function(){return{entries:[]}}},6059:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exportRecordAsBuffer=t.importRecordFromBuffer=t.detectRecordFileFormatByPath=t.RecordFileFormat=void 0;const n=o(1753),i=o(2851);var a;function r(e){switch(e){default:return"UTF8";case a.KIF:case a.KI2:return"SJIS"}}!function(e){e.KIF=".kif",e.KIFU=".kifu",e.KI2=".ki2",e.KI2U=".ki2u",e.CSA=".csa",e.SFEN=".sfen",e.JKF=".jkf"}(a||(t.RecordFileFormat=a={})),t.detectRecordFileFormatByPath=function(e){for(const t of Object.values(a))if(e.toLowerCase().endsWith(t))return t},t.importRecordFromBuffer=function(e,t,o){const s=(0,n.decodeText)(e,{encoding:r(t),autoDetect:o?.autoDetect});switch(t){case a.KIF:case a.KIFU:return(0,i.importKIF)(s);case a.KI2:case a.KI2U:return(0,i.importKI2)(s);case a.CSA:return(0,i.importCSA)(s);case a.SFEN:return new Error(".sfen file import is not supported");case a.JKF:return(0,i.importJKFString)(s)}},t.exportRecordAsBuffer=function(e,t,o){const s=r(t);let l;switch(t){case a.KIF:case a.KIFU:l=(0,i.exportKIF)(e,o);break;case a.KI2:case a.KI2U:l=(0,i.exportKI2)(e,o);break;case a.CSA:l=(0,i.exportCSA)(e,{...o,v3:o.csa?.v3?{milliseconds:!0}:void 0});break;case a.SFEN:throw new Error(".sfen file export is not supported");case a.JKF:l=(0,i.exportJKFString)(e)}const c=(0,n.encodeText)(l,s);let d=!1;if("SJIS"===s&&o.detectGarbled){(0,n.decodeText)(c,{encoding:"SJIS"})!==l&&(d=!0)}return{data:c,garbled:d}}},4725:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CSAGameResult=t.CSASpecialMove=t.emptyCSAPlayerStates=t.emptyCSAGameSummary=void 0;const n=o(2851);var i,a;t.emptyCSAGameSummary=function(){return{id:"",myColor:n.Color.BLACK,toMove:n.Color.BLACK,position:"",players:{black:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}},white:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}}}}},t.emptyCSAPlayerStates=function(){return{black:{time:0},white:{time:0}}},function(e){e.UNKNOWN="unknown",e.RESIGN="resign",e.SENNICHITE="sennichite",e.OUTE_SENNICHITE="oute_sennichite",e.ILLEGAL_MOVE="illegal_move",e.ILLEGAL_ACTION="illegal_action",e.TIME_UP="time_up",e.JISHOGI="jishogi",e.MAX_MOVES="max_moves"}(i||(t.CSASpecialMove=i={})),function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw",e.CENSORED="censored",e.CHUDAN="chudan"}(a||(t.CSAGameResult=a={}))},3695:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GameResult=void 0,function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(o||(t.GameResult=o={}))},7187:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUSIPV=t.SCORE_MATE_INFINITE=void 0,t.SCORE_MATE_INFINITE=1e4,t.parseUSIPV=function(e,t){const o=[],n=e.clone();for(const e of t){const t=n.createMoveByUSI(e);if(!t||!n.doMove(t))break;o.push(t)}return o}},5746:(e,t)=>{function o(e=new Date){return e.toLocaleTimeString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}Object.defineProperty(t,"__esModule",{value:!0}),t.getDateTimeStringMs=t.getDateTimeString=t.getDateString=void 0,t.getDateString=function(e=new Date){return e.toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})},t.getDateTimeString=o,t.getDateTimeStringMs=function(e=new Date){return o(e)+"."+String(e.getTime()%1e3).padStart(3,"0")}},1753:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.detectTextEncoding=t.decodeText=t.encodeText=void 0;const n=o(6953);function i(e,t){return(0,n.detect)(e)||t||"UTF8"}t.encodeText=function(e,t){return"ASCII"===t||"UTF8"===t?(new TextEncoder).encode(e):new Uint8Array((0,n.convert)(e,{type:"arraybuffer",from:"UNICODE",to:t}))},t.decodeText=function(e,t){const o=t?.autoDetect?i(e,t.encoding):t?.encoding;return"ASCII"===o||"UTF8"===o?(new TextDecoder).decode(e):(0,n.convert)(e,{type:"string",from:o,to:"UNICODE"})},t.detectTextEncoding=i},9006:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.filter=t.ordinal=t.formatPercentage=t.toString=void 0,t.toString=function(e){return e instanceof Error?e.message:e instanceof Object?JSON.stringify(e):String(e)},t.formatPercentage=function(e,t,o){return 0===t?"0%":(e/t*100).toFixed(o)+"%"},t.ordinal=function(e){switch(e%100){case 11:case 12:case 13:return e+"th"}switch(e%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd";default:return e+"th"}},t.filter=function(e,t){const o=e.toLowerCase();return t.every((e=>o.includes(e.toLowerCase())))}},9886:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.secondsToMMSS=void 0,t.secondsToMMSS=function(e){const t=Math.floor(e/60),o=e%60;return String(t).padStart(2,"0")+":"+String(o).padStart(2,"0")}},3295:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.localizeError=void 0;const n=o(2851),i=o(1874);t.localizeError=function(e){return e instanceof n.InvalidPieceNameError?new Error(`${i.t.invalidPieceName}: ${e.data}`):e instanceof n.InvalidTurnError?new Error(`${i.t.invalidTurn}: ${e.data}`):e instanceof n.InvalidMoveError?new Error(`${i.t.invalidMove}: ${e.data}`):e instanceof n.InvalidMoveNumberError?new Error(`${i.t.invalidMoveNumber}: ${e.data}`):e instanceof n.InvalidDestinationError?new Error(`${i.t.invalidDestination}: ${e.data}`):e instanceof n.PieceNotExistsError?new Error(`${i.t.pieceNotExists}: ${e.data}`):e instanceof n.InvalidLineError?new Error(`${i.t.invalidLine}: ${e.data}`):e instanceof n.InvalidBoardError?new Error(`${i.t.invalidBoard}: ${e.data}`):e instanceof n.InvalidHandPieceError?new Error(`${i.t.invalidHandPiece}: ${e.data}`):e instanceof n.InvalidUSIError?new Error(`${i.t.invalidUSI}: ${e.data}`):e}},8474:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.setLanguage=t.usiOptionNameMap=t.t=void 0;const s=a(o(1874)),l=a(o(9233));r(o(9365),t);var c=o(1874);Object.defineProperty(t,"t",{enumerable:!0,get:function(){return c.t}}),r(o(3295),t),r(o(7445),t);var d=o(9233);Object.defineProperty(t,"usiOptionNameMap",{enumerable:!0,get:function(){return d.usiOptionNameMap}}),t.setLanguage=function(e){s.setLanguage(e),l.setLanguage(e)}},9365:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.Language=void 0,function(e){e.JA="ja",e.EN="en",e.ZH_TW="zh_tw"}(o||(t.Language=o={}))},855:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.en=void 0;const n=o(9006);t.en={shogiHome:"ShogiHome",clear:"Clear",open:"Open",saveOverwrite:"Overwrite",newRecord:"New Record",openRecord:"Open Record",saveRecord:"Save Record",saveRecordAs:"Save Record As",openAutoSavingDirectory:"Open Auto-Saving Directory",exportPositionImage:"Export Position Image",positionImage:"Position Image",batchConversion:"Batch Conversion",recordFileBatchConversion:"Record File Batch Conversion",close:"Close",quit:"Quit",editing:"Edit",copyAsKIF:"Copy (KIF)",copyAsKI2:"Copy (KI2)",copyAsCSA:"Copy (CSA)",copyAsUSI:"Copy (USI)",copyAsSFEN:"Copy (SFEN)",copyAsJKF:"Copy (JKF)",copy:"Copy",cut:"Cut",paste:"Paste",copyRecord:"Copy Record",asKIF:"as KIF",asKI2:"as KI2",asCSA:"as CSA",asUSIUntilCurrentMove:"as USI (until current move)",asUSIAll:"as USI (all)",asJSONKifuFormat:"as JSON Kifu Format",copyPositionAsSFEN:"Copy Position (as SFEN)",pasteRecordOrPosition:"Paste Record/Position",appendSpecialMove:"Append Special Move",deleteMoves:"Delete Current Move and Following Moves",view:"View",toggleFullScreen:"Toggle Full Screen",defaultFontSize:"Default Font Size",largerFontSize:"Larger Font Size",smallerFontSize:"Smaller Font Size",settings:"Settings",config:"Config",debug:"Debug",toggleDevTools:"Toggle Developer Tools",logFile:"Log File",openAppLog:"Open App Log",openUSILog:"Open USI Log",openCSALog:"Open CSA Log",tailAppLog:"Tail App Log",tailUSILog:"Tail USI Log",tailCSALog:"Tail CSA Log",copyAppLogTailCommand:"Copy App Log Tail Command",copyUSILogTailCommand:"Copy USI Log Tail Command",copyCSALogTailCommand:"Copy CSA Log Tail Command",reloadCustomPieceImage:"Reload Custom Piece Image",launchUSIEngine:"Launch USI Engine",connectToCSAServer:"Connect to CSA Server",adminMode:"Admin Mode",inAdminModeYouShouldInvokeCommandsManuallyAtPrompt:"In admin mode, you should invoke commands manually at prompt.",setoptionAndPrecedingCommandsWillBeSentAutomatically:'"setoption" and preceding commands will be sent automatically.',serverMustSupportShogiServerX1ModeLogIn:"The server must support shogi-server's x1-mode log-in.",folders:"Folders",notification:"Notification",notificationTest:"Notification Test",thisIsTestNotification:"This is test notification.",app:"App",log:"Log",backup:"Backup",cache:"Cache",help:"Help",openWebSite:"Open Web Site",howToUse:"How to Use",openLatestReleasePage:"Open Latest Release Page",openStableReleasePage:"Open Stable Release Page",inputs:"Inputs",outputs:"Outputs",format:"Format",formats:"Formats",subdirectories:"Subdirectories",separately:"Separately",merge:"Merge",createSubdirectories:"Create Subdirectories",nameConflictAction:"Name Conflict Action",numberSuffix:"Number Suffix",skip:"Skip",convert:"Convert",openLogFile:"Open Log File",succeeded:"Succeeded",failed:"Failed",skipped:"Skipped",game:"Game",player:"Player",server:"Server",selectFromHistory:"Select from History",noHistory:"Empty",saveHistory:"Save History",version:"Version",gameProgress:"Game Progress",allGamesCompleted:"All Games Completed",wins:"Wins",draws:"Draws",validGames:"Valid Games",invalidGames:"Invalid Games",eloRatingDiff:"Elo Rating Diff",ignoreDraws:"Ignore Draws",drawsAreHalfWin:"Draws are Half Win",zValue:"Z Value",significance5pc:"Significance-5%",significance1pc:"Significance-1%",gameEnded:"Game Ended",offlineGame:"Offline Game",csaOnlineGame:"CSA Online Game",csaProtocolOnlineGame:"Online Game (CSA Protocol)",csaProtocolV121:"CSA Protocol 1.2.1 Standard",csaProtocolV121WithPVComment:"CSA Protocol 1.2.1 with PV Comment",hostToConnect:"Hostname",portNumber:"Port",password:"Password",showPassword:"Show Password",keepaliveInitialDelay:"Keepalive Initial Delay",blankLinePing:"Blank Line Ping",blankLinePingInitialDelay:"Blank Line Ping Initial Delay",blankLinePingInterval:"Blank Line Ping Interval",logout:"Logout",calculateJishogiPoints:"Calculate Jishogi Points",jishogiPoints:"Jishogi Points",displayGameResults:"Display Results",interrupt:"Stop",stopGame:"Stop",resign:"Resign",draw:"Draw",impass:"Impass",repetitionDraw:"Repetition Draw",mate:"Mate",noMate:"No Mate",mateSearch:"Mate Search",startMateSearch:"Start Mate Search",stopMateSearch:"Stop Mate Search",noMateFound:"No mate.",timeout:"Timeout",foulWin:"Foul Win",foulLose:"Foul Lose",enteringOfKing:"Entering of King",winByDefault:"Win by Default",loseByDefault:"Lose by Default",winByDeclaration:"Win by Declaration",declareWinning:"Declare Winning",research:"Research",startResearch:"Start Research",endResearch:"End Research",recordAnalysis:"Record Analysis",analysis:"Analyze",analyze:"Analyze",stopAnalysis:"Stop Analysis",setupPosition:"Setup Position",startPositionSetup:"Start Position Setup",completePositionSetup:"Complete Setup",changeTurn:"Change Turn",initializePosition:"Initialize Position",changePieceSet:"Change Piece Set",appSettings:"Preferences",language:"Languages",theme:"Theme",standard:"Standard",green:"Green",cherryBlossom:"Cherry Blossom",customImage:"Custom Image",autumn:"Autumn",snow:"Snow",darkGreen:"Dark Green",dark:"Dark",piece:"Piece",singleKanjiPiece:"Single Kanji",singleKanjiGothicPiece:"Single Kanji (Gothic)",singleKanjiDarkPiece:"Single Kanji (Dark)",singleKanjiGothicDarkPiece:"Single Kanji (Gothic, Dark)",imageHasMarginsRemoveToDisplayLarger:"The image has margins (remove it to display larger)",backgroundImage:"Background Image",board:"Board Image",pieceStand:"Piece Stand",lightWoodyTexture:"Woody Texture (Light)",warmWoodTexture:"Woody Texture (Warm)",resin:"Resin",transparent:"Transparent",boardOpacity:"Board Opacity",pieceStandOpacity:"Piece Stand Opacity",recordOpacity:"Record Opacity",displayFileAndRank:"Display File & Rank",displayLeftControls:"Display Left Controls",displayRightControls:"Display Right Controls",tabViewStyle:"Tab View Style",oneColumn:"1 Column",twoColumns:"2 Columns",sounds:"Sounds",pieceLoudness:"Piece Loudness",clockLoudness:"Clock Loudness",clockPitch:"Clock Pitch",clockSoundTarget:"Clock Sound Target",anyTurn:"Any",onlyHumanTurn:"Human",defaultRecordFileFormat:"Default Record Format",textEncoding:"Text Encoding",strict:"Strict",autoDetect:"Auto Detect",newlineCharacter:"Newline Character",old90sMac:"90's Mac",autoSaving:"Auto-Saving",autoSavingDirectory:"Auto-Saving Directory",recordFileName:"Record File Name",select:"Select",positionOfUSIOutput:"Position of USI Output",movesOfUSIOutput:"Moves of USI Output",onlySFEN:"Only SFEN",usiProtocol:"USI Protocol",translateOptionName:"Translate Option Name",functionalOnJapaneseOnly:"Functional on Japanese Only",maxStartupTime:"Max Startup Time",forDevelopers:"For Developers",enableAppLog:"Enable App Log",enableUSILog:"Enable USI Log",enableCSALog:"Enable CSA Log",logLevel:"Log Level",engineSettings:"Engine Settings",flipBoard:"Flip Board",file:"File",recordFile:"Record File",executableFile:"Executable",imageFile:"Image",unsaved:"Unsaved",remove:"Remove",deleteMove:"Delete Move",recordProperties:"Record Properties",comments:"Comments",commentsAndBookmarks:"Comments & Bookmarks",branches:"Branches",bookmark:"Bookmark",bookmarkList:"Bookmarks",useBookmarkAsHeader:"Use Bookmark as Header",moveComments:"Move Comments",searchLog:"Search Log",pv:"PV",mateShort:"M",displayPVShort:"Play",evaluation:"Evaluation",eval:"Eval",estimatedWinRate:"Estimated Win Rate",evaluationAndEstimatedWinRate:"Evaluation & Estimated Win Rate",swapEachTurnChange:"Swap Each Turn Change",alwaysSenteIsPositive:"Always Sente is Positive",signOfEvaluation:"Sign of Evaluation",winRateCoefficient:"Win Rate Coefficient",monitor:"Monitor",hideTabView:"Hide",expandTabView:"Expand Tab View",sente:"Sente",senteOrShitate:"Sente (Shitate)",shitate:"Shitate",gote:"Gote",goteOrUwate:"Gote (Uwate)",uwate:"Uwate",swapSenteGote:"Swap Sente/Gote",currentPosition:"Current Position",enableEngineTimeout:"Enable Engine Timeout",setDifferentTimeForGote:"Set different time for Gote",nextTurn:"Next Move",elapsedTime:"Elapsed Time",elapsed:"Elapsed",rank:"Rank",depth:"Depth",searchEngine:"Search Engine",ponder:"Ponder",numberOfThreads:"Threads",multiPV:"Multi PV",startPosition:"Position",maxMoves:"Max Moves",gameRepetition:"Repeat",jishogi:"Jishogi",rule24:"24-point rule",rule27:"27-point rule",tryRule:"TRY rule",autoRelogin:"Auto Re-Login",restartItEveryGame:"Restart it Every Game",swapTurnWhenGameRepetition:"Swap Turns When Repeat",outputComments:"Output Comments",saveRecordAutomatically:"Save Record Automatically",adjustBoardToHumanPlayer:"Adjust Board to Human Player",adjustBoardAutomatically:"Adjust Board Automatically",command:"Command",startGame:"Start Game",cancelGame:"Cancel Game",allottedTime:"Allotted Time",byoyomi:"Byoyomi",increments:"Increments",startEndCriteria:"Start/End Criteria",endCriteria1Move:"End Criteria for 1 Move",outputSettings:"Output Settings",noOutputs:"No Outputs",insertCommentToTop:"Insert to Top",appendCommentToBottom:"Append to Bottom",insertToComment:"Ins. to Comment",insertToRecord:"Ins. to Record",overwrite:"Overwrite",fromPrefix:"from",fromSuffix:"",toPrefix:"to",toSuffix:"",plyPrefix:"",plySuffix:"th move",hoursSuffix:"h",minutesSuffix:"min",secondsSuffix:"sec",engineManagement:"Engine Management",engineName:"Engine Name",author:"Author",earlyPonder:"Early Ponder",enginePath:"Engine Path",openDirectory:"Open Directory",displayName:"Display Name",invoke:"Invoke",resetToEngineDefaultValues:"Reset to default values",defaultValue:"Default Value",noEngineRegistered:"No engine",duplicate:"Copy",add:"Add",recommended:"Recommended",import:"Import",saveAndClose:"Save & Close",save:"Save",saveAs:"Save As",history:"History",clearHistory:"Clear History",userFile:"User File",automaticBackup:"Automatic Backup",restore:"Restore",loadRecordFromWeb:"Load Record from Web",fetchLatestData:"Fetch Latest Data",sourceURL:"Source URL",ok:"OK",cancel:"Cancel",back:"Back",name:"Name",prediction:"Prediction",best:"Best",nodes:"Nodes",hashUsage:"Hash Usage",stop:"Stop",resume:"Resume",nonHandicap:"Non-Handicap",lanceHandicap:"Lance Handicap",rightLanceHandicap:"Right Lance Handicap",bishopHandicap:"Bishop Handicap",rookHandicap:"Rook Handicap",rookLanceHandicap:"Rook-Lance Handicap",twoPiecesHandicap:"2 Pieces Handicap",fourPiecesHandicap:"4 Pieces Handicap",sixPiecesHandicap:"6 Pieces Handicap",eightPiecesHandicap:"8 Pieces Handicap",tenPiecesHandicap:"10 Pieces Handicap",tsumeShogi:"Tsume Shogi",doubleKingTsumeShogi:"2-Kings Tsume Shogi",startDateTime:"Start",endDateTime:"End",gameDate:"Date",tournament:"Tournament",strategy:"Strategy",gameTitle:"Title",timeLimit:"Time Limit",blackTimeLimit:"Time Limit (Sente)",whiteTimeLimit:"Time Limit (Gote)",place:"Place",postedOn:"Posted On",note:"Note",senteShortName:"Sente(short)",goteShortName:"Gote(short)",opusNo:"Opus No.",opusName:"Opus Name",publishedBy:"Published By",publishedOn:"Published On",source:"Source",numberOfMoves:"Number of Moves",integrity:"Integrity",recordCategory:"Category",award:"Award",filterByOptionName:"Filter by Option Name",filterByEngineName:"Filter by Engine Name",bookStyle:"Book Style",gameStyle:"Game Style",thin:"Thin",bold:"Bold",extraBold:"Extra Bold",playerName:"Player Name",typeface:"Typeface",weight:"Weight",handLabel:"Hand Label",header:"Header",vertical:"Vertical",size:"Size",none:"None",bgCover:"Cover",bgContain:"Contain",bgTile:"Tile",inaccuracy:"Inaccuracy",dubious:"Dubious",mistake:"Mistake",blunder:"Blunder",inaccuracyThreshold:"Inaccuracy Threshold",dubiousThreshold:"Dubious Threshold",mistakeThreshold:"Mistake Threshold",blunderThreshold:"Blunder Threshold",gothic:"Gothic",mincho:"Mincho",appVersion:"App Version",installed:"Installed",stable:"Stable",latest:"Latest",updatedAt:"Updated At",createdAt:"Created At",lastSent:"Last Sent",lastReceived:"Last Received",protocolVersion:"Protocol Version",prompt:"Prompt",openPrompt:"Open Prompt",forceQuit:"Force Quit",forceClose:"Force Close",blankLine:"Blank Line",autoScroll:"Auto Scroll",showTimestamp:"Show Timestamp",highlightByPartialMatch:"Highlight by Partial Match",csaServer:"CSA Server",usiEngine:"USI Engine",noRunningUSIEngine:"No running USI engine.",noConnectedCSAServer:"No connected CSA server.",willBeRemovedFromTheListSoon:"This session is closed, will be removed from the list soon.",typeCommandHereAndPressEnter:"Type command here and press Enter.",allowBlankLine:"Allow Blank Line",removeSpaceFromBothEnds:"Remove Space from Both Ends",collapseSequentialSpaces:"Collapse Sequential Spaces",typeCustomTitleHere:"Type custom title here",displayEmptyElements:"Display Empty Elements",waitingForNewGame:"Waiting for new game.",waitingForPlayerSetup:"Waiting for player setup.",insertedComment:"Inserted comment.",conversionCompleted:"Conversion completed.",tryingToConnectAndLoginToCSAServer:"Trying to connect and login to CSA server.",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"*In web browser version, it will output logs to console and ignore this setting.",shouldRestartToApplyLogSettings:"*You should restart this app to apply log settings.",canOpenLogDirectoryFromMenu:'*You can open log directory from "Debug" - "Open Log Directory" menu.',hasNoOldLogCleanUpFeature:"*This app has no clean-up feature. Please remove old logs manually.",processingPleaseWait:"Processing, please wait.",importingFollowingRecordOrPosition:"Importing the following record(or position).",supportsKIF_KI2_CSA_USI_SFEN_JKF:"*Supports KIF, KI2, CSA, USI, SFEN, and JKF.",pleasePasteRecordIntoTextArea:"*Please paste record data into the text area.",pleaseSpecifyPlainTextURL:"*Please specify plain text URL.",redirectNotSupported:"*Redirect is not supported.",desktopVersionPastesAutomatically:"*In desktop version, it will paste automatically from clipboard.",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:'Early ponder feature sends "ponderhit" command with YaneuraOu\'s non-standard options.',ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"If your engine does not support the options, it may cause unexpected behavior.",someLogsDisabled:"Some log settings are disabled.",logsRecommendedForCSAProtocol:"Log settings are recommended for CSA protocol.",pleaseEnableLogsAndRestart:"Please enable log settings and restart this app.",notSendPVOnStandardCSAProtocol:"Client do not send PV on standard CSA protocol.",csaProtocolSendPlaintextPassword:"On CSA protocol, client send plaintext password.",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"Password will saved as plaintext because OS side encryption is not available.",pleaseUncheckSaveHistoryIfNotWantSave:"Please uncheck Save History, if you don't want to save.",csaProtocolSendPlaintextPasswordRegardlessOfHistory:"On CSA protocol, client send plaintext password regardless of history.",whenNewVersionIsAvailableItWillBeNotified:"When new version is available, it will be notified.",pleaseCheckMessageThisIsTestNotificationByAboveButton:'Please check the message "This is test notification." by above button.',ifNotWorkYouShouldAllowNotificationOnOSSetting:"If it does not work, you should allow notification on OS setting.",areYouSureWantToResign:"Are you sure you want to resign?",areYouSureWantToDoDeclaration:"Are you sure you want to do declaration?",areYouSureWantToQuitGames:"Are you sure you want to quit games?",areYouSureWantToRequestQuit:"You have possibility to be loser. Are you sure you want to request quit?",areYouSureWantToClearRecord:"Are you sure you want to clear record?",areYouSureWantToDiscardPosition:"Are you sure you want to discard the position?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"Are you sure you want to open the file instead of current record?",areYouSureWantToClearHistory:"Are you sure you want to clear history?",yamlFormatSettingCopiedToClipboard:"YAML format setting copied to clipboard.",jsonFormatSettingCopiedToClipboard:"JSON format setting copied to clipboard.",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge command copied to clipboard.",youCanNotCloseAppWhileCSAOnlineGame:"You can not close app while CSA online game.",fileExtensionNotSupported:"File extension is not supported.",errorOccuredWhileDisconnectingFromCSAServer:"An error occured while disconnecting from CSA server.",failedToConnectToCSAServer:"Failed to connect to CSA server.",errorOccuredWhileLogoutFromCSAServer:"An error occured while logout from CSA server.",disconnectedFromCSAServer:"Disconnected from CSA server.",csaServerLoginDenied:"CSA server login denied.",thisFeatureNotAvailableOnWebApp:"This feature is not available on web app.",failedToStartNewGame:"Failed to start new game.",errorOccuredWhileEndingGame:"An error occured while ending game.",failedToSendGoCommand:"Failed to send go-command.",failedToSendPonderCommand:"Failed to send ponder-command.",failedToSendStopCommand:"Failed to send stop-command.",failedToShutdownEngines:"Failed to shutdown engines.",failedToCheckUpdates:"Failed to check updates.",failedToSaveRecord:"Failed to save record.",failedToParseSFEN:"Failed to parse SFEN.",failedToDetectRecordFormat:"Failed to detect record format.",unknown:"Unknown",unknownFileExtension:"Unknown file extension.",emptyRecordInput:"Empty record input.",invalidPieceName:"Invalid piece name",invalidTurn:"Invalid turn",invalidMove:"Invalid move",invalidMoveNumber:"Invalid move number",invalidDestination:"Invalid destination",pieceNotExists:"Piece not exists",invalidLine:"Invalid line",invalidBoard:"Invalid board",invalidHandPiece:"Invalid hand piece",invalidUSI:"Invalid USI",backgroundImageFileNotSelected:"Background image file is not selected.",pieceImageFileNotSelected:"Piece image File is not selected.",boardImageFileNotSelected:"Board image file is not selected.",pieceStandImageFileNotSelected:"Piece stand image file is not selected.",pieceVolumeMustBe0To100Percent:"Piece volume must be 0% to 100%.",clockVolumeMustBe0To100Percent:"Clock volume must be 0% to 100%.",clockPitchMustBe220To880Hz:"Clock pitch must be 220Hz to 880Hz.",engineTimeoutMustBe1To300Seconds:"Engine timeout must be 1 to 300 seconds.",coefficientInSigmoidMustBeGreaterThan0:"Coefficient in sigmoid must be greater than 0.",inaccuracyThresholdMustBe1To100Percent:"Inaccuracy must be 1% to 100%.",dubiousThresholdMustBe1To100Percent:"Dubious threshold must be 1% to 100%.",mistakeThresholdMustBe1To100Percent:"Mistake threshold must be 1% to 100%.",blunderThresholdMustBe1To100Percent:"Blunder threshold must be 1% to 100%.",recordSavedWithGarbledCharacters:"The record has saved with some garbled characters.",pleaseConsiderToUseKIFU:"Please consider to use KIFU(UTF-8).",youCanChangeDefaultRecordFileFormatFromAppSettings:"You can change default record file format from App Settings.",inaccuracyThresholdMustBeLessThanDubiousThreshold:"Inaccuracy threshold must be less than dubious threshold.",dubiousThresholdMustBeLessThanMistakeThreshold:"Dubious threshold must be less than mistake threshold.",mistakeThresholdMustBeLessThanBlunderThreshold:"Mistake threshold must be less than blunder threshold.",thisEngineNotSupportsMateSearch:"This engine does not support mate search.",pleaseEndActiveFeaturesBeforeOpenRecord:"Please end active features before open record.",bothTimeLimitAndByoyomiAreNotSet:"Both time limit and byoyomi are not set.",canNotUseByoyomiWithFischer:"You can not use Byoyomi with Fischer.",repeatsMustBeOneIfHumanPlayerIncluded:"The number of repeats must be 1, if a human player is included.",protocolVersionNotSelected:"Protocol version is not selected.",hostNameIsEmpty:"Host name is empty.",invalidPortNumber:"Invalid port number.",idIsEmpty:"ID is empty.",idContainsSpace:"ID contains space.",passwordContainsSpace:"Password contains space.",tcpKeepaliveInitialDelayMustBePositive:"TCP keepalive initial delay must be positive.",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"Blank line ping initial delay must be >=30.",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"Blank line ping interval must be >=30.",engineNotSelected:"Engine is not selected.",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"For exporting conversion log, please enable app logs, set log level to DEBUG and restart this app.",sourceDirectoryNotSpecified:"Source directory is not specified.",sourceFormatsNotSpecified:"Source formats are not specified.",destinationDirectoryNotSpecified:"Destination directory is not specified.",destinationFileNotSpecified:"Destination file is not specified.",totalNumber:e=>`Total: ${e}`,number:e=>""+e,tryToReloginToCSAServerNSecondsLater:e=>`Try to relogin to CSA server ${e} seconds later.`,mateInNPlyDoYouWantToDisplay:e=>`Mate in ${e} ply. Do you want to display?`,insertedNMovesToRecord:e=>`Inserted ${e} moves to the record.`,errorsOccurred:e=>e>=2?`${e} errors have occurred.`:`${e} error has occurred.`,between:(e,t)=>`between ${e} and ${t}`,addNthEngine:e=>`Add ${(0,n.ordinal)(e)} engine`,copyOf:e=>`${e} (copy)`,keepLatest:e=>`keep latest ${e}`,followingDataNotSavedBecauseNotSupporetedBy:e=>`Following data not saved because not supporeted by "${e}".`,areYouSureWantToDeleteFollowingMove:e=>`Are you sure you want to delete ${e}th move and the following move?`,failedToOpenDirectory:e=>`Failed to open directory of the file: ${e}`,unexpectedEventSenderPleaseReport:e=>`Unexpected event sender. Please report this error message to developer. [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`Unexpected HTTP method. Please report this error message to developer. [${e}]`,unexpectedRequestURLPleaseReport:e=>`Unexpected request URL. Please report this error message to developer. [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`No response from engine while ${e} seconds. Please extend timeout at app settings, if your engine is slow.`,stableVersionReleased:e=>`Stable version ${e} released!`,latestVersionReleased:e=>`Latest version ${e} released!`}},9445:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ja=void 0,t.ja={shogiHome:"ShogiHome",clear:"初期化",open:"開く",saveOverwrite:"上書き保存",newRecord:"新規棋譜",openRecord:"棋譜を開く",saveRecord:"棋譜を上書き保存",saveRecordAs:"棋譜を名前を付けて保存",openAutoSavingDirectory:"自動保存先を開く",exportPositionImage:"局面図を出力",positionImage:"局面図",batchConversion:"一括変換",recordFileBatchConversion:"棋譜ファイル一括変換",close:"閉じる",quit:"終了",editing:"編集",copyAsKIF:"コピー・KIF",copyAsKI2:"コピー・KI2",copyAsCSA:"コピー・CSA",copyAsUSI:"コピー・USI",copyAsSFEN:"コピー・SFEN",copyAsJKF:"コピー・JKF",copy:"コピー",cut:"切り取り",paste:"貼り付け",copyRecord:"棋譜コピー",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSIUntilCurrentMove:"USI形式(現在の指し手まで)",asUSIAll:"USI形式(全て)",asJSONKifuFormat:"JSON棋譜フォーマット",copyPositionAsSFEN:"局面コピー(SFEN形式)",pasteRecordOrPosition:"棋譜・局面貼り付け",appendSpecialMove:"特殊な指し手",deleteMoves:"現在の位置から棋譜を削除",view:"表示",toggleFullScreen:"全画面表示切り替え",defaultFontSize:"標準の文字サイズ",largerFontSize:"文字を拡大",smallerFontSize:"文字を縮小",settings:"設定",config:"設定",debug:"デバッグ",toggleDevTools:"開発者ツール表示切り替え",logFile:"ログファイル",openAppLog:"アプリログを開く",openUSILog:"USI通信ログを開く",openCSALog:"CSA通信ログを開く",tailAppLog:"アプリログをTailする",tailUSILog:"USI通信ログをTailする",tailCSALog:"CSA通信ログをTailする",copyAppLogTailCommand:"アプリログのTailコマンドをコピー",copyUSILogTailCommand:"USI通信ログのTailコマンドをコピー",copyCSALogTailCommand:"CSA通信ログのTailコマンドをコピー",reloadCustomPieceImage:"カスタム駒画像をリロード",launchUSIEngine:"USIエンジンを起動",connectToCSAServer:"CSAサーバーに接続",adminMode:"管理モード",inAdminModeYouShouldInvokeCommandsManuallyAtPrompt:"管理モードではプロンプトから手動でコマンドを実行する必要があります。",setoptionAndPrecedingCommandsWillBeSentAutomatically:"setoptionコマンドまでのコマンドは自動で送信されます。",serverMustSupportShogiServerX1ModeLogIn:"サーバーは shogi-server の拡張モード (x1) ログインをサポートしている必要があります。",folders:"各種フォルダ",notification:"通知",notificationTest:"通知テスト",thisIsTestNotification:"これは通知のテストです。",app:"アプリ",log:"ログ",backup:"バックアップ",cache:"キャッシュ",help:"ヘルプ",openWebSite:"Webサイトを開く",howToUse:"使い方を開く",openLatestReleasePage:"最新版リリースページを開く",openStableReleasePage:"安定版リリースページを開く",inputs:"入力",outputs:"出力",format:"フォーマット",formats:"フォーマット",subdirectories:"サブディレクトリ",separately:"個別",merge:"マージ",createSubdirectories:"サブディレクトリ作成",nameConflictAction:"名前衝突時の動作",numberSuffix:"番号付与",skip:"スキップ",convert:"変換",openLogFile:"ログファイルを開く",succeeded:"成功",failed:"失敗",skipped:"スキップ",game:"対局",player:"プレイヤー",server:"サーバー",selectFromHistory:"履歴から選ぶ",noHistory:"履歴がありません",saveHistory:"履歴に保存する",version:"バージョン",gameProgress:"対局の経過",allGamesCompleted:"連続対局終了",wins:"勝ち数",draws:"引き分け",validGames:"有効対局数",invalidGames:"無効対局数",eloRatingDiff:"レーティング差",ignoreDraws:"引き分け無効",drawsAreHalfWin:"引き分け0.5勝",zValue:"Z値",significance5pc:"有意水準5%",significance1pc:"有意水準1%",gameEnded:"対局終了",offlineGame:"ローカル対局",csaOnlineGame:"通信対局(CSA)",csaProtocolOnlineGame:"通信対局(CSAプロトコル)",csaProtocolV121:"CSAプロトコル1.2.1 標準",csaProtocolV121WithPVComment:"CSAプロトコル1.2.1 読み筋コメント付き",hostToConnect:"接続先ホスト",portNumber:"ポート番号",password:"パスワード",showPassword:"パスワードを表示する",keepaliveInitialDelay:"Keepalive初期遅延",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初期遅延",blankLinePingInterval:"空行Ping間隔",logout:"ログアウト",calculateJishogiPoints:"持将棋の点数を計算",jishogiPoints:"持将棋の点数",displayGameResults:"戦績確認",interrupt:"中断",stopGame:"対局中断",resign:"投了",draw:"引き分け",impass:"持将棋",repetitionDraw:"千日手",mate:"詰み",noMate:"不詰",mateSearch:"詰み探索",startMateSearch:"詰み探索開始",stopMateSearch:"詰み探索終了",noMateFound:"詰みが見つかりませんでした。",timeout:"時間切れ",foulWin:"反則勝ち",foulLose:"反則負け",enteringOfKing:"入玉勝ち",winByDefault:"不戦勝",loseByDefault:"不戦敗",winByDeclaration:"宣言勝ち",declareWinning:"勝ち宣言",research:"検討",startResearch:"検討開始",endResearch:"検討終了",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"解析中断",setupPosition:"局面編集",startPositionSetup:"局面編集開始",completePositionSetup:"局面編集終了",changeTurn:"手番変更",initializePosition:"局面の初期化",changePieceSet:"駒の増減",appSettings:"アプリ設定",language:"言語",theme:"テーマ",standard:"標準",green:"緑",cherryBlossom:"桜",customImage:"カスタム画像",autumn:"紅葉",snow:"雪",darkGreen:"深緑",dark:"ダーク",piece:"駒",singleKanjiPiece:"一文字駒",singleKanjiGothicPiece:"一文字駒(ゴシック体)",singleKanjiDarkPiece:"一文字駒(ダーク)",singleKanjiGothicDarkPiece:"一文字駒(ゴシック体・ダーク)",imageHasMarginsRemoveToDisplayLarger:"画像に余白が含まれている(除去して大きく表示)",backgroundImage:"背景画像",board:"盤",pieceStand:"駒台",lightWoodyTexture:"木目(明るい)",warmWoodTexture:"木目(暖かい)",resin:"樹脂",transparent:"透過表示",boardOpacity:"盤の不透明度",pieceStandOpacity:"駒台の不透明度",recordOpacity:"棋譜の不透明度",displayFileAndRank:"段・筋を表示",displayLeftControls:"左側操作ボタンを表示",displayRightControls:"右側操作ボタンを表示",tabViewStyle:"タブビューの形式",oneColumn:"1列",twoColumns:"2列",sounds:"音",pieceLoudness:"駒音の大きさ",clockLoudness:"時計音の大きさ",clockPitch:"時計音の高さ",clockSoundTarget:"時計音の対象",anyTurn:"全ての手番",onlyHumanTurn:"人間の手番のみ",defaultRecordFileFormat:"デフォルトの保存形式",textEncoding:"文字コード",strict:"厳格",autoDetect:"自動判定",newlineCharacter:"改行文字",old90sMac:"90年代Mac",autoSaving:"自動保存",autoSavingDirectory:"棋譜の自動保存先",recordFileName:"棋譜ファイル名",select:"選択",positionOfUSIOutput:"USI の局面表記",movesOfUSIOutput:"USI の指し手表記",onlySFEN:"SFEN のみ",usiProtocol:"USIプロトコル",translateOptionName:"オプション名を翻訳",functionalOnJapaneseOnly:"日本語選択時のみ有効",maxStartupTime:"最大起動待ち時間",forDevelopers:"開発者向け",enableAppLog:"アプリログを出力",enableUSILog:"USI通信ログを出力",enableCSALog:"CSA通信ログを出力",logLevel:"ログレベル",engineSettings:"エンジン設定",flipBoard:"盤面反転",file:"ファイル",recordFile:"棋譜ファイル",executableFile:"実行可能ファイル",imageFile:"画像ファイル",unsaved:"未保存",remove:"削除",deleteMove:"指し手削除",recordProperties:"棋譜情報",comments:"コメント",commentsAndBookmarks:"コメント・しおり",branches:"分岐",bookmark:"しおり",bookmarkList:"しおり一覧",useBookmarkAsHeader:"しおりを見出しに使う",moveComments:"指し手コメント",searchLog:"思考",pv:"読み筋",mateShort:"詰",displayPVShort:"再現",evaluation:"評価値",eval:"評価値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRate:"評価値・期待勝率",swapEachTurnChange:"手番側有利がプラスの値",alwaysSenteIsPositive:"先手有利がプラスの値",signOfEvaluation:"評価値の符号",winRateCoefficient:"勝率換算係数",monitor:"監視",hideTabView:"最小化",expandTabView:"タブビューを再表示",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",swapSenteGote:"先後入れ替え",currentPosition:"現在の局面",enableEngineTimeout:"エンジンの時間切れあり",setDifferentTimeForGote:"後手に異なる時間を設定",nextTurn:"次の手番",elapsedTime:"消費時間",elapsed:"経過時間",rank:"順位",depth:"深さ",searchEngine:"エンジン",ponder:"先読み(Ponder)",numberOfThreads:"スレッド数",multiPV:"マルチPV",startPosition:"開始局面",maxMoves:"最大手数",gameRepetition:"連続対局",jishogi:"持将棋",rule24:"24点法",rule27:"27点法",tryRule:"トライルール",autoRelogin:"自動で再ログインする",restartItEveryGame:"1局ごとに再起動する",swapTurnWhenGameRepetition:"1局ごとに手番を入れ替える",outputComments:"コメントを出力する",saveRecordAutomatically:"棋譜を自動で保存する",adjustBoardToHumanPlayer:"人を手前に表示する",adjustBoardAutomatically:"盤面の向きを自動調整",command:"コマンド",startGame:"対局開始",cancelGame:"対局をキャンセル",allottedTime:"持ち時間",byoyomi:"秒読み",increments:"増加",startEndCriteria:"開始・終了条件",endCriteria1Move:"局面ごとの終了条件",outputSettings:"出力設定",noOutputs:"出力しない",insertCommentToTop:"前方に加筆する",appendCommentToBottom:"末尾に加筆する",insertToComment:"コメントに挿入",insertToRecord:"棋譜に挿入",overwrite:"上書きする",fromPrefix:"",fromSuffix:"から",toPrefix:"",toSuffix:"まで",plyPrefix:"",plySuffix:"手目",hoursSuffix:"時間",minutesSuffix:"分",secondsSuffix:"秒",engineManagement:"エンジン管理",engineName:"エンジン名",author:"作者",earlyPonder:"早期Ponder",enginePath:"場所",openDirectory:"フォルダを開く",displayName:"表示名",invoke:"実行",resetToEngineDefaultValues:"エンジンの既定値に戻す",defaultValue:"既定値",noEngineRegistered:"エンジンが登録されていません。",duplicate:"複製",add:"追加",recommended:"推奨",import:"取り込む",saveAndClose:"保存して閉じる",save:"保存",saveAs:"保存",history:"履歴",clearHistory:"履歴をクリア",userFile:"ユーザーのファイル",automaticBackup:"自動バックアップ",restore:"復元",loadRecordFromWeb:"Webの棋譜を取得",fetchLatestData:"最新データを取得",sourceURL:"ソースURL",ok:"OK",cancel:"キャンセル",back:"戻る",name:"名前",prediction:"予想",best:"最善",nodes:"Node数",hashUsage:"Hash使用率",stop:"停止",resume:"再開",nonHandicap:"平手",lanceHandicap:"香落ち",rightLanceHandicap:"右香落ち",bishopHandicap:"角落ち",rookHandicap:"飛車落ち",rookLanceHandicap:"飛車香落ち",twoPiecesHandicap:"二枚落ち",fourPiecesHandicap:"四枚落ち",sixPiecesHandicap:"六枚落ち",eightPiecesHandicap:"八枚落ち",tenPiecesHandicap:"十枚落ち",tsumeShogi:"詰将棋",doubleKingTsumeShogi:"双玉詰将棋",startDateTime:"開始日時",endDateTime:"終了日時",gameDate:"対局日",tournament:"棋戦",strategy:"戦型",gameTitle:"表題",timeLimit:"持ち時間",blackTimeLimit:"先手の持ち時間",whiteTimeLimit:"後手の持ち時間",place:"場所",postedOn:"掲載",note:"備考",senteShortName:"先手省略名",goteShortName:"後手省略名",opusNo:"作品番号",opusName:"作品名",publishedBy:"発表誌",publishedOn:"発表年月",source:"出典",numberOfMoves:"手数",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"オプション名で検索",filterByEngineName:"エンジン名で検索",bookStyle:"書籍風",gameStyle:"対局画面風",thin:"細",bold:"太",extraBold:"極太",playerName:"対局者名",typeface:"書体",weight:"太さ",handLabel:"持ち駒ラベル",header:"見出し",vertical:"垂直方向",size:"サイズ",none:"なし",bgCover:"1枚で表示",bgContain:"拡大して表示",bgTile:"タイル状に表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"悪手",blunder:"大悪手",inaccuracyThreshold:"緩手の閾値",dubiousThreshold:"疑問手の閾値",mistakeThreshold:"悪手の閾値",blunderThreshold:"大悪手の閾値",gothic:"ゴシック体",mincho:"明朝体",appVersion:"アプリバージョン",installed:"インストール済み",stable:"安定版",latest:"最新版",updatedAt:"更新日時",createdAt:"作成日時",lastSent:"最終送信",lastReceived:"最終受信",protocolVersion:"プロトコルバージョン",prompt:"プロンプト",openPrompt:"プロンプトを開く",forceQuit:"強制Quit",forceClose:"強制Close",blankLine:"空行",autoScroll:"自動スクロール",showTimestamp:"タイムスタンプを表示",highlightByPartialMatch:"部分一致でハイライト",csaServer:"CSAサーバー",usiEngine:"USIエンジン",noRunningUSIEngine:"稼働中のUSIエンジンはありません。",noConnectedCSAServer:"接続中のCSAサーバーはありません。",willBeRemovedFromTheListSoon:"セッションが終了したため、まもなく一覧から削除されます。",typeCommandHereAndPressEnter:"コマンドを入力してEnter",allowBlankLine:"空行を許可",removeSpaceFromBothEnds:"両端の空白を削除",collapseSequentialSpaces:"連続する空白をまとめる",typeCustomTitleHere:"ここに見出しを入力",displayEmptyElements:"未入力の項目を表示",waitingForNewGame:"対局開始を待っています。",waitingForPlayerSetup:"対局者の準備を待っています。",insertedComment:"コメントを挿入しました。",conversionCompleted:"変換が完了しました。",tryingToConnectAndLoginToCSAServer:"CSAサーバーへの接続とログインを試みています。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※ブラウザ版ではログがコンソールに出力され、ここでの設定は無視されます。",shouldRestartToApplyLogSettings:"※ログ設定の変更を反映するにはアプリの再起動が必要です。",canOpenLogDirectoryFromMenu:"※ログの出力先は「デバッグ」-「ログファイルの場所を開く」で開きます。",hasNoOldLogCleanUpFeature:"※現在、古いログファイルの自動削除機能はありません。",processingPleaseWait:"処理中です。お待ちください。",importingFollowingRecordOrPosition:"以下の棋譜(または局面)を取り込みます。",supportsKIF_KI2_CSA_USI_SFEN_JKF:"※KIF形式/KI2形式/CSA形式/USI/SFEN/JKFに対応しています。",pleasePasteRecordIntoTextArea:"※テキストエリアに棋譜を貼り付けてください。",pleaseSpecifyPlainTextURL:"※プレーンテキストのURLを指定してください。",redirectNotSupported:"※リダイレクトはサポートされていません。",desktopVersionPastesAutomatically:"※インストールアプリ版では自動的に貼り付けられます。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期Ponder機能は、やねうら王の独自オプションでponderhitコマンドを送信します。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"エンジンがこのオプションに対応していない場合、予期しない動作を引き起こす可能性があります。",someLogsDisabled:"一部のログが無効になっています。",logsRecommendedForCSAProtocol:"CSAプロトコルを使用した対局では各種ログの出力を推奨します。",pleaseEnableLogsAndRestart:"アプリ設定からログを有効にしてアプリを再起動してください。",notSendPVOnStandardCSAProtocol:"標準のCSAプロトコルでは評価値や読み筋が送信されません。",csaProtocolSendPlaintextPassword:"CSAプロトコルの規格上パスワードは平文で送信されます。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"OSの暗号化機能が利用できないため、入力したパスワードは平文で保存されます。",pleaseUncheckSaveHistoryIfNotWantSave:"保存したくない場合は「履歴に保存する」のチェックを外してください。",csaProtocolSendPlaintextPasswordRegardlessOfHistory:"なお、履歴の保存に関係なくCSAプロトコルの規格上パスワードは平文で送信されます。",whenNewVersionIsAvailableItWillBeNotified:"新しいバージョンが利用可能になると通知されます。",pleaseCheckMessageThisIsTestNotificationByAboveButton:"上のボタンで「これは通知のテストです。」というメッセージを確認してください。",ifNotWorkYouShouldAllowNotificationOnOSSetting:"表示されない場合はOSの設定で通知を許可してください。",areYouSureWantToResign:"投了しますか?",areYouSureWantToDoDeclaration:"宣言しますか?",areYouSureWantToQuitGames:"連続対局を中断しますか?",areYouSureWantToRequestQuit:"中断を要求すると負けになる可能性があります。よろしいですか?",areYouSureWantToClearRecord:"現在の棋譜は削除されます。よろしいですか?",areYouSureWantToDiscardPosition:"現在の局面は破棄されます。よろしいですか?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"現在の棋譜を閉じて別のファイルを開きます。よろしいですか?",areYouSureWantToClearHistory:"履歴をクリアします。よろしいですか?",yamlFormatSettingCopiedToClipboard:"YAML形式の設定をクリップボードにコピーしました。",jsonFormatSettingCopiedToClipboard:"JSON形式の設定をクリップボードにコピーしました。",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge コマンドをクリップボードにコピーしました。",youCanNotCloseAppWhileCSAOnlineGame:"CSAプロトコル使用中はアプリを終了できません。",fileExtensionNotSupported:"取り扱いできないファイル拡張子です。",errorOccuredWhileDisconnectingFromCSAServer:"CSAサーバーからの切断中にエラーが発生しました。",failedToConnectToCSAServer:"CSAサーバーに接続できませんでした。",errorOccuredWhileLogoutFromCSAServer:"CSAサーバーからのログアウト中にエラーが発生しました。",disconnectedFromCSAServer:"CSAサーバーへの接続が切れました。",csaServerLoginDenied:"CSAサーバーへのログインが拒否されました。",thisFeatureNotAvailableOnWebApp:"Web版では利用できない機能です。",failedToStartNewGame:"対局の開始に失敗しました。",errorOccuredWhileEndingGame:"対局の終了中にエラーが発生しました。",failedToSendGoCommand:"goコマンドを送信できませんでした。",failedToSendPonderCommand:"ponderコマンドを送信できませんでした。",failedToSendStopCommand:"stopコマンドを送信できませんでした。",failedToShutdownEngines:"エンジンを正常に終了できませんでした。",failedToCheckUpdates:"アップデートの確認ができませんでした。",failedToSaveRecord:"棋譜の保存に失敗しました。",failedToParseSFEN:"SFENの読み込みに失敗しました。",failedToDetectRecordFormat:"棋譜形式を判別できませんでした。",unknown:"不明",unknownFileExtension:"不明なファイル形式です。",emptyRecordInput:"棋譜が入力されていません。",invalidPieceName:"不正な駒",invalidTurn:"不正な手番",invalidMove:"不正な指し手",invalidMoveNumber:"不正な手数",invalidDestination:"不正な移動先",pieceNotExists:"存在しない駒",invalidLine:"不正な行",invalidBoard:"不正な盤面",invalidHandPiece:"不正な持ち駒",invalidUSI:"不正なUSI",backgroundImageFileNotSelected:"背景画像のファイルが選択されていません。",pieceImageFileNotSelected:"駒画像のファイルが選択されていません。",boardImageFileNotSelected:"盤面画像のファイルが選択されていません。",pieceStandImageFileNotSelected:"駒台画像のファイルが選択されていません。",pieceVolumeMustBe0To100Percent:"駒音の大きさには0%~100%の値を指定してください。",clockVolumeMustBe0To100Percent:"時計音の大きさには0%~100%の値を指定してください。",clockPitchMustBe220To880Hz:"時計音の高さには220Hz~880Hzの値を指定してください。",engineTimeoutMustBe1To300Seconds:"エンジンのタイムアウト時間には1秒~300秒の値を指定してください。",coefficientInSigmoidMustBeGreaterThan0:"勝率換算係数には0より大きい値を指定してください。",inaccuracyThresholdMustBe1To100Percent:"緩手には1%~100%の値を指定してください。",dubiousThresholdMustBe1To100Percent:"疑問手には1%~100%の値を指定してください。",mistakeThresholdMustBe1To100Percent:"悪手には1%~100%の閾値を指定してください。",blunderThresholdMustBe1To100Percent:"大悪手には1%~100%の値を指定してください。",recordSavedWithGarbledCharacters:"保存した棋譜の一部が文字化けしている可能性があります。",pleaseConsiderToUseKIFU:"KIFU形式(UTF-8)で保存することをお勧めします。",youCanChangeDefaultRecordFileFormatFromAppSettings:"デフォルトの棋譜形式はアプリ設定で変更可能です。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手には疑問手より小さい値を指定してください。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手には悪手より小さい値を指定してください。",mistakeThresholdMustBeLessThanBlunderThreshold:"悪手には大悪手より小さい値を指定してください。",thisEngineNotSupportsMateSearch:"このエンジンは詰将棋探索をサポートしていません。",pleaseEndActiveFeaturesBeforeOpenRecord:"棋譜を開くには現在利用している機能を終了してください。",bothTimeLimitAndByoyomiAreNotSet:"持ち時間と秒読みが両方とも0です。",canNotUseByoyomiWithFischer:"秒読みとフィッシャールールは併用できません。",repeatsMustBeOneIfHumanPlayerIncluded:"人が対局する場合、連続対局の回数は1以外を設定できません。",protocolVersionNotSelected:"プロトコルのバージョンを選択してください。",hostNameIsEmpty:"ホスト名が空です。",invalidPortNumber:"無効なポート番号です。",idIsEmpty:"IDが空です。",idContainsSpace:"IDに空白が含まれています。",passwordContainsSpace:"パスワードに空白が含まれています。",tcpKeepaliveInitialDelayMustBePositive:"TCP Keepaliveの初期遅延時間には正の値を指定してください。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"空行送信の初期遅延時間には30秒以上を指定してください。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"空行送信の間隔には30秒以上を指定してください。",engineNotSelected:"エンジンが選択されていません。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"変換ログを出力するにはアプリログを有効にし、ログレベルをデバッグに設定してアプリを再起動してください。",sourceDirectoryNotSpecified:"入力ディレクトリが指定されていません。",sourceFormatsNotSpecified:"入力の対象フォーマットが指定されていません。",destinationDirectoryNotSpecified:"出力ディレクトリが指定されていません。",destinationFileNotSpecified:"出力ファイルが指定されていません。",totalNumber:e=>`合計 ${e} 件`,number:e=>`${e} 件`,tryToReloginToCSAServerNSecondsLater:e=>`CSAサーバーへのログインを${e}秒後に再試行します。`,mateInNPlyDoYouWantToDisplay:e=>`${e}手で詰みました。再生画面を表示しますか?`,insertedNMovesToRecord:e=>`${e}手を棋譜に挿入しました。`,errorsOccurred:e=>`${e} 種類のエラーが発生しました。`,between:(e,t)=>`${e} から ${t} まで`,addNthEngine:e=>`${e} 個目のエンジンを追加`,copyOf:e=>`${e} のコピー`,keepLatest:e=>`最新${e}件まで`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下の情報は ${e} 形式では対応していないため保存されませんでした。`,areYouSureWantToDeleteFollowingMove:e=>`${e}手目以降を削除します。よろしいですか?`,failedToOpenDirectory:e=>`ファイルの場所を開けませんでした: ${e}`,unexpectedEventSenderPleaseReport:e=>`予期せぬイベントの送信元です。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`予期せぬHTTPメソッドです。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`予期せぬURLへのリクエストです。このエラーメッセージを開発者に報告してください。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`${e}秒以内にエンジンから応答がありませんでした。エンジンの起動が重い場合はアプリ設定で待ち時間を延長してください。`,stableVersionReleased:e=>`安定版 ${e} がリリースされました!`,latestVersionReleased:e=>`最新版 ${e} がリリースされました!`}},8584:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.zh_tw=void 0,t.zh_tw={shogiHome:"ShogiHome",clear:"清除",open:"開啟",saveOverwrite:"覆蓋檔案",newRecord:"新棋譜",openRecord:"打開棋譜",saveRecord:"保存棋譜",saveRecordAs:"另存棋譜",openAutoSavingDirectory:"打開自動保存目錄",exportPositionImage:"輸出局面圖",positionImage:"局面圖",batchConversion:"棋譜大量轉換",recordFileBatchConversion:"棋譜大量轉換",close:"關閉",quit:"離開",editing:"編輯",copyAsKIF:"複製KIF棋譜",copyAsKI2:"複製KI2棋譜",copyAsCSA:"複製CSA棋譜",copyAsUSI:"複製USI棋譜",copyAsSFEN:"複製SFEN局面",copyAsJKF:"複製JKF棋譜",copy:"拷貝",cut:"剪下",paste:"貼上",copyRecord:"複製棋譜",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSIUntilCurrentMove:"USI形式(到目前手數為止)",asUSIAll:"USI形式(全部)",asJSONKifuFormat:"JSON Kifu Format",copyPositionAsSFEN:"複製局面(SFEN形式)",pasteRecordOrPosition:"貼上棋譜、局面",appendSpecialMove:"特殊手",deleteMoves:"刪除現在位置後的棋譜",view:"表示",toggleFullScreen:"切換全螢幕",defaultFontSize:"預設字體尺寸",largerFontSize:"增加字體尺寸",smallerFontSize:"縮小字體尺寸",settings:"設定",config:"設定",debug:"偵錯",toggleDevTools:"打開/關閉開發者工具顯示",logFile:"紀錄檔",openAppLog:"開啟程式紀錄檔",openUSILog:"開啟USI通訊紀錄檔",openCSALog:"開啟CSA通訊紀錄檔",tailAppLog:"即時顯示程式紀錄",tailUSILog:"即時顯示USI通訊紀錄",tailCSALog:"即時顯示CSA通訊紀錄",copyAppLogTailCommand:"複製即時顯示程式紀錄指令",copyUSILogTailCommand:"複製即時顯示USI通訊紀錄指令",copyCSALogTailCommand:"複製即時顯示CSA通訊紀錄指令",reloadCustomPieceImage:"重整自訂棋駒圖片",launchUSIEngine:"啟動USI引擎",connectToCSAServer:"連接CSA伺服器",adminMode:"管理模式",inAdminModeYouShouldInvokeCommandsManuallyAtPrompt:"在管理模式下,您需要手動輸入指令方可執行。",setoptionAndPrecedingCommandsWillBeSentAutomatically:"setoption 之前的指令將會被自動發送。",serverMustSupportShogiServerX1ModeLogIn:"對應的 shogi-server 必須支援擴展 (x1) 登入模式。",folders:"資料夾",notification:"通知",notificationTest:"通知測試",thisIsTestNotification:"這是測試用的通知。",app:"軟體",log:"紀錄檔",backup:"備份",cache:"快取",help:"協助",openWebSite:"官方網站",howToUse:"使用教學",openLatestReleasePage:"前往最新版發布頁面",openStableReleasePage:"前往安定版發布頁面",inputs:"輸入目錄",outputs:"輸出目錄",format:"格式",formats:"格式",subdirectories:"子目錄",separately:"個別",merge:"合併",createSubdirectories:"建立子目錄",nameConflictAction:"名稱衝突處理方式",numberSuffix:"附加編號",skip:"跳過該檔案",convert:"開始轉換",openLogFile:"打開記錄檔案",succeeded:"成功",failed:"失敗",skipped:"跳過",game:"對局",player:"玩家",server:"伺服器",selectFromHistory:"從紀錄選取",noHistory:"目前沒有紀錄",saveHistory:"保存紀錄",version:"版本",gameProgress:"對局過程",allGamesCompleted:"連續對局結束",wins:"勝利數目",draws:"平手數目",validGames:"有効対局数",invalidGames:"無効対局数",eloRatingDiff:"等級分相差",ignoreDraws:"引き分け無効",drawsAreHalfWin:"平手作0.5勝",zValue:"Z值",significance5pc:"有意水準5%",significance1pc:"有意水準1%",gameEnded:"對局結束",offlineGame:"本地(單機)對局",csaOnlineGame:"通訊對局(CSA)",csaProtocolOnlineGame:"通訊對局(CSA協定)",csaProtocolV121:"CSA協定 1.2.1 標準",csaProtocolV121WithPVComment:"CSA協定 1.2.1 +思考註解",hostToConnect:"連接之伺服器",portNumber:"連接埠號碼",password:"密碼",showPassword:"顯示密碼",keepaliveInitialDelay:"Keepalive初始延遲",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初始延遲",blankLinePingInterval:"空行Ping間隔",logout:"登出",calculateJishogiPoints:"計算持將棋點數",jishogiPoints:"持將棋點數",displayGameResults:"確認戰績",interrupt:"中斷",stopGame:"對局中斷",resign:"投了",draw:"平手",impass:"持將棋",repetitionDraw:"千日手",mate:"詰死",noMate:"無詰",mateSearch:"詰搜尋",startMateSearch:"開始詰搜尋",stopMateSearch:"結束詰搜尋",noMateFound:"在目前的盤面中找不到詰。",timeout:"時間耗盡",foulWin:"反則勝利",foulLose:"反則敗北",enteringOfKing:"入玉勝利",winByDefault:"不戰勝",loseByDefault:"不戰敗",winByDeclaration:"勝利宣言",declareWinning:"勝利宣言",research:"檢討",startResearch:"檢討開始",endResearch:"結束檢討",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"中斷解析",setupPosition:"編輯局面",startPositionSetup:"開始編輯局面",completePositionSetup:"結束編輯局面",changeTurn:"變更手番",initializePosition:"初始化局面",changePieceSet:"駒の増減",appSettings:"程式設定",language:"語言",theme:"主題",standard:"標準",green:"綠色",cherryBlossom:"櫻花",customImage:"自定義圖片",autumn:"紅葉",snow:"雪",darkGreen:"深綠",dark:"深色主題",piece:"棋駒",singleKanjiPiece:"一文字駒",singleKanjiGothicPiece:"一文字駒(黑體)",singleKanjiDarkPiece:"一文字駒(深色)",singleKanjiGothicDarkPiece:"一文字駒(黑體・深色)",imageHasMarginsRemoveToDisplayLarger:"圖片含有透明邊界(去除後圖片會略為放大)",backgroundImage:"背景圖片",board:"棋盤",pieceStand:"駒台",lightWoodyTexture:"木目(亮色)",warmWoodTexture:"木目(暖色)",resin:"樹脂",transparent:"透明",boardOpacity:"盤面不透明度",pieceStandOpacity:"駒台不透明度",recordOpacity:"棋譜不透明度",displayFileAndRank:"顯示段・筋",displayLeftControls:"顯示左側操作按鈕",displayRightControls:"顯示右側操作按鈕",tabViewStyle:"分頁顯示形式",oneColumn:"1列",twoColumns:"2列",sounds:"音效",pieceLoudness:"棋駒音效",clockLoudness:"棋鐘音效大小",clockPitch:"棋鐘音效頻率",clockSoundTarget:"棋鐘音效對象",anyTurn:"所有手番",onlyHumanTurn:"只有玩家手番",defaultRecordFileFormat:"預設保存格式",textEncoding:"文字編碼",strict:"檔案原始編碼",autoDetect:"自動判定",newlineCharacter:"換行符號",old90sMac:"90年代Mac",autoSaving:"自動保存",autoSavingDirectory:"棋譜自動保存地點",recordFileName:"棋譜檔案名稱",select:"選擇",positionOfUSIOutput:"USI 局面紀錄格式",movesOfUSIOutput:"USI 棋譜紀錄格式",onlySFEN:"只有 SFEN",usiProtocol:"USI協定",translateOptionName:"選項名稱翻譯",functionalOnJapaneseOnly:"只有在日文選擇時有效",maxStartupTime:"最大起動等待時間",forDevelopers:"開發者用",enableAppLog:"輸出程式紀錄",enableUSILog:"輸出USI通訊紀錄",enableCSALog:"輸出CSA通訊紀錄",logLevel:"紀錄等級",engineSettings:"引擎設定",flipBoard:"盤面反轉",file:"檔案",recordFile:"棋譜檔案",executableFile:"可執行檔案",imageFile:"圖片檔案",unsaved:"未保存",remove:"刪除",deleteMove:"刪除該手",recordProperties:"棋譜情報",comments:"備註",commentsAndBookmarks:"備註・書籤",branches:"分支",bookmark:"書籤",bookmarkList:"書籤一覽",useBookmarkAsHeader:"將書籤名稱作為標題",moveComments:"棋步備註",searchLog:"思考",pv:"預測手順",mateShort:"詰",displayPVShort:"再現",evaluation:"評價值",eval:"評價値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRate:"評價値・期待勝率",swapEachTurnChange:"手番側有利時為正值",alwaysSenteIsPositive:"先手有利時為正值",signOfEvaluation:"評價值符號",winRateCoefficient:"勝率換算係數",monitor:"監視",hideTabView:"最小化",expandTabView:"展開分頁",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",swapSenteGote:"先後交換",currentPosition:"現在局面",enableEngineTimeout:"開啟引擎時間限制",setDifferentTimeForGote:"先後手時間不相同",nextTurn:"手番",elapsedTime:"消費時間",elapsed:"經過時間",rank:"順位",depth:"深度",searchEngine:"引擎",ponder:"對方手番時運算(Ponder)",numberOfThreads:"執行緒數",multiPV:"多重PV",startPosition:"開始局面",maxMoves:"最大手數",gameRepetition:"連續對局",jishogi:"持將棋",rule24:"24點法",rule27:"27點法",tryRule:"Try Rule",autoRelogin:"自動重新登入",restartItEveryGame:"每局重新啟動",swapTurnWhenGameRepetition:"每局交換手番",outputComments:"輸出備註",saveRecordAutomatically:"自動保存棋譜",adjustBoardToHumanPlayer:"調整到玩家所在方向",adjustBoardAutomatically:"自動調整盤面方向",command:"指令",startGame:"對局開始",cancelGame:"取消對局",allottedTime:"持時間",byoyomi:"讀秒",increments:"增秒",startEndCriteria:"開始・結束條件",endCriteria1Move:"局面結束條件",outputSettings:"輸出設定",noOutputs:"不輸出",insertCommentToTop:"加入到前方",appendCommentToBottom:"在後方新增",insertToComment:"加入到備註欄",insertToRecord:"加入到棋譜",overwrite:"覆寫原檔案",fromPrefix:"從",fromSuffix:"",toPrefix:"到",toSuffix:"",plyPrefix:"第",plySuffix:"手",hoursSuffix:"小時",minutesSuffix:"分",secondsSuffix:"秒",engineManagement:"引擎管理",engineName:"引擎名稱",author:"作者",earlyPonder:"早期Ponder",enginePath:"場所",openDirectory:"開啟資料夾",displayName:"表示名稱",invoke:"執行",resetToEngineDefaultValues:"回復至引擎預設設定",defaultValue:"預設値",noEngineRegistered:"尚未登錄引擎。",duplicate:"複製",add:"追加",recommended:"推薦",import:"匯入",saveAndClose:"保存並關閉",save:"保存",saveAs:"另存為",history:"歷史紀錄",clearHistory:"清除歷史紀錄",userFile:"使用者檔案",automaticBackup:"自動備份",restore:"復原",loadRecordFromWeb:"從網上取得棋譜",fetchLatestData:"最新データを取得",sourceURL:"ソースURL",ok:"OK",cancel:"取消",back:"返回",name:"名稱",prediction:"預測",best:"最善",nodes:"Node數",hashUsage:"Hash使用率",stop:"停止",resume:"重新開始",nonHandicap:"平手",lanceHandicap:"香落",rightLanceHandicap:"右香落",bishopHandicap:"角落",rookHandicap:"飛車落",rookLanceHandicap:"飛車香落",twoPiecesHandicap:"二枚落",fourPiecesHandicap:"四枚落",sixPiecesHandicap:"六枚落",eightPiecesHandicap:"八枚落",tenPiecesHandicap:"十枚落",tsumeShogi:"詰將棋",doubleKingTsumeShogi:"雙玉詰將棋",startDateTime:"開始日時",endDateTime:"結束日時",gameDate:"對局日",tournament:"棋戰",strategy:"戰型",gameTitle:"標題",timeLimit:"限時",blackTimeLimit:"先手限時",whiteTimeLimit:"後手限時",place:"地點",postedOn:"登錄於",note:"備註",senteShortName:"先手省略名",goteShortName:"後手省略名",opusNo:"作品編號",opusName:"作品名",publishedBy:"發表於",publishedOn:"發表年月",source:"來源",numberOfMoves:"手數",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"搜尋設定名稱",filterByEngineName:"搜尋引擎名稱",bookStyle:"書籍風",gameStyle:"對局畫面風",thin:"細",bold:"粗",extraBold:"特粗",playerName:"對局者名稱",typeface:"字體",weight:"字體粗細",handLabel:"持駒標題",header:"標題",vertical:"垂直調整",size:"大小",none:"無",bgCover:"圖片置中",bgContain:"擴大表示",bgTile:"磁磚狀表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"惡手",blunder:"大惡手",inaccuracyThreshold:"緩手閾値",dubiousThreshold:"疑問手閾値",mistakeThreshold:"惡手閾値",blunderThreshold:"大惡手閾値",gothic:"黑體",mincho:"明體",appVersion:"軟體版本",installed:"已安裝",stable:"安定版",latest:"最新版",updatedAt:"更新時間",createdAt:"建立時間",lastSent:"最後送出",lastReceived:"最後接收",protocolVersion:"協定版本",prompt:"指令",openPrompt:"打開指令視窗",forceQuit:"強制退出",forceClose:"強制關閉",blankLine:"空行",autoScroll:"自動捲動",showTimestamp:"顯示時間戳章",highlightByPartialMatch:"反白部分一致部分",csaServer:"CSA伺服器",usiEngine:"USI引擎",noRunningUSIEngine:"目前沒有啟動中的USI引擎。",noConnectedCSAServer:"尚未連接CSA伺服器。",willBeRemovedFromTheListSoon:"由於 Session 結束,將會自一覽清除。",typeCommandHereAndPressEnter:"輸入指令後按下 Enter 以發送",allowBlankLine:"允許空行",removeSpaceFromBothEnds:"消除前後空白",collapseSequentialSpaces:"整理連續空白",typeCustomTitleHere:"輸入自定義標題",displayEmptyElements:"顯示未定義資料",waitingForNewGame:"正在等待下一場對局開始。",waitingForPlayerSetup:"正在等待對局者準備。",insertedComment:"已加入備註。",conversionCompleted:"轉換完成。",tryingToConnectAndLoginToCSAServer:"正在連接並登入CSA伺服器。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※在瀏覽器版本中紀錄會於 console 中顯示,並無視此處的設定。",shouldRestartToApplyLogSettings:"※您需要重新啟動本程式以使用變更後的紀錄設定。",canOpenLogDirectoryFromMenu:"※紀錄的輸出檔案可以在「偵錯」-「開啟紀錄檔案資料夾」開啟。",hasNoOldLogCleanUpFeature:"※現在並沒有舊紀錄的自動刪除機制。",processingPleaseWait:"現在處理中。請稍待一會。",importingFollowingRecordOrPosition:"將匯入以下棋譜(局面)。",supportsKIF_KI2_CSA_USI_SFEN_JKF:"※支援KIF/KI2/CSA/USI/SFEN/JKF形式。",pleasePasteRecordIntoTextArea:"※請在文字輸入區域貼上您的棋譜。",pleaseSpecifyPlainTextURL:"※プレーンテキストのURLを指定してください。",redirectNotSupported:"※リダイレクトはサポートされていません。",desktopVersionPastesAutomatically:"※安裝程式版將會自動貼上棋譜。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期Ponder機能は、やねうら王の独自オプションでponderhitコマンドを送信します。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"エンジンがこのオプションに対応していない場合、予期しない動作を引き起こす可能性があります。",someLogsDisabled:"部份 log 已被無效化。",logsRecommendedForCSAProtocol:"若使用CSA協定對局,建議輸出各項紀錄。",pleaseEnableLogsAndRestart:"請在程式設定中開啟紀錄並重新啟動本程式。",notSendPVOnStandardCSAProtocol:"在標準的CSA協定中不會送出評價值以及思考棋步。",csaProtocolSendPlaintextPassword:"在CSA協定中,密碼為明文傳輸。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"由於無法使用系統的加密機能,輸入的密碼將會以明文保存。",pleaseUncheckSaveHistoryIfNotWantSave:"若不想保存密碼,請不要將「保存紀錄」勾選。",csaProtocolSendPlaintextPasswordRegardlessOfHistory:"不過,CSA協定仍會以明文傳輸您的密碼。",whenNewVersionIsAvailableItWillBeNotified:"將會在新版本發布時進行通知。",pleaseCheckMessageThisIsTestNotificationByAboveButton:"上方按鈕會發送「這是測試用的通知。」的通知訊息。",ifNotWorkYouShouldAllowNotificationOnOSSetting:"若無法顯示,請在使用的作業系統中許可本程式的通知。",areYouSureWantToResign:"確定要投了嗎?",areYouSureWantToDoDeclaration:"確定要進行勝利宣言嗎?",areYouSureWantToQuitGames:"要中斷連續對局嗎?",areYouSureWantToRequestQuit:"若提出中斷要求,可能會被判負。請問您要繼續嗎?",areYouSureWantToClearRecord:"將會刪除現在的棋譜。請問您要繼續嗎?",areYouSureWantToDiscardPosition:"將不會保存現在的局面。請問您要繼續嗎?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"會將現在的棋譜關閉並開啟別的檔案,請問您要繼續嗎?",areYouSureWantToClearHistory:"將清除紀錄。請問您要繼續嗎?",yamlFormatSettingCopiedToClipboard:"YAML形式の設定をクリップボードにコピーしました。",jsonFormatSettingCopiedToClipboard:"JSON形式の設定をクリップボードにコピーしました。",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge コマンドをクリップボードにコピーしました。",youCanNotCloseAppWhileCSAOnlineGame:"由於CSA協定正在使用中,本程式無法被關閉。",fileExtensionNotSupported:"無法支援的副檔名。",errorOccuredWhileDisconnectingFromCSAServer:"在與CSA伺服器中斷連線時發生錯誤。",failedToConnectToCSAServer:"無法連接CSA伺服器。",errorOccuredWhileLogoutFromCSAServer:"在登出 CSA 伺服器時發生錯誤。",disconnectedFromCSAServer:"與CSA伺服器的連接結束。",csaServerLoginDenied:"您對CSA伺服器的登入被拒絕。",thisFeatureNotAvailableOnWebApp:"Web版無法使用本機能",failedToStartNewGame:"對局開始失敗。",errorOccuredWhileEndingGame:"在對局結束時發生錯誤。",failedToSendGoCommand:"無法送出go指令。",failedToSendPonderCommand:"無法送出ponder指令。",failedToSendStopCommand:"無法送出stop指令。",failedToShutdownEngines:"引擎無法正常結束。",failedToCheckUpdates:"無法確認更新。",failedToSaveRecord:"棋譜保存失敗。",failedToParseSFEN:"SFEN讀取失敗。",failedToDetectRecordFormat:"無法判別棋譜形式。",unknown:"不明",unknownFileExtension:"未知的檔案形式。",emptyRecordInput:"您尚未輸入棋譜。",invalidPieceName:"不合法的棋駒",invalidTurn:"不合法的手番",invalidMove:"不合法的棋步",invalidMoveNumber:"不合法的手數",invalidDestination:"不合法的移動目的地",pieceNotExists:"不存在的棋駒",invalidLine:"不存在的行",invalidBoard:"不合法的盤面",invalidHandPiece:"不合法的持駒",invalidUSI:"不合法的USI",backgroundImageFileNotSelected:"尚未選取背景圖片。",pieceImageFileNotSelected:"尚未選取棋駒圖片。",boardImageFileNotSelected:"尚未選取盤面圖片。",pieceStandImageFileNotSelected:"尚未選取駒台圖片。",pieceVolumeMustBe0To100Percent:"請在0%~100%之間指定棋駒音效大小。",clockVolumeMustBe0To100Percent:"請在0%~100%之間指定棋鐘音效大小。",clockPitchMustBe220To880Hz:"請在220Hz~880Hz之間指定棋鐘音效頻率。",engineTimeoutMustBe1To300Seconds:"請在1秒~300秒之間指定引擎執行最長時間。",coefficientInSigmoidMustBeGreaterThan0:"請將勝率換算係數填為大於0之值。",inaccuracyThresholdMustBe1To100Percent:"請在0%~100%之間指定緩手門檻。",dubiousThresholdMustBe1To100Percent:"請在0%~100%之間指定疑問手門檻。",mistakeThresholdMustBe1To100Percent:"請在0%~100%之間指定惡手門檻。",blunderThresholdMustBe1To100Percent:"請在0%~100%之間指定大惡手門檻。",recordSavedWithGarbledCharacters:"保存的棋譜有部分可能會造成亂碼。",pleaseConsiderToUseKIFU:"建議您使用KIFU形式(UTF-8)儲存您的棋譜。",youCanChangeDefaultRecordFileFormatFromAppSettings:"預設棋譜檔案格式可以在程式設定中進行更動。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手門檻應小於疑問手門檻。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手門檻應小於惡手門檻。",mistakeThresholdMustBeLessThanBlunderThreshold:"惡手門檻應小於大惡手門檻。",thisEngineNotSupportsMateSearch:"這個引擎不支援詰將棋搜索。",pleaseEndActiveFeaturesBeforeOpenRecord:"請關閉現正運行的功能再開啟棋譜。",bothTimeLimitAndByoyomiAreNotSet:"持時間與讀秒尚未設置。",canNotUseByoyomiWithFischer:"讀秒與 Fischer 選項無法同時併用。",repeatsMustBeOneIfHumanPlayerIncluded:"人が対局する場合、連続対局の回数は1以外を設定できません。",protocolVersionNotSelected:"請選擇協定版本。",hostNameIsEmpty:"主機名稱為空。",invalidPortNumber:"不可用的連接埠號碼。",idIsEmpty:"ID 為空。",idContainsSpace:"ID 含有空白字符。",passwordContainsSpace:"密碼含有空白字符。",tcpKeepaliveInitialDelayMustBePositive:"請輸入正確的TCP Keepalive初始延遲時間。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出初始延遲時間。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出間隔時間。",engineNotSelected:"尚未選擇引擎。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"如要監看轉換紀錄,請在程式設定內設定 log level 到 Debug 並重新啟動本程式。",sourceDirectoryNotSpecified:"輸入目錄尚未被指定。",sourceFormatsNotSpecified:"輸入格式尚未被指定。",destinationDirectoryNotSpecified:"輸出格式尚未被指定。",destinationFileNotSpecified:"輸出檔案尚未被指定。",totalNumber:e=>`總計 ${e} 筆`,number:e=>`${e} 筆`,tryToReloginToCSAServerNSecondsLater:e=>`請在${e}秒後再次嘗試登入 CSA 伺服器。`,mateInNPlyDoYouWantToDisplay:e=>`尋找到${e}手詰。要顯示結果嗎?`,insertedNMovesToRecord:e=>`已加入${e}手到棋譜。`,errorsOccurred:e=>`發生 ${e} 種類的錯誤。`,between:(e,t)=>`自 ${e} 到 ${t} `,addNthEngine:e=>`追加第 ${e} 個引擎`,copyOf:e=>`${e} 的拷貝`,keepLatest:e=>`到最新${e}件`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下的資料由於 ${e} 格式無法支援的原因無法保存。`,areYouSureWantToDeleteFollowingMove:e=>`將會刪除${e}手目以後的棋譜。請問您要繼續嗎?`,failedToOpenDirectory:e=>`無法開啟檔案目錄:${e}`,unexpectedEventSenderPleaseReport:e=>`無法預期的事件發送方已發生。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`無法預期的 HTTP 方法。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`無法從 URL 獲取資訊。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`引擎在${e}秒内沒有回應。若引擎的啟動時間稍長,請在設定中調整引擎最長等待時間。`,stableVersionReleased:e=>`安定版 ${e} 已經發布!`,latestVersionReleased:e=>`最新版 ${e} 已經發布!`}},7445:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRecordMetadataName=void 0;const n=o(2851),i=o(1874);t.getRecordMetadataName=function(e){switch(e){case n.RecordMetadataKey.BLACK_NAME:return i.t.sente;case n.RecordMetadataKey.WHITE_NAME:return i.t.gote;case n.RecordMetadataKey.SHITATE_NAME:return i.t.shitate;case n.RecordMetadataKey.UWATE_NAME:return i.t.uwate;case n.RecordMetadataKey.START_DATETIME:return i.t.startDateTime;case n.RecordMetadataKey.END_DATETIME:return i.t.endDateTime;case n.RecordMetadataKey.DATE:return i.t.gameDate;case n.RecordMetadataKey.TOURNAMENT:return i.t.tournament;case n.RecordMetadataKey.STRATEGY:return i.t.strategy;case n.RecordMetadataKey.TITLE:return i.t.gameTitle;case n.RecordMetadataKey.TIME_LIMIT:return i.t.timeLimit;case n.RecordMetadataKey.BLACK_TIME_LIMIT:return i.t.blackTimeLimit;case n.RecordMetadataKey.WHITE_TIME_LIMIT:return i.t.whiteTimeLimit;case n.RecordMetadataKey.BYOYOMI:return i.t.byoyomi;case n.RecordMetadataKey.TIME_SPENT:return i.t.elapsedTime;case n.RecordMetadataKey.MAX_MOVES:return i.t.maxMoves;case n.RecordMetadataKey.JISHOGI:return i.t.jishogi;case n.RecordMetadataKey.PLACE:return i.t.place;case n.RecordMetadataKey.POSTED_ON:return i.t.postedOn;case n.RecordMetadataKey.NOTE:return i.t.note;case n.RecordMetadataKey.BLACK_SHORT_NAME:return i.t.senteShortName;case n.RecordMetadataKey.WHITE_SHORT_NAME:return i.t.goteShortName;case n.RecordMetadataKey.OPUS_NO:return i.t.opusNo;case n.RecordMetadataKey.OPUS_NAME:return i.t.opusName;case n.RecordMetadataKey.AUTHOR:return i.t.author;case n.RecordMetadataKey.PUBLISHED_BY:return i.t.publishedBy;case n.RecordMetadataKey.PUBLISHED_AT:return i.t.publishedOn;case n.RecordMetadataKey.SOURCE:return i.t.source;case n.RecordMetadataKey.LENGTH:return i.t.numberOfMoves;case n.RecordMetadataKey.INTEGRITY:return i.t.integrity;case n.RecordMetadataKey.CATEGORY:return i.t.recordCategory;case n.RecordMetadataKey.AWARD:return i.t.award}}},1874:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setLanguage=t.t=void 0;const n=o(9365),i=o(855),a=o(9445),r=o(8584);t.t=a.ja,t.setLanguage=function(e){Object.entries(function(e){switch(e){case n.Language.JA:return a.ja;case n.Language.EN:return i.en;case n.Language.ZH_TW:return r.zh_tw;default:return a.ja}}(e)).forEach((([e,o])=>{t.t[e]=o}))}},9233:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setLanguage=t.usiOptionNameMap=void 0;const n=o(9365),i={USI_Ponder:"相手番思考",Ponder:"相手番思考",USI_Hash:"ハッシュ",Hash:"ハッシュ",Clear_Hash:"ハッシュクリア",Threads:"スレッド",NumberOfThreads:"スレッド数",thread_num_per_gpu:"GPUあたりのスレッド数",ThreadIdOffset:"スレッドIDオフセット",MultiPV:"マルチPV",BookFile:"定跡ファイル",Book_File:"定跡ファイル",Book_Enable:"定跡あり",BookEvalDiff:"定跡の評価値差",book_file_name:"定跡ファイル名",use_book:"定跡を使用",BookPvMoves:"定跡PV手数",TinyBook:"小さい定跡",BookMoves:"定跡利用手数",BookMaxPly:"定跡最大手数",BookIgnoreRate:"定跡不使用率",RandomBookSelect:"ランダム定跡選択",IgnoreBookPly:"定跡の手数を無視",DepthLimit:"最大深さ",NarrowBook:"定跡手を限定",WriteDebugLog:"デバッグログ出力",Write_Debug_Log:"デバッグログ出力",ResignValue:"投了基準値",ResignScore:"投了基準値",PvInterval:"PV出力間隔",NodesLimit:"最大ノード数",USI_OwnBook:"定跡を使用",OwnBook:"定跡を使用",EvalDir:"評価関数のフォルダ",Eval_Dir:"評価関数のフォルダ",EvalFile:"評価関数ファイル",EvalHash:"評価値ハッシュ",Eval_Hash:"評価値ハッシュ",EvalSaveDir:"評価関数保存フォルダ",EvalShare:"評価値共有",BookDir:"定跡ファイルのフォルダ",Stochastic_Ponder:"相手番思考(確率的)",MinimumThinkingTime:"最小思考時間",Minimum_Thinking_Time:"最小思考時間",MinThinkingTime:"最小思考時間",MaxMovesToDraw:"強制引き分け手数",SlowMover:"長考",Slow_Mover:"長考",OutputFailLHPV:"Fail Low/Highを出力",NetworkDelay:"通信遅延",NetworkDelay2:"通信遅延2",FV_SCALE:"評価値スケール",UseBook:"定跡を使用",MaxDepth:"最大深さ",MarginMs:"マージン(ミリ秒)",Time_Margin:"時間マージン",ByoyomiMargin:"秒読みマージン",Byoyomi_Margin:"秒読みマージン",byoyomi_margin:"秒読みマージン",Move_Overhead:"着手オーバーヘッド",FischerMargin:"フィッシャーマージン",SuddenDeathMargin:"切れ負けマージン",Snappy:"素早く指す",EnteringKingRule:"入玉ルール",Do_YoTsume_Search:"余詰めを探索",gpu_num:"GPU数",ConsiderationMode:"検討モード",ConsiderBookMoveCount:"定跡出現率を使用",GenerateAllLegalMoves:"全合法手を生成",DrawScore:"引き分けのスコア",DrawValue:"引き分けの値",DrawValueBlack:"引き分けの値(先手)",DrawValueWhite:"引き分けの値(後手)",LargePageEnable:"LargePageを使用",SkillLevel:"スキルレベル",Skill_Level:"スキルレベル"};t.usiOptionNameMap={},t.setLanguage=function(e){Object.keys(t.usiOptionNameMap).forEach((e=>{delete t.usiOptionNameMap[e]})),Object.entries(function(e){switch(e){case n.Language.JA:return i;case n.Language.EN:default:return{}}}(e)).forEach((([e,o])=>{t.usiOptionNameMap[e]=o}))}},1219:(e,t)=>{var o,n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=t.LogType=void 0,function(e){e.APP="app",e.USI="usi",e.CSA="csa"}(o||(t.LogType=o={})),function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(n||(t.LogLevel=n={}))},9273:(e,t)=>{var o;function n(){return{startCriteria:{enableNumber:!1,number:20},endCriteria:{enableNumber:!1,number:100},perMoveCriteria:{maxSeconds:5},commentBehavior:o.INSERT}}Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAnalysisSetting=t.defaultAnalysisSetting=t.CommentBehavior=void 0,function(e){e.NONE="none",e.INSERT="insert",e.APPEND="append",e.OVERWRITE="overwrite"}(o||(t.CommentBehavior=o={})),t.defaultAnalysisSetting=n,t.normalizeAnalysisSetting=function(e){return{...n(),...e,startCriteria:{enableNumber:!1,number:20,...e.startCriteria},endCriteria:{enableNumber:!1,number:100,...e.endCriteria},perMoveCriteria:{maxSeconds:5,...e.perMoveCriteria}}}},7748:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getPieceImageURLTemplate=t.validateAppSetting=t.normalizeAppSetting=t.defaultAppSetting=t.buildUpdatedAppSetting=t.isLogEnabled=t.PositionImageFontWeight=t.PositionImageHandLabelType=t.PositionImageTypeface=t.PositionImageStyle=t.ClockSoundTarget=t.EvaluationViewFrom=t.TextDecodingRule=t.Tab=t.TabPaneType=t.RightSideControlType=t.LeftSideControlType=t.BoardLabelType=t.PieceStandImageType=t.BoardImageType=t.KingPieceType=t.PieceImageType=t.BackgroundImageType=t.Thema=void 0;const n=o(8474),i=o(1219),a=o(6059),r=o(8574);var s,l,c,d,u,m,h,p,g,S,y,f,v,b,I,T,E,C;function A(e){return{language:n.Language.JA,thema:s.STANDARD,backgroundImageType:l.NONE,pieceImage:c.HITOMOJI,kingPieceType:d.GYOKU_AND_OSHO,deletePieceImageMargin:!1,boardImage:u.RESIN2,pieceStandImage:m.STANDARD,enableTransparent:!1,boardOpacity:1,pieceStandOpacity:1,recordOpacity:1,boardLabelType:h.STANDARD,leftSideControlType:p.STANDARD,rightSideControlType:g.STANDARD,pieceVolume:30,clockVolume:30,clockPitch:500,clockSoundTarget:b.ONLY_USER,boardFlipping:!1,tabPaneType:S.DOUBLE,tab:y.RECORD_INFO,tab2:y.COMMENT,topPaneHeightPercentage:60,topPanePreviousHeightPercentage:60,bottomLeftPaneWidthPercentage:60,defaultRecordFileFormat:a.RecordFileFormat.KIF,textDecodingRule:f.AUTO_DETECT,returnCode:e?.returnCode||"\r\n",autoSaveDirectory:e?.autoSaveDirectory||"",recordFileNameTemplate:r.defaultRecordFileNameTemplate,useCSAV3:!1,enableUSIFileStartpos:!0,enableUSIFileResign:!1,translateEngineOptionName:!0,engineTimeoutSeconds:10,evaluationViewFrom:v.EACH,coefficientInSigmoid:600,badMoveLevelThreshold1:5,badMoveLevelThreshold2:10,badMoveLevelThreshold3:20,badMoveLevelThreshold4:50,showElapsedTimeInRecordView:!0,showCommentInRecordView:!0,enableAppLog:!1,enableUSILog:!1,enableCSALog:!1,logLevel:i.LogLevel.INFO,positionImageStyle:I.BOOK,positionImageSize:500,positionImageTypeface:T.GOTHIC,positionImageHandLabelType:E.PLAYER_NAME,useBookmarkAsPositionImageHeader:!1,positionImageHeader:"",positionImageCharacterY:0,positionImageFontScale:1,positionImageFontWeight:C.W400X,lastRecordFilePath:"",lastUSIEngineFilePath:"",lastImageExportFilePath:"",lastOtherFilePath:"",emptyRecordInfoVisibility:!0}}function M(e){return e.backgroundImageType===l.NONE||e.backgroundImageFileURL?e.pieceImage!==c.CUSTOM_IMAGE||e.pieceImageFileURL&&e.croppedPieceImageBaseURL?e.boardImage!==u.CUSTOM_IMAGE||e.boardImageFileURL?e.pieceStandImage!==m.CUSTOM_IMAGE||e.pieceStandImageFileURL?e.pieceVolume<0||e.pieceVolume>100?new Error(n.t.pieceVolumeMustBe0To100Percent):e.clockVolume<0||e.clockVolume>100?new Error(n.t.clockVolumeMustBe0To100Percent):e.clockPitch<220||e.clockPitch>880?new Error(n.t.clockPitchMustBe220To880Hz):e.engineTimeoutSeconds<1||e.engineTimeoutSeconds>300?new Error(n.t.engineTimeoutMustBe1To300Seconds):e.coefficientInSigmoid<=0?new Error(n.t.coefficientInSigmoidMustBeGreaterThan0):e.badMoveLevelThreshold1<1||e.badMoveLevelThreshold1>100?new Error(n.t.inaccuracyThresholdMustBe1To100Percent):e.badMoveLevelThreshold2<1||e.badMoveLevelThreshold2>100?new Error(n.t.dubiousThresholdMustBe1To100Percent):e.badMoveLevelThreshold3<1||e.badMoveLevelThreshold3>100?new Error(n.t.mistakeThresholdMustBe1To100Percent):e.badMoveLevelThreshold4<1||e.badMoveLevelThreshold4>100?new Error(n.t.blunderThresholdMustBe1To100Percent):e.badMoveLevelThreshold1>=e.badMoveLevelThreshold2?new Error(n.t.inaccuracyThresholdMustBeLessThanDubiousThreshold):e.badMoveLevelThreshold2>=e.badMoveLevelThreshold3?new Error(n.t.dubiousThresholdMustBeLessThanMistakeThreshold):e.badMoveLevelThreshold3>=e.badMoveLevelThreshold4?new Error(n.t.mistakeThresholdMustBeLessThanBlunderThreshold):void 0:new Error(n.t.pieceStandImageFileNotSelected):new Error(n.t.boardImageFileNotSelected):new Error(n.t.pieceImageFileNotSelected):new Error(n.t.backgroundImageFileNotSelected)}!function(e){e.STANDARD="standard",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark"}(s||(t.Thema=s={})),function(e){e.NONE="none",e.COVER="cover",e.CONTAIN="contain",e.TILE="tile"}(l||(t.BackgroundImageType=l={})),function(e){e.HITOMOJI="hitomoji",e.HITOMOJI_DARK="hitomojiDark",e.HITOMOJI_GOTHIC="hitomojiGothic",e.HITOMOJI_GOTHIC_DARK="hitomojiGothicDark",e.CUSTOM_IMAGE="custom-image"}(c||(t.PieceImageType=c={})),function(e){e.GYOKU_AND_OSHO="gyokuAndOsho",e.GYOKU_AND_GYOKU="gyokuAndGyoku"}(d||(t.KingPieceType=d={})),function(e){e.LIGHT="light",e.WARM="warm",e.RESIN="resin",e.RESIN2="resin2",e.RESIN3="resin3",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(u||(t.BoardImageType=u={})),function(e){e.STANDARD="standard",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(m||(t.PieceStandImageType=m={})),function(e){e.NONE="none",e.STANDARD="standard"}(h||(t.BoardLabelType=h={})),function(e){e.NONE="none",e.STANDARD="standard"}(p||(t.LeftSideControlType=p={})),function(e){e.NONE="none",e.STANDARD="standard"}(g||(t.RightSideControlType=g={})),function(e){e.SINGLE="single",e.DOUBLE="double"}(S||(t.TabPaneType=S={})),function(e){e.RECORD_INFO="recordInfo",e.COMMENT="comment",e.SEARCH="search",e.PV="pv",e.CHART="chart",e.PERCENTAGE_CHART="percentageChart",e.MONITOR="monitor",e.INVISIBLE="invisible"}(y||(t.Tab=y={})),function(e){e.STRICT="strict",e.AUTO_DETECT="autoDetect"}(f||(t.TextDecodingRule=f={})),function(e){e.BLACK="black",e.EACH="each"}(v||(t.EvaluationViewFrom=v={})),function(e){e.ALL="all",e.ONLY_USER="onlyUser"}(b||(t.ClockSoundTarget=b={})),function(e){e.BOOK="book",e.GAME="game"}(I||(t.PositionImageStyle=I={})),function(e){e.GOTHIC="gothic",e.MINCHO="mincho"}(T||(t.PositionImageTypeface=T={})),function(e){e.PLAYER_NAME="playerName",e.SENTE_GOTE="senteGote",e.MOCHIGOMA="mochigoma",e.TSUME_SHOGI="tsumeShogi",e.NONE="none"}(E||(t.PositionImageHandLabelType=E={})),function(e){e.W400="400",e.W400X="400+",e.W700X="700+"}(C||(t.PositionImageFontWeight=C={})),t.isLogEnabled=function(e,t){switch(e){case i.LogType.APP:return t.enableAppLog;case i.LogType.USI:return t.enableUSILog;case i.LogType.CSA:return t.enableCSALog}},t.buildUpdatedAppSetting=function(e,t){const o={...e,...t};if(o.tabPaneType===S.DOUBLE)switch(o.tab){case y.COMMENT:o.tab=y.RECORD_INFO;break;case y.CHART:case y.PERCENTAGE_CHART:o.tab=y.PV}return 0!==e.topPaneHeightPercentage&&100!==e.topPaneHeightPercentage&&(o.topPanePreviousHeightPercentage=e.topPaneHeightPercentage),M(o)||o},t.defaultAppSetting=A,t.normalizeAppSetting=function(e,t){const o={...A(t),...e};if((o.autoSaveDirectory.endsWith("\\")||o.autoSaveDirectory.endsWith("/"))&&(o.autoSaveDirectory=o.autoSaveDirectory.slice(0,-1)),!e.pieceStandImage)switch(e.boardImage){default:o.pieceStandImage=m.STANDARD;break;case u.DARK:o.pieceStandImage=m.DARK;break;case u.GREEN:o.pieceStandImage=m.GREEN;break;case u.CHERRY_BLOSSOM:o.pieceStandImage=m.CHERRY_BLOSSOM}if(o.tab===y.INVISIBLE&&(o.tab=y.RECORD_INFO),!e.positionImageFontWeight)if(e.positionImageTypeface===T.MINCHO)o.positionImageFontWeight=C.W700X;else o.positionImageFontWeight=C.W400X;return o},t.validateAppSetting=M,t.getPieceImageURLTemplate=function(e){switch(e.pieceImage){case c.HITOMOJI_DARK:return"./piece/hitomoji_dark/${piece}.png";case c.HITOMOJI_GOTHIC:return"./piece/hitomoji_gothic/${piece}.png";case c.HITOMOJI_GOTHIC_DARK:return"./piece/hitomoji_gothic_dark/${piece}.png";case c.CUSTOM_IMAGE:if(e.croppedPieceImageBaseURL){const t=e.croppedPieceImageQuery?`?${e.croppedPieceImageQuery}`:"";return e.croppedPieceImageBaseURL+"/${piece}.png"+t}}return"./piece/hitomoji/${piece}.png"}},2587:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateBatchConversionSetting=t.normalizeBatchConversionSetting=t.defaultBatchConversionSetting=t.FileNameConflictAction=t.DestinationType=void 0;const n=o(6059),i=o(8474);var a,r;function s(){return{source:"",sourceFormats:[n.RecordFileFormat.KIF,n.RecordFileFormat.KIFU,n.RecordFileFormat.KI2,n.RecordFileFormat.KI2U,n.RecordFileFormat.CSA,n.RecordFileFormat.JKF],subdirectories:!0,destinationType:a.DIRECTORY,destination:"",createSubdirectories:!0,destinationFormat:n.RecordFileFormat.KIF,fileNameConflictAction:r.NUMBER_SUFFIX,singleFileDestination:""}}!function(e){e.DIRECTORY="directory",e.SINGLE_FILE="singleFile"}(a||(t.DestinationType=a={})),function(e){e.OVERWRITE="overwrite",e.NUMBER_SUFFIX="numberSuffix",e.SKIP="skip"}(r||(t.FileNameConflictAction=r={})),t.defaultBatchConversionSetting=s,t.normalizeBatchConversionSetting=function(e){return{...s(),...e}},t.validateBatchConversionSetting=function(e){if(!e.source)return new Error(i.t.sourceDirectoryNotSpecified);if(0===e.sourceFormats.length)return new Error(i.t.sourceFormatsNotSpecified);switch(e.destinationType){case a.DIRECTORY:if(!e.destination)return new Error(i.t.destinationDirectoryNotSpecified);break;case a.SINGLE_FILE:if(!e.singleFileDestination)return new Error(i.t.destinationFileNotSpecified);break;default:return new Error("Invalid destination type.")}}},3010:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.decompressCSAGameSettingForCLI=t.compressCSAGameSettingForCLI=t.importCSAGameSettingForCLI=t.exportCSAGameSettingForCLI=t.decryptCSAGameSettingHistory=t.encryptCSAGameSettingHistory=t.normalizeSecureCSAGameSettingHistory=t.defaultSecureCSAGameSettingHistory=t.emptySecureCSAServerSetting=t.appendCSAGameSettingHistory=t.maxServerHistoryLength=t.buildCSAGameSettingByHistory=t.defaultCSAGameSettingHistory=t.validateCSAGameSetting=t.validateCSAServerSetting=t.defaultCSAGameSetting=t.defaultCSAServerSetting=t.CSAProtocolVersion=void 0;const r=a(o(7367)),s=o(4890),l=o(8474),c=o(2040),d=o(6953);var u;function m(){return{protocolVersion:u.V121_FLOODGATE,host:"localhost",port:4081,id:"",password:"",tcpKeepalive:{initialDelay:10}}}function h(e){if(e.protocolVersion!==u.V121&&e.protocolVersion!==u.V121_FLOODGATE&&e.protocolVersion!==u.V121_X1)return new Error(l.t.protocolVersionNotSelected);if(""===e.host)return new Error(l.t.hostNameIsEmpty);if(e.port<0||e.port>65535)return new Error(l.t.invalidPortNumber);if(""===e.id)return new Error(l.t.idIsEmpty);if(e.id.indexOf(" ")>=0)return new Error(l.t.idContainsSpace);if(e.password.indexOf(" ")>=0)return new Error(l.t.passwordContainsSpace);if(e.tcpKeepalive.initialDelay<=0)return new Error(l.t.tcpKeepaliveInitialDelayMustBePositive);if(e.blankLinePing){if(e.blankLinePing.initialDelay<30)return new Error(l.t.blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30);if(e.blankLinePing.interval<30)return new Error(l.t.blankLinePingIntervalMustBeGreaterThanOrEqualTo30)}}function p(){return{protocolVersion:u.V121_FLOODGATE,host:"",port:0,id:"",tcpKeepalive:{initialDelay:10}}}function g(){return{player:{name:"人",uri:r.ES_HUMAN},serverHistory:[],autoFlip:!0,enableComment:!0,enableAutoSave:!0,repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}}!function(e){e.V121="v121",e.V121_FLOODGATE="v121_floodgate",e.V121_X1="v121_x1"}(u||(t.CSAProtocolVersion=u={})),t.defaultCSAServerSetting=m,t.defaultCSAGameSetting=function(){return{player:{name:"人",uri:r.ES_HUMAN},server:m(),autoFlip:!0,enableComment:!0,enableAutoSave:!0,repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}},t.validateCSAServerSetting=h,t.validateCSAGameSetting=function(e){const t=(0,s.validatePlayerSetting)(e.player);if(t)return t;const o=h(e.server);return o||(e.server.protocolVersion!==u.V121&&e.server.protocolVersion!==u.V121_FLOODGATE?new Error("protocolVersion must be v121 or v121_floodgate"):!Number.isInteger(e.repeat)||e.repeat<1?new Error("repeat must be a positive integer"):void 0)},t.defaultCSAGameSettingHistory=function(){return{player:{name:"人",uri:r.ES_HUMAN},serverHistory:[],autoFlip:!0,enableComment:!0,enableAutoSave:!0,repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}},t.buildCSAGameSettingByHistory=function(e,t){return{player:e.player,server:e.serverHistory?.length>t?e.serverHistory[t]:m(),autoFlip:e.autoFlip,enableComment:e.enableComment,enableAutoSave:e.enableAutoSave,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.maxServerHistoryLength=10,t.appendCSAGameSettingHistory=function(e,o){const n=[o.server];for(const i of e.serverHistory)if(i.protocolVersion===o.server.protocolVersion&&i.host===o.server.host&&i.port===o.server.port&&i.id===o.server.id&&i.password===o.server.password&&i.tcpKeepalive.initialDelay===o.server.tcpKeepalive.initialDelay&&!i.blankLinePing==!o.server.blankLinePing&&i.blankLinePing?.initialDelay===o.server.blankLinePing?.initialDelay&&i.blankLinePing?.interval===o.server.blankLinePing?.interval||n.push(i),n.length===t.maxServerHistoryLength)break;return{player:o.player,serverHistory:n,autoFlip:o.autoFlip,enableComment:o.enableComment,enableAutoSave:o.enableAutoSave,repeat:o.repeat,autoRelogin:o.autoRelogin,restartPlayerEveryGame:o.restartPlayerEveryGame}},t.emptySecureCSAServerSetting=p,t.defaultSecureCSAGameSettingHistory=g,t.normalizeSecureCSAGameSettingHistory=function(e){const t=[];for(const o of e.serverHistory)t.push({...p(),...o});return{...g(),...e,player:{...(0,s.defaultPlayerSetting)(),...e.player},serverHistory:t}},t.encryptCSAGameSettingHistory=function(e,t){const o=[];for(const n of e.serverHistory){const e={protocolVersion:n.protocolVersion,host:n.host,port:n.port,id:n.id,tcpKeepalive:n.tcpKeepalive};n.blankLinePing&&(e.blankLinePing=n.blankLinePing),t?e.encryptedPassword=t(n.password):e.password=n.password,o.push(e)}return{player:e.player,serverHistory:o,autoFlip:e.autoFlip,enableComment:e.enableComment,enableAutoSave:e.enableAutoSave,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.decryptCSAGameSettingHistory=function(e,t){const o=[];for(const n of e.serverHistory){const e={protocolVersion:n.protocolVersion,host:n.host,port:n.port,id:n.id,password:t&&n.encryptedPassword?t(n.encryptedPassword):n.password||"",tcpKeepalive:n.tcpKeepalive};n.blankLinePing&&(e.blankLinePing=n.blankLinePing),o.push(e)}return{player:e.player,serverHistory:o,autoFlip:e.autoFlip,enableComment:e.enableComment,enableAutoSave:e.enableAutoSave,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.exportCSAGameSettingForCLI=function(e,t){return r.isUSIEngine(e.player.uri)&&e.player.usi?{usi:(0,c.exportUSIEngineSettingForCLI)(e.player.usi),server:e.server,saveRecordFile:e.enableAutoSave,enableComment:e.enableComment,recordFileNameTemplate:t.recordFileNameTemplate,recordFileFormat:t.defaultRecordFileFormat,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}:new Error("player must be USI engine.")},t.importCSAGameSettingForCLI=function(e,t){const o=(0,c.importUSIEngineSettingForCLI)(e.usi,t);return{player:{name:e.usi.name,uri:o.uri,usi:o},server:e.server,autoFlip:!0,enableComment:e.enableComment,enableAutoSave:e.saveRecordFile,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.compressCSAGameSettingForCLI=async function(e){const t=JSON.stringify(e),o=new CompressionStream("gzip");new Blob([t]).stream().pipeThrough(o);const n=await new Response(o.readable).arrayBuffer();return(0,d.base64Encode)(new Uint8Array(n))},t.decompressCSAGameSettingForCLI=async function(e){const t=new Uint8Array((0,d.base64Decode)(e)),o=new DecompressionStream("gzip");return new Blob([t]).stream().pipeThrough(o),JSON.parse(await new Response(o.readable).text())}},9161:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.validateGameSettingForWeb=t.validateGameSetting=t.normalizeGameSetting=t.defaultGameSetting=t.DeclarableJishogiRules=t.JishogiRule=t.defaultTimeLimitSetting=void 0;const r=o(4890),s=o(8474),l=a(o(7367));function c(){return{timeSeconds:0,byoyomi:30,increment:0}}var d;function u(){return{black:(0,r.defaultPlayerSetting)(),white:(0,r.defaultPlayerSetting)(),timeLimit:{timeSeconds:0,byoyomi:30,increment:0},enableEngineTimeout:!1,humanIsFront:!0,enableComment:!0,enableAutoSave:!0,repeat:1,swapPlayers:!1,maxMoves:1e3,jishogiRule:d.GENERAL27}}function m(e){if(0===e.timeLimit.timeSeconds&&0===e.timeLimit.byoyomi)return new Error(s.t.bothTimeLimitAndByoyomiAreNotSet);if(0!==e.timeLimit.byoyomi&&0!==e.timeLimit.increment)return new Error(s.t.canNotUseByoyomiWithFischer);if(e.whiteTimeLimit&&0===e.whiteTimeLimit.timeSeconds&&0===e.whiteTimeLimit.byoyomi)return new Error(s.t.bothTimeLimitAndByoyomiAreNotSet);if(e.whiteTimeLimit&&0!==e.whiteTimeLimit.byoyomi&&0!==e.whiteTimeLimit.increment)return new Error(s.t.canNotUseByoyomiWithFischer);if(e.repeat<1)return new Error("The number of repeats must be positive.");return(e.black.uri===l.ES_HUMAN||e.white.uri===l.ES_HUMAN)&&e.repeat>1?new Error(s.t.repeatsMustBeOneIfHumanPlayerIncluded):void 0}t.defaultTimeLimitSetting=c,function(e){e.NONE="none",e.GENERAL24="general24",e.GENERAL27="general27",e.TRY="try"}(d||(t.JishogiRule=d={})),t.DeclarableJishogiRules=[d.GENERAL24,d.GENERAL27],t.defaultGameSetting=u,t.normalizeGameSetting=function(e){return{...u(),...e,black:{...(0,r.defaultPlayerSetting)(),...e.black},white:{...(0,r.defaultPlayerSetting)(),...e.white},timeLimit:{timeSeconds:0,byoyomi:30,increment:0,...e.timeLimit}}},t.validateGameSetting=m,t.validateGameSettingForWeb=function(e){const t=m(e);return t||(e.enableAutoSave?new Error("自動保存はWeb版で利用できません。"):void 0)}},9994:(e,t)=>{function o(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeMateSearchSetting=t.defaultMateSearchSetting=void 0,t.defaultMateSearchSetting=o,t.normalizeMateSearchSetting=function(e){return{...e}}},4890:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.validatePlayerSetting=t.defaultPlayerSetting=void 0;const r=o(2040),s=a(o(7367));t.defaultPlayerSetting=function(){return{name:"人",uri:s.ES_HUMAN}},t.validatePlayerSetting=function(e){if(!e.name)return new Error("player name is required");if(!e.uri)return new Error("player URI is required");if(s.isUSIEngine(e.uri)){if(!e.usi)return new Error("USI is required");const t=(0,r.validateUSIEngineSetting)(e.usi);if(t)return t}}},7914:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateResearchSetting=t.normalizeResearchSetting=t.defaultResearchSetting=void 0;const n=o(8474);function i(){return{enableMaxSeconds:!1,maxSeconds:10}}t.defaultResearchSetting=i,t.normalizeResearchSetting=function(e){return{enableMaxSeconds:!1,maxSeconds:10,...e,secondaries:e.secondaries?.filter((e=>!!e.usi))}},t.validateResearchSetting=function(e){return e.usi?e.secondaries?.some((e=>!e.usi))?new Error(n.t.engineNotSelected):void 0:new Error(n.t.engineNotSelected)}},2040:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.importUSIEngineSettingForCLI=t.exportUSIEngineSettingForCLI=t.USIEngineSettings=t.validateUSIEngineSetting=t.mergeUSIEngineSetting=t.duplicateEngineSetting=t.emptyUSIEngineSetting=t.USIEngineLabel=t.getUSIEngineOptionCurrentValue=t.MultiPV=t.NumberOfThreads=t.Threads=t.USIMultiPV=t.USIHash=t.USIPonder=void 0;const r=o(7367),s=a(o(7367)),l=o(8474);function c(e){if(e&&"button"!==e.type)return void 0!==e.value?e.value:"string"!==e.type&&"filename"!==e.type||"<empty>"!==e.default?e.default:""}var d;function u(){return{uri:"",name:"",defaultName:"",author:"",path:"",options:{},labels:{game:!0,research:!0,mate:!0},enableEarlyPonder:!1}}function m(e){if("button"===e.type||void 0===e.value)return!0;switch(e.type){case"check":if("true"!==e.value&&"false"!==e.value)return!1;break;case"spin":if("number"!=typeof e.value)return!1;if(void 0!==e.min&&e.value<e.min)return!1;if(void 0!==e.max&&e.value>e.max)return!1;break;case"string":case"filename":if("string"!=typeof e.value)return!1;break;case"combo":if("string"!=typeof e.value)return!1;if(!e.vars.includes(e.value))return!1}return!0}t.USIPonder="USI_Ponder",t.USIHash="USI_Hash",t.USIMultiPV="USI_MultiPV",t.Threads="Threads",t.NumberOfThreads="NumberOfThreads",t.MultiPV="MultiPV",t.getUSIEngineOptionCurrentValue=c,function(e){e.GAME="game",e.RESEARCH="research",e.MATE="mate"}(d||(t.USIEngineLabel=d={})),t.emptyUSIEngineSetting=u,t.duplicateEngineSetting=function(e){const t=JSON.parse(JSON.stringify(e));return t.uri=(0,r.issueEngineURI)(),t.name=l.t.copyOf(t.name),t},t.mergeUSIEngineSetting=function(e,t){e.uri=t.uri,e.name=t.name,Object.values(t.options).forEach((t=>{const o=e.options[t.name];o&&"button"!==o.type&&o.type===t.type&&(o.value=t.value)})),e.labels=t.labels,e.enableEarlyPonder=t.enableEarlyPonder},t.validateUSIEngineSetting=function(e){if(!s.isUSIEngine(e.uri))return new Error("invalid engine URI");if(!e.name&&!e.defaultName)return new Error("engine name is required");if(!e.path)return new Error("engine path is required");for(const t in e.options){const o=e.options[t];if(!["check","spin","combo","button","string","filename"].includes(o.type))return new Error(`invalid option type: name=[${t}] type=[${o.type}]`);if(!m(o))return new Error(`invalid option value: name=[${t}] type=[${o.type}]`+("button"!==o.type?` value=[${o.value}]`:""))}};class h{engines={};constructor(e){if(e){const t=JSON.parse(e);Object.keys(t.engines).filter(s.isUSIEngine).forEach((e=>{const o={uri:"",name:"",defaultName:"",author:"",path:"",options:{},labels:{game:!0,research:!0,mate:!0},enableEarlyPonder:!1},n=t.engines[e];this.engines[e]={...o,...n,uri:e,labels:{...o.labels,...n.labels}}}))}}hasEngine(e){return!!this.engines[e]}addEngine(e){this.engines[e.uri]=e}updateEngine(e){return!!this.engines[e.uri]&&(this.engines[e.uri]=e,!0)}removeEngine(e){return!!this.engines[e]&&(delete this.engines[e],!0)}getEngine(e){return this.engines[e]}get engineList(){return Object.values(this.engines).sort(((e,t)=>e.name!==t.name?e.name>t.name?1:-1:e.defaultName!==t.defaultName?e.defaultName>t.defaultName?1:-1:e.uri>t.uri?1:-1))}get json(){return JSON.stringify(this)}get jsonWithIndent(){return JSON.stringify(this,void 0,2)}getClone(){return new h(this.json)}filterByLabel(e){const t=new h;return this.engineList.filter((t=>t.labels&&t.labels[e])).forEach((e=>t.addEngine(e))),t}}t.USIEngineSettings=h,t.exportUSIEngineSettingForCLI=function(e){const t={};for(const o of Object.values(e.options)){const e=c(o);if(void 0!==e)switch(o.type){case"check":t[o.name]={type:"check",value:"true"===e};break;case"spin":t[o.name]={type:"spin",value:e};break;case"button":break;default:t[o.name]={type:o.type,value:e}}}return{name:e.name,path:e.path,options:t,enableEarlyPonder:e.enableEarlyPonder}},t.importUSIEngineSettingForCLI=function(e,t){const o={};for(const t in e.options){const n=e.options[t];switch(n.type){case"check":o[t]={name:t,type:"check",order:0,value:n.value?"true":"false"};break;case"spin":o[t]={name:t,type:"spin",order:0,value:n.value};break;case"combo":o[t]={name:t,type:"combo",order:0,value:n.value,vars:[n.value]};break;default:o[t]={name:t,type:n.type,order:0,value:n.value}}}return{uri:t||(0,r.issueEngineURI)(),name:e.name,defaultName:e.name,author:"",path:e.path,options:o,enableEarlyPonder:e.enableEarlyPonder,labels:{}}}},7367:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.issueEngineURI=t.isUSIEngine=t.ES_USI_ENGINE=t.ES_HUMAN=void 0,t.ES_HUMAN="es://human",t.ES_USI_ENGINE="es://usi-engine/",t.isUSIEngine=function(e){return e.startsWith(t.ES_USI_ENGINE)},t.issueEngineURI=function(){const e=Date.now(),o=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16);return t.ES_USI_ENGINE+`${e}/${o}`}},8574:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generateRecordFileName=t.defaultRecordFileNameTemplate=t.join=t.dirname=void 0;const n=o(2851),i=o(5746);function a(e){return e.endsWith("/")||e.endsWith("\\")?e.substring(0,e.length-1):e}function r(e){return e.replaceAll(/[<>:"/\\|?*]/g,"_")}t.dirname=function(e){return e.substring(0,Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")))},t.join=function(e,...t){const o=function(e){return e.indexOf("/")>=0?"/":"\\"}(e);let n=a(e);for(const e of t)n+=e.startsWith("/")||e.startsWith("\\")?e:o+e,n=a(n);return n},t.defaultRecordFileNameTemplate="{datetime}{_title}{_sente}{_gote}",t.generateRecordFileName=function(e,o,a){const s={datetime:function(e){const t=e.getStandardMetadata(n.RecordMetadataKey.START_DATETIME)||e.getStandardMetadata(n.RecordMetadataKey.DATE);return t?t.trim().replaceAll(" ","_").replaceAll("/","").replaceAll(":",""):(0,i.getDateString)().replaceAll("/","")}(e),title:e.getStandardMetadata(n.RecordMetadataKey.TITLE)||e.getStandardMetadata(n.RecordMetadataKey.TOURNAMENT)||e.getStandardMetadata(n.RecordMetadataKey.OPUS_NAME)||e.getStandardMetadata(n.RecordMetadataKey.OPUS_NO)||e.getStandardMetadata(n.RecordMetadataKey.PLACE)||e.getStandardMetadata(n.RecordMetadataKey.POSTED_ON)||e.getStandardMetadata(n.RecordMetadataKey.AUTHOR)||"",sente:(0,n.getBlackPlayerName)(e)||"",gote:(0,n.getWhitePlayerName)(e)||"",hex5:Math.floor(1048576*Math.random()).toString(16).toUpperCase().padStart(5,"0")};for(const e in s){const t=s[e];s["_"+e]=t?"_"+t:"",s[e+"_"]=t?t+"_":""}let l=o||t.defaultRecordFileNameTemplate;l=r(l);for(const e in s){const t=s[e];l=r(l.replaceAll("{"+e+"}",t))}return l=l.trim(),l+=a?a.startsWith(".")?a:"."+a:".kif",l}},7510:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNative=t.bridge=t.appInfo=void 0;const n=o(2040),i=o(4908);function a(){return window}t.appInfo=a().electronShogi||{},t.bridge=a().electronShogiAPI||i.webAPI;const r={...t.bridge,loadAppSetting:async()=>JSON.parse(await t.bridge.loadAppSetting()),saveAppSetting:e=>t.bridge.saveAppSetting(JSON.stringify(e)),loadBatchConversionSetting:async()=>JSON.parse(await t.bridge.loadBatchConversionSetting()),saveBatchConversionSetting:e=>t.bridge.saveBatchConversionSetting(JSON.stringify(e)),loadResearchSetting:async()=>JSON.parse(await t.bridge.loadResearchSetting()),saveResearchSetting:e=>t.bridge.saveResearchSetting(JSON.stringify(e)),loadAnalysisSetting:async()=>JSON.parse(await t.bridge.loadAnalysisSetting()),saveAnalysisSetting:e=>t.bridge.saveAnalysisSetting(JSON.stringify(e)),loadGameSetting:async()=>JSON.parse(await t.bridge.loadGameSetting()),saveGameSetting:e=>t.bridge.saveGameSetting(JSON.stringify(e)),loadCSAGameSettingHistory:async()=>JSON.parse(await t.bridge.loadCSAGameSettingHistory()),saveCSAGameSettingHistory:e=>t.bridge.saveCSAGameSettingHistory(JSON.stringify(e)),loadMateSearchSetting:async()=>JSON.parse(await t.bridge.loadMateSearchSetting()),saveMateSearchSetting:e=>t.bridge.saveMateSearchSetting(JSON.stringify(e)),loadRecordFileHistory:async()=>JSON.parse(await t.bridge.loadRecordFileHistory()),loadUSIEngineSetting:async()=>new n.USIEngineSettings(await t.bridge.loadUSIEngineSetting()),saveUSIEngineSetting:e=>t.bridge.saveUSIEngineSetting(e.json),fetchInitialRecordFileRequest:async()=>JSON.parse(await t.bridge.fetchInitialRecordFileRequest()),convertRecordFiles:async e=>JSON.parse(await t.bridge.convertRecordFiles(JSON.stringify(e))),getUSIEngineInfo:async(e,o)=>JSON.parse(await t.bridge.getUSIEngineInfo(e,o)),usiLaunch:(e,o)=>t.bridge.usiLaunch(JSON.stringify(e),o),usiReady:e=>t.bridge.usiReady(e),usiGo:(e,o,n)=>t.bridge.usiGo(e,o,JSON.stringify(n)),usiGoPonder:(e,o,n)=>t.bridge.usiGoPonder(e,o,JSON.stringify(n)),usiPonderHit:(e,o)=>t.bridge.usiPonderHit(e,JSON.stringify(o)),csaLogin:e=>t.bridge.csaLogin(JSON.stringify(e)),collectSessionStates:async()=>JSON.parse(await t.bridge.collectSessionStates()),setupPrompt:async(e,o)=>JSON.parse(await t.bridge.setupPrompt(e,o)),exportCaptureAsPNG:e=>t.bridge.exportCaptureAsPNG(e.json),exportCaptureAsJPEG:e=>t.bridge.exportCaptureAsJPEG(e.json),getVersionStatus:async()=>JSON.parse(await t.bridge.getVersionStatus())};t.default=r,t.isNative=function(){return!!a().electronShogiAPI}},4908:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.webAPI=void 0;const n=o(9273),i=o(7748),a=o(9161),r=o(7914),s=o(2040),l=o(1219),c=o(8474),d=o(3010),u=o(9994),m=o(2587),h=o(7892);var p;!function(e){e.APP_SETTING="appSetting",e.RESEARCH_SETTING="researchSetting",e.BATCH_CONVERSION_SETTING="batchConversionSetting",e.ANALYSIS_SETTING="analysisSetting",e.GAME_SETTING="gameSetting",e.MATE_SEARCH_SETTING="mateSearchSetting",e.CSA_GAME_SETTING_HISTORY="csaGameSettingHistory"}(p||(p={})),t.webAPI={updateAppState(){},onClosable(){},onClose(){},onSendError(){},onMenuEvent(){},async loadAppSetting(){const e=localStorage.getItem(p.APP_SETTING);return e?JSON.stringify({...(0,i.defaultAppSetting)(),...JSON.parse(e)}):JSON.stringify((0,i.defaultAppSetting)())},async saveAppSetting(e){localStorage.setItem(p.APP_SETTING,e)},async loadBatchConversionSetting(){const e=localStorage.getItem(p.BATCH_CONVERSION_SETTING);return e?JSON.stringify({...(0,m.defaultBatchConversionSetting)(),...JSON.parse(e)}):JSON.stringify((0,m.defaultBatchConversionSetting)())},async saveBatchConversionSetting(e){localStorage.setItem(p.BATCH_CONVERSION_SETTING,e)},async loadResearchSetting(){const e=localStorage.getItem(p.RESEARCH_SETTING);return e?JSON.stringify({...(0,r.defaultResearchSetting)(),...JSON.parse(e)}):JSON.stringify((0,r.defaultResearchSetting)())},async saveResearchSetting(e){localStorage.setItem(p.RESEARCH_SETTING,e)},async loadAnalysisSetting(){const e=localStorage.getItem(p.ANALYSIS_SETTING);return e?JSON.stringify({...(0,n.defaultAnalysisSetting)(),...JSON.parse(e)}):JSON.stringify((0,n.defaultAnalysisSetting)())},async saveAnalysisSetting(e){localStorage.setItem(p.ANALYSIS_SETTING,e)},async loadGameSetting(){const e=localStorage.getItem(p.GAME_SETTING);return e?JSON.stringify({...(0,a.defaultGameSetting)(),...JSON.parse(e)}):JSON.stringify((0,a.defaultGameSetting)())},async saveGameSetting(e){localStorage.setItem(p.GAME_SETTING,e)},async loadCSAGameSettingHistory(){const e=localStorage.getItem(p.CSA_GAME_SETTING_HISTORY);return e?JSON.stringify({...(0,d.defaultCSAGameSettingHistory)(),...JSON.parse(e)}):JSON.stringify((0,d.defaultCSAGameSettingHistory)())},async saveCSAGameSettingHistory(e){localStorage.setItem(p.CSA_GAME_SETTING_HISTORY,e)},async loadMateSearchSetting(){const e=localStorage.getItem(p.MATE_SEARCH_SETTING);return e?JSON.stringify({...(0,u.defaultMateSearchSetting)(),...JSON.parse(e)}):JSON.stringify((0,u.defaultMateSearchSetting)())},async saveMateSearchSetting(e){localStorage.setItem(p.MATE_SEARCH_SETTING,e)},loadUSIEngineSetting:async()=>(new s.USIEngineSettings).json,async saveUSIEngineSetting(){},onUpdateAppSetting(){},fetchInitialRecordFileRequest:async()=>"null",async showOpenRecordDialog(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async showSaveRecordDialog(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async showSaveMergedRecordDialog(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async openRecord(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async saveRecord(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},loadRecordFileHistory:async()=>JSON.stringify((0,h.getEmptyHistory)()),addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async loadRemoteRecordFile(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async convertRecordFiles(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},onOpenRecord(){},async showSelectUSIEngineDialog(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async getUSIEngineInfo(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async sendUSISetOption(){},async usiLaunch(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async usiReady(){},async usiGo(){},async usiGoPonder(){},async usiPonderHit(){},async usiGoInfinite(){},async usiGoMate(){},async usiStop(){},async usiGameover(){},async usiQuit(){},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},onUSIPonderInfo(){},async csaLogin(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async csaLogout(){},async csaAgree(){},async csaMove(){},async csaResign(){},async csaWin(){},async csaStop(){},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},collectSessionStates:async()=>JSON.stringify({usiSessions:[],csaSessions:[]}),async setupPrompt(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async openPrompt(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},invokePromptCommand(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},onPromptCommand(){},async showSelectImageDialog(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async cropPieceImage(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsPNG(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsJPEG(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},openLogFile(){},log(e,t){switch(e){case l.LogLevel.DEBUG:console.debug(t);break;case l.LogLevel.INFO:console.log(t);break;case l.LogLevel.WARN:console.warn(t);break;case l.LogLevel.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},async showSelectDirectoryDialog(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)},openExplorer(){},openWebBrowser(e){window.open(e,"_blank")},isEncryptionAvailable:async()=>!1,getVersionStatus:async()=>JSON.stringify({}),sendTestNotification(){throw new Error(c.t.thisFeatureNotAvailableOnWebApp)}}},3101:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultPlayerBuilder=void 0;const r=o(9335),s=o(7769),l=a(o(7367));t.defaultPlayerBuilder=function(e){return{async build(t,o){if(t.uri===l.ES_HUMAN)return r.humanPlayer;if(l.isUSIEngine(t.uri)&&t.usi){const n=new s.USIPlayer(t.usi,e??10,o);return await n.launch(),n}throw new Error("defaultPlayerBuilder#build: 予期せぬプレイヤーURIです: "+t.uri)}}}},9335:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.humanPlayer=t.HumanPlayer=void 0;class o{searchHandler;isEngine(){return!1}async readyNewGame(){}async startSearch(e,t,o,n){this.searchHandler=n}async startPonder(){}async startMateSearch(){}async stop(){}async gameover(){}async close(){this.searchHandler=void 0}doMove(e){const t=this.searchHandler;this.searchHandler=void 0,t?.onMove(e)}resign(){const e=this.searchHandler;this.searchHandler=void 0,e?.onResign()}win(){const e=this.searchHandler;this.searchHandler=void 0,e?.onWin()}}t.HumanPlayer=o,t.humanPlayer=new o},7769:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isActiveUSIPlayerSession=t.onUSIPonderInfo=t.onUSIInfo=t.onUSINoMate=t.onUSICheckmateTimeout=t.onUSICheckmateNotImplemented=t.onUSICheckmate=t.onUSIBestMove=t.USIPlayer=t.setOnUpdateUSIPonderInfoHandler=t.setOnUpdateUSIInfoHandler=void 0;const i=n(o(7510)),a=o(7187),r=o(2040),s=o(2851);let l=()=>{},c=()=>{};t.setOnUpdateUSIInfoHandler=function(e){l=e},t.setOnUpdateUSIPonderInfoHandler=function(e){c=e};t.USIPlayer=class{setting;timeoutSeconds;onSearchInfo;_sessionID=0;usi;position;searchHandler;mateHandler;ponder;inPonder=!1;info;usiInfoTimeout;constructor(e,t,o){this.setting=e,this.timeoutSeconds=t,this.onSearchInfo=o}get name(){return this.setting.name}get sessionID(){return this._sessionID}async launch(){this._sessionID=await i.default.usiLaunch(this.setting,this.timeoutSeconds),d[this.sessionID]=this}isEngine(){return!0}async readyNewGame(){await i.default.usiReady(this.sessionID)}async startSearch(e,t,o,n){this.clearHandlers(),this.searchHandler=n,this.usi=t,this.position=e.clone(),this.inPonder&&this.ponder===this.usi?i.default.usiPonderHit(this.sessionID,o):(this.info=void 0,await i.default.usiGo(this.sessionID,this.usi,o)),this.inPonder=!1,this.ponder=void 0}async startPonder(e,t,o){if("true"!==(0,r.getUSIEngineOptionCurrentValue)(this.setting.options[r.USIPonder]))return;if(this.inPonder)return;const n=t;if(!this.ponder||!this.ponder.startsWith(n))return;const a=e.createMoveByUSI(this.ponder.slice(n.length+1));a&&e.isValidMove(a)&&(this.clearHandlers(),this.usi=this.ponder,this.position=e.clone(),this.position.doMove(a),this.info=void 0,this.inPonder=!0,await i.default.usiGoPonder(this.sessionID,this.ponder,o))}async startMateSearch(e,t,o){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),this.mateHandler=o,await i.default.usiGoMate(this.sessionID,this.usi)}async startResearch(e,t){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),await i.default.usiGoInfinite(this.sessionID,t)}async stop(){await i.default.usiStop(this.sessionID)}async gameover(e){await i.default.usiGameover(this.sessionID,e)}async close(){this.clearHandlers(),await i.default.usiQuit(this.sessionID),delete d[this.sessionID]}clearHandlers(){this.searchHandler=void 0,this.mateHandler=void 0}onBestMove(e,t,o){const n=this.searchHandler;if(this.clearHandlers(),!n||!this.position)return;if(e!==this.usi)return;if("resign"===t)return void n.onResign();if("win"===t)return void n.onWin();const i=this.position.createMoveByUSI(t);if(!i)return n.onError("エンジンから不明な指し手を受信しました:"+t),void n.onResign();const a=e.indexOf(" moves ")>0;if(this.ponder=o&&`${e}${a?"":" moves"} ${t} ${o}`,this.flushUSIInfo(),this.info?.pv&&this.info.pv.length>=1&&this.info.pv[0].equals(i)){const e={...this.info,pv:this.info.pv.slice(1)};n.onMove(i,e)}else n.onMove(i)}onCheckmate(e,t){if(e!==this.usi||!this.position)return;const o=this.mateHandler;if(this.clearHandlers(),!o)return;const n=this.position,i=[];for(const e of t){const t=n.createMoveByUSI(e);if(!t)return void o.onError("エンジンから不明な指し手を受信しました:"+e);if(i.push(t),!n.doMove(t))return void o.onError("エンジンから無効な指し手を受信しました:"+e)}o.onCheckmate(i)}onCheckmateNotImplemented(){const e=this.mateHandler;this.clearHandlers(),e?.onNotImplemented()}onCheckmateTimeout(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onTimeout()}onNoMate(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onNoMate()}onUSIInfo(e,t){if(e!==this.usi||!this.position)return;if(t.multipv&&1!==t.multipv)return;const o=this.position.color===s.Color.BLACK?1:-1,n=t.pv&&t.pv.length>=1?t.pv:t.currmove?[t.currmove]:void 0;this.info={usi:e,depth:t.depth??this.info?.depth,nodes:t.nodes??this.info?.nodes,score:(t.scoreCP&&t.scoreCP*o)??this.info?.score,mate:(t.scoreMate&&t.scoreMate*o)??this.info?.mate,pv:(n&&(0,a.parseUSIPV)(this.position,n))??this.info?.pv},this.inPonder||this.usiInfoTimeout||(this.usiInfoTimeout=window.setTimeout((()=>{this.flushUSIInfo()}),500))}flushUSIInfo(){this.usiInfoTimeout&&(clearTimeout(this.usiInfoTimeout),this.usiInfoTimeout=void 0),this.info&&this.onSearchInfo?.(this.info)}};const d={};t.onUSIBestMove=function(e,t,o,n){d[e]?.onBestMove(t,o,n)},t.onUSICheckmate=function(e,t,o){const n=d[e];n&&(l(e,t,n.name,{pv:o}),n.onCheckmate(t,o))},t.onUSICheckmateNotImplemented=function(e){d[e]?.onCheckmateNotImplemented()},t.onUSICheckmateTimeout=function(e,t){d[e]?.onCheckmateTimeout(t)},t.onUSINoMate=function(e,t){d[e]?.onNoMate(t)},t.onUSIInfo=function(e,t,o){const n=d[e];n&&(l(e,t,n.name,o),n.onUSIInfo(t,o))},t.onUSIPonderInfo=function(e,t,o){const n=d[e];n&&(c(e,t,n.name,o),n.onUSIInfo(t,o))},t.isActiveUSIPlayerSession=function(e){return!!d[e]}},6255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Clock=void 0;t.Clock=class{_setting={timeMs:0,byoyomi:0,increment:0};_timeMs=0;_byoyomi=0;_elapsedMs=0;timerHandle=0;timerStart=0;lastTimeMs=0;setup(e){this._setting=e,this._timeMs=e.timeMs||0,this._byoyomi=e.byoyomi||0,this._elapsedMs=0}get setting(){return this._setting}get time(){return Math.ceil(this._timeMs/1e3)}get timeMs(){return this._timeMs}get byoyomi(){return this._byoyomi}get elapsedMs(){return this._elapsedMs}start(){this.clearTimer(),this.timerStart=Date.now(),this.lastTimeMs=this._timeMs,this._byoyomi=this.setting.byoyomi||0,this._elapsedMs=0,this.timerHandle=window.setInterval((()=>{const e=this.timeMs,t=this.byoyomi;this._elapsedMs=Date.now()-this.timerStart;const o=this.lastTimeMs-this._elapsedMs;o>=0?this._timeMs=o:(this._timeMs=0,this._byoyomi=Math.max(Math.ceil((this.setting.byoyomi||0)+o/1e3),0)),0!==this.timeMs||0!==this.byoyomi?this.fireBeep(e,t):this.timeout()}),100)}fireBeep(e,t){let o=Math.ceil(this.timeMs/1e3),n=Math.ceil(e/1e3);0!==o&&0!==this.byoyomi||(0!==o||0===n?(0!==this.byoyomi&&(o=this.byoyomi,n=t),o!==n&&(o<=5?this.setting.onBeepUnlimited&&this.setting.onBeepUnlimited():(o<=10||20===o||30===o||60===o)&&this.setting.onBeepShort&&this.setting.onBeepShort())):this.setting.onBeepShort&&this.setting.onBeepShort())}pause(){this.clearTimer()}stop(){this.clearTimer(),this.incrementTime()}timeout(){this.clearTimer(),this.setting.onTimeout?.()}clearTimer(){this.timerHandle&&(window.clearInterval(this.timerHandle),this.timerHandle=0),this.setting.onStopBeep?.()}incrementTime(){this._timeMs+=1e3*(this.setting.increment||0)}}},7076:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.onCSAClose=t.onCSAGameResult=t.onCSAMove=t.onCSAStart=t.onCSAReject=t.onCSAGameSummary=t.CSAGameManager=t.CSAGameState=t.loginRetryIntervalSeconds=void 0;const i=n(o(7510)),a=o(4725),r=o(3101),s=o(3010),l=o(2851),c=o(9273),d=o(7872),u=o(8474),m=o(3695),h=o(7769);var p,g;t.loginRetryIntervalSeconds=10,function(e){e[e.OFFLINE=0]="OFFLINE",e[e.PLAYER_SETUP=1]="PLAYER_SETUP",e[e.WAITING_LOGIN=2]="WAITING_LOGIN",e[e.LOGIN_FAILED=3]="LOGIN_FAILED",e[e.LOGIN_RETRY_INTERVAL=4]="LOGIN_RETRY_INTERVAL",e[e.READY=5]="READY",e[e.GAME=6]="GAME"}(p||(t.CSAGameState=p={})),function(e){e[e.DO_NOT_RELOGIN=0]="DO_NOT_RELOGIN",e[e.RELOGIN_WITH_INTERVAL=1]="RELOGIN_WITH_INTERVAL",e[e.RELOGIN_IMMEDIATELY=2]="RELOGIN_IMMEDIATELY"}(g||(g={}));t.CSAGameManager=class{recordManager;blackClock;whiteClock;_state=p.OFFLINE;_setting=(0,s.defaultCSAGameSetting)();_sessionID=0;stopRequested=!1;repeat=0;player;gameSummary=(0,a.emptyCSAGameSummary)();searchInfo;playerBuilder=(0,r.defaultPlayerBuilder)();retryTimer;onSaveRecord=()=>{};onGameNext=()=>{};onNewGame=()=>{};onGameEnd=()=>{};onLoginRetry=()=>{};onFlipBoard=()=>{};onPieceBeat=()=>{};onBeepShort=()=>{};onBeepUnlimited=()=>{};onStopBeep=()=>{};onError=()=>{};constructor(e,t,o){this.recordManager=e,this.blackClock=t,this.whiteClock=o}on(e,t){switch(e){case"saveRecord":this.onSaveRecord=t;break;case"gameNext":this.onGameNext=t;break;case"newGame":this.onNewGame=t;break;case"gameEnd":this.onGameEnd=t;break;case"loginRetry":this.onLoginRetry=t;break;case"flipBoard":this.onFlipBoard=t;break;case"pieceBeat":this.onPieceBeat=t;break;case"beepShort":this.onBeepShort=t;break;case"beepUnlimited":this.onBeepUnlimited=t;break;case"stopBeep":this.onStopBeep=t;break;case"error":this.onError=t}return this}get state(){return this._state}get setting(){return this._setting}get sessionID(){return this._sessionID}get usiSessionID(){return this.player instanceof h.USIPlayer?this.player.sessionID:0}get isMyTurn(){return this.recordManager.record.position.color===this.gameSummary.myColor}async login(e,t){if(this.sessionID)throw new Error("CSAGameManager#login: session already exists");if(this._state!==p.OFFLINE)throw new Error("CSAGameManager#login: unexpected state");this._state=p.PLAYER_SETUP,this._setting=e,this.playerBuilder=t,this.repeat=0,this.player=await this.playerBuilder.build(this._setting.player,(e=>this.recordManager.updateSearchInfo(d.SearchInfoSenderType.OPPONENT,e))),this._login().catch(this.onError)}async relogin(){this.setting.restartPlayerEveryGame&&(this._state=p.PLAYER_SETUP,this.player&&(await this.player.close(),this.player=void 0),this.player=await this.playerBuilder.build(this._setting.player,(e=>this.recordManager.updateSearchInfo(d.SearchInfoSenderType.OPPONENT,e)))),await this._login()}async _login(){if(!this.player)throw new Error("CSAGameManager#relogin: player is not initialized");try{this._state=p.PLAYER_SETUP,await this.player.readyNewGame(),this._state=p.WAITING_LOGIN;const e=await i.default.csaLogin(this._setting.server);this._sessionID=e,this._state=p.READY,function(e,t){S[e]=t}(this.sessionID,this),this.onGameNext()}catch(e){throw this._state=p.LOGIN_FAILED,this.close(g.RELOGIN_WITH_INTERVAL),new Error(`CSAGameManager#relogin: ${u.t.failedToStartNewGame}: ${e}`)}}stop(){this.sessionID&&(this.stopRequested=!0,i.default.csaStop(this.sessionID))}logout(){this.close(g.DO_NOT_RELOGIN)}close(e){if(this._state!==p.OFFLINE&&this._state!==p.WAITING_LOGIN){var o;if(this._state===p.GAME&&this.setting.enableAutoSave&&this.onSaveRecord(),this.stopRequested&&(e=g.DO_NOT_RELOGIN,this.stopRequested=!1),this.sessionID&&(o=this.sessionID,delete S[o],i.default.csaLogout(this.sessionID).catch((e=>{this.onError(new Error(`CSAGameManager#close: ${u.t.errorOccuredWhileLogoutFromCSAServer}: ${e}`))})),this._sessionID=0),this.blackClock.stop(),this.whiteClock.stop(),this._state=p.OFFLINE,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=void 0),e===g.DO_NOT_RELOGIN||this.repeat>=this.setting.repeat)return this.player&&(this.player.close().catch((e=>{this.onError(new Error(`CSAGameManager#close: ${u.t.failedToShutdownEngines}: ${e}`))})),this.player=void 0),void this.onGameEnd();e===g.RELOGIN_IMMEDIATELY?this.relogin().catch(this.onError):(this._state=p.LOGIN_RETRY_INTERVAL,this.onLoginRetry(),this.retryTimer=setTimeout((()=>this.relogin().catch(this.onError)),1e3*t.loginRetryIntervalSeconds))}}onGameSummary(e){this.gameSummary=e;const t=this.recordManager.importRecord(this.gameSummary.position,{type:l.RecordFormatType.CSA});if(t)return this.onError(`CSAGameManager#onGameSummary: ${t}`),void this.close(g.DO_NOT_RELOGIN);this.recordManager.changePly(Number.MAX_SAFE_INTEGER),i.default.csaAgree(this.sessionID,this.gameSummary.id)}onReject(){this.close(g.RELOGIN_WITH_INTERVAL)}onStart(e){this.repeat++,this.onNewGame(this.repeat);const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;this.recordManager.setGameStartMetadata({gameTitle:this.gameSummary.id,blackName:this.gameSummary.players.black.playerName,whiteName:this.gameSummary.players.white.playerName,blackTimeLimit:{timeSeconds:t.totalTime*t.timeUnitMs/1e3,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},whiteTimeLimit:{timeSeconds:o.totalTime*o.timeUnitMs/1e3,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}),this.setting.autoFlip&&this.onFlipBoard&&this.onFlipBoard(this.gameSummary.myColor===l.Color.WHITE),this._state=p.GAME,this.next(e)}onMove(e,t){const o=this.isMyTurn,n=(0,l.parseCSAMove)(this.recordManager.record.position,e);n instanceof Error?this.onError(`CSAGameManager#onMove: 解釈できない指し手 [${e}]: ${n.message}`):(this.recordManager.appendMove({move:n,moveOption:{ignoreValidation:!0},elapsedMs:this.parseElapsedMs(n.color,e)}),o&&this.searchInfo&&this.recordManager.updateSearchInfo(d.SearchInfoSenderType.PLAYER,this.searchInfo),o&&this.searchInfo&&this.setting.enableComment&&this.recordManager.appendSearchComment(d.SearchInfoSenderType.PLAYER,this.searchInfo,c.CommentBehavior.APPEND),this.onPieceBeat(),this.next(t))}parseElapsedMs(e,t){const o=this.gameSummary.players[e].time,n=/^.*,T([0-9]+)$/.exec(t);return n?Number(parseInt(n[1]))*o.timeUnitMs:0}onGameResult(e,t){if(this.recordManager.appendMove({move:this.gameResultToSpecialMove(e,t)}),this.player){let e;switch(t){case a.CSAGameResult.WIN:e=m.GameResult.WIN;break;case a.CSAGameResult.LOSE:e=m.GameResult.LOSE;break;case a.CSAGameResult.DRAW:case a.CSAGameResult.CENSORED:case a.CSAGameResult.CHUDAN:e=m.GameResult.DRAW}this.player.gameover(e)}this.close(g.RELOGIN_IMMEDIATELY)}gameResultToSpecialMove(e,t){const o=this.recordManager.record.position.color;switch(e){case a.CSASpecialMove.RESIGN:return l.SpecialMoveType.RESIGN;case a.CSASpecialMove.SENNICHITE:return l.SpecialMoveType.REPETITION_DRAW;case a.CSASpecialMove.OUTE_SENNICHITE:case a.CSASpecialMove.ILLEGAL_MOVE:case a.CSASpecialMove.ILLEGAL_ACTION:switch(t){case a.CSAGameResult.WIN:return o===this.gameSummary.myColor?l.SpecialMoveType.FOUL_WIN:l.SpecialMoveType.FOUL_LOSE;case a.CSAGameResult.LOSE:return o===this.gameSummary.myColor?l.SpecialMoveType.FOUL_LOSE:l.SpecialMoveType.FOUL_WIN}break;case a.CSASpecialMove.TIME_UP:return l.SpecialMoveType.TIMEOUT;case a.CSASpecialMove.JISHOGI:return l.SpecialMoveType.ENTERING_OF_KING;case a.CSASpecialMove.MAX_MOVES:return l.SpecialMoveType.IMPASS}return t===a.CSAGameResult.DRAW?l.SpecialMoveType.DRAW:l.SpecialMoveType.INTERRUPT}onClose(){this.close(this.setting.autoRelogin?g.RELOGIN_WITH_INTERVAL:g.DO_NOT_RELOGIN)}next(e){this.blackClock.stop(),this.whiteClock.stop(),this.syncClock(e),this.startClock();this.recordManager.record.position.color===this.gameSummary.myColor?this.startSearch(e):this.startPonder()}syncClock(e){const t={onBeepShort:()=>this.onBeepShort(),onBeepUnlimited:()=>this.onBeepUnlimited(),onStopBeep:()=>this.onStopBeep()},o=this.gameSummary.players.black.time;this.blackClock.setup({...t,timeMs:e.black.time*o.timeUnitMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3});const n=this.gameSummary.players.white.time;this.whiteClock.setup({...t,timeMs:e.white.time*n.timeUnitMs,byoyomi:n.byoyomi*n.timeUnitMs/1e3})}startClock(){this.recordManager.record.position.color===l.Color.BLACK?this.blackClock.start():this.whiteClock.start()}startSearch(e){this.player?this.player.startSearch(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates(e),{onMove:this.onPlayerMove.bind(this),onResign:this.onPlayerResign.bind(this),onWin:this.onPlayerWin.bind(this),onError:this.onPlayerError.bind(this)}).catch((e=>{this.onError(new Error(`CSAGameManager#startSearch: ${u.t.failedToSendGoCommand}: ${e}`))})):this.onError("CSAGameManager#startSearch: player is not initialized")}startPonder(){this.player?this.player.startPonder(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates()).catch((e=>{this.onError(new Error(`CSAGameManager#startPonder: ${u.t.failedToSendPonderCommand}: ${e}`))})):this.onError("CSAGameManager#startPonder: player is not initialized")}startEarlyPonder(e){if(!this.player)return void this.onError("CSAGameManager#startEarlyPonder: player is not initialized");const t=this.recordManager.record.position.clone(),o=this.recordManager.record.usi+" "+e.usi;t.doMove(e)?this.player.startPonder(t,o,this.buildTimeStates()).catch((e=>{this.onError(new Error(`CSAGameManager#startEarlyPonder: ${u.t.failedToSendPonderCommand}: ${e}`))})):this.onError("CSAGameManager#startEarlyPonder: failed to make a move")}buildTimeStates(e){const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;return{black:{timeMs:e?e.black.time*t.timeUnitMs:this.blackClock.timeMs,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},white:{timeMs:e?e.white.time*o.timeUnitMs:this.whiteClock.timeMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}}onPlayerMove(e,t){let o,n;switch(this.searchInfo=t,this._setting.server.protocolVersion){case s.CSAProtocolVersion.V121:break;case s.CSAProtocolVersion.V121_FLOODGATE:o=t?.score,t?.pv?.forEach((e=>{n=n?n+" ":"",n+=(0,l.formatCSAMove)(e)}))}i.default.csaMove(this.sessionID,(0,l.formatCSAMove)(e),o,n),this.setting.player.usi?.enableEarlyPonder&&this.startEarlyPonder(e)}onPlayerResign(){i.default.csaResign(this.sessionID)}onPlayerWin(){i.default.csaWin(this.sessionID)}onPlayerError(e){this.onError(e)}};const S={};t.onCSAGameSummary=function(e,t){S[e]?.onGameSummary(t)},t.onCSAReject=function(e){S[e]?.onReject()},t.onCSAStart=function(e,t){S[e]?.onStart(t)},t.onCSAMove=function(e,t,o){S[e]?.onMove(t,o)},t.onCSAGameResult=function(e,t,o){S[e]?.onGameResult(t,o)},t.onCSAClose=function(e){S[e]?.onClose()}},7872:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RecordManager=t.SearchInfoSenderType=void 0;const i=o(5746),a=o(2851),r=o(5283),s=o(9273),l=o(8474),c=o(6059),d=o(7187),u=n(o(7510)),m=o(1219),h=o(9886);var p;function g(e){const t=/^\*詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||d.SCORE_MATE_INFINITE)*("先手勝ち"===t[1]?1:-1)}function S(e){const t=/^#詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||d.SCORE_MATE_INFINITE)*("先手勝ち"===t[1]?1:-1)}function y(e){const t=/^\*評価値=([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function f(e){const t=/^#評価値=([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function v(e){const t=/^\* *([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function b(e){const t=/^\*対局 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function I(e){const t=/^\*解析 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function T(e){const t=/^\* .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function E(e){const t=/^#(?:形勢|指し手)\[([+-]?[0-9]+)\]/.exec(e);return t?Number(t[1]):void 0}function C(e){e.forEach((e=>{const t=e.customData||{},o=e.comment.split("\n");for(const e of o){const o=g(e);void 0!==o&&(t.playerSearchInfo={...t.playerSearchInfo,mate:o});const n=S(e);void 0!==n&&(t.researchInfo={...t.researchInfo,mate:n});const i=y(e)||v(e)||b(e);void 0!==i&&(t.playerSearchInfo={...t.playerSearchInfo,score:i});const a=f(e)||I(e)||T(e)||E(e);void 0!==a&&(t.researchInfo={...t.researchInfo,score:a})}e.customData=t}))}function A(e,t){const o=t.indexOf(" ",t.indexOf(" ")+1)+1,n=[],i=e.clone();for(let e=o;e<t.length;e+=8){const o=t.substring(e,e+7),r=(0,a.parseCSAMove)(i,o);if(r instanceof Error||!i.doMove(r,{ignoreValidation:!1}))break;n.push(r)}return n}function M(e){return e.timeSeconds+"+"+e.byoyomi+"+"+e.increment}function P(e){return(0,h.secondsToMMSS)(e.timeSeconds)+"+"+String(e.byoyomi).padStart(2,"0")}!function(e){e[e.PLAYER=0]="PLAYER",e[e.OPPONENT=1]="OPPONENT",e[e.RESEARCHER=2]="RESEARCHER",e[e.RESEARCHER_2=3]="RESEARCHER_2",e[e.RESEARCHER_3=4]="RESEARCHER_3",e[e.RESEARCHER_4=5]="RESEARCHER_4"}(p||(t.SearchInfoSenderType=p={}));t.RecordManager=class{_record=new a.Record;_recordFilePath;_unsaved=!1;_sourceURL;onResetRecord=()=>{};onChangePosition=()=>{};onUpdateTree=()=>{};onUpdateCustomData=()=>{};onUpdateFollowingMoves=()=>{};onBackup=()=>{};get record(){return this._record}get recordFilePath(){return this._recordFilePath}get unsaved(){return this._unsaved}get sourceURL(){return this._sourceURL}updateRecordFilePath(e){this._unsaved=!1,e!==this._recordFilePath&&(this._recordFilePath=e,e&&u.default.addRecordFileHistory(e))}async saveBackup(){if(!this.unsaved)return;const e=this.onBackup(),t=(0,a.exportKIF)(this.record,e||{});await u.default.saveRecordFileBackup(t)}saveBackupOnBackground(){this.saveBackup().catch((e=>{u.default.log(m.LogLevel.ERROR,`RecordManager#saveBackupOnBackground: failed to save backup: ${e}`)}))}clearRecord(e){this.saveBackupOnBackground(),this._record.clear(e),this._unsaved=!1,this._recordFilePath=void 0,this._sourceURL=void 0,this.onResetRecord()}replaceRecord(e,t){this.saveBackupOnBackground(),this._record=e,this.bindRecordHandlers(),this.updateRecordFilePath(t?.path),this._unsaved=!t?.markAsSaved,this._sourceURL=void 0,C(this._record),this.onResetRecord()}reset(){this.clearRecord()}resetByInitialPositionType(e){this.resetBySFEN((0,a.initialPositionTypeToSFEN)(e))}resetBySFEN(e){const t=new a.Position;return!!t.resetBySFEN(e)&&(this.clearRecord(t),!0)}resetByCurrentPosition(){this.clearRecord(this._record.position)}parseRecordData(e,t){let o;switch(t||(0,a.detectRecordFormat)(e)){case a.RecordFormatType.SFEN:{const t=a.Position.newBySFEN(e);o=t?new a.Record(t):new Error(l.t.failedToParseSFEN);break}case a.RecordFormatType.USI:o=a.Record.newByUSI(e);break;case a.RecordFormatType.KIF:o=(0,a.importKIF)(e);break;case a.RecordFormatType.KI2:o=(0,a.importKI2)(e);break;case a.RecordFormatType.CSA:o=(0,a.importCSA)(e);break;case a.RecordFormatType.JKF:o=(0,a.importJKFString)(e);break;default:o=new Error(l.t.failedToDetectRecordFormat)}return o instanceof Error?(0,l.localizeError)(o):o}importRecord(e,t){const o=this.parseRecordData(e,t?.type);if(o instanceof Error)return o;this.replaceRecord(o,t)}importRecordFromBuffer(e,t,o){const n=(0,c.detectRecordFileFormatByPath)(t);if(!n)return new Error(`${l.t.unknownFileExtension}: ${t}`);const i=(0,c.importRecordFromBuffer)(e,n,o);if(i instanceof Error)return(0,l.localizeError)(i);this.replaceRecord(i,{path:t,markAsSaved:!0})}async importRecordFromRemoteURL(e){const t=!e;if(!(e=e||this._sourceURL))return void u.default.log(m.LogLevel.ERROR,"RecordManager#importRecordFromRemoteURL: source URL is not set");const o=await u.default.loadRemoteRecordFile(e),n=this.parseRecordData(o);if(n instanceof Error)throw n;t?this.mergeRecord(n):this.replaceRecord(n),this._sourceURL=e}exportRecordAsBuffer(e,t){const o=(0,c.detectRecordFileFormatByPath)(e);if(!o)return new Error(`${l.t.unknownFileExtension}: ${e}`);const n=(0,c.exportRecordAsBuffer)(this._record,o,t);return this.updateRecordFilePath(e),n}applyPosition(e){this._record.clear(e),this._unsaved=!0,this._recordFilePath=void 0,this.onResetRecord()}swapNextTurn(){const e=this.record.position.clone();e.setColor((0,a.reverseColor)(e.color)),this.applyPosition(e)}changePosition(e){const t=this.record.position.clone();t.edit(e),this.applyPosition(t)}changePieceSet(e){const t=this.record.position.clone(),o=(0,a.countExistingPieces)(this.record.position),n={king:e.king-o.king,rook:e.rook-(o.rook+o.dragon),bishop:e.bishop-(o.bishop+o.horse),gold:e.gold-o.gold,silver:e.silver-(o.silver+o.promSilver),knight:e.knight-(o.knight+o.promKnight),lance:e.lance-(o.lance+o.promLance),pawn:e.pawn-(o.pawn+o.promPawn)};Object.entries(n).filter((([,e])=>e<0)).forEach((([e,o])=>{const n=e;for(let e=0;e>o;e--){const e=a.Square.all.find((e=>t.board.at(e)?.unpromoted().type===n));e?t.board.remove(e):n!==a.PieceType.KING&&(t.blackHand.count(n)>t.whiteHand.count(n)?t.blackHand.reduce(n,1):t.whiteHand.reduce(n,1))}})),Object.entries(n).filter((([,e])=>e>0)).forEach((([e,o])=>{const n=e;for(let e=0;e<o;e++){const e=a.Square.all.find((e=>!t.board.at(e)));e?t.board.set(e,new a.Piece(a.Color.BLACK,n)):n!==a.PieceType.KING&&(t.blackHand.count(n)<=t.whiteHand.count(n)?t.blackHand.add(n,1):t.whiteHand.add(n,1))}})),this.applyPosition(t)}changePly(e){this._record.goto(e)}changeBranch(e){return this._record.switchBranchByIndex(e)}swapWithNextBranch(){return!!this._record.swapWithNextBranch()&&(this._unsaved=!0,!0)}swapWithPreviousBranch(){return!!this._record.swapWithPreviousBranch()&&(this._unsaved=!0,!0)}removeCurrentMove(){return!!this._record.removeCurrentMove()&&(this._unsaved=!0,!0)}removeNextMove(){return!!this._record.removeNextMove()&&(this._unsaved=!0,!0)}jumpToBookmark(e){return this._record.jumpToBookmark(e)}updateComment(e){this._record.current.comment=e,this._unsaved=!0}updateBookmark(e){this._record.current.bookmark=e,this._unsaved=!0}appendComment(e,t){if(!e)return;const o=this._record.current.comment,n=this.record.current.comment?"\n":"";switch(t){case s.CommentBehavior.NONE:break;case s.CommentBehavior.INSERT:this._record.current.comment=e+n+o;break;case s.CommentBehavior.APPEND:this._record.current.comment=o+n+e;break;case s.CommentBehavior.OVERWRITE:this._record.current.comment=e}this._unsaved=!0}appendSearchComment(e,t,o,n){let i=function(e,t,o,n){const i=t===p.PLAYER?"*":"#";let s="";o.mate&&(s+=`${i}詰み=${o.mate>=0?"先手勝ち":"後手勝ち"}`,Math.abs(o.mate)!==d.SCORE_MATE_INFINITE&&(s+=`:${Math.abs(o.mate)}手`),s+="\n");return void 0!==o.score&&(s+=(0,r.getSituationText)(o.score)+"\n",s+=`${i}評価値=${o.score}\n`),o.pv&&0!==o.pv.length&&(s+=`${i}読み筋=${(0,a.formatPV)(e,o.pv)}\n`),o.depth&&(s+=`${i}深さ=${o.depth}\n`),o.nodes&&(s+=`${i}ノード数=${o.nodes}\n`),s&&n?.engineName&&(s+=`${i}エンジン=${n.engineName}\n`),s}(this.record.position,e,t,n);n?.header&&(i=n.header+"\n"+i),this.appendComment(i,o),this._unsaved=!0}get inCommentPVs(){return function(e,t){const o=[];for(const n of t.split("\n")){let t;if(n.match(/^[#*]読み筋=/))t=(0,a.parsePV)(e,n.substring(5));else if(n.match(/^\*.* 読み筋 /)){const o=n.substring(n.indexOf(" 読み筋 ")+5),i=e.color===a.Color.BLACK?"▲":"△";t=(0,a.parsePV)(e,o.substring(o.indexOf(i)))}else if(n.match(/^#(?:指し手|形勢)\[/)){const o=n.substring(n.indexOf("]")+1),i=e.color===a.Color.BLACK?"▲":"△";t=(0,a.parsePV)(e,o.substring(o.indexOf(i)))}else n.match(/^\* -?[0-9]+ /)&&(t=A(e,n));t?.length&&o.push(t)}return o}(this.record.position,this.record.current.comment)}setGameStartMetadata(e){e.gameTitle&&this._record.metadata.setStandardMetadata(a.RecordMetadataKey.TITLE,e.gameTitle),e.blackName&&this._record.metadata.setStandardMetadata(a.RecordMetadataKey.BLACK_NAME,e.blackName),e.whiteName&&this._record.metadata.setStandardMetadata(a.RecordMetadataKey.WHITE_NAME,e.whiteName),this._record.metadata.setStandardMetadata(a.RecordMetadataKey.DATE,(0,i.getDateString)()),this._record.metadata.setStandardMetadata(a.RecordMetadataKey.START_DATETIME,(0,i.getDateTimeString)());const t=e.blackTimeLimit.increment||e.whiteTimeLimit.increment?M:P,o=t(e.blackTimeLimit),n=t(e.whiteTimeLimit);o===n?this._record.metadata.setStandardMetadata(a.RecordMetadataKey.TIME_LIMIT,o):(this._record.metadata.setStandardMetadata(a.RecordMetadataKey.BLACK_TIME_LIMIT,o),this._record.metadata.setStandardMetadata(a.RecordMetadataKey.WHITE_TIME_LIMIT,n)),this._unsaved=!0}setGameEndMetadata(){this._record.metadata.setStandardMetadata(a.RecordMetadataKey.END_DATETIME,(0,i.getDateTimeString)()),this._unsaved=!0}updateSearchInfo(e,t){const o=this.record.current.customData||{};switch(e){case p.PLAYER:o.playerSearchInfo=t;break;case p.OPPONENT:o.opponentSearchInfo=t;break;case p.RESEARCHER:(t.depth||0)>=(o.researchInfo?.depth||0)&&(o.researchInfo=t);break;case p.RESEARCHER_2:(t.depth||0)>=(o.researchInfo2?.depth||0)&&(o.researchInfo2=t);break;case p.RESEARCHER_3:(t.depth||0)>=(o.researchInfo3?.depth||0)&&(o.researchInfo3=t);break;case p.RESEARCHER_4:(t.depth||0)>=(o.researchInfo4?.depth||0)&&(o.researchInfo4=t)}this._record.current.customData=o,this.onUpdateCustomData()}appendMove(e){return!!this._record.append(e.move,e.moveOption)&&(void 0!==e.elapsedMs&&this._record.current.setElapsedMs(e.elapsedMs),this._unsaved=!0,!0)}appendMovesSilently(e,t){this.unbindRecordHandlers();try{let o=0;const n=this._record.current.ply;for(const n of e){if(!this._record.append(n,t))break;o++}return this._record.goto(n),this._unsaved=!0,this.onUpdateFollowingMoves(),o}finally{this.bindRecordHandlers()}}mergeRecord(e){this._record.merge(e),this._unsaved=!0,C(this._record),this.onUpdateTree()}updateStandardMetadata(e){this._record.metadata.setStandardMetadata(e.key,e.value),this._unsaved=!0}on(e,t){switch(e){case"resetRecord":this.onResetRecord=t;break;case"changePosition":this.onChangePosition=t,this.bindRecordHandlers();break;case"updateTree":this.onUpdateTree=t;break;case"updateCustomData":this.onUpdateCustomData=t;break;case"updateFollowingMoves":this.onUpdateFollowingMoves=t;break;case"backup":this.onBackup=t}return this}bindRecordHandlers(){this._record.on("changePosition",this.onChangePosition)}unbindRecordHandlers(){this._record.on("changePosition",(()=>{}))}}},5283:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scoreToPercentage=t.getSituationText=void 0,t.getSituationText=function(e){return e>=1500?"先手勝勢":e>=600?"先手優勢":e>=400?"先手有利":e>=200?"先手有望":e>=-200?"互角":e>=-400?"後手有望":e>=-600?"後手有利":e>=-1500?"後手優勢":"後手勝勢"},t.scoreToPercentage=function(e,t){return 100/(1+Math.exp(-e/t))}},1288:e=>{e.exports=require("electron")},2851:e=>{e.exports=require("electron-shogi-core")},6953:e=>{e.exports=require("encoding-japanese")},983:e=>{e.exports=require("log4js")},636:e=>{e.exports=require("node:child_process")},9971:e=>{e.exports=require("node:fs")},9427:e=>{e.exports=require("node:net")},1258:e=>{e.exports=require("node:os")},6743:e=>{e.exports=require("node:path")},7558:e=>{e.exports=require("node:readline")},913:e=>{e.exports=require("yaml")}},t={};var o=function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,o),a.exports}(3965);module.exports=o})();
|
|
2
|
+
(()=>{"use strict";var e={3995:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Client=t.State=void 0;const i=o(3113),n=o(4725),a=o(3010),r=o(1869),s=o(8474),l=o(9169);var c;!function(e){e.IDLE="idle",e.CONNECTING="connecting",e.CONNECTED="connected",e.WAITING_GAME_SUMMARY="waitingGameSummary",e.GAME_SUMMARY="gameSummary",e.GAME_TIME="gameTime",e.GAME_TIME_B="gameTimeB",e.GAME_TIME_W="gameTimeW",e.GAME_POSITION="gamePosition",e.READY="ready",e.WAITING_START="waitingStart",e.WAITING_REJECT="waitingReject",e.PLAYING="playing",e.WAITING_LOGOUT="waitingLogout",e.WAITING_CLOSE="waitingClose",e.CLOSED="closed"}(c||(t.State=c={}));t.Client=class{sessionID;_settings;logger;_state=c.IDLE;gameSummaryCallback;rejectCallback;startCallback;moveCallback;gameResultCallback;closeCallback;errorCallback;commandCallback;socket;gameSummary=(0,n.emptyCSAGameSummary)();playerStates=(0,n.emptyCSAPlayerStates)();specialMove=n.CSASpecialMove.UNKNOWN;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};_createdMs=Date.now();_loggedInMs;blankLinePingTimeout=null;constructor(e,t,o){this.sessionID=e,this._settings=t,this.logger=o}get settings(){return this._settings}get state(){return this._state}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get createdMs(){return this._createdMs}get loggedInMs(){return this._loggedInMs}on(e,t){switch(e){case"gameSummary":this.gameSummaryCallback=t;break;case"reject":this.rejectCallback=t;break;case"start":this.startCallback=t;break;case"move":this.moveCallback=t;break;case"gameResult":this.gameResultCallback=t;break;case"close":this.closeCallback=t;break;case"error":this.errorCallback=t;break;case"command":this.commandCallback=t}return this}login(){this.logger.info("sid=%d: connecting to %s:%d",this.sessionID,this.settings.host,this.settings.port),this._state=c.CONNECTING,this.socket=new r.Socket(this.settings.host,this.settings.port,{onConnect:this.onConnect.bind(this),onError:this.onConnectionError.bind(this),onFIN:this.onFIN.bind(this),onClose:this.onClose.bind(this),onRead:this.onRead.bind(this)},{keepaliveInitialDelay:this.settings.tcpKeepalive.initialDelay})}logout(){if(this.settings.protocolVersion===a.CSAProtocolVersion.V121_FLOODGATE)this.socket&&(this.logger.info("sid=%d: disconnect",this.sessionID),this.socket.end(),this._state=c.WAITING_CLOSE);else this.state!==c.WAITING_GAME_SUMMARY&&this.state!==c.GAME_SUMMARY&&this.state!==c.GAME_TIME&&this.state!==c.GAME_TIME_B&&this.state!==c.GAME_TIME_W&&this.state!==c.GAME_POSITION&&this.state!==c.READY||(this.send("LOGOUT"),this._state=c.WAITING_LOGOUT)}agree(e){this.state===c.READY&&e===this.gameSummary.id&&(this._state=c.WAITING_START,this.send(`AGREE ${this.gameSummary.id}`))}reject(e){this.state===c.READY&&e===this.gameSummary.id&&(this._state=c.WAITING_REJECT,this.send(`REJECT ${this.gameSummary.id}`))}doMove(e,t,o){if(this.state!==c.PLAYING)return;let i=e;void 0!==t&&(i+=`,'* ${Math.round(t)}`,void 0!==o&&(i+=` ${o}`)),this.send(i)}resign(){this.state===c.PLAYING&&this.send("%TORYO")}win(){this.state===c.PLAYING&&this.send("%KACHI")}stop(){this.state===c.PLAYING&&this.send("%CHUDAN")}send(e){this.socket?(this.socket.write(e),this._lastSent=(0,l.newCommand)(l.CommandType.SEND,this.hideSecureValues(e)),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,this.hideSecureValues(e)),this.setBlankLinePing(e)):this.logger.error("sid=%d: failed to send command caused by invalid socket: %s",this.sessionID,e)}hideSecureValues(e){return this.settings.password&&(e=e.replaceAll(this.settings.password,"*****")),e}onConnect(){this.logger.info("sid=%d: connected",this.sessionID),this._state=c.CONNECTED;let e="";this.settings.protocolVersion===a.CSAProtocolVersion.V121_X1&&(e=" x1"),this.send(`LOGIN ${this.settings.id} ${this.settings.password}${e}`)}onConnectionError(e){if(this.state===c.CLOSED)return;this.onError(e),this._state=c.CLOSED,this.closeCallback?.();const t=(0,l.newCommand)(l.CommandType.SYSTEM,"connection error");this.updateCommendHistory(t),this.commandCallback?.(t)}onError(e){this.logger.error("sid=%d: error: %s %s",this.sessionID,e.name,e.message),this.errorCallback?.(e)}onFIN(){this.logger.info("sid=%d: FIN packet received",this.sessionID),this.clearBlankLinePing()}onClose(e){if(this.clearBlankLinePing(),this.state===c.CLOSED)return;switch(this.state){case c.WAITING_GAME_SUMMARY:case c.WAITING_LOGOUT:case c.WAITING_CLOSE:e?this.onError(new Error(s.t.errorOccuredWhileDisconnectingFromCSAServer)):this.logger.info("sid=%d: socket closed",this.sessionID);break;case c.CONNECTING:this.onError(new Error(s.t.failedToConnectToCSAServer));break;default:this.onError(new Error(s.t.disconnectedFromCSAServer))}this._state=c.CLOSED,this.closeCallback?.();const t=(0,l.newCommand)(l.CommandType.SYSTEM,e?"closed (error)":"closed");this.updateCommendHistory(t),this.commandCallback?.(t)}onRead(e){this.setBlankLinePing(),this._lastReceived=(0,l.newCommand)(l.CommandType.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),""!==e&&(this.state===c.GAME_SUMMARY?this.onGameSummary(e):this.state===c.GAME_TIME?this.onGameTime(e):this.state===c.GAME_TIME_B?this.onGameTime(e,i.Color.BLACK):this.state===c.GAME_TIME_W?this.onGameTime(e,i.Color.WHITE):this.state===c.GAME_POSITION?this.onGamePosition(e):this.state===c.PLAYING?this.onMove(e):e.match(/^LOGIN:.* OK$/)?this.onLoginOK():"LOGIN:incorrect"===e?this.onLoginIncorrect():"LOGOUT:completed"===e?this.onLogout():"BEGIN Game_Summary"===e?this.onBeginGameSummary():e.startsWith("REJECT:")?this.onReject():e.startsWith("START:")?this.onStart():this.logger.warn("sid=%d: unknown command received",this.sessionID))}onLoginOK(){this._loggedInMs=Date.now(),this.logger.info("sid=%d: login ok",this.sessionID),this._state=c.WAITING_GAME_SUMMARY}onLoginIncorrect(){this.onError(new Error(s.t.csaServerLoginDenied)),this.socket&&this.socket.end()}onLogout(){this.logger.info("sid=%d: logout",this.sessionID),this._state=c.WAITING_CLOSE}onBeginGameSummary(){this._state=c.GAME_SUMMARY,this.gameSummary=(0,n.emptyCSAGameSummary)()}onEndGameSummary(){const e=this.gameSummary.players.black.time,t=this.gameSummary.players.white.time;this.playerStates.black.time=e.totalTime+e.increment,this.playerStates.white.time=t.totalTime+t.increment;const o=(0,i.importCSA)(this.gameSummary.position);if(o instanceof Error)return this.onError(new Error("invalid game position received from CSA server")),void this.logout();for(const e of o.moves){if((0,i.isKnownSpecialMove)(e.move)&&e.move.type===i.SpecialMoveType.START)continue;const t=(0,i.reverseColor)(e.nextColor);this.updateTime(t,e.elapsedMs)}this._state=c.READY,this.gameSummaryCallback?.(this.gameSummary)}onGameSummary(e){switch(e){case"END Game_Summary":return void this.onEndGameSummary();case"BEGIN Time":return void(this._state=c.GAME_TIME);case"BEGIN Time+":return void(this._state=c.GAME_TIME_B);case"BEGIN Time-":return void(this._state=c.GAME_TIME_W);case"BEGIN Position":return void(this._state=c.GAME_POSITION)}const[t,o]=e.split(":",2);switch(t){case"Protocol_Version":case"Protocol_Mode":case"Format":case"Declaration":case"Rematch_On_Draw":case"Max_Moves":break;case"Game_ID":this.gameSummary.id=o;break;case"Name+":this.gameSummary.players.black.playerName=o;break;case"Name-":this.gameSummary.players.white.playerName=o;break;case"Your_Turn":this.gameSummary.myColor="+"===o?i.Color.BLACK:i.Color.WHITE;break;case"To_Move":this.gameSummary.toMove="+"===o?i.Color.BLACK:i.Color.WHITE;break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGameTime(e,t){switch(e){case"END Time":case"END Time+":case"END Time-":return void(this._state=c.GAME_SUMMARY)}const o=t?[this.gameSummary.players[t].time]:[this.gameSummary.players.black.time,this.gameSummary.players.white.time],[i,n]=e.split(":",2);switch(i){case"Least_Time_Per_Move":case"Time_Roundup":break;case"Time_Unit":for(const e of o)n.endsWith("msec")?e.timeUnitMs=Number(n.slice(0,-4)):n.endsWith("sec")?e.timeUnitMs=1e3*Number(n.slice(0,-3)):n.endsWith("min")&&(e.timeUnitMs=60*Number(n.slice(0,-3))*1e3);break;case"Total_Time":for(const e of o)e.totalTime=Number(n);break;case"Byoyomi":for(const e of o)e.byoyomi=Number(n);break;case"Delay":for(const e of o)e.delay=Number(n);break;case"Increment":for(const e of o)e.increment=Number(n);break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGamePosition(e){"END Position"!==e?this.gameSummary.position+=e+"\n":this._state=c.GAME_SUMMARY}onReject(){this._state=c.WAITING_GAME_SUMMARY,this.rejectCallback?.()}onStart(){this._state=c.PLAYING,this.startCallback?.(this.playerStates)}onMove(e){e.startsWith("+")?this.onMoveWithColor(e,i.Color.BLACK):e.startsWith("-")?this.onMoveWithColor(e,i.Color.WHITE):e.startsWith("#")?this.onEndingCommand(e):e.startsWith("%")||this.logger.warn("sid=%d: unknown move command received",this.sessionID)}onMoveWithColor(e,t){const o=/^.*,T([0-9]+)$/.exec(e);if(o){const e=Number(o[1]);this.updateTime(t,1e3*e)}else this.logger.error("sid=%d: invalid move format",this.sessionID);this.moveCallback?.(e,this.playerStates)}updateTime(e,t){const o=this.gameSummary.players[e].time,i=t/o.timeUnitMs,n=this.playerStates[e].time-i+o.increment;this.playerStates[e].time=Math.max(n,0)}onEndingCommand(e){switch(e){case"#RESIGN":this.specialMove=n.CSASpecialMove.RESIGN;break;case"#SENNICHITE":this.specialMove=n.CSASpecialMove.SENNICHITE;break;case"#OUTE_SENNICHITE":this.specialMove=n.CSASpecialMove.OUTE_SENNICHITE;break;case"#ILLEGAL_MOVE":this.specialMove=n.CSASpecialMove.ILLEGAL_MOVE;break;case"#ILLEGAL_ACTION":this.specialMove=n.CSASpecialMove.ILLEGAL_ACTION;break;case"#TIME_UP":this.specialMove=n.CSASpecialMove.TIME_UP;break;case"#JISHOGI":this.specialMove=n.CSASpecialMove.JISHOGI;break;case"#MAX_MOVES":this.specialMove=n.CSASpecialMove.MAX_MOVES;break;case"#WIN":this.onGameResult(n.CSAGameResult.WIN);break;case"#LOSE":this.onGameResult(n.CSAGameResult.LOSE);break;case"#DRAW":this.onGameResult(n.CSAGameResult.DRAW);break;case"#CENSORED":this.onGameResult(n.CSAGameResult.CENSORED);break;case"#CHUDAN":this.onGameResult(n.CSAGameResult.CHUDAN)}}onGameResult(e){this._state=c.WAITING_GAME_SUMMARY,this.gameResultCallback?.(this.specialMove,e)}invoke(e,t){switch(e){case l.CommandType.SEND:this.send(t);break;case l.CommandType.RECEIVE:this.onRead(t)}}setBlankLinePing(e){this.settings.blankLinePing&&(this.clearBlankLinePing(),this.blankLinePingTimeout=setTimeout((()=>{this.send("")}),1e3*(""===e?this.settings.blankLinePing.interval:this.settings.blankLinePing.initialDelay)))}clearBlankLinePing(){this.blankLinePingTimeout&&(clearTimeout(this.blankLinePingTimeout),this.blankLinePingTimeout=null)}updateCommendHistory(e){(0,l.addCommand)(this._commandHistory,e,100,10)}}},242:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setHandlers=function(e){if(a)throw new Error("handlers already set");a=e},t.login=function(e){const t=(r+=1,r),o=new n.Client(t,e,(0,i.getCSALogger)()).on("gameSummary",(e=>a.onCSAGameSummary(t,e))).on("reject",(()=>a.onCSAReject(t))).on("start",(e=>a.onCSAStart(t,e))).on("move",((e,o)=>a.onCSAMove(t,e,o))).on("gameResult",((e,o)=>a.onCSAGameResult(t,e,o))).on("close",(()=>{setTimeout((()=>{s.delete(t)}),1e4),a.onCSAClose(t)})).on("error",a.sendError).on("command",(e=>{a.sendPromptCommand(t,e)}));return s.set(t,o),o.login(),t},t.logout=function(e){s.get(e)?.logout()},t.agree=function(e,t){s.get(e)?.agree(t)},t.doMove=function(e,t,o,i){s.get(e)?.doMove(t,o,i)},t.resign=function(e){s.get(e)?.resign()},t.win=function(e){s.get(e)?.win()},t.stop=function(e){s.get(e)?.stop()},t.collectSessionStates=function(){return Array.from(s.entries()).map((([e,t])=>({sessionID:e,host:t.settings.host,port:t.settings.port,loginID:t.settings.id,protocolVersion:t.settings.protocolVersion,stateCode:t.state,lastReceived:t.lastReceived,lastSent:t.lastSent,createdMs:t.createdMs,loggedInMs:t.loggedInMs,updatedMs:Date.now(),closed:t.state===n.State.WAITING_CLOSE||t.state===n.State.CLOSED}))).sort(((e,t)=>t.sessionID-e.sessionID))},t.getCommandHistory=function(e){const t=s.get(e);if(t)return t.commandHistory;throw new Error(`session not found: ${e}`)},t.invokeCommand=function(e,t,o){s.get(e)?.invoke(t,o)};const i=o(1626),n=o(3995);let a;let r=0;const s=new Map},1869:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const n=i(o(9427)),a=o(7558);t.Socket=class{socket;readline;constructor(e,t,o,i={keepaliveInitialDelay:0}){this.socket=n.default.createConnection({port:t,host:e},o.onConnect).setKeepAlive(!0,1e3*i.keepaliveInitialDelay).on("error",o.onError).on("end",o.onFIN).on("close",(e=>{this.closeReadline(),o.onClose(e)})),this.readline=(0,a.createInterface)(this.socket),this.readline.on("line",o.onRead)}write(e){this.socket.write(e+"\n")}end(){this.socket.end()}closeReadline(){this.readline&&(this.readline.close(),this.readline=null)}}},3746:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.exists=async function(e){try{return await n.promises.lstat(e),!0}catch{return!1}},t.listFiles=async function e(t,o){const i=[],r=await n.promises.readdir(t);for(const s of r){const r=a.default.join(t,s),l=await n.promises.lstat(r);l.isFile()?i.push(r):o>0&&l.isDirectory()&&i.push(...await e(r,o-1))}return i};const n=o(9971),a=i(o(6743))},6801:(e,t,o)=>{function i(){return o(1288)}Object.defineProperty(t,"__esModule",{value:!0}),t.requireElectron=i,t.getElectron=function(){try{return i()}catch{return null}}},1626:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.openLogsDirectory=function(){(0,p.requireElectron)().shell.openPath(h)},t.setLogDestinations=function(e,t,o){I[e]=t.map((t=>"file"===t?e:t)),T[e]=o},t.getAppLogger=function(){return C(m.LogType.APP)},t.getUSILogger=function(){return C(m.LogType.USI)},t.getCSALogger=function(){return C(m.LogType.CSA)},t.shutdownLoggers=function(){c.shutdown((e=>{console.error("failed to shutdown loggers:",e)}))},t.openLogFile=function(e){(0,p.requireElectron)().shell.openPath(b(e))},t.getTailCommand=A,t.tailLogFile=function(e){const t=A(e).replaceAll('"','\\"');switch(process.platform){case"win32":l.default.spawn("powershell.exe",["-Command",`start-process powershell '-NoExit','-Command "${t}"'`]);break;case"darwin":l.default.spawn("osascript",["-e",`tell app "Terminal" to do script "${t}"`,"-e",'tell app "Terminal" to activate'])}};const s=r(o(6743)),l=r(o(636)),c=a(o(983)),d=o(5746),u=o(3974),m=o(1219),p=o(6801),h=(0,u.getAppPath)("logs");const g=(0,d.getDateTimeString)().replaceAll(" ","_").replaceAll("/","").replaceAll(":",""),S=s.default.join(h,`app-${g}.log`),f=s.default.join(h,`usi-${g}.log`),y=s.default.join(h,`csa-${g}.log`),v={appenders:{stdout:{type:"stdout"},recording:{type:"recording"}},categories:{default:{appenders:["stdout"],level:"info"}}};function b(e){switch(e){case m.LogType.APP:return S;case m.LogType.USI:return f;case m.LogType.CSA:return y}}const I={[m.LogType.APP]:["stdout"],[m.LogType.USI]:["stdout"],[m.LogType.CSA]:["stdout"]},T={[m.LogType.APP]:m.LogLevel.INFO,[m.LogType.USI]:m.LogLevel.INFO,[m.LogType.CSA]:m.LogLevel.INFO};const E={};function C(e){if(E[e])return E[e];v.appenders[e]||(v.appenders[e]={type:"file",filename:b(e)},v.categories[e]={appenders:I[e],level:T[e]});const t=c.configure(v).getLogger(e);return E[e]=t,t}function A(e){const t=b(e);return"win32"===process.platform?`Get-Content -Path "${t}" -Wait -Tail 10`:`tail -f "${t}"`}},3974:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isDevelopment=l,t.isPreview=c,t.isTest=d,t.isProduction=u,t.isPortable=function(){return void 0!==process.env.PORTABLE_EXECUTABLE_DIR},t.getPortableExeDir=function(){return process.env.PORTABLE_EXECUTABLE_DIR},t.getTempPathForTesting=p,t.getAppPath=function(e){0;const t=(0,s.getElectron)()?.app;if(t)return t.getPath(e);switch(e){case"logs":return r.default.join(process.cwd(),"logs");case"exe":return process.argv[1];default:return process.cwd()}},t.getPreloadPath=function(){return u()?"./preload.js":"../../../packed/preload.js"};const n=i(o(9971)),a=i(o(1258)),r=i(o(6743)),s=o(6801);function l(){return"electron:serve"===process.env.npm_lifecycle_event&&!0}function c(){return"electron:preview"===process.env.npm_lifecycle_event}function d(){return!1}function u(){return!l()&&!c()&&!0}let m;function p(){return m||(m=n.default.mkdtempSync(r.default.join(a.default.tmpdir(),"electron-shogi-test-"))),m}},2992:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EngineProcess=t.State=t.GameResult=void 0;const i=o(2040),n=o(7187),a=o(6797),r=o(9169);var s,l;function c(e){switch(e){case"+":case"+0":case"0":return+n.SCORE_MATE_INFINITE;case"-":case"-0":return-n.SCORE_MATE_INFINITE;default:return Number(e)}}function d(e){const t={},o=e.split(" ");for(let i=0;i<e.length;i+=1)switch(o[i]){case"depth":t.depth=Number(o[i+1]),i+=1;break;case"seldepth":t.seldepth=Number(o[i+1]),i+=1;break;case"time":t.timeMs=Number(o[i+1]),i+=1;break;case"nodes":t.nodes=Number(o[i+1]),i+=1;break;case"pv":t.pv=o.slice(i+1),i=o.length;break;case"multipv":t.multipv=Number(o[i+1]),i+=1;break;case"score":switch(o[i+1]){case"cp":t.scoreCP=Number(o[i+2]),i+=2;break;case"mate":t.scoreMate=c(o[i+2]),i+=2}break;case"lowerbound":t.lowerbound=!0;break;case"upperbound":t.upperbound=!0;break;case"currmove":t.currmove=o[i+1],i+=1;break;case"hashfull":t.hashfullPerMill=Number(o[i+1]),i+=1;break;case"nps":t.nps=Number(o[i+1]),i+=1;break;case"string":t.string=o.slice(i+1).join(" "),i=o.length}return t}function u(e){return e?`btime ${e.btime} wtime ${e.wtime} `+(0!==e.binc||0!==e.winc?`binc ${e.binc} winc ${e.winc}`:`byoyomi ${e.byoyomi}`):"infinite"}!function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(s||(t.GameResult=s={})),function(e){e.WaitingForUSIOK="waitingForUSIOK",e.NotReady="notReady",e.WaitingForReadyOK="waitingForReadyOK",e.Ready="ready",e.WaitingForBestMove="waitingForBestMove",e.Ponder="ponder",e.WaitingForPonderBestMove="waitingForPonderBestMove",e.WaitingForCheckmate="waitingForCheckmate",e.WillQuit="willQuit"}(l||(t.State=l={}));t.EngineProcess=class{_path;sessionID;logger;option;process=null;_name="NO NAME";_author="";_engineOptions={};_state=l.WaitingForUSIOK;_currentPosition="";invalidBestMoveCount=0;reservedGoCommand;launchTimeout;quitTimeout;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};timeoutCallback;errorCallback;usiOkCallback;readyCallback;bestMoveCallback;checkmateCallback;checkmateNotImplementedCallback;checkmateTimeoutCallback;noMateCallback;infoCallback;ponderInfoCallback;commandCallback;constructor(e,t,o,i){this._path=e,this.sessionID=t,this.logger=o,this.option=i}get path(){return this._path}get name(){return this._name}get author(){return this._author}get engineOptions(){return this._engineOptions}get state(){return this._state}get currentPosition(){return this._currentPosition}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get pid(){return this.process?.pid}on(e,t){switch(e){case"timeout":this.timeoutCallback=t;break;case"error":this.errorCallback=t;break;case"usiok":this.usiOkCallback=t;break;case"ready":this.readyCallback=t;break;case"bestmove":this.bestMoveCallback=t;break;case"checkmate":this.checkmateCallback=t;break;case"checkmateNotImplemented":this.checkmateNotImplementedCallback=t;break;case"checkmateTimeout":this.checkmateTimeoutCallback=t;break;case"noMate":this.noMateCallback=t;break;case"info":this.infoCallback=t;break;case"ponderInfo":this.ponderInfoCallback=t;break;case"command":this.commandCallback=t}return this}launch(){this.logger.info("sid=%d: launch: %s",this.sessionID,this.path),this.setLaunchTimeout(),this.process=new a.ChildProcess(this.path),this.process.on("error",this.onError.bind(this)),this.process.on("close",this.onClose.bind(this)),this.process.on("receive",this.onReceive.bind(this)),this.send("usi")}quit(){this.state!==l.WillQuit&&(this._state=l.WillQuit,this.clearLaunchTimeout(),this.logger.info("sid=%d: quit USI engine",this.sessionID),this.process&&(this.setQuitTimeout(),this.send("quit")))}setOption(e,t){void 0!==t?this.send(`setoption name ${e} value ${t}`):this.send(`setoption name ${e}`)}ready(){if(this.state!==l.WaitingForReadyOK){if(this.state!==l.Ready&&this.state!==l.WaitingForBestMove&&this.state!==l.Ponder&&this.state!==l.WaitingForPonderBestMove&&this.state!==l.WaitingForCheckmate||this.gameover(s.DRAW),this.state!==l.NotReady)return this.logger.warn("sid=%d: ready: unexpected state: %s",this.sessionID,this.state),new Error("unexpected state");this.send("isready"),this._state=l.WaitingForReadyOK}}go(e,t){switch(this.reservedGoCommand={position:e,timeState:t},this.state){case l.Ready:this.sendReservedGoCommands();break;case l.WaitingForBestMove:case l.Ponder:case l.WaitingForCheckmate:this.stop()}}goPonder(e,t){this.state===l.Ready?(this.reservedGoCommand={position:e,timeState:this.option.enableEarlyPonder?void 0:t,ponder:!0},this.sendReservedGoCommands()):this.logger.warn("sid=%d: goPonder: unexpected state: %s",this.sessionID,this.state)}goMate(e){this.state===l.Ready?(this.reservedGoCommand={position:e,mate:!0},this.sendReservedGoCommands()):this.logger.warn("sid=%d: goMate: unexpected state: %s",this.sessionID,this.state)}ponderHit(e){this.state===l.Ponder?(this.option.enableEarlyPonder?this.send("ponderhit "+u(e)):this.send("ponderhit"),this._state=l.WaitingForBestMove):this.logger.warn("sid=%d: ponderHit: unexpected state: %s",this.sessionID,this.state)}stop(){this.state===l.WaitingForBestMove||this.state===l.Ponder||this.state===l.WaitingForCheckmate?"stop"!==this.lastSent?.command&&(this.send("stop"),this.state===l.Ponder&&(this._state=l.WaitingForPonderBestMove)):this.logger.warn("sid=%d: stop: unexpected state: %s",this.sessionID,this.state)}gameover(e){switch(this.state){case l.WaitingForUSIOK:case l.NotReady:case l.WaitingForReadyOK:case l.WillQuit:return void this.logger.warn("sid=%d: gameover: unexpected state: %s",this.sessionID,this.state);case l.WaitingForBestMove:case l.Ponder:this.stop(),this.invalidBestMoveCount++;break;case l.WaitingForPonderBestMove:this.invalidBestMoveCount++;break;case l.WaitingForCheckmate:this.stop();case l.Ready:}this.send("gameover "+e),this._state=l.NotReady,this.reservedGoCommand=void 0}setLaunchTimeout(){this.launchTimeout=setTimeout((()=>{this.timeoutCallback?.(),this.quit()}),this.option.timeout||1e4)}clearLaunchTimeout(){this.launchTimeout&&(clearTimeout(this.launchTimeout),this.launchTimeout=void 0)}setQuitTimeout(){this.quitTimeout=setTimeout((()=>{this.process&&(this.process.kill(),this.process=null)}),5e3)}clearQuitTimeout(){this.quitTimeout&&(clearTimeout(this.quitTimeout),this.quitTimeout=void 0)}onError(e){this.errorCallback?.(e),this.quit()}onClose(e,t){this.logger.info("sid=%d: engine process closed: close=%s signal=%s",this.sessionID,e,t),this.state!==l.WillQuit&&this.errorCallback?.(new Error("closed unexpectedly")),this.clearLaunchTimeout(),this.clearQuitTimeout(),this.process=null;const o=(0,r.newCommand)(r.CommandType.SYSTEM,`closed: close=${e} signal=${t}`);this.updateCommendHistory(o),this.commandCallback?.(o)}sendReservedGoCommands(){if(!this.reservedGoCommand)return;this.send(this.reservedGoCommand.position);let e="",t="";var o;this.reservedGoCommand.ponder?(e="ponder",t=(o=this.reservedGoCommand.timeState)?u(o):""):this.reservedGoCommand.mate?(e="mate",t=u(this.reservedGoCommand.timeState)):t=u(this.reservedGoCommand.timeState),this.send("go"+(e?" "+e:"")+(t?" "+t:"")),this._currentPosition=this.reservedGoCommand.position,this._state=this.reservedGoCommand.ponder?l.Ponder:this.reservedGoCommand.mate?l.WaitingForCheckmate:l.WaitingForBestMove,this.reservedGoCommand=void 0}send(e){this.process&&(this.process.send(e),this._lastSent=(0,r.newCommand)(r.CommandType.SEND,e),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,e))}onReceive(e){this._lastReceived=(0,r.newCommand)(r.CommandType.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),this.state!==l.WillQuit&&(e.startsWith("id name ")?this.onIDName(e.substring(8)):e.startsWith("id author ")?this.onIDAuthor(e.substring(10)):e.startsWith("option ")?this.onOption(e.substring(7)):"usiok"===e?this.onUSIOk():"readyok"===e?this.onReadyOk():e.startsWith("bestmove ")?this.onBestMove(e.substring(9)):e.startsWith("checkmate ")?this.onCheckmate(e.substring(10)):e.startsWith("info ")&&this.onInfo(e.substring(5)))}onIDName(e){this._name=e}onIDAuthor(e){this._author=e}onOption(e){const t=e.split(" ");if(t.length<4||"name"!==t[0]||"type"!==t[2])return void this.logger.error("sid=%d: invalid option command",this.sessionID);const o=t[1],i=t[3],n=100+Object.keys(this._engineOptions).length,a="combo"===i?{name:o,type:i,order:n,vars:[]}:{name:o,type:i,order:n};if("button"!==a.type)for(let e=4;e+1<t.length;e+=2)switch(t[e]){case"default":a.default="spin"===a.type?Number(t[e+1]):t[e+1];break;case"min":"spin"===a.type&&(a.min=Number(t[e+1]));break;case"max":"spin"===a.type&&(a.max=Number(t[e+1]));break;case"var":"combo"===a.type&&a.vars.push(t[e+1])}this._engineOptions[a.name]=a}onUSIOk(){this.state===l.WaitingForUSIOK?(this.engineOptions[i.USIHash]||(this._engineOptions[i.USIHash]={name:i.USIHash,type:"spin",order:1,default:32}),this.engineOptions[i.USIPonder]||(this._engineOptions[i.USIPonder]={name:i.USIPonder,type:"check",order:2,default:"true"}),this.option.engineOptions&&this.option.engineOptions.forEach((e=>{const t=(0,i.getUSIEngineOptionCurrentValue)(e);void 0!==t&&this.setOption(e.name,t)})),this.clearLaunchTimeout(),this._state=l.NotReady,this.usiOkCallback?.()):this.logger.warn("sid=%d: onUSIOk: unexpected state: %s",this.sessionID,this.state)}onReadyOk(){this.state===l.WaitingForReadyOK?(this._state=l.Ready,this.readyCallback?.(),this.send("usinewgame"),this.sendReservedGoCommands()):this.logger.warn("sid=%d: onReadyOk: unexpected state: %s",this.sessionID,this.state)}onBestMove(e){if(this.invalidBestMoveCount>0)return this.invalidBestMoveCount--,void this.logger.warn("sid=%d: onBestMove: ignore bestmove: %s",this.sessionID,e);if(this.state===l.WaitingForBestMove||this.state===l.WaitingForPonderBestMove){if(this.bestMoveCallback&&this.state===l.WaitingForBestMove){const t=e.split(" "),o=t[0],i=t.length>=3&&"ponder"===t[1]&&t[2]||void 0;this.bestMoveCallback(this.currentPosition,o,i)}this._state=l.Ready,this._currentPosition="",this.sendReservedGoCommands()}else this.logger.warn("sid=%d: onBestMove: unexpected state: %s",this.sessionID,this.state)}onCheckmate(e){this.state===l.WaitingForCheckmate?(this._state=l.Ready,"notimplemented"!==e.trim()?"timeout"!==e.trim()?"nomate"!==e.trim()?this.checkmateCallback?.(this.currentPosition,e.trim().split(" ")):this.noMateCallback?.(this.currentPosition):this.checkmateTimeoutCallback?.(this.currentPosition):this.checkmateNotImplementedCallback?.()):this.logger.warn("sid=%d: onCheckmate: unexpected state: %s",this.sessionID,this.state)}onInfo(e){switch(this.state){case l.WaitingForBestMove:case l.WaitingForCheckmate:this.infoCallback?.(this.currentPosition,d(e));break;case l.Ponder:case l.WaitingForPonderBestMove:this.ponderInfoCallback?.(this.currentPosition,d(e))}}invoke(e,t){switch(e){case r.CommandType.SEND:this.send(t);break;case r.CommandType.RECEIVE:this.onReceive(t)}}updateCommendHistory(e){(0,r.addCommand)(this._commandHistory,e,100,10)}}},9336:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.setHandlers=function(e){if(h)throw new Error("handlers already set");h=e},t.getUSIEngineInfo=function(e,t){const o=f();return new Promise(((i,n)=>{const a=new s.EngineProcess((0,u.resolveEnginePath)(e),o,(0,m.getUSILogger)(),{timeout:1e3*t}).on("error",n).on("timeout",(()=>n(g(t)))).on("usiok",(()=>{i({...(0,r.emptyUSIEngine)(),uri:l.issueEngineURI(),name:a.name,defaultName:a.name,author:a.author,path:e,options:a.engineOptions}),a.quit()})).on("command",(e=>{h.sendPromptCommand(o,e)}));a.launch()}))},t.sendSetOptionCommand=function(e,t,o){const i=f();return new Promise(((n,a)=>{const r=new s.EngineProcess((0,u.resolveEnginePath)(e),i,(0,m.getUSILogger)(),{timeout:1e3*o}).on("error",a).on("timeout",(()=>{a(g(o))})).on("usiok",(()=>{r.setOption(t),n(),r.quit()})).on("command",(e=>{h.sendPromptCommand(i,e)}));r.launch()}))},t.setupPlayer=function(e,t){const o=f(),i=new s.EngineProcess((0,u.resolveEnginePath)(e.path),o,(0,m.getUSILogger)(),{timeout:1e3*t,engineOptions:Object.values(e.options),enableEarlyPonder:e.enableEarlyPonder});return y.set(o,{process:i,engine:e,createdMs:Date.now()}),new Promise(((e,n)=>{i.on("error",n).on("timeout",(()=>n(g(t)))).on("bestmove",((e,t,i)=>h.onUSIBestMove(o,e,t,i))).on("checkmate",((e,t)=>{h.onUSICheckmate(o,e,t)})).on("checkmateNotImplemented",(()=>{h.onUSICheckmateNotImplemented(o)})).on("checkmateTimeout",(e=>{h.onUSICheckmateTimeout(o,e)})).on("noMate",(e=>{h.onUSINoMate(o,e)})).on("usiok",(()=>e(o))).on("command",(e=>{h.sendPromptCommand(o,e)})),i.launch()}))},t.ready=function(e){const t=v(e);return new Promise(((e,o)=>{t.process.on("ready",e).on("error",o);const i=t.process.ready();i&&o(i)}))},t.go=function(e,t,o){const i=v(e),n=(0,p.getNextColorFromUSI)(t);i.process.go(t,b(n,o)),i.process.on("info",((t,o)=>h.onUSIInfo(e,t,o)))},t.goPonder=function(e,t,o){const i=v(e),n=(0,p.getNextColorFromUSI)(t);i.process.goPonder(t,b(n,o)),i.process.on("ponderInfo",((t,o)=>{h.onUSIPonderInfo(e,t,o)}))},t.goInfinite=function(e,t){const o=v(e);o.process.go(t),o.process.on("info",((t,o)=>h.onUSIInfo(e,t,o)))},t.goMate=function(e,t){const o=v(e);o.process.goMate(t),o.process.on("info",((t,o)=>h.onUSIInfo(e,t,o)))},t.ponderHit=function(e,t){const o=v(e),i=(0,p.getNextColorFromUSI)(o.process.currentPosition);o.process.ponderHit(b(i,t))},t.stop=function(e){v(e).process.stop()},t.gameover=function(e,t){const o=v(e);switch(t){case c.GameResult.WIN:o.process.gameover(s.GameResult.WIN);break;case c.GameResult.LOSE:o.process.gameover(s.GameResult.LOSE);break;case c.GameResult.DRAW:o.process.gameover(s.GameResult.DRAW)}},t.quit=function(e){if(!function(e){return y.has(e)}(e))return;v(e).process.quit(),setTimeout((()=>{y.delete(e)}),1e4)},t.quitAll=function(){y.forEach((e=>{e.process.quit()})),y.clear()},t.collectSessionStates=function(){return Array.from(y.entries()).map((([e,t])=>({sessionID:e,uri:t.engine.uri,name:t.engine.name,path:t.engine.path,pid:t.process.pid,stateCode:t.process.state,createdMs:t.createdMs,lastReceived:t.process.lastReceived,lastSent:t.process.lastSent,updatedMs:Date.now(),closed:t.process.state===s.State.WillQuit}))).sort(((e,t)=>t.sessionID-e.sessionID))},t.getCommandHistory=function(e){return v(e).process.commandHistory},t.invokeCommand=function(e,t,o){v(e).process.invoke(t,o)};const r=o(2040),s=o(2992),l=a(o(7367)),c=o(3695),d=o(8474),u=o(9249),m=o(1626),p=o(3113);let h;function g(e){return new Error(d.t.noResponseFromEnginePleaseExtendTimeout(e))}let S=0;function f(){return S+=1,S}const y=new Map;function v(e){const t=y.get(e);if(!t)throw new Error("No engine session: SessionID="+e);return t}function b(e,t){const o=t.black,i=t.white,n=t[e].byoyomi;return{btime:o.timeMs-1e3*o.increment,wtime:i.timeMs-1e3*i.increment,byoyomi:1e3*n,binc:0===n?1e3*o.increment:0,winc:0===n?1e3*i.increment:0}}},9249:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveEnginePath=function(e){const t=(0,a.getPortableExeDir)();if(t)return n.default.resolve(t,e);return e},t.getRelativeEnginePath=function(e){const t=(0,a.getPortableExeDir)();if(t){const o=n.default.relative(t,e);if(!o.startsWith(".."))return o}return e};const n=i(o(6743)),a=o(3974)},6797:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ChildProcess=void 0;const n=o(636),a=o(7558),r=i(o(6743)),s="win32"===process.platform;t.ChildProcess=class{handle;readline=null;constructor(e){const t={cwd:r.default.dirname(e)};s&&(e.endsWith(".bat")||e.endsWith(".cmd"))?this.handle=(0,n.spawn)("cmd.exe",["/c",e],t):this.handle=(0,n.spawn)(e,t),this.handle.on("close",this.onClose.bind(this))}get pid(){return this.handle.pid}on(e,t){switch(e){case"receive":null===this.readline&&(this.readline=(0,a.createInterface)(this.handle.stdout)),this.readline.on("line",t);break;case"close":this.handle.on("close",((e,o)=>{this.onClose(),t(e,o)}));break;default:this.handle.on(e,t)}return this}send(e){this.handle.stdin.write(e+"\n")}kill(){this.onClose(),this.handle.kill()}onClose(){null!==this.readline&&this.readline.close()}}},4659:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentsParser=void 0;t.ArgumentsParser=class{valueKeys=[];stringRestrictions=new Map;numberKeys=[];numberRestrictions=new Map;flagKeys=[];values=new Map;numbers=new Map;flags=new Map;bareArgs=[];help;constructor(e,t){"string"==typeof t&&(t=[t]),this.help="Usage:\n";for(const o of t||[""])this.help+=` ${e} [options] ${o}\n`;this.help+="\nOptions:\n"}value(e,t,o,i){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.valueKeys.push(n),i&&this.stringRestrictions.set(n,i),()=>{const e=this.values.get(n);return void 0!==e?e:o}}valueOrNull(e,t,o){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.valueKeys.push(i),o&&this.stringRestrictions.set(i,o),()=>{const e=this.values.get(i);return void 0!==e?e:null}}number(e,t,o,i){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.numberKeys.push(n),i&&this.numberRestrictions.set(n,i),()=>{const e=this.numbers.get(n);return void 0!==e?e:o}}numberOrNull(e,t,o){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.numberKeys.push(i),o&&this.numberRestrictions.set(i,o),()=>{const e=this.numbers.get(i);return void 0!==e?e:null}}flag(e,t){const o="--"+e;return this.help+=` ${o}\n`,this.help+=` ${t}\n`,this.flagKeys.push(o),()=>this.flags.get(o)||!1}parse(){let e=0;for(let t=2;t<process.argv.length;t++){const o=process.argv[t];if(t===e)this.bareArgs.push(o);else if(this.valueKeys.includes(o)){const e=process.argv[++t],i=this.stringRestrictions.get(o);i&&(i.includes(e)||this.onError(`${o} option must be one of: ${i.join(", ")}`)),this.values.set(o,e)}else if(this.numberKeys.includes(o)){const e=Number(process.argv[++t]);Number.isNaN(e)&&this.onError(`${o} option must be a number: ${process.argv[t]}`);const i=this.numberRestrictions.get(o);i?.min&&e<i.min&&this.onError(`${o} option must be greater than or equal to ${i.min}`),i?.max&&e>i.max&&this.onError(`${o} option must be less than or equal to ${i.max}`),this.numbers.set(o,e)}else this.flagKeys.includes(o)?this.flags.set(o,!0):"--"===o?e=t+1:"--help"===o?(this.showHelp(),process.exit(0)):o.startsWith("-")?this.onError(`Unknown option: ${o}`):this.bareArgs.push(o)}}get args(){return this.bareArgs}showHelp(){console.log(this.help)}onError(e){console.error(e),process.exit(1)}}},2526:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.preload=function(e){(0,s.setLanguage)(e.language);const t=e.stdoutLog?["file","stdout"]:["file"],l=e.appLogFile?t:["stdout"],c=e.usiLogFile?t:["stdout"],d=e.csaLogFile?t:["stdout"];(0,i.setLogDestinations)(r.LogType.APP,l,e.logLevel),(0,i.setLogDestinations)(r.LogType.USI,c,e.logLevel),(0,i.setLogDestinations)(r.LogType.CSA,d,e.logLevel);const u={updateAppState(){},onClosable(){},onClose(){},onSendError(){},onMenuEvent(){},async loadAppSettings(){throw new Error("This feature is not available on command line tool")},async saveAppSettings(){throw new Error("This feature is not available on command line tool")},async loadBatchConversionSettings(){throw new Error("This feature is not available on command line tool")},async saveBatchConversionSettings(){throw new Error("This feature is not available on command line tool")},async loadResearchSettings(){throw new Error("This feature is not available on command line tool")},async saveResearchSettings(){throw new Error("This feature is not available on command line tool")},async loadAnalysisSettings(){throw new Error("This feature is not available on command line tool")},async saveAnalysisSettings(){throw new Error("This feature is not available on command line tool")},async loadGameSettings(){throw new Error("This feature is not available on command line tool")},async saveGameSettings(){throw new Error("This feature is not available on command line tool")},async loadCSAGameSettingsHistory(){throw new Error("This feature is not available on command line tool")},async saveCSAGameSettingsHistory(){throw new Error("This feature is not available on command line tool")},async loadMateSearchSettings(){throw new Error("This feature is not available on command line tool")},async saveMateSearchSettings(){throw new Error("This feature is not available on command line tool")},async loadUSIEngines(){throw new Error("This feature is not available on command line tool")},async saveUSIEngines(){},onUpdateAppSettings(){},fetchInitialRecordFileRequest:async()=>"null",async showOpenRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveMergedRecordDialog(){throw new Error("This feature is not available on command line tool")},async openRecord(){throw new Error("This feature is not available on command line tool")},async saveRecord(){throw new Error("This feature is not available on command line tool")},async loadRecordFileHistory(){throw new Error("This feature is not available on command line tool")},addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error("This feature is not available on command line tool")},async loadRemoteRecordFile(){throw new Error("This feature is not available on command line tool")},async convertRecordFiles(){throw new Error("This feature is not available on command line tool")},onOpenRecord(){},async showSelectUSIEngineDialog(){throw new Error("This feature is not available on command line tool")},async getUSIEngineInfo(){throw new Error("This feature is not available on command line tool")},async sendUSISetOption(){},async usiLaunch(e,t){const o=JSON.parse(e);return await(0,a.setupPlayer)(o,t)},usiReady:async e=>await(0,a.ready)(e),async usiGo(e,t,o){(0,a.go)(e,t,JSON.parse(o))},async usiGoPonder(e,t,o){(0,a.goPonder)(e,t,JSON.parse(o))},async usiPonderHit(e,t){(0,a.ponderHit)(e,JSON.parse(t))},async usiGoInfinite(e,t){(0,a.goInfinite)(e,t)},async usiGoMate(e,t){(0,a.goMate)(e,t)},async usiStop(e){(0,a.stop)(e)},async usiGameover(e,t){(0,a.gameover)(e,t)},async usiQuit(e){(0,a.quit)(e)},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},onUSIPonderInfo(){},csaLogin:async e=>(0,n.login)(JSON.parse(e)),async csaLogout(e){(0,n.logout)(e)},async csaAgree(e,t){(0,n.agree)(e,t)},async csaMove(e,t,o,i){(0,n.doMove)(e,t,o,i)},async csaResign(e){(0,n.resign)(e)},async csaWin(e){(0,n.win)(e)},async csaStop(e){(0,n.stop)(e)},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},async collectSessionStates(){throw new Error("This feature is not available on command line tool")},async setupPrompt(){throw new Error("This feature is not available on command line tool")},async openPrompt(){throw new Error("This feature is not available on command line tool")},invokePromptCommand(){throw new Error("This feature is not available on command line tool")},onPromptCommand(){},async showSelectImageDialog(){throw new Error("This feature is not available on command line tool")},async cropPieceImage(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsPNG(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsJPEG(){throw new Error("This feature is not available on command line tool")},async loadLayoutProfileList(){throw new Error("This feature is not available on command line tool")},updateLayoutProfileList(){},onUpdateLayoutProfileList(){},openLogFile(){},log(e,t){switch(e){case r.LogLevel.DEBUG:console.debug(t);break;case r.LogLevel.INFO:console.log(t);break;case r.LogLevel.WARN:console.warn(t);break;case r.LogLevel.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error("This feature is not available on command line tool")},async showSelectDirectoryDialog(){throw new Error("This feature is not available on command line tool")},openExplorer(){throw new Error("This feature is not available on command line tool")},openWebBrowser(){throw new Error("This feature is not available on command line tool")},isEncryptionAvailable:async()=>!1,async getVersionStatus(){throw new Error("This feature is not available on command line tool")},sendTestNotification(){throw new Error("This feature is not available on command line tool")}};global.window={...global,electronShogiAPI:u};const m=o(7769);(0,a.setHandlers)({onUSIBestMove:m.onUSIBestMove,onUSICheckmate:m.onUSICheckmate,onUSICheckmateNotImplemented:m.onUSICheckmateNotImplemented,onUSICheckmateTimeout:m.onUSICheckmateTimeout,onUSINoMate:m.onUSINoMate,onUSIInfo:m.onUSIInfo,onUSIPonderInfo:m.onUSIPonderInfo,sendPromptCommand:()=>{}});const p=o(7076);(0,n.setHandlers)({onCSAGameSummary:p.onCSAGameSummary,onCSAReject:p.onCSAReject,onCSAStart:p.onCSAStart,onCSAMove:p.onCSAMove,onCSAGameResult:p.onCSAGameResult,onCSAClose:p.onCSAClose,sendPromptCommand:()=>{},sendError:e=>{(0,i.getAppLogger)().error(e)}}),process.on("uncaughtException",((e,t)=>{(0,i.getAppLogger)().error(new Error(`${t} ${e}`))}))};const i=o(1626),n=o(242),a=o(9336),r=o(1219),s=o(8474)},3965:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=o(4659),a=o(1219),r=o(8474),s=new n.ArgumentsParser("usi-csa-bridge",["path/to/csa_game_config.yaml","path/to/csa_game_config.json","--base64 <base64>"]),l=s.valueOrNull("base64","Base64 of gzip compressed JSON config."),c=s.number("engine-timeout","Maximum time[seconds] of USI engine execution.",180,{min:1}),d=s.valueOrNull("protocol-version","Overwrite server.protocolVersion setting."),u=s.valueOrNull("host","Overwrite server.host setting."),m=s.numberOrNull("port","Overwrite server.port setting.",{min:1024,max:49151}),p=s.valueOrNull("id","Overwrite server.id setting."),h=s.valueOrNull("password","Overwrite server.password setting."),g=s.flag("save-record","Save record file after game end."),S=s.value("record-dir","Directory to save records.","records"),f=s.valueOrNull("record-file-name-template","Overwrite recordFileNameTemplate setting."),y=s.valueOrNull("record-file-format","Overwrite recordFileFormat setting."),v=s.value("return-code","Return code which one of LF or CRLF. It is used for record file.","win32"===process.platform?"CRLF":"LF",["LF","CRLF"]),b=s.flag("csa-v3","Use CSA V3 format for record file."),I=s.numberOrNull("repeat","Overwrite repeat setting.",{min:1}),T=s.flag("app-log-file","Enable application log file."),E=s.flag("usi-log-file","Enable USI log file."),C=s.flag("csa-log-file","Enable CSA log file."),A=s.flag("all-log-file","Enable all log files."),P=s.flag("disable-stdout-log","Disable stdout log. Should be used with --XXX-log-file."),M=s.value("log-level",`Log level which one of: ${Object.values(a.LogLevel).join(", ")}`,a.LogLevel.INFO,[a.LogLevel.DEBUG,a.LogLevel.INFO,a.LogLevel.WARN,a.LogLevel.ERROR]),R=s.value("lang",`Language which one of: ${Object.values(r.Language).join(", ")}`,r.Language.JA,[r.Language.JA,r.Language.EN,r.Language.ZH_TW]);s.parse();(0,o(2526).preload)({appLogFile:T()||A(),usiLogFile:E()||A(),csaLogFile:C()||A(),stdoutLog:!P(),logLevel:M(),language:R()});const w=i(o(9971)),N=i(o(6743)),O=i(o(913)),_=o(3010),L=o(6255),k=o(7872),F=o(7076),D=o(3101),G=o(1626),U=o(8574),B=o(6059),H=o(9006),W=o(3746);!async function(){const e=s.args[0];let t;const o=l();if(o?t=await(0,_.decompressCSAGameSettingsForCLI)(o):(e||((0,G.getAppLogger)().error("config file is not specified."),s.showHelp(),process.exit(1)),t=e.endsWith(".json")?JSON.parse(w.default.readFileSync(e,"utf-8")):O.default.parse(w.default.readFileSync(e,"utf-8"))),t.server.protocolVersion=d()||t.server.protocolVersion,t.server.host=u()||t.server.host,t.server.port=m()||t.server.port,t.server.id=p()||t.server.id,t.server.password=h()||t.server.password,t.saveRecordFile=g()||t.saveRecordFile,t.repeat=I()||t.repeat,e&&!await(0,W.exists)(t.usi.path)){const o=N.default.resolve(N.default.dirname(e),t.usi.path);await(0,W.exists)(o)||((0,G.getAppLogger)().error(`usi engine is not found: ${t.usi.path}`),process.exit(1)),t.usi.path=o}const i=(0,_.importCSAGameSettingsForCLI)(t),n=(0,_.validateCSAGameSettings)(i);n&&((0,G.getAppLogger)().error(n),process.exit(1));const a=new k.RecordManager,r=new L.Clock,T=new L.Clock,E=new F.CSAGameManager(a,r,T),C=(0,D.defaultPlayerBuilder)(c());E.on("gameNext",(function(){(0,G.getAppLogger)().info("waiting for new game...")})).on("newGame",(function(e){(0,G.getAppLogger)().info(`${(0,H.ordinal)(e)} game started.`)})).on("gameEnd",(function(){(0,G.getAppLogger)().info("completed. will exit after some seconds...")})).on("saveRecord",(function(){const e=(0,U.generateRecordFileName)(a.record.metadata,f()||t.recordFileNameTemplate||U.defaultRecordFileNameTemplate,y()||t.recordFileFormat||B.RecordFileFormat.KIF),o=S(),i=N.default.join(o,e);w.default.promises.mkdir(o,{recursive:!0}).then((()=>{const e=a.exportRecordAsBuffer(i,{returnCode:A,csa:{v3:b()}});if(!(e instanceof Error))return w.default.promises.writeFile(i,e.data);(0,G.getAppLogger)().error(e)})).then((()=>{(0,G.getAppLogger)().info("record saved: %s",i)})).catch((e=>{(0,G.getAppLogger)().error(e)}))})).on("loginRetry",(function(){(0,G.getAppLogger)().warn(`Retry login after ${F.loginRetryIntervalSeconds} seconds...`)})).on("error",(function(e){(0,G.getAppLogger)().error(e)})).login(i,C).catch((function(e){(0,G.getAppLogger)().error(e),process.exit(1)}));const A="CRLF"===v()?"\r\n":"\n"}()},9169:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommandType=void 0,t.newCommand=function(e,t){const o=new Date;return{type:e,command:t,dateTime:(0,i.getDateTimeStringMs)(o),timeMs:o.getTime()}},t.addCommand=function(e,t,o,i){Array.isArray(t)||(t=[t]);for(const o of t)e.commands.push(o);if(e.commands.length>o){const t=Math.max(i,e.commands.length-o);e.discarded+=t,e.commands.splice(0,t)}};const i=o(5746);var n;!function(e){e.SEND="send",e.RECEIVE="receive",e.SYSTEM="system"}(n||(t.CommandType=n={}))},7892:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryClass=void 0,t.getEmptyHistory=function(){return{entries:[]}},function(e){e.USER="user",e.BACKUP="backup"}(o||(t.HistoryClass=o={}))},6059:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RecordFileFormat=void 0,t.detectRecordFileFormatByPath=function(e){for(const t of Object.values(a))if(e.toLowerCase().endsWith(t))return t},t.importRecordFromBuffer=function(e,t,o){const s=(0,i.decodeText)(e,{encoding:r(t),autoDetect:o?.autoDetect});switch(t){case a.KIF:case a.KIFU:return(0,n.importKIF)(s);case a.KI2:case a.KI2U:return(0,n.importKI2)(s);case a.CSA:return(0,n.importCSA)(s);case a.SFEN:return new Error(".sfen file import is not supported");case a.JKF:return(0,n.importJKFString)(s)}},t.exportRecordAsBuffer=function(e,t,o){const s=r(t);let l;switch(t){case a.KIF:case a.KIFU:l=(0,n.exportKIF)(e,o);break;case a.KI2:case a.KI2U:l=(0,n.exportKI2)(e,o);break;case a.CSA:l=(0,n.exportCSA)(e,{...o,v3:o.csa?.v3?{milliseconds:!0}:void 0});break;case a.SFEN:throw new Error(".sfen file export is not supported");case a.JKF:l=(0,n.exportJKFString)(e)}const c=(0,i.encodeText)(l,s);let d=!1;if("SJIS"===s&&o.detectGarbled){(0,i.decodeText)(c,{encoding:"SJIS"})!==l&&(d=!0)}return{data:c,garbled:d}};const i=o(1753),n=o(3113);var a;function r(e){switch(e){default:return"UTF8";case a.KIF:case a.KI2:return"SJIS"}}!function(e){e.KIF=".kif",e.KIFU=".kifu",e.KI2=".ki2",e.KI2U=".ki2u",e.CSA=".csa",e.SFEN=".sfen",e.JKF=".jkf"}(a||(t.RecordFileFormat=a={}))},4725:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CSAGameResult=t.CSASpecialMove=void 0,t.emptyCSAGameSummary=function(){return{id:"",myColor:i.Color.BLACK,toMove:i.Color.BLACK,position:"",players:{black:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}},white:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}}}}},t.emptyCSAPlayerStates=function(){return{black:{time:0},white:{time:0}}};const i=o(3113);var n,a;!function(e){e.UNKNOWN="unknown",e.RESIGN="resign",e.SENNICHITE="sennichite",e.OUTE_SENNICHITE="oute_sennichite",e.ILLEGAL_MOVE="illegal_move",e.ILLEGAL_ACTION="illegal_action",e.TIME_UP="time_up",e.JISHOGI="jishogi",e.MAX_MOVES="max_moves"}(n||(t.CSASpecialMove=n={})),function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw",e.CENSORED="censored",e.CHUDAN="chudan"}(a||(t.CSAGameResult=a={}))},3695:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GameResult=void 0,function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(o||(t.GameResult=o={}))},7187:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SCORE_MATE_INFINITE=void 0,t.parseUSIPV=function(e,t){const o=[],i=e.clone();for(const e of t){const t=i.createMoveByUSI(e);if(!t||!i.doMove(t))break;o.push(t)}return o},t.SCORE_MATE_INFINITE=1e4},5746:(e,t)=>{function o(e=new Date){return e.toLocaleTimeString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}Object.defineProperty(t,"__esModule",{value:!0}),t.getDateString=function(e=new Date){return e.toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})},t.getDateTimeString=o,t.getDateTimeStringMs=function(e=new Date){return o(e)+"."+String(e.getTime()%1e3).padStart(3,"0")}},1753:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeText=function(e,t){if("ASCII"===t||"UTF8"===t)return(new TextEncoder).encode(e);return new Uint8Array((0,i.convert)(e,{type:"arraybuffer",from:"UNICODE",to:t}))},t.decodeText=function(e,t){const o=t?.autoDetect?n(e,t.encoding):t?.encoding;if("ASCII"===o||"UTF8"===o)return(new TextDecoder).decode(e);return(0,i.convert)(e,{type:"string",from:o,to:"UNICODE"})},t.detectTextEncoding=n;const i=o(6953);function n(e,t){return(0,i.detect)(e)||t||"UTF8"}},9006:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toString=function(e){return e instanceof Error?e.message:e instanceof Object?JSON.stringify(e):String(e)},t.formatPercentage=function(e,t,o){if(0===t)return"0%";return(e/t*100).toFixed(o)+"%"},t.ordinal=function(e){switch(e%100){case 11:case 12:case 13:return e+"th"}switch(e%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd";default:return e+"th"}},t.filter=function(e,t){const o=e.toLowerCase();return t.every((e=>o.includes(e.toLowerCase())))}},9886:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.secondsToMMSS=function(e){const t=Math.floor(e/60),o=e%60;return String(t).padStart(2,"0")+":"+String(o).padStart(2,"0")}},3295:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.localizeError=function(e){if(e instanceof i.InvalidPieceNameError)return new Error(`${n.t.invalidPieceName}: ${e.data}`);if(e instanceof i.InvalidTurnError)return new Error(`${n.t.invalidTurn}: ${e.data}`);if(e instanceof i.InvalidMoveError)return new Error(`${n.t.invalidMove}: ${e.data}`);if(e instanceof i.InvalidMoveNumberError)return new Error(`${n.t.invalidMoveNumber}: ${e.data}`);if(e instanceof i.InvalidDestinationError)return new Error(`${n.t.invalidDestination}: ${e.data}`);if(e instanceof i.PieceNotExistsError)return new Error(`${n.t.pieceNotExists}: ${e.data}`);if(e instanceof i.InvalidLineError)return new Error(`${n.t.invalidLine}: ${e.data}`);if(e instanceof i.InvalidBoardError)return new Error(`${n.t.invalidBoard}: ${e.data}`);if(e instanceof i.InvalidHandPieceError)return new Error(`${n.t.invalidHandPiece}: ${e.data}`);if(e instanceof i.InvalidUSIError)return new Error(`${n.t.invalidUSI}: ${e.data}`);return e};const i=o(3113),n=o(1874)},8474:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t},r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||i(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.usiOptionNameMap=t.t=void 0,t.setLanguage=function(e){s.setLanguage(e),l.setLanguage(e)};const s=a(o(1874)),l=a(o(9233));r(o(9365),t);var c=o(1874);Object.defineProperty(t,"t",{enumerable:!0,get:function(){return c.t}}),r(o(3295),t),r(o(7445),t);var d=o(9233);Object.defineProperty(t,"usiOptionNameMap",{enumerable:!0,get:function(){return d.usiOptionNameMap}})},9365:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.Language=void 0,function(e){e.JA="ja",e.EN="en",e.ZH_TW="zh_tw"}(o||(t.Language=o={}))},855:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.en=void 0;const i=o(9006);t.en={shogiHome:"ShogiHome",clear:"Clear",open:"Open",openNewInstance:"Open a New ShogiHome Instance",saveOverwrite:"Overwrite",newRecord:"New Record",openRecord:"Open Record",saveRecord:"Save Record",saveRecordAs:"Save Record As",openAutoSavingDirectory:"Open Auto-Saving Directory",exportPositionImage:"Export Position Image",positionImage:"Position Image",batchConversion:"Batch Conversion",recordFileBatchConversion:"Record File Batch Conversion",close:"Close",quit:"Quit",editing:"Edit",copyAsKIF:"Copy (KIF)",copyAsKI2:"Copy (KI2)",copyAsCSA:"Copy (CSA)",copyAsUSI:"Copy (USI)",copyAsSFEN:"Copy (SFEN)",copyAsJKF:"Copy (JKF)",copy:"Copy",cut:"Cut",paste:"Paste",copyRecord:"Copy Record",asKIF:"as KIF",asKI2:"as KI2",asCSA:"as CSA",asUSIUntilCurrentMove:"as USI (until current move)",asUSIAll:"as USI (all)",asJSONKifuFormat:"as JSON Kifu Format",copyPositionAsSFEN:"Copy Position (as SFEN)",pasteRecordOrPosition:"Paste Record/Position",appendSpecialMove:"Append Special Move",deleteMoves:"Delete Current Move and Following Moves",view:"View",openLayoutManager:"Open Layout Manager",toggleFullScreen:"Toggle Full Screen",defaultFontSize:"Default Font Size",largerFontSize:"Larger Font Size",smallerFontSize:"Smaller Font Size",settings:"Settings",config:"Config",debug:"Debug",toggleDevTools:"Toggle Developer Tools",logFile:"Log File",openAppLog:"Open App Log",openUSILog:"Open USI Log",openCSALog:"Open CSA Log",tailAppLog:"Tail App Log",tailUSILog:"Tail USI Log",tailCSALog:"Tail CSA Log",copyAppLogTailCommand:"Copy App Log Tail Command",copyUSILogTailCommand:"Copy USI Log Tail Command",copyCSALogTailCommand:"Copy CSA Log Tail Command",reloadCustomPieceImage:"Reload Custom Piece Image",launchUSIEngine:"Launch USI Engine",connectToCSAServer:"Connect to CSA Server",adminMode:"Admin Mode",inAdminModeYouShouldInvokeCommandsManuallyAtPrompt:"In admin mode, you should invoke commands manually at prompt.",setoptionAndPrecedingCommandsWillBeSentAutomatically:'"setoption" and preceding commands will be sent automatically.',serverMustSupportShogiServerX1ModeLogIn:"The server must support shogi-server's x1-mode log-in.",folders:"Folders",notification:"Notification",notificationTest:"Notification Test",thisIsTestNotification:"This is test notification.",app:"App",log:"Log",backup:"Backup",cache:"Cache",help:"Help",openWebSite:"Open Web Site",howToUse:"How to Use",openLatestReleasePage:"Open Latest Release Page",openStableReleasePage:"Open Stable Release Page",inputs:"Inputs",outputs:"Outputs",format:"Format",formats:"Formats",subdirectories:"Subdirectories",separately:"Separately",merge:"Merge",createSubdirectories:"Create Subdirectories",nameConflictAction:"Name Conflict Action",numberSuffix:"Number Suffix",skip:"Skip",convert:"Convert",openLogFile:"Open Log File",succeeded:"Succeeded",failed:"Failed",skipped:"Skipped",game:"Game",player:"Player",server:"Server",selectFromHistory:"Select from History",noHistory:"Empty",saveHistory:"Save History",version:"Version",gameProgress:"Game Progress",allGamesCompleted:"All Games Completed",wins:"Wins",draws:"Draws",validGames:"Valid Games",invalidGames:"Invalid Games",eloRatingDiff:"Elo Rating Diff",ignoreDraws:"Ignore Draws",drawsAreHalfWin:"Draws are Half Win",zValue:"Z Value",significance5pc:"Significance-5%",significance1pc:"Significance-1%",gameEnded:"Game Ended",offlineGame:"Offline Game",csaOnlineGame:"CSA Online Game",csaProtocolOnlineGame:"Online Game (CSA Protocol)",csaProtocolV121:"CSA Protocol 1.2.1 Standard",csaProtocolV121WithPVComment:"CSA Protocol 1.2.1 with PV Comment",hostToConnect:"Hostname",portNumber:"Port",password:"Password",showPassword:"Show Password",keepaliveInitialDelay:"Keepalive Initial Delay",blankLinePing:"Blank Line Ping",blankLinePingInitialDelay:"Blank Line Ping Initial Delay",blankLinePingInterval:"Blank Line Ping Interval",logout:"Logout",calculateJishogiPoints:"Calculate Jishogi Points",jishogiPoints:"Jishogi Points",displayGameResults:"Display Results",interrupt:"Stop",stopGame:"Stop",resign:"Resign",draw:"Draw",impass:"Impass",repetitionDraw:"Repetition Draw",mate:"Mate",noMate:"No Mate",mateSearch:"Mate Search",startMateSearch:"Start Mate Search",stopMateSearch:"Stop Mate Search",noMateFound:"No mate.",timeout:"Timeout",foulWin:"Foul Win",foulLose:"Foul Lose",enteringOfKing:"Entering of King",winByDefault:"Win by Default",loseByDefault:"Lose by Default",winByDeclaration:"Win by Declaration",declareWinning:"Declare Winning",research:"Research",startResearch:"Start Research",endResearch:"End Research",recordAnalysis:"Record Analysis",analysis:"Analyze",analyze:"Analyze",stopAnalysis:"Stop Analysis",setupPosition:"Setup Position",startPositionSetup:"Start Position Setup",completePositionSetup:"Complete Setup",changeTurn:"Change Turn",initializePosition:"Initialize Position",changePieceSet:"Change Piece Set",appSettings:"Preferences",language:"Languages",theme:"Theme",standard:"Standard",green:"Green",cherryBlossom:"Cherry Blossom",customImage:"Custom Image",autumn:"Autumn",snow:"Snow",darkGreen:"Dark Green",dark:"Dark",piece:"Piece",singleKanjiPiece:"Single Kanji",singleKanjiGothicPiece:"Single Kanji (Gothic)",singleKanjiDarkPiece:"Single Kanji (Dark)",singleKanjiGothicDarkPiece:"Single Kanji (Gothic, Dark)",imageHasMarginsRemoveToDisplayLarger:"The image has margins (remove it to display larger)",backgroundImage:"Background Image",board:"Board",pieceStand:"Piece Stand",lightWoodyTexture:"Woody Texture (Light)",warmWoodTexture:"Woody Texture (Warm)",resin:"Resin",transparent:"Transparent",boardOpacity:"Board Opacity",pieceStandOpacity:"Piece Stand Opacity",recordOpacity:"Record Opacity",displayFileAndRank:"Display File & Rank",displayLeftControls:"Display Left Controls",displayRightControls:"Display Right Controls",tabViewStyle:"Tab View Style",oneColumn:"1 Column",twoColumns:"2 Columns",sounds:"Sounds",pieceLoudness:"Piece Loudness",clockLoudness:"Clock Loudness",clockPitch:"Clock Pitch",clockSoundTarget:"Clock Sound Target",anyTurn:"Any",onlyHumanTurn:"Human",defaultRecordFileFormat:"Default Record Format",textEncoding:"Text Encoding",strict:"Strict",autoDetect:"Auto Detect",newlineCharacter:"Newline Character",old90sMac:"90's Mac",autoSaving:"Auto-Saving",autoSavingDirectory:"Auto-Saving Directory",recordFileName:"Record File Name",select:"Select",positionOfUSIOutput:"Position of USI Output",movesOfUSIOutput:"Moves of USI Output",onlySFEN:"Only SFEN",usiProtocol:"USI Protocol",translateOptionName:"Translate Option Name",functionalOnJapaneseOnly:"Functional on Japanese Only",maxStartupTime:"Max Startup Time",forDevelopers:"For Developers",enableAppLog:"Enable App Log",enableUSILog:"Enable USI Log",enableCSALog:"Enable CSA Log",logLevel:"Log Level",manageEngines:"Manage Engines",flipBoard:"Flip Board",file:"File",recordFile:"Record File",executableFile:"Executable",imageFile:"Image",unsaved:"Unsaved",remove:"Remove",deleteMove:"Delete Move",recordProperties:"Record Properties",comments:"Comments",commentsAndBookmarks:"Comments & Bookmarks",branches:"Branches",bookmark:"Bookmark",bookmarkList:"Bookmarks",useBookmarkAsHeader:"Use Bookmark as Header",moveComments:"Move Comments",searchLog:"Search Log",pv:"PV",mateShort:"M",displayPVShort:"Play",evaluation:"Evaluation",eval:"Eval",estimatedWinRate:"Estimated Win Rate",evaluationAndEstimatedWinRate:"Evaluation & Estimated Win Rate",swapEachTurnChange:"Swap Each Turn Change",alwaysSenteIsPositive:"Always Sente is Positive",signOfEvaluation:"Sign of Evaluation",winRateCoefficient:"Win Rate Coefficient",monitor:"Monitor",hideTabView:"Hide",expandTabView:"Expand Tab View",sente:"Sente",senteOrShitate:"Sente (Shitate)",shitate:"Shitate",gote:"Gote",goteOrUwate:"Gote (Uwate)",uwate:"Uwate",swapSenteGote:"Swap Sente/Gote",currentPosition:"Current Position",enableEngineTimeout:"Enable Engine Timeout",setDifferentTimeForGote:"Set different time for Gote",nextTurn:"Next Move",elapsedTime:"Elapsed Time",elapsed:"Elapsed",rank:"Rank",depth:"Depth",searchEngine:"Search Engine",ponder:"Ponder",numberOfThreads:"Threads",multiPV:"Multi PV",startPosition:"Position",maxMoves:"Max Moves",gameRepetition:"Repeat",jishogi:"Jishogi",rule24:"24-point rule",rule27:"27-point rule",tryRule:"TRY rule",autoRelogin:"Auto Re-Login",restartItEveryGame:"Restart it Every Game",swapTurnWhenGameRepetition:"Swap Turns When Repeat",outputComments:"Output Comments",saveRecordAutomatically:"Save Record Automatically",adjustBoardToHumanPlayer:"Adjust Board to Human Player",adjustBoardAutomatically:"Adjust Board Automatically",command:"Command",startGame:"Start Game",cancelGame:"Cancel Game",allottedTime:"Allotted Time",byoyomi:"Byoyomi",increments:"Increments",startEndCriteria:"Start/End Criteria",endCriteria1Move:"End Criteria for 1 Move",outputSettings:"Output Settings",noOutputs:"No Outputs",insertCommentToTop:"Insert to Top",appendCommentToBottom:"Append to Bottom",insertToComment:"Ins. to Comment",insertToRecord:"Ins. to Record",overwrite:"Overwrite",fromPrefix:"from",fromSuffix:"",toPrefix:"to",toSuffix:"",plyPrefix:"",plySuffix:"th move",hoursSuffix:"h",minutesSuffix:"min",secondsSuffix:"sec",engineManagement:"Engine Management",engineName:"Engine Name",author:"Author",earlyPonder:"Early Ponder",enginePath:"Engine Path",openDirectory:"Open Directory",displayName:"Display Name",invoke:"Invoke",resetToEngineDefaultValues:"Reset to default values",defaultValue:"Default Value",noEngineRegistered:"No engine",duplicate:"Copy",add:"Add",recommended:"Recommended",import:"Import",saveAndClose:"Save & Close",save:"Save",saveAs:"Save As",history:"History",clearHistory:"Clear History",userFile:"User File",automaticBackup:"Automatic Backup",restore:"Restore",loadRecordFromWeb:"Load Record from Web",fetchLatestData:"Fetch Latest Data",sourceURL:"Source URL",ok:"OK",cancel:"Cancel",back:"Back",name:"Name",prediction:"Prediction",best:"Best",nodes:"Nodes",hashUsage:"Hash Usage",stop:"Stop",resume:"Resume",nonHandicap:"Non-Handicap",lanceHandicap:"Lance Handicap",rightLanceHandicap:"Right Lance Handicap",bishopHandicap:"Bishop Handicap",rookHandicap:"Rook Handicap",rookLanceHandicap:"Rook-Lance Handicap",twoPiecesHandicap:"2 Pieces Handicap",fourPiecesHandicap:"4 Pieces Handicap",sixPiecesHandicap:"6 Pieces Handicap",eightPiecesHandicap:"8 Pieces Handicap",tenPiecesHandicap:"10 Pieces Handicap",tsumeShogi:"Tsume Shogi",doubleKingTsumeShogi:"2-Kings Tsume Shogi",startDateTime:"Start",endDateTime:"End",gameDate:"Date",tournament:"Tournament",strategy:"Strategy",gameTitle:"Title",timeLimit:"Time Limit",blackTimeLimit:"Time Limit (Sente)",whiteTimeLimit:"Time Limit (Gote)",place:"Place",postedOn:"Posted On",note:"Note",senteShortName:"Sente(short)",goteShortName:"Gote(short)",opusNo:"Opus No.",opusName:"Opus Name",publishedBy:"Published By",publishedOn:"Published On",source:"Source",numberOfMoves:"Number of Moves",integrity:"Integrity",recordCategory:"Category",award:"Award",filterByOptionName:"Filter by Option Name",filterByEngineName:"Filter by Engine Name",bookStyle:"Book Style",gameStyle:"Game Style",thin:"Thin",bold:"Bold",extraBold:"Extra Bold",playerName:"Player Name",typeface:"Typeface",weight:"Weight",handLabel:"Hand Label",header:"Header",vertical:"Vertical",size:"Size",none:"None",bgCover:"Cover",bgContain:"Contain",bgTile:"Tile",inaccuracy:"Inaccuracy",dubious:"Dubious",mistake:"Mistake",blunder:"Blunder",inaccuracyThreshold:"Inaccuracy Threshold",dubiousThreshold:"Dubious Threshold",mistakeThreshold:"Mistake Threshold",blunderThreshold:"Blunder Threshold",gothic:"Gothic",mincho:"Mincho",appVersion:"App Version",installed:"Installed",stable:"Stable",latest:"Latest",backgroundColor:"Background Color",dialogBackdrop:"Dialog Backdrop",record:"Record",chart:"Chart",analytics:"Analytics",controlGroup:"Control Group",left:"Left",top:"Top",width:"Width",height:"Height",newCustomProfile:"New Custom Profile",addCustomLayoutProfile:"Add Custom Layout Profile",duplicateCurrentProfile:"Duplicate Current Profile",removeCurrentProfile:"Remove Current Profile",exportProfileToClipboard:"Export Profile to Clipboard",importProfileFromClipboard:"Import Profile from Clipboard",profileExportedToClipboard:"Profile exported to clipboard.",profileImported:"Profile imported.",failedToImportProfile:"Failed to import profile.",rightControlBox:"Right Control Box",leftControlBox:"Left Control Box",topControlBox:"Top Control Box",legends:"Legends",historyMode:"History Mode",headers:"Headers",playButton:"Play Button",insert:"Insert",bringForward:"Bring Forward",sendBackward:"Send Backward",updatedAt:"Updated At",createdAt:"Created At",lastSent:"Last Sent",lastReceived:"Last Received",protocolVersion:"Protocol Version",prompt:"Prompt",openPrompt:"Open Prompt",forceQuit:"Force Quit",forceClose:"Force Close",blankLine:"Blank Line",autoScroll:"Auto Scroll",showTimestamp:"Show Timestamp",highlightByPartialMatch:"Highlight by Partial Match",csaServer:"CSA Server",usiEngine:"USI Engine",noRunningUSIEngine:"No running USI engine.",noConnectedCSAServer:"No connected CSA server.",willBeRemovedFromTheListSoon:"This session is closed, will be removed from the list soon.",typeCommandHereAndPressEnter:"Type command here and press Enter.",allowBlankLine:"Allow Blank Line",removeSpaceFromBothEnds:"Remove Space from Both Ends",collapseSequentialSpaces:"Collapse Sequential Spaces",typeCustomTitleHere:"Type custom title here",displayEmptyElements:"Display Empty Elements",waitingForNewGame:"Waiting for new game.",waitingForPlayerSetup:"Waiting for player setup.",insertedComment:"Inserted comment.",conversionCompleted:"Conversion completed.",tryingToConnectAndLoginToCSAServer:"Trying to connect and login to CSA server.",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"*In web browser version, it will output logs to console and ignore this setting.",shouldRestartToApplyLogSettings:"*You should restart this app to apply log settings.",canOpenLogDirectoryFromMenu:'*You can open log directory from "Debug" - "Open Log Directory" menu.',hasNoOldLogCleanUpFeature:"*This app has no clean-up feature. Please remove old logs manually.",processingPleaseWait:"Processing, please wait.",importingFollowingRecordOrPosition:"Importing the following record(or position).",supportsKIF_KI2_CSA_USI_SFEN_JKF:"*Supports KIF, KI2, CSA, USI, SFEN, and JKF.",pleasePasteRecordIntoTextArea:"*Please paste record data into the text area.",pleaseSpecifyPlainTextURL:"*Please specify plain text URL.",redirectNotSupported:"*Redirect is not supported.",desktopVersionPastesAutomatically:"*In desktop version, it will paste automatically from clipboard.",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:'Early ponder feature sends "ponderhit" command with YaneuraOu\'s non-standard options.',ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"If your engine does not support the options, it may cause unexpected behavior.",someLogsDisabled:"Some log settings are disabled.",logsRecommendedForCSAProtocol:"Log settings are recommended for CSA protocol.",pleaseEnableLogsAndRestart:"Please enable log settings and restart this app.",notSendPVOnStandardCSAProtocol:"Client do not send PV on standard CSA protocol.",csaProtocolSendPlaintextPassword:"On CSA protocol, client send plaintext password.",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"Password will saved as plaintext because OS side encryption is not available.",pleaseUncheckSaveHistoryIfNotWantSave:"Please uncheck Save History, if you don't want to save.",csaProtocolSendPlaintextPasswordRegardlessOfHistory:"On CSA protocol, client send plaintext password regardless of history.",whenNewVersionIsAvailableItWillBeNotified:"When new version is available, it will be notified.",pleaseCheckMessageThisIsTestNotificationByAboveButton:'Please check the message "This is test notification." by above button.',ifNotWorkYouShouldAllowNotificationOnOSSetting:"If it does not work, you should allow notification on OS setting.",translationHelpNeeded:"We'd like your help to translate.",restartRequiredAfterLocaleChange:"You should restart this app to change the language.",areYouSureWantToResign:"Are you sure you want to resign?",areYouSureWantToDoDeclaration:"Are you sure you want to do declaration?",areYouSureWantToQuitGames:"Are you sure you want to quit games?",areYouSureWantToRequestQuit:"You have possibility to be loser. Are you sure you want to request quit?",areYouSureWantToClearRecord:"Are you sure you want to clear record?",areYouSureWantToDiscardPosition:"Are you sure you want to discard the position?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"Are you sure you want to open the file instead of current record?",areYouSureWantToClearHistory:"Are you sure you want to clear history?",areYouSureWantToRemoveCurrentProfile:"Are you sure you want to remove current profile?",yamlFormatSettingsCopiedToClipboard:"YAML format settings copied to clipboard.",jsonFormatSettingsCopiedToClipboard:"JSON format settings copied to clipboard.",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge command copied to clipboard.",youCanNotCloseAppWhileCSAOnlineGame:"You can not close app while CSA online game.",fileExtensionNotSupported:"File extension is not supported.",errorOccuredWhileDisconnectingFromCSAServer:"An error occured while disconnecting from CSA server.",failedToConnectToCSAServer:"Failed to connect to CSA server.",errorOccuredWhileLogoutFromCSAServer:"An error occured while logout from CSA server.",disconnectedFromCSAServer:"Disconnected from CSA server.",csaServerLoginDenied:"CSA server login denied.",thisFeatureNotAvailableOnWebApp:"This feature is not available on web app.",failedToStartNewGame:"Failed to start new game.",errorOccuredWhileEndingGame:"An error occured while ending game.",failedToSendGoCommand:"Failed to send go-command.",failedToSendPonderCommand:"Failed to send ponder-command.",failedToSendStopCommand:"Failed to send stop-command.",failedToShutdownEngines:"Failed to shutdown engines.",failedToCheckUpdates:"Failed to check updates.",failedToSaveRecord:"Failed to save record.",failedToParseSFEN:"Failed to parse SFEN.",failedToDetectRecordFormat:"Failed to detect record format.",unknown:"Unknown",unknownFileExtension:"Unknown file extension.",emptyRecordInput:"Empty record input.",invalidPieceName:"Invalid piece name",invalidTurn:"Invalid turn",invalidMove:"Invalid move",invalidMoveNumber:"Invalid move number",invalidDestination:"Invalid destination",pieceNotExists:"Piece not exists",invalidLine:"Invalid line",invalidBoard:"Invalid board",invalidHandPiece:"Invalid hand piece",invalidUSI:"Invalid USI",backgroundImageFileNotSelected:"Background image file is not selected.",pieceImageFileNotSelected:"Piece image File is not selected.",boardImageFileNotSelected:"Board image file is not selected.",pieceStandImageFileNotSelected:"Piece stand image file is not selected.",pieceVolumeMustBe0To100Percent:"Piece volume must be 0% to 100%.",clockVolumeMustBe0To100Percent:"Clock volume must be 0% to 100%.",clockPitchMustBe220To880Hz:"Clock pitch must be 220Hz to 880Hz.",engineTimeoutMustBe1To300Seconds:"Engine timeout must be 1 to 300 seconds.",coefficientInSigmoidMustBeGreaterThan0:"Coefficient in sigmoid must be greater than 0.",inaccuracyThresholdMustBe1To100Percent:"Inaccuracy must be 1% to 100%.",dubiousThresholdMustBe1To100Percent:"Dubious threshold must be 1% to 100%.",mistakeThresholdMustBe1To100Percent:"Mistake threshold must be 1% to 100%.",blunderThresholdMustBe1To100Percent:"Blunder threshold must be 1% to 100%.",recordSavedWithGarbledCharacters:"The record has saved with some garbled characters.",pleaseConsiderToUseKIFU:"Please consider to use KIFU(UTF-8).",youCanChangeDefaultRecordFileFormatFromAppSettings:"You can change default record file format from App Settings.",inaccuracyThresholdMustBeLessThanDubiousThreshold:"Inaccuracy threshold must be less than dubious threshold.",dubiousThresholdMustBeLessThanMistakeThreshold:"Dubious threshold must be less than mistake threshold.",mistakeThresholdMustBeLessThanBlunderThreshold:"Mistake threshold must be less than blunder threshold.",thisEngineNotSupportsMateSearch:"This engine does not support mate search.",pleaseEndActiveFeaturesBeforeOpenRecord:"Please end active features before open record.",bothTimeLimitAndByoyomiAreNotSet:"Both time limit and byoyomi are not set.",canNotUseByoyomiWithFischer:"You can not use Byoyomi with Fischer.",repeatsMustBeOneIfHumanPlayerIncluded:"The number of repeats must be 1, if a human player is included.",protocolVersionNotSelected:"Protocol version is not selected.",hostNameIsEmpty:"Host name is empty.",invalidPortNumber:"Invalid port number.",idIsEmpty:"ID is empty.",idContainsSpace:"ID contains space.",passwordContainsSpace:"Password contains space.",tcpKeepaliveInitialDelayMustBePositive:"TCP keepalive initial delay must be positive.",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"Blank line ping initial delay must be >=30.",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"Blank line ping interval must be >=30.",engineNotSelected:"Engine is not selected.",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"For exporting conversion log, please enable app logs, set log level to DEBUG and restart this app.",sourceDirectoryNotSpecified:"Source directory is not specified.",sourceFormatsNotSpecified:"Source formats are not specified.",destinationDirectoryNotSpecified:"Destination directory is not specified.",destinationFileNotSpecified:"Destination file is not specified.",totalNumber:e=>`Total: ${e}`,number:e=>""+e,tryToReloginToCSAServerNSecondsLater:e=>`Try to relogin to CSA server ${e} seconds later.`,mateInNPlyDoYouWantToDisplay:e=>`Mate in ${e} ply. Do you want to display?`,insertedNMovesToRecord:e=>`Inserted ${e} moves to the record.`,errorsOccurred:e=>e>=2?`${e} errors have occurred.`:`${e} error has occurred.`,between:(e,t)=>`between ${e} and ${t}`,addNthEngine:e=>`Add ${(0,i.ordinal)(e)} engine`,copyOf:e=>`${e} (copy)`,keepLatest:e=>`keep latest ${e}`,followingDataNotSavedBecauseNotSupporetedBy:e=>`Following data not saved because not supporeted by "${e}".`,areYouSureWantToDeleteFollowingMove:e=>`Are you sure you want to delete ${e}th move and the following move?`,failedToOpenDirectory:e=>`Failed to open directory of the file: ${e}`,unexpectedEventSenderPleaseReport:e=>`Unexpected event sender. Please report this error message to developer. [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`Unexpected HTTP method. Please report this error message to developer. [${e}]`,unexpectedRequestURLPleaseReport:e=>`Unexpected request URL. Please report this error message to developer. [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`No response from engine while ${e} seconds. Please extend timeout at app settings, if your engine is slow.`,stableVersionReleased:e=>`Stable version ${e} released!`,latestVersionReleased:e=>`Latest version ${e} released!`}},9445:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ja=void 0,t.ja={shogiHome:"ShogiHome",clear:"初期化",open:"開く",openNewInstance:"新しい ShogiHome ウィンドウを開く",saveOverwrite:"上書き保存",newRecord:"新規棋譜",openRecord:"棋譜を開く",saveRecord:"棋譜を上書き保存",saveRecordAs:"棋譜を名前を付けて保存",openAutoSavingDirectory:"自動保存先を開く",exportPositionImage:"局面図を出力",positionImage:"局面図",batchConversion:"一括変換",recordFileBatchConversion:"棋譜ファイル一括変換",close:"閉じる",quit:"終了",editing:"編集",copyAsKIF:"コピー・KIF",copyAsKI2:"コピー・KI2",copyAsCSA:"コピー・CSA",copyAsUSI:"コピー・USI",copyAsSFEN:"コピー・SFEN",copyAsJKF:"コピー・JKF",copy:"コピー",cut:"切り取り",paste:"貼り付け",copyRecord:"棋譜コピー",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSIUntilCurrentMove:"USI形式(現在の指し手まで)",asUSIAll:"USI形式(全て)",asJSONKifuFormat:"JSON棋譜フォーマット",copyPositionAsSFEN:"局面コピー(SFEN形式)",pasteRecordOrPosition:"棋譜・局面貼り付け",appendSpecialMove:"特殊な指し手",deleteMoves:"現在の位置から棋譜を削除",view:"表示",openLayoutManager:"レイアウトマネージャー",toggleFullScreen:"全画面表示切り替え",defaultFontSize:"標準の文字サイズ",largerFontSize:"文字を拡大",smallerFontSize:"文字を縮小",settings:"設定",config:"設定",debug:"デバッグ",toggleDevTools:"開発者ツール表示切り替え",logFile:"ログファイル",openAppLog:"アプリログを開く",openUSILog:"USI通信ログを開く",openCSALog:"CSA通信ログを開く",tailAppLog:"アプリログをTailする",tailUSILog:"USI通信ログをTailする",tailCSALog:"CSA通信ログをTailする",copyAppLogTailCommand:"アプリログのTailコマンドをコピー",copyUSILogTailCommand:"USI通信ログのTailコマンドをコピー",copyCSALogTailCommand:"CSA通信ログのTailコマンドをコピー",reloadCustomPieceImage:"カスタム駒画像をリロード",launchUSIEngine:"USIエンジンを起動",connectToCSAServer:"CSAサーバーに接続",adminMode:"管理モード",inAdminModeYouShouldInvokeCommandsManuallyAtPrompt:"管理モードではプロンプトから手動でコマンドを実行する必要があります。",setoptionAndPrecedingCommandsWillBeSentAutomatically:"setoptionコマンドまでのコマンドは自動で送信されます。",serverMustSupportShogiServerX1ModeLogIn:"サーバーは shogi-server の拡張モード (x1) ログインをサポートしている必要があります。",folders:"各種フォルダ",notification:"通知",notificationTest:"通知テスト",thisIsTestNotification:"これは通知のテストです。",app:"アプリ",log:"ログ",backup:"バックアップ",cache:"キャッシュ",help:"ヘルプ",openWebSite:"Webサイトを開く",howToUse:"使い方を開く",openLatestReleasePage:"最新版リリースページを開く",openStableReleasePage:"安定版リリースページを開く",inputs:"入力",outputs:"出力",format:"フォーマット",formats:"フォーマット",subdirectories:"サブディレクトリ",separately:"個別",merge:"マージ",createSubdirectories:"サブディレクトリ作成",nameConflictAction:"名前衝突時の動作",numberSuffix:"番号付与",skip:"スキップ",convert:"変換",openLogFile:"ログファイルを開く",succeeded:"成功",failed:"失敗",skipped:"スキップ",game:"対局",player:"プレイヤー",server:"サーバー",selectFromHistory:"履歴から選ぶ",noHistory:"履歴がありません",saveHistory:"履歴に保存する",version:"バージョン",gameProgress:"対局の経過",allGamesCompleted:"連続対局終了",wins:"勝ち数",draws:"引き分け",validGames:"有効対局数",invalidGames:"無効対局数",eloRatingDiff:"レーティング差",ignoreDraws:"引き分け無効",drawsAreHalfWin:"引き分け0.5勝",zValue:"Z値",significance5pc:"有意水準5%",significance1pc:"有意水準1%",gameEnded:"対局終了",offlineGame:"ローカル対局",csaOnlineGame:"通信対局(CSA)",csaProtocolOnlineGame:"通信対局(CSAプロトコル)",csaProtocolV121:"CSAプロトコル1.2.1 標準",csaProtocolV121WithPVComment:"CSAプロトコル1.2.1 読み筋コメント付き",hostToConnect:"接続先ホスト",portNumber:"ポート番号",password:"パスワード",showPassword:"パスワードを表示する",keepaliveInitialDelay:"Keepalive初期遅延",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初期遅延",blankLinePingInterval:"空行Ping間隔",logout:"ログアウト",calculateJishogiPoints:"持将棋の点数を計算",jishogiPoints:"持将棋の点数",displayGameResults:"戦績確認",interrupt:"中断",stopGame:"対局中断",resign:"投了",draw:"引き分け",impass:"持将棋",repetitionDraw:"千日手",mate:"詰み",noMate:"不詰",mateSearch:"詰み探索",startMateSearch:"詰み探索開始",stopMateSearch:"詰み探索終了",noMateFound:"詰みが見つかりませんでした。",timeout:"時間切れ",foulWin:"反則勝ち",foulLose:"反則負け",enteringOfKing:"入玉勝ち",winByDefault:"不戦勝",loseByDefault:"不戦敗",winByDeclaration:"宣言勝ち",declareWinning:"勝ち宣言",research:"検討",startResearch:"検討開始",endResearch:"検討終了",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"解析中断",setupPosition:"局面編集",startPositionSetup:"局面編集開始",completePositionSetup:"局面編集終了",changeTurn:"手番変更",initializePosition:"局面の初期化",changePieceSet:"駒の増減",appSettings:"アプリ設定",language:"言語",theme:"テーマ",standard:"標準",green:"緑",cherryBlossom:"桜",customImage:"カスタム画像",autumn:"紅葉",snow:"雪",darkGreen:"深緑",dark:"ダーク",piece:"駒",singleKanjiPiece:"一文字駒",singleKanjiGothicPiece:"一文字駒(ゴシック体)",singleKanjiDarkPiece:"一文字駒(ダーク)",singleKanjiGothicDarkPiece:"一文字駒(ゴシック体・ダーク)",imageHasMarginsRemoveToDisplayLarger:"画像に余白が含まれている(除去して大きく表示)",backgroundImage:"背景画像",board:"盤",pieceStand:"駒台",lightWoodyTexture:"木目(明るい)",warmWoodTexture:"木目(暖かい)",resin:"樹脂",transparent:"透過表示",boardOpacity:"盤の不透明度",pieceStandOpacity:"駒台の不透明度",recordOpacity:"棋譜の不透明度",displayFileAndRank:"段・筋を表示",displayLeftControls:"左側操作ボタンを表示",displayRightControls:"右側操作ボタンを表示",tabViewStyle:"タブビューの形式",oneColumn:"1列",twoColumns:"2列",sounds:"音",pieceLoudness:"駒音の大きさ",clockLoudness:"時計音の大きさ",clockPitch:"時計音の高さ",clockSoundTarget:"時計音の対象",anyTurn:"全ての手番",onlyHumanTurn:"人間の手番のみ",defaultRecordFileFormat:"デフォルトの保存形式",textEncoding:"文字コード",strict:"厳格",autoDetect:"自動判定",newlineCharacter:"改行文字",old90sMac:"90年代Mac",autoSaving:"自動保存",autoSavingDirectory:"棋譜の自動保存先",recordFileName:"棋譜ファイル名",select:"選択",positionOfUSIOutput:"USI の局面表記",movesOfUSIOutput:"USI の指し手表記",onlySFEN:"SFEN のみ",usiProtocol:"USIプロトコル",translateOptionName:"オプション名を翻訳",functionalOnJapaneseOnly:"日本語選択時のみ有効",maxStartupTime:"最大起動待ち時間",forDevelopers:"開発者向け",enableAppLog:"アプリログを出力",enableUSILog:"USI通信ログを出力",enableCSALog:"CSA通信ログを出力",logLevel:"ログレベル",manageEngines:"エンジン設定",flipBoard:"盤面反転",file:"ファイル",recordFile:"棋譜ファイル",executableFile:"実行可能ファイル",imageFile:"画像ファイル",unsaved:"未保存",remove:"削除",deleteMove:"指し手削除",recordProperties:"棋譜情報",comments:"コメント",commentsAndBookmarks:"コメント・しおり",branches:"分岐",bookmark:"しおり",bookmarkList:"しおり一覧",useBookmarkAsHeader:"しおりを見出しに使う",moveComments:"指し手コメント",searchLog:"思考",pv:"読み筋",mateShort:"詰",displayPVShort:"再現",evaluation:"評価値",eval:"評価値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRate:"評価値・期待勝率",swapEachTurnChange:"手番側有利がプラスの値",alwaysSenteIsPositive:"先手有利がプラスの値",signOfEvaluation:"評価値の符号",winRateCoefficient:"勝率換算係数",monitor:"監視",hideTabView:"最小化",expandTabView:"タブビューを再表示",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",swapSenteGote:"先後入れ替え",currentPosition:"現在の局面",enableEngineTimeout:"エンジンの時間切れあり",setDifferentTimeForGote:"後手に異なる時間を設定",nextTurn:"次の手番",elapsedTime:"消費時間",elapsed:"経過時間",rank:"順位",depth:"深さ",searchEngine:"エンジン",ponder:"先読み(Ponder)",numberOfThreads:"スレッド数",multiPV:"マルチPV",startPosition:"開始局面",maxMoves:"最大手数",gameRepetition:"連続対局",jishogi:"持将棋",rule24:"24点法",rule27:"27点法",tryRule:"トライルール",autoRelogin:"自動で再ログインする",restartItEveryGame:"1局ごとに再起動する",swapTurnWhenGameRepetition:"1局ごとに手番を入れ替える",outputComments:"コメントを出力する",saveRecordAutomatically:"棋譜を自動で保存する",adjustBoardToHumanPlayer:"人を手前に表示する",adjustBoardAutomatically:"盤面の向きを自動調整",command:"コマンド",startGame:"対局開始",cancelGame:"対局をキャンセル",allottedTime:"持ち時間",byoyomi:"秒読み",increments:"増加",startEndCriteria:"開始・終了条件",endCriteria1Move:"局面ごとの終了条件",outputSettings:"出力設定",noOutputs:"出力しない",insertCommentToTop:"前方に加筆する",appendCommentToBottom:"末尾に加筆する",insertToComment:"コメントに挿入",insertToRecord:"棋譜に挿入",overwrite:"上書きする",fromPrefix:"",fromSuffix:"から",toPrefix:"",toSuffix:"まで",plyPrefix:"",plySuffix:"手目",hoursSuffix:"時間",minutesSuffix:"分",secondsSuffix:"秒",engineManagement:"エンジン管理",engineName:"エンジン名",author:"作者",earlyPonder:"早期Ponder",enginePath:"場所",openDirectory:"フォルダを開く",displayName:"表示名",invoke:"実行",resetToEngineDefaultValues:"エンジンの既定値に戻す",defaultValue:"既定値",noEngineRegistered:"エンジンが登録されていません。",duplicate:"複製",add:"追加",recommended:"推奨",import:"取り込む",saveAndClose:"保存して閉じる",save:"保存",saveAs:"保存",history:"履歴",clearHistory:"履歴をクリア",userFile:"ユーザーのファイル",automaticBackup:"自動バックアップ",restore:"復元",loadRecordFromWeb:"Webの棋譜を取得",fetchLatestData:"最新データを取得",sourceURL:"ソースURL",ok:"OK",cancel:"キャンセル",back:"戻る",name:"名前",prediction:"予想",best:"最善",nodes:"Node数",hashUsage:"Hash使用率",stop:"停止",resume:"再開",nonHandicap:"平手",lanceHandicap:"香落ち",rightLanceHandicap:"右香落ち",bishopHandicap:"角落ち",rookHandicap:"飛車落ち",rookLanceHandicap:"飛車香落ち",twoPiecesHandicap:"二枚落ち",fourPiecesHandicap:"四枚落ち",sixPiecesHandicap:"六枚落ち",eightPiecesHandicap:"八枚落ち",tenPiecesHandicap:"十枚落ち",tsumeShogi:"詰将棋",doubleKingTsumeShogi:"双玉詰将棋",startDateTime:"開始日時",endDateTime:"終了日時",gameDate:"対局日",tournament:"棋戦",strategy:"戦型",gameTitle:"表題",timeLimit:"持ち時間",blackTimeLimit:"先手の持ち時間",whiteTimeLimit:"後手の持ち時間",place:"場所",postedOn:"掲載",note:"備考",senteShortName:"先手省略名",goteShortName:"後手省略名",opusNo:"作品番号",opusName:"作品名",publishedBy:"発表誌",publishedOn:"発表年月",source:"出典",numberOfMoves:"手数",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"オプション名で検索",filterByEngineName:"エンジン名で検索",bookStyle:"書籍風",gameStyle:"対局画面風",thin:"細",bold:"太",extraBold:"極太",playerName:"対局者名",typeface:"書体",weight:"太さ",handLabel:"持ち駒ラベル",header:"見出し",vertical:"垂直方向",size:"サイズ",none:"なし",bgCover:"1枚で表示",bgContain:"拡大して表示",bgTile:"タイル状に表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"悪手",blunder:"大悪手",inaccuracyThreshold:"緩手の閾値",dubiousThreshold:"疑問手の閾値",mistakeThreshold:"悪手の閾値",blunderThreshold:"大悪手の閾値",gothic:"ゴシック体",mincho:"明朝体",appVersion:"アプリバージョン",installed:"インストール済み",stable:"安定版",latest:"最新版",backgroundColor:"背景色",dialogBackdrop:"ダイアログ表示中の暗転",record:"棋譜",chart:"グラフ",analytics:"解析",controlGroup:"メニュー",left:"左",top:"上",width:"幅",height:"高さ",newCustomProfile:"新規カスタムプロファイル",addCustomLayoutProfile:"新規レイアウトプロファイル",duplicateCurrentProfile:"現在のプロファイルを複製",removeCurrentProfile:"現在のプロファイルを削除",exportProfileToClipboard:"プロファイルをクリップボードに出力",importProfileFromClipboard:"クリップボードからプロファイルを取り込む",profileExportedToClipboard:"プロファイルをクリップボードに出力しました。",profileImported:"プロファイルを取り込みました。",failedToImportProfile:"プロファイルの取り込みに失敗しました。",rightControlBox:"右側メニュー",leftControlBox:"左側メニュー",topControlBox:"操作ボタン",legends:"凡例",historyMode:"履歴モード",headers:"ヘッダー",playButton:"再現ボタン",insert:"挿入",bringForward:"前面へ",sendBackward:"背面へ",updatedAt:"更新日時",createdAt:"作成日時",lastSent:"最終送信",lastReceived:"最終受信",protocolVersion:"プロトコルバージョン",prompt:"プロンプト",openPrompt:"プロンプトを開く",forceQuit:"強制Quit",forceClose:"強制Close",blankLine:"空行",autoScroll:"自動スクロール",showTimestamp:"タイムスタンプを表示",highlightByPartialMatch:"部分一致でハイライト",csaServer:"CSAサーバー",usiEngine:"USIエンジン",noRunningUSIEngine:"稼働中のUSIエンジンはありません。",noConnectedCSAServer:"接続中のCSAサーバーはありません。",willBeRemovedFromTheListSoon:"セッションが終了したため、まもなく一覧から削除されます。",typeCommandHereAndPressEnter:"コマンドを入力してEnter",allowBlankLine:"空行を許可",removeSpaceFromBothEnds:"両端の空白を削除",collapseSequentialSpaces:"連続する空白をまとめる",typeCustomTitleHere:"ここに見出しを入力",displayEmptyElements:"未入力の項目を表示",waitingForNewGame:"対局開始を待っています。",waitingForPlayerSetup:"対局者の準備を待っています。",insertedComment:"コメントを挿入しました。",conversionCompleted:"変換が完了しました。",tryingToConnectAndLoginToCSAServer:"CSAサーバーへの接続とログインを試みています。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※ブラウザ版ではログがコンソールに出力され、ここでの設定は無視されます。",shouldRestartToApplyLogSettings:"※ログ設定の変更を反映するにはアプリの再起動が必要です。",canOpenLogDirectoryFromMenu:"※ログの出力先は「デバッグ」-「ログファイルの場所を開く」で開きます。",hasNoOldLogCleanUpFeature:"※現在、古いログファイルの自動削除機能はありません。",processingPleaseWait:"処理中です。お待ちください。",importingFollowingRecordOrPosition:"以下の棋譜(または局面)を取り込みます。",supportsKIF_KI2_CSA_USI_SFEN_JKF:"※KIF形式/KI2形式/CSA形式/USI/SFEN/JKFに対応しています。",pleasePasteRecordIntoTextArea:"※テキストエリアに棋譜を貼り付けてください。",pleaseSpecifyPlainTextURL:"※プレーンテキストのURLを指定してください。",redirectNotSupported:"※リダイレクトはサポートされていません。",desktopVersionPastesAutomatically:"※インストールアプリ版では自動的に貼り付けられます。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期Ponder機能は、やねうら王の独自オプションでponderhitコマンドを送信します。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"エンジンがこのオプションに対応していない場合、予期しない動作を引き起こす可能性があります。",someLogsDisabled:"一部のログが無効になっています。",logsRecommendedForCSAProtocol:"CSAプロトコルを使用した対局では各種ログの出力を推奨します。",pleaseEnableLogsAndRestart:"アプリ設定からログを有効にしてアプリを再起動してください。",notSendPVOnStandardCSAProtocol:"標準のCSAプロトコルでは評価値や読み筋が送信されません。",csaProtocolSendPlaintextPassword:"CSAプロトコルの規格上パスワードは平文で送信されます。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"OSの暗号化機能が利用できないため、入力したパスワードは平文で保存されます。",pleaseUncheckSaveHistoryIfNotWantSave:"保存したくない場合は「履歴に保存する」のチェックを外してください。",csaProtocolSendPlaintextPasswordRegardlessOfHistory:"なお、履歴の保存に関係なくCSAプロトコルの規格上パスワードは平文で送信されます。",whenNewVersionIsAvailableItWillBeNotified:"新しいバージョンが利用可能になると通知されます。",pleaseCheckMessageThisIsTestNotificationByAboveButton:"上のボタンで「これは通知のテストです。」というメッセージを確認してください。",ifNotWorkYouShouldAllowNotificationOnOSSetting:"表示されない場合はOSの設定で通知を許可してください。",translationHelpNeeded:"翻訳の改善にご協力ください。",restartRequiredAfterLocaleChange:"言語の変更には再起動が必要です。",areYouSureWantToResign:"投了しますか?",areYouSureWantToDoDeclaration:"宣言しますか?",areYouSureWantToQuitGames:"連続対局を中断しますか?",areYouSureWantToRequestQuit:"中断を要求すると負けになる可能性があります。よろしいですか?",areYouSureWantToClearRecord:"現在の棋譜は削除されます。よろしいですか?",areYouSureWantToDiscardPosition:"現在の局面は破棄されます。よろしいですか?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"現在の棋譜を閉じて別のファイルを開きます。よろしいですか?",areYouSureWantToClearHistory:"履歴をクリアします。よろしいですか?",areYouSureWantToRemoveCurrentProfile:"現在のプロファイルを削除します。よろしいですか?",yamlFormatSettingsCopiedToClipboard:"YAML形式の設定をクリップボードにコピーしました。",jsonFormatSettingsCopiedToClipboard:"JSON形式の設定をクリップボードにコピーしました。",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge コマンドをクリップボードにコピーしました。",youCanNotCloseAppWhileCSAOnlineGame:"CSAプロトコル使用中はアプリを終了できません。",fileExtensionNotSupported:"取り扱いできないファイル拡張子です。",errorOccuredWhileDisconnectingFromCSAServer:"CSAサーバーからの切断中にエラーが発生しました。",failedToConnectToCSAServer:"CSAサーバーに接続できませんでした。",errorOccuredWhileLogoutFromCSAServer:"CSAサーバーからのログアウト中にエラーが発生しました。",disconnectedFromCSAServer:"CSAサーバーへの接続が切れました。",csaServerLoginDenied:"CSAサーバーへのログインが拒否されました。",thisFeatureNotAvailableOnWebApp:"Web版では利用できない機能です。",failedToStartNewGame:"対局の開始に失敗しました。",errorOccuredWhileEndingGame:"対局の終了中にエラーが発生しました。",failedToSendGoCommand:"goコマンドを送信できませんでした。",failedToSendPonderCommand:"ponderコマンドを送信できませんでした。",failedToSendStopCommand:"stopコマンドを送信できませんでした。",failedToShutdownEngines:"エンジンを正常に終了できませんでした。",failedToCheckUpdates:"アップデートの確認ができませんでした。",failedToSaveRecord:"棋譜の保存に失敗しました。",failedToParseSFEN:"SFENの読み込みに失敗しました。",failedToDetectRecordFormat:"棋譜形式を判別できませんでした。",unknown:"不明",unknownFileExtension:"不明なファイル形式です。",emptyRecordInput:"棋譜が入力されていません。",invalidPieceName:"不正な駒",invalidTurn:"不正な手番",invalidMove:"不正な指し手",invalidMoveNumber:"不正な手数",invalidDestination:"不正な移動先",pieceNotExists:"存在しない駒",invalidLine:"不正な行",invalidBoard:"不正な盤面",invalidHandPiece:"不正な持ち駒",invalidUSI:"不正なUSI",backgroundImageFileNotSelected:"背景画像のファイルが選択されていません。",pieceImageFileNotSelected:"駒画像のファイルが選択されていません。",boardImageFileNotSelected:"盤面画像のファイルが選択されていません。",pieceStandImageFileNotSelected:"駒台画像のファイルが選択されていません。",pieceVolumeMustBe0To100Percent:"駒音の大きさには0%~100%の値を指定してください。",clockVolumeMustBe0To100Percent:"時計音の大きさには0%~100%の値を指定してください。",clockPitchMustBe220To880Hz:"時計音の高さには220Hz~880Hzの値を指定してください。",engineTimeoutMustBe1To300Seconds:"エンジンのタイムアウト時間には1秒~300秒の値を指定してください。",coefficientInSigmoidMustBeGreaterThan0:"勝率換算係数には0より大きい値を指定してください。",inaccuracyThresholdMustBe1To100Percent:"緩手には1%~100%の値を指定してください。",dubiousThresholdMustBe1To100Percent:"疑問手には1%~100%の値を指定してください。",mistakeThresholdMustBe1To100Percent:"悪手には1%~100%の閾値を指定してください。",blunderThresholdMustBe1To100Percent:"大悪手には1%~100%の値を指定してください。",recordSavedWithGarbledCharacters:"保存した棋譜の一部が文字化けしている可能性があります。",pleaseConsiderToUseKIFU:"KIFU形式(UTF-8)で保存することをお勧めします。",youCanChangeDefaultRecordFileFormatFromAppSettings:"デフォルトの棋譜形式はアプリ設定で変更可能です。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手には疑問手より小さい値を指定してください。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手には悪手より小さい値を指定してください。",mistakeThresholdMustBeLessThanBlunderThreshold:"悪手には大悪手より小さい値を指定してください。",thisEngineNotSupportsMateSearch:"このエンジンは詰将棋探索をサポートしていません。",pleaseEndActiveFeaturesBeforeOpenRecord:"棋譜を開くには現在利用している機能を終了してください。",bothTimeLimitAndByoyomiAreNotSet:"持ち時間と秒読みが両方とも0です。",canNotUseByoyomiWithFischer:"秒読みとフィッシャールールは併用できません。",repeatsMustBeOneIfHumanPlayerIncluded:"人が対局する場合、連続対局の回数は1以外を設定できません。",protocolVersionNotSelected:"プロトコルのバージョンを選択してください。",hostNameIsEmpty:"ホスト名が空です。",invalidPortNumber:"無効なポート番号です。",idIsEmpty:"IDが空です。",idContainsSpace:"IDに空白が含まれています。",passwordContainsSpace:"パスワードに空白が含まれています。",tcpKeepaliveInitialDelayMustBePositive:"TCP Keepaliveの初期遅延時間には正の値を指定してください。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"空行送信の初期遅延時間には30秒以上を指定してください。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"空行送信の間隔には30秒以上を指定してください。",engineNotSelected:"エンジンが選択されていません。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"変換ログを出力するにはアプリログを有効にし、ログレベルをデバッグに設定してアプリを再起動してください。",sourceDirectoryNotSpecified:"入力ディレクトリが指定されていません。",sourceFormatsNotSpecified:"入力の対象フォーマットが指定されていません。",destinationDirectoryNotSpecified:"出力ディレクトリが指定されていません。",destinationFileNotSpecified:"出力ファイルが指定されていません。",totalNumber:e=>`合計 ${e} 件`,number:e=>`${e} 件`,tryToReloginToCSAServerNSecondsLater:e=>`CSAサーバーへのログインを${e}秒後に再試行します。`,mateInNPlyDoYouWantToDisplay:e=>`${e}手で詰みました。再生画面を表示しますか?`,insertedNMovesToRecord:e=>`${e}手を棋譜に挿入しました。`,errorsOccurred:e=>`${e} 種類のエラーが発生しました。`,between:(e,t)=>`${e} から ${t} まで`,addNthEngine:e=>`${e} 個目のエンジンを追加`,copyOf:e=>`${e} のコピー`,keepLatest:e=>`最新${e}件まで`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下の情報は ${e} 形式では対応していないため保存されませんでした。`,areYouSureWantToDeleteFollowingMove:e=>`${e}手目以降を削除します。よろしいですか?`,failedToOpenDirectory:e=>`ファイルの場所を開けませんでした: ${e}`,unexpectedEventSenderPleaseReport:e=>`予期せぬイベントの送信元です。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`予期せぬHTTPメソッドです。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`予期せぬURLへのリクエストです。このエラーメッセージを開発者に報告してください。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`${e}秒以内にエンジンから応答がありませんでした。エンジンの起動が重い場合はアプリ設定で待ち時間を延長してください。`,stableVersionReleased:e=>`安定版 ${e} がリリースされました!`,latestVersionReleased:e=>`最新版 ${e} がリリースされました!`}},8584:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.zh_tw=void 0,t.zh_tw={shogiHome:"ShogiHome",clear:"清除",open:"開啟",openNewInstance:"開啟新的 ShogiHome 視窗",saveOverwrite:"覆蓋檔案",newRecord:"新棋譜",openRecord:"打開棋譜",saveRecord:"保存棋譜",saveRecordAs:"另存棋譜",openAutoSavingDirectory:"打開自動保存目錄",exportPositionImage:"輸出局面圖",positionImage:"局面圖",batchConversion:"棋譜大量轉換",recordFileBatchConversion:"棋譜大量轉換",close:"關閉",quit:"離開",editing:"編輯",copyAsKIF:"複製KIF棋譜",copyAsKI2:"複製KI2棋譜",copyAsCSA:"複製CSA棋譜",copyAsUSI:"複製USI棋譜",copyAsSFEN:"複製SFEN局面",copyAsJKF:"複製JKF棋譜",copy:"拷貝",cut:"剪下",paste:"貼上",copyRecord:"複製棋譜",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSIUntilCurrentMove:"USI形式(到目前手數為止)",asUSIAll:"USI形式(全部)",asJSONKifuFormat:"JSON Kifu Format",copyPositionAsSFEN:"複製局面(SFEN形式)",pasteRecordOrPosition:"貼上棋譜、局面",appendSpecialMove:"特殊手",deleteMoves:"刪除現在位置後的棋譜",view:"表示",openLayoutManager:"開啟佈局管理員",toggleFullScreen:"切換全螢幕",defaultFontSize:"預設字體尺寸",largerFontSize:"增加字體尺寸",smallerFontSize:"縮小字體尺寸",settings:"設定",config:"設定",debug:"偵錯",toggleDevTools:"打開/關閉開發者工具顯示",logFile:"紀錄檔",openAppLog:"開啟程式紀錄檔",openUSILog:"開啟USI通訊紀錄檔",openCSALog:"開啟CSA通訊紀錄檔",tailAppLog:"即時顯示程式紀錄",tailUSILog:"即時顯示USI通訊紀錄",tailCSALog:"即時顯示CSA通訊紀錄",copyAppLogTailCommand:"複製即時顯示程式紀錄指令",copyUSILogTailCommand:"複製即時顯示USI通訊紀錄指令",copyCSALogTailCommand:"複製即時顯示CSA通訊紀錄指令",reloadCustomPieceImage:"重整自訂棋駒圖片",launchUSIEngine:"啟動USI引擎",connectToCSAServer:"連接CSA伺服器",adminMode:"管理模式",inAdminModeYouShouldInvokeCommandsManuallyAtPrompt:"在管理模式下,您需要手動輸入指令方可執行。",setoptionAndPrecedingCommandsWillBeSentAutomatically:"setoption 之前的指令將會被自動發送。",serverMustSupportShogiServerX1ModeLogIn:"對應的 shogi-server 必須支援擴展 (x1) 登入模式。",folders:"資料夾",notification:"通知",notificationTest:"通知測試",thisIsTestNotification:"這是測試用的通知。",app:"軟體",log:"紀錄檔",backup:"備份",cache:"快取",help:"協助",openWebSite:"官方網站",howToUse:"使用教學",openLatestReleasePage:"前往最新版發布頁面",openStableReleasePage:"前往安定版發布頁面",inputs:"輸入目錄",outputs:"輸出目錄",format:"格式",formats:"格式",subdirectories:"子目錄",separately:"個別",merge:"合併",createSubdirectories:"建立子目錄",nameConflictAction:"名稱衝突處理方式",numberSuffix:"附加編號",skip:"跳過該檔案",convert:"開始轉換",openLogFile:"打開記錄檔案",succeeded:"成功",failed:"失敗",skipped:"跳過",game:"對局",player:"玩家",server:"伺服器",selectFromHistory:"從紀錄選取",noHistory:"目前沒有紀錄",saveHistory:"保存紀錄",version:"版本",gameProgress:"對局過程",allGamesCompleted:"連續對局結束",wins:"勝利數目",draws:"平手數目",validGames:"有效對局數",invalidGames:"無效對局數",eloRatingDiff:"等級分相差",ignoreDraws:"忽略平手對局",drawsAreHalfWin:"平手作0.5勝",zValue:"Z值",significance5pc:"顯著性水準5%",significance1pc:"顯著性水準1%",gameEnded:"對局結束",offlineGame:"本地(單機)對局",csaOnlineGame:"通訊對局(CSA)",csaProtocolOnlineGame:"通訊對局(CSA協定)",csaProtocolV121:"CSA協定 1.2.1 標準",csaProtocolV121WithPVComment:"CSA協定 1.2.1 +思考註解",hostToConnect:"連接之伺服器",portNumber:"連接埠號碼",password:"密碼",showPassword:"顯示密碼",keepaliveInitialDelay:"Keepalive初始延遲",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初始延遲",blankLinePingInterval:"空行Ping間隔",logout:"登出",calculateJishogiPoints:"計算持將棋點數",jishogiPoints:"持將棋點數",displayGameResults:"確認戰績",interrupt:"中斷",stopGame:"對局中斷",resign:"投了",draw:"平手",impass:"持將棋",repetitionDraw:"千日手",mate:"詰死",noMate:"無詰",mateSearch:"詰搜尋",startMateSearch:"開始詰搜尋",stopMateSearch:"結束詰搜尋",noMateFound:"在目前的盤面中找不到詰。",timeout:"時間耗盡",foulWin:"反則勝利",foulLose:"反則敗北",enteringOfKing:"入玉勝利",winByDefault:"不戰勝",loseByDefault:"不戰敗",winByDeclaration:"勝利宣言",declareWinning:"勝利宣言",research:"檢討",startResearch:"檢討開始",endResearch:"結束檢討",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"中斷解析",setupPosition:"編輯局面",startPositionSetup:"開始編輯局面",completePositionSetup:"結束編輯局面",changeTurn:"變更手番",initializePosition:"初始化局面",changePieceSet:"調整棋駒數",appSettings:"程式設定",language:"語言",theme:"主題",standard:"標準",green:"綠色",cherryBlossom:"櫻花",customImage:"自定義圖片",autumn:"紅葉",snow:"雪",darkGreen:"深綠",dark:"深色主題",piece:"棋駒",singleKanjiPiece:"一文字駒",singleKanjiGothicPiece:"一文字駒(黑體)",singleKanjiDarkPiece:"一文字駒(深色)",singleKanjiGothicDarkPiece:"一文字駒(黑體・深色)",imageHasMarginsRemoveToDisplayLarger:"圖片含有透明邊界(去除後圖片會略為放大)",backgroundImage:"背景圖片",board:"棋盤",pieceStand:"駒台",lightWoodyTexture:"木目(亮色)",warmWoodTexture:"木目(暖色)",resin:"樹脂",transparent:"透明",boardOpacity:"盤面不透明度",pieceStandOpacity:"駒台不透明度",recordOpacity:"棋譜不透明度",displayFileAndRank:"顯示段・筋",displayLeftControls:"顯示左側操作按鈕",displayRightControls:"顯示右側操作按鈕",tabViewStyle:"分頁顯示形式",oneColumn:"1列",twoColumns:"2列",sounds:"音效",pieceLoudness:"棋駒音效",clockLoudness:"棋鐘音效大小",clockPitch:"棋鐘音效頻率",clockSoundTarget:"棋鐘音效對象",anyTurn:"所有手番",onlyHumanTurn:"只有玩家手番",defaultRecordFileFormat:"預設保存格式",textEncoding:"文字編碼",strict:"檔案原始編碼",autoDetect:"自動判定",newlineCharacter:"換行符號",old90sMac:"90年代Mac",autoSaving:"自動保存",autoSavingDirectory:"棋譜自動保存地點",recordFileName:"棋譜檔案名稱",select:"選擇",positionOfUSIOutput:"USI 局面紀錄格式",movesOfUSIOutput:"USI 棋譜紀錄格式",onlySFEN:"只有 SFEN",usiProtocol:"USI協定",translateOptionName:"選項名稱翻譯",functionalOnJapaneseOnly:"只有在日文選擇時有效",maxStartupTime:"最大起動等待時間",forDevelopers:"開發者用",enableAppLog:"輸出程式紀錄",enableUSILog:"輸出USI通訊紀錄",enableCSALog:"輸出CSA通訊紀錄",logLevel:"紀錄等級",manageEngines:"引擎設定",flipBoard:"盤面反轉",file:"檔案",recordFile:"棋譜檔案",executableFile:"可執行檔案",imageFile:"圖片檔案",unsaved:"未保存",remove:"刪除",deleteMove:"刪除該手",recordProperties:"棋譜情報",comments:"備註",commentsAndBookmarks:"備註・書籤",branches:"分支",bookmark:"書籤",bookmarkList:"書籤一覽",useBookmarkAsHeader:"將書籤名稱作為標題",moveComments:"棋步備註",searchLog:"思考",pv:"預測手順",mateShort:"詰",displayPVShort:"再現",evaluation:"評價值",eval:"評價値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRate:"評價値・期待勝率",swapEachTurnChange:"手番側有利時為正值",alwaysSenteIsPositive:"先手有利時為正值",signOfEvaluation:"評價值符號",winRateCoefficient:"勝率換算係數",monitor:"引擎監視",hideTabView:"最小化",expandTabView:"展開分頁",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",swapSenteGote:"先後交換",currentPosition:"現在局面",enableEngineTimeout:"開啟引擎時間限制",setDifferentTimeForGote:"先後手時間不相同",nextTurn:"手番",elapsedTime:"消費時間",elapsed:"經過時間",rank:"順位",depth:"深度",searchEngine:"引擎",ponder:"對方手番時運算 (Ponder)",numberOfThreads:"執行緒數",multiPV:"多重PV",startPosition:"開始局面",maxMoves:"最大手數",gameRepetition:"連續對局",jishogi:"持將棋",rule24:"24點法",rule27:"27點法",tryRule:"Try Rule",autoRelogin:"自動重新登入",restartItEveryGame:"每局重新啟動",swapTurnWhenGameRepetition:"每局交換手番",outputComments:"輸出備註",saveRecordAutomatically:"自動保存棋譜",adjustBoardToHumanPlayer:"調整到玩家所在方向",adjustBoardAutomatically:"自動調整盤面方向",command:"指令",startGame:"對局開始",cancelGame:"取消對局",allottedTime:"持時間",byoyomi:"讀秒",increments:"增秒",startEndCriteria:"開始・結束條件",endCriteria1Move:"局面結束條件",outputSettings:"輸出設定",noOutputs:"不輸出",insertCommentToTop:"加入到前方",appendCommentToBottom:"在後方新增",insertToComment:"加入到備註欄",insertToRecord:"加入到棋譜",overwrite:"覆寫原檔案",fromPrefix:"從",fromSuffix:"",toPrefix:"到",toSuffix:"",plyPrefix:"第",plySuffix:"手",hoursSuffix:"小時",minutesSuffix:"分",secondsSuffix:"秒",engineManagement:"引擎管理",engineName:"引擎名稱",author:"作者",earlyPonder:"預先Ponder",enginePath:"場所",openDirectory:"開啟資料夾",displayName:"表示名稱",invoke:"執行",resetToEngineDefaultValues:"回復至引擎預設設定",defaultValue:"預設値",noEngineRegistered:"尚未登錄引擎。",duplicate:"複製",add:"追加",recommended:"推薦",import:"匯入",saveAndClose:"保存並關閉",save:"保存",saveAs:"另存為",history:"歷史紀錄",clearHistory:"清除歷史紀錄",userFile:"使用者檔案",automaticBackup:"自動備份",restore:"復原",loadRecordFromWeb:"從網際網路取得棋譜",fetchLatestData:"取得最新資料",sourceURL:"來源網址",ok:"OK",cancel:"取消",back:"返回",name:"名稱",prediction:"預測",best:"最善",nodes:"Node數",hashUsage:"Hash使用率",stop:"停止",resume:"重新開始",nonHandicap:"平手",lanceHandicap:"香落",rightLanceHandicap:"右香落",bishopHandicap:"角落",rookHandicap:"飛車落",rookLanceHandicap:"飛車香落",twoPiecesHandicap:"二枚落",fourPiecesHandicap:"四枚落",sixPiecesHandicap:"六枚落",eightPiecesHandicap:"八枚落",tenPiecesHandicap:"十枚落",tsumeShogi:"詰將棋",doubleKingTsumeShogi:"雙玉詰將棋",startDateTime:"開始日時",endDateTime:"結束日時",gameDate:"對局日",tournament:"棋戰",strategy:"戰型",gameTitle:"標題",timeLimit:"限時",blackTimeLimit:"先手限時",whiteTimeLimit:"後手限時",place:"地點",postedOn:"登錄於",note:"備註",senteShortName:"先手省略名",goteShortName:"後手省略名",opusNo:"作品編號",opusName:"作品名",publishedBy:"發表於",publishedOn:"發表年月",source:"來源",numberOfMoves:"手數",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"搜尋設定名稱",filterByEngineName:"搜尋引擎名稱",bookStyle:"書籍風",gameStyle:"對局畫面風",thin:"細",bold:"粗",extraBold:"特粗",playerName:"對局者名稱",typeface:"字體",weight:"字體粗細",handLabel:"持駒標題",header:"標題",vertical:"垂直調整",size:"大小",none:"無",bgCover:"圖片置中",bgContain:"擴大表示",bgTile:"磁磚狀表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"惡手",blunder:"大惡手",inaccuracyThreshold:"緩手閾値",dubiousThreshold:"疑問手閾値",mistakeThreshold:"惡手閾値",blunderThreshold:"大惡手閾値",gothic:"黑體",mincho:"明體",appVersion:"軟體版本",installed:"已安裝",stable:"安定版",latest:"最新版",backgroundColor:"背景顏色",dialogBackdrop:"ダイアログ表示中の暗転",record:"棋譜",chart:"圖表",analytics:"解析",controlGroup:"選單",left:"左方間隔",top:"上方間隔",width:"寬度",height:"高度",newCustomProfile:"新增佈局設定",addCustomLayoutProfile:"新增佈局設定",duplicateCurrentProfile:"複製目前佈局設定",removeCurrentProfile:"移除該佈局設定",exportProfileToClipboard:"將佈局設定複製至剪貼板",importProfileFromClipboard:"自剪貼板匯入佈局設定",profileExportedToClipboard:"該佈局已複製至剪貼板。",profileImported:"該佈局已成功匯入。",failedToImportProfile:"佈局匯入失敗。",rightControlBox:"右側選單",leftControlBox:"左側選單",topControlBox:"操作按鈕",legends:"圖例",historyMode:"歷史模式",headers:"解析表頭",playButton:"再現按鈕",insert:"插入",bringForward:"前面へ",sendBackward:"背面へ",updatedAt:"更新時間",createdAt:"建立時間",lastSent:"最後送出",lastReceived:"最後接收",protocolVersion:"協定版本",prompt:"指令",openPrompt:"打開指令視窗",forceQuit:"強制退出",forceClose:"強制關閉",blankLine:"空行",autoScroll:"自動捲動",showTimestamp:"顯示時間戳章",highlightByPartialMatch:"反白部分一致部分",csaServer:"CSA伺服器",usiEngine:"USI引擎",noRunningUSIEngine:"目前沒有啟動中的USI引擎。",noConnectedCSAServer:"尚未連接CSA伺服器。",willBeRemovedFromTheListSoon:"由於 Session 結束,將會自一覽清除。",typeCommandHereAndPressEnter:"輸入指令後按下 Enter 以發送",allowBlankLine:"允許空行",removeSpaceFromBothEnds:"消除前後空白",collapseSequentialSpaces:"整理連續空白",typeCustomTitleHere:"輸入自定義標題",displayEmptyElements:"顯示未定義資料",waitingForNewGame:"正在等待下一場對局開始。",waitingForPlayerSetup:"正在等待對局者準備。",insertedComment:"已加入備註。",conversionCompleted:"轉換完成。",tryingToConnectAndLoginToCSAServer:"正在連接並登入CSA伺服器。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※在瀏覽器版本中紀錄會於 console 中顯示,並無視此處的設定。",shouldRestartToApplyLogSettings:"※您需要重新啟動本程式以使用變更後的紀錄設定。",canOpenLogDirectoryFromMenu:"※紀錄的輸出檔案可以在「偵錯」-「開啟紀錄檔案資料夾」開啟。",hasNoOldLogCleanUpFeature:"※現在並沒有舊紀錄的自動刪除機制。",processingPleaseWait:"現在處理中。請稍待一會。",importingFollowingRecordOrPosition:"將匯入以下棋譜(局面)。",supportsKIF_KI2_CSA_USI_SFEN_JKF:"※支援KIF/KI2/CSA/USI/SFEN/JKF形式。",pleasePasteRecordIntoTextArea:"※請在文字輸入區域貼上您的棋譜。",pleaseSpecifyPlainTextURL:"※請輸入您要使用的URL。",redirectNotSupported:"※無法使用重新導向連結。",desktopVersionPastesAutomatically:"※安裝程式版將會自動貼上棋譜。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期 Ponder 機能將會發送やねうら王自行定義之 ponderhit 指令。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"若您的引擎不支援該指令,可能會有預期外之行為發生。",someLogsDisabled:"部份 log 已被無效化。",logsRecommendedForCSAProtocol:"若使用CSA協定對局,建議輸出各項紀錄。",pleaseEnableLogsAndRestart:"請在程式設定中開啟紀錄並重新啟動本程式。",notSendPVOnStandardCSAProtocol:"在標準的CSA協定中不會送出評價值以及思考棋步。",csaProtocolSendPlaintextPassword:"在CSA協定中,密碼為明文傳輸。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"由於無法使用系統的加密機能,輸入的密碼將會以明文保存。",pleaseUncheckSaveHistoryIfNotWantSave:"若不想保存密碼,請不要將「保存紀錄」勾選。",csaProtocolSendPlaintextPasswordRegardlessOfHistory:"不過,CSA協定仍會以明文傳輸您的密碼。",whenNewVersionIsAvailableItWillBeNotified:"將會在新版本發布時進行通知。",pleaseCheckMessageThisIsTestNotificationByAboveButton:"上方按鈕會發送「這是測試用的通知。」的通知訊息。",ifNotWorkYouShouldAllowNotificationOnOSSetting:"若無法顯示,請在使用的作業系統中許可本程式的通知。",translationHelpNeeded:"我們正在招募翻譯人員。",restartRequiredAfterLocaleChange:"更改語言後,請重新啟動本程式。",areYouSureWantToResign:"確定要投了嗎?",areYouSureWantToDoDeclaration:"確定要進行勝利宣言嗎?",areYouSureWantToQuitGames:"要中斷連續對局嗎?",areYouSureWantToRequestQuit:"若提出中斷要求,可能會被判負。請問您要繼續嗎?",areYouSureWantToClearRecord:"將會刪除現在的棋譜。請問您要繼續嗎?",areYouSureWantToDiscardPosition:"將不會保存現在的局面。請問您要繼續嗎?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"會將現在的棋譜關閉並開啟別的檔案,請問您要繼續嗎?",areYouSureWantToClearHistory:"將清除紀錄。請問您要繼續嗎?",areYouSureWantToRemoveCurrentProfile:"將移除現在的設定。請問您要繼續嗎?",yamlFormatSettingsCopiedToClipboard:"已將 YAML 格式之設定複製到剪貼板。",jsonFormatSettingsCopiedToClipboard:"已將 JSON 格式之設定複製到剪貼板。",usiCsaBridgeCommandCopiedToClipboard:"已將 usi-csa-bridge 指令複製到剪貼板。",youCanNotCloseAppWhileCSAOnlineGame:"由於CSA協定正在使用中,本程式無法被關閉。",fileExtensionNotSupported:"無法使用該副檔名。",errorOccuredWhileDisconnectingFromCSAServer:"在與CSA伺服器中斷連線時發生錯誤。",failedToConnectToCSAServer:"無法連接CSA伺服器。",errorOccuredWhileLogoutFromCSAServer:"在登出 CSA 伺服器時發生錯誤。",disconnectedFromCSAServer:"與CSA伺服器的連接結束。",csaServerLoginDenied:"您對CSA伺服器的登入被拒絕。",thisFeatureNotAvailableOnWebApp:"Web版無法使用本機能",failedToStartNewGame:"對局開始失敗。",errorOccuredWhileEndingGame:"在對局結束時發生錯誤。",failedToSendGoCommand:"無法送出go指令。",failedToSendPonderCommand:"無法送出ponder指令。",failedToSendStopCommand:"無法送出stop指令。",failedToShutdownEngines:"引擎無法正常結束。",failedToCheckUpdates:"無法確認更新。",failedToSaveRecord:"棋譜保存失敗。",failedToParseSFEN:"SFEN讀取失敗。",failedToDetectRecordFormat:"無法判別棋譜形式。",unknown:"未知",unknownFileExtension:"未知的檔案形式。",emptyRecordInput:"您尚未輸入棋譜。",invalidPieceName:"不合法的棋駒",invalidTurn:"不合法的手番",invalidMove:"不合法的棋步",invalidMoveNumber:"不合法的手數",invalidDestination:"不合法的移動目的地",pieceNotExists:"不存在的棋駒",invalidLine:"不存在的行",invalidBoard:"不合法的盤面",invalidHandPiece:"不合法的持駒",invalidUSI:"不合法的USI",backgroundImageFileNotSelected:"尚未選取背景圖片。",pieceImageFileNotSelected:"尚未選取棋駒圖片。",boardImageFileNotSelected:"尚未選取盤面圖片。",pieceStandImageFileNotSelected:"尚未選取駒台圖片。",pieceVolumeMustBe0To100Percent:"請在0%~100%之間指定棋駒音效大小。",clockVolumeMustBe0To100Percent:"請在0%~100%之間指定棋鐘音效大小。",clockPitchMustBe220To880Hz:"請在220Hz~880Hz之間指定棋鐘音效頻率。",engineTimeoutMustBe1To300Seconds:"請在1秒~300秒之間指定引擎執行最長時間。",coefficientInSigmoidMustBeGreaterThan0:"請將勝率換算係數填為大於0之值。",inaccuracyThresholdMustBe1To100Percent:"請在0%~100%之間指定緩手門檻。",dubiousThresholdMustBe1To100Percent:"請在0%~100%之間指定疑問手門檻。",mistakeThresholdMustBe1To100Percent:"請在0%~100%之間指定惡手門檻。",blunderThresholdMustBe1To100Percent:"請在0%~100%之間指定大惡手門檻。",recordSavedWithGarbledCharacters:"保存的棋譜有部分可能會造成亂碼。",pleaseConsiderToUseKIFU:"建議您使用KIFU形式(UTF-8)儲存您的棋譜。",youCanChangeDefaultRecordFileFormatFromAppSettings:"預設棋譜檔案格式可以在程式設定中進行更動。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手門檻應小於疑問手門檻。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手門檻應小於惡手門檻。",mistakeThresholdMustBeLessThanBlunderThreshold:"惡手門檻應小於大惡手門檻。",thisEngineNotSupportsMateSearch:"這個引擎不支援詰將棋搜索。",pleaseEndActiveFeaturesBeforeOpenRecord:"請關閉現正運行的功能再開啟棋譜。",bothTimeLimitAndByoyomiAreNotSet:"持時間與讀秒尚未設置。",canNotUseByoyomiWithFischer:"讀秒與 Fischer 選項無法同時併用。",repeatsMustBeOneIfHumanPlayerIncluded:"若要與人對局,連續對局次數僅能設為 1 。",protocolVersionNotSelected:"請選擇協定版本。",hostNameIsEmpty:"主機名稱為空。",invalidPortNumber:"不可用的連接埠號碼。",idIsEmpty:"ID 為空。",idContainsSpace:"ID 含有空白字符。",passwordContainsSpace:"密碼含有空白字符。",tcpKeepaliveInitialDelayMustBePositive:"請輸入正確的TCP Keepalive初始延遲時間。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出初始延遲時間。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出間隔時間。",engineNotSelected:"尚未選擇引擎。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"如要監看轉換紀錄,請在程式設定內設定 log level 到 Debug 並重新啟動本程式。",sourceDirectoryNotSpecified:"輸入目錄尚未被指定。",sourceFormatsNotSpecified:"輸入格式尚未被指定。",destinationDirectoryNotSpecified:"輸出格式尚未被指定。",destinationFileNotSpecified:"輸出檔案尚未被指定。",totalNumber:e=>`總計 ${e} 筆`,number:e=>`${e} 筆`,tryToReloginToCSAServerNSecondsLater:e=>`請在${e}秒後再次嘗試登入 CSA 伺服器。`,mateInNPlyDoYouWantToDisplay:e=>`尋找到${e}手詰。要顯示結果嗎?`,insertedNMovesToRecord:e=>`已加入${e}手到棋譜。`,errorsOccurred:e=>`發生 ${e} 種類的錯誤。`,between:(e,t)=>`自 ${e} 到 ${t} `,addNthEngine:e=>`追加第 ${e} 個引擎`,copyOf:e=>`${e} 的拷貝`,keepLatest:e=>`到最新${e}件`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下的資料由於 ${e} 格式無法支援的原因無法保存。`,areYouSureWantToDeleteFollowingMove:e=>`將會刪除${e}手目以後的棋譜。請問您要繼續嗎?`,failedToOpenDirectory:e=>`無法開啟檔案目錄:${e}`,unexpectedEventSenderPleaseReport:e=>`無法預期的事件發送方已發生。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`無法預期的 HTTP 方法。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`無法從 URL 獲取資訊。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`引擎在${e}秒内沒有回應。若引擎的啟動時間稍長,請在設定中調整引擎最長等待時間。`,stableVersionReleased:e=>`安定版 ${e} 已經發布!`,latestVersionReleased:e=>`最新版 ${e} 已經發布!`}},7445:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRecordMetadataName=function(e){switch(e){case i.RecordMetadataKey.BLACK_NAME:return n.t.sente;case i.RecordMetadataKey.WHITE_NAME:return n.t.gote;case i.RecordMetadataKey.SHITATE_NAME:return n.t.shitate;case i.RecordMetadataKey.UWATE_NAME:return n.t.uwate;case i.RecordMetadataKey.START_DATETIME:return n.t.startDateTime;case i.RecordMetadataKey.END_DATETIME:return n.t.endDateTime;case i.RecordMetadataKey.DATE:return n.t.gameDate;case i.RecordMetadataKey.TOURNAMENT:return n.t.tournament;case i.RecordMetadataKey.STRATEGY:return n.t.strategy;case i.RecordMetadataKey.TITLE:return n.t.gameTitle;case i.RecordMetadataKey.TIME_LIMIT:return n.t.timeLimit;case i.RecordMetadataKey.BLACK_TIME_LIMIT:return n.t.blackTimeLimit;case i.RecordMetadataKey.WHITE_TIME_LIMIT:return n.t.whiteTimeLimit;case i.RecordMetadataKey.BYOYOMI:return n.t.byoyomi;case i.RecordMetadataKey.TIME_SPENT:return n.t.elapsedTime;case i.RecordMetadataKey.MAX_MOVES:return n.t.maxMoves;case i.RecordMetadataKey.JISHOGI:return n.t.jishogi;case i.RecordMetadataKey.PLACE:return n.t.place;case i.RecordMetadataKey.POSTED_ON:return n.t.postedOn;case i.RecordMetadataKey.NOTE:return n.t.note;case i.RecordMetadataKey.BLACK_SHORT_NAME:return n.t.senteShortName;case i.RecordMetadataKey.WHITE_SHORT_NAME:return n.t.goteShortName;case i.RecordMetadataKey.OPUS_NO:return n.t.opusNo;case i.RecordMetadataKey.OPUS_NAME:return n.t.opusName;case i.RecordMetadataKey.AUTHOR:return n.t.author;case i.RecordMetadataKey.PUBLISHED_BY:return n.t.publishedBy;case i.RecordMetadataKey.PUBLISHED_AT:return n.t.publishedOn;case i.RecordMetadataKey.SOURCE:return n.t.source;case i.RecordMetadataKey.LENGTH:return n.t.numberOfMoves;case i.RecordMetadataKey.INTEGRITY:return n.t.integrity;case i.RecordMetadataKey.CATEGORY:return n.t.recordCategory;case i.RecordMetadataKey.AWARD:return n.t.award}};const i=o(3113),n=o(1874)},1874:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.t=void 0,t.setLanguage=function(e){Object.entries(function(e){switch(e){case i.Language.JA:return a.ja;case i.Language.EN:return n.en;case i.Language.ZH_TW:return r.zh_tw;default:return a.ja}}(e)).forEach((([e,o])=>{t.t[e]=o}))};const i=o(9365),n=o(855),a=o(9445),r=o(8584);t.t=a.ja},9233:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.usiOptionNameMap=void 0,t.setLanguage=function(e){Object.keys(t.usiOptionNameMap).forEach((e=>{delete t.usiOptionNameMap[e]})),Object.entries(function(e){switch(e){case i.Language.JA:return n;case i.Language.EN:default:return{}}}(e)).forEach((([e,o])=>{t.usiOptionNameMap[e]=o}))};const i=o(9365),n={USI_Ponder:"相手番思考",Ponder:"相手番思考",USI_Hash:"ハッシュ",Hash:"ハッシュ",Clear_Hash:"ハッシュクリア",Threads:"スレッド",NumberOfThreads:"スレッド数",thread_num_per_gpu:"GPUあたりのスレッド数",ThreadIdOffset:"スレッドIDオフセット",MultiPV:"マルチPV",BookFile:"定跡ファイル",Book_File:"定跡ファイル",Book_Enable:"定跡あり",BookEvalDiff:"定跡の評価値差",book_file_name:"定跡ファイル名",use_book:"定跡を使用",BookPvMoves:"定跡PV手数",TinyBook:"小さい定跡",BookMoves:"定跡利用手数",BookMaxPly:"定跡最大手数",BookIgnoreRate:"定跡不使用率",RandomBookSelect:"ランダム定跡選択",IgnoreBookPly:"定跡の手数を無視",DepthLimit:"最大深さ",NarrowBook:"定跡手を限定",WriteDebugLog:"デバッグログ出力",Write_Debug_Log:"デバッグログ出力",ResignValue:"投了基準値",ResignScore:"投了基準値",PvInterval:"PV出力間隔",NodesLimit:"最大ノード数",USI_OwnBook:"定跡を使用",OwnBook:"定跡を使用",EvalDir:"評価関数のフォルダ",Eval_Dir:"評価関数のフォルダ",EvalFile:"評価関数ファイル",EvalHash:"評価値ハッシュ",Eval_Hash:"評価値ハッシュ",EvalSaveDir:"評価関数保存フォルダ",EvalShare:"評価値共有",BookDir:"定跡ファイルのフォルダ",Stochastic_Ponder:"相手番思考(確率的)",MinimumThinkingTime:"最小思考時間",Minimum_Thinking_Time:"最小思考時間",MinThinkingTime:"最小思考時間",MaxMovesToDraw:"強制引き分け手数",SlowMover:"長考",Slow_Mover:"長考",OutputFailLHPV:"Fail Low/Highを出力",NetworkDelay:"通信遅延",NetworkDelay2:"通信遅延2",FV_SCALE:"評価値スケール",UseBook:"定跡を使用",MaxDepth:"最大深さ",MarginMs:"マージン(ミリ秒)",Time_Margin:"時間マージン",ByoyomiMargin:"秒読みマージン",Byoyomi_Margin:"秒読みマージン",byoyomi_margin:"秒読みマージン",Move_Overhead:"着手オーバーヘッド",FischerMargin:"フィッシャーマージン",SuddenDeathMargin:"切れ負けマージン",Snappy:"素早く指す",EnteringKingRule:"入玉ルール",Do_YoTsume_Search:"余詰めを探索",gpu_num:"GPU数",ConsiderationMode:"検討モード",ConsiderBookMoveCount:"定跡出現率を使用",GenerateAllLegalMoves:"全合法手を生成",DrawScore:"引き分けのスコア",DrawValue:"引き分けの値",DrawValueBlack:"引き分けの値(先手)",DrawValueWhite:"引き分けの値(後手)",LargePageEnable:"LargePageを使用",SkillLevel:"スキルレベル",Skill_Level:"スキルレベル"};t.usiOptionNameMap={}},1219:(e,t)=>{var o,i;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=t.LogType=void 0,function(e){e.APP="app",e.USI="usi",e.CSA="csa"}(o||(t.LogType=o={})),function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(i||(t.LogLevel=i={}))},9273:(e,t)=>{var o;function i(){return{startCriteria:{enableNumber:!1,number:20},endCriteria:{enableNumber:!1,number:100},perMoveCriteria:{maxSeconds:5},commentBehavior:o.INSERT}}Object.defineProperty(t,"__esModule",{value:!0}),t.CommentBehavior=void 0,t.defaultAnalysisSettings=i,t.normalizeAnalysisSettings=function(e){return{...i(),...e,startCriteria:{enableNumber:!1,number:20,...e.startCriteria},endCriteria:{enableNumber:!1,number:100,...e.endCriteria},perMoveCriteria:{maxSeconds:5,...e.perMoveCriteria}}},function(e){e.NONE="none",e.INSERT="insert",e.APPEND="append",e.OVERWRITE="overwrite"}(o||(t.CommentBehavior=o={}))},7748:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PositionImageFontWeight=t.PositionImageHandLabelType=t.PositionImageTypeface=t.PositionImageStyle=t.ClockSoundTarget=t.EvaluationViewFrom=t.TextDecodingRule=t.Tab=t.TabPaneType=t.RightSideControlType=t.LeftSideControlType=t.BoardLabelType=t.PieceStandImageType=t.BoardImageType=t.KingPieceType=t.PieceImageType=t.BackgroundImageType=t.Thema=void 0,t.isLogEnabled=function(e,t){switch(e){case n.LogType.APP:return t.enableAppLog;case n.LogType.USI:return t.enableUSILog;case n.LogType.CSA:return t.enableCSALog}},t.buildUpdatedAppSettings=function(e,t){const o={...e,...t};if(o.tabPaneType===S.DOUBLE)switch(o.tab){case f.COMMENT:o.tab=f.RECORD_INFO;break;case f.CHART:case f.PERCENTAGE_CHART:o.tab=f.PV}0!==e.topPaneHeightPercentage&&100!==e.topPaneHeightPercentage&&(o.topPanePreviousHeightPercentage=e.topPaneHeightPercentage);return P(o)||o},t.defaultAppSettings=A,t.normalizeAppSettings=function(e,t){const o={...A(t),...e};(o.autoSaveDirectory.endsWith("\\")||o.autoSaveDirectory.endsWith("/"))&&(o.autoSaveDirectory=o.autoSaveDirectory.slice(0,-1));if(!e.pieceStandImage)switch(e.boardImage){default:o.pieceStandImage=m.STANDARD;break;case u.DARK:o.pieceStandImage=m.DARK;break;case u.GREEN:o.pieceStandImage=m.GREEN;break;case u.CHERRY_BLOSSOM:o.pieceStandImage=m.CHERRY_BLOSSOM}o.tab===f.INVISIBLE&&(o.tab=f.RECORD_INFO);if(!e.positionImageFontWeight)if(e.positionImageTypeface===T.MINCHO)o.positionImageFontWeight=C.W700X;else o.positionImageFontWeight=C.W400X;return o},t.validateAppSettings=P,t.getPieceImageURLTemplate=function(e){switch(e.pieceImage){case c.HITOMOJI_DARK:return"./piece/hitomoji_dark/${piece}.png";case c.HITOMOJI_GOTHIC:return"./piece/hitomoji_gothic/${piece}.png";case c.HITOMOJI_GOTHIC_DARK:return"./piece/hitomoji_gothic_dark/${piece}.png";case c.CUSTOM_IMAGE:if(e.croppedPieceImageBaseURL){const t=e.croppedPieceImageQuery?`?${e.croppedPieceImageQuery}`:"";return e.croppedPieceImageBaseURL+"/${piece}.png"+t}}return"./piece/hitomoji/${piece}.png"};const i=o(8474),n=o(1219),a=o(6059),r=o(8574);var s,l,c,d,u,m,p,h,g,S,f,y,v,b,I,T,E,C;function A(e){return{language:i.Language.JA,thema:s.STANDARD,backgroundImageType:l.NONE,pieceImage:c.HITOMOJI,kingPieceType:d.GYOKU_AND_OSHO,deletePieceImageMargin:!1,boardImage:u.RESIN2,pieceStandImage:m.STANDARD,enableTransparent:!1,boardOpacity:1,pieceStandOpacity:1,recordOpacity:1,boardLabelType:p.STANDARD,leftSideControlType:h.STANDARD,rightSideControlType:g.STANDARD,pieceVolume:30,clockVolume:30,clockPitch:500,clockSoundTarget:b.ONLY_USER,boardFlipping:!1,tabPaneType:S.DOUBLE,tab:f.RECORD_INFO,tab2:f.COMMENT,topPaneHeightPercentage:60,topPanePreviousHeightPercentage:60,bottomLeftPaneWidthPercentage:60,defaultRecordFileFormat:a.RecordFileFormat.KIF,textDecodingRule:y.AUTO_DETECT,returnCode:e?.returnCode||"\r\n",autoSaveDirectory:e?.autoSaveDirectory||"",recordFileNameTemplate:r.defaultRecordFileNameTemplate,useCSAV3:!1,enableUSIFileStartpos:!0,enableUSIFileResign:!1,translateEngineOptionName:!0,engineTimeoutSeconds:10,evaluationViewFrom:v.EACH,coefficientInSigmoid:600,badMoveLevelThreshold1:5,badMoveLevelThreshold2:10,badMoveLevelThreshold3:20,badMoveLevelThreshold4:50,showElapsedTimeInRecordView:!0,showCommentInRecordView:!0,enableAppLog:!1,enableUSILog:!1,enableCSALog:!1,logLevel:n.LogLevel.INFO,positionImageStyle:I.BOOK,positionImageSize:500,positionImageTypeface:T.GOTHIC,positionImageHandLabelType:E.PLAYER_NAME,useBookmarkAsPositionImageHeader:!1,positionImageHeader:"",positionImageCharacterY:0,positionImageFontScale:1,positionImageFontWeight:C.W400X,lastRecordFilePath:"",lastUSIEngineFilePath:"",lastImageExportFilePath:"",lastOtherFilePath:"",emptyRecordInfoVisibility:!0}}function P(e){return e.backgroundImageType===l.NONE||e.backgroundImageFileURL?e.pieceImage!==c.CUSTOM_IMAGE||e.pieceImageFileURL&&e.croppedPieceImageBaseURL?e.boardImage!==u.CUSTOM_IMAGE||e.boardImageFileURL?e.pieceStandImage!==m.CUSTOM_IMAGE||e.pieceStandImageFileURL?e.pieceVolume<0||e.pieceVolume>100?new Error(i.t.pieceVolumeMustBe0To100Percent):e.clockVolume<0||e.clockVolume>100?new Error(i.t.clockVolumeMustBe0To100Percent):e.clockPitch<220||e.clockPitch>880?new Error(i.t.clockPitchMustBe220To880Hz):e.engineTimeoutSeconds<1||e.engineTimeoutSeconds>300?new Error(i.t.engineTimeoutMustBe1To300Seconds):e.coefficientInSigmoid<=0?new Error(i.t.coefficientInSigmoidMustBeGreaterThan0):e.badMoveLevelThreshold1<1||e.badMoveLevelThreshold1>100?new Error(i.t.inaccuracyThresholdMustBe1To100Percent):e.badMoveLevelThreshold2<1||e.badMoveLevelThreshold2>100?new Error(i.t.dubiousThresholdMustBe1To100Percent):e.badMoveLevelThreshold3<1||e.badMoveLevelThreshold3>100?new Error(i.t.mistakeThresholdMustBe1To100Percent):e.badMoveLevelThreshold4<1||e.badMoveLevelThreshold4>100?new Error(i.t.blunderThresholdMustBe1To100Percent):e.badMoveLevelThreshold1>=e.badMoveLevelThreshold2?new Error(i.t.inaccuracyThresholdMustBeLessThanDubiousThreshold):e.badMoveLevelThreshold2>=e.badMoveLevelThreshold3?new Error(i.t.dubiousThresholdMustBeLessThanMistakeThreshold):e.badMoveLevelThreshold3>=e.badMoveLevelThreshold4?new Error(i.t.mistakeThresholdMustBeLessThanBlunderThreshold):void 0:new Error(i.t.pieceStandImageFileNotSelected):new Error(i.t.boardImageFileNotSelected):new Error(i.t.pieceImageFileNotSelected):new Error(i.t.backgroundImageFileNotSelected)}!function(e){e.STANDARD="standard",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark"}(s||(t.Thema=s={})),function(e){e.NONE="none",e.COVER="cover",e.CONTAIN="contain",e.TILE="tile"}(l||(t.BackgroundImageType=l={})),function(e){e.HITOMOJI="hitomoji",e.HITOMOJI_DARK="hitomojiDark",e.HITOMOJI_GOTHIC="hitomojiGothic",e.HITOMOJI_GOTHIC_DARK="hitomojiGothicDark",e.CUSTOM_IMAGE="custom-image"}(c||(t.PieceImageType=c={})),function(e){e.GYOKU_AND_OSHO="gyokuAndOsho",e.GYOKU_AND_GYOKU="gyokuAndGyoku"}(d||(t.KingPieceType=d={})),function(e){e.LIGHT="light",e.WARM="warm",e.RESIN="resin",e.RESIN2="resin2",e.RESIN3="resin3",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(u||(t.BoardImageType=u={})),function(e){e.STANDARD="standard",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(m||(t.PieceStandImageType=m={})),function(e){e.NONE="none",e.STANDARD="standard"}(p||(t.BoardLabelType=p={})),function(e){e.NONE="none",e.STANDARD="standard"}(h||(t.LeftSideControlType=h={})),function(e){e.NONE="none",e.STANDARD="standard"}(g||(t.RightSideControlType=g={})),function(e){e.SINGLE="single",e.DOUBLE="double"}(S||(t.TabPaneType=S={})),function(e){e.RECORD_INFO="recordInfo",e.COMMENT="comment",e.SEARCH="search",e.PV="pv",e.CHART="chart",e.PERCENTAGE_CHART="percentageChart",e.MONITOR="monitor",e.INVISIBLE="invisible"}(f||(t.Tab=f={})),function(e){e.STRICT="strict",e.AUTO_DETECT="autoDetect"}(y||(t.TextDecodingRule=y={})),function(e){e.BLACK="black",e.EACH="each"}(v||(t.EvaluationViewFrom=v={})),function(e){e.ALL="all",e.ONLY_USER="onlyUser"}(b||(t.ClockSoundTarget=b={})),function(e){e.BOOK="book",e.GAME="game"}(I||(t.PositionImageStyle=I={})),function(e){e.GOTHIC="gothic",e.MINCHO="mincho"}(T||(t.PositionImageTypeface=T={})),function(e){e.PLAYER_NAME="playerName",e.SENTE_GOTE="senteGote",e.MOCHIGOMA="mochigoma",e.TSUME_SHOGI="tsumeShogi",e.NONE="none"}(E||(t.PositionImageHandLabelType=E={})),function(e){e.W400="400",e.W400X="400+",e.W700X="700+"}(C||(t.PositionImageFontWeight=C={}))},2587:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FileNameConflictAction=t.DestinationType=void 0,t.defaultBatchConversionSettings=s,t.normalizeBatchConversionSettings=function(e){return{...s(),...e}},t.validateBatchConversionSettings=function(e){if(!e.source)return new Error(n.t.sourceDirectoryNotSpecified);if(0===e.sourceFormats.length)return new Error(n.t.sourceFormatsNotSpecified);switch(e.destinationType){case a.DIRECTORY:if(!e.destination)return new Error(n.t.destinationDirectoryNotSpecified);break;case a.SINGLE_FILE:if(!e.singleFileDestination)return new Error(n.t.destinationFileNotSpecified);break;default:return new Error("Invalid destination type.")}};const i=o(6059),n=o(8474);var a,r;function s(){return{source:"",sourceFormats:[i.RecordFileFormat.KIF,i.RecordFileFormat.KIFU,i.RecordFileFormat.KI2,i.RecordFileFormat.KI2U,i.RecordFileFormat.CSA,i.RecordFileFormat.JKF],subdirectories:!0,destinationType:a.DIRECTORY,destination:"",createSubdirectories:!0,destinationFormat:i.RecordFileFormat.KIF,fileNameConflictAction:r.NUMBER_SUFFIX,singleFileDestination:""}}!function(e){e.DIRECTORY="directory",e.SINGLE_FILE="singleFile"}(a||(t.DestinationType=a={})),function(e){e.OVERWRITE="overwrite",e.NUMBER_SUFFIX="numberSuffix",e.SKIP="skip"}(r||(t.FileNameConflictAction=r={}))},3010:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.maxServerHistoryLength=t.CSAProtocolVersion=void 0,t.defaultCSAServerSettings=m,t.defaultCSAGameSettings=function(){return{player:{name:"人",uri:r.ES_HUMAN},server:m(),autoFlip:!0,enableComment:!0,enableAutoSave:!0,repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}},t.validateCSAServerSettings=p,t.validateCSAGameSettings=function(e){const t=(0,s.validatePlayerSettings)(e.player);if(t)return t;const o=p(e.server);if(o)return o;if(e.server.protocolVersion!==u.V121&&e.server.protocolVersion!==u.V121_FLOODGATE)return new Error("protocolVersion must be v121 or v121_floodgate");if(!Number.isInteger(e.repeat)||e.repeat<1)return new Error("repeat must be a positive integer")},t.defaultCSAGameSettingsHistory=function(){return{player:{name:"人",uri:r.ES_HUMAN},serverHistory:[],autoFlip:!0,enableComment:!0,enableAutoSave:!0,repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}},t.buildCSAGameSettingsByHistory=function(e,t){return{player:e.player,server:e.serverHistory?.length>t?e.serverHistory[t]:m(),autoFlip:e.autoFlip,enableComment:e.enableComment,enableAutoSave:e.enableAutoSave,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.appendCSAGameSettingsHistory=function(e,o){const i=[o.server];for(const n of e.serverHistory)if(n.protocolVersion===o.server.protocolVersion&&n.host===o.server.host&&n.port===o.server.port&&n.id===o.server.id&&n.password===o.server.password&&n.tcpKeepalive.initialDelay===o.server.tcpKeepalive.initialDelay&&!n.blankLinePing==!o.server.blankLinePing&&n.blankLinePing?.initialDelay===o.server.blankLinePing?.initialDelay&&n.blankLinePing?.interval===o.server.blankLinePing?.interval||i.push(n),i.length===t.maxServerHistoryLength)break;return{player:o.player,serverHistory:i,autoFlip:o.autoFlip,enableComment:o.enableComment,enableAutoSave:o.enableAutoSave,repeat:o.repeat,autoRelogin:o.autoRelogin,restartPlayerEveryGame:o.restartPlayerEveryGame}},t.emptySecureCSAServerSettings=h,t.defaultSecureCSAGameSettingsHistory=g,t.normalizeSecureCSAGameSettingsHistory=function(e){const t=[];for(const o of e.serverHistory)t.push({...h(),...o});return{...g(),...e,player:{...(0,s.defaultPlayerSettings)(),...e.player},serverHistory:t}},t.encryptCSAGameSettingsHistory=function(e,t){const o=[];for(const i of e.serverHistory){const e={protocolVersion:i.protocolVersion,host:i.host,port:i.port,id:i.id,tcpKeepalive:i.tcpKeepalive};i.blankLinePing&&(e.blankLinePing=i.blankLinePing),t?e.encryptedPassword=t(i.password):e.password=i.password,o.push(e)}return{player:e.player,serverHistory:o,autoFlip:e.autoFlip,enableComment:e.enableComment,enableAutoSave:e.enableAutoSave,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.decryptCSAGameSettingsHistory=function(e,t){const o=[];for(const i of e.serverHistory){const e={protocolVersion:i.protocolVersion,host:i.host,port:i.port,id:i.id,password:t&&i.encryptedPassword?t(i.encryptedPassword):i.password||"",tcpKeepalive:i.tcpKeepalive};i.blankLinePing&&(e.blankLinePing=i.blankLinePing),o.push(e)}return{player:e.player,serverHistory:o,autoFlip:e.autoFlip,enableComment:e.enableComment,enableAutoSave:e.enableAutoSave,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.exportCSAGameSettingsForCLI=function(e,t){if(!r.isUSIEngine(e.player.uri)||!e.player.usi)return new Error("player must be USI engine.");return{usi:(0,c.exportUSIEnginesForCLI)(e.player.usi),server:e.server,saveRecordFile:e.enableAutoSave,enableComment:e.enableComment,recordFileNameTemplate:t.recordFileNameTemplate,recordFileFormat:t.defaultRecordFileFormat,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.importCSAGameSettingsForCLI=function(e,t){const o=(0,c.importUSIEnginesForCLI)(e.usi,t);return{player:{name:e.usi.name,uri:o.uri,usi:o},server:e.server,autoFlip:!0,enableComment:e.enableComment,enableAutoSave:e.saveRecordFile,repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame}},t.compressCSAGameSettingsForCLI=async function(e){const t=JSON.stringify(e),o=new CompressionStream("gzip");new Blob([t]).stream().pipeThrough(o);const i=await new Response(o.readable).arrayBuffer();return(0,d.base64Encode)(new Uint8Array(i))},t.decompressCSAGameSettingsForCLI=async function(e){const t=new Uint8Array((0,d.base64Decode)(e)),o=new DecompressionStream("gzip");return new Blob([t]).stream().pipeThrough(o),JSON.parse(await new Response(o.readable).text())};const r=a(o(7367)),s=o(4890),l=o(8474),c=o(2040),d=o(6953);var u;function m(){return{protocolVersion:u.V121_FLOODGATE,host:"localhost",port:4081,id:"",password:"",tcpKeepalive:{initialDelay:10}}}function p(e){if(e.protocolVersion!==u.V121&&e.protocolVersion!==u.V121_FLOODGATE&&e.protocolVersion!==u.V121_X1)return new Error(l.t.protocolVersionNotSelected);if(""===e.host)return new Error(l.t.hostNameIsEmpty);if(e.port<0||e.port>65535)return new Error(l.t.invalidPortNumber);if(""===e.id)return new Error(l.t.idIsEmpty);if(e.id.indexOf(" ")>=0)return new Error(l.t.idContainsSpace);if(e.password.indexOf(" ")>=0)return new Error(l.t.passwordContainsSpace);if(e.tcpKeepalive.initialDelay<=0)return new Error(l.t.tcpKeepaliveInitialDelayMustBePositive);if(e.blankLinePing){if(e.blankLinePing.initialDelay<30)return new Error(l.t.blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30);if(e.blankLinePing.interval<30)return new Error(l.t.blankLinePingIntervalMustBeGreaterThanOrEqualTo30)}}function h(){return{protocolVersion:u.V121_FLOODGATE,host:"",port:0,id:"",tcpKeepalive:{initialDelay:10}}}function g(){return{player:{name:"人",uri:r.ES_HUMAN},serverHistory:[],autoFlip:!0,enableComment:!0,enableAutoSave:!0,repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}}!function(e){e.V121="v121",e.V121_FLOODGATE="v121_floodgate",e.V121_X1="v121_x1"}(u||(t.CSAProtocolVersion=u={})),t.maxServerHistoryLength=10},9161:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarableJishogiRules=t.JishogiRule=void 0,t.defaultTimeLimitSettings=c,t.defaultGameSettings=u,t.normalizeGameSettings=function(e){return{...u(),...e,black:{...(0,r.defaultPlayerSettings)(),...e.black},white:{...(0,r.defaultPlayerSettings)(),...e.white},timeLimit:{timeSeconds:0,byoyomi:30,increment:0,...e.timeLimit}}},t.validateGameSettings=m,t.validateGameSettingsForWeb=function(e){const t=m(e);if(t)return t;if(e.enableAutoSave)return new Error("自動保存はWeb版で利用できません。");return};const r=o(4890),s=o(8474),l=a(o(7367));function c(){return{timeSeconds:0,byoyomi:30,increment:0}}var d;function u(){return{black:(0,r.defaultPlayerSettings)(),white:(0,r.defaultPlayerSettings)(),timeLimit:{timeSeconds:0,byoyomi:30,increment:0},enableEngineTimeout:!1,humanIsFront:!0,enableComment:!0,enableAutoSave:!0,repeat:1,swapPlayers:!1,maxMoves:1e3,jishogiRule:d.GENERAL27}}function m(e){if(0===e.timeLimit.timeSeconds&&0===e.timeLimit.byoyomi)return new Error(s.t.bothTimeLimitAndByoyomiAreNotSet);if(0!==e.timeLimit.byoyomi&&0!==e.timeLimit.increment)return new Error(s.t.canNotUseByoyomiWithFischer);if(e.whiteTimeLimit&&0===e.whiteTimeLimit.timeSeconds&&0===e.whiteTimeLimit.byoyomi)return new Error(s.t.bothTimeLimitAndByoyomiAreNotSet);if(e.whiteTimeLimit&&0!==e.whiteTimeLimit.byoyomi&&0!==e.whiteTimeLimit.increment)return new Error(s.t.canNotUseByoyomiWithFischer);if(e.repeat<1)return new Error("The number of repeats must be positive.");return(e.black.uri===l.ES_HUMAN||e.white.uri===l.ES_HUMAN)&&e.repeat>1?new Error(s.t.repeatsMustBeOneIfHumanPlayerIncluded):void 0}!function(e){e.NONE="none",e.GENERAL24="general24",e.GENERAL27="general27",e.TRY="try"}(d||(t.JishogiRule=d={})),t.DeclarableJishogiRules=[d.GENERAL24,d.GENERAL27]},3541:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluationChartType=void 0,t.emptyLayoutProfileList=function(){return{profiles:[]}},t.appendCustomLayoutProfile=function(e,t){return t=t||{uri:r.issueCustomLayoutProfileURI(),name:s.t.newCustomProfile,dialogBackdrop:!0,components:[{type:"Record",left:10,top:298,width:150,height:211},{type:"Analytics",left:628,top:10,width:400,height:64,showMultiPvColumn:!0,showScoreColumn:!0},{type:"Chart",left:628,top:83,width:400,height:140,chartType:l.WIN_RATE},{type:"Board",left:10,top:10,width:800,height:500},{type:"Comment",left:790,top:230,width:240,height:280},{type:"ControlGroup1",left:1040,top:10,width:150,height:180},{type:"ControlGroup2",left:1040,top:200,width:150,height:180}]},e.profiles.push(t),t.uri},t.duplicateCustomLayoutProfile=function(e,t){const o=e.profiles.find((e=>e.uri===t));if(!o)return null;const i=r.issueCustomLayoutProfileURI();return e.profiles.push({...JSON.parse(JSON.stringify(o)),uri:i,name:`${o.name} (Copy)`}),i},t.removeCustomLayoutProfile=function(e,t){e.profiles=e.profiles.filter((e=>e.uri!==t))},t.serializeLayoutProfile=function(e){return JSON.stringify(Object.fromEntries(Object.entries(e).filter((([e])=>"uri"!==e))))},t.deserializeLayoutProfile=function(e){const t=JSON.parse(e);if(t.uri=r.issueCustomLayoutProfileURI(),!Array.isArray(t.components))throw new Error("Invalid layout profile data");return t};const r=a(o(7367)),s=o(8474);var l;!function(e){e.RAW="raw",e.WIN_RATE="winRate"}(l||(t.EvaluationChartType=l={}))},9994:(e,t)=>{function o(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.defaultMateSearchSettings=o,t.normalizeMateSearchSettings=function(e){return{...e}}},4890:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultPlayerSettings=function(){return{name:"人",uri:s.ES_HUMAN}},t.validatePlayerSettings=function(e){if(!e.name)return new Error("player name is required");if(!e.uri)return new Error("player URI is required");if(s.isUSIEngine(e.uri)){if(!e.usi)return new Error("USI is required");const t=(0,r.validateUSIEngine)(e.usi);if(t)return t}};const r=o(2040),s=a(o(7367))},7914:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultResearchSettings=n,t.normalizeResearchSettings=function(e){return{enableMaxSeconds:!1,maxSeconds:10,...e,secondaries:e.secondaries?.filter((e=>!!e.usi))}},t.validateResearchSettings=function(e){if(!e.usi)return new Error(i.t.engineNotSelected);if(e.secondaries?.some((e=>!e.usi)))return new Error(i.t.engineNotSelected)};const i=o(8474);function n(){return{enableMaxSeconds:!1,maxSeconds:10}}},2040:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.USIEngines=t.USIEngineLabel=t.MultiPV=t.NumberOfThreads=t.Threads=t.USIMultiPV=t.USIHash=t.USIPonder=void 0,t.getUSIEngineOptionCurrentValue=c,t.emptyUSIEngine=u,t.duplicateEngine=function(e){const t=JSON.parse(JSON.stringify(e));return t.uri=(0,r.issueEngineURI)(),t.name=l.t.copyOf(t.name),t},t.mergeUSIEngine=function(e,t){e.uri=t.uri,e.name=t.name,Object.values(t.options).forEach((t=>{const o=e.options[t.name];o&&"button"!==o.type&&o.type===t.type&&(o.value=t.value)})),e.labels=t.labels,e.enableEarlyPonder=t.enableEarlyPonder},t.validateUSIEngine=function(e){if(!s.isUSIEngine(e.uri))return new Error("invalid engine URI");if(!e.name&&!e.defaultName)return new Error("engine name is required");if(!e.path)return new Error("engine path is required");for(const t in e.options){const o=e.options[t];if(!["check","spin","combo","button","string","filename"].includes(o.type))return new Error(`invalid option type: name=[${t}] type=[${o.type}]`);if(!m(o))return new Error(`invalid option value: name=[${t}] type=[${o.type}]`+("button"!==o.type?` value=[${o.value}]`:""))}},t.exportUSIEnginesForCLI=function(e){const t={};for(const o of Object.values(e.options)){const e=c(o);if(void 0!==e)switch(o.type){case"check":t[o.name]={type:"check",value:"true"===e};break;case"spin":t[o.name]={type:"spin",value:e};break;case"button":break;default:t[o.name]={type:o.type,value:e}}}return{name:e.name,path:e.path,options:t,enableEarlyPonder:e.enableEarlyPonder}},t.importUSIEnginesForCLI=function(e,t){const o={};for(const t in e.options){const i=e.options[t];switch(i.type){case"check":o[t]={name:t,type:"check",order:0,value:i.value?"true":"false"};break;case"spin":o[t]={name:t,type:"spin",order:0,value:i.value};break;case"combo":o[t]={name:t,type:"combo",order:0,value:i.value,vars:[i.value]};break;default:o[t]={name:t,type:i.type,order:0,value:i.value}}}return{uri:t||(0,r.issueEngineURI)(),name:e.name,defaultName:e.name,author:"",path:e.path,options:o,enableEarlyPonder:e.enableEarlyPonder,labels:{}}};const r=o(7367),s=a(o(7367)),l=o(8474);function c(e){if(e&&"button"!==e.type)return void 0!==e.value?e.value:"string"!==e.type&&"filename"!==e.type||"<empty>"!==e.default?e.default:""}var d;function u(){return{uri:"",name:"",defaultName:"",author:"",path:"",options:{},labels:{game:!0,research:!0,mate:!0},enableEarlyPonder:!1}}function m(e){if("button"===e.type||void 0===e.value)return!0;switch(e.type){case"check":if("true"!==e.value&&"false"!==e.value)return!1;break;case"spin":if("number"!=typeof e.value)return!1;if(void 0!==e.min&&e.value<e.min)return!1;if(void 0!==e.max&&e.value>e.max)return!1;break;case"string":case"filename":if("string"!=typeof e.value)return!1;break;case"combo":if("string"!=typeof e.value)return!1;if(!e.vars.includes(e.value))return!1}return!0}t.USIPonder="USI_Ponder",t.USIHash="USI_Hash",t.USIMultiPV="USI_MultiPV",t.Threads="Threads",t.NumberOfThreads="NumberOfThreads",t.MultiPV="MultiPV",function(e){e.GAME="game",e.RESEARCH="research",e.MATE="mate"}(d||(t.USIEngineLabel=d={}));class p{engines={};constructor(e){if(e){const t=JSON.parse(e);Object.keys(t.engines).filter(s.isUSIEngine).forEach((e=>{const o={uri:"",name:"",defaultName:"",author:"",path:"",options:{},labels:{game:!0,research:!0,mate:!0},enableEarlyPonder:!1},i=t.engines[e];this.engines[e]={...o,...i,uri:e,labels:{...o.labels,...i.labels}}}))}}hasEngine(e){return!!this.engines[e]}addEngine(e){this.engines[e.uri]=e}updateEngine(e){return!!this.engines[e.uri]&&(this.engines[e.uri]=e,!0)}removeEngine(e){return!!this.engines[e]&&(delete this.engines[e],!0)}getEngine(e){return this.engines[e]}get engineList(){return Object.values(this.engines).sort(((e,t)=>e.name!==t.name?e.name>t.name?1:-1:e.defaultName!==t.defaultName?e.defaultName>t.defaultName?1:-1:e.uri>t.uri?1:-1))}get json(){return JSON.stringify(this)}get jsonWithIndent(){return JSON.stringify(this,void 0,2)}getClone(){return new p(this.json)}filterByLabel(e){const t=new p;return this.engineList.filter((t=>t.labels&&t.labels[e])).forEach((e=>t.addEngine(e))),t}}t.USIEngines=p},7367:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ES_CUSTOM_LAYOUT_PROFILE_PREFIX=t.ES_STANDARD_LAYOUT_PROFILE=t.ES_USI_ENGINE_PREFIX=t.ES_HUMAN=void 0,t.isUSIEngine=function(e){return e.startsWith(t.ES_USI_ENGINE_PREFIX)},t.issueEngineURI=function(){const e=Date.now(),o=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16);return t.ES_USI_ENGINE_PREFIX+`${e}/${o}`},t.issueCustomLayoutProfileURI=function(){const e=Date.now(),o=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16);return t.ES_CUSTOM_LAYOUT_PROFILE_PREFIX+`${e}/${o}`},t.ES_HUMAN="es://human",t.ES_USI_ENGINE_PREFIX="es://usi-engine/",t.ES_STANDARD_LAYOUT_PROFILE="es://layout-profile/standard",t.ES_CUSTOM_LAYOUT_PROFILE_PREFIX="es://layout-profile/custom/"},8574:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultRecordFileNameTemplate=void 0,t.dirname=function(e){return e.substring(0,Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")))},t.join=function(e,...t){const o=function(e){return e.indexOf("/")>=0?"/":"\\"}(e);let i=a(e);for(const e of t)i+=e.startsWith("/")||e.startsWith("\\")?e:o+e,i=a(i);return i},t.generateRecordFileName=function(e,o,a){const s=function(e){const t=e.getStandardMetadata(i.RecordMetadataKey.START_DATETIME)||e.getStandardMetadata(i.RecordMetadataKey.DATE);if(t)return t.trim().replaceAll(" ","_").replaceAll("/","").replaceAll(":","");return(0,n.getDateString)().replaceAll("/","")}(e),l=e.getStandardMetadata(i.RecordMetadataKey.TITLE)||e.getStandardMetadata(i.RecordMetadataKey.TOURNAMENT)||e.getStandardMetadata(i.RecordMetadataKey.OPUS_NAME)||e.getStandardMetadata(i.RecordMetadataKey.OPUS_NO)||e.getStandardMetadata(i.RecordMetadataKey.PLACE)||e.getStandardMetadata(i.RecordMetadataKey.POSTED_ON)||e.getStandardMetadata(i.RecordMetadataKey.AUTHOR),c=(0,i.getBlackPlayerName)(e),d=(0,i.getWhitePlayerName)(e),u=Math.floor(1048576*Math.random()).toString(16).toUpperCase().padStart(5,"0"),m={datetime:s,title:l||"",sente:c||"",gote:d||"",hex5:u};for(const e in m){const t=m[e];m["_"+e]=t?"_"+t:"",m[e+"_"]=t?t+"_":""}let p=o||t.defaultRecordFileNameTemplate;p=r(p);for(const e in m){const t=m[e];p=r(p.replaceAll("{"+e+"}",t))}p=p.trim(),p+=a?a.startsWith(".")?a:"."+a:".kif";return p};const i=o(3113),n=o(5746);function a(e){return e.endsWith("/")||e.endsWith("\\")?e.substring(0,e.length-1):e}function r(e){return e.replaceAll(/[<>:"/\\|?*]/g,"_")}t.defaultRecordFileNameTemplate="{datetime}{_title}{_sente}{_gote}"},7510:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bridge=t.appInfo=void 0,t.isNative=function(){return!!a().electronShogiAPI};const i=o(2040),n=o(4908);function a(){return window}t.appInfo=a().electronShogi||{},t.bridge=a().electronShogiAPI||n.webAPI;const r={...t.bridge,loadAppSettings:async()=>JSON.parse(await t.bridge.loadAppSettings()),saveAppSettings:e=>t.bridge.saveAppSettings(JSON.stringify(e)),loadBatchConversionSettings:async()=>JSON.parse(await t.bridge.loadBatchConversionSettings()),saveBatchConversionSettings:e=>t.bridge.saveBatchConversionSettings(JSON.stringify(e)),loadResearchSettings:async()=>JSON.parse(await t.bridge.loadResearchSettings()),saveResearchSettings:e=>t.bridge.saveResearchSettings(JSON.stringify(e)),loadAnalysisSettings:async()=>JSON.parse(await t.bridge.loadAnalysisSettings()),saveAnalysisSettings:e=>t.bridge.saveAnalysisSettings(JSON.stringify(e)),loadGameSettings:async()=>JSON.parse(await t.bridge.loadGameSettings()),saveGameSettings:e=>t.bridge.saveGameSettings(JSON.stringify(e)),loadCSAGameSettingsHistory:async()=>JSON.parse(await t.bridge.loadCSAGameSettingsHistory()),saveCSAGameSettingsHistory:e=>t.bridge.saveCSAGameSettingsHistory(JSON.stringify(e)),loadMateSearchSettings:async()=>JSON.parse(await t.bridge.loadMateSearchSettings()),saveMateSearchSettings:e=>t.bridge.saveMateSearchSettings(JSON.stringify(e)),loadRecordFileHistory:async()=>JSON.parse(await t.bridge.loadRecordFileHistory()),loadUSIEngines:async()=>new i.USIEngines(await t.bridge.loadUSIEngines()),saveUSIEngines:e=>t.bridge.saveUSIEngines(e.json),fetchInitialRecordFileRequest:async()=>JSON.parse(await t.bridge.fetchInitialRecordFileRequest()),convertRecordFiles:async e=>JSON.parse(await t.bridge.convertRecordFiles(JSON.stringify(e))),getUSIEngineInfo:async(e,o)=>JSON.parse(await t.bridge.getUSIEngineInfo(e,o)),usiLaunch:(e,o)=>t.bridge.usiLaunch(JSON.stringify(e),o),usiReady:e=>t.bridge.usiReady(e),usiGo:(e,o,i)=>t.bridge.usiGo(e,o,JSON.stringify(i)),usiGoPonder:(e,o,i)=>t.bridge.usiGoPonder(e,o,JSON.stringify(i)),usiPonderHit:(e,o)=>t.bridge.usiPonderHit(e,JSON.stringify(o)),csaLogin:e=>t.bridge.csaLogin(JSON.stringify(e)),collectSessionStates:async()=>JSON.parse(await t.bridge.collectSessionStates()),setupPrompt:async(e,o)=>JSON.parse(await t.bridge.setupPrompt(e,o)),exportCaptureAsPNG:e=>t.bridge.exportCaptureAsPNG(e.json),exportCaptureAsJPEG:e=>t.bridge.exportCaptureAsJPEG(e.json),async loadLayoutProfileList(){const[e,o]=await t.bridge.loadLayoutProfileList();return[e,JSON.parse(o)]},updateLayoutProfileList(e,o){t.bridge.updateLayoutProfileList(e,JSON.stringify(o))},getVersionStatus:async()=>JSON.parse(await t.bridge.getVersionStatus())};t.default=r},4908:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.webAPI=void 0;const r=o(9273),s=o(7748),l=o(9161),c=o(7914),d=o(2040),u=o(1219),m=o(8474),p=o(3010),h=o(9994),g=o(2587),S=o(7892),f=o(3541),y=a(o(7367));var v;!function(e){e.APP_SETTINGS="appSetting",e.RESEARCH_SETTINGS="researchSetting",e.BATCH_CONVERSION_SETTINGS="batchConversionSetting",e.ANALYSIS_SETTINGS="analysisSetting",e.GAME_SETTINGS="gameSetting",e.MATE_SEARCH_SETTINGS="mateSearchSetting",e.CSA_GAME_SETTINGS_HISTORY="csaGameSettingHistory"}(v||(v={})),t.webAPI={updateAppState(){},onClosable(){},onClose(){},onSendError(){},onMenuEvent(){},async loadAppSettings(){const e=localStorage.getItem(v.APP_SETTINGS);return e?JSON.stringify({...(0,s.defaultAppSettings)(),...JSON.parse(e)}):JSON.stringify((0,s.defaultAppSettings)())},async saveAppSettings(e){localStorage.setItem(v.APP_SETTINGS,e)},async loadBatchConversionSettings(){const e=localStorage.getItem(v.BATCH_CONVERSION_SETTINGS);return e?JSON.stringify({...(0,g.defaultBatchConversionSettings)(),...JSON.parse(e)}):JSON.stringify((0,g.defaultBatchConversionSettings)())},async saveBatchConversionSettings(e){localStorage.setItem(v.BATCH_CONVERSION_SETTINGS,e)},async loadResearchSettings(){const e=localStorage.getItem(v.RESEARCH_SETTINGS);return e?JSON.stringify({...(0,c.defaultResearchSettings)(),...JSON.parse(e)}):JSON.stringify((0,c.defaultResearchSettings)())},async saveResearchSettings(e){localStorage.setItem(v.RESEARCH_SETTINGS,e)},async loadAnalysisSettings(){const e=localStorage.getItem(v.ANALYSIS_SETTINGS);return e?JSON.stringify({...(0,r.defaultAnalysisSettings)(),...JSON.parse(e)}):JSON.stringify((0,r.defaultAnalysisSettings)())},async saveAnalysisSettings(e){localStorage.setItem(v.ANALYSIS_SETTINGS,e)},async loadGameSettings(){const e=localStorage.getItem(v.GAME_SETTINGS);return e?JSON.stringify({...(0,l.defaultGameSettings)(),...JSON.parse(e)}):JSON.stringify((0,l.defaultGameSettings)())},async saveGameSettings(e){localStorage.setItem(v.GAME_SETTINGS,e)},async loadCSAGameSettingsHistory(){const e=localStorage.getItem(v.CSA_GAME_SETTINGS_HISTORY);return e?JSON.stringify({...(0,p.defaultCSAGameSettingsHistory)(),...JSON.parse(e)}):JSON.stringify((0,p.defaultCSAGameSettingsHistory)())},async saveCSAGameSettingsHistory(e){localStorage.setItem(v.CSA_GAME_SETTINGS_HISTORY,e)},async loadMateSearchSettings(){const e=localStorage.getItem(v.MATE_SEARCH_SETTINGS);return e?JSON.stringify({...(0,h.defaultMateSearchSettings)(),...JSON.parse(e)}):JSON.stringify((0,h.defaultMateSearchSettings)())},async saveMateSearchSettings(e){localStorage.setItem(v.MATE_SEARCH_SETTINGS,e)},loadUSIEngines:async()=>(new d.USIEngines).json,async saveUSIEngines(){},onUpdateAppSettings(){},fetchInitialRecordFileRequest:async()=>"null",async showOpenRecordDialog(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async showSaveRecordDialog(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async showSaveMergedRecordDialog(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async openRecord(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async saveRecord(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},loadRecordFileHistory:async()=>JSON.stringify((0,S.getEmptyHistory)()),addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async loadRemoteRecordFile(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async convertRecordFiles(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},onOpenRecord(){},async showSelectUSIEngineDialog(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async getUSIEngineInfo(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async sendUSISetOption(){},async usiLaunch(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async usiReady(){},async usiGo(){},async usiGoPonder(){},async usiPonderHit(){},async usiGoInfinite(){},async usiGoMate(){},async usiStop(){},async usiGameover(){},async usiQuit(){},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},onUSIPonderInfo(){},async csaLogin(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async csaLogout(){},async csaAgree(){},async csaMove(){},async csaResign(){},async csaWin(){},async csaStop(){},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},collectSessionStates:async()=>JSON.stringify({usiSessions:[],csaSessions:[]}),async setupPrompt(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async openPrompt(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},invokePromptCommand(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},onPromptCommand(){},async showSelectImageDialog(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async cropPieceImage(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsPNG(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsJPEG(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},loadLayoutProfileList:async()=>[y.ES_STANDARD_LAYOUT_PROFILE,JSON.stringify((0,f.emptyLayoutProfileList)())],updateLayoutProfileList(){},onUpdateLayoutProfileList(){},openLogFile(){},log(e,t){switch(e){case u.LogLevel.DEBUG:console.debug(t);break;case u.LogLevel.INFO:console.log(t);break;case u.LogLevel.WARN:console.warn(t);break;case u.LogLevel.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},async showSelectDirectoryDialog(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)},openExplorer(){},openWebBrowser(e){window.open(e,"_blank")},isEncryptionAvailable:async()=>!1,getVersionStatus:async()=>JSON.stringify({}),sendTestNotification(){throw new Error(m.t.thisFeatureNotAvailableOnWebApp)}}},3101:function(e,t,o){var i=this&&this.__createBinding||(Object.create?function(e,t,o,i){void 0===i&&(i=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,i,n)}:function(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&i(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultPlayerBuilder=function(e){return{async build(t,o){if(t.uri===l.ES_HUMAN)return r.humanPlayer;if(l.isUSIEngine(t.uri)&&t.usi){const i=new s.USIPlayer(t.usi,e??10,o);return await i.launch(),i}throw new Error("defaultPlayerBuilder#build: 予期せぬプレイヤーURIです: "+t.uri)}}};const r=o(9335),s=o(7769),l=a(o(7367))},9335:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.humanPlayer=t.HumanPlayer=void 0;class o{searchHandler;isEngine(){return!1}async readyNewGame(){}async startSearch(e,t,o,i){this.searchHandler=i}async startPonder(){}async startMateSearch(){}async stop(){}async gameover(){}async close(){this.searchHandler=void 0}doMove(e){const t=this.searchHandler;this.searchHandler=void 0,t?.onMove(e)}resign(){const e=this.searchHandler;this.searchHandler=void 0,e?.onResign()}win(){const e=this.searchHandler;this.searchHandler=void 0,e?.onWin()}}t.HumanPlayer=o,t.humanPlayer=new o},7769:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.USIPlayer=void 0,t.setOnUpdateUSIInfoHandler=function(e){l=e},t.setOnUpdateUSIPonderInfoHandler=function(e){c=e},t.onUSIBestMove=function(e,t,o,i){d[e]?.onBestMove(t,o,i)},t.onUSICheckmate=function(e,t,o){const i=d[e];if(!i)return;l(e,t,i.name,{pv:o}),i.onCheckmate(t,o)},t.onUSICheckmateNotImplemented=function(e){d[e]?.onCheckmateNotImplemented()},t.onUSICheckmateTimeout=function(e,t){d[e]?.onCheckmateTimeout(t)},t.onUSINoMate=function(e,t){d[e]?.onNoMate(t)},t.onUSIInfo=function(e,t,o){const i=d[e];if(!i)return;l(e,t,i.name,o),i.onUSIInfo(t,o)},t.onUSIPonderInfo=function(e,t,o){const i=d[e];if(!i)return;c(e,t,i.name,o),i.onUSIInfo(t,o)},t.isActiveUSIPlayerSession=function(e){return!!d[e]};const n=i(o(7510)),a=o(7187),r=o(2040),s=o(3113);let l=()=>{},c=()=>{};t.USIPlayer=class{engine;timeoutSeconds;onSearchInfo;_sessionID=0;usi;position;searchHandler;mateHandler;ponder;inPonder=!1;info;usiInfoTimeout;constructor(e,t,o){this.engine=e,this.timeoutSeconds=t,this.onSearchInfo=o}get name(){return this.engine.name}get sessionID(){return this._sessionID}async launch(){this._sessionID=await n.default.usiLaunch(this.engine,this.timeoutSeconds),d[this.sessionID]=this}isEngine(){return!0}async readyNewGame(){await n.default.usiReady(this.sessionID)}async startSearch(e,t,o,i){this.clearHandlers(),this.searchHandler=i,this.usi=t,this.position=e.clone(),this.inPonder&&this.ponder===this.usi?n.default.usiPonderHit(this.sessionID,o):(this.info=void 0,await n.default.usiGo(this.sessionID,this.usi,o)),this.inPonder=!1,this.ponder=void 0}async startPonder(e,t,o){if("true"!==(0,r.getUSIEngineOptionCurrentValue)(this.engine.options[r.USIPonder]))return;if(this.inPonder)return;const i=t;if(!this.ponder||!this.ponder.startsWith(i))return;const a=e.createMoveByUSI(this.ponder.slice(i.length+1));a&&e.isValidMove(a)&&(this.clearHandlers(),this.usi=this.ponder,this.position=e.clone(),this.position.doMove(a),this.info=void 0,this.inPonder=!0,await n.default.usiGoPonder(this.sessionID,this.ponder,o))}async startMateSearch(e,t,o){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),this.mateHandler=o,await n.default.usiGoMate(this.sessionID,this.usi)}async startResearch(e,t){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),await n.default.usiGoInfinite(this.sessionID,t)}async stop(){await n.default.usiStop(this.sessionID)}async gameover(e){await n.default.usiGameover(this.sessionID,e)}async close(){this.clearHandlers(),await n.default.usiQuit(this.sessionID),delete d[this.sessionID]}clearHandlers(){this.searchHandler=void 0,this.mateHandler=void 0}onBestMove(e,t,o){const i=this.searchHandler;if(this.clearHandlers(),!i||!this.position)return;if(e!==this.usi)return;if("resign"===t)return void i.onResign();if("win"===t)return void i.onWin();const n=this.position.createMoveByUSI(t);if(!n)return i.onError("エンジンから不明な指し手を受信しました:"+t),void i.onResign();const a=e.indexOf(" moves ")>0;if(this.ponder=o&&`${e}${a?"":" moves"} ${t} ${o}`,this.flushUSIInfo(),this.info?.pv&&this.info.pv.length>=1&&this.info.pv[0].equals(n)){const e={...this.info,pv:this.info.pv.slice(1)};i.onMove(n,e)}else i.onMove(n)}onCheckmate(e,t){if(e!==this.usi||!this.position)return;const o=this.mateHandler;if(this.clearHandlers(),!o)return;const i=this.position,n=[];for(const e of t){const t=i.createMoveByUSI(e);if(!t)return void o.onError("エンジンから不明な指し手を受信しました:"+e);if(n.push(t),!i.doMove(t))return void o.onError("エンジンから無効な指し手を受信しました:"+e)}o.onCheckmate(n)}onCheckmateNotImplemented(){const e=this.mateHandler;this.clearHandlers(),e?.onNotImplemented()}onCheckmateTimeout(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onTimeout()}onNoMate(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onNoMate()}onUSIInfo(e,t){if(e!==this.usi||!this.position)return;if(t.multipv&&1!==t.multipv)return;const o=this.position.color===s.Color.BLACK?1:-1,i=t.pv&&t.pv.length>=1?t.pv:t.currmove?[t.currmove]:void 0;this.info={usi:e,depth:t.depth??this.info?.depth,nodes:t.nodes??this.info?.nodes,score:(t.scoreCP&&t.scoreCP*o)??this.info?.score,mate:(t.scoreMate&&t.scoreMate*o)??this.info?.mate,pv:(i&&(0,a.parseUSIPV)(this.position,i))??this.info?.pv},this.inPonder||this.usiInfoTimeout||(this.usiInfoTimeout=window.setTimeout((()=>{this.flushUSIInfo()}),500))}flushUSIInfo(){this.usiInfoTimeout&&(clearTimeout(this.usiInfoTimeout),this.usiInfoTimeout=void 0),this.info&&this.onSearchInfo?.(this.info)}};const d={}},6255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Clock=void 0;t.Clock=class{_settings={timeMs:0,byoyomi:0,increment:0};_timeMs=0;_byoyomi=0;_elapsedMs=0;timerHandle=0;timerStart=0;lastTimeMs=0;setup(e){this._settings=e,this._timeMs=e.timeMs||0,this._byoyomi=e.byoyomi||0,this._elapsedMs=0}get settings(){return this._settings}get time(){return Math.ceil(this._timeMs/1e3)}get timeMs(){return this._timeMs}get byoyomi(){return this._byoyomi}get elapsedMs(){return this._elapsedMs}start(){this.clearTimer(),this.timerStart=Date.now(),this.lastTimeMs=this._timeMs,this._byoyomi=this.settings.byoyomi||0,this._elapsedMs=0,this.timerHandle=window.setInterval((()=>{const e=this.timeMs,t=this.byoyomi;this._elapsedMs=Date.now()-this.timerStart;const o=this.lastTimeMs-this._elapsedMs;o>=0?this._timeMs=o:(this._timeMs=0,this._byoyomi=Math.max(Math.ceil((this.settings.byoyomi||0)+o/1e3),0)),0!==this.timeMs||0!==this.byoyomi?this.fireBeep(e,t):this.timeout()}),100)}fireBeep(e,t){let o=Math.ceil(this.timeMs/1e3),i=Math.ceil(e/1e3);0!==o&&0!==this.byoyomi||(0!==o||0===i?(0!==this.byoyomi&&(o=this.byoyomi,i=t),o!==i&&(o<=5?this.settings.onBeepUnlimited&&this.settings.onBeepUnlimited():(o<=10||20===o||30===o||60===o)&&this.settings.onBeepShort&&this.settings.onBeepShort())):this.settings.onBeepShort&&this.settings.onBeepShort())}pause(){this.clearTimer()}stop(){this.clearTimer(),this.incrementTime()}timeout(){this.clearTimer(),this.settings.onTimeout?.()}clearTimer(){this.timerHandle&&(window.clearInterval(this.timerHandle),this.timerHandle=0),this.settings.onStopBeep?.()}incrementTime(){this._timeMs+=1e3*(this.settings.increment||0)}}},7076:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CSAGameManager=t.CSAGameState=t.loginRetryIntervalSeconds=void 0,t.onCSAGameSummary=function(e,t){S[e]?.onGameSummary(t)},t.onCSAReject=function(e){S[e]?.onReject()},t.onCSAStart=function(e,t){S[e]?.onStart(t)},t.onCSAMove=function(e,t,o){S[e]?.onMove(t,o)},t.onCSAGameResult=function(e,t,o){S[e]?.onGameResult(t,o)},t.onCSAClose=function(e){S[e]?.onClose()};const n=i(o(7510)),a=o(4725),r=o(3101),s=o(3010),l=o(3113),c=o(9273),d=o(7872),u=o(8474),m=o(3695),p=o(7769);var h,g;t.loginRetryIntervalSeconds=10,function(e){e[e.OFFLINE=0]="OFFLINE",e[e.PLAYER_SETUP=1]="PLAYER_SETUP",e[e.WAITING_LOGIN=2]="WAITING_LOGIN",e[e.LOGIN_FAILED=3]="LOGIN_FAILED",e[e.LOGIN_RETRY_INTERVAL=4]="LOGIN_RETRY_INTERVAL",e[e.READY=5]="READY",e[e.GAME=6]="GAME"}(h||(t.CSAGameState=h={})),function(e){e[e.DO_NOT_RELOGIN=0]="DO_NOT_RELOGIN",e[e.RELOGIN_WITH_INTERVAL=1]="RELOGIN_WITH_INTERVAL",e[e.RELOGIN_IMMEDIATELY=2]="RELOGIN_IMMEDIATELY"}(g||(g={}));t.CSAGameManager=class{recordManager;blackClock;whiteClock;_state=h.OFFLINE;_settings=(0,s.defaultCSAGameSettings)();_sessionID=0;stopRequested=!1;repeat=0;player;gameSummary=(0,a.emptyCSAGameSummary)();searchInfo;playerBuilder=(0,r.defaultPlayerBuilder)();retryTimer;onSaveRecord=()=>{};onGameNext=()=>{};onNewGame=()=>{};onGameEnd=()=>{};onLoginRetry=()=>{};onFlipBoard=()=>{};onPieceBeat=()=>{};onBeepShort=()=>{};onBeepUnlimited=()=>{};onStopBeep=()=>{};onError=()=>{};constructor(e,t,o){this.recordManager=e,this.blackClock=t,this.whiteClock=o}on(e,t){switch(e){case"saveRecord":this.onSaveRecord=t;break;case"gameNext":this.onGameNext=t;break;case"newGame":this.onNewGame=t;break;case"gameEnd":this.onGameEnd=t;break;case"loginRetry":this.onLoginRetry=t;break;case"flipBoard":this.onFlipBoard=t;break;case"pieceBeat":this.onPieceBeat=t;break;case"beepShort":this.onBeepShort=t;break;case"beepUnlimited":this.onBeepUnlimited=t;break;case"stopBeep":this.onStopBeep=t;break;case"error":this.onError=t}return this}get state(){return this._state}get settings(){return this._settings}get sessionID(){return this._sessionID}get usiSessionID(){return this.player instanceof p.USIPlayer?this.player.sessionID:0}get isMyTurn(){return this.recordManager.record.position.color===this.gameSummary.myColor}async login(e,t){if(this.sessionID)throw new Error("CSAGameManager#login: session already exists");if(this._state!==h.OFFLINE)throw new Error("CSAGameManager#login: unexpected state");this._state=h.PLAYER_SETUP,this._settings=e,this.playerBuilder=t,this.repeat=0,this.player=await this.playerBuilder.build(this._settings.player,(e=>this.recordManager.updateSearchInfo(d.SearchInfoSenderType.OPPONENT,e))),this._login().catch(this.onError)}async relogin(){this.settings.restartPlayerEveryGame&&(this._state=h.PLAYER_SETUP,this.player&&(await this.player.close(),this.player=void 0),this.player=await this.playerBuilder.build(this._settings.player,(e=>this.recordManager.updateSearchInfo(d.SearchInfoSenderType.OPPONENT,e)))),await this._login()}async _login(){if(!this.player)throw new Error("CSAGameManager#relogin: player is not initialized");try{this._state=h.PLAYER_SETUP,await this.player.readyNewGame(),this._state=h.WAITING_LOGIN;const e=await n.default.csaLogin(this._settings.server);this._sessionID=e,this._state=h.READY,function(e,t){S[e]=t}(this.sessionID,this),this.onGameNext()}catch(e){throw this._state=h.LOGIN_FAILED,this.close(g.RELOGIN_WITH_INTERVAL),new Error(`CSAGameManager#relogin: ${u.t.failedToStartNewGame}: ${e}`)}}stop(){this.sessionID&&(this.stopRequested=!0,n.default.csaStop(this.sessionID))}logout(){this.close(g.DO_NOT_RELOGIN)}close(e){if(this._state!==h.OFFLINE&&this._state!==h.WAITING_LOGIN){var o;if(this._state===h.GAME&&this.settings.enableAutoSave&&this.onSaveRecord(),this.stopRequested&&(e=g.DO_NOT_RELOGIN,this.stopRequested=!1),this.sessionID&&(o=this.sessionID,delete S[o],n.default.csaLogout(this.sessionID).catch((e=>{this.onError(new Error(`CSAGameManager#close: ${u.t.errorOccuredWhileLogoutFromCSAServer}: ${e}`))})),this._sessionID=0),this.blackClock.stop(),this.whiteClock.stop(),this._state=h.OFFLINE,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=void 0),e===g.DO_NOT_RELOGIN||this.repeat>=this.settings.repeat)return this.player&&(this.player.close().catch((e=>{this.onError(new Error(`CSAGameManager#close: ${u.t.failedToShutdownEngines}: ${e}`))})),this.player=void 0),void this.onGameEnd();e===g.RELOGIN_IMMEDIATELY?this.relogin().catch(this.onError):(this._state=h.LOGIN_RETRY_INTERVAL,this.onLoginRetry(),this.retryTimer=setTimeout((()=>this.relogin().catch(this.onError)),1e3*t.loginRetryIntervalSeconds))}}onGameSummary(e){this.gameSummary=e;const t=this.recordManager.importRecord(this.gameSummary.position,{type:l.RecordFormatType.CSA});if(t)return this.onError(`CSAGameManager#onGameSummary: ${t}`),void this.close(g.DO_NOT_RELOGIN);this.recordManager.changePly(Number.MAX_SAFE_INTEGER),n.default.csaAgree(this.sessionID,this.gameSummary.id)}onReject(){this.close(g.RELOGIN_WITH_INTERVAL)}onStart(e){this.repeat++,this.onNewGame(this.repeat);const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;this.recordManager.setGameStartMetadata({gameTitle:this.gameSummary.id,blackName:this.gameSummary.players.black.playerName,whiteName:this.gameSummary.players.white.playerName,blackTimeLimit:{timeSeconds:t.totalTime*t.timeUnitMs/1e3,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},whiteTimeLimit:{timeSeconds:o.totalTime*o.timeUnitMs/1e3,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}),this.settings.autoFlip&&this.onFlipBoard&&this.onFlipBoard(this.gameSummary.myColor===l.Color.WHITE),this._state=h.GAME,this.next(e)}onMove(e,t){const o=this.isMyTurn,i=(0,l.parseCSAMove)(this.recordManager.record.position,e);i instanceof Error?this.onError(`CSAGameManager#onMove: 解釈できない指し手 [${e}]: ${i.message}`):(this.recordManager.appendMove({move:i,moveOption:{ignoreValidation:!0},elapsedMs:this.parseElapsedMs(i.color,e)}),o&&this.searchInfo&&this.recordManager.updateSearchInfo(d.SearchInfoSenderType.PLAYER,this.searchInfo),o&&this.searchInfo&&this.settings.enableComment&&this.recordManager.appendSearchComment(d.SearchInfoSenderType.PLAYER,this.searchInfo,c.CommentBehavior.APPEND),this.onPieceBeat(),this.next(t))}parseElapsedMs(e,t){const o=this.gameSummary.players[e].time,i=/^.*,T([0-9]+)$/.exec(t);return i?Number(parseInt(i[1]))*o.timeUnitMs:0}onGameResult(e,t){if(this.recordManager.appendMove({move:this.gameResultToSpecialMove(e,t)}),this.player){let e;switch(t){case a.CSAGameResult.WIN:e=m.GameResult.WIN;break;case a.CSAGameResult.LOSE:e=m.GameResult.LOSE;break;case a.CSAGameResult.DRAW:case a.CSAGameResult.CENSORED:case a.CSAGameResult.CHUDAN:e=m.GameResult.DRAW}this.player.gameover(e)}this.close(g.RELOGIN_IMMEDIATELY)}gameResultToSpecialMove(e,t){const o=this.recordManager.record.position.color;switch(e){case a.CSASpecialMove.RESIGN:return l.SpecialMoveType.RESIGN;case a.CSASpecialMove.SENNICHITE:return l.SpecialMoveType.REPETITION_DRAW;case a.CSASpecialMove.OUTE_SENNICHITE:case a.CSASpecialMove.ILLEGAL_MOVE:case a.CSASpecialMove.ILLEGAL_ACTION:switch(t){case a.CSAGameResult.WIN:return o===this.gameSummary.myColor?l.SpecialMoveType.FOUL_WIN:l.SpecialMoveType.FOUL_LOSE;case a.CSAGameResult.LOSE:return o===this.gameSummary.myColor?l.SpecialMoveType.FOUL_LOSE:l.SpecialMoveType.FOUL_WIN}break;case a.CSASpecialMove.TIME_UP:return l.SpecialMoveType.TIMEOUT;case a.CSASpecialMove.JISHOGI:return l.SpecialMoveType.ENTERING_OF_KING;case a.CSASpecialMove.MAX_MOVES:return l.SpecialMoveType.IMPASS}return t===a.CSAGameResult.DRAW?l.SpecialMoveType.DRAW:l.SpecialMoveType.INTERRUPT}onClose(){this.close(this.settings.autoRelogin?g.RELOGIN_WITH_INTERVAL:g.DO_NOT_RELOGIN)}next(e){this.blackClock.stop(),this.whiteClock.stop(),this.syncClock(e),this.startClock();this.recordManager.record.position.color===this.gameSummary.myColor?this.startSearch(e):this.startPonder()}syncClock(e){const t={onBeepShort:()=>this.onBeepShort(),onBeepUnlimited:()=>this.onBeepUnlimited(),onStopBeep:()=>this.onStopBeep()},o=this.gameSummary.players.black.time;this.blackClock.setup({...t,timeMs:e.black.time*o.timeUnitMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3});const i=this.gameSummary.players.white.time;this.whiteClock.setup({...t,timeMs:e.white.time*i.timeUnitMs,byoyomi:i.byoyomi*i.timeUnitMs/1e3})}startClock(){this.recordManager.record.position.color===l.Color.BLACK?this.blackClock.start():this.whiteClock.start()}startSearch(e){this.player?this.player.startSearch(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates(e),{onMove:this.onPlayerMove.bind(this),onResign:this.onPlayerResign.bind(this),onWin:this.onPlayerWin.bind(this),onError:this.onPlayerError.bind(this)}).catch((e=>{this.onError(new Error(`CSAGameManager#startSearch: ${u.t.failedToSendGoCommand}: ${e}`))})):this.onError("CSAGameManager#startSearch: player is not initialized")}startPonder(){this.player?this.player.startPonder(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates()).catch((e=>{this.onError(new Error(`CSAGameManager#startPonder: ${u.t.failedToSendPonderCommand}: ${e}`))})):this.onError("CSAGameManager#startPonder: player is not initialized")}startEarlyPonder(e){if(!this.player)return void this.onError("CSAGameManager#startEarlyPonder: player is not initialized");const t=this.recordManager.record.position.clone(),o=this.recordManager.record.usi+" "+e.usi;t.doMove(e)?this.player.startPonder(t,o,this.buildTimeStates()).catch((e=>{this.onError(new Error(`CSAGameManager#startEarlyPonder: ${u.t.failedToSendPonderCommand}: ${e}`))})):this.onError("CSAGameManager#startEarlyPonder: failed to make a move")}buildTimeStates(e){const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;return{black:{timeMs:e?e.black.time*t.timeUnitMs:this.blackClock.timeMs,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},white:{timeMs:e?e.white.time*o.timeUnitMs:this.whiteClock.timeMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}}onPlayerMove(e,t){let o,i;switch(this.searchInfo=t,this._settings.server.protocolVersion){case s.CSAProtocolVersion.V121:break;case s.CSAProtocolVersion.V121_FLOODGATE:o=t?.score,t?.pv?.forEach((e=>{i=i?i+" ":"",i+=(0,l.formatCSAMove)(e)}))}n.default.csaMove(this.sessionID,(0,l.formatCSAMove)(e),o,i),this.settings.player.usi?.enableEarlyPonder&&this.startEarlyPonder(e)}onPlayerResign(){n.default.csaResign(this.sessionID)}onPlayerWin(){n.default.csaWin(this.sessionID)}onPlayerError(e){this.onError(e)}};const S={}},7872:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RecordManager=t.SearchInfoSenderType=void 0;const n=o(5746),a=o(3113),r=o(5283),s=o(9273),l=o(8474),c=o(6059),d=o(7187),u=i(o(7510)),m=o(1219),p=o(9886);var h;function g(e){const t=/^\*詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||d.SCORE_MATE_INFINITE)*("先手勝ち"===t[1]?1:-1)}function S(e){const t=/^#詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||d.SCORE_MATE_INFINITE)*("先手勝ち"===t[1]?1:-1)}function f(e){const t=/^\*評価値=([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function y(e){const t=/^#評価値=([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function v(e){const t=/^\* *([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function b(e){const t=/^\*対局 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function I(e){const t=/^\*解析 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function T(e){const t=/^\* .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function E(e){const t=/^#(?:形勢|指し手)\[([+-]?[0-9]+)\]/.exec(e);return t?Number(t[1]):void 0}function C(e){e.forEach((e=>{const t=e.customData||{},o=e.comment.split("\n");for(const e of o){const o=g(e);void 0!==o&&(t.playerSearchInfo={...t.playerSearchInfo,mate:o});const i=S(e);void 0!==i&&(t.researchInfo={...t.researchInfo,mate:i});const n=f(e)||v(e)||b(e);void 0!==n&&(t.playerSearchInfo={...t.playerSearchInfo,score:n});const a=y(e)||I(e)||T(e)||E(e);void 0!==a&&(t.researchInfo={...t.researchInfo,score:a})}e.customData=t}))}function A(e,t){const o=t.indexOf(" ",t.indexOf(" ")+1)+1,i=[],n=e.clone();for(let e=o;e<t.length;e+=8){const o=t.substring(e,e+7),r=(0,a.parseCSAMove)(n,o);if(r instanceof Error||!n.doMove(r,{ignoreValidation:!1}))break;i.push(r)}return i}function P(e){return e.timeSeconds+"+"+e.byoyomi+"+"+e.increment}function M(e){return(0,p.secondsToMMSS)(e.timeSeconds)+"+"+String(e.byoyomi).padStart(2,"0")}!function(e){e[e.PLAYER=0]="PLAYER",e[e.OPPONENT=1]="OPPONENT",e[e.RESEARCHER=2]="RESEARCHER",e[e.RESEARCHER_2=3]="RESEARCHER_2",e[e.RESEARCHER_3=4]="RESEARCHER_3",e[e.RESEARCHER_4=5]="RESEARCHER_4"}(h||(t.SearchInfoSenderType=h={}));t.RecordManager=class{_record=new a.Record;_recordFilePath;_unsaved=!1;_sourceURL;onResetRecord=()=>{};onChangePosition=()=>{};onUpdateTree=()=>{};onUpdateCustomData=()=>{};onUpdateFollowingMoves=()=>{};onBackup=()=>{};get record(){return this._record}get recordFilePath(){return this._recordFilePath}get unsaved(){return this._unsaved}get sourceURL(){return this._sourceURL}updateRecordFilePath(e){this._unsaved=!1,e!==this._recordFilePath&&(this._recordFilePath=e,e&&u.default.addRecordFileHistory(e))}async saveBackup(){if(!this.unsaved)return;const e=this.onBackup(),t=(0,a.exportKIF)(this.record,e||{});await u.default.saveRecordFileBackup(t)}saveBackupOnBackground(){this.saveBackup().catch((e=>{u.default.log(m.LogLevel.ERROR,`RecordManager#saveBackupOnBackground: failed to save backup: ${e}`)}))}clearRecord(e){this.saveBackupOnBackground(),this._record.clear(e),this._unsaved=!1,this._recordFilePath=void 0,this._sourceURL=void 0,this.onResetRecord()}replaceRecord(e,t){this.saveBackupOnBackground(),this._record=e,this.bindRecordHandlers(),this.updateRecordFilePath(t?.path),this._unsaved=!t?.markAsSaved,this._sourceURL=void 0,C(this._record),this.onResetRecord()}reset(){this.clearRecord()}resetByInitialPositionType(e){this.resetBySFEN((0,a.initialPositionTypeToSFEN)(e))}resetBySFEN(e){const t=new a.Position;return!!t.resetBySFEN(e)&&(this.clearRecord(t),!0)}resetByCurrentPosition(){this.clearRecord(this._record.position)}parseRecordData(e,t){let o;switch(t||(0,a.detectRecordFormat)(e)){case a.RecordFormatType.SFEN:{const t=a.Position.newBySFEN(e);o=t?new a.Record(t):new Error(l.t.failedToParseSFEN);break}case a.RecordFormatType.USI:o=a.Record.newByUSI(e);break;case a.RecordFormatType.KIF:o=(0,a.importKIF)(e);break;case a.RecordFormatType.KI2:o=(0,a.importKI2)(e);break;case a.RecordFormatType.CSA:o=(0,a.importCSA)(e);break;case a.RecordFormatType.JKF:o=(0,a.importJKFString)(e);break;default:o=new Error(l.t.failedToDetectRecordFormat)}return o instanceof Error?(0,l.localizeError)(o):o}importRecord(e,t){const o=this.parseRecordData(e,t?.type);if(o instanceof Error)return o;this.replaceRecord(o,t)}importRecordFromBuffer(e,t,o){const i=(0,c.detectRecordFileFormatByPath)(t);if(!i)return new Error(`${l.t.unknownFileExtension}: ${t}`);const n=(0,c.importRecordFromBuffer)(e,i,o);if(n instanceof Error)return(0,l.localizeError)(n);this.replaceRecord(n,{path:t,markAsSaved:!0})}async importRecordFromRemoteURL(e){const t=!e;if(!(e=e||this._sourceURL))return void u.default.log(m.LogLevel.ERROR,"RecordManager#importRecordFromRemoteURL: source URL is not set");const o=await u.default.loadRemoteRecordFile(e),i=this.parseRecordData(o);if(i instanceof Error)throw i;t?this.mergeRecord(i):this.replaceRecord(i),this._sourceURL=e}exportRecordAsBuffer(e,t){const o=(0,c.detectRecordFileFormatByPath)(e);if(!o)return new Error(`${l.t.unknownFileExtension}: ${e}`);const i=(0,c.exportRecordAsBuffer)(this._record,o,t);return this.updateRecordFilePath(e),i}applyPosition(e){this._record.clear(e),this._unsaved=!0,this._recordFilePath=void 0,this.onResetRecord()}swapNextTurn(){const e=this.record.position.clone();e.setColor((0,a.reverseColor)(e.color)),this.applyPosition(e)}changePosition(e){const t=this.record.position.clone();t.edit(e),this.applyPosition(t)}changePieceSet(e){const t=this.record.position.clone(),o=(0,a.countExistingPieces)(this.record.position),i={king:e.king-o.king,rook:e.rook-(o.rook+o.dragon),bishop:e.bishop-(o.bishop+o.horse),gold:e.gold-o.gold,silver:e.silver-(o.silver+o.promSilver),knight:e.knight-(o.knight+o.promKnight),lance:e.lance-(o.lance+o.promLance),pawn:e.pawn-(o.pawn+o.promPawn)};Object.entries(i).filter((([,e])=>e<0)).forEach((([e,o])=>{const i=e;for(let e=0;e>o;e--){const e=a.Square.all.find((e=>t.board.at(e)?.unpromoted().type===i));e?t.board.remove(e):i!==a.PieceType.KING&&(t.blackHand.count(i)>t.whiteHand.count(i)?t.blackHand.reduce(i,1):t.whiteHand.reduce(i,1))}})),Object.entries(i).filter((([,e])=>e>0)).forEach((([e,o])=>{const i=e;for(let e=0;e<o;e++){const e=a.Square.all.find((e=>!t.board.at(e)));e?t.board.set(e,new a.Piece(a.Color.BLACK,i)):i!==a.PieceType.KING&&(t.blackHand.count(i)<=t.whiteHand.count(i)?t.blackHand.add(i,1):t.whiteHand.add(i,1))}})),this.applyPosition(t)}changePly(e){this._record.goto(e)}changeBranch(e){return this._record.switchBranchByIndex(e)}swapWithNextBranch(){return!!this._record.swapWithNextBranch()&&(this._unsaved=!0,!0)}swapWithPreviousBranch(){return!!this._record.swapWithPreviousBranch()&&(this._unsaved=!0,!0)}removeCurrentMove(){return!!this._record.removeCurrentMove()&&(this._unsaved=!0,!0)}removeNextMove(){return!!this._record.removeNextMove()&&(this._unsaved=!0,!0)}jumpToBookmark(e){return this._record.jumpToBookmark(e)}updateComment(e){this._record.current.comment=e,this._unsaved=!0}updateBookmark(e){this._record.current.bookmark=e,this._unsaved=!0}appendComment(e,t){if(!e)return;const o=this._record.current.comment,i=this.record.current.comment?"\n":"";switch(t){case s.CommentBehavior.NONE:break;case s.CommentBehavior.INSERT:this._record.current.comment=e+i+o;break;case s.CommentBehavior.APPEND:this._record.current.comment=o+i+e;break;case s.CommentBehavior.OVERWRITE:this._record.current.comment=e}this._unsaved=!0}appendSearchComment(e,t,o,i){let n=function(e,t,o,i){const n=t===h.PLAYER?"*":"#";let s="";o.mate&&(s+=`${n}詰み=${o.mate>=0?"先手勝ち":"後手勝ち"}`,Math.abs(o.mate)!==d.SCORE_MATE_INFINITE&&(s+=`:${Math.abs(o.mate)}手`),s+="\n");return void 0!==o.score&&(s+=(0,r.getSituationText)(o.score)+"\n",s+=`${n}評価値=${o.score}\n`),o.pv&&0!==o.pv.length&&(s+=`${n}読み筋=${(0,a.formatPV)(e,o.pv)}\n`),o.depth&&(s+=`${n}深さ=${o.depth}\n`),o.nodes&&(s+=`${n}ノード数=${o.nodes}\n`),s&&i?.engineName&&(s+=`${n}エンジン=${i.engineName}\n`),s}(this.record.position,e,t,i);i?.header&&(n=i.header+"\n"+n),this.appendComment(n,o),this._unsaved=!0}get inCommentPVs(){return function(e,t){const o=[];for(const i of t.split("\n")){let t;if(i.match(/^[#*]読み筋=/))t=(0,a.parsePV)(e,i.substring(5));else if(i.match(/^\*.* 読み筋 /)){const o=i.substring(i.indexOf(" 読み筋 ")+5),n=e.color===a.Color.BLACK?"▲":"△";t=(0,a.parsePV)(e,o.substring(o.indexOf(n)))}else if(i.match(/^#(?:指し手|形勢)\[/)){const o=i.substring(i.indexOf("]")+1),n=e.color===a.Color.BLACK?"▲":"△";t=(0,a.parsePV)(e,o.substring(o.indexOf(n)))}else i.match(/^\* -?[0-9]+ /)&&(t=A(e,i));t?.length&&o.push(t)}return o}(this.record.position,this.record.current.comment)}setGameStartMetadata(e){e.gameTitle&&this._record.metadata.setStandardMetadata(a.RecordMetadataKey.TITLE,e.gameTitle),e.blackName&&this._record.metadata.setStandardMetadata(a.RecordMetadataKey.BLACK_NAME,e.blackName),e.whiteName&&this._record.metadata.setStandardMetadata(a.RecordMetadataKey.WHITE_NAME,e.whiteName),this._record.metadata.setStandardMetadata(a.RecordMetadataKey.DATE,(0,n.getDateString)()),this._record.metadata.setStandardMetadata(a.RecordMetadataKey.START_DATETIME,(0,n.getDateTimeString)());const t=e.blackTimeLimit.increment||e.whiteTimeLimit.increment?P:M,o=t(e.blackTimeLimit),i=t(e.whiteTimeLimit);o===i?this._record.metadata.setStandardMetadata(a.RecordMetadataKey.TIME_LIMIT,o):(this._record.metadata.setStandardMetadata(a.RecordMetadataKey.BLACK_TIME_LIMIT,o),this._record.metadata.setStandardMetadata(a.RecordMetadataKey.WHITE_TIME_LIMIT,i)),this._unsaved=!0}setGameEndMetadata(){this._record.metadata.setStandardMetadata(a.RecordMetadataKey.END_DATETIME,(0,n.getDateTimeString)()),this._unsaved=!0}updateSearchInfo(e,t){const o=this.record.current.customData||{};switch(e){case h.PLAYER:o.playerSearchInfo=t;break;case h.OPPONENT:o.opponentSearchInfo=t;break;case h.RESEARCHER:(t.depth||0)>=(o.researchInfo?.depth||0)&&(o.researchInfo=t);break;case h.RESEARCHER_2:(t.depth||0)>=(o.researchInfo2?.depth||0)&&(o.researchInfo2=t);break;case h.RESEARCHER_3:(t.depth||0)>=(o.researchInfo3?.depth||0)&&(o.researchInfo3=t);break;case h.RESEARCHER_4:(t.depth||0)>=(o.researchInfo4?.depth||0)&&(o.researchInfo4=t)}this._record.current.customData=o,this.onUpdateCustomData()}appendMove(e){return!!this._record.append(e.move,e.moveOption)&&(void 0!==e.elapsedMs&&this._record.current.setElapsedMs(e.elapsedMs),this._unsaved=!0,!0)}appendMovesSilently(e,t){this.unbindRecordHandlers();try{let o=0;const i=this._record.current.ply;for(const i of e){if(!this._record.append(i,t))break;o++}return this._record.goto(i),this._unsaved=!0,this.onUpdateFollowingMoves(),o}finally{this.bindRecordHandlers()}}mergeRecord(e){this._record.merge(e),this._unsaved=!0,C(this._record),this.onUpdateTree()}updateStandardMetadata(e){this._record.metadata.setStandardMetadata(e.key,e.value),this._unsaved=!0}on(e,t){switch(e){case"resetRecord":this.onResetRecord=t;break;case"changePosition":this.onChangePosition=t,this.bindRecordHandlers();break;case"updateTree":this.onUpdateTree=t;break;case"updateCustomData":this.onUpdateCustomData=t;break;case"updateFollowingMoves":this.onUpdateFollowingMoves=t;break;case"backup":this.onBackup=t}return this}bindRecordHandlers(){this._record.on("changePosition",this.onChangePosition)}unbindRecordHandlers(){this._record.on("changePosition",(()=>{}))}}},5283:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSituationText=function(e){return e>=1500?"先手勝勢":e>=600?"先手優勢":e>=400?"先手有利":e>=200?"先手有望":e>=-200?"互角":e>=-400?"後手有望":e>=-600?"後手有利":e>=-1500?"後手優勢":"後手勝勢"},t.scoreToPercentage=function(e,t){return 100/(1+Math.exp(-e/t))}},1288:e=>{e.exports=require("electron")},6953:e=>{e.exports=require("encoding-japanese")},983:e=>{e.exports=require("log4js")},636:e=>{e.exports=require("node:child_process")},9971:e=>{e.exports=require("node:fs")},9427:e=>{e.exports=require("node:net")},1258:e=>{e.exports=require("node:os")},6743:e=>{e.exports=require("node:path")},7558:e=>{e.exports=require("node:readline")},3113:e=>{e.exports=require("tsshogi")},913:e=>{e.exports=require("yaml")}},t={};var o=function o(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,o),a.exports}(3965);module.exports=o})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usi-csa-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "command line tool derived from ShogiHome(https://github.com/sunfish-shogi/electron-shogi)",
|
|
5
5
|
"author": "Kubo, Ryosuke",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"scripts": {},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"electron-shogi-core": "^0.7.0",
|
|
23
22
|
"encoding-japanese": "^2.0.0",
|
|
24
23
|
"log4js": "^6.7.0",
|
|
24
|
+
"tsshogi": "^1.0.0",
|
|
25
25
|
"yaml": "^2.3.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {},
|