nadesiko3 3.3.78 → 3.3.80
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/README.md +48 -27
- package/batch/command.txt +177 -169
- package/batch/command_nakopad.txt +8 -0
- package/core/package.json +1 -1
- package/core/src/nako_core_version.mjs +2 -2
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_gen.mjs +6 -3
- package/core/src/nako_gen.mts +6 -3
- package/core/src/nako_parser3.mjs +9 -2
- package/core/src/nako_parser3.mts +5 -2
- package/core/src/nako_types.mts +1 -0
- package/core/src/plugin_system.mjs +77 -1
- package/core/src/plugin_system.mts +69 -1
- package/core/test/array_test.mjs +22 -0
- package/core/test/flow_test.mjs +18 -0
- package/package.json +1 -1
- package/release/_hash.txt +28 -28
- package/release/_script-tags.txt +14 -14
- package/release/command.json +1 -1
- package/release/command.json.js +1 -1
- package/release/command_cnako3.json +1 -1
- package/release/command_list.json +1 -1
- package/release/editor.js +1 -1
- package/release/nako_gen_async.js +1 -1
- package/release/plugin_turtle.js +1 -1
- package/release/stats.json +1 -1
- package/release/version.js +1 -1
- package/release/wnako3.js +1 -1
- package/release/wnako3webworker.js +1 -1
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser_storage.mjs +2 -3
- package/src/plugin_node.mjs +20 -0
- package/src/plugin_node.mts +20 -0
- package/src/plugin_turtle.mjs +1 -1
- package/test/node/plugin_node_test.mjs +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";var __webpack_modules__={4228:function(e,t){t.Z={version:"3.3.77",major:3,minor:3,patch:77}},6297:function(e,t,n){n.d(t,{as:function(){return c},cg:function(){return i},ih:function(){return u},k:function(){return s},l0:function(){return a},t5:function(){return r},tO:function(){return o}});class s extends Error{constructor(e,t,n,s){const r=`${n||""}${void 0===s?"":`(${s+1}行目): `}`;super(`[${e}]${r}${t=t.replace(/『main__(.+?)』/g,"『$1』")}`),this.name="NakoError",this.type="NakoError",this.tag="["+e+"]",this.positionJa=r,this.msg=t}}class r extends s{constructor(e,t,n){super("インデントエラー",e,n,t),this.type="NakoIndentError",this.line=t,this.file=n}}class i extends s{constructor(e,t,n,s,r){super("字句解析エラー(内部エラー)",e,r,s),this.type="InternalLexerError",this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=n,this.line=s,this.file=r}}class o extends s{constructor(e,t,n,s,r){super("字句解析エラー",e,r,s),this.type="NakoLexerError",this.startOffset=t,this.endOffset=n,this.line=s,this.file=r}}class u extends s{constructor(e,t,n,s,r){super("文法エラー",e,r,t),this.type="NakoSyntaxError",this.file=r,this.line=t,this.startOffset=n,this.endOffset=s}static fromNode(e,t,n){if(!t)return new u(e,void 0,void 0,void 0,void 0);const s="number"==typeof t.startOffset?t.startOffset:void 0,r=n&&"number"==typeof n.endOffset?n.endOffset:"number"==typeof t.endOffset?t.endOffset:void 0;return new u(e,t.line,s,r,t.file)}}class c extends s{constructor(e,t){let n,r,i,o="unknown";"string"==typeof e?o=e:e instanceof c||e instanceof s?o=e.msg:e instanceof Error&&(o="Error"===e.name?e.message:`${e.name}: ${e.message}`),void 0===t?(n=void 0,r=void 0):(i=/^l(-?\d+):(.*)$/.exec(t))?(n=parseInt(i[1]),r=i[2]):(i=/^l(-?\d+)$/.exec(t))?(n=parseInt(i[1]),r="main.nako3"):(n=0,r=t),super("実行時エラー",o,r,n),this.type="NakoRuntimeError",this.lineNo=t,this.line=n,this.file=r}}class a extends s{constructor(e,t,n){super("取り込みエラー",e,t,n),this.file=t,this.line=n}}},9485:function(e,t,n){n.d(t,{Im:function(){return o},Jc:function(){return i},un:function(){return r}});var s=n(6297);class r{constructor(e=!1,t=[],n="",s=""){this.isTest=e,this.codeStandalone=n,this.codeEnv=s,this.importFiles=["plugin_system.mjs","plugin_math.mjs","plugin_csv.mjs","plugin_promise.mjs","plugin_test.mjs"];for(const e of t)this.importFiles.push(e)}}class i{constructor(e){this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestFuncs={},this.usedFuncSet=new Set,this.loopId=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0,mumeiId:0},this.warnUndefinedVar=!0,this.constPools=[],this.warnUndefinedReturnUserFunc=1,this.warnUndefinedCallingUserFunc=1,this.warnUndefinedCallingSystemFunc=1,this.warnUndefinedCalledUserFuncArgs=1,this.debugOption=e.debugOption}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}convLineno(e,t=!1,n=0){if(this.speedMode.lineNumbers>0)return"";let s;if(s="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line+n}`:`l${e.line+n}:${e.file}`,!t){if(s===this.lastLineNo)return"";this.lastLineNo=s}const r=JSON.stringify(s);let i="";return this.debugOption.useDebug&&(this.debugOption.messageAction&&(i+=`window.postMessage({action:'${this.debugOption.messageAction}',line: ${r}});`),e.line+n>=1&&this.debugOption.waitTime>0&&(i+=`await __v0['秒待'](${this.debugOption.waitTime},__self);`),i+="if(__v0.forceClose){return-1};"),`__v0.line=${r};`+i}varname(e){return 3===this.varslistSet.length?`__varslist[2][${JSON.stringify(e)}]`:i.isValidIdentifier(e)?e:`__vars[${JSON.stringify(e)}]`}static getFuncName(e){if(e.indexOf("__")>=0){const t=e.split("__");return`${t[0]}__${i.getFuncName(t[1])}`}let t=e.replace(/[ぁ-ん]+$/,"");return""===t&&(t=e),t}static convPrint(e){return`__print(${e});`}convRequire(e){const t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');\n`}getDefFuncCode(e,t){let n="";n+=`const nakoVersion = { version: ${JSON.stringify(e.version)} }\n`,n+="const __self = self;\n",n+="self.__self = self;\n",n+="const __varslist = self.__varslist;\n",n+="const __module = self.__module;\n",n+="const __v0 = self.__v0 = self.__varslist[0];\n",n+="const __v1 = self.__v1 = self.__varslist[1];\n",n+="const __vars = self.__vars = self.__varslist[2];\n",n+=`const __modList = self.__modList = ${JSON.stringify(e.getModList())}\n`,n+="__v0.line = 0;\n",n+="__v0.forceClose = false;\n",n+=`__v0.useDebug = ${this.debugOption.useDebug};\n`,n+="self.constPools = "+JSON.stringify(this.constPools)+";\n";let s="";for(const e in this.nakoFuncList){const t=this.nakoFuncList[e].fn;s+=`//[DEF_FUNC name='${e}' asyncFn=${this.nakoFuncList[e].asyncFn?"true":"false"}]\nself.__varslist[1]["${e}"]=${t};\n;//[/DEF_FUNC name='${e}']\n`}if(""!==s&&(n+="__v0.line='関数の定義';\n"+s),t.isTest){let e="const __tests = [];\n";for(const t in this.nakoTestFuncs){e+=`${this.nakoTestFuncs[t].fn};\n;`}""!==e&&(n+="__v0.line='テストの定義';\n",n+=e+"\n")}return n}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=[],n=e=>{if(!e.block)return;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const r=s[e];if("def_func"===r.type){if(!r.name)throw new Error("[System Error] 関数の定義で関数名が指定されていない");const e=r.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.varslistSet[1].names.add(e);const n=r.name.meta;this.nakoFuncList[e]={josi:n.josi,fn:()=>{},type:"func",asyncFn:r.asyncFn},t.push({name:e,node:r})}else if("speed_mode"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}else if("performance_monitor"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}}};n(e);const r=new Set;0===this.speedMode.invalidSore&&r.add("それ"),this.varsSet={isFunction:!1,names:r,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){const n=this.convLineno(e,!1)+this._convGen(e,!0);return t.isTest?"":n}_convGen(e,t){if(!e)return"";let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"block":if(!e.block)return n;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const t=s[e];n+=this._convGen(t,!1)}break;case"comment":case"eol":n+=this.convComment(e);break;case"break":n+=this.convCheckLoop(e,"break");break;case"continue":n+=this.convCheckLoop(e,"continue");break;case"end":n+="__v0['終'](__self);";break;case"number":n+=e.value;break;case"string":n+=this.convString(e);break;case"def_local_var":n+=this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.convDefLocalVarlist(e);break;case"let":n+=this.convLet(e);break;case"inc":n+=this.convInc(e);break;case"word":case"variable":n+=this.convGetVar(e);break;case"op":case"calc":n+=this.convOp(e);break;case"renbun":n+=this.convRenbun(e);break;case"not":n+="(("+this._convGen(e.value,!0)+")?0:1)";break;case"func":case"func_pointer":case"calc_func":n+=this.convCallFunc(e,t);break;case"if":n+=this.convIf(e);break;case"tikuji":n+=this.convTikuji(e);break;case"for":n+=this.convFor(e);break;case"foreach":n+=this.convForeach(e);break;case"repeat_times":n+=this.convRepeatTimes(e);break;case"speed_mode":n+=this.convSpeedMode(e,t);break;case"performance_monitor":n+=this.convPerformanceMonitor(e,t);break;case"while":n+=this.convWhile(e);break;case"atohantei":n+=this.convAtohantei(e);break;case"switch":n+=this.convSwitch(e);break;case"let_array":n+=this.convLetArray(e);break;case"配列参照":n+=this.convRefArray(e);break;case"json_array":n+=this.convJsonArray(e);break;case"json_obj":n+=this.convJsonObj(e);break;case"func_obj":n+=this.convFuncObj(e);break;case"bool":n+=e.value?"true":"false";break;case"null":n+="null";break;case"def_test":n+=this.convDefTest(e);break;case"def_func":n+=this.convDefFunc(e);break;case"return":n+=this.convReturn(e);break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}findVar(e){if(this.varslistSet.length>3&&this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:this.varname(e)};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n){if("引数"===e||"それ"===e||"対象"===e||"対象キー"===e);else if(this.warnUndefinedVar){const n=e.replace(/^main__(.+)$/,"$1");this.__self.getLogger().warn(`変数『${n}』は定義されていません。`,t)}return this.varsSet.names.add(e),this.varname(e)}if(0===n.i){const i=this.__self.getNakoFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi||0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;return this.genVar(t,e)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);const t=this.convLineno(e,!1);let n;if(e.value)n=this._convGen(e.value,!0);else{if(0!==this.speedMode.invalidSore)return t+"return;";n=this.varname("それ")}if(0===this.warnUndefinedReturnUserFunc)return t+`return ${n};`;{const s=this.constPools.length;return this.constPools.push({msg:"ユーザ関数からundefinedが返されています",file:e.file,line:e.line}),t+`return (__self.chk(${n}, ${s}));`}}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return this.convLineno(e)+t+";"}convDefFuncCommon(e,t){let n="",s="";if(0!==this.performanceMonitor.userFunction){let e=t;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),n=`const performanceMonitorEnd = (function (key, type) {\nconst uf_start = performance.now() * 1000;\nreturn function () {\nconst el_time = performance.now() * 1000 - uf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=el_time;\nif(__self.__performance_monitor[key].min_usec>el_time){__self.__performance_monitor[key].min_usec=el_time;}\nif(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_monitor[key].max_usec=el_time;}\n}};})('${e}', 'user');try {\n`,s="} finally { performanceMonitorEnd(); }\n"}let r="";const o=new Set;0===this.speedMode.invalidSore&&o.add("それ"),this.varsSet={isFunction:!0,names:o,readonly:new Set},this.varslistSet.push(this.varsSet),r+=" var 引数 = arguments;\n",r+=" var __vars = {};\n";const u=Array.from(this.varsSet.names.values());let c="";const a=t?e.name.meta:e.meta;for(let n=0;n<a.varnames.length;n++){const s=a.varnames[n];0===this.warnUndefinedCalledUserFuncArgs?c+=` ${this.varname(s)} = arguments[${n}];\n`:c+=t?` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('ユーザ関数(${t})の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`:` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('匿名関数の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`,this.varsSet.names.add(s)}t&&(this.usedFuncSet.add(t),this.varslistSet[1].names.add(t),void 0===this.nakoFuncList[t]&&(this.nakoFuncList[t]={josi:e.name.meta.josi,fn:()=>{},type:"func",asyncFn:!1}));const f=this.usedAsyncFn;this.usedAsyncFn=this.debugOption.useDebug;c+=this._convGen(e.block,!1).split("\n").map((e=>" "+e)).join("\n")+"\n",0===this.speedMode.invalidSore&&(c+=` return (${this.varname("それ")});\n`),c+=s,t&&this.usedAsyncFn&&(this.nakoFuncList[t].asyncFn=!0);for(const e of Array.from(this.varsSet.names.values()))u.includes(e)||i.isValidIdentifier(e)&&(r+=` var ${e};\n`);0===this.speedMode.invalidSore&&(i.isValidIdentifier("それ")?r+=" var それ = '';\n":r+=` ${this.varname("それ")} = '';`);return c=(this.usedAsyncFn?"(async function(){\n":"(function(){\n")+n+r+(" "+this.convLineno(e,!0,1)+"\n")+c+"",c+="})",t&&(this.nakoFuncList[t].fn=c,this.nakoFuncList[t].asyncFn=this.usedAsyncFn,a.asyncFn=this.usedAsyncFn),this.usedAsyncFn=f,this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],t&&(this.__self.__varslist[1][t]=c),c}convDefTest(e){const t=e.name.value;let n=`__tests.push({ name: '${t}', f: () => {\n`;return n+=` ${this._convGen(e.block,!1)}\n}});`,this.nakoTestFuncs[t]={josi:e.name.meta.josi,fn:n,type:"test_func"},""}convDefFunc(e){if(!e.name)return"";const t=i.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){return"{"+e.value.map((e=>`${this._convGen(e.key,!0)}:${this._convGen(e.value,!0)}`)).join(",")+"}"}convJsonArray(e){return"["+e.value.map((e=>this._convGen(e,!0))).join(",")+"]"}convRefArray(e){const t=this._convGen(e.name,!0),n=e.index;let s=t;if(!n)return s;for(let e=0;e<n.length;e++){s+="["+this._convGen(n[e],!0)+"]"}return s}convLetArray(e){const t=this._convGen(e.name,!0),n=e.index||[];let r="",i=t,o="";if(e.checkInit){const e="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";r+=`\n/*配列初期化*/if (!(${t} instanceof Array)) { ${t} = ${e}; /*console.log('初期化:${t}')*/ };`;for(let s=0;s<n.length-1;s++){o+=`[${this._convGen(n[s],!0)}]`,r+=`\n/*配列初期化${s}*/if (!(${t}${o} instanceof Array)) { ${t}${o} = ${e}; };`}r+="\n"}for(let e=0;e<n.length;e++){i+="["+this._convGen(n[e],!0)+"]"}let u=null;if(0===this.speedMode.invalidSore&&(u=this.varname("それ")),e.value&&(u=this._convGen(e.value,!0)),null==u)throw s.ih.fromNode("代入する先の変数名がありません。",e);i+=" = "+u+";\n";return this.convLineno(e,!1)+r+i}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.loopId++,s=`$nako_i${n}`,r=this._convGen(e.from,!0),i=this._convGen(e.to,!0);let o="1";null===e.inc&&void 0!==e.inc&&"null"!==e.inc||(o=this._convGen(e.inc,!0));const u=this.convGenLoop(e.block),c=`$nako_from${n}`,a=`$nako_to${n}`;let f="";0===this.speedMode.invalidSore&&(f=`${this.varname("それ")} = `);const l=`\n//[FOR id=${n}]\nconst ${c} = ${r};\nconst ${a} = ${i};\nif (${c} <= ${a}) { // up\n for (let ${s} = ${c}; ${s} <= ${a}; ${s}+= ${o}) {\n ${f}${t} = ${s};\n ${u}\n };\n} else { // down\n for (let ${s} = ${c}; ${s} >= ${a}; ${s}-= ${o}) {\n ${f}${t} = ${s};\n ${u}\n };\n};\n//[/FOR id=${n}]\n`;return this.convLineno(e,!1)+l}convForeach(e){let t;if(null===e.target){if(0!==this.speedMode.invalidSore)throw s.ih.fromNode("『反復』の対象がありません。",e);t=this.varname("それ")}else t=this._convGen(e.target,!0);let n='__v0["対象"]';e.name&&(n=this.varname(e.name.value),this.varsSet.names.add(e.name.value));const r=this.convGenLoop(e.block),i=this.loopId++;let o="";0===this.speedMode.invalidSore&&(o=`${this.varname("それ")} = `);const u=`let $nako_foreach_v${i}=${t};\nfor (let $nako_i${i} in $nako_foreach_v${i}){\n if ($nako_foreach_v${i}.hasOwnProperty($nako_i${i})) {\n ${n} = ${o}$nako_foreach_v${i}[$nako_i${i}];\n __v0["対象キー"] = $nako_i${i};\n ${r}\n }\n};\n`;return this.convLineno(e,!1)+u}convRepeatTimes(e){const t=this.loopId++,n=this._convGen(e.value,!0),s=this.convGenLoop(e.block);let r="";0===this.speedMode.invalidSore&&(r=`${this.varname("それ")} = `);const i=`let $nako_times_v${t} = ${n};\nfor(var $nako_i${t} = 1; $nako_i${t} <= $nako_times_v${t}; $nako_i${t}++){\n ${r}__v0["回数"] = $nako_i${t};\n `+s+"\n}\n";return this.convLineno(e,!1)+i}convSpeedMode(e,t){if(!e.options)return"";const n={...this.speedMode};e.options["行番号無し"]&&this.speedMode.lineNumbers++,e.options["暗黙の型変換無し"]&&this.speedMode.implicitTypeCasting++,e.options["強制ピュア"]&&this.speedMode.forcePure++,e.options["それ無効"]&&this.speedMode.invalidSore++;try{return this._convGen(e.block,t)}finally{this.speedMode=n}}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};if(!e.options)return"";e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.block,t)}finally{this.performanceMonitor=n}}convWhile(e){const t=`while (${this._convGen(e.cond,!0)}){\n ${this.convGenLoop(e.block)}\n}\n`;return this.convLineno(e,!1)+t}convAtohantei(e){const t=`$nako_i${this.loopId++}`,n=this._convGen(e.cond,!0),s=`for(;;) {\n ${this.convGenLoop(e.block)}\n let ${t} = ${n};\n if (${t}) { continue } else { break }\n}\n\n`;return this.convLineno(e,!1)+s}convSwitch(e){const t=this._convGen(e.value,!0),n=e.cases||[];let s="";for(let e=0;e<n.length;e++){const t=n[e][0],r=this.convGenLoop(n[e][1]);if("違えば"===t.type)s+=" default:\n";else{s+=` case ${this._convGen(t,!0)}:\n`}s+=` ${r}\n break\n`}const r=`switch (${t}){\n${s}\n}\n`;return this.convLineno(e,!1)+r}convIf(e){const t=this._convGen(e.expr,!0),n=this._convGen(e.block,!1),s=null===e.false_block?"":"else {"+this._convGen(e.false_block,!1)+"};\n";return this.convLineno(e,!1)+`if (${t}) {\n ${n}\n}`+s+";\n"}convTikuji(e){const t=`__tikuji${this.loopId++}`;let n=`const ${t} = []\n`;const s=e.blocks?e.blocks:[];for(let e=0;e<s.length;e++){const r=this._convGen(s[e],!1).replace(/\s+$/,"")+"\n";n+=`${t}.push(function(resolve, reject) {\n __self.resolve = resolve;\n __self.reject = reject;\n __self.resolveCount = 0;\n ${this.convLineno(s[e],!0)}\n ${r} if (__self.resolveCount === 0) resolve();\n}); // end of tikuji__\${pid}[{$i}]\n`}n+=`// end of ${t} \n`;let r=` ${t}.splice(0);\n __v0["エラーメッセージ"]=errMsg;\n`;if(null!=e.errorBlock){r+=this._convGen(e.errorBlock,!1).replace(/\s+$/,"")+"\n"}return n+=`const ${t}__reject = function(errMsg){\n${r}};\n`,n+="__self.resolve = undefined;\n",n+=`const ${t}__resolve = function(){\n`,n+=" setTimeout(function(){\n",n+=` if (${t}.length == 0) {return}\n`,n+=` const f = ${t}.shift()\n`,n+=` f(${t}__resolve, ${t}__reject);\n`,n+=" }, 0);\n",n+="};\n",n+=`${t}__resolve()\n`,this.convLineno(e,!1)+n}convFuncGetArgsCalcType(e,t,n){const s=[],r={},i=n.args?n.args:[];for(let e=0;e<i.length;e++){const t=i[e];0===e&&null===t&&0===this.speedMode.invalidSore?(s.push(this.varname("それ")),r.sore=!0):s.push(this._convGen(t,!0))}return[s,r]}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){const n=i.getFuncName(e.name),r=this.findVar(n);if(null===r)throw s.ih.fromNode(`関数『${n}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let o;if(0===r.i){if(o=this.__self.getFunc(n),!o)throw new Error(`[System Error] 関数「${n}」NakoCompiler.nakoFuncList の不整合があります。`);if("func"!==o.type)throw s.ih.fromNode(`『${n}』は関数ではありません。`,e)}else o=this.nakoFuncList[n],void 0===o&&(o={return_none:!1});if("func_pointer"===e.type)return r.js;const u=this.convFuncGetArgsCalcType(n,o,e),c=u[0],a=u[1];if(this.usedFuncSet.add(n),"名前空間設定"===n)return`\n// --- 名前空間(${c[0]}) ---\n__varslist[0]['名前空間設定'](${c[0]}, __self);__self.__modName=${c[0]};\n`;if("プラグイン名設定"===n)return`\n__varslist[0]['プラグイン名設定'](${c[0]}, __self);\n`;c.push("__self");let f="function",l="",h="";if(e.setter&&(l+=";__self.isSetter = true;\n",h+=";__self.isSetter = false;\n"),0===r.i&&this.varslistSet.length>3&&!0!==o.pure&&0===this.speedMode.forcePure){const e=[];for(const t of Array.from(this.varsSet.names.values()))i.isValidIdentifier(t)&&e.push({str:JSON.stringify(t),js:this.varname(t)});l+="__self.__locals = __vars;\n";for(const t of e)l+=`__self.__locals[${t.str}] = ${t.js};\n`;for(const t of e)"それ"!==t.js&&(h+=`${t.js} = __self.__locals[${t.str}];\n`)}a.sore&&(l+="/*[sore]*/");const p=(e,t)=>{let n="";for(const s of e.split("\n"))""!==s&&(n+=" ".repeat(t)+s+"\n");return n},d={TYPEOF:!0,"変数型確認":!0};let _;if(0===this.warnUndefinedCallingUserFunc&&0!==r.i||0===this.warnUndefinedCallingSystemFunc&&0===r.i)_=c.join(",");else{const t=[];c.forEach((s=>{if("__self"===s||!0===d[n])t.push(`${s}`);else{const i=this.constPools.length;0===r.i?this.constPools.push({msg:`命令『${n}』の引数にundefinedを渡しています。`,file:e.file,line:e.line}):this.constPools.push({msg:`ユーザ関数『『${n}』の引数にundefinedを渡しています。`,file:e.file,line:e.line});const o=""===s?'""':s;t.push(`(__self.chk(${o}, ${i}))`)}})),_=t.join(", ")}let y=`${r.js}(${_})`;if(o.asyncFn&&(f=`async ${f}`,y=`await ${y}`,this.numAsyncFn++,this.usedAsyncFn=!0),0===r.i&&0!==this.performanceMonitor.systemFunctionBody){let e=n;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),y=`(${f} (key, type) {\nconst sbf_start = performance.now() * 1000;\ntry {\nreturn `+y+";\n} finally {\nconst sbl_time = performance.now() * 1000 - sbf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sbl_time;\nif(__self.__performance_monitor[key].min_usec>sbl_time){__self.__performance_monitor[key].min_usec=sbl_time;}\nif(__self.__performance_monitor[key].max_usec<sbl_time){__self.__performance_monitor[key].max_usec=sbl_time;}\n"+`}}})('${n}_body', 'sysbody')\n`}let m="";if(o.return_none)m=""===h?""===l?`${y};\n`:`${l} ${y};\n`:`${l}try {\n${p(y,1)};\n} finally {\n${p(h,1)}}\n`;else{let n="";0===this.speedMode.invalidSore&&(n=`${this.varname("それ")} = `),m=""===l&&""===h?`(${n}${y})`:""===h?`(${f}(){\n${p(`${l};\nreturn ${n} ${y}`,1)}}).call(this)`:`(${f}(){\n${p(`${l}try {\n${p(`return ${n}${y};`,1)}\n} finally {\n${p(h,1)}}`,1)}}).call(this)`,("して"===e.josi||""===e.josi&&!t)&&(m+=";\n")}return 0===r.i&&0!==this.performanceMonitor.systemFunction&&(m="(function (key, type) {\nconst sf_start = performance.now() * 1000;\ntry {\nreturn "+m+";\n} finally {\nconst sl_time = performance.now() * 1000 - sf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sl_time;\nif(__self.__performance_monitor[key].min_usec>sl_time){__self.__performance_monitor[key].min_usec=sl_time;}\nif(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_monitor[key].max_usec=sl_time;}\n"+`}}})('${n}_sys', 'system')\n`),m}convRenbun(e){const t=this._convGen(e.right,!0);return`(function(){${this._convGen(e.left,!1)}; return ${t}}).call(this)`}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"};let n=e.operator||"",s=this._convGen(e.right,!0),r=this._convGen(e.left,!0);return"+"===n&&0===this.speedMode.implicitTypeCasting&&(e.left&&"number"!==e.left.type&&(r=`parseFloat(${r})`),e.right&&"number"!==e.right.type&&(s=`parseFloat(${s})`)),"^"===n?`(Math.pow(${r}, ${s}))`:"÷÷"===n?`(Math.floor(${r} / ${s}))`:(t[n]&&(n=t[n]),`(${r} ${n} ${s})`)}convInc(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("加算する先の変数名がありません。",e);const n=e.name.value;let r=this.findVar(n),i="";if(null===r&&(this.varsSet.names.add(n),r=this.findVar(n),!r))throw new Error("『増』または『減』で変数が見当たりません。");const o=r.js;return i+=`if (typeof(${o}) === 'undefined') { ${o} = 0; }`,i+=`${o} += ${t}`,";"+this.convLineno(e,!1)+i+"\n"}convLet(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("代入する先の変数名がありません。",e);const n=e.name.value,r=this.findVar(n);let i="";if(null===r)this.varsSet.names.add(n),i=`${this.varname(n)} = ${t};`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);i=`${r.js} = ${t};`}return";"+this.convLineno(e,!1)+i+"\n"}convDefLocalVar(e){const t=null===e.value?"null":this._convGen(e.value,!0),n=e.name.value,r=e.vartype;if(this.varsSet.names.has(n))throw s.ih.fromNode(`${r}『${n}』の二重定義はできません。`,e);this.varsSet.names.add(n),"定数"===r&&this.varsSet.readonly.add(n);const i=`${this.varname(n)}=${t};\n`;return this.convLineno(e,!1)+i}convDefLocalVarlist(e){let t="";const n=e.vartype,s=null===e.value?"null":this._convGen(e.value,!0);this.loopId++;const r=`$nako_i${this.loopId}`;t+=`${r}=${s}\n`,t+=`if (!(${r} instanceof Array)) { ${r}=[${r}] }\n`;const i=e.names?e.names:[];for(let e=0;e<i.length;e++){const s=i[e].value;this.varsSet.names.has(s),this.varsSet.names.add(s),"定数"===n&&this.varsSet.readonly.add(s);t+=`${this.varname(s)}=${r}[${e}];\n`}return this.convLineno(e,!1)+t}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n){const n=(t,n)=>'"+'+this.genVar(n,e)+'+"';t=t.replace(/\{(.+?)\}/g,n),t=t.replace(/{(.+?)}/g,n)}return'"'+t+'"'}convTryExcept(e){const t=this._convGen(e.block,!1),n=this._convGen(e.errBlock,!1);return this.convLineno(e,!1)+`try {\n${t}\n} catch (e) {\n __v0["エラーメッセージ"] = e.message;\n;\n`+`${n}}\n`}getUsedFuncSet(){return this.usedFuncSet}getPluginInitCode(){let e="",t="";for(const e in this.__self.__module){const n=`!${e}:初期化`;this.varslistSet[0].names.has(n)&&(this.usedFuncSet.add(`!${e}:初期化`),t+=`__v0["!${e}:初期化"](__self);\n`)}return""!==t&&(e+="__v0.line='l0:プラグインの初期化';\n"+t),e}}function o(e,t,n){const s=new i(e);s.registerFunction(t);let r=s.convGen(t,n);const o=s.getDefFuncCode(e,n),u=(new Date).getTime()+"_"+Math.floor(4294967295*Math.random());if(r&&n.isTest&&(r+="\n__self._runTests(__tests);\n"),s.numAsyncFn>0||s.debugOption.useDebug){const e="__eval_nako3async_"+u+"__";r=`\n// --------------------------------------------------\n// <nadesiko3::gen::async id="${u}" times="${s.numAsyncFn}">\nasync function ${e}(self) {\n${o}\n${r}\n} // end of ${e}\n${e}.call(self, self)\n.then(() => {\n // ok\n})\n.catch(err => {\n if (err.message === '__終わる__') { return }\n self.numFailures++\n throw self.logger.runtimeError(err, self.__v0.line)\n})\n// </nadesiko3::gen::async id="${u}">\n// --------------------------------------------------\n`}else{const e="__eval_nako3sync_"+u+"__";r=`\n// --------------------------------------------------\n// <nadesiko3::gen::syncMode>\nfunction ${e}(self) {\ntry {\n ${o}\n ${r}\n} catch (err) {\n if (err.message === '__終わる__') { return }\n self.numFailures++\n throw self.logger.runtimeError(err, self.__v0.line)\n}\n} // end of ${e}\n${e}(self)\n// </nadesiko3::gen::syncMode>\n// --------------------------------------------------\n`}e.getLogger().trace("--- generate ---\n"+r);let c="";const a=[];for(const e of n.importFiles){if("nako_errors.mjs"===e)continue;const t="nako3runtime_"+e.replace(/\.(js|mjs)$/,"").replace(/[^a-zA-Z0-9_]/g,"_");a.push(t),c+=`import ${t} from './nako3runtime/${e}'\n`}const f=`// <standaloneCode>\nimport path from 'path'\nimport { NakoRuntimeError } from './nako3runtime/nako_errors.mjs'\n${c}\nconst self = {}\nself.coreVersion = '${e.coreVersion}'\nself.version = '${e.version}'\nself.logger = {\n error: (message) => { console.error(message) },\n warn: (message) => { console.warn(message) },\n send: (level, message) => { console.log(message) },\n};\nself.__varslist = [{}, {}, {}]\nself.__v0 = self.__varslist[0]\nself.initFuncList = []\nself.clearFuncList = []\n// Copy module functions\nfor (const mod of [${a.join(", ")}]) {\n for (const funcName in mod) {\n if (funcName === '初期化') {\n self.initFuncList.push(mod[funcName].fn)\n continue\n }\n if (funcName === '!クリア') {\n self.clearFuncList.push(mod[funcName].fn)\n continue\n }\n self.__varslist[0][funcName] = mod[funcName].fn\n }\n}\nself.__vars = self.__varslist[2];\nself.__module = {};\nself.__locals = {};\nself.__genMode = 'sync';\n\n// プラグインの初期化コードを実行\nself.initFuncList.map(f => f(self))\n\ntry {\n${n.codeStandalone}\n// <JS:standalone>\n${r}\n// </JS:standalone>\n // standaloneCodeでは、即時プラグインのクリアコードを実行\n self.clearFuncList.map(f => f(self))\n} catch (err) {\n self.logger.error(err);\n throw err;\n}\n// </standaloneCode>\n`,l=s.getPluginInitCode();return{runtimeEnv:`\n// <runtimeEnvCode>\nconst self = this\n${n.codeEnv}\n${o}\n${l}\n${r}\n// </runtimeEnvCode>\n`,standalone:f,gen:s}}},8801:function(e,t,n){n.d(t,{g:function(){return g}});var s=n(6297),r=n(4228),i=n(9485);const o="NOP",u="LBL",c="EOL",a="JMP",f="JMP_T",l="JMP_F",h="CALL",p="CALL_OBJ",d="RET",_="TRY",y="CODE";class m{constructor(e,t){this.type=e,this.value=t,this.no=-1,this.tag=0}}class g{constructor(e){this.com=e,this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestList={},this.usedFuncSet=new Set,this.loopId=1,this.flagLoop=!1,this.codeId=0,this.codeArray=[],this.labelContinue=null,this.labelBreak=null,this.labels={},this.__self=e,this.genMode="非同期モード",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0}}static generate(e,t,n){const i=new g(e);i.registerFunction(t);let o=i.convGen(t,!!n);return o=i.getDefFuncCode(n)+o,e.getLogger().trace("--- generate(非同期モード) ---\n"+o),o&&n&&(o+="\n__self._runTests(__tests);\n"),{runtimeEnv:o,standalone:`const nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nthis.logger = {\n error(message) { console.error(message) },\n send(level, message) { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__labels = {};\nthis.__code = [];\nthis.__callstack = [];\nthis.__stack = [];\nthis.__genMode = '非同期モード';\ntry {\n ${i.getVarsCode()}\n ${o}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, this.__varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}`,gen:i}}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return`sys.__vars[${JSON.stringify(e)}]`}getVarsCode(){let e="";for(const t of Array.from(this.usedFuncSet.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n",t+="const __code = this.__code;\n";let n="";for(const e in this.nakoFuncList){n+=`//[DEF_FUNC name='${e}']\n__v1["${e}"]=${this.nakoFuncList[e].fn};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.usedFuncSet.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nakoTestList)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nakoTestList[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=e=>{for(let n=0;n<e.block.length;n++){const s=e.block[n];if("def_func"===s.type){const e=s.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.nakoFuncList[e]={josi:s.name.meta.josi,fn:"",type:"func"}}else("speed_mode"===s.type||"performance_monitor"===s.type)&&("block"===s.block.type?t(s.block):t(s))}};t(e);const n=new Set;0===this.speedMode.invalidSore&&n.add("それ"),this.varsSet={isFunction:!1,names:n,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){this._convGen(e,!0);const n=new Set([a,f,l,h,_]);let s=this.codeArray;{s=s.filter((e=>e.type!==o));const e=new Set;s.forEach((t=>{n.has(t.type)&&e.add(t.value)})),s=s.filter((t=>t.type!==u||(15===t.tag||e.has(t.value))));let t=0;for(;t<s.length-1;)s[t].type!==c||s[t+1].type!==c?t++:s.splice(t+1,1);this.codeArray=s}s.forEach(((e,t)=>{e.type===u&&(this.labels[e.value]=t)})),s.forEach((e=>{n.has(e.type)&&e.no<0&&(e.no=this.labels[e.value])}));let r="";return s.forEach(((e,t)=>{switch(e.type){case o:r+=`case ${t}: break; // [NOP] ${e.value}\n`;break;case u:r+=`case ${t}: break; // [LABEL] ${e.value}\n`;break;case c:r+=`case ${t}: ${e.value}; break; // [EOL]\n`;break;case a:r+=`case ${t}: sys.nextIndex = ${e.no}; break; // ${e.value}\n`;break;case f:r+=`case ${t}: if (sys.__stack.pop()) { sys.nextIndex = ${e.no};} break; // ${e.value}\n`;break;case l:r+=`case ${t}: if (!sys.__stack.pop()) { sys.nextIndex = ${e.no}} break; // ${e.value}\n`;break;case d:r+=`case ${t}: sys.__return(sys); break;\n`;break;case h:r+=`case ${t}: sys.__call(${e.no}, sys); break; // ${e.value}\n`;break;case p:r+=`case ${t}: sys.__callObj('${e.value}', ${t}, sys); break; // ${e.value}\n`;break;case _:r+=`case ${t}: sys.tryIndex = ${e.no}; break; // TRY \n`;break;case y:{const n=e.value.replace(/\s+$/,"");r+=`case ${t}: {\n${n}\n};break;\n`;break}default:throw new Error("invalid code type")}})),r=`\n //-------------------------\n // main_code\n this.__labels = ${JSON.stringify(this.labels)};\n this.nextAsync = (sys) => {\n if (sys.index >= sys.codeSize || sys.index < 0) {return}\n const __v0 = sys.__v0\n try {\n sys.inLoop = true\n while (sys.index < sys.codeSize && sys.index >= 0) {\n // console.log('@@[run]', sys.index)\n switch (sys.index) {\n // --- CODE.BEGIN ---\n ${r}\n // --- CODE.END ---\n default:\n sys.inLoop = false\n console.log(sys.index, sys.__stack)\n throw new Error('Invalid sys.index:' + sys.index)\n break\n }\n // check next\n if (sys.nextIndex >= 0) {\n sys.index = sys.nextIndex\n sys.nextIndex = -1\n } else {\n sys.index++\n }\n if (sys.async) {\n sys.__saveSysenv(sys)\n sys.async = false\n break\n }\n } // end of while\n sys.inLoop = false\n } catch (e) {\n sys.__errorAsync(e, sys)\n }\n }\n this.__errorAsync = (e, sys) => { // エラーが起きた時呼び出す\n sys.__v0["エラーメッセージ"] = e.message;\n if (e.message == '__終わる__') {\n sys.__stopAsync(sys)\n return\n }\n if (sys.tryIndex >= 0) {\n sys.index = sys.tryIndex;\n setTimeout(() => {sys.nextAsync(sys)}, 1)\n } else {\n throw e\n }\n }\n this.__call = (no, sys) => {\n const info = {lastVars:sys.__vars, backNo: this.index + 1}\n sys.__callstack.push(info);\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.nextIndex = no;\n }\n this.__return = sys => {\n if (sys.__callstack.length === 0) {\n sys.__destroySysenv(sys, sys.curSysenv.envid)\n sys.index = -2\n sys.nextIndex = -1\n return\n }\n const sore = sys.__vars['それ'];\n sys.__varslist.pop();\n const info = sys.__callstack.pop();\n sys.nextIndex = info.backNo;\n sys.__vars = info.lastVars;\n sys.__vars['それ'] = sore\n sys.__stack.push(sore);\n }\n this.__resetAsync = sys => {\n sys.index = 0\n sys.codeSize = ${s.length};\n sys.async = false\n sys.nextIndex = -1\n sys.tryIndex = -1\n }\n this.__stopAsync = sys => {\n sys.__resetAsync(sys)\n sys.index = -1 // force stop!!\n }\n this.__callNakoCode = (no, backNo, sys) => {\n this.__call(backNo, sys)\n sys.nextIndex = no\n const sysenv = sys.setAsync(sys)\n setTimeout(() => {\n // console.log('//__callNakoCode, back=', backNo, 'no=', no)\n sys.compAsync(sys, sysenv)\n } ,1)\n }\n this.__callNakoCodeEntry = (no, sys) => {\n sys.__saveSysenv(sys)\n sys.curSysenv = sys.__generateSysenv(sys)\n sys.__restoreSysenv(sys)\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.index = no;\n sys.nextAsync(sys)\n }\n this.__callObj = (vname, curNo, sys) => {\n if (sys.__vars[vname]) {\n const fname = sys.__vars[vname]\n // console.log(sys.__labels)\n if (fname && sys.__labels[fname]) {\n const no = sys.__labels[fname]\n sys.__call(no, sys)\n return\n } else {\n console.log('vname=', vname, 'label=', fname)\n }\n }\n throw new Error('async error in __callObj::', vname)\n }\n this.__generateSysenv = sys => {\n sys.envid = ( sys.envid == null ? 0 : sys.envid ) + 1\n const sysenv = {\n callstack: [],\n varstack: [],\n varslist: [sys.__varslist[0], sys.__varslist[1], sys.__varslist[2]],\n index: -1,\n nextIndex: -1,\n tryIndex: -1,\n envid: sys.envid\n }\n sysenv.vars = sysenv.varslist[2]\n if (sys.sysenvs == null) { sys.sysenvs={} }\n sys.sysenvs[sys.envid] = sysenv\n // console.log('generete envid '+sys.envid)\n return sysenv\n }\n this.__destroySysenv = (sys, envid) => {\n delete sys.sysenvs[envid]\n // console.log('destroy envid '+envid)\n }\n this.__saveSysenv = sys => {\n const sysenv = sys.curSysenv\n sysenv.callstack = sys.__callstack\n sysenv.varstack = sys.__stack\n sysenv.varslist = sys.__varslist\n sysenv.vars = sys.__vars\n sysenv.index = sys.index\n sysenv.nextIndex = sys.nextIndex\n sysenv.tryIndex = sys.tryIndex\n }\n this.__restoreSysenv = sys => {\n const sysenv = sys.curSysenv\n sys.__callstack = sysenv.callstack\n sys.__stack = sysenv.varstack\n sys.__varslist = sysenv.varslist\n sys.__vars = sysenv.vars\n ___vars = sys.__vars\n sys.index = sysenv.index\n sys.nextIndex = sysenv.nextIndex\n sys.tryIndex = sysenv.tryIndex\n }\n this.setAsync = sys => {\n sys.async = true\n return sys.curSysenv\n }\n this.compAsync = (sys,sysenv) => {\n if (sys.async && sys.curSysenv != null && sysenv != null && sys.curSysenv.envid === sysenv.envid) {\n sys.async = false\n } else {\n if (sys.curSysenv == null || sysenv == null || sys.curSysenv.envid !== sysenv.envid) {\n sys.__saveSysenv(sys)\n const envid = sys.curSysenv.envid\n sys.curSysenv = sysenv\n sys.__restoreSysenv(sys)\n // console.log('switch envid '+envid+' to '+sys.curSysenv.envid)\n }\n sys.nextAsync(sys)\n }\n }\n\n this.__resetAsync(this)\n this.curSysenv = this.__generateSysenv(this)\n this.nextAsync(this)\n //-------------------------\n `,t?"":r}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"comment":e.value||(e.value=""),this.addCode(new m(o,e.value));break;case"eol":this.addCode(new m(c,this.convLineno(e,!0)));break;case"number":this.addCodeStr(`sys.__stack.push(${e.value});//number`);break;case"string":this.convString(e);break;case"word":case"variable":this.convGetVar(e);break;case"op":case"calc":this.convOp(e);break;case"renbun":this.convRenbun(e);break;case"not":this._convGen(e.value,!0),this.addCodeStr("if (sys.__stack.length==0) throw new Error('NOTでスタックに値がありません');sys.__stack[sys.__stack.length-1] = (sys.__stack[sys.__stack.length-1]) ? 0:1");break;case"配列参照":this.convRefArray(e);break;case"json_array":this.convJsonArray(e);break;case"json_obj":this.convJsonObj(e);break;case"bool":{const t=e.value?"true":"false";this.addCodeStr(`sys.__stack.push(${t})`);break}case"null":this.addCodeStr("sys.__stack.push(null)");break;case"func":case"func_pointer":case"calc_func":this.convFunc(e,t);break;case"let":this.convLet(e);break;case"let_array":this.convLetArray(e);break;case"block":for(let t=0;t<e.block.length;t++){const n=e.block[t];this._convGen(n,!1)}break;case"if":this.convIf(e);break;case"repeat_times":this.convRepeatTimes(e);break;case"break":this.addCodeStr(this.convCheckLoop(e,"break"));break;case"continue":this.addCodeStr(this.convCheckLoop(e,"continue"));break;case"for":this.convFor(e);break;case"foreach":this.convForeach(e);break;case"while":this.convWhile(e);break;case"switch":this.convSwitch(e);break;case"return":this.convReturn(e);break;case"end":n+=this.addCodeStr("__varslist[0]['終']();");break;case"def_local_var":this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.addCodeStr(this.convDefLocalVarlist(e));break;case"tikuji":throw s.ih.fromNode("「逐次実行」構文は「!非同期モード」では使えません。",e);case"speed_mode":throw s.ih.fromNode("「速度有線」構文は「!非同期モード」では使えません。",e);case"performance_monitor":this.convPerformanceMonitor(e,t);break;case"func_obj":this.convFuncObj(e);break;case"def_test":this.convDefTest(e);break;case"def_func":n+=this.addCodeStr(this.convDefFunc(e));break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}convRequire(e){const t=new i.Jc(this.com);return this.addCodeStr(t.convRequire(e)),""}addCodeStr(e){if(""===e)return"";const t=e.split("\n").map((e=>" "+e.replace(/\s+$/,""))),n=new m(y,t.join("\n"));return this.addCode(n)}addCode(e){return this.codeArray[this.codeId]=e,this.codeId++,""}makeLabel(e){const t=e+"_"+this.loopId++;return this.makeLabelDirectly(t)}makeLabelDirectly(e){const t=new m(u,e);return this.labels[e]=-1,t}makeJump(e){return new m(a,e.value)}makeJumpIfTrue(e){return new m(f,e.value)}makeJumpIfFalse(e){return new m(l,e.value)}convIf(e){const t=this.makeLabel("もし:ここから"),n=this.makeLabel("もし:ここまで"),s=this.makeLabel("もし:違えば");return this.addCode(t),this._convGen(e.expr,!0),this.addCode(this.makeJumpIfFalse(s)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(s),e.falseBlock&&this._convGen(e.falseBlock,!1),this.addCode(n),""}convRepeatTimes(e){this.flagLoop=!0,this.varsSet.names.add("回数"),this.varsSet.readonly.add("回数");const t=`sys.__tmp_i${this.loopId}`;this.loopId++;const n=`sys.__tmp_count${this.loopId}`;this.loopId++,this._convGen(e.value,!0),this.addCodeStr(`${n} = sys.__stack.pop(); ${t} = 0;`);const s=this.makeLabel("回:条件チェック");this.addCode(s);const r=this.makeLabel("回:ここまで");this.labelBreak=r,this.labelContinue=s;const i=`sys.__vars["回数"] = ++${t}\nsys.__stack.push(${t} > ${n})\n`;return this.addCodeStr(i),this.addCode(this.makeJumpIfTrue(r)),this.convGenLoop(e.block),this.addCode(this.makeJump(s)),this.addCode(r),this.flagLoop=!1,""}findVar(e){if(this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:`sys.__vars[${JSON.stringify(e)}]`};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`sys.__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||"回数"===e||this.__self.getLogger().warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const i=this.__self.getFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi)throw new Error("[System Error]");if(0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;let n=`sys.__vars[${JSON.stringify(t)}]`;const s=this.findVar(t);null!=s&&(n=s.js),this.addCodeStr(`sys.__stack.push(${n});`)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);return e.value&&(this._convGen(e.value,!0),this.addCodeStr('sys.__vars["それ"] = sys.__stack.pop()')),this.addCode(new m(d,"")),""}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return"continue"===t?this.labelContinue&&this.addCode(this.makeJump(this.labelContinue)):this.labelBreak&&this.addCode(this.makeJump(this.labelBreak)),""}convDefFuncCommon(e,t){const n=""===t;let s=t;n&&(s="無名関数:"+this.loopId++);const r=this.makeLabel(`関数「${s}」:ここまで`);this.addCode(this.makeJump(r));const i=this.makeLabelDirectly(s);i.tag=15,this.addCode(i);const o=new Set;this.varsSet={isFunction:!0,names:o,readonly:new Set},this.varsSet.names.add("それ"),this.varslistSet.push(this.varsSet);const u=n?e.meta:e.name.meta;let c="",a="";c+=`//関数『${s}』の初期化処理\n`,c+="// 引数をローカル変数として登録\n";for(let e=u.varnames.length-1;e>=0;e--){const t=u.varnames[e];c+=` ${this.varname(t)} = sys.__stack.pop();\n`,this.varsSet.names.add(t),a+=""}return c+="// ここまで:引数をローカル変数として登録\n",this.addCodeStr(c),this.usedFuncSet.add(s),this.varslistSet[1].names.add(s),this.nakoFuncList[s]={josi:u.josi,fn:`(function(){\n const sys = (arguments.length > 0) ? arguments[arguments.length-1] : {}; \n if (sys.newenv) { \n sys.newenv = false\n sys.__callNakoCodeEntry(sys.__labels['${s}'], sys);\n } else {\n `+a+"\n"+` sys.__callNakoCode(sys.__labels['${s}'], sys.nextIndex, sys);\n if (!sys.inLoop) { sys.nextAsync(sys) }\n } })`,type:"func"},this._convGen(e.block,!1),this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],this.__self.__varslist[1][s]=function(){},this.addCode(new m(d,"")),this.addCode(r),t||this.addCodeStr(`sys.__stack.push('${s}')`),""}convDefTest(e){throw s.ih.fromNode("テスト構文は!非同期モードでは使えません。",e)}convDefFunc(e){const t=i.Jc.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){const t=e.value,n="sys.__tmp_obj"+this.loopId++;return this.addCodeStr(n+"={}; // convJsonObj::ここから"),t.forEach((e=>{this._convGen(e.value,!0),this._convGen(e.key,!0),this.addCodeStr(`${n}[sys.__stack.pop()]=sys.__stack.pop()`)})),this.addCodeStr(`this.__stack.push(${n}); delete $objName; // convJsonObj::ここまで`),""}convJsonArray(e){const t=e.value;this.addCode(this.makeLabel("convJsonArray::ここから")),t.forEach((e=>this._convGen(e,!0)));const n=t.length;return this.addCodeStr(`sys.__stack.push(sys.__stack.splice(sys.__stack.length-${n},${n}))`),""}convRefArray(e){this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++)this._convGen(t[e],!0),this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);");return""}convLetArray(e){this._convGen(e.value,!0),this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++){if(this._convGen(t[e],!0),e===t.length-1){this.addCodeStr("const idx = this.__stack.pop();const obj = this.__stack.pop();const val = this.__stack.pop();obj[idx]=val;");break}this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);")}return""}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(this.flagLoop=!0,null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.varname("それ"),s=this.loopId++,r=`sys.__tmp__i${s}`,i=`sys.__tmp__to${s}`;this._convGen(e.from,!0),this._convGen(e.to,!0),this.addCodeStr(`${i}=sys.__stack.pop();${r}=sys.__stack.pop();`),this.addCodeStr(`${n} = ${t} = ${r}`);const o=this.makeLabel("繰返:条件確認"),u=this.makeLabel("繰返:加算");this.addCode(o);const c=this.makeLabel("繰返:ここまで");return this.addCodeStr(`sys.__stack.push(${t} <= ${i})`),this.addCode(this.makeJumpIfFalse(c)),this.labelContinue=u,this.labelBreak=c,this.convGenLoop(e.block),this.addCode(u),this.addCodeStr(`${n} = ++${t};`),this.addCode(this.makeJump(o)),this.addCode(c),this.addCodeStr(`delete ${r};delete ${i};//繰返:掃除`),this.flagLoop=!1,""}convForeach(e){this.flagLoop=!0;let t='__v0["対象"]';e.name&&(t=this.varname(e.name.value),this.varsSet.names.add(e.name.value));if(null===e.target)throw s.ih.fromNode("『反復』の対象がありません。",e);const n=this.varname("それ"),r="sys.__tmp__target"+this.loopId++,i="sys.__tmp__keys"+this.loopId++,o="sys.__tmp__i"+this.loopId++,u="sys.__tmp__count"+this.loopId++;this._convGen(e.target,!0);const c=`// 反復: 初期化\n${r} = sys.__stack.pop();\n${o} = 0;\nif (typeof(${r}) == 'string' || typeof(${r}) == 'number') { ${r} = [${r}]; }\nif (${r} instanceof Array) { ${u} = ${r}.length; }\nelse { // キーの一覧を得る\n ${i} = Object.keys(${r}); \n // hasOwnPropertyがfalseならばkeyを消す処理\n ${i} = ${i}.filter((key)=>{ return ${r}.hasOwnProperty(key) })\n ${u} = ${i}.length;\n}\n`;this.addCodeStr(c);const a=this.makeLabel("反復:条件確認"),f=this.makeLabel("反復:加算"),l=this.makeLabel("反復:ここまで");this.labelBreak=l,this.labelContinue=f,this.addCode(a);const h=`if (${r} instanceof Array) {\n ${t} = ${n} = ${r}[${o}]; __v0["対象キー"] = ${o};\n} else {\n __v0["対象キー"] = ${i}[${o}]; ${t} = ${n} = ${r}[__v0["対象キー"]];\n}\n`;return this.addCodeStr(`${h}\nsys.__stack.push(${o} < ${u});`),this.addCode(this.makeJumpIfFalse(l)),this.convGenLoop(e.block),this.addCode(f),this.addCodeStr(`${o}++`),this.addCode(this.makeJump(a)),this.addCode(l),this.flagLoop=!1,""}convWhile(e){this.flagLoop=!0;const t=this.makeLabel("間:ここから"),n=this.makeLabel("間:ここまで");return this.labelContinue=t,this.labelBreak=n,this.addCode(t),this._convGen(e.cond,!0),this.addCode(this.makeJumpIfFalse(n)),this.convGenLoop(e.block),this.addCode(this.makeJump(t)),this.addCode(n),this.flagLoop=!1,""}convSpeedMode(e,t){return""}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++,this._convGen(e.block,t),this.performanceMonitor=n}convSwitch(e){this._convGen(e.value,!0);const t="sys.__tmp__i"+this.loopId++;this.addCodeStr(`${t} = sys.__stack.pop()`);const n=this.makeLabel("条件分岐:ここまで"),s=e.cases;for(let e=0;e<s.length;e++){const r=s[e][0];if("違えば"===r.type)this.convGenLoop(s[e][1]);else{const i=this.makeLabel("条件分岐:次");this._convGen(r,!0),this.addCodeStr(`sys.__stack.push(sys.__stack.pop() == ${t})`),this.addCode(this.makeJumpIfFalse(i)),this.convGenLoop(s[e][1]),this.addCode(this.makeJump(n)),this.addCode(i)}}return this.addCode(n),this.addCodeStr(`delete ${t}//条件分岐:掃除`),""}convFuncGetArgsCalcType(e,t,n){const s={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t?(this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"),s.sore=!0):this._convGen(t,!0)}return s}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convFunc(e,t){let n=!1,r=!1;const o=i.Jc.getFuncName(e.name),u=this.findVar(o);if(null===u)throw s.ih.fromNode(`関数『${o}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let c;if(0===u.i){if(c=this.__self.getFunc(o),"func"!==c.type)throw s.ih.fromNode(`『${o}』は関数ではありません。`,e);n=!0}else c=this.nakoFuncList[o],void 0===c&&(r=!0,c={return_none:!1});if("func_pointer"===e.type)return u.js;const a=this.convFuncGetArgsCalcType(o,c,e);this.usedFuncSet.add(o);let f="",l="";e.setter&&(f+=";__self.isSetter = true;\n",l+=";__self.isSetter = false;\n"),a.sore&&(f+="/*[sore]*/");const d=e.args.length;let _="";n?(_+=f,_+=`const args = sys.__stack.splice(sys.__stack.length - ${d}, ${d});\n`,_+="args.push(sys);\n",_+=`const ret = ${u.js}.apply(sys, args);\n`,c.return_none||(_+="sys.__vars['それ'] = ret;\n",t&&(_+="sys.__stack.push(ret);\n")),_+=l,this.addCodeStr(_)):(r?this.addCode(new m(p,o)):this.addCode(new m(h,o)),t||this.addCodeStr("sys.__stack.pop();// 戻り値を利用しない関数呼出"))}convRenbun(e){this._convGen(e.left,!1),this._convGen(e.right,!0)}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"},n=e.operator;this._convGen(e.left,!0),this._convGen(e.right,!0);let s="const rv = sys.__stack.pop();\nconst lv = sys.__stack.pop();\n";if("^"===n)s+="const v = (Math.pow(lv, rv))\n";else{s+=`const v = ((lv) ${t[n]||n} (rv));\n`}s+=`sys.__stack.push(v); //op:${n}\n`,this.addCodeStr(s)}convLet(e){let t="";null===e.value?this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"):this._convGen(e.value,!0);const n=e.name.value,r=this.findVar(n);if(null===r)this.varsSet.names.add(n),t=`${this.varname(n)}=sys.__stack.pop();`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);t=`${r.js}=sys.__stack.pop();`}this.addCodeStr(t+"//let")}convDefLocalVar(e){null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const t=e.name.value,n=e.vartype;if(this.varsSet.names.has(t))throw s.ih.fromNode(`${n}『${t}』の二重定義はできません。`,e);return this.varsSet.names.add(t),"定数"===n&&this.varsSet.readonly.add(t),this.addCodeStr(`${this.varname(t)}=sys.__stack.pop()`),""}convDefLocalVarlist(e){const t=e.vartype;null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const n=`sys.__tmp_i${this.loopId}`;this.loopId++,this.addCodeStr(`${n}=sys.__stack.pop();if (!(${n} instanceof Array)) { ${n}=[${n}] }`);for(const r of e.names){const i=r.value;if(this.varsSet.names.has(i))throw s.ih.fromNode(`${t}『${i}』の二重定義はできません。`,e);this.varsSet.names.add(i),"定数"===t&&this.varsSet.readonly.add(i);const o=this.varname(i);this.addCodeStr(`${o}=${n}.pop()`)}return this.addCodeStr(`delete ${n}//複数代入:掃除`),""}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n)throw new Error("[システムエラー] ジェネレーターでの文字列の展開はサポートしていません");return this.addCodeStr(`sys.__stack.push("${t}")//string`),'"'+t+'"'}convTryExcept(e){const t=this.makeLabel("エラー監視:ならば"),n=this.makeLabel("エラー監視:ここまで");this.addCode(new m(_,t.value)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(t),this._convGen(e.errBlock,!1),this.addCode(n)}}if("object"==typeof navigator&&"object"==typeof navigator.nako3){const e=navigator.nako3;e.addCodeGenerator&&e.addCodeGenerator("非同期モード",g)}},8775:function(e,t,n){n.r(t),n.d(t,{josiList:function(){return s},josiRE:function(){return c},removeJosiList:function(){return i},removeJosiMap:function(){return u},tararebaJosiList:function(){return r},tararebaMap:function(){return o}});const s=["について","くらい","なのか","までを","までの","による","とは","から","まで","だけ","より","ほど","など","いて","えて","きて","けて","して","って","にて","みて","めて","ねて","では","には","は~","んで","ずつ","は","を","に","へ","で","と","が","の"],r=["でなければ","なければ","ならば","なら","たら","れば"],i=["こと","である","です","します","でした"],o={};r.forEach((e=>{s.push(e),o[e]=!0}));const u={};i.forEach((e=>{s.push(e),u[e]=!0})),s.sort(((e,t)=>t.length-e.length));const c=new RegExp("^[\\t ]*("+s.join("|")+")")},515:function(e,t,n){n.r(t);t.default={"回":"回","回繰返":"回","間":"間","間繰返":"間","繰返":"繰返","増繰返":"増繰返","減繰返":"減繰返","後判定":"後判定","反復":"反復","抜":"抜ける","続":"続ける","戻":"戻る","先":"先に","次":"次に","代入":"代入","実行速度優先":"実行速度優先","パフォーマンスモニタ適用":"パフォーマンスモニタ適用","定":"定める","逐次実行":"逐次実行","条件分岐":"条件分岐","増":"増","減":"減","変数":"変数","定数":"定数","エラー監視":"エラー監視","エラー":"エラー","それ":"word","そう":"word","関数":"def_func","インデント構文":"インデント構文","非同期モード":"非同期モード","DNCLモード":"DNCLモード","モード設定":"モード設定","取込":"取込"}},6758:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){var _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(6297);__webpack_exports__.Z={meta:{type:"const",value:{pluginName:"plugin_system",pluginVersion:"3.3.38",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.3.38"}},"初期化":{type:"func",josi:[],pure:!1,fn:function(e){e.__v0["ナデシコバージョン"]=e.version,e.__v0["ナデシコ言語バージョン"]=e.coreVersion,e.__namespaceList=[],e.__findVar=function(t,n){if("function"==typeof t)return t;if(e.__locals[t])return e.__locals[t];if(t.indexOf("__")>=0){for(let n=2;n>=0;n--){const s=e.__varslist[n];if(s[t])return s[t]}return n}const s=e.__modList?e.__modList:[e.__modName];for(const n of s){const s=n+"__"+t;for(let t=2;t>=0;t--){const n=e.__varslist[t];if(n[s])return n[s]}}return n},e.__findFunc=function(t,n){const s=e.__findVar(t);if("function"==typeof s)return s;throw new Error(`『${n}』に実行できない関数が指定されました。`)},e.__exec=function(t,n){const s=e.__v0[t];if(s)return s.apply(this,n);const r=e.__findVar(t);if(!r)throw new Error("システム関数でエイリアスの指定ミス:"+t);return r.apply(this,n)},e.__timeout=[],e.__interval=[];const t=e.__zero2=e=>(e="00"+e).substring(e.length-2);e.__zero=(e,t)=>{let n="";for(let e=0;e<t;e++)n+="0";return(e=n+e).substring(e.length-t)},e.__formatDate=e=>e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),e.__formatTime=e=>t(e.getHours())+":"+t(e.getSeconds())+":"+t(e.getMinutes()),e.__formatDateTime=(e,n)=>{const s=e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),r=t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds());return n.match(/^\d+\/\d+\/\d+\s+\d+:\d+:\d+$/)?s+" "+r:n.match(/^\d+\/\d+\/\d+$/)?s:n.match(/^\d+:\d+:\d+$/)?r:s+" "+r},e.__str2date=e=>{if((e=(""+e).replace(/(^\s+|\s+$)/,"")).match(/^(\d+|\d+\.\d+)$/))return new Date(1e3*parseFloat(e));if(e.match(/^\d+:\d+(:\d+)?$/)){const t=new Date,n=(e+":0").split(":");return new Date(t.getFullYear(),t.getMonth(),t.getDate(),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}e=e.replace(/[\s:-]/g,"/");const t=(e+="/0/0/0").split("/");return new Date(parseInt(t[0]),parseInt(t[1])-1,parseInt(t[2]),parseInt(t[3]),parseInt(t[4]),parseInt(t[5]))},e.__printPool="",e.chk=(t,n)=>{if(void 0===t){const t=e.constPools[n];e.logger.warn(t.msg,{file:t.file,line:t.line})}return t}}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__exec("全タイマー停止",[e]),"非同期モード"===e.__genMode&&e.__stopAsync(e),e.__v0["表示ログ"]=""}},"ナデシコバージョン":{type:"const",value:"?"},"ナデシコ言語バージョン":{type:"const",value:"?"},"ナデシコエンジン":{type:"const",value:"nadesi.com/v3"},"ナデシコ種類":{type:"const",value:"?"},"はい":{type:"const",value:1},"いいえ":{type:"const",value:0},"真":{type:"const",value:1},"偽":{type:"const",value:0},"永遠":{type:"const",value:1},"オン":{type:"const",value:1},"オフ":{type:"const",value:0},"改行":{type:"const",value:"\n"},"タブ":{type:"const",value:"\t"},"カッコ":{type:"const",value:"「"},"カッコ閉":{type:"const",value:"」"},"波カッコ":{type:"const",value:"{"},"波カッコ閉":{type:"const",value:"}"},OK:{type:"const",value:!0},NG:{type:"const",value:!1},"キャンセル":{type:"const",value:0},TRUE:{type:"const",value:!0},FALSE:{type:"const",value:!1},PI:{type:"const",value:Math.PI},"空":{type:"const",value:""},NULL:{type:"const",value:null},undefined:{type:"const",value:void 0},"未定義":{type:"const",value:void 0},"エラーメッセージ":{type:"const",value:""},"対象":{type:"const",value:""},"対象キー":{type:"const",value:""},"回数":{type:"const",value:""},CR:{type:"const",value:"\r"},LF:{type:"const",value:"\n"},"非数":{type:"const",value:NaN},"無限大":{type:"const",value:1/0},"空配列":{type:"func",josi:[],pure:!0,fn:function(){return[]}},"空辞書":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空ハッシュ":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空オブジェクト":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("空ハッシュ",[e])}},"表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){e=t.__printPool+e,t.__printPool="",t.__varslist[0]["表示ログ"]+=e+"\n",t.logger.send("stdout",e+"")},return_none:!0},"継続表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__printPool+=e},return_none:!0},"連続表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("表示",[n,t])},return_none:!0},"連続無改行表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("継続表示",[n,t])},return_none:!0},"表示ログ":{type:"const",value:""},"表示ログクリア":{type:"func",josi:[],pure:!0,fn:function(e){e.__varslist[0]["表示ログ"]=""},return_none:!0},"言":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.logger.send("stdout",e+"")},return_none:!0},"コンソール表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e){console.log(e)},return_none:!0},"足":{type:"func",josi:[["に","と"],["を"]],isVariableJosi:!1,pure:!0,fn:function(e,t){return e+t}},"引":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){return e-t}},"掛":{type:"func",josi:[["に","と"],["を"]],pure:!0,fn:function(e,t){if("number"==typeof e)return e*t;if("string"==typeof e){let n="";for(let s=0;s<parseInt(t);s++)n+=e;return n}if(e instanceof Array){const n=[];for(let s=0;s<parseInt(t);s++)n.push(...e);return n}return e*t}},"倍":{type:"func",josi:[["の"],[""]],pure:!0,fn:function(e,t){return e*t}},"割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e/t}},"割余":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e%t}},"偶数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==0}},"奇数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==1}},"二乗":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e*e}},"べき乗":{type:"func",josi:[["の"],["の"]],pure:!0,fn:function(e,t){return Math.pow(e,t)}},"以上":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>=t}},"以下":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<=t}},"未満":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<t}},"超":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>t}},"等":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e===t}},"等無":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e!==t}},"一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)===JSON.stringify(t)}return e===t}},"不一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)!==JSON.stringify(t)}return e!==t}},"範囲内":{type:"func",josi:[["が"],["から"],["の"]],pure:!0,fn:function(e,t,n){return t<=e&&e<=n}},"連続加算":{type:"func",josi:[["を"],["に","と"]],isVariableJosi:!0,pure:!0,fn:function(e,...t){return t.pop(),t.push(e),t.reduce(((e,t)=>e+t))}},"ください":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"お願":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"です":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"拝啓":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu=0},return_none:!0},"敬具":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu+=100},return_none:!0},"礼節レベル取得":{type:"func",josi:[],pure:!0,fn:function(e){return e.__reisetu||(e.__reisetu=0),e.__reisetu}},"JS実行":{type:"func",josi:[["を","で"]],pure:!0,fn:function(src,sys){return eval(src)}},"JSオブジェクト取得":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__findVar(e,null)}},"JS関数実行":{type:"func",josi:[["を"],["で"]],fn:function(name,args){if("string"==typeof name&&(name=eval(name)),"function"!=typeof name)throw new Error("JS関数取得で実行できません。");return args instanceof Array||(args=[args]),name.apply(null,args)}},"JSメソッド実行":{type:"func",josi:[["の"],["を"],["で"]],fn:function(obj,m,args){if("string"==typeof obj&&(obj=eval(obj)),"object"!=typeof obj)throw new Error("JSオブジェクトを取得できませんでした。");return"function"!=typeof m&&(m=obj[m]),args instanceof Array||(args=[args]),m.apply(obj,args)}},"ナデシコ":{type:"func",josi:[["を","で"]],pure:!1,fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ」は利用できません。");t.__varslist[0]["表示ログ"]="",t.__self.runEx(e,t.__modName,{resetEnv:!1,resetLog:!0});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"ナデシコ続":{type:"func",josi:[["を","で"]],fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ続」は利用できません。");t.__self.runEx(e,t.__modName,{resetEnv:!1,resetAll:!1});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"実行":{type:"func",josi:[["を","に","で"]],pure:!1,fn:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e){const n=t.__findFunc(e,"実行");if("function"==typeof n)return n(t)}return e}},"実行時間計測":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=t.__findFunc(e,"実行時間計測")),performance&&performance.now){const n=performance.now();e(t);return performance.now()-n}{const n=Date.now();e(t);return Date.now()-n}}},"終":{type:"func",josi:[],pure:!0,fn:function(e){if(e.__v0.forceClose=!0,!e.__v0.useDebug)throw new Error("__終わる__")}},"変数型確認":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},TYPEOF:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},"文字列変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},TOSTR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},"整数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},TOINT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},"実数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},TOFLOAT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},INT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e)}},FLOAT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseFloat(e)}},"NAN判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return isNaN(e)}},"非数判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Number.isNaN(e)}},HEX:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e).toString(16)}},"進数変換":{type:"func",josi:[["を","の"],[""]],pure:!0,fn:function(e,t){return parseInt(e).toString(t)}},"二進":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return parseInt(e).toString(2)}},"二進表示":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n=parseInt(e).toString(2);t.__exec("表示",[n,t])}},RGB:{type:"func",josi:[["と"],["の"],["で"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+parseInt(""+e).toString(16);return t.substring(t.length-2,t.length)};return"#"+s(e)+s(t)+s(n)}},"論理OR":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e||t}},"論理AND":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&&t}},"論理NOT":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e?0:1}},OR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e|t}},AND:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&t}},XOR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e^t}},NOT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return~e}},SHIFT_L:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e<<t}},SHIFT_R:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>t}},SHIFT_UR:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>>t}},"文字数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Array.from?Array.from(e).length:String(e).length}},"何文字目":{type:"func",josi:[["で","の"],["が"]],pure:!0,fn:function(e,t){return String(e).indexOf(t)+1}},CHR:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.fromCodePoint?String.fromCodePoint(e):String.fromCharCode(e)}},ASC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.prototype.codePointAt?String(e).codePointAt(0):String(e).charCodeAt(0)}},"文字挿入":{type:"func",josi:[["で","の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){t<=0&&(t=1);const s=String(e);return s.substring(0,t-1)+n+s.substring(t-1)}},"文字検索":{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){let s=String(e);s=s.substring(t);const r=s.indexOf(n);return-1===r?0:r+1+t}},"追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)}},"一行追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)+"\n"}},"文字列分解":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return Array.from?Array.from(e):String(e).split("")}},"リフレイン":{type:"func",josi:[["を","の"],["で"]],pure:!0,fn:function(e,t){let n="";for(let s=0;s<t;s++)n+=String(e);return n}},"出現回数":{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return(e=""+e).split(t=""+t).length-1}},MID:{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},"文字抜出":{type:"func",josi:[["で","の"],["から"],["を",""]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},LEFT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},"文字左部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},RIGHT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"文字右部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"区切":{type:"func",josi:[["の","を"],["で"]],pure:!0,fn:function(e,t){return(""+e).split(""+t)}},"文字列分割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=(e=""+e).indexOf(t=""+t);return n<0?[e]:[e.substring(0,n),e.substring(n+t.length)]}},"切取":{type:"func",josi:[["から","の"],["まで","を"]],pure:!0,fn:function(e,t,n){const s=(e=String(e)).indexOf(t);return s<0?(n.__v0["対象"]="",e):(n.__v0["対象"]=e.substring(s+t.length),e.substring(0,s))}},"文字削除":{type:"func",josi:[["の"],["から"],["だけ","を",""]],pure:!0,fn:function(e,t,n){return(e=""+e).substring(0,t-1)+e.substring(t-1+n)}},"置換":{type:"func",josi:[["の","で"],["を","から"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).split(t).join(n)}},"単置換":{type:"func",josi:[["の","で"],["を"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).replace(t,n)}},"トリム":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"空白除去":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"大文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toUpperCase()}},"小文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toLowerCase()}},"平仮名変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u30a1-\u30f6]/g,(function(e){const t=e.charCodeAt(0)-96;return String.fromCharCode(t)}))}},"カタカナ変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u3041-\u3096]/g,(function(e){const t=e.charCodeAt(0)+96;return String.fromCharCode(t)}))}},"英数全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"英数記号全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\x20-\x7F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数記号半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\uFF00-\uFF5F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"カタカナ全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];let o="",u=0;for(;u<e.length;){const t=e.substring(u,u+2),c=i.indexOf(t);if(c>=0){o+=r.charAt(c/2),u+=2;continue}const a=e.charAt(u),f=s.indexOf(a);f>=0?(o+=n.charAt(f),u++):(o+=a,u++)}return o}},"カタカナ半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];return e.split("").map((e=>{const t=n.indexOf(e);if(t>=0)return s.charAt(t);const o=r.indexOf(e);return o>=0?i.substring(2*o,2*o+2):e})).join("")}},"全角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ全角変換",[n,t]),n=t.__exec("英数記号全角変換",[n,t]),n}},"半角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ半角変換",[n,t]),n=t.__exec("英数記号半角変換",[n,t]),n}},"全角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」"},"全角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"半角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」゙゚"},"半角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"JSONエンコード":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e)}},"JSONエンコード整形":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e,null,2)}},"JSONデコード":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return JSON.parse(e)}},"正規表現マッチ":{type:"func",josi:[["を","が"],["で","に"]],pure:!0,fn:function(e,t,n){let s;const r=(""+t).match(/^\/(.+)\/([a-zA-Z]*)$/);s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]);const i=n.__varslist[0]["抽出文字列"]=[],o=String(e).match(s);let u=o;if(s.global);else if(o&&o.length>0){u=o[0];for(let e=1;e<o.length;e++)i[e-1]=o[e]}return u}},"抽出文字列":{type:"const",value:[]},"正規表現置換":{type:"func",josi:[["の"],["を","から"],["で","に","へ"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)/);return s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]),String(e).replace(s,n)}},"正規表現区切":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){let n;const s=t.match(/^\/(.+)\/([a-zA-Z]*)/);return n=null===s?new RegExp(t,"g"):new RegExp(s[1],s[2]),String(e).split(n)}},"通貨形式":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},"ゼロ埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n="0";for(let e=0;e<t;e++)n+="0";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"空白埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n=" ";for(let e=0;e<t;e++)n+=" ";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"かなか判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12353&&t<=12447}},"カタカナ判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12449&&t<=12538}},"数字判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){const t=String(e).charAt(0);return t>="0"&&t<="9"||t>="0"&&t<="9"}},"数列判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){return null!==String(e).match(/^[0-9.]+$/)}},"配列結合":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.join(""+t);return String(e).split("\n").join(""+t)}},"配列検索":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.indexOf(t):-1}},"配列要素数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e instanceof Array?e.length:e instanceof Object?Object.keys(e).length:1}},"要素数":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("配列要素数",[e])}},"配列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,0,n);throw new Error("『配列挿入』で配列以外の要素への挿入。")}},"配列一括挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array&&n instanceof Array){for(let s=0;s<n.length;s++)e.splice(t+s,0,n[s]);return e}throw new Error("『配列一括挿入』で配列以外の要素への挿入。")}},"配列ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列数値ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort(((e,t)=>parseFloat(e)-parseFloat(t)));throw new Error("『配列数値ソート』で配列以外が指定されました。")}},"配列カスタムソート":{type:"func",josi:[["で"],["の","を"]],pure:!1,fn:function(e,t,n){let s=e;if("string"==typeof e&&(s=n.__findFunc(e,"配列カスタムソート")),t instanceof Array)return t.sort(s);throw new Error("『配列カスタムソート』で配列以外が指定されました。")}},"配列逆順":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.reverse();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列シャッフル":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}throw new Error("『配列シャッフル』で配列以外が指定されました。")}},"配列削除":{type:"func",josi:[["の","から"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("配列切取",[e,t,n])}},"配列切取":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array){const n=e.splice(t,1);return n instanceof Array?n[0]:null}if(!(e instanceof Object&&"string"==typeof t))throw new Error("『配列切取』で配列以外を指定。");if(e[t]){const n=e[t];return delete e[t],n}}},"配列取出":{type:"func",josi:[["の"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,n);throw new Error("『配列取出』で配列以外を指定。")}},"配列ポップ":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if(e instanceof Array)return e.pop();throw new Error("『配列ポップ』で配列以外の処理。")}},"配列追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.push(t),e;throw new Error("『配列追加』で配列以外の処理。")}},"配列複製":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return JSON.parse(JSON.stringify(e))}},"配列足":{type:"func",josi:[["に","へ","と"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.concat(t):JSON.parse(JSON.stringify(e))}},"配列最大値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.max(e,t)))}},"配列最小値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.min(e,t)))}},"配列合計":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(e instanceof Array){let t=0;return e.forEach((e=>{const n=parseFloat(e);isNaN(n)||(t+=n)})),t}throw new Error("『配列合計』で配列変数以外の値が指定されました。")}},"表ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>{const s=e[t],r=n[t];return s===r?0:s<r?-1:1})),e}},"表数値ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表数値ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>e[t]-n[t])),e}},"表ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表ピックアップ』には配列を指定する必要があります。");return e.filter((e=>String(e[t]).indexOf(n)>=0))}},"表完全一致ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表完全ピックアップ』には配列を指定する必要があります。");return e.filter((e=>e[t]===n))}},"表検索":{type:"func",josi:[["の"],["で","に"],["から"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表検索』には配列を指定する必要があります。");for(let r=n;r<e.length;r++)if(e[r][t]===s)return r;return-1}},"表列数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表列数』には配列を指定する必要があります。");let t=1;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);return t}},"表行数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表行数』には配列を指定する必要があります。");return e.length}},"表行列交換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表行列交換』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=void 0!==e[r][t]?e[r][t]:""}return r}},"表右回転":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表右回転』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=e[s-r-1][t]}return r}},"表重複削除":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表重複削除』には配列を指定する必要があります。");const n=[],s={};for(let r=0;r<e.length;r++){const i=e[r][t];void 0===s[i]&&(s[i]=!0,n.push(e[r]))}return n}},"表列取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列取得』には配列を指定する必要があります。");return e.map((e=>e[t]))}},"表列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列挿入』には配列を指定する必要があります。");const s=[];return e.forEach(((e,r)=>{let i=[];t>0&&(i=i.concat(e.slice(0,t))),i.push(n[r]),i=i.concat(e.slice(t)),s.push(i)})),s}},"表列削除":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列削除』には配列を指定する必要があります。");const n=[];return e.forEach((e=>{const s=e.slice(0);s.splice(t,1),n.push(s)})),n}},"表列合計":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列合計』には配列を指定する必要があります。");let n=0;return e.forEach((e=>{n+=e[t]})),n}},"表曖昧検索":{type:"func",josi:[["の"],["から"],["で"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表曖昧検索』には配列を指定する必要があります。");const r=new RegExp(s);for(let s=t;s<e.length;s++){const t=e[s];if(r.test(t[n]))return s}return-1}},"表正規表現ピックアップ":{type:"func",josi:[["の","で"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表正規表現ピックアップ』には配列を指定する必要があります。");const s=new RegExp(n),r=[];for(let n=0;n<e.length;n++){const i=e[n];s.test(i[t])&&r.push(i.slice(0))}return r}},"辞書キー列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(n);return t}if(e instanceof Array){for(let n=0;n<e.length;n++)t.push(n);return t}throw new Error("『辞書キー列挙』でハッシュ以外が与えられました。")}},"辞書キー削除":{type:"func",josi:[["から","の"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Object)return e[t]&&delete e[t],e;throw new Error("『辞書キー削除』でハッシュ以外が与えられました。")}},"辞書キー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"ハッシュキー列挙":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("辞書キー列挙",[e,t])}},"ハッシュ内容列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(e[n]);return t}throw new Error("『ハッシュ内容列挙』でハッシュ以外が与えられました。")}},"ハッシュキー削除":{type:"func",josi:[["から","の"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("辞書キー削除",[e,t,n])}},"ハッシュキー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"秒待":{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(e,t){return new Promise(((n,s)=>{try{const s=setTimeout((()=>{const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*parseFloat(e));t.__timeout.push(s)}catch(e){s(e)}}))},return_none:!0},"秒待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode){if(void 0===t.resolve)throw new Error("『秒待機』命令は『!非同期モード』で使ってください。");t.__exec("秒逐次待機",[e,t])}else{const n=t.setAsync(t);setTimeout((()=>{t.compAsync(t,n)}),1e3*e)}},return_none:!0},"秒逐次待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『秒逐次待機』命令は『逐次実行』構文と一緒に使ってください。");const n=t.resolve;t.resolveCount++;const s=setTimeout((function(){const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*e);t.__timeout.unshift(s)},return_none:!0},"秒後":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒後"));const s=setTimeout((()=>{const t=n.__timeout.indexOf(s);t>=0&&n.__timeout.splice(t,1),"非同期モード"===n.__genMode&&(n.newenv=!0);try{e(s,n)}catch(e){let t=e;e instanceof _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as||(t=new _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as(e,n.__varslist[0].line)),n.logger.error(t)}}),1e3*parseFloat(t));return n.__timeout.unshift(s),n.__v0["対象"]=s,s}},"秒毎":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒毎"));const s=setInterval((()=>{"非同期モード"===n.__genMode&&(n.newenv=!0),e(s,n)}),1e3*parseFloat(t));return n.__interval.unshift(s),n.__v0["対象"]=s,s}},"秒タイマー開始時":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){return n.__exec("秒毎",[e,t,n])}},"タイマー停止":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e,t){const n=t.__interval.indexOf(e);if(n>=0)return t.__interval.splice(n,1),clearInterval(e),!0;const s=t.__timeout.indexOf(e);return s>=0&&(t.__timeout.splice(s,1),clearTimeout(e),!0)},return_none:!1},"全タイマー停止":{type:"func",josi:[],pure:!0,fn:function(e){for(let t=0;t<e.__interval.length;t++){const n=e.__interval[t];clearInterval(n)}e.__interval=[];for(let t=0;t<e.__timeout.length;t++){const n=e.__timeout[t];clearTimeout(n)}e.__timeout=[]},return_none:!0},"元号データ":{type:"const",value:[{"元号":"令和","改元日":"2019/05/01"},{"元号":"平成","改元日":"1989/01/08"},{"元号":"昭和","改元日":"1926/12/25"},{"元号":"大正","改元日":"1912/07/30"},{"元号":"明治","改元日":"1868/10/23"}]},"今":{type:"func",josi:[],pure:!0,fn:function(){const e=e=>(e="00"+e).substring(e.length-2,e.length),t=new Date;return e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())}},"システム時間":{type:"func",josi:[],pure:!0,fn:function(){const e=new Date;return Math.floor(e.getTime()/1e3)}},"システム時間ミリ秒":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getTime()}},"今日":{type:"func",josi:[],pure:!0,fn:function(e){return e.__formatDate(new Date)}},"明日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()+864e5;return e.__formatDate(new Date(t))}},"昨日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()-864e5;return e.__formatDate(new Date(t))}},"今年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()}},"来年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()+1}},"去年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()-1}},"今月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+1}},"来月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+2}},"先月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()}},"曜日":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){const n=t.__str2date(e);return"日月火水木金土".charAt(n.getDay()%7)}},"曜日番号取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e.split("/");return new Date(t[0],t[1]-1,t[2]).getDay()}},"UNIXTIME変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"UNIX時間変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"日時変換":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e,t){const n=1e3*e;return t.__formatDateTime(new Date(n),"2022/01/01 00:00:00")}},"日時書式変換":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return t=t.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,(e=>{switch(e){case"YYYY":return s.getFullYear();case"YY":return(""+s.getFullYear()).substring(2);case"MM":return n.__zero2(s.getMonth()+1);case"DD":return n.__zero2(s.getDate());case"M":return s.getMonth()+1;case"D":return s.getDate();case"HH":return n.__zero2(s.getHours());case"mm":return n.__zero2(s.getMinutes());case"ss":return n.__zero2(s.getSeconds());case"ccc":return n.__zero(s.getMilliseconds(),3);case"H":return s.getHours();case"m":return s.getMinutes();case"s":return s.getSeconds();case"W":return"日月火水木金土".charAt(s.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][s.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s.getMonth()]}return e}))}},"和暦変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){const n=t.__str2date(e),s=n.getTime();for(const e of t.__v0["元号データ"]){const r=e["元号"],i=t.__str2date(e["改元日"]);if(i.getTime()<=s){let e=n.getFullYear()-i.getFullYear()+1;return 1===e&&(e="元"),r+e+"年"+t.__zero2(n.getMonth()+1)+"月"+t.__zero2(n.getDate())+"日"}}throw new Error("『和暦変換』は明示以前の日付には対応していません。")}},"年数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return n.__str2date(t).getFullYear()-s.getFullYear()}},"月数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e),r=n.__str2date(t);return 12*r.getFullYear()+r.getMonth()-(12*s.getFullYear()+s.getMonth())}},"日数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/86400)}},"時間差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/3600)}},"分差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/60)}},"秒差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil(r-s)}},"日時差":{type:"func",josi:[["と","から"],["の","までの"],["による"]],pure:!0,fn:function(e,t,n,s){switch(n){case"年":return s.__exec("年数差",[e,t,s]);case"月":return s.__exec("月数差",[e,t,s]);case"日":return s.__exec("日数差",[e,t,s]);case"時間":return s.__exec("時間差",[e,t,s]);case"分":return s.__exec("分差",[e,t,s]);case"秒":return s.__exec("秒差",[e,t,s])}throw new Error("『日時差』で不明な単位です。")}},"時間加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=t.charAt(0);"-"!==s&&"+"!==s||(t=t.substring(1));const r=n.__str2date(e),i=(t+":0:0").split(":");let o=60*parseInt(i[0])*60+60*parseInt(i[1])+parseInt(i[2]);"-"===s&&(o*=-1);const u=new Date(r.getTime()+1e3*o);return n.__formatDateTime(u,e)}},"日付加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=1;const r=t.charAt(0);"-"!==r&&"+"!==r||(t=t.substring(1),"-"===r&&(s*=-1));const i=n.__str2date(e),o=(t+"/0/0").split("/"),u=parseInt(o[0])*s,c=parseInt(o[1])*s,a=parseInt(o[2])*s;return i.setFullYear(i.getFullYear()+u),i.setMonth(i.getMonth()+c),i.setDate(i.getDate()+a),n.__formatDateTime(i,e)}},"日時加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=(""+t).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!s)throw new Error("『日付加算』は『(+|-)1(年|ヶ月|日|時間|分|秒)』の書式で指定します。");switch(s[3]){case"年":return n.__exec("日付加算",[e,`${s[1]}${s[2]}/0/0`,n]);case"ヶ月":return n.__exec("日付加算",[e,`${s[1]}0/${s[2]}/0`,n]);case"週間":return n.__exec("日付加算",[e,`${s[1]}0/0/${7*parseInt(s[2])}`,n]);case"日":return n.__exec("日付加算",[e,`${s[1]}0/0/${s[2]}`,n]);case"時間":return n.__exec("時間加算",[e,`${s[1]}${s[2]}:0:0`,n]);case"分":return n.__exec("時間加算",[e,`${s[1]}0:${s[2]}:0`,n]);case"秒":return n.__exec("時間加算",[e,`${s[1]}0:0:${s[2]}`,n])}}},"時間ミリ秒取得":{type:"func",josi:[],pure:!0,fn:function(){if(performance&&performance.now)return performance.now();if(Date.now)return Date.now();return(new Date).getTime()}},"エラー発生":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e){throw new Error(e)}},"グローバル関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[1],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[0],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数存在":{type:"func",josi:[["が","の"]],pure:!0,fn:function(e,t){return void 0!==t.__v0[e]}},"プラグイン一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.pluginfiles)t.push(n);return t}},"モジュール一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__module)t.push(n);return t}},"助詞一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,8775)).then((t=>{const n=Object.assign({},t);e(n.josiList)})).catch((e=>{t(e)}))}))}},"予約語一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,515)).then((t=>{const n=Object.assign({},t),s=[];for(const e in n.default)s.push(e);e(s)})).catch((e=>{t(e)}))}))}},"プラグイン名":{type:"const",value:"メイン"},"プラグイン名設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__v0["プラグイン名"]=e},return_none:!0},"名前空間":{type:"const",value:""},"名前空間設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__namespaceList.push([t.__v0["名前空間"],t.__v0["プラグイン名"]]),t.__v0["名前空間"]=e},return_none:!0},"名前空間ポップ":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__namespaceList.pop();t&&(e.__v0["名前空間"]=t[0],e.__v0["プラグイン名"]=t[1])},return_none:!0},"URLエンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){return encodeURIComponent(e)}},"URLデコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){return decodeURIComponent(e)}},"URLパラメータ解析":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n={};if("string"!=typeof e)return n;const s=e.split("?");if(s.length<=1)return n;const r=s[1].split("&");for(const e of r){const s=(e+"=").split("=");n[t.__exec("URLデコード",[s[0]])]=t.__exec("URLデコード",[s[1]])}return n}},"BASE64エンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.btoa){const t=(new TextEncoder).encode(e),n=String.fromCharCode.apply(null,t);return btoa(n)}if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("『BASE64エンコード』は利用できません。")}},"BASE64デコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.atob){const t=atob(e),n=Array.prototype.map.call(t,(e=>e.charCodeAt())),s=new Uint8Array(n);return new TextDecoder("UTF-8").decode(s)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString();throw new Error("『BASE64デコード』は利用できません。")}}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};!function(){const e={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"÷":5,"÷÷":5,"%":5,"^":6},t=["いて","えて","きて","けて","して","って","にて","みて","めて","ねて","には","んで"],n=[];for(const t in e)n.push(t);function s(e="?",t="",n=-1,s=0,r="main.nako3"){return{type:e,value:t,indent:n,line:s,column:0,file:r,josi:""}}var r=__webpack_require__(6297),i=__webpack_require__(515);function o(e){const t=e.charCodeAt(0);return"\t"===e?4:" "===e||"|"===e?1:"・"===e||" "===e||"⏋"===e||"⏌"===e||t>=9472&&t<=9599||t>=9120&&t<=9135||t>=9144&&t<=9151?2:0}var u=__webpack_require__(8775);const c=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,a=/^[ぁ-ん]/,f=/^[ぁ-ん]+$/,l=/^.+(以上|以下|超|未満)$/,h=e=>function(){throw new Error("突然の『"+e+"』があります。")},p=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|px|dot|pt|em|b|mb|kb|gb)/,d=[{name:"ここまで",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・|⎿ |└||)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:function(e){let t="";let n=0;const s=(e=e.substring(2)).indexOf("*/");s<0?(t=e,e=""):(t=e.substring(0,s),e=e.substring(s+2));for(let e=0;e<t.length;e++)"\n"===t.charAt(e)&&n++;return t=t.replace(/(^\s+|\s+$)/,""),{src:e,res:t,josi:"",numEOL:n}}},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:y},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:y},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:y},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:y},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:y},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:y},{name:"ここから",pattern:/^(ここから),?/},{name:"ここまで",pattern:/^(ここまで|💧)/},{name:"もし",pattern:/^もしも?/},{name:"違えば",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"←",pattern:/^(←|<--)/},{name:"eq",pattern:/^(==|🟰🟰)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい|DNCLモード|DNCL2モード|DNCL2)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&)/},{name:"or",pattern:/^(または|或いは|あるいは|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"*",pattern:/^(×|\*)/},{name:"÷÷",pattern:/^÷÷/},{name:"÷",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"string",pattern:/^🌿/,cbParser:e=>_("🌿","🌿",e)},{name:"string_ex",pattern:/^🌴/,cbParser:e=>_("🌴","🌴",e)},{name:"string_ex",pattern:/^「/,cbParser:e=>_("「","」",e)},{name:"string",pattern:/^『/,cbParser:e=>_("『","』",e)},{name:"string_ex",pattern:/^“/,cbParser:e=>_("“","”",e)},{name:"string_ex",pattern:/^"/,cbParser:e=>_('"','"',e)},{name:"string",pattern:/^'/,cbParser:e=>_("'","'",e)},{name:"」",pattern:/^」/,cbParser:h("」")},{name:"』",pattern:/^』/,cbParser:h("』")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:function(e,t=!0){let n="",s="";for(;""!==e;){if(n.length>0){const t=u.josiRE.exec(e);if(t){s=t[0].replace(/^\s+/,""),","===(e=e.substr(t[0].length)).charAt(0)&&(e=e.substr(1));break}}const t=c.exec(e);if(t){n+=t[0],e=e.substr(t[0].length);continue}if(!a.test(e))break;n+=e.charAt(0),e=e.substr(1)}/[ぁ-ん]間$/.test(n)&&(e=n.charAt(n.length-1)+e,n=n.slice(0,-1));const r=l.exec(n);r&&(e=r[1]+s+e,s="",n=n.substr(0,n.length-r[1].length));u.removeJosiMap[s]&&(s="");t&&(n=function(e){if(!a.test(e))return e.replace(/[ぁ-ん]+/g,"");if(f.test(e))return e;return e.replace(/[ぁ-ん]+$/g,"")}(n));""===n&&""!==s&&(n=s,s="");return{src:e,res:n,josi:s,numEOL:0}}}];function _(e,t,n){let s="",r="",i=0;const o=(n=n.substr(e.length)).indexOf(t);if(o<0)s=n,n="";else if(s=n.substr(0,o),n=n.substr(o+t.length),s.indexOf(e)>=0)throw"『"===e?new Error("「『」で始めた文字列の中に「『」を含めることはできません。"):new Error(`『${e}』で始めた文字列の中に『${e}』を含めることはできません。`);const c=u.josiRE.exec(n);c&&(r=c[0].replace(/^\s+/,""),","===(n=n.substr(c[0].length)).charAt(0)&&(n=n.substr(1))),u.removeJosiMap[r]&&(r="");for(let e=0;e<s.length;e++)"\n"===s.charAt(e)&&i++;return{src:n,res:s,josi:r,numEOL:i}}function y(e){return Number(e.replace(/_/g,""))}class m{constructor(e){this.logger=e,this.funclist={},this.modList=[],this.result=[],this.modName="main.nako3"}setFuncList(e){this.funclist=e}replaceTokens(e,t,n){if(this.result=e,this.modName=m.filenameToModName(n),m.preDefineFunc(e,this.logger,this.funclist),this._replaceWord(this.result),t)if(this.result.length>0){const e=this.result[this.result.length-1];this.result.push({type:"eol",line:e.line,column:0,indent:-1,file:e.file,josi:"",value:"---",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""}),this.result.push({type:"eof",line:e.line,indent:-1,column:0,file:e.file,josi:"",value:"",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,indent:-1,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,indent:-1,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,n){let s=0,r=!1;const o=()=>{const t=[],n={};if("("!==e[s].type)return[];for(s++;e[s];){const i=e[s];if(s++,")"===i.type)break;"func"===i.type?r=!0:"|"!==i.type&&"comma"!==i.type&&(r&&(i.funcPointer=!0,r=!1),t.push(i),n[i.value]||(n[i.value]=[]),n[i.value].push(i.josi))}const i=[],o=[],u=[],c={};for(const e of t)if(!c[e.value]){const t=n[e.value];u.push(t),i.push(e.value),e.funcPointer?o.push(e.value):o.push(null),c[e.value]=!0}return[u,i,o]};for(;s<e.length;){const r=e[s];if("word"===r.type&&"には"===r.josi||"word"===r.type&&"は~"===r.josi){r.josi="には",e.splice(s+1,0,{type:"def_func",value:"関数",indent:r.indent,line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset,endOffset:r.endOffset,rawJosi:"",tag:"無名関数"}),s++;continue}if("word"===r.type&&""===r.josi&&r.value.length>=2&&r.value.match(/回$/)){r.value=r.value.substring(0,r.value.length-1),r.endOffset||(r.endOffset=1);const t={type:"回",value:"回",indent:r.indent,line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset-1,endOffset:r.endOffset,rawJosi:""};e.splice(s+1,0,t),r.endOffset--,s++}if("word"===r.type&&i.default[r.value]&&(r.type=i.default[r.value],"そう"===r.value&&(r.value="それ")),"def_test"!==r.type&&"def_func"!==r.type){s++;continue}let u=!0,c={type:"eol"};s>=1&&(c=e[s-1]),"eol"===c.type&&(u=!1);const a=r;s++;let f=[],l=[],h=[],p="",d=null;if(e[s]&&"("===e[s].type&&([f,l,h]=o()),!u&&e[s]&&"word"===e[s].type&&(d=e[s++],p=d.value),0===f.length&&e[s]&&"("===e[s].type&&([f,l,h]=o()),""!==p&&d){if(p=m.filenameToModName(r.file)+"__"+p,p in n){const e=p.replace(/^main__/,"");t.warn(`関数『${e}』は既に定義されています。`,a)}d.value=p,n[p]={type:"func",josi:f,fn:null,asyncFn:!1,varnames:l,funcPointers:h}}a.meta={type:"func",josi:f,varnames:l,funcPointers:h}}}splitStringEx(e){const t=[],n=e.split(/[{{]/);t.push(n[0]);for(const e of n.slice(1)){const n=e.replace("}","}").indexOf("}");if(-1===n)return null;t.push(e.slice(0,n),e.slice(n+1))}return t}_replaceWord(t){let n=[],s=0;let r=t.length>0?m.filenameToModName(t[0].file):"main.nako3";for(;s<t.length;){const i=t[s];if("word"!==i.type&&"func"!==i.type||"名前空間設定"!==i.value||(r=t[s-1].value),"word"===i.type&&"それ"!==i.value){const e=i.value;if(e.indexOf("__")<0){const t=`${r}__${e}`,n=this.funclist[t];if(n&&"func"===n.type){i.type="func",i.meta=n,i.value=t;continue}for(const t of this.modList){const n=`${t}__${e}`,s=this.funclist[n];if(s&&"func"===s.type){i.type="func",i.meta=s,i.value=n;break}}if("func"===i.type)continue}const t=this.funclist[e];t&&"func"===t.type&&(i.type="func",i.meta=t)}if("-"===i.type&&t[s+1]&&"number"===t[s+1].type){const n=s<=0?"eol":t[s-1].type;("eol"===n||e[n]||""!==t[s-1].josi)&&(t.splice(s,1),t[s].value*=-1)}if(void 0===i.josi&&(i.josi=""),"は"!==i.josi)if("とは"!==i.josi)if(u.tararebaMap[i.josi]){const e="でなければ"===i.josi||"なければ"===i.josi?"でなければ":"ならば";i.rawJosi||(i.rawJosi=e);const n=void 0===i.endOffset?void 0:i.endOffset-i.rawJosi.length;t.splice(s+1,0,{type:"ならば",value:e,indent:i.indent,line:i.line,column:i.column,file:i.file,startOffset:n,endOffset:i.endOffset,josi:"",rawJosi:""}),i.josi=i.rawJosi="",i.endOffset=n,s+=2}else"_eol"!==i.type?"line_comment"!==i.type&&"range_comment"!==i.type?("eol"===i.type&&(i.value=n.join("/"),n=[]),s++):(n.push(i.value),t.splice(s,1)):t.splice(s,1);else{i.rawJosi||(i.rawJosi=i.josi);const e=void 0===i.endOffset?void 0:i.endOffset-i.rawJosi.length;t.splice(s+1,0,{type:i.josi,indent:i.indent,line:i.line,column:i.column,file:i.file,startOffset:e,endOffset:i.endOffset,josi:"",rawJosi:"",value:void 0}),i.josi=i.rawJosi="",i.endOffset=e,s+=2}else{i.rawJosi||(i.rawJosi=i.josi);const e=void 0===i.endOffset?void 0:i.endOffset-i.rawJosi.length;t.splice(s+1,0,{type:"eq",indent:i.indent,line:i.line,column:i.column,file:i.file,startOffset:e,endOffset:i.endOffset,josi:"",rawJosi:"",value:void 0}),s+=2,i.josi=i.rawJosi="",i.endOffset=e}}}countIndent(e){let t=0;for(let n=0;n<e.length;n++){const s=o(e.charAt(n));if(0===s)return[t,n];t+=s}return[t,e.length]}tokenize(e,t,n){const s=e.length,i=[];let o,c,a=1,f=!1,l=0;const h=this.countIndent(e);for(l=h[0],e=e.substring(h[1]),a+=h[1];""!==e;){let h=!1;for(const _ of d){const d=_.pattern.exec(e);if(!d)continue;if(h=!0,"space"===_.name){a+=d[0].length,e=e.substring(d[0].length);continue}if(_.cbParser){let u;if(f&&"word"===_.name)u=_.cbParser(e,!1);else try{u=_.cbParser(e)}catch(i){throw new r.tO(i.message,s-e.length,s-e.length+1,t,n)}if("string_ex"===_.name){const o=this.splitStringEx(u.res);if(null===o)throw new r.cg("展開あり文字列で値の埋め込み{...}が対応していません。",s-e.length,s-u.src.length,t,n);let c=0;for(let r=0;r<o.length;r++){const f=r===o.length-1?u.josi:"";r%2==0?(i.push({type:"string",value:o[r],file:n,josi:f,indent:l,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:o[r].length+2+f.length}),c+=o[r].length+2):(i.push({type:"&",value:"&",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:0}),i.push({type:"(",value:"(",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:0}),i.push({type:"code",value:o[r],josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:o[r].length}),i.push({type:")",value:")",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c+o[r].length,preprocessedCodeLength:0}),i.push({type:"&",value:"&",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c+o[r].length,preprocessedCodeLength:0}),c+=o[r].length)}t+=u.numEOL,a+=e.length-u.src.length,e=u.src,u.numEOL>0&&(a=1);break}o=a,a+=e.length-u.src.length,i.push({type:_.name,value:u.res,josi:u.josi,indent:l,line:t,column:o,file:n,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-u.src.length}),e=u.src,t+=u.numEOL,u.numEOL>0&&(a=1);break}const y=s-e.length;let m=d[0];if(_.cb&&(m=_.cb(m)),o=a,c=t,a+=d[0].length,e=e.substring(d[0].length),("eol"===_.name&&"\n"===m||"_eol"===_.name)&&(m=t++,a=1),"number"===_.name){const t=p.exec(e);t&&(e=e.substring(t[0].length),a+=d[0].length)}let g="";if(_.readJosi){const t=u.josiRE.exec(e);t&&(g=t[0].replace(/^\s+/,""),a+=t[0].length,","===(e=e.substring(t[0].length)).charAt(0)&&(e=e.substring(1)),u.removeJosiMap[g]&&(g=""))}switch(_.name){case"def_test":f=!0;break;case"eol":f=!1}if("dec_lineno"!==_.name){if(i.push({type:_.name,value:m,indent:l,line:c,column:o,file:n,josi:g,preprocessedCodeOffset:y,preprocessedCodeLength:s-e.length-y}),"eol"===_.name&&1===a){const t=this.countIndent(e);l=t[0],a+=t[1],e=e.substring(t[1])}break}t--}if(!h)throw new r.cg("未知の語句: "+e.substring(0,3)+"...",s-e.length,s-s+3,t,n)}return i}static tokensToTypeStr(e,t){return e.map((e=>e.type)).join(t)}static filenameToModName(e){if(!e)return"main";if((e=e.replace(/[\\:]/g,"/")).indexOf("/")>=0){const t=e.split("/");e=t[t.length-1]}return e=e.replace(/\.nako3?$/,"")}}class g extends class{constructor(e){this.logger=e,this.stackList=[],this.tokens=[],this.usedFuncs=new Set,this.stack=[],this.index=0,this.y=[],this.modName="inline",this.modList=[],this.funclist={},this.funcLevel=0,this.usedAsyncFn=!1,this.localvars={"それ":{type:"var",value:""}},this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[],this.init()}init(){this.funclist={},this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}popStack(e){if(!e){const e=this.stack.pop();return e||null}for(let t=this.stack.length-1;t>=0;t--){const n=this.stack[t];if(0===e.length||e.indexOf(n.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(n)),n}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}findVar(e){if(this.localvars[e])return{name:e,scope:"local",info:this.localvars[e]};if(e.indexOf("__")>=0)return this.funclist[e]?{name:e,scope:"global",info:this.funclist[e]}:void 0;const t=`${this.modName}__${e}`;if(this.funclist[t])return{name:t,scope:"global",info:this.funclist[t]};for(const t of this.modList){const n=`${t}__${e}`;if(this.funclist[n])return{name:n,scope:"global",info:this.funclist[n]}}return this.funclist[e]?{name:e,scope:"system",info:this.funclist[e]}:void 0}pushStack(e){this.logger.trace("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}getIndex(){return this.index}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){const n=t+this.index;if(this.tokens.length<=n)return!1;if("*"===e[t])continue;const s=this.tokens[n];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1}else if(s.type!==e[t])return!1}return!0}checkTypes(e){const t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){const t=[],n=this.index,s=()=>(this.index=n,!1);for(let n=0;n<e.length;n++){if(this.isEOF())return s();const r=e[n];if(null==r)return s();if("string"!=typeof r)if("function"!=typeof r){if(!(r instanceof Array))throw new Error("System Error : accept broken : "+typeof r);if(!this.checkTypes(r))return s();t[n]=this.get()}else{const e=r.bind(this)(t);if(null===e)return s();t[n]=e}else{const e=this.get();if(e&&e.type!==r)return s();t[n]=e}}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}getCur(){if(this.isEOF())throw new Error("トークンが取得できません。");const e=this.tokens[this.index++];if(!e)throw new Error("トークンが取得できません。");return e}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekDef(e=null){return this.isEOF()?(e||(e=s()),e):this.tokens[this.index]}peekSourceMap(){const e=this.peek();return null===e?{startOffset:void 0,endOffset:void 0,file:void 0,line:0,column:0}:{startOffset:e.startOffset,endOffset:e.endOffset,file:e.file,line:e.line,column:e.column}}nodeToStr(e,t,n){const s=t.depth-1,r=e=>void 0!==t.typeName?t.typeName:e,i=n?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":if(s>=0){const t=e.value;return`${r("")}『${this.nodeToStr(t,{depth:s},n)}に演算子『not』を適用した式${i}』`}return`${r("演算子")}『not』`;case"op":{const t=e;let o=t.operator||"";const u={eq:"=",not:"!",gt:">",lt:"<",and:"かつ",or:"または"};if(o in u&&(o=u[o]),s>=0){const e=this.nodeToStr(t.left,{depth:s},n),u=this.nodeToStr(t.right,{depth:s},n);return"eq"===t.operator?`${r("")}『${e}と${u}が等しいかどうかの比較${i}』`:`${r("")}『${e}と${u}に演算子『${o}』を適用した式${i}』`}return`${r("演算子")}『${o}${i}』`}case"number":return`${r("数値")}${e.value}`;case"string":return`${r("文字列")}『${e.value}${i}』`;case"word":return`${r("単語")}『${e.value}${i}』`;case"func":return`${r("関数")}『${e.name||e.value}${i}』`;case"eol":return"行の末尾";case"eof":return"ファイルの末尾";default:{let t=e.name;return t&&(t=e.value),"string"!=typeof t&&(t=e.type),`${r("")}『${t}${i}』`}}}}{parse(e,t){return this.reset(),this.tokens=e,this.modName=m.filenameToModName(t),this.modList.push(this.modName),this.startParser()}startParser(){const e=this.ySentenceList(),t=this.get();if(t&&"eof"!==t.type)throw this.logger.debug(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!0)}の使い方が間違っています。`,t),r.ih.fromNode(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!1)}の使い方が間違っています。`,t);return e}ySentenceList(){const e=[];let t=-1;const n=this.peekSourceMap();for(;!this.isEOF();){const n=this.ySentence();if(!n)break;e.push(n),t<0&&(t=n.line)}if(0===e.length){const e=this.peek()||this.tokens[0];throw this.logger.debug("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!0),e),r.ih.fromNode("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!1),e)}return{type:"block",block:e,...n,end:this.peekSourceMap(),genMode:this.genMode}}yEOL(){const e=this.get();if(!e)return null;if(this.stack.length>0){const t=[];this.stack.forEach((e=>{let n=this.nodeToStr(e,{depth:1},!1);e.josi&&(n+=e.josi),t.push(n)}));const n=t.join(",");let s="";const i="A".charCodeAt(0);for(const e of this.recentlyCalledFunc){s+=" - ";let t=0;const n=e.josi;if(n)for(const e of n){s+=String.fromCharCode(i+t),1===e.length?s+=e[0]:s+=`(${e.join("|")})`,t++}s+=e.name+"\n"}throw r.ih.fromNode(`未解決の単語があります: [${n}]\n次の命令の可能性があります:\n${s}`,e)}return this.recentlyCalledFunc=[],e}ySentence(){const e=this.peekSourceMap();if(this.check("eol"))return this.yEOL();if(this.check("もし"))return this.yIF();if(this.check("後判定"))return this.yAtohantei();if(this.check("エラー監視"))return this.yTryExcept();if(this.check("逐次実行"))return this.yTikuji();if(this.accept(["抜ける"]))return{type:"break",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["続ける"]))return{type:"continue",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["require","string","取込"]))return this.yRequire();if(this.accept(["not","非同期モード"]))return this.yASyncMode();if(this.accept(["DNCLモード"]))return this.yDNCLMode(1);if(this.accept(["DNCL2モード"]))return this.yDNCLMode(2);if(this.accept(["not","string","モード設定"]))return this.ySetGenMode(this.y[1].value);if(this.check2(["func","←"]))return this.yCallOp();if(this.check2(["func","eq"])){const e=this.get()||s();throw r.ih.fromNode(`関数『${e.value}』に代入できません。『←』を使ってください。`,e)}if(this.accept([this.ySpeedMode]))return this.y[0];if(this.accept([this.yPerformanceMonitor]))return this.y[0];if(this.accept([this.yLet]))return this.y[0];if(this.accept([this.yDefTest]))return this.y[0];if(this.accept([this.yDefFunc]))return this.y[0];if(this.accept([this.yCall])){const t=this.y[0];if("して"===t.josi){const n=this.ySentence();if(null!==n)return{type:"block",block:[t,n],josi:n.josi,...e,end:this.peekSourceMap()}}return t}return null}yASyncMode(){const e=this.peekSourceMap();return this.genMode="非同期モード",{type:"eol",...e,end:this.peekSourceMap()}}yDNCLMode(e){const t=this.peekSourceMap();return 1===e&&(this.arrayIndexFrom=1,this.flagReverseArrayIndex=!0),this.flagCheckArrayInit=!0,{type:"eol",...t,end:this.peekSourceMap()}}ySetGenMode(e){const t=this.peekSourceMap();return this.genMode=e,{type:"eol",...t,end:this.peekSourceMap()}}yRequire(){const e=this.y[1].value,t=m.filenameToModName(e);if(this.modList.indexOf(t)<0){const e=this.modList.shift();e&&(this.modList.unshift(t),this.modList.unshift(e))}return{type:"require",value:e,josi:"",...this.peekSourceMap(),end:this.peekSourceMap()}}yBlock(){const e=this.peekSourceMap(),t=[];for(this.check("ここから")&&this.get();!this.isEOF()&&!this.checkTypes(["違えば","ここまで","エラー"])&&this.accept([this.ySentence]);)t.push(this.y[0]);return{type:"block",block:t,...e,end:this.peekSourceMap()}}yDefFuncReadArgs(){if(!this.check("("))return null;const e=[];for(this.get();!this.isEOF();){if(this.check(")")){this.get();break}const t=this.get();t&&e.push(t),this.check("comma")&&this.get()}return e}yDefTest(){return this.yDef("def_test")}yDefFunc(){return this.yDef("def_func")}yDef(e){if(!this.check(e))return null;const t=this.peekSourceMap(),n=this.get();if(!n)return null;let s=[];this.check("(")&&(s=this.yDefFuncReadArgs()||[]);const i=this.get();if(!i||"func"!==i.type)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言でエラー。",i),r.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言でエラー。",n);if(this.check("(")){if(s.length>0)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i),r.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i);s=this.yDefFuncReadArgs()||[]}this.check("とは")&&this.get();let o=null,u=!1,c=!1;this.check("ここから")&&(u=!0),this.check("eol")&&(u=!0);try{this.funcLevel++,this.usedAsyncFn=!1;const e=this.localvars;if(this.localvars={"それ":{type:"var",value:""}},u){this.saveStack();for(const e of s){const t=e.value?e.value+"":"";this.localvars[t]={type:"var",value:""}}if(o=this.yBlock(),!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。関数定義の末尾に必要です。",n);this.get(),this.loadStack()}else this.saveStack(),o=this.ySentence(),this.loadStack();this.funcLevel--,c=this.usedAsyncFn,this.localvars=e}catch(e){throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の定義で以下のエラーがありました。\n"+e.message,n),r.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の定義で以下のエラーがありました。\n"+e.message,n)}return{type:e,name:i,args:s,block:o||[],asyncFn:c,josi:"",...t,end:this.peekSourceMap()}}yIFCond(){const e=this.peekSourceMap();let t=this.yGetArg();if(!t)return null;if("ならば"===t.josi)return t;if("でなければ"===t.josi)return t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()},t;if(""!==t.josi&&this.check("func"))this.stack.push(t),t=this.yCall();else if("が"===t.josi){const n=this.index,s=this.yGetArg();if(!s)throw r.ih.fromNode("もし文の条件「AがBならば」でBがないか条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1),e);if(this.check("ならば")){const e=this.get()||{value:"ならば"};s.josi=e.value}if(s&&("ならば"===s.josi||"でなければ"===s.josi))return{type:"op",operator:"でなければ"===s.josi?"noteq":"eq",left:t,right:s,josi:"",...e,end:this.peekSourceMap()};this.index=n}if(this.check("ならば")||(this.stack.push(t),t=this.yCall()),!this.check("ならば")){const n=t||{type:"?",...e};throw this.logger.debug("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",n),r.ih.fromNode("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",n)}const n=this.get();return n&&"でなければ"===n.value&&(t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()}),t}yIF(){const e=this.peekSourceMap();if(!this.check("もし"))return null;const t=this.get();if(null==t)return null;for(;this.check("comma");)this.get();let n=null;try{n=this.yIFCond()}catch(e){throw r.ih.fromNode("『もし』文の条件で次のエラーがあります。\n"+e.message,t)}if(null===n)throw r.ih.fromNode("『もし』文で条件の指定が空です。",t);let s=null,i=null,o=!1;for(this.check("eol")?s=this.yBlock():(s=this.ySentence(),o=!0);this.check("eol");)this.get();if(this.check("違えば")){for(this.get();this.check("comma");)this.get();this.check("eol")?i=this.yBlock():(i=this.ySentence(),o=!0)}if(!1===o){if(!this.check("ここまで"))throw r.ih.fromNode("『もし』文で『ここまで』がありません。",t);this.get()}return{type:"if",expr:n||[],block:s||[],false_block:i||[],josi:"",...e,end:this.peekSourceMap()}}ySpeedMode(){const e=this.peekSourceMap();if(!this.check2(["string","実行速度優先"]))return null;const t=this.get();this.get();let n="";if(!t||!t.value)return null;n=t.value;const s={"行番号無し":!1,"暗黙の型変換無し":!1,"強制ピュア":!1,"それ無効":!1};for(const e of n.split("/")){if("全て"===e){for(const e of Object.keys(s))s[e]=!0;break}Object.keys(s).includes(e)?s[e]=!0:this.logger.warn(`実行速度優先文のオプション『${e}』は存在しません。`,t)}let r=!1;this.check("ここから")?(this.get(),r=!0):this.check("eol")&&(r=!0);let i=null;return r?(i=this.yBlock(),this.check("ここまで")&&this.get()):i=this.ySentence(),{type:"speed_mode",options:s,block:i||[],josi:"",...e}}yPerformanceMonitor(){const e=this.peekSourceMap();if(!this.check2(["string","パフォーマンスモニタ適用"]))return null;const t=this.get();if(!t)return null;this.get();const n={"ユーザ関数":!1,"システム関数本体":!1,"システム関数":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`パフォーマンスモニタ適用文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"performance_monitor",options:n,block:r||[],josi:"",...e}}yTikuji(){const e=this.peekSourceMap();if(!this.check("逐次実行"))return null;const t=this.getCur();this.logger.warn("『逐次実行』構文の使用は非推奨になりました(https://nadesi.com/v3/doc/go.php?944)。",t);const n=[];let s=null;if(!t||!this.check("eol"))throw r.ih.fromNode("『逐次実行』の直後は改行が必要です。",t);for(;!this.check("ここまで");){if(this.check("eol")){this.get();continue}if(this.check2(["エラー","ならば"])){this.get(),this.get(),s=this.yBlock();break}let t=null;if(this.check("先に")||this.check("次に")){const n=this.get();if(this.check("comma")&&this.get(),this.check("eol")){if(t=this.yBlock(),!this.check("ここまで")){let t="次に";throw null!=n&&(t=n.type),r.ih.fromNode(`『${t}』...『ここまで』を対応させてください。`,e)}this.get()}else t=this.ySentence()}else t=this.ySentence();null!=t&&n.push(t)}if(!this.check("ここまで"))throw console.log(n,this.peek()),r.ih.fromNode("『逐次実行』...『ここまで』を対応させてください。",t);return this.get(),{type:"tikuji",blocks:n||[],errorBlock:s||[],josi:"",...e,end:this.peekSourceMap()}}yGetArgOperator(t){const n=[t];for(;!this.isEOF();){let s=this.peek();if(!s||!e[s.type])break;{s=this.getCur(),n.push(s);const e=this.yValue();if(null===e)throw r.ih.fromNode(`計算式で演算子『${s.value}』後に値がありません`,t);n.push(e)}}return 0===n.length?null:1===n.length?n[0]:this.infixToAST(n)}yGetArg(){const e=this.yValue();return null===e?null:this.yGetArgOperator(e)}infixToPolish(t){const n=t=>e[t.type]?e[t.type]:10,s=[],r=[];for(;t.length>0;){const e=t.shift();if(!e)break;for(;s.length>0;){const t=s[s.length-1];if(n(e)>n(t))break;const i=s.pop();if(!i){this.logger.error("計算式に間違いがあります。",e);break}r.push(i)}s.push(e)}for(;s.length>0;){const e=s.pop();e&&r.push(e)}return r}infixToAST(t){if(0===t.length)return null;const n=t[t.length-1].josi,s=t[t.length-1],i=this.infixToPolish(t),o=[];for(const t of i){if(!e[t.type]){o.push(t);continue}const u=o.pop(),c=o.pop();if(void 0===c||void 0===u)throw this.logger.debug("--- 計算式(逆ポーランド) ---\n"+JSON.stringify(i)),r.ih.fromNode("計算式でエラー",s);const a={type:"op",operator:t.type,left:c,right:u,josi:n,startOffset:c.startOffset,endOffset:c.endOffset,line:c.line,column:c.column,file:c.file};o.push(a)}const u=o.pop();return u||null}yGetArgParen(e){let t=!1;const n=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}const e=this.yGetArg();if(!e)break;this.pushStack(e),this.check("comma")&&this.get()}if(!t)throw r.ih.fromNode(`C風関数『${e[0].value}』でカッコが閉じていません`,e[0]);const s=[];for(;n<this.stack.length;){const e=this.popStack();e&&s.unshift(e)}return s}yRepeatTime(){const e=this.peekSourceMap();if(!this.check("回"))return null;this.get(),this.check("comma")&&this.get(),this.check("繰返")&&this.get();let t=this.popStack([]),n=!1,s=null;if(null===t&&(t={type:"word",value:"それ",josi:"",...e,end:this.peekSourceMap()}),this.check("comma")&&this.get(),this.check("ここから")?(this.get(),n=!0):this.check("eol")&&(n=!0),n){if(s=this.yBlock(),!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『回』...『ここまで』を対応させてください。",e);this.get()}else s=this.ySentence();return{type:"repeat_times",value:t,block:s||[],josi:"",...e,end:this.peekSourceMap()}}yWhile(){const e=this.peekSourceMap();if(!this.check("間"))return null;for(this.get();this.check("comma");)this.get();this.check("繰返")&&this.get();const t=this.popStack();if(null===t)throw r.ih.fromNode("『間』で条件がありません。",e);if(this.check("comma")&&this.get(),!this.checkTypes(["ここから","eol"]))throw r.ih.fromNode("『間』の直後は改行が必要です",e);const n=this.yBlock();return this.check("ここまで")&&this.get(),{type:"while",cond:t,block:n,josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){const e=this.peekSourceMap();this.check("後判定")&&this.get(),this.check("繰返")&&this.get(),this.check("ここから")&&this.get();const t=this.yBlock();this.check("ここまで")&&this.get(),this.check("comma")&&this.get();let n=this.yGetArg(),s=!1;const r=this.peek();return!r||"なる"!==r.value||"まで"!==r.josi&&"までの"!==r.josi||(this.get(),s=!0),this.check("間")&&this.get(),s&&(n={type:"not",value:n,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",cond:n||[],block:t,josi:"",...e,end:this.peekSourceMap()}}yFor(){const e=this.peekSourceMap();if(!(this.check("繰返")||this.check("増繰返")||this.check("減繰返")))return null;const t=this.getCur(),n=this.stack.pop();n&&("word"!==n.type||"増"!==n.value&&"減"!==n.value?this.stack.push(n):t.type=n.value+t.type);let s=null;"増繰返"!==t.type&&"減繰返"!==t.type||(s=this.popStack(["ずつ"]));const i=this.popStack(["まで"]),o=this.popStack(["から"]),u=this.popStack(["を","で"]);if(null===o||null===i)throw r.ih.fromNode("『繰り返す』文でAからBまでの指定がありません。",t);this.check("comma")&&this.get();let c=!1;(this.check("ここから")||this.check("eol"))&&(c=!0,this.get());let a=null;if(c){if(a=this.yBlock(),!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『繰り返す』...『ここまで』を対応させてください。",e);this.get()}else a=this.ySentence();return{type:"for",from:o,to:i,inc:s,word:u,block:a||[],josi:"",...e,end:this.peekSourceMap()}}yReturn(){const e=this.peekSourceMap();if(!this.check("戻る"))return null;this.get();const t=this.popStack(["で","を"]);if(this.stack.length>0)throw r.ih.fromNode("『戻』文の直前に未解決の引数があります。『(式)を戻す』のように式をカッコで括ってください。",e);return{type:"return",value:t,josi:"",...e,end:this.peekSourceMap()}}yForEach(){const e=this.peekSourceMap();if(!this.check("反復"))return null;for(this.get();this.check("comma");)this.get();const t=this.popStack(["を"]),n=this.popStack(["で"]);let s=null,r=!1;return this.check("ここから")?(r=!0,this.get()):this.check("eol")&&(r=!0),r?(s=this.yBlock(),this.check("ここまで")&&this.get()):s=this.ySentence(),{type:"foreach",name:n,target:t,block:s||[],josi:"",...e,end:this.peekSourceMap()}}ySwitch(){const e=this.peekSourceMap();if(!this.check("条件分岐"))return null;const t=this.get();if(!t)return null;const n=this.get();if(!n)return null;const s=this.popStack(["で"]);if(!s)throw r.ih.fromNode("『(値)で条件分岐』のように記述してください。",t);if("eol"!==n.type)throw r.ih.fromNode("『条件分岐』の直後は改行してください。",t);let i=!1,o=!1;const u=[];for(;!this.isEOF();){if(this.check("ここまで")){if(o)throw r.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);this.get();break}if(this.check("eol")){this.get();continue}if(i)throw r.ih.fromNode("『条件分岐』で『違えば〜ここまで』の後に処理を続けることは出来ません。",t);let e=null;const n=this.peek();if(n&&"違えば"===n.type)o=!1,i=!0,e=this.get(),this.check("comma")&&this.get();else{if(o)throw r.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);if(e=this.yValue(),!e)throw r.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);const n=this.get();if(!n||"ならば"!==n.type)throw r.ih.fromNode("『条件分岐』で条件は**ならばと記述してください。",t);this.check("comma")&&this.get()}const s=this.yBlock(),c=this.peek();if(c&&"ここまで"===c.type)this.get();else{if(i)throw r.ih.fromNode("『条件分岐』は『違えば〜ここまで』と記述してください。",t);o=!0}u.push([e,s])}return{type:"switch",value:s,cases:u||[],josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){const e=this.peekSourceMap();if(!this.check("def_func"))return null;const t=this.get();if(!t)return null;let n=[];this.check("comma")&&this.get(),this.check("(")&&(n=this.yDefFuncReadArgs()||[]),this.check("comma")&&this.get(),this.funcLevel++,this.saveStack();const s=this.yBlock();if(!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『には』構文か無名関数の末尾に『ここまで』が必要です。",e);return this.get(),this.loadStack(),this.funcLevel--,{type:"func_obj",args:n,block:s,meta:t.meta,josi:"",...e,end:this.peekSourceMap()}}yDainyu(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const n=this.popStack(["を"]),s=this.popStack(["へ","に"]);if(!s||"word"!==s.type&&"func"!==s.type&&"配列参照"!==s.type)throw r.ih.fromNode("代入文で代入先の変数が見当たりません。『(変数名)に(値)を代入』のように使います。",t);if("配列参照"===s.type)return{type:"let_array",name:s.name,index:s.index,value:n,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()};return{type:"let",name:this.getVarName(s),value:n,josi:"",...e,end:this.peekSourceMap()}}ySadameru(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const n=this.popStack(["を"]),s=this.popStack(["へ","に"]);if(!n||"word"!==n.type&&"func"!==n.type&&"配列参照"!==n.type)throw r.ih.fromNode("『定める』文で定数が見当たりません。『(定数名)を(値)に定める』のように使います。",t);return{type:"def_local_var",name:this.getVarName(n),vartype:"定数",value:s,josi:"",...e,end:this.peekSourceMap()}}yIncDec(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;if(this.check("繰返"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap()}),this.yFor();let n=this.popStack(["だけ",""]);n||(n={type:"number",value:1,josi:"だけ",...e,end:this.peekSourceMap()});const s=this.popStack(["を"]);if(!s||"word"!==s.type&&"配列参照"!==s.type)throw r.ih.fromNode(`『${t.type}』文で定数が見当たりません。『(変数名)を(値)だけ${t.type}』のように使います。`,t);return"減"===t.value&&(n={type:"op",operator:"*",left:n,right:{type:"number",value:-1,line:t.line},josi:"",...e}),{type:"inc",name:s,value:n,josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("ここから")&&this.get(),this.check("代入"))return this.yDainyu();if(this.check("定める"))return this.ySadameru();if(this.check("回"))return this.yRepeatTime();if(this.check("間"))return this.yWhile();if(this.check("繰返")||this.check("増繰返")||this.check("減繰返"))return this.yFor();if(this.check("反復"))return this.yForEach();if(this.check("条件分岐"))return this.ySwitch();if(this.check("戻る"))return this.yReturn();if(this.check("増")||this.check("減"))return this.yIncDec();if(this.check2([["func","word"],"("])){const e=this.peek();if(e&&""===e.josi){const e=this.yValue();if(e){const n=e.josi||"";if("func"===e.type&&(""===e.josi||t.indexOf(n)>=0))return e.josi="",e;this.pushStack(e)}this.check("comma")&&this.get();continue}}if(this.check("func")){const e=this.yCallFunc();if(null===e)continue;if(this.check("間")){this.pushStack(e);continue}if(!this.checkTypes(n))return e;this.pushStack(this.yGetArgOperator(e));continue}const e=this.yGetArg();if(!e)break;this.pushStack(e)}if(this.stack.length>0){this.logger.debug("--- stack dump ---\n"+JSON.stringify(this.stack,null,2)+"\npeek: "+JSON.stringify(this.peek(),null,2));let e=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!0))).join("、")}が解決していません。`,t=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!1))).join("、")}が解決していません。`;for(const n of this.stack){const s=this.nodeToStr(n,{depth:0},!1),r=this.nodeToStr(n,{depth:1},!1);s!==r&&(e+=`${this.nodeToStr(n,{depth:0},!0)}は${this.nodeToStr(n,{depth:1},!0)}として使われています。`,t+=`${s}は${r}として使われています。`)}const n=this.stack[0],s=this.stack[this.stack.length-1];throw this.logger.debug(e,n),r.ih.fromNode(t,n,s)}return this.popStack([])}yCallFunc(){const e=this.peekSourceMap(),n=this.get();if(!n)return null;const s=n.meta,i=n.value;let o=null;if("には"===n.josi){try{o=this.yMumeiFunc()}catch(e){throw r.ih.fromNode(`『${n.value}には...』で無名関数の定義で以下の間違いがあります。\n${e.message}`,n)}if(null===o)throw r.ih.fromNode("『Fには』構文がありましたが、関数定義が見当たりません。",n)}if(!s||void 0===s.josi)throw r.ih.fromNode("関数の定義でエラー。",n);this.recentlyCalledFunc.push({name:i,...s}),s&&s.asyncFn&&(this.usedAsyncFn=!0);const u=[];let c=0,a=0;for(let e=s.josi.length-1;e>=0;e--)for(;;){let t=this.popStack(s.josi[e]);if(null!==t)a++;else{if(!(e<s.josi.length-1)&&s.isVariableJosi)break;c++,t=o}if(null!==t&&void 0!==s.funcPointers&&null!==s.funcPointers[e]){if("func"!==t.type){const t=s.varnames?s.varnames[e]:`${e+1}番目の引数`;throw r.ih.fromNode(`関数『${n.value}』の引数『${t}』には関数オブジェクトが必要です。`,n)}t.type="func_pointer"}if(u.unshift(t),e<s.josi.length-1||!s.isVariableJosi)break}if(c>=2&&(a>0||""===n.josi||t.indexOf(n.josi)>=0))throw r.ih.fromNode(`関数『${n.value}』の引数が不足しています。`,n);this.usedFuncs.add(n.value);const f={type:"func",name:n.value,args:u,josi:n.josi,...e,end:this.peekSourceMap()};if("プラグイン名設定"===f.name&&u.length>0&&u[0]){let e=""+u[0].value;"メイン"===e&&(e=""+u[0].file),this.modName=m.filenameToModName(e)}return""===n.josi?f:t.indexOf(n.josi)>=0?(f.josi="して",f):(f.meta=s,this.pushStack(f),null)}yCallOp(){if(!this.check2(["func","←"]))return null;const e=this.peekSourceMap(),t=this.get();if(null==t)throw new Error("関数が取得できません。");try{if(null==this.get())throw new Error("関数呼び出し演算子が取得できません。");const n=t.value;if(!t.meta)throw new Error("関数本体を取得できません。");if(!t.meta.josi)throw new Error("関数の引数情報を取得できません。");const s=t.meta.josi.length;if(0===s)throw r.ih.fromNode(`引数がない関数『${n}』を関数呼び出し演算子で呼び出すことはできません。`,t);const i=this.stack.length;for(;!this.isEOF();){const e=this.yGetArg();if(!e)break;if(this.pushStack(e),this.stack.length-i===s)break}const o=this.stack.length-i;if(o!==s)throw r.ih.fromNode(`関数『${n}』呼び出しで引数の数(${o})が定義(${s})と違います。`,t);const u=this.stack.splice(i,s);let c=u;if(s>=2){c=[];t.meta.josi.forEach(((e,t)=>{for(let n=0;n<u.length;n++){const s=u[n];if(e.indexOf(s.josi)>=0)return void(c[t]=s)}const n=e.join(",");throw new Error(`助詞『${n}』が見当たりません。`)}))}return this.usedFuncs.add(n),{type:"func",name:n,args:c,setter:!0,josi:"",...e,end:this.peekSourceMap()}}catch(e){throw this.logger.debug(`${this.nodeToStr(t,{depth:0},!0)}の関数呼び出しで引数(『←』以降)が読み取れません。`,t),r.ih.fromNode(`${this.nodeToStr(t,{depth:0},!1)}の関数呼び出しでエラーがあります。\n${e.message}`,t)}}yLet(){const e=this.peekSourceMap();if(this.check2(["word","eq"])){const t=this.peek();let n=!1;try{if(this.accept(["word","eq",this.yCalc])||this.accept(["word","eq",this.ySentence])){if("eol"===this.y[2].type)throw new Error("値が空です。");this.check("comma")&&this.get();const t=this.getVarName(this.y[0]);return{type:"let",name:t,value:this.y[2],...e,end:this.peekSourceMap()}}throw n=!0,this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に書き間違いがあります。`,t),r.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に書き間違いがあります。`,e)}catch(s){if(n)throw s;throw this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に以下の書き間違いがあります。\n${s.message}`,t),r.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に以下の書き間違いがあります。\n${s.message}`,e)}}if(this.check2(["word","@"])){const t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){const t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","とは"])){const t=this.getVarName(this.y[0]);if(!this.checkTypes(["変数","定数"]))throw r.ih.fromNode("ローカル変数『"+t.value+"』の定義エラー",t);const n=this.getCur();let s=null;return this.check("eq")&&(this.get(),s=this.yCalc()),this.check("comma")&&this.get(),{type:"def_local_var",name:t,vartype:n.type,value:s,...e,end:this.peekSourceMap()}}if(this.accept(["変数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw r.ih.fromNode("複数定数の代入文でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw r.ih.fromNode(`複数定数の代入文${e+1}番目でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["変数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw r.ih.fromNode("複数変数の代入文でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw r.ih.fromNode(`複数変数の代入文${e+1}番目でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[4],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[6],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[8],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[10],...e,end:this.peekSourceMap()}}}return null}checkArrayIndex(e){return 0===this.arrayIndexFrom?e:{...e,type:"op",operator:"-",left:e,right:{...e,type:"number",value:this.arrayIndexFrom}}}checkArrayReverse(e){return e?this.flagReverseArrayIndex?e.length<=1?e:e.reverse():e:[]}yLetArrayAt(e){return this.accept(["word","@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[4],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:null}yLetArrayBracket(e){return this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[5],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),value:this.y[8],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[7],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]),value:this.y[11],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[9],...e,end:this.peekSourceMap()}:null}yCalc(){const e=this.peekSourceMap();if(this.check("eol"))return null;const t=this.yGetArg();if(!t)return null;if(""===t.josi)return t;this.pushStack(t);const n=this.yCall();if(!n)return this.popStack();if("して"!==n.josi)return n;const s=this.yCalc();return s?{type:"renbun",left:n,right:s,josi:s.josi,...e,end:this.peekSourceMap()}:n}yValueKakko(){if(!this.check("("))return null;const e=this.get();if(!e)throw new Error("[System Error] check したのに get できない");this.saveStack();const t=this.yCalc()||this.ySentence();if(null===t){const t=this.get();throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),r.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e)}if(!this.check(")"))throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),r.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e);const n=this.get();return this.loadStack(),n&&(t.josi=n.josi),t}yValue(){const e=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","string"]))return this.getCur();if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){const t=this.get(),n=this.yValue(),s=n&&n.josi?n.josi:"";return{type:"op",operator:"*",left:{type:"number",value:-1,line:t&&t.line?t.line:0},right:n||[],josi:s,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();const t=this.yValue();return{type:"not",value:t,josi:t&&t.josi?t.josi:"",...e,end:this.peekSourceMap()}}const t=this.yJSONArray();if(t)return t;const i=this.yJSONObject();if(i)return i;const o=n.concat(["eol",")","]","ならば","回","間","反復","条件分岐"]);if(this.check2(["func",o])){const t=this.get();if(!t)throw new Error("[System Error] 正しく値が取れませんでした。");const n=this.getVarNameRef(t);return this.usedFuncs.add(n.value),{type:"func",name:n.value,args:[],josi:n.josi,...e,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&""===this.peekDef().josi){const t=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"])){const t=this.getVarNameRef(this.y[0]).value;return this.usedFuncs.add(t),{type:"func",name:t,args:this.y[2],josi:this.y[3].josi,...e,end:this.peekSourceMap()}}throw r.ih.fromNode("C風関数呼び出しのエラー",t||s())}if(this.check2(["func","←"]))return this.yCallOp();if(this.check("def_func"))return this.yMumeiFunc();const u=this.yValueWord();return u||null}yValueWordGetIndex(e){if(e.index||(e.index=[]),this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw r.ih.fromNode("変数の後ろの『@要素』の指定が不正です。",e)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,!0;if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])];return e.index=this.checkArrayReverse(t),e.josi=this.y[4].josi,!0}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])];return e.index=this.checkArrayReverse(t),e.josi=this.y[6].josi,!0}return!1}yValueWord(){const e=this.peekSourceMap();if(this.check("word")){const t=this.getCur(),n=this.getVarNameRef(t);if(""===n.josi&&this.checkTypes(["[","@"])){const t={type:"配列参照",name:n,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(t););if(t.index&&0===t.index.length)throw r.ih.fromNode(`配列『${n.value}』アクセスで指定ミス`,n);return t}return n}return null}getVarName(e){const t=this.findVar(e.value);if(t)t&&"global"===t.scope&&(e.value=t.name);else if(0===this.funcLevel){let t=e.value;t.indexOf("__")<0&&(t=this.modName+"__"+e.value),this.funclist[t]={type:"var",value:""},e.value=t}else this.localvars[e.value]={type:"var",value:""};return e}getVarNameRef(e){const t=this.findVar(e.value);return t?t&&"global"===t.scope&&(e.value=t.name):0===this.funcLevel&&e.value.indexOf("__")<0&&(e.value=this.modName+"__"+e.value),e}getVarNameList(e){for(let t=0;t<e.length;t++)e[t]=this.getVarName(e[t]);return e}yJSONObjectValue(){const e=[],t=this.peek();if(!t)return null;for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push({key:this.y[0],value:this.y[2]});else if(this.accept(["string",":",this.yCalc]))e.push({key:this.y[0],value:this.y[2]});else if(this.check("word")){const t=this.getCur();t.type="string",e.push({key:t,value:t})}else{if(!this.checkTypes(["string","number"]))throw r.ih.fromNode("辞書オブジェクトの宣言で末尾の『}』がありません。",t);{const t=this.getCur();e.push({key:t,value:t})}}this.check("comma")&&this.get()}return e}yJSONObject(){const e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw r.ih.fromNode("辞書型変数の初期化が『}』で閉じられていません。",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();const e=this.yCalc();if(null===e)return null;this.check("comma")&&this.get();const t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){const e=this.yCalc();if(null===e)break;this.check("comma")&&this.get(),t.push(e)}return t}yJSONArray(){const e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw r.ih.fromNode("配列変数の初期化が『]』で閉じられていません。",this.y[1]);return null}yTryExcept(){const e=this.peekSourceMap();if(!this.check("エラー監視"))return null;const t=this.getCur(),n=this.yBlock();if(!this.check2(["エラー","ならば"]))throw r.ih.fromNode("エラー構文で『エラーならば』がありません。『エラー監視..エラーならば..ここまで』を対で記述します。",t);this.get(),this.get();const s=this.yBlock();if(!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『エラー監視』...『エラーならば』...『ここまで』を対応させてください。",e);return this.get(),{type:"try_except",block:n,errBlock:s||[],josi:"",...e,end:this.peekSourceMap()}}}class v{constructor(e,t,n){this.from=e,this.to=t,this.index=n}}class b{constructor(e,t){this.text=e,this.sourcePosition=t}}class k{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){const n=this.getText().indexOf(e);if(-1===n)break;e.length!==t.length&&this.history.unshift(new v(e.length,t.length,n)),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(const t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(e=t.to>=2&&e===t.index+t.to-1?t.index+t.from-1:t.index);return e}}class w{constructor(){this.convertTable=new Map([[8208,"-"],[8209,"-"],[8211,"-"],[8212,"-"],[8213,"-"],[8722,"-"],[732,"~"],[759,"~"],[8275,"~"],[8764,"~"],[12316,"~"],[65374,"~"],[8192," "],[8194," "],[8195," "],[8196," "],[8197," "],[8198," "],[8199," "],[8201," "],[8202," "],[8203," "],[8239," "],[8287," "],[12288," "],[12644," "],[8251,"#"],[12290,";"],[12304,"["],[12305,"]"],[12289,","],[65292,","],[10006,"*"],[10133,"+"],[10134,"-"],[10135,"÷"]])}static getInstance(){return w._instance||(w._instance=new w),w._instance}convert1ch(e){if(!e)return"";const t=e.codePointAt(0)||0,n=this.convertTable.get(t)||"";if(n)return n;if(t<127)return e;if(t>=65281&&t<=65374){const e=t-65248;return String.fromCodePoint(e)}return e}convert(e){if(!e)return[];const t=new k(e);t.replaceAll("\r\n","\n"),t.replaceAll("\r","\n");let n=!1,s=!1,r="";const i=[];let o=0,u="",c=0;for(;c<t.getText().length;){const e=t.getText().charAt(c),a=t.getText().substr(c,2);if(n){if(e===r){n=!1,i.push(new b(u+r,t.getSourcePosition(o))),c++,o=c;continue}u+=e,c++;continue}if(s){if(a===r){s=!1,"*/"===r&&(r="*/"),i.push(new b(u+r,t.getSourcePosition(o))),c+=2,o=c;continue}u+=e,c++;continue}if("「"===e){i.push(new b(e,t.getSourcePosition(o))),c++,o=c,n=!0,r="」",u="";continue}if("『"===e){i.push(new b(e,t.getSourcePosition(o))),c++,o=c,n=!0,r="』",u="";continue}if("“"===e){i.push(new b(e,t.getSourcePosition(o))),c++,o=c,n=!0,r="”",u="";continue}if("🌴"===a||"🌿"===a){i.push(new b(a,t.getSourcePosition(o))),c+=2,o=c,s=!0,r=a,u="";continue}const f=this.convert1ch(e);'"'!==f&&"'"!==f?"#"!==f?"//"!==a&&"//"!==a?"/*"!==a?"/*"!==a?(i.push(new b(f,t.getSourcePosition(o))),c++,o=c):(i.push(new b(a,t.getSourcePosition(o))),c+=2,o=c,s=!0,r="*/",u=""):(i.push(new b("/*",t.getSourcePosition(o))),c+=2,o=c,s=!0,r="*/",u=""):(i.push(new b("//",t.getSourcePosition(o))),c+=2,o=c,n=!0,r="\n",u=""):(i.push(new b(f,t.getSourcePosition(o))),c++,o=c,n=!0,r="\n",u=""):(i.push(new b(f,t.getSourcePosition(o))),c++,o=c,n=!0,r=e,u="")}return(n||s)&&i.push(new b(u+r,t.getSourcePosition(o))),i}}var S=__webpack_require__(9485),j=__webpack_require__(8801);let $=s();function O(e,t,n){n&&($=n);return s(e,t,$.indent,$.line,$.file)}function x(e){return"違えば"===e.type||"word"===e.type&&"エラー"===e.value&&"ならば"===e.josi}function A(e){const t=[];for(const n of e)for(const e of n)t.push(e);return t}function C(e){const t=e.length;if(0===t)return s("?");let n=e[t-1];return"eol"===n.type&&t>=2&&(n=e[t-2]),n}function F(e,t){const n=[];let s=[],r=0;for(const i of e)s.push(i),"{"===i.type?r++:"}"===i.type?r--:0===r&&i.type===t&&(n.push(s),s=[]);return s.length>0&&n.push(s),n}function N(e){if(0===e.length)return!0;for(let t=0;t<e.length;t++){const n=e[t].type;if("eol"!==n&&"line_comment"!==n&&"range_comment"!==n)return!1}return!0}function M(e){for(let t=0;t<e.length;t++){const n=e[t].type;if("eol"!==n&&"line_comment"!==n&&"range_comment"!==n)return e[t]}return e[0]}const L=["!インデント構文","!ここまでだるい","💡インデント構文","💡ここまでだるい"];function E(e){if(!function(e){for(let t=0;t<e.length&&!(t>100);t++){const n=e[t];if("line_comment"===n.type&&L.indexOf(n.value)>=0)return!0}return!1}(e))return e;for(const t of e)if("ここまで"===t.type)throw new r.t5("インデント構文が有効化されているときに『ここまで』を使うことはできません。",t.line,t.file);let t=0,n=0;const s=e=>{e.forEach((e=>{"{"===e.type&&t++,"}"===e.type&&t--,"["===e.type&&n++,"]"===e.type&&n--}))},i=[],o=F(e,"eol");let u=0;for(let e=0;e<o.length;e++){const r=o[e];if(N(r))continue;if(n>0||t>0){s(r);continue}const c=M(r),a=c.indent;if(a!==u){if(u>=0)for(;u>a;){const t=i[i.length-1][1];if(x(c)&&t===a);else{const t=o[e-1][0];o[e-1].push(O("ここまで","ここまで",t)),o[e-1].push(O("eol","\n",t))}if(i.pop(),!(i.length>0)){u=0;break}u=i[i.length-1][0]}n>0||t>0||(s(r),a>u&&(i.push([a,u]),u=a))}}for(let t=0;t<i.length;t++){let t=e[0];for(let e=o.length-1;e>=0;e--){const n=o[e];if(n.length>0){t=n[n.length-1];break}}o[o.length-1].push(O("ここまで","ここまで",t)),o[o.length-1].push(O("eol","\n",t))}return A(o)}const T=["!DNCLモード","💡DNCLモード"],I={"←:←":["eq","="],"÷:÷":["÷÷","÷÷"],"{:{":["[","["],"}:}":["]","]"],"word:を実行":["ここまで","ここまで"],"word:乱数":["word","乱数範囲"],"word:表示":["word","連続表示"]};function P(e){if(!function(e){for(let t=0;t<e.length&&!(t>100);t++){const n=e[t];if("line_comment"===n.type&&T.indexOf(n.value)>=0)return n.type="DNCLモード",!0}return!1}(e))return e;const t=F(e,"eol");for(let e=0;e<t.length;e++){const n=t[e];if(n.length<=1)continue;for(let e=0;e<n.length&&"|"===n[e].type;e++)n[e].type="range_comment";const r=n[0];"word"===r.type&&"繰返"===r.value&&n.splice(0,n.length,s("word","後判定",r.indent,r.line,r.file),s("word","繰返",r.indent,r.line,r.file));const i=D(n,["word:なる","word:繰返"]);i>0&&G(n,i);const o=D(n,["word:なる","word:実行"]);o>0&&G(n,o);const u=D(n,["word:ない"]);if(u>=1){"ならば"===n[u].josi&&(n[u-1].josi="でなければ",n.splice(u,1))}for(;;){const e=D(n,["word:二進","word:表示"]);if(e<0)break;n[e].value="二進表示",n[e].josi="",n.splice(e+1,1)}for(;;){const e=D(n,["word:改行","word:表示"]);if(e<0)break;const t=n[e];t.value="連続無改行表示",t.josi="",n.splice(e+1,1)}for(;;){const e=D(n,["word:を実行","comma:,","word:そう"]);if(e<0)break;const t=n[e+2];if("でなければ"!==t.josi){if("で"===t.josi){const r=n[e+3];if("なくもし"===r.value.substring(0,4)){if(t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t),r.value.length>4){const t=r.value.substring(4),i=s("word",t,r.indent,r.line,r.file);t.match(/^\d/)&&(i.type="number"),n.splice(e+2,0,i),r.value=r.value.substring(0,4)}r.type="もし",r.value="もし",r.josi="";continue}}break}t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t)}for(;;){const e=D(n,["word:増","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="増繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=D(n,["word:減","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="減繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=D(n,["word:を繰り返"]);if(e<0)break;const t=n[e];t.type="ここまで",t.value="ここまで",t.josi=""}for(;;){const e=D(n,["word:すべて","word:要素"]);if(!(e>=1))break;J(n,e)}for(;;){const e=D(n,["word:すべて","word:値"]);if(!(e>=1))break;J(n,e)}let c=0;for(;c<n.length;){const e=n[c];if("word"===e.type&&e.value.length>=2){const t=e.value.charAt(e.value.length-1);"減"!==t&&"増"!==t||(e.value=e.value.substring(0,e.value.length-1),e.josi="だけ",n.splice(c+1,0,s("word",t,e.indent,e.line,e.file))),c++}else c++}}for(let t=0;t<e.length;t++){const n=e[t],s=I[n.type+":"+n.value];void 0!==s&&(n.type=s[0],n.value=s[1])}return e=A(t)}function J(e,t){const n=e[t];e[t-1].josi="";const r=s("eq","=",n.indent,n.line,n.file),i=s("[","[",n.indent,n.line,n.file),o=s("]","]",n.indent,n.line,n.file);o.josi="に";const u=e[t+2];u.josi="";const c=s("number",100,n.indent,n.line,n.file);c.josi="を";const a=s("word","掛",n.indent,n.line,n.file);e.splice(t,4,r,i,u,o,c,a)}function G(e,t){const n=D(e,["word:を"]);n>=0&&(e[n].type="ここまで",e[n].value="ここまで");const s=D(e,["word:が"]);s>=0&&(e[s].type="ここまで",e[s].value="ここまで"),e[t+1].value="間"}function D(e,t){const n=t.map((e=>e.split(":")));for(let t=0;t<e.length;t++){let s=!0;for(let r=0;r<n.length;r++){const i=n[r],o=t+r;if(o>=e.length)return-1;if(e[o].type!==i[0]||e[o].value!==i[1]){s=!1;break}}if(s)return t}return-1}const R=["!DNCL2モード","💡DNCL2モード","!DNCL2","💡DNCL2"],V={"←:←":["eq","="],"÷:÷":["÷÷","÷÷"],"{:{":["[","["],"}:}":["]","]"],"word:and":["and","かつ"],"word:or":["or","または"],"word:not":["not","!"],"word:乱数":["word","乱数範囲"],"word:表示":["word","連続表示"]};function q(e){if(!function(e){for(let t=0;t<e.length&&!(t>100);t++){const n=e[t];if("line_comment"===n.type&&R.indexOf(n.value)>=0)return n.type="DNCL2モード",!0}return!1}(e))return e;const t=F(e,"eol");for(let e=0;e<t.length;e++){const n=t[e];if(n.length<=1)continue;const r=U(n,["word:ない"]);if(r>=1){"ならば"===n[r].josi&&(n[r-1].josi="でなければ",n.splice(r,1))}for(let e=0;e<n.length;e++){const t=n[e];"そう"===t.value&&"でなければ"===t.josi&&(t.type="違えば",t.value="違えば",t.josi="")}for(;;){const e=U(n,["word:を実行","comma:,","word:そう"]);if(e<0)break;const t=n[e+2];if("でなければ"!==t.josi){if("で"===t.josi){const r=n[e+3];if("なくもし"===r.value.substring(0,4)){if(t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t),r.value.length>4){const t=r.value.substring(4),i=s("word",t,r.indent,r.line,r.file);t.match(/^\d/)&&(i.type="number"),n.splice(e+2,0,i),r.value=r.value.substring(0,4)}r.type="もし",r.value="もし",r.josi="";continue}}break}t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t)}for(;;){const e=U(n,["word:増","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="増繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=U(n,["word:減","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="減繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=U(n,["word:増","word:ら繰り返"]);if(e<0)break;const t=n[e];t.type="word",t.value="増繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=U(n,["word:減","word:ら繰り返"]);if(e<0)break;const t=n[e];t.type="word",t.value="減繰返",t.josi="",n.splice(e,2,t)}for(let e=0;e<n.length;e++){if(B([["word:配列","word:配列変数"],"word","word:すべて",["word:要素","word:値"],"*","word:代入"],n,e)){const t=n[e+1];t.josi="";const s=n[e+4];s.josi="",n.splice(e,6,t,O("eq","=",t),O("word","掛"),O("(","("),O("[","["),s,O("]","]"),O("comma",","),O("number",30),O(")",")")),e+=6}if(B(["word","word:すべて",["word:要素","word:値"],["number","string","word"],"word:する"],n,e)){const t=n[e];t.josi="";const s=n[e+3];s.josi="",n.splice(e,5,t,O("eq","=",t),O("word","掛"),O("(","("),O("[","["),s,O("]","]"),O("comma",","),O("number",30),O(")",")"))}if(B([["word:配列変数","word:配列"],"word","word:初期化"],n,e)){const t=n[e+1];t.josi="",n.splice(e,3,t,O("eq","=",t),O("word","掛"),O("(","("),O("[","["),O("number",0),O("]","]"),O("comma",","),O("number",30),O(")",")"))}}for(;;){const e=U(n,["word:二進","word:表示"]);if(e<0)break;n[e].value="二進表示",n[e].josi="",n.splice(e+1,1)}for(;;){const e=U(n,["word:改行","word:表示"]);if(e<0)break;const t=n[e];t.value="連続無改行表示",t.josi="",n.splice(e+1,1)}let i=0;for(;i<n.length;){const e=n[i];if("word"===e.type&&e.value.length>=2){const t=e.value.charAt(e.value.length-1);"減"!==t&&"増"!==t||(e.value=e.value.substring(0,e.value.length-1),e.josi="だけ",n.splice(i+1,0,s("word",t,e.indent,e.line,e.file))),i++}else i++}}for(let t=0;t<e.length;t++){const n=e[t],s=V[n.type+":"+n.value];void 0!==s&&(n.type=s[0],n.value=s[1])}return e=A(t)}function B(e,t,n){const s=(e,t)=>{if(e instanceof Array){for(let n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}if("*"===e)return!0;if(e.indexOf(":")<0)return e===t.type;return e===`${t.type}:${t.value}`};for(let r=0;r<e.length;r++){const i=r+n;if(i>=t.length)return!1;const o=e[r],u=t[i];if(!s(o,u))return!1}return!0}function U(e,t){const n=t.map((e=>e.split(":")));for(let t=0;t<e.length;t++){let s=!0;for(let r=0;r<n.length;r++){const i=n[r],o=t+r;if(o>=e.length)return-1;if(e[o].type!==i[0]||e[o].value!==i[1]){s=!1;break}}if(s)return t}return-1}class W{constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let n=0;this.cumulativeSum=[];for(const e of t)this.cumulativeSum.push(n),n+=e.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){const t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}}class X{constructor(e,t,n){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=n;let s=0;for(const t of e.split("\n"))this.lines.push({offset:s,len:t.length}),s+=t.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){if(null===e)return{startOffset:e,endOffset:t};const n=this.getLineNumber(e);for(const s of this.linesInsertedByIndentationSyntax){if(n===s){e=null,t=null;break}n>s&&(e-=this.lines[s].len+1,null!==t&&(t-=this.lines[s].len+1))}for(const s of this.linesDeletedByIndentationSyntax)n>=s.lineNumber&&(null!==e&&(e+=s.len+1),null!==t&&(t+=s.len+1));return{startOffset:e,endOffset:t}}getLineNumber(e){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let t=this.lastLineNumber;t<this.lines.length-1;t++)if(e<this.lines[t+1].offset)return this.lastLineNumber=t,t;return this.lastLineNumber=this.lines.length-1,this.lines.length-1}}class Y{constructor(e){this.lineOffsets=[];let t=0;for(const n of e.split("\n"))this.lineOffsets.push(t),t+=n.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let n=this.lastLineNumber;n<this.lineOffsets.length-1;n++)if(e<this.lineOffsets[n+1])return this.lastLineNumber=n,{line:n+(t?1:0),column:e-this.lineOffsets[n]};return this.lastLineNumber=this.lineOffsets.length-1,{line:this.lineOffsets.length-1+(t?1:0),column:e-this.lineOffsets[this.lineOffsets.length-1]}}}function z(e,t){if("number"==typeof e.startOffset&&(e.startOffset-=t.length),"number"==typeof e.endOffset&&(e.endOffset-=t.length),""!==t){const n=t.split("\n");"number"==typeof e.line&&(e.line-=n.length-1),0===e.line&&"number"==typeof e.column&&(e.column-=n[n.length-1].length)}return e}const H=["black","red","green","yellow","blue","magenta","cyan","white"],Z=e=>{const t=e.replace(/\x1b\[\d+m/g,""),n=[];let s="inherit",r="inherit";const i=e===t?t:e.replace(/\x1b\[(\d+)m/g,((e,t)=>{const i=+t;return 0===i&&(s="inherit",r="inherit"),1===i&&(r="bold"),i>=30&&i<=37&&(s=H[i-30]),n.push(`color: ${s}; font-weight: ${r};`),"%c"}));let o="inherit",u="inherit";var c;return{noColor:t,nodeConsole:e===t?t:e+"[0m",html:e===t?t:"<span>"+(c=e,c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")).replace(/\x1b\[(\d+)m/g,((e,t)=>{const n=+t;return 0===n&&(o="inherit",u="inherit"),1===n&&(u="bold"),n>=30&&n<=37&&(o=H[n-30]),`</span><span style="color: ${o}; font-weight: ${u};">`}))+"</span>",browserConsole:[i,...n]}},K={reset:"[0m",bold:"[1m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m"};class Q{static fromS(e){let t=Q.trace;switch(e){case"all":t=Q.all;break;case"trace":t=Q.trace;break;case"debug":t=Q.debug;break;case"info":t=Q.info;break;case"warn":t=Q.warn;break;case"error":t=Q.error;break;case"stdout":t=Q.stdout;break;default:throw new Error("[NakoLogger] unknown logger level:"+e)}return t}static toString(e){return["all","trace","debug","info","warn","error","stdout"][e]}}function ee(e){return e?`${e.file||""}${void 0===e.line?"":`(${e.line+1}行目): `}`:""}Q.all=0,Q.trace=1,Q.debug=2,Q.info=3,Q.warn=4,Q.error=5,Q.stdout=6;class te{constructor(){this.listeners=[],this.logs="",this.position=""}getErrorLogs(){return[this.logs.replace(/\s+$/,""),this.position]}clear(){this.logs="",this.position=""}addListener(e,t){const n=Q.fromS(e);this.listeners.push({level:n,callback:t})}removeListener(e){this.listeners=this.listeners.filter((t=>t.callback!==e))}trace(e,t=null){this.sendI(Q.trace,`${K.bold}[デバッグ情報(詳細)]${K.reset}${ee(t)}${e}`,t)}debug(e,t=null){this.sendI(Q.debug,`${K.bold}[デバッグ情報]${K.reset}${ee(t)}${e}`,t)}info(e,t=null){this.sendI(Q.info,`${K.bold}${K.blue}[情報]${K.reset}${ee(t)}${e}`,t)}warn(e,t=null){this.sendI(Q.warn,`${K.bold}${K.green}[警告]${K.reset}${ee(t)}${e}`,t)}error(e,t=null){if(e instanceof Error&&"string"==typeof e.type){switch(e.type){case"NakoRuntimeError":case"NakoError":if(e instanceof r.k){const n=e;let s=t;return null==s&&(s={file:n.file,line:n.line||0,startOffset:0,endOffset:0}),void this.sendI(Q.error,n.message,s)}}}e instanceof Error&&(e=e.message),this.sendI(Q.error,`${K.bold}${K.red}[エラー]${K.reset}${ee(t)}${e}`,t)}runtimeError(e,t){return new r.as(e,t)}stdout(e,t=null){this.sendI(Q.stdout,`${e}`,t)}send(e,t,n,s=null,r=null){const i=Q.fromS(e);this.sendI(i,t,n,s,r)}sendI(e,t,n,s=null,r=null){const i=()=>{const i=Z(t);let o="";t.includes("\n")&&(o+="border-top: 1px solid #8080806b; border-bottom: 1px solid #8080806b;");return{noColor:i.noColor,nodeConsole:i.nodeConsole,browserConsole:r||i.browserConsole,html:`<div style="${o}">`+(s||i.html)+"</div>",level:Q.toString(e),position:n}};if(e===Q.error){const e=i();this.logs+=e.noColor+"\n",n&&null!==this.position&&(this.position=`l${n.line}:${n.file}`)}for(const t of this.listeners)if(t.level<=e){const e=i();t.callback(e)}}}class ne{constructor(e,t,n=0){this.guid=n,this.lastJSCode="",this.__locals={},this.__varslist=[{...e.__varslist[0]},{...e.__varslist[1]},{...e.__varslist[2]}],this.numFailures=0,this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.version=e.version,this.coreVersion=e.coreVersion,this.__module={...e.__module},this.pluginfiles={...e.getPluginfiles()},this.gen=t,this.logger=e.getLogger(),this.compiler=e}clearLog(){this.__varslist[0]["表示ログ"]=""}get log(){let e=this.__varslist[0]["表示ログ"];return e=e.replace(/\s+$/,""),e}runEx(e,t,n,s=""){return n.preCode=s,n.nakoGlobal=this,this.compiler.runSync(e,t,n)}async runAsync(e,t,n,s=""){return n.preCode=s,n.nakoGlobal=this,await this.compiler.runAsync(e,t,n)}_runTests(e){let t=`${K.bold}テストの実行結果${K.reset}\n`,n=0,s=0;for(const r of e)try{r.f(),t+=`${K.green}✔${K.reset} ${r.name}\n`,n++}catch(e){t+=`${K.red}☓${K.reset} ${r.name}: ${e.message}\n`,s++}t+=s>0?`${K.green}成功 ${n}件 ${K.red}失敗 ${s}件`:`${K.green}成功 ${n}件`,this.numFailures=s,this.logger.stdout(t)}clearPlugins(){for(const e in this.pluginfiles){const t=this.__module[e];t["!クリア"]&&t["!クリア"].fn&&t["!クリア"].fn(this)}}reset(){this.clearPlugins()}destroy(){this.reset()}}var se=__webpack_require__(4228),re=__webpack_require__(6758),ie={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},SIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sin(e)}},COS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.cos(e)}},TAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.tan(e)}},ARCSIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.asin(e)}},ARCCOS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.acos(e)}},ARCTAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.atan(e)}},ATAN2:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.atan2(e,t)}},"座標角度計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 180*Math.atan2(e[1],e[0])/Math.PI}},RAD2DEG:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},DEG2RAD:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},"度変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},"ラジアン変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},SIGN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 0===parseFloat(e)?0:e>0?1:-1}},"符号":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("SIGN",[e])}},ABS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},"絶対値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},EXP:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.exp(e)}},HYPOT:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},"斜辺":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},LN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOG:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOGN:{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return 2===e?Math.LOG2E*Math.log(t):10===e?Math.LOG10E*Math.log(t):Math.log(t)/Math.log(e)}},FRAC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"小数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"整数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.trunc(e)}},"乱数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.floor(Math.random()*e)}},"乱数範囲":{type:"func",josi:[["から"],["までの","の"]],pure:!0,fn:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},SQRT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},"平方根":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},ROUND:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.round(e)}},"四捨五入":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return Math.round(e)}},"小数点切上":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.ceil(e*n)/n}},"小数点切下":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.floor(e*n)/n}},"小数点四捨五入":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}},CEIL:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},"切上":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},FLOOR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}},"切捨":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}}};const oe={delimiter:",",eol:"\r\n"};function ue(e,t){void 0===t&&(t=oe.delimiter),e=(e=(e+="\n").replace(/(\r\n|\r)/g,"\n")).replace(/\s+$/,"")+"\n";const n=new RegExp("^(.*?)([\\"+t+"\\n])"),s=function(e){return"string"==typeof e&&e.search(/^[0-9.]+$/)>=0&&(e=parseFloat(e)),e},r=[];let i=[],o="";for(;""!==e;){if(o=e.charAt(0),o===t){e=e.substring(1),i.push("");continue}if("\n"===o){i.push(""),r.push(i),i=[],e=e.substring(1);continue}if(o=(e=e.replace(/^\s+/,"")).charAt(0),o===t){console.log("delimiter"),i.push(""),e=e.substring(t.length);continue}if("="===o&&'"'===e.charAt(1)){e=e.substring(1);continue}if('"'!==o){const o=n.exec(e);if(!o){i.push(s(e)),r.push(i),i=[];break}"\n"===o[2]?(i.push(s(o[1])),r.push(i),i=[]):o[2]===t&&i.push(s(o[1])),e=e.substring(o[0].length);continue}if('""'===e.substring(0,2)){i.push(""),e=e.substring(2);continue}let u=1,c="";for(;u<e.length;){const n=e.charAt(u),o=e.charAt(u+1);if('"'!==n||'"'!==o)if('"'!==n)c+=n,u++;else{if(u++,o===t){u++,i.push(s(c)),c="";break}if("\n"===o){u++,i.push(s(c)),r.push(i),i=[];break}u++}else u+=2,c+='"'}e=e.substr(u)}return i.length>0&&r.push(i),r}function ce(e,t,n){void 0===t&&(t=oe.delimiter),void 0===n&&(n=oe.eol);const s=function(e){return function(t){let n=!1;return((t=""+t).indexOf("\n")>=0||t.indexOf("\r")>=0)&&(n=!0),t.indexOf(e)>=0&&(n=!0),t.indexOf('"')>=0&&(n=!0,t=t.replace(/"/g,'""')),n&&(t='"'+t+'"'),t}}(t);if(void 0===e)return"";let r="";for(let i=0;i<e.length;i++){const o=e[i];if(void 0!==o){for(let e=0;e<o.length;e++)o[e]=s(o[e]);r+=o.join(t)+n}else r+=n}return r=r.replace(/(\r\n|\r|\n)/g,n),r}var ae={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},"CSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return oe.delimiter=",",ue(e)}},"TSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return oe.delimiter="\t",ue(e)}},"表CSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return oe.delimiter=",",ce(e)}},"表TSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return oe.delimiter="\t",ce(e)}}},fe={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){null==e.__promise&&(e.__promise={setLastPromise:function(t){return e.__v0["そ"]=t,t}})}},"そ":{type:"const",value:""},"動時":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){return t.__promise.setLastPromise(new Promise(((t,n)=>e(t,n))))},return_none:!1},"成功時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"処理時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(!0,t,n))),(t=>(n.__v0["対象"]=t,e(!1,t,n)))))},return_none:!1},"失敗時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.catch((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"終了時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.finally((()=>e())))},return_none:!1},"束":{type:"func",josi:[["と","を"]],pure:!0,fn:function(...e){return e.pop().__promise.setLastPromise(Promise.all(e))},return_none:!1}},le={"ASSERT等":{type:"func",josi:[["と"],["が"]],pure:!0,fn:function(e,t){if(e!==t)throw new Error(`不一致 [実際]${e} [期待]${t}`);return!0}},"テスト実行":{type:"func",josi:[["と"],["で"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}},"テスト等":{type:"func",josi:[["と"],["が"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}}};const he=e=>JSON.parse(JSON.stringify(e));function pe(e={}){return"object"!=typeof e&&(e={}),e.testOnly=e.testOnly||!1,e.resetEnv=e.resetEnv||!1,e.resetAll=e.resetAll||!1,e.preCode=e.preCode||"",e.nakoGlobal=e.nakoGlobal||null,e}class de{constructor(e){void 0===e&&(e={useBasicPlugin:!0}),this.__varslist=[{},{},{}],this.__locals={},this.__self=this,this.__vars=this.__varslist[2],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.version=se.Z.version,this.coreVersion=se.Z.version,this.__globals=[],this.__globalObj=null,this.__module={},this.pluginFunclist={},this.funclist={},this.pluginfiles={},this.commandlist=new Set,this.nakoFuncList={},this.eventList=[],this.codeGenerateor={},this.debugOption={useDebug:!1,waitTime:0},this.logger=new te,this.filename="main.nako3",this.dependencies={},this.usedFuncs=new Set,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins(),this.prepare=w.getInstance(),this.parser=new g(this.logger),this.lexer=new m(this.logger),this.lexer.setFuncList(this.funclist)}getModList(){return this.lexer.modList}getLogger(){return this.logger}getNakoFuncList(){return this.nakoFuncList}getNakoFunc(e){return this.nakoFuncList[e]}getPluginfiles(){return this.pluginfiles}addBasicPlugins(){this.addPluginObject("PluginSystem",re.Z),this.addPluginObject("PluginMath",ie),this.addPluginObject("PluginPromise",fe),this.addPluginObject("PluginAssert",le),this.addPluginObject("PluginCSV",ae)}replaceLogger(){return this.lexer.logger=this.parser.logger=this.logger=new te}static listRequireStatements(e){const t=[];for(let n=0;n+2<e.length;n++)"not"!==e[n].type||"string"!==e[n+1].type&&"string_ex"!==e[n+1].type||"取込"!==e[n+2].value||(t.push({...e[n],start:n,end:n+3,value:e[n+1].value+"",firstToken:e[n],lastToken:e[n+2]}),n+=2);return t}_loadDependencies(e,t,n,s){const i={},o=new de({useBasicPlugin:!0}),u=(e,t)=>{const n=s.readJs(e.filePath,e.firstToken);t.push(n.task.then((t=>{const n=t();this.addPluginFile(e.value,e.filePath,n,!1),i[e.filePath].funclist=n,i[e.filePath].addPluginFile=()=>{this.addPluginFile(e.value,e.filePath,n,!1)}})))},c=(e,t)=>{const n=s.readNako3(e.filePath,e.firstToken),r=t=>{const n=m.filenameToModName(e.filePath);t=`『${n}』に名前空間設定;『${n}』にプラグイン名設定;`+t+";名前空間ポップ;";const s=this.rawtokenize(t,0,e.filePath);i[e.filePath].tokens=s;const r={};return m.preDefineFunc(he(s),this.logger,r),i[e.filePath].funclist=r,a(t,e.filePath,"")};t.push(n.task.then((e=>r(e))))},a=(e,t,n)=>{const a=[],f=de.listRequireStatements(o.rawtokenize(e,0,t,n)).map((e=>({...e,...s.resolvePath(e.value,e.firstToken,t)})));for(const e of f)if(i.hasOwnProperty(e.filePath))i[e.filePath].alias.add(e.value);else if(i[e.filePath]={tokens:[],alias:new Set([e.value]),addPluginFile:()=>{},funclist:{}},"js"===e.type||"mjs"===e.type)u(e,a);else{if("nako3"!==e.type)throw new r.l0(`ファイル『${e.value}』を読み込めません。ファイルが存在しないか未対応の拡張子です。`,e.firstToken.file,e.firstToken.line);c(e,a)}if(a.length>0)return Promise.all(a)};try{const s=a(e,t,n);return void 0!==s&&s.catch((e=>{this.logger.error(e.msg),this.numFailures++})),this.dependencies=i,s}catch(e){throw this.logger.error(""+e),e}}rawtokenize(e,t,n,s=""){if(!e.startsWith(s))throw new Error("codeの先頭にはpreCodeを含める必要があります。");const i=m.filenameToModName(n),o=this.getModList();o.indexOf(i)<0&&o.unshift(i);const u=this.prepare.convert(e),c=new W(e.length,u),a=new X(e,[],[]),f=new Y(e);let l;try{l=this.lexer.tokenize(u.map((e=>e.text)).join(""),t,n)}catch(e){if(!(e instanceof r.cg))throw e;const t=a.map(c.map(e.preprocessedCodeStartOffset),c.map(e.preprocessedCodeEndOffset)),i=null===t.startOffset?e.line:f.map(t.startOffset,!1).line,o=z({...t,line:i},s);throw new r.tO(e.msg,o.startOffset,o.endOffset,o.line,n)}return l=q(l),l=P(l),l=E(l),l=function(e){const t=F(e,"eol"),n=[];let s=-1,r=0,i=0;const o=e=>{e.forEach((e=>{"{"===e.type&&r++,"}"===e.type&&r--,"["===e.type&&i++,"]"===e.type&&i--}))};for(let e=0;e<t.length;e++){const u=t[e];if(N(u))continue;const c=M(u);if(r>0||i>0){o(u);continue}if(s>=0){const r=c.indent;for(;s>=r;){const i=c;if(x(i)&&s===r||(t[e-1].push(O("ここまで","ここまで",i)),t[e-1].push(O("eol","\n",i))),n.pop(),!(n.length>0)){s=-1;break}s=n[n.length-1]}}if(o(u),r>0||i>0)continue;const a=C(u);":"===a.type&&(t[e]=t[e].filter((e=>e!==a)),s=a.indent,n.push(s))}if(t.length>0&&n.length>0){let s=e[0];for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.length>0){s=n[n.length-1];break}}for(let e=0;e<n.length;e++)t[t.length-1].push(O("ここまで","ここまで",s)),t[t.length-1].push(O("eol","\n",s))}return A(t)}(l),l=l.map((e=>{const t=a.map(c.map(e.preprocessedCodeOffset||0),c.map((e.preprocessedCodeOffset||0)+(e.preprocessedCodeLength||0)));let n=e.line,r=0;if("eol"===e.type&&null!==t.endOffset){const e=f.map(t.endOffset,!1);n=e.line,r=e.column}else if(null!==t.startOffset){const e=f.map(t.startOffset,!1);n=e.line,r=e.column}return{...e,...z({line:n,column:r,startOffset:t.startOffset,endOffset:t.endOffset},s),rawJosi:e.josi}})),l}converttoken(e,t,n){return this.lexer.replaceTokens(e,t,n)}reset(e){e&&!e.needToClearPlugin||this.clearPlugins(),this.__varslist=[this.__varslist[0],{},{}],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals={},this.funclist={};for(const e of Object.keys(this.__v0)){const t=this.pluginFunclist[e];t&&(this.funclist[e]=JSON.parse(JSON.stringify(t)))}this.lexer.setFuncList(this.funclist),this.logger.clear()}lexCodeToken(e,t,n,s){let r=this.rawtokenize(e,t,n,"");if(null===s)for(const e of r)e.startOffset=void 0,e.endOffset=void 0;else for(const e of r)void 0!==e.startOffset&&(e.startOffset+=s),void 0!==e.endOffset&&(e.endOffset+=s);const i=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));return r=this.converttoken(r,!1,n),{tokens:r,commentTokens:i}}replaceRequireStatements(e,t=new Set){const n=[];for(const s of de.listRequireStatements(e).reverse()){if(t.has(s.value)){n.push(...e.splice(s.start||0,(s.end||0)-(s.start||0)));continue}const i=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(s.value)));if(void 0===i){if(!s.firstToken)throw new Error(`ファイル『${s.value}』が読み込まれていません。`);throw new r.tO(`ファイル『${s.value}』が読み込まれていません。`,s.firstToken.startOffset||0,s.firstToken.endOffset||0,s.firstToken.line,s.firstToken.file)}this.dependencies[i].addPluginFile();const o=he(this.dependencies[i].tokens);t.add(s.value),n.push(...this.replaceRequireStatements(o,t)),n.push(...e.splice(s.start||0,(s.end||0)-(s.start||0),...o))}return n}removeRequireStatements(e){const t=[];for(const n of de.listRequireStatements(e).reverse()){const s=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(n.value)));void 0!==s&&this.dependencies[s].addPluginFile(),t.push(...e.splice(n.start||0,(n.end||0)-(n.start||0)))}return t}lex(e,t="main.nako3",n="",s=!1){let r=this.rawtokenize(e,0,t,n);const i=s?this.removeRequireStatements(r):this.replaceRequireStatements(r,void 0);for(const e of i)"word"!==e.type&&"not"!==e.type||(e.type="require");if(i.length>=3)for(let e=0;e<i.length;e+=3){let t=i[e+1].value;t=m.filenameToModName(t),this.lexer.modList.indexOf(t)<0&&this.lexer.modList.push(t)}const o=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));r=this.converttoken(r,!0,t);for(let e=0;e<r.length;e++)if(r[e]&&"code"===r[e].type){const n=this.lexCodeToken(r[e].value,r[e].line,t,r[e].startOffset||0);o.push(...n.commentTokens),r.splice(e,1,...n.tokens),e--}return this.logger.trace("--- lex ---\n"+JSON.stringify(r,null,2)),{commentTokens:o,tokens:r,requireTokens:i}}parse(e,t,n=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist);const s=this.lex(e,t,n);let i;try{this.parser.genMode="sync",i=this.parser.parse(s.tokens,t)}catch(e){if("number"!=typeof e.startOffset)throw r.ih.fromNode(e.message,s.tokens[this.parser.getIndex()]);throw e}return this.usedFuncs=this.parser.usedFuncs,this.deleteUnNakoFuncs(),this.logger.trace("--- ast ---\n"+JSON.stringify(i,null,2)),i}getUsedFuncs(e){const t=[e];for(this.usedFuncs=new Set;t.length>0;){const e=t.pop();null!=e&&null!==e.block&&void 0!==e.block&&this.getUsedAndDefFuncs(t,JSON.parse(JSON.stringify(e.block)))}return this.deleteUnNakoFuncs()}getUsedAndDefFuncs(e,t){for(;t.length>0;){const n=t.pop();null!=n&&this.getUsedAndDefFunc(n,e,t)}}getUsedAndDefFunc(e,t,n){["func","func_pointer"].includes(e.type)&&null!==e.name&&void 0!==e.name&&this.usedFuncs.add(e.name),t.push([e,e.block]),n.push.apply(n,[e.value].concat(e.args))}deleteUnNakoFuncs(){for(const e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,n=!1,s=""){const r=pe();r.testOnly=n,r.preCode=s;return this.compileFromCode(e,t,r).runtimeEnv}compileFromCode(e,t,n){""===t&&(t="main.nako3"),void 0===n&&(n=pe());try{n.resetEnv&&this.reset(),n.resetAll&&this.clearPlugins(),this.eventList.filter((e=>"beforeParse"===e.eventName)).map((t=>t.callback(e)));const s=this.parse(e,t,n.preCode);this.eventList.filter((e=>"beforeGenerate"===e.eventName)).map((e=>e.callback(s)));const r=this.generateCode(s,new S.un(n.testOnly));return this.eventList.filter((e=>"afterGenerate"===e.eventName)).map((e=>e.callback(r))),r}catch(e){throw this.logger.error(e),e}}generateCode(e,t){const n=e.genMode||"";if("sync"===n)return(0,S.Im)(this,e,t);if("非同期モード"===n)return this.logger.warn("『!非同期モード』の利用は非推奨です。[詳細](https://github.com/kujirahand/nadesiko3/issues/1164)"),j.g.generate(this,e,t.isTest);const s=this.codeGenerateor[n];if(!s)throw new Error(`コードジェネレータの「${n}」はサポートされていません。`);return s.generate(this,e,t.isTest)}addCodeGenerator(e,t){this.codeGenerateor[e]=t}async _run(e,t,n,s,r=""){const i=pe({resetEnv:n,resetAll:n,testOnly:s,preCode:r});return this._runEx(e,t,i)}clearPlugins(){this.__globals.forEach((e=>{e.__varslist[0].forceClose=!0,e.reset()})),this.__globals=[]}evalJS(e,t){this.eventList.filter((e=>"beforeRun"===e.eventName)).map((e=>e.callback(t))),this.__globalObj=t,this.__globalObj.lastJSCode=e;try{new Function(e).apply(t)}catch(e){throw t.numFailures++,this.getLogger().error(e),e}this.eventList.filter((e=>"finish"===e.eventName)).map((e=>e.callback(t)))}runSync(e,t,n){n=pe(n);const s=this.compileFromCode(e,t,n),r=this.getNakoGlobal(n,s.gen,t);return this.evalJS(s.runtimeEnv,r),r}async runAsync(e,t,n){n=pe(n);const s=this.compileFromCode(e,t,n),r=this.getNakoGlobal(n,s.gen,t);return this.evalJS(s.runtimeEnv,r),r}getNakoGlobal(e,t,n){let s=e.nakoGlobal;return s||(s=this.__globals.length>0&&!1===e.resetAll&&!1===e.resetEnv?this.__globals[this.__globals.length-1]:new ne(this,t,this.__globals.length+1),s.__varslist[0]["名前空間"]=m.filenameToModName(n)),this.__globals.indexOf(s)<0&&this.__globals.push(s),s}addListener(e,t){this.eventList.push({eventName:e,callback:t})}test(e,t,n="",s=!1){const r=pe();return r.preCode=n,r.testOnly=s,this.runSync(e,t,r)}run(e,t="main.nako3",n=""){const s=pe();return s.preCode=n,this.runSync(e,t,s)}compileStandalone(e,t,n=null){null===n&&(n=new S.un);const s=this.parse(e,t);return this.generateCode(s,n).standalone}addPlugin(e,t=!0){const n=this.__varslist[0];void 0===n.meta&&(n.meta={});for(const s in e){const r=e[s];if(this.funclist[s]=r,t&&(this.pluginFunclist[s]=JSON.parse(JSON.stringify(r))),"func"===r.type)n[s]=r.fn;else{if("const"!==r.type&&"var"!==r.type)throw console.error("[プラグイン追加エラー]",r),new Error("プラグインの追加でエラー。");n[s]=r.value,n.meta[s]={readonly:"const"===r.type}}"初期化"!==s&&"!"!==s.substring(0,1)&&this.commandlist.add(s)}}addPluginObject(e,t,n=!0){if(this.__module[e]=t,this.pluginfiles[e]="*","object"==typeof t["初期化"]){const n=t["初期化"];delete t["初期化"];t[`!${e}:初期化`]=n}if(t.meta&&t.meta.value&&"object"==typeof t.meta){const n=t.meta;delete t.meta;t[`__${n.value.pluginName||e}`.replace("-","__")]=n}this.addPlugin(t,n)}addPluginFile(e,t,n,s=!0){e.indexOf("\\")>=0&&(e=e.replace(/\\/g,"/")),this.addPluginObject(e,n,s),void 0===this.pluginfiles[e]&&(this.pluginfiles[e]=t)}addFunc(e,t,n,s=!0,r=!1){this.funclist[e]={josi:t,fn:n,type:"func",return_none:s,asyncFn:r},this.pluginFunclist[e]=he(this.funclist[e]),this.__varslist[0][e]=n}setFunc(e,t,n,s=!0,r=!1){this.addFunc(e,t,n,s,r)}getFunc(e){return this.funclist[e]}_runEx(e,t,n,s="",r){return n.preCode=s,r&&(n.nakoGlobal=r),this.runSync(e,t,n)}runEx(e,t,n,s=""){return this._runEx(e,t,n,s)}async runReset(e,t="main.nako3",n=""){const s=pe({resetAll:!0,resetEnv:!0});return this._runEx(e,t,s,n)}}var _e={"HTTP取得":{type:"func",josi:[["の","から","を"]],pure:!0,asyncFn:!0,fn:async function(e,t){return t.__exec("AJAXテキスト取得",[e,t])}},"AJAX受信":{type:"func",josi:[["から","を"]],pure:!0,asyncFn:!0,fn:async function(e,t){return t.__exec("AJAXテキスト取得",[e,t])}},"AJAX受信時":{type:"func",josi:[["で"],["から","を"]],pure:!0,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"AJAX送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,asyncFn:!0,fn:async function(e,t){return t.__exec("AJAXテキスト取得",[e,t])}},"AJAX送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!0,fn:function(e,t,n){let s=n.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(t,s).then((e=>200!==e.status?n.__v0["AJAX:ONERROR"](e.status):e.text())).then((t=>{n.__v0["対象"]=t,e(t,n)})).catch((e=>{n.__v0["AJAX:ONERROR"](e)}))},return_none:!0},"AJAXオプション":{type:"const",value:""},"AJAXオプション設定":{type:"func",josi:[["に","へ","と"]],pure:!0,fn:function(e,t){t.__v0["AJAXオプション"]=e},return_none:!0},"AJAXオプションPOST設定":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){const n={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.__exec("POSTデータ生成",[e,t])};t.__v0["AJAXオプション"]=n},return_none:!0},"AJAX失敗時":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){t.__v0["AJAX:ONERROR"]=e}},"AJAXテキスト取得":{type:"func",josi:[["から","を"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.text()},return_none:!1},"AJAX_JSON取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.json()},return_none:!1},"AJAXバイナリ取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.blob()},return_none:!1},"GET送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!1,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"POST送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n,s){const r=s.__exec("POSTデータ生成",[n,s]);fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTフォーム送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n,s){const r=new FormData;for(const e in n)r.set(e,n[e]);fetch(t,{method:"POST",body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTデータ生成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=[];for(const t in e){const s=e[t],r=encodeURIComponent(t)+"="+encodeURIComponent(s);n.push(r)}return n.join("&")}},"POST送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,asyncFn:!0,fn:function(e,t,n){return new Promise(((s,r)=>{const i=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then((e=>e.text())).then((e=>{s(e)})).catch((e=>{r(e.message)}))}))}},"POSTフォーム送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,asyncFn:!0,fn:function(e,t,n){return new Promise(((n,s)=>{const r=new FormData;for(const e in t)r.set(e,t[e]);fetch(e,{method:"POST",body:r}).then((e=>e.text())).then((e=>{n(e)})).catch((e=>{s(e.message)}))}))}},"AJAX保障送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){let n=t.__v0["AJAXオプション"];return""===n&&(n={method:"GET"}),fetch(e,n)},return_none:!1},"HTTP保障取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){return t.__exec("AJAX保障送信",[e,t])},return_none:!1},"POST保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=n.__exec("POSTデータ生成",[t,n]);return fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})},return_none:!1},"POSTフォーム保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=new FormData;for(const e in t)s.set(e,t[e]);return fetch(e,{method:"POST",body:s})},return_none:!1},"AJAX内容取得":{type:"func",josi:[["から"],["で"]],pure:!0,fn:function(e,t,n){return"TEXT"===(t=t.toString().toUpperCase())||"テキスト"===t?e.text():"JSON"===t?e.json():"BLOB"===t?e.blob():"ARRAY"===t||"配列"===t?e.arrayBuffer():"BODY"===t||"本体"===t?e.body:e.body()},return_none:!1},"BLOB作成":{type:"func",josi:[["を","から"],["で"]],pure:!0,fn:function(e,t){return e instanceof Array||(e=[e]),new Blob(e,t)}},"AJAX逐次送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX逐次送信』は『逐次実行』構文内で利用する必要があります。");t.resolveCount++;const n=t.resolve,s=t.reject;let r=t.__v0["AJAXオプション"];""===r&&(r={method:"GET"}),fetch(e,r).then((e=>e.text())).then((e=>{t.__v0["対象"]=e,n()})).catch((e=>{s(e.message)}))},return_none:!0},"HTTP逐次取得":{type:"func",josi:[["の","から","を"]],pure:!1,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP逐次取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"POST逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POSTフォーム逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム逐次送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=new FormData;for(const e in t)i.set(e,t[e]);fetch(e,{method:"POST",body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0}};const ye={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){"undefined"==typeof self&&(self={}),"undefined"==typeof navigator&&(navigator={}),e.__v0["AJAX:ONERROR"]=e=>{console.log(e)},e.__v0.SELF=self,e.__v0.NAVIGATOR=navigator}}};[{"水色":{type:"const",value:"aqua"},"紫色":{type:"const",value:"fuchsia"},"緑色":{type:"const",value:"lime"},"青色":{type:"const",value:"blue"},"赤色":{type:"const",value:"red"},"黄色":{type:"const",value:"yellow"},"黒色":{type:"const",value:"black"},"白色":{type:"const",value:"white"},"茶色":{type:"const",value:"maroon"},"灰色":{type:"const",value:"gray"},"金色":{type:"const",value:"gold"},"黄金色":{type:"const",value:"gold"},"銀色":{type:"const",value:"silver"},"白金色":{type:"const",value:"silver"},"オリーブ色":{type:"const",value:"olive"},"ベージュ色":{type:"const",value:"beige"},"アリスブルー色":{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["と"],["と"],["で","の"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)},return_none:!1},"色混":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};if(!e)throw new Error("『色混ぜる』の引数には配列を指定します");if(e.length<3)throw new Error("『色混ぜる』の引数には[RR,GG,BB]形式の配列を指定します");return"#"+t(e[0])+t(e[1])+t(e[2])},return_none:!1}},_e,{"HTML変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}},"クリップボード設定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){if(navigator.clipboard)navigator.clipboard.writeText(e);else{const t=document.createElement("div"),n=document.createElement("pre");n.style.webkitUserSelect="auto",n.style.userSelect="auto",t.appendChild(n).textContent=e,t.style.position="fixed",t.right="200%",document.body.appendChild(t),document.getSelection().selectAllChildren(t),document.execCommand("copy"),document.body.removeChild(t)}},return_none:!0},"クリップボード取得時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!navigator.clipboard)throw new Error("Clipbard APIが利用できません。");"string"==typeof e&&(e=t.__findFunc(e,"クリップボード取得時"));navigator.clipboard.readText().then((n=>{t.__v0["対象"]=n,e(t)}))}}},{"WS接続完了時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONOPEN"]=e},return_none:!0},"WS受信時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONMESSAGE"]=e},return_none:!0},"WSエラー発生時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONERROR"]=e},return_none:!0},"WS接続":{type:"func",josi:[["に","へ","の"]],pure:!0,fn:function(e,t){const n=new WebSocket(e);return n.onopen=()=>{const e=t.__v0["WS:ONOPEN"];e&&e(t)},n.onerror=e=>{const n=t.__v0["WS:ONERROR"];n&&n(e,t),console.log("WSエラー",e)},n.onmessage=e=>{t.__v0["対象"]=e.data;const n=t.__v0["WS:ONMESSAGE"];n&&n(t)},t.__v0["WS:SOCKET"]=n,n}},"WS送信":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__v0["WS:SOCKET"].send(e)}},"WS切断":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0["WS:SOCKET"].close()}}}].forEach((e=>{const t={};Object.assign(t,e),void 0!==t["初期化"]&&delete t["初期化"],Object.assign(ye,t)}));var me=ye;var ge={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0.SELF=self||{},e.__v0["依頼主"]=self||{}}},"対象イベント":{type:"const",value:""},"受信データ":{type:"const",value:""},SELF:{type:"const",value:""},"依頼主":{type:"const",value:""},"NAKOワーカーデータ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),t.__varslist[0]["PluginWorker:ondata"]=(n,s)=>(t.__v0["受信データ"]=n,t.__v0["対象イベント"]=s,e(s,t))},return_none:!0},"ワーカーメッセージ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),self.onmessage=n=>(t.__v0["受信データ"]=n.data,t.__v0["対象イベント"]=n,e(n,t))},return_none:!0},"NAKOワーカーデータ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"data",data:e})},return_none:!0},"ワーカーメッセージ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage(e)},return_none:!0},"表示":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"output",data:e})},return_none:!0},"終了":{type:"func",josi:[],pure:!0,fn:function(e){close()},return_none:!0}};class ve extends de{constructor(){super(),this.__varslist[0]["ナデシコ種類"]="wwnako3",this.__varslist[0]["PluginWorker:ondata"]=(e,t)=>{throw new Error("『NAKOワーカーデータ受信時』が呼ばれていません。")}}}if("object"==typeof navigator&&self&&self instanceof WorkerGlobalScope){const e=navigator.nako3=new ve;let t=e;e.addPluginObject("PluginBrowserInWorker",me),e.addPluginObject("PluginWorker",ge),e.getLogger().addListener("error",(function(e){self.postMessage({type:"error",data:e})}),!1),self.onmessage=n=>{const s=n.data||{type:"",data:""},r=s.type||"",i=s.data||"";switch(r){case"reset":e.reset();break;case"close":self.close();break;case"run":t=t.runEx(i,"_webworker.nako3",{resetEnv:!1,resetLog:!1});break;case"trans":i.forEach((t=>{"func"===t.type?(e.nakoFuncList[t.name]=t.content.meta,e.funclist[t.name]=t.content.func,e.__varslist[1][t.name]=()=>{}):"val"===t.type&&(e.__varslist[2][t.name]=t.content)}));break;case"data":t.__varslist[0]["PluginWorker:ondata"]&&t.__varslist[0]["PluginWorker:ondata"].apply(t,[i,n])}}}}()})();
|
|
1
|
+
(function(){"use strict";var __webpack_modules__={4228:function(e,t){t.Z={version:"3.3.79",major:3,minor:3,patch:79}},6297:function(e,t,n){n.d(t,{as:function(){return c},cg:function(){return i},ih:function(){return u},k:function(){return s},l0:function(){return a},t5:function(){return r},tO:function(){return o}});class s extends Error{constructor(e,t,n,s){const r=`${n||""}${void 0===s?"":`(${s+1}行目): `}`;super(`[${e}]${r}${t=t.replace(/『main__(.+?)』/g,"『$1』")}`),this.name="NakoError",this.type="NakoError",this.tag="["+e+"]",this.positionJa=r,this.msg=t}}class r extends s{constructor(e,t,n){super("インデントエラー",e,n,t),this.type="NakoIndentError",this.line=t,this.file=n}}class i extends s{constructor(e,t,n,s,r){super("字句解析エラー(内部エラー)",e,r,s),this.type="InternalLexerError",this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=n,this.line=s,this.file=r}}class o extends s{constructor(e,t,n,s,r){super("字句解析エラー",e,r,s),this.type="NakoLexerError",this.startOffset=t,this.endOffset=n,this.line=s,this.file=r}}class u extends s{constructor(e,t,n,s,r){super("文法エラー",e,r,t),this.type="NakoSyntaxError",this.file=r,this.line=t,this.startOffset=n,this.endOffset=s}static fromNode(e,t,n){if(!t)return new u(e,void 0,void 0,void 0,void 0);const s="number"==typeof t.startOffset?t.startOffset:void 0,r=n&&"number"==typeof n.endOffset?n.endOffset:"number"==typeof t.endOffset?t.endOffset:void 0;return new u(e,t.line,s,r,t.file)}}class c extends s{constructor(e,t){let n,r,i,o="unknown";"string"==typeof e?o=e:e instanceof c||e instanceof s?o=e.msg:e instanceof Error&&(o="Error"===e.name?e.message:`${e.name}: ${e.message}`),void 0===t?(n=void 0,r=void 0):(i=/^l(-?\d+):(.*)$/.exec(t))?(n=parseInt(i[1]),r=i[2]):(i=/^l(-?\d+)$/.exec(t))?(n=parseInt(i[1]),r="main.nako3"):(n=0,r=t),super("実行時エラー",o,r,n),this.type="NakoRuntimeError",this.lineNo=t,this.line=n,this.file=r}}class a extends s{constructor(e,t,n){super("取り込みエラー",e,t,n),this.file=t,this.line=n}}},9485:function(e,t,n){n.d(t,{Im:function(){return o},Jc:function(){return i},un:function(){return r}});var s=n(6297);class r{constructor(e=!1,t=[],n="",s=""){this.isTest=e,this.codeStandalone=n,this.codeEnv=s,this.importFiles=["plugin_system.mjs","plugin_math.mjs","plugin_csv.mjs","plugin_promise.mjs","plugin_test.mjs"];for(const e of t)this.importFiles.push(e)}}class i{constructor(e){this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestFuncs={},this.usedFuncSet=new Set,this.loopId=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0,mumeiId:0},this.warnUndefinedVar=!0,this.constPools=[],this.warnUndefinedReturnUserFunc=1,this.warnUndefinedCallingUserFunc=1,this.warnUndefinedCallingSystemFunc=1,this.warnUndefinedCalledUserFuncArgs=1,this.debugOption=e.debugOption}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}convLineno(e,t=!1,n=0){if(this.speedMode.lineNumbers>0)return"";let s;if(s="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line+n}`:`l${e.line+n}:${e.file}`,!t){if(s===this.lastLineNo)return"";this.lastLineNo=s}const r=JSON.stringify(s);let i="";return this.debugOption.useDebug&&(this.debugOption.messageAction&&(i+=`window.postMessage({action:'${this.debugOption.messageAction}',line: ${r}});`),e.line+n>=1&&this.debugOption.waitTime>0&&(i+=`await __v0['秒待'](${this.debugOption.waitTime},__self);`),i+="if(__v0.forceClose){return-1};"),`__v0.line=${r};`+i}varname(e){return 3===this.varslistSet.length?`__varslist[2][${JSON.stringify(e)}]`:i.isValidIdentifier(e)?e:`__vars[${JSON.stringify(e)}]`}static getFuncName(e){if(e.indexOf("__")>=0){const t=e.split("__");return`${t[0]}__${i.getFuncName(t[1])}`}let t=e.replace(/[ぁ-ん]+$/,"");return""===t&&(t=e),t}static convPrint(e){return`__print(${e});`}convRequire(e){const t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');\n`}getDefFuncCode(e,t){let n="";n+=`const nakoVersion = { version: ${JSON.stringify(e.version)} }\n`,n+="const __self = self;\n",n+="self.__self = self;\n",n+="const __varslist = self.__varslist;\n",n+="const __module = self.__module;\n",n+="const __v0 = self.__v0 = self.__varslist[0];\n",n+="const __v1 = self.__v1 = self.__varslist[1];\n",n+="const __vars = self.__vars = self.__varslist[2];\n",n+=`const __modList = self.__modList = ${JSON.stringify(e.getModList())}\n`,n+="__v0.line = 0;\n",n+="__v0.forceClose = false;\n",n+=`__v0.useDebug = ${this.debugOption.useDebug};\n`,n+="self.constPools = "+JSON.stringify(this.constPools)+";\n";let s="";for(const e in this.nakoFuncList){const t=this.nakoFuncList[e].fn;s+=`//[DEF_FUNC name='${e}' asyncFn=${this.nakoFuncList[e].asyncFn?"true":"false"}]\nself.__varslist[1]["${e}"]=${t};\n;//[/DEF_FUNC name='${e}']\n`}if(""!==s&&(n+="__v0.line='関数の定義';\n"+s),t.isTest){let e="const __tests = [];\n";for(const t in this.nakoTestFuncs){e+=`${this.nakoTestFuncs[t].fn};\n;`}""!==e&&(n+="__v0.line='テストの定義';\n",n+=e+"\n")}return n}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=[],n=e=>{if(!e.block)return;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const r=s[e];if("def_func"===r.type){if(!r.name)throw new Error("[System Error] 関数の定義で関数名が指定されていない");const e=r.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.varslistSet[1].names.add(e);const n=r.name.meta;this.nakoFuncList[e]={josi:n.josi,fn:()=>{},type:"func",asyncFn:r.asyncFn},t.push({name:e,node:r})}else if("speed_mode"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}else if("performance_monitor"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}}};n(e);const r=new Set;0===this.speedMode.invalidSore&&r.add("それ"),this.varsSet={isFunction:!1,names:r,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){const n=this.convLineno(e,!1)+this._convGen(e,!0);return t.isTest?"":n}_convGen(e,t){if(!e)return"";let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"block":if(!e.block)return n;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const t=s[e];n+=this._convGen(t,!1)}break;case"comment":case"eol":n+=this.convComment(e);break;case"break":n+=this.convCheckLoop(e,"break");break;case"continue":n+=this.convCheckLoop(e,"continue");break;case"end":n+="__v0['終'](__self);";break;case"number":n+=e.value;break;case"string":n+=this.convString(e);break;case"def_local_var":n+=this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.convDefLocalVarlist(e);break;case"let":n+=this.convLet(e);break;case"inc":n+=this.convInc(e);break;case"word":case"variable":n+=this.convGetVar(e);break;case"op":case"calc":n+=this.convOp(e);break;case"renbun":n+=this.convRenbun(e);break;case"not":n+="(("+this._convGen(e.value,!0)+")?0:1)";break;case"func":case"func_pointer":case"calc_func":n+=this.convCallFunc(e,t);break;case"if":n+=this.convIf(e);break;case"tikuji":n+=this.convTikuji(e);break;case"for":n+=this.convFor(e);break;case"foreach":n+=this.convForeach(e);break;case"repeat_times":n+=this.convRepeatTimes(e);break;case"speed_mode":n+=this.convSpeedMode(e,t);break;case"performance_monitor":n+=this.convPerformanceMonitor(e,t);break;case"while":n+=this.convWhile(e);break;case"atohantei":n+=this.convAtohantei(e);break;case"switch":n+=this.convSwitch(e);break;case"let_array":n+=this.convLetArray(e);break;case"配列参照":n+=this.convRefArray(e);break;case"json_array":n+=this.convJsonArray(e);break;case"json_obj":n+=this.convJsonObj(e);break;case"func_obj":n+=this.convFuncObj(e);break;case"bool":n+=e.value?"true":"false";break;case"null":n+="null";break;case"def_test":n+=this.convDefTest(e);break;case"def_func":n+=this.convDefFunc(e);break;case"return":n+=this.convReturn(e);break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}findVar(e){if(this.varslistSet.length>3&&this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:this.varname(e)};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n){if("引数"===e||"それ"===e||"対象"===e||"対象キー"===e);else if(this.warnUndefinedVar){const n=e.replace(/^main__(.+)$/,"$1");this.__self.getLogger().warn(`変数『${n}』は定義されていません。`,t)}return this.varsSet.names.add(e),this.varname(e)}if(0===n.i){const i=this.__self.getNakoFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi||0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;return this.genVar(t,e)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);const t=this.convLineno(e,!1);let n;if(e.value)n=this._convGen(e.value,!0);else{if(0!==this.speedMode.invalidSore)return t+"return;";n=this.varname("それ")}if(0===this.warnUndefinedReturnUserFunc)return t+`return ${n};`;{const s=this.constPools.length;return this.constPools.push({msg:"ユーザ関数からundefinedが返されています",file:e.file,line:e.line}),t+`return (__self.chk(${n}, ${s}));`}}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return this.convLineno(e)+t+";"}convDefFuncCommon(e,t){let n="",s="";if(0!==this.performanceMonitor.userFunction){let e=t;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),n=`const performanceMonitorEnd = (function (key, type) {\nconst uf_start = performance.now() * 1000;\nreturn function () {\nconst el_time = performance.now() * 1000 - uf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=el_time;\nif(__self.__performance_monitor[key].min_usec>el_time){__self.__performance_monitor[key].min_usec=el_time;}\nif(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_monitor[key].max_usec=el_time;}\n}};})('${e}', 'user');try {\n`,s="} finally { performanceMonitorEnd(); }\n"}let r="";const o=new Set;0===this.speedMode.invalidSore&&o.add("それ"),this.varsSet={isFunction:!0,names:o,readonly:new Set},this.varslistSet.push(this.varsSet),r+=" var 引数 = arguments;\n",r+=" var __vars = {};\n";const u=Array.from(this.varsSet.names.values());let c="";const a=t?e.name.meta:e.meta;for(let n=0;n<a.varnames.length;n++){const s=a.varnames[n];0===this.warnUndefinedCalledUserFuncArgs?c+=` ${this.varname(s)} = arguments[${n}];\n`:c+=t?` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('ユーザ関数(${t})の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`:` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('匿名関数の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`,this.varsSet.names.add(s)}t&&(this.usedFuncSet.add(t),this.varslistSet[1].names.add(t),void 0===this.nakoFuncList[t]&&(this.nakoFuncList[t]={josi:e.name.meta.josi,fn:()=>{},type:"func",asyncFn:!1}));const f=this.usedAsyncFn;this.usedAsyncFn=this.debugOption.useDebug;c+=this._convGen(e.block,!1).split("\n").map((e=>" "+e)).join("\n")+"\n",0===this.speedMode.invalidSore&&(c+=` return (${this.varname("それ")});\n`),c+=s,t&&this.usedAsyncFn&&(this.nakoFuncList[t].asyncFn=!0);for(const e of Array.from(this.varsSet.names.values()))u.includes(e)||i.isValidIdentifier(e)&&(r+=` var ${e};\n`);0===this.speedMode.invalidSore&&(i.isValidIdentifier("それ")?r+=" var それ = '';\n":r+=` ${this.varname("それ")} = '';`);return c=(this.usedAsyncFn?"(async function(){\n":"(function(){\n")+n+r+(" "+this.convLineno(e,!0,1)+"\n")+c+"",c+="})",t&&(this.nakoFuncList[t].fn=c,this.nakoFuncList[t].asyncFn=this.usedAsyncFn,a.asyncFn=this.usedAsyncFn),this.usedAsyncFn=f,this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],t&&(this.__self.__varslist[1][t]=c),c}convDefTest(e){const t=e.name.value;let n=`__tests.push({ name: '${t}', f: () => {\n`;return n+=` ${this._convGen(e.block,!1)}\n}});`,this.nakoTestFuncs[t]={josi:e.name.meta.josi,fn:n,type:"test_func"},""}convDefFunc(e){if(!e.name)return"";const t=i.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){return"{"+e.value.map((e=>`${this._convGen(e.key,!0)}:${this._convGen(e.value,!0)}`)).join(",")+"}"}convJsonArray(e){return"["+e.value.map((e=>this._convGen(e,!0))).join(",")+"]"}convRefArray(e){const t=this._convGen(e.name,!0),n=e.index;let s=t;if(!n)return s;for(let e=0;e<n.length;e++){s+="["+this._convGen(n[e],!0)+"]"}return s}convLetArray(e){const t=this._convGen(e.name,!0),n=e.index||[];let r="",i=t,o="";if(e.checkInit){const e="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";r+=`\n/*配列初期化*/if (!(${t} instanceof Array)) { ${t} = ${e}; /*console.log('初期化:${t}')*/ };`;for(let s=0;s<n.length-1;s++){o+=`[${this._convGen(n[s],!0)}]`,r+=`\n/*配列初期化${s}*/if (!(${t}${o} instanceof Array)) { ${t}${o} = ${e}; };`}r+="\n"}for(let e=0;e<n.length;e++){i+="["+this._convGen(n[e],!0)+"]"}let u=null;if(0===this.speedMode.invalidSore&&(u=this.varname("それ")),e.value&&(u=this._convGen(e.value,!0)),null==u)throw s.ih.fromNode("代入する先の変数名がありません。",e);i+=" = "+u+";\n";return this.convLineno(e,!1)+r+i}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.loopId++,s=`$nako_i${n}`,r=this._convGen(e.from,!0),i=this._convGen(e.to,!0),o=e.flagDown;let u="1";null===e.inc&&void 0!==e.inc&&"null"!==e.inc||(u=this._convGen(e.inc,!0));const c=this.convGenLoop(e.block),a=`$nako_from${n}`,f=`$nako_to${n}`;let l="";0===this.speedMode.invalidSore&&(l=`${this.varname("それ")} = `);const h=`\n//[FOR id=${n}]\nconst ${a} = ${r};\nconst ${f} = ${i};\nif (${a} <= ${f}) { // up\n for (let ${s} = ${a}; ${s} <= ${f}; ${s}+= ${u}) {\n ${l}${t} = ${s};\n ${c}\n };\n} else { // down\n if (${o}) { for (let ${s} = ${a}; ${s} >= ${f}; ${s}-= ${u}) {\n ${l}${t} = ${s};\n ${c}\n }\n };\n};\n//[/FOR id=${n}]\n`;return this.convLineno(e,!1)+h}convForeach(e){let t;if(null===e.target){if(0!==this.speedMode.invalidSore)throw s.ih.fromNode("『反復』の対象がありません。",e);t=this.varname("それ")}else t=this._convGen(e.target,!0);let n='__v0["対象"]';e.name&&(n=this.varname(e.name.value),this.varsSet.names.add(e.name.value));const r=this.convGenLoop(e.block),i=this.loopId++;let o="";0===this.speedMode.invalidSore&&(o=`${this.varname("それ")} = `);const u=`let $nako_foreach_v${i}=${t};\nfor (let $nako_i${i} in $nako_foreach_v${i}){\n if ($nako_foreach_v${i}.hasOwnProperty($nako_i${i})) {\n ${n} = ${o}$nako_foreach_v${i}[$nako_i${i}];\n __v0["対象キー"] = $nako_i${i};\n ${r}\n }\n};\n`;return this.convLineno(e,!1)+u}convRepeatTimes(e){const t=this.loopId++,n=this._convGen(e.value,!0),s=this.convGenLoop(e.block);let r="";0===this.speedMode.invalidSore&&(r=`${this.varname("それ")} = `);const i=`let $nako_times_v${t} = ${n};\nfor(var $nako_i${t} = 1; $nako_i${t} <= $nako_times_v${t}; $nako_i${t}++){\n ${r}__v0["回数"] = $nako_i${t};\n `+s+"\n}\n";return this.convLineno(e,!1)+i}convSpeedMode(e,t){if(!e.options)return"";const n={...this.speedMode};e.options["行番号無し"]&&this.speedMode.lineNumbers++,e.options["暗黙の型変換無し"]&&this.speedMode.implicitTypeCasting++,e.options["強制ピュア"]&&this.speedMode.forcePure++,e.options["それ無効"]&&this.speedMode.invalidSore++;try{return this._convGen(e.block,t)}finally{this.speedMode=n}}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};if(!e.options)return"";e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.block,t)}finally{this.performanceMonitor=n}}convWhile(e){const t=`while (${this._convGen(e.cond,!0)}){\n ${this.convGenLoop(e.block)}\n}\n`;return this.convLineno(e,!1)+t}convAtohantei(e){const t=`$nako_i${this.loopId++}`,n=this._convGen(e.cond,!0),s=`for(;;) {\n ${this.convGenLoop(e.block)}\n let ${t} = ${n};\n if (${t}) { continue } else { break }\n}\n\n`;return this.convLineno(e,!1)+s}convSwitch(e){const t=this._convGen(e.value,!0),n=e.cases||[];let s="";for(let e=0;e<n.length;e++){const t=n[e][0],r=this.convGenLoop(n[e][1]);if("違えば"===t.type)s+=" default:\n";else{s+=` case ${this._convGen(t,!0)}:\n`}s+=` ${r}\n break\n`}const r=`switch (${t}){\n${s}\n}\n`;return this.convLineno(e,!1)+r}convIf(e){const t=this._convGen(e.expr,!0),n=this._convGen(e.block,!1),s=null===e.false_block?"":"else {"+this._convGen(e.false_block,!1)+"};\n";return this.convLineno(e,!1)+`if (${t}) {\n ${n}\n}`+s+";\n"}convTikuji(e){const t=`__tikuji${this.loopId++}`;let n=`const ${t} = []\n`;const s=e.blocks?e.blocks:[];for(let e=0;e<s.length;e++){const r=this._convGen(s[e],!1).replace(/\s+$/,"")+"\n";n+=`${t}.push(function(resolve, reject) {\n __self.resolve = resolve;\n __self.reject = reject;\n __self.resolveCount = 0;\n ${this.convLineno(s[e],!0)}\n ${r} if (__self.resolveCount === 0) resolve();\n}); // end of tikuji__\${pid}[{$i}]\n`}n+=`// end of ${t} \n`;let r=` ${t}.splice(0);\n __v0["エラーメッセージ"]=errMsg;\n`;if(null!=e.errorBlock){r+=this._convGen(e.errorBlock,!1).replace(/\s+$/,"")+"\n"}return n+=`const ${t}__reject = function(errMsg){\n${r}};\n`,n+="__self.resolve = undefined;\n",n+=`const ${t}__resolve = function(){\n`,n+=" setTimeout(function(){\n",n+=` if (${t}.length == 0) {return}\n`,n+=` const f = ${t}.shift()\n`,n+=` f(${t}__resolve, ${t}__reject);\n`,n+=" }, 0);\n",n+="};\n",n+=`${t}__resolve()\n`,this.convLineno(e,!1)+n}convFuncGetArgsCalcType(e,t,n){const s=[],r={},i=n.args?n.args:[];for(let e=0;e<i.length;e++){const t=i[e];0===e&&null===t&&0===this.speedMode.invalidSore?(s.push(this.varname("それ")),r.sore=!0):s.push(this._convGen(t,!0))}return[s,r]}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){const n=i.getFuncName(e.name),r=this.findVar(n);if(null===r)throw s.ih.fromNode(`関数『${n}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let o;if(0===r.i){if(o=this.__self.getFunc(n),!o)throw new Error(`[System Error] 関数「${n}」NakoCompiler.nakoFuncList の不整合があります。`);if("func"!==o.type)throw s.ih.fromNode(`『${n}』は関数ではありません。`,e)}else o=this.nakoFuncList[n],void 0===o&&(o={return_none:!1});if("func_pointer"===e.type)return r.js;const u=this.convFuncGetArgsCalcType(n,o,e),c=u[0],a=u[1];if(this.usedFuncSet.add(n),"名前空間設定"===n)return`\n// --- 名前空間(${c[0]}) ---\n__varslist[0]['名前空間設定'](${c[0]}, __self);__self.__modName=${c[0]};\n`;if("プラグイン名設定"===n)return`\n__varslist[0]['プラグイン名設定'](${c[0]}, __self);\n`;c.push("__self");let f="function",l="",h="";if(e.setter&&(l+=";__self.isSetter = true;\n",h+=";__self.isSetter = false;\n"),0===r.i&&this.varslistSet.length>3&&!0!==o.pure&&0===this.speedMode.forcePure){const e=[];for(const t of Array.from(this.varsSet.names.values()))i.isValidIdentifier(t)&&e.push({str:JSON.stringify(t),js:this.varname(t)});l+="__self.__locals = __vars;\n";for(const t of e)l+=`__self.__locals[${t.str}] = ${t.js};\n`;for(const t of e)"それ"!==t.js&&(h+=`${t.js} = __self.__locals[${t.str}];\n`)}a.sore&&(l+="/*[sore]*/");const p=(e,t)=>{let n="";for(const s of e.split("\n"))""!==s&&(n+=" ".repeat(t)+s+"\n");return n},d={TYPEOF:!0,"変数型確認":!0};let _;if(0===this.warnUndefinedCallingUserFunc&&0!==r.i||0===this.warnUndefinedCallingSystemFunc&&0===r.i)_=c.join(",");else{const t=[];c.forEach((s=>{if("__self"===s||!0===d[n])t.push(`${s}`);else{const i=this.constPools.length;0===r.i?this.constPools.push({msg:`命令『${n}』の引数にundefinedを渡しています。`,file:e.file,line:e.line}):this.constPools.push({msg:`ユーザ関数『『${n}』の引数にundefinedを渡しています。`,file:e.file,line:e.line});const o=""===s?'""':s;t.push(`(__self.chk(${o}, ${i}))`)}})),_=t.join(", ")}let y=`${r.js}(${_})`;if(o.asyncFn&&(f=`async ${f}`,y=`await ${y}`,this.numAsyncFn++,this.usedAsyncFn=!0),0===r.i&&0!==this.performanceMonitor.systemFunctionBody){let e=n;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),y=`(${f} (key, type) {\nconst sbf_start = performance.now() * 1000;\ntry {\nreturn `+y+";\n} finally {\nconst sbl_time = performance.now() * 1000 - sbf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sbl_time;\nif(__self.__performance_monitor[key].min_usec>sbl_time){__self.__performance_monitor[key].min_usec=sbl_time;}\nif(__self.__performance_monitor[key].max_usec<sbl_time){__self.__performance_monitor[key].max_usec=sbl_time;}\n"+`}}})('${n}_body', 'sysbody')\n`}let m="";if(o.return_none)m=""===h?""===l?`${y};\n`:`${l} ${y};\n`:`${l}try {\n${p(y,1)};\n} finally {\n${p(h,1)}}\n`;else{let n="";0===this.speedMode.invalidSore&&(n=`${this.varname("それ")} = `),m=""===l&&""===h?`(${n}${y})`:""===h?`(${f}(){\n${p(`${l};\nreturn ${n} ${y}`,1)}}).call(this)`:`(${f}(){\n${p(`${l}try {\n${p(`return ${n}${y};`,1)}\n} finally {\n${p(h,1)}}`,1)}}).call(this)`,("して"===e.josi||""===e.josi&&!t)&&(m+=";\n")}return 0===r.i&&0!==this.performanceMonitor.systemFunction&&(m="(function (key, type) {\nconst sf_start = performance.now() * 1000;\ntry {\nreturn "+m+";\n} finally {\nconst sl_time = performance.now() * 1000 - sf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sl_time;\nif(__self.__performance_monitor[key].min_usec>sl_time){__self.__performance_monitor[key].min_usec=sl_time;}\nif(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_monitor[key].max_usec=sl_time;}\n"+`}}})('${n}_sys', 'system')\n`),m}convRenbun(e){const t=this._convGen(e.right,!0);return`(function(){${this._convGen(e.left,!1)}; return ${t}}).call(this)`}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"};let n=e.operator||"",s=this._convGen(e.right,!0),r=this._convGen(e.left,!0);return"+"===n&&0===this.speedMode.implicitTypeCasting&&(e.left&&"number"!==e.left.type&&(r=`parseFloat(${r})`),e.right&&"number"!==e.right.type&&(s=`parseFloat(${s})`)),"^"===n?`(Math.pow(${r}, ${s}))`:"÷÷"===n?`(Math.floor(${r} / ${s}))`:(t[n]&&(n=t[n]),`(${r} ${n} ${s})`)}convInc(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("加算する先の変数名がありません。",e);const n=e.name.value;let r=this.findVar(n),i="";if(null===r&&(this.varsSet.names.add(n),r=this.findVar(n),!r))throw new Error("『増』または『減』で変数が見当たりません。");const o=r.js;return i+=`if (typeof(${o}) === 'undefined') { ${o} = 0; }`,i+=`${o} += ${t}`,";"+this.convLineno(e,!1)+i+"\n"}convLet(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("代入する先の変数名がありません。",e);const n=e.name.value,r=this.findVar(n);let i="";if(null===r)this.varsSet.names.add(n),i=`${this.varname(n)} = ${t};`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);i=`${r.js} = ${t};`}return";"+this.convLineno(e,!1)+i+"\n"}convDefLocalVar(e){const t=null===e.value?"null":this._convGen(e.value,!0),n=e.name.value,r=e.vartype;if(this.varsSet.names.has(n))throw s.ih.fromNode(`${r}『${n}』の二重定義はできません。`,e);this.varsSet.names.add(n),"定数"===r&&this.varsSet.readonly.add(n);const i=`${this.varname(n)}=${t};\n`;return this.convLineno(e,!1)+i}convDefLocalVarlist(e){let t="";const n=e.vartype,s=null===e.value?"null":this._convGen(e.value,!0);this.loopId++;const r=`$nako_i${this.loopId}`;t+=`${r}=${s}\n`,t+=`if (!(${r} instanceof Array)) { ${r}=[${r}] }\n`;const i=e.names?e.names:[];for(let e=0;e<i.length;e++){const s=i[e].value;this.varsSet.names.has(s),this.varsSet.names.add(s),"定数"===n&&this.varsSet.readonly.add(s);t+=`${this.varname(s)}=${r}[${e}];\n`}return this.convLineno(e,!1)+t}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n){const n=(t,n)=>'"+'+this.genVar(n,e)+'+"';t=t.replace(/\{(.+?)\}/g,n),t=t.replace(/{(.+?)}/g,n)}return'"'+t+'"'}convTryExcept(e){const t=this._convGen(e.block,!1),n=this._convGen(e.errBlock,!1);return this.convLineno(e,!1)+`try {\n${t}\n} catch (e) {\n __v0["エラーメッセージ"] = e.message;\n;\n`+`${n}}\n`}getUsedFuncSet(){return this.usedFuncSet}getPluginInitCode(){let e="",t="";for(const e in this.__self.__module){const n=`!${e}:初期化`;this.varslistSet[0].names.has(n)&&(this.usedFuncSet.add(`!${e}:初期化`),t+=`__v0["!${e}:初期化"](__self);\n`)}return""!==t&&(e+="__v0.line='l0:プラグインの初期化';\n"+t),e}}function o(e,t,n){const s=new i(e);s.registerFunction(t);let r=s.convGen(t,n);const o=s.getDefFuncCode(e,n),u=(new Date).getTime()+"_"+Math.floor(4294967295*Math.random());if(r&&n.isTest&&(r+="\n__self._runTests(__tests);\n"),s.numAsyncFn>0||s.debugOption.useDebug){const e="__eval_nako3async_"+u+"__";r=`\n// --------------------------------------------------\n// <nadesiko3::gen::async id="${u}" times="${s.numAsyncFn}">\nasync function ${e}(self) {\n${o}\n${r}\n} // end of ${e}\n${e}.call(self, self)\n.then(() => {\n // ok\n})\n.catch(err => {\n if (err.message === '__終わる__') { return }\n self.numFailures++\n throw self.logger.runtimeError(err, self.__v0.line)\n})\n// </nadesiko3::gen::async id="${u}">\n// --------------------------------------------------\n`}else{const e="__eval_nako3sync_"+u+"__";r=`\n// --------------------------------------------------\n// <nadesiko3::gen::syncMode>\nfunction ${e}(self) {\ntry {\n ${o}\n ${r}\n} catch (err) {\n if (err.message === '__終わる__') { return }\n self.numFailures++\n throw self.logger.runtimeError(err, self.__v0.line)\n}\n} // end of ${e}\n${e}(self)\n// </nadesiko3::gen::syncMode>\n// --------------------------------------------------\n`}e.getLogger().trace("--- generate ---\n"+r);let c="";const a=[];for(const e of n.importFiles){if("nako_errors.mjs"===e)continue;const t="nako3runtime_"+e.replace(/\.(js|mjs)$/,"").replace(/[^a-zA-Z0-9_]/g,"_");a.push(t),c+=`import ${t} from './nako3runtime/${e}'\n`}const f=`// <standaloneCode>\nimport path from 'path'\nimport { NakoRuntimeError } from './nako3runtime/nako_errors.mjs'\n${c}\nconst self = {}\nself.coreVersion = '${e.coreVersion}'\nself.version = '${e.version}'\nself.logger = {\n error: (message) => { console.error(message) },\n warn: (message) => { console.warn(message) },\n send: (level, message) => { console.log(message) },\n};\nself.__varslist = [{}, {}, {}]\nself.__v0 = self.__varslist[0]\nself.initFuncList = []\nself.clearFuncList = []\n// Copy module functions\nfor (const mod of [${a.join(", ")}]) {\n for (const funcName in mod) {\n if (funcName === '初期化') {\n self.initFuncList.push(mod[funcName].fn)\n continue\n }\n if (funcName === '!クリア') {\n self.clearFuncList.push(mod[funcName].fn)\n continue\n }\n self.__varslist[0][funcName] = mod[funcName].fn\n }\n}\nself.__vars = self.__varslist[2];\nself.__module = {};\nself.__locals = {};\nself.__genMode = 'sync';\n\n// プラグインの初期化コードを実行\nself.initFuncList.map(f => f(self))\n\ntry {\n${n.codeStandalone}\n// <JS:standalone>\n${r}\n// </JS:standalone>\n // standaloneCodeでは、即時プラグインのクリアコードを実行\n self.clearFuncList.map(f => f(self))\n} catch (err) {\n self.logger.error(err);\n throw err;\n}\n// </standaloneCode>\n`,l=s.getPluginInitCode();return{runtimeEnv:`\n// <runtimeEnvCode>\nconst self = this\n${n.codeEnv}\n${o}\n${l}\n${r}\n// </runtimeEnvCode>\n`,standalone:f,gen:s}}},8801:function(e,t,n){n.d(t,{g:function(){return g}});var s=n(6297),r=n(4228),i=n(9485);const o="NOP",u="LBL",c="EOL",a="JMP",f="JMP_T",l="JMP_F",h="CALL",p="CALL_OBJ",d="RET",_="TRY",y="CODE";class m{constructor(e,t){this.type=e,this.value=t,this.no=-1,this.tag=0}}class g{constructor(e){this.com=e,this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestList={},this.usedFuncSet=new Set,this.loopId=1,this.flagLoop=!1,this.codeId=0,this.codeArray=[],this.labelContinue=null,this.labelBreak=null,this.labels={},this.__self=e,this.genMode="非同期モード",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0}}static generate(e,t,n){const i=new g(e);i.registerFunction(t);let o=i.convGen(t,!!n);return o=i.getDefFuncCode(n)+o,e.getLogger().trace("--- generate(非同期モード) ---\n"+o),o&&n&&(o+="\n__self._runTests(__tests);\n"),{runtimeEnv:o,standalone:`const nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nthis.logger = {\n error(message) { console.error(message) },\n send(level, message) { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__labels = {};\nthis.__code = [];\nthis.__callstack = [];\nthis.__stack = [];\nthis.__genMode = '非同期モード';\ntry {\n ${i.getVarsCode()}\n ${o}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, this.__varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}`,gen:i}}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return`sys.__vars[${JSON.stringify(e)}]`}getVarsCode(){let e="";for(const t of Array.from(this.usedFuncSet.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n",t+="const __code = this.__code;\n";let n="";for(const e in this.nakoFuncList){n+=`//[DEF_FUNC name='${e}']\n__v1["${e}"]=${this.nakoFuncList[e].fn};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.usedFuncSet.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nakoTestList)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nakoTestList[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=e=>{for(let n=0;n<e.block.length;n++){const s=e.block[n];if("def_func"===s.type){const e=s.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.nakoFuncList[e]={josi:s.name.meta.josi,fn:"",type:"func"}}else("speed_mode"===s.type||"performance_monitor"===s.type)&&("block"===s.block.type?t(s.block):t(s))}};t(e);const n=new Set;0===this.speedMode.invalidSore&&n.add("それ"),this.varsSet={isFunction:!1,names:n,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){this._convGen(e,!0);const n=new Set([a,f,l,h,_]);let s=this.codeArray;{s=s.filter((e=>e.type!==o));const e=new Set;s.forEach((t=>{n.has(t.type)&&e.add(t.value)})),s=s.filter((t=>t.type!==u||(15===t.tag||e.has(t.value))));let t=0;for(;t<s.length-1;)s[t].type!==c||s[t+1].type!==c?t++:s.splice(t+1,1);this.codeArray=s}s.forEach(((e,t)=>{e.type===u&&(this.labels[e.value]=t)})),s.forEach((e=>{n.has(e.type)&&e.no<0&&(e.no=this.labels[e.value])}));let r="";return s.forEach(((e,t)=>{switch(e.type){case o:r+=`case ${t}: break; // [NOP] ${e.value}\n`;break;case u:r+=`case ${t}: break; // [LABEL] ${e.value}\n`;break;case c:r+=`case ${t}: ${e.value}; break; // [EOL]\n`;break;case a:r+=`case ${t}: sys.nextIndex = ${e.no}; break; // ${e.value}\n`;break;case f:r+=`case ${t}: if (sys.__stack.pop()) { sys.nextIndex = ${e.no};} break; // ${e.value}\n`;break;case l:r+=`case ${t}: if (!sys.__stack.pop()) { sys.nextIndex = ${e.no}} break; // ${e.value}\n`;break;case d:r+=`case ${t}: sys.__return(sys); break;\n`;break;case h:r+=`case ${t}: sys.__call(${e.no}, sys); break; // ${e.value}\n`;break;case p:r+=`case ${t}: sys.__callObj('${e.value}', ${t}, sys); break; // ${e.value}\n`;break;case _:r+=`case ${t}: sys.tryIndex = ${e.no}; break; // TRY \n`;break;case y:{const n=e.value.replace(/\s+$/,"");r+=`case ${t}: {\n${n}\n};break;\n`;break}default:throw new Error("invalid code type")}})),r=`\n //-------------------------\n // main_code\n this.__labels = ${JSON.stringify(this.labels)};\n this.nextAsync = (sys) => {\n if (sys.index >= sys.codeSize || sys.index < 0) {return}\n const __v0 = sys.__v0\n try {\n sys.inLoop = true\n while (sys.index < sys.codeSize && sys.index >= 0) {\n // console.log('@@[run]', sys.index)\n switch (sys.index) {\n // --- CODE.BEGIN ---\n ${r}\n // --- CODE.END ---\n default:\n sys.inLoop = false\n console.log(sys.index, sys.__stack)\n throw new Error('Invalid sys.index:' + sys.index)\n break\n }\n // check next\n if (sys.nextIndex >= 0) {\n sys.index = sys.nextIndex\n sys.nextIndex = -1\n } else {\n sys.index++\n }\n if (sys.async) {\n sys.__saveSysenv(sys)\n sys.async = false\n break\n }\n } // end of while\n sys.inLoop = false\n } catch (e) {\n sys.__errorAsync(e, sys)\n }\n }\n this.__errorAsync = (e, sys) => { // エラーが起きた時呼び出す\n sys.__v0["エラーメッセージ"] = e.message;\n if (e.message == '__終わる__') {\n sys.__stopAsync(sys)\n return\n }\n if (sys.tryIndex >= 0) {\n sys.index = sys.tryIndex;\n setTimeout(() => {sys.nextAsync(sys)}, 1)\n } else {\n throw e\n }\n }\n this.__call = (no, sys) => {\n const info = {lastVars:sys.__vars, backNo: this.index + 1}\n sys.__callstack.push(info);\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.nextIndex = no;\n }\n this.__return = sys => {\n if (sys.__callstack.length === 0) {\n sys.__destroySysenv(sys, sys.curSysenv.envid)\n sys.index = -2\n sys.nextIndex = -1\n return\n }\n const sore = sys.__vars['それ'];\n sys.__varslist.pop();\n const info = sys.__callstack.pop();\n sys.nextIndex = info.backNo;\n sys.__vars = info.lastVars;\n sys.__vars['それ'] = sore\n sys.__stack.push(sore);\n }\n this.__resetAsync = sys => {\n sys.index = 0\n sys.codeSize = ${s.length};\n sys.async = false\n sys.nextIndex = -1\n sys.tryIndex = -1\n }\n this.__stopAsync = sys => {\n sys.__resetAsync(sys)\n sys.index = -1 // force stop!!\n }\n this.__callNakoCode = (no, backNo, sys) => {\n this.__call(backNo, sys)\n sys.nextIndex = no\n const sysenv = sys.setAsync(sys)\n setTimeout(() => {\n // console.log('//__callNakoCode, back=', backNo, 'no=', no)\n sys.compAsync(sys, sysenv)\n } ,1)\n }\n this.__callNakoCodeEntry = (no, sys) => {\n sys.__saveSysenv(sys)\n sys.curSysenv = sys.__generateSysenv(sys)\n sys.__restoreSysenv(sys)\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.index = no;\n sys.nextAsync(sys)\n }\n this.__callObj = (vname, curNo, sys) => {\n if (sys.__vars[vname]) {\n const fname = sys.__vars[vname]\n // console.log(sys.__labels)\n if (fname && sys.__labels[fname]) {\n const no = sys.__labels[fname]\n sys.__call(no, sys)\n return\n } else {\n console.log('vname=', vname, 'label=', fname)\n }\n }\n throw new Error('async error in __callObj::', vname)\n }\n this.__generateSysenv = sys => {\n sys.envid = ( sys.envid == null ? 0 : sys.envid ) + 1\n const sysenv = {\n callstack: [],\n varstack: [],\n varslist: [sys.__varslist[0], sys.__varslist[1], sys.__varslist[2]],\n index: -1,\n nextIndex: -1,\n tryIndex: -1,\n envid: sys.envid\n }\n sysenv.vars = sysenv.varslist[2]\n if (sys.sysenvs == null) { sys.sysenvs={} }\n sys.sysenvs[sys.envid] = sysenv\n // console.log('generete envid '+sys.envid)\n return sysenv\n }\n this.__destroySysenv = (sys, envid) => {\n delete sys.sysenvs[envid]\n // console.log('destroy envid '+envid)\n }\n this.__saveSysenv = sys => {\n const sysenv = sys.curSysenv\n sysenv.callstack = sys.__callstack\n sysenv.varstack = sys.__stack\n sysenv.varslist = sys.__varslist\n sysenv.vars = sys.__vars\n sysenv.index = sys.index\n sysenv.nextIndex = sys.nextIndex\n sysenv.tryIndex = sys.tryIndex\n }\n this.__restoreSysenv = sys => {\n const sysenv = sys.curSysenv\n sys.__callstack = sysenv.callstack\n sys.__stack = sysenv.varstack\n sys.__varslist = sysenv.varslist\n sys.__vars = sysenv.vars\n ___vars = sys.__vars\n sys.index = sysenv.index\n sys.nextIndex = sysenv.nextIndex\n sys.tryIndex = sysenv.tryIndex\n }\n this.setAsync = sys => {\n sys.async = true\n return sys.curSysenv\n }\n this.compAsync = (sys,sysenv) => {\n if (sys.async && sys.curSysenv != null && sysenv != null && sys.curSysenv.envid === sysenv.envid) {\n sys.async = false\n } else {\n if (sys.curSysenv == null || sysenv == null || sys.curSysenv.envid !== sysenv.envid) {\n sys.__saveSysenv(sys)\n const envid = sys.curSysenv.envid\n sys.curSysenv = sysenv\n sys.__restoreSysenv(sys)\n // console.log('switch envid '+envid+' to '+sys.curSysenv.envid)\n }\n sys.nextAsync(sys)\n }\n }\n\n this.__resetAsync(this)\n this.curSysenv = this.__generateSysenv(this)\n this.nextAsync(this)\n //-------------------------\n `,t?"":r}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"comment":e.value||(e.value=""),this.addCode(new m(o,e.value));break;case"eol":this.addCode(new m(c,this.convLineno(e,!0)));break;case"number":this.addCodeStr(`sys.__stack.push(${e.value});//number`);break;case"string":this.convString(e);break;case"word":case"variable":this.convGetVar(e);break;case"op":case"calc":this.convOp(e);break;case"renbun":this.convRenbun(e);break;case"not":this._convGen(e.value,!0),this.addCodeStr("if (sys.__stack.length==0) throw new Error('NOTでスタックに値がありません');sys.__stack[sys.__stack.length-1] = (sys.__stack[sys.__stack.length-1]) ? 0:1");break;case"配列参照":this.convRefArray(e);break;case"json_array":this.convJsonArray(e);break;case"json_obj":this.convJsonObj(e);break;case"bool":{const t=e.value?"true":"false";this.addCodeStr(`sys.__stack.push(${t})`);break}case"null":this.addCodeStr("sys.__stack.push(null)");break;case"func":case"func_pointer":case"calc_func":this.convFunc(e,t);break;case"let":this.convLet(e);break;case"let_array":this.convLetArray(e);break;case"block":for(let t=0;t<e.block.length;t++){const n=e.block[t];this._convGen(n,!1)}break;case"if":this.convIf(e);break;case"repeat_times":this.convRepeatTimes(e);break;case"break":this.addCodeStr(this.convCheckLoop(e,"break"));break;case"continue":this.addCodeStr(this.convCheckLoop(e,"continue"));break;case"for":this.convFor(e);break;case"foreach":this.convForeach(e);break;case"while":this.convWhile(e);break;case"switch":this.convSwitch(e);break;case"return":this.convReturn(e);break;case"end":n+=this.addCodeStr("__varslist[0]['終']();");break;case"def_local_var":this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.addCodeStr(this.convDefLocalVarlist(e));break;case"tikuji":throw s.ih.fromNode("「逐次実行」構文は「!非同期モード」では使えません。",e);case"speed_mode":throw s.ih.fromNode("「速度有線」構文は「!非同期モード」では使えません。",e);case"performance_monitor":this.convPerformanceMonitor(e,t);break;case"func_obj":this.convFuncObj(e);break;case"def_test":this.convDefTest(e);break;case"def_func":n+=this.addCodeStr(this.convDefFunc(e));break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}convRequire(e){const t=new i.Jc(this.com);return this.addCodeStr(t.convRequire(e)),""}addCodeStr(e){if(""===e)return"";const t=e.split("\n").map((e=>" "+e.replace(/\s+$/,""))),n=new m(y,t.join("\n"));return this.addCode(n)}addCode(e){return this.codeArray[this.codeId]=e,this.codeId++,""}makeLabel(e){const t=e+"_"+this.loopId++;return this.makeLabelDirectly(t)}makeLabelDirectly(e){const t=new m(u,e);return this.labels[e]=-1,t}makeJump(e){return new m(a,e.value)}makeJumpIfTrue(e){return new m(f,e.value)}makeJumpIfFalse(e){return new m(l,e.value)}convIf(e){const t=this.makeLabel("もし:ここから"),n=this.makeLabel("もし:ここまで"),s=this.makeLabel("もし:違えば");return this.addCode(t),this._convGen(e.expr,!0),this.addCode(this.makeJumpIfFalse(s)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(s),e.falseBlock&&this._convGen(e.falseBlock,!1),this.addCode(n),""}convRepeatTimes(e){this.flagLoop=!0,this.varsSet.names.add("回数"),this.varsSet.readonly.add("回数");const t=`sys.__tmp_i${this.loopId}`;this.loopId++;const n=`sys.__tmp_count${this.loopId}`;this.loopId++,this._convGen(e.value,!0),this.addCodeStr(`${n} = sys.__stack.pop(); ${t} = 0;`);const s=this.makeLabel("回:条件チェック");this.addCode(s);const r=this.makeLabel("回:ここまで");this.labelBreak=r,this.labelContinue=s;const i=`sys.__vars["回数"] = ++${t}\nsys.__stack.push(${t} > ${n})\n`;return this.addCodeStr(i),this.addCode(this.makeJumpIfTrue(r)),this.convGenLoop(e.block),this.addCode(this.makeJump(s)),this.addCode(r),this.flagLoop=!1,""}findVar(e){if(this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:`sys.__vars[${JSON.stringify(e)}]`};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`sys.__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||"回数"===e||this.__self.getLogger().warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const i=this.__self.getFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi)throw new Error("[System Error]");if(0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;let n=`sys.__vars[${JSON.stringify(t)}]`;const s=this.findVar(t);null!=s&&(n=s.js),this.addCodeStr(`sys.__stack.push(${n});`)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);return e.value&&(this._convGen(e.value,!0),this.addCodeStr('sys.__vars["それ"] = sys.__stack.pop()')),this.addCode(new m(d,"")),""}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return"continue"===t?this.labelContinue&&this.addCode(this.makeJump(this.labelContinue)):this.labelBreak&&this.addCode(this.makeJump(this.labelBreak)),""}convDefFuncCommon(e,t){const n=""===t;let s=t;n&&(s="無名関数:"+this.loopId++);const r=this.makeLabel(`関数「${s}」:ここまで`);this.addCode(this.makeJump(r));const i=this.makeLabelDirectly(s);i.tag=15,this.addCode(i);const o=new Set;this.varsSet={isFunction:!0,names:o,readonly:new Set},this.varsSet.names.add("それ"),this.varslistSet.push(this.varsSet);const u=n?e.meta:e.name.meta;let c="",a="";c+=`//関数『${s}』の初期化処理\n`,c+="// 引数をローカル変数として登録\n";for(let e=u.varnames.length-1;e>=0;e--){const t=u.varnames[e];c+=` ${this.varname(t)} = sys.__stack.pop();\n`,this.varsSet.names.add(t),a+=""}return c+="// ここまで:引数をローカル変数として登録\n",this.addCodeStr(c),this.usedFuncSet.add(s),this.varslistSet[1].names.add(s),this.nakoFuncList[s]={josi:u.josi,fn:`(function(){\n const sys = (arguments.length > 0) ? arguments[arguments.length-1] : {}; \n if (sys.newenv) { \n sys.newenv = false\n sys.__callNakoCodeEntry(sys.__labels['${s}'], sys);\n } else {\n `+a+"\n"+` sys.__callNakoCode(sys.__labels['${s}'], sys.nextIndex, sys);\n if (!sys.inLoop) { sys.nextAsync(sys) }\n } })`,type:"func"},this._convGen(e.block,!1),this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],this.__self.__varslist[1][s]=function(){},this.addCode(new m(d,"")),this.addCode(r),t||this.addCodeStr(`sys.__stack.push('${s}')`),""}convDefTest(e){throw s.ih.fromNode("テスト構文は!非同期モードでは使えません。",e)}convDefFunc(e){const t=i.Jc.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){const t=e.value,n="sys.__tmp_obj"+this.loopId++;return this.addCodeStr(n+"={}; // convJsonObj::ここから"),t.forEach((e=>{this._convGen(e.value,!0),this._convGen(e.key,!0),this.addCodeStr(`${n}[sys.__stack.pop()]=sys.__stack.pop()`)})),this.addCodeStr(`this.__stack.push(${n}); delete $objName; // convJsonObj::ここまで`),""}convJsonArray(e){const t=e.value;this.addCode(this.makeLabel("convJsonArray::ここから")),t.forEach((e=>this._convGen(e,!0)));const n=t.length;return this.addCodeStr(`sys.__stack.push(sys.__stack.splice(sys.__stack.length-${n},${n}))`),""}convRefArray(e){this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++)this._convGen(t[e],!0),this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);");return""}convLetArray(e){this._convGen(e.value,!0),this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++){if(this._convGen(t[e],!0),e===t.length-1){this.addCodeStr("const idx = this.__stack.pop();const obj = this.__stack.pop();const val = this.__stack.pop();obj[idx]=val;");break}this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);")}return""}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(this.flagLoop=!0,null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.varname("それ"),s=this.loopId++,r=`sys.__tmp__i${s}`,i=`sys.__tmp__to${s}`;this._convGen(e.from,!0),this._convGen(e.to,!0),this.addCodeStr(`${i}=sys.__stack.pop();${r}=sys.__stack.pop();`),this.addCodeStr(`${n} = ${t} = ${r}`);const o=this.makeLabel("繰返:条件確認"),u=this.makeLabel("繰返:加算");this.addCode(o);const c=this.makeLabel("繰返:ここまで");return this.addCodeStr(`sys.__stack.push(${t} <= ${i})`),this.addCode(this.makeJumpIfFalse(c)),this.labelContinue=u,this.labelBreak=c,this.convGenLoop(e.block),this.addCode(u),this.addCodeStr(`${n} = ++${t};`),this.addCode(this.makeJump(o)),this.addCode(c),this.addCodeStr(`delete ${r};delete ${i};//繰返:掃除`),this.flagLoop=!1,""}convForeach(e){this.flagLoop=!0;let t='__v0["対象"]';e.name&&(t=this.varname(e.name.value),this.varsSet.names.add(e.name.value));if(null===e.target)throw s.ih.fromNode("『反復』の対象がありません。",e);const n=this.varname("それ"),r="sys.__tmp__target"+this.loopId++,i="sys.__tmp__keys"+this.loopId++,o="sys.__tmp__i"+this.loopId++,u="sys.__tmp__count"+this.loopId++;this._convGen(e.target,!0);const c=`// 反復: 初期化\n${r} = sys.__stack.pop();\n${o} = 0;\nif (typeof(${r}) == 'string' || typeof(${r}) == 'number') { ${r} = [${r}]; }\nif (${r} instanceof Array) { ${u} = ${r}.length; }\nelse { // キーの一覧を得る\n ${i} = Object.keys(${r}); \n // hasOwnPropertyがfalseならばkeyを消す処理\n ${i} = ${i}.filter((key)=>{ return ${r}.hasOwnProperty(key) })\n ${u} = ${i}.length;\n}\n`;this.addCodeStr(c);const a=this.makeLabel("反復:条件確認"),f=this.makeLabel("反復:加算"),l=this.makeLabel("反復:ここまで");this.labelBreak=l,this.labelContinue=f,this.addCode(a);const h=`if (${r} instanceof Array) {\n ${t} = ${n} = ${r}[${o}]; __v0["対象キー"] = ${o};\n} else {\n __v0["対象キー"] = ${i}[${o}]; ${t} = ${n} = ${r}[__v0["対象キー"]];\n}\n`;return this.addCodeStr(`${h}\nsys.__stack.push(${o} < ${u});`),this.addCode(this.makeJumpIfFalse(l)),this.convGenLoop(e.block),this.addCode(f),this.addCodeStr(`${o}++`),this.addCode(this.makeJump(a)),this.addCode(l),this.flagLoop=!1,""}convWhile(e){this.flagLoop=!0;const t=this.makeLabel("間:ここから"),n=this.makeLabel("間:ここまで");return this.labelContinue=t,this.labelBreak=n,this.addCode(t),this._convGen(e.cond,!0),this.addCode(this.makeJumpIfFalse(n)),this.convGenLoop(e.block),this.addCode(this.makeJump(t)),this.addCode(n),this.flagLoop=!1,""}convSpeedMode(e,t){return""}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++,this._convGen(e.block,t),this.performanceMonitor=n}convSwitch(e){this._convGen(e.value,!0);const t="sys.__tmp__i"+this.loopId++;this.addCodeStr(`${t} = sys.__stack.pop()`);const n=this.makeLabel("条件分岐:ここまで"),s=e.cases;for(let e=0;e<s.length;e++){const r=s[e][0];if("違えば"===r.type)this.convGenLoop(s[e][1]);else{const i=this.makeLabel("条件分岐:次");this._convGen(r,!0),this.addCodeStr(`sys.__stack.push(sys.__stack.pop() == ${t})`),this.addCode(this.makeJumpIfFalse(i)),this.convGenLoop(s[e][1]),this.addCode(this.makeJump(n)),this.addCode(i)}}return this.addCode(n),this.addCodeStr(`delete ${t}//条件分岐:掃除`),""}convFuncGetArgsCalcType(e,t,n){const s={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t?(this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"),s.sore=!0):this._convGen(t,!0)}return s}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convFunc(e,t){let n=!1,r=!1;const o=i.Jc.getFuncName(e.name),u=this.findVar(o);if(null===u)throw s.ih.fromNode(`関数『${o}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let c;if(0===u.i){if(c=this.__self.getFunc(o),"func"!==c.type)throw s.ih.fromNode(`『${o}』は関数ではありません。`,e);n=!0}else c=this.nakoFuncList[o],void 0===c&&(r=!0,c={return_none:!1});if("func_pointer"===e.type)return u.js;const a=this.convFuncGetArgsCalcType(o,c,e);this.usedFuncSet.add(o);let f="",l="";e.setter&&(f+=";__self.isSetter = true;\n",l+=";__self.isSetter = false;\n"),a.sore&&(f+="/*[sore]*/");const d=e.args.length;let _="";n?(_+=f,_+=`const args = sys.__stack.splice(sys.__stack.length - ${d}, ${d});\n`,_+="args.push(sys);\n",_+=`const ret = ${u.js}.apply(sys, args);\n`,c.return_none||(_+="sys.__vars['それ'] = ret;\n",t&&(_+="sys.__stack.push(ret);\n")),_+=l,this.addCodeStr(_)):(r?this.addCode(new m(p,o)):this.addCode(new m(h,o)),t||this.addCodeStr("sys.__stack.pop();// 戻り値を利用しない関数呼出"))}convRenbun(e){this._convGen(e.left,!1),this._convGen(e.right,!0)}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"},n=e.operator;this._convGen(e.left,!0),this._convGen(e.right,!0);let s="const rv = sys.__stack.pop();\nconst lv = sys.__stack.pop();\n";if("^"===n)s+="const v = (Math.pow(lv, rv))\n";else{s+=`const v = ((lv) ${t[n]||n} (rv));\n`}s+=`sys.__stack.push(v); //op:${n}\n`,this.addCodeStr(s)}convLet(e){let t="";null===e.value?this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"):this._convGen(e.value,!0);const n=e.name.value,r=this.findVar(n);if(null===r)this.varsSet.names.add(n),t=`${this.varname(n)}=sys.__stack.pop();`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);t=`${r.js}=sys.__stack.pop();`}this.addCodeStr(t+"//let")}convDefLocalVar(e){null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const t=e.name.value,n=e.vartype;if(this.varsSet.names.has(t))throw s.ih.fromNode(`${n}『${t}』の二重定義はできません。`,e);return this.varsSet.names.add(t),"定数"===n&&this.varsSet.readonly.add(t),this.addCodeStr(`${this.varname(t)}=sys.__stack.pop()`),""}convDefLocalVarlist(e){const t=e.vartype;null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const n=`sys.__tmp_i${this.loopId}`;this.loopId++,this.addCodeStr(`${n}=sys.__stack.pop();if (!(${n} instanceof Array)) { ${n}=[${n}] }`);for(const r of e.names){const i=r.value;if(this.varsSet.names.has(i))throw s.ih.fromNode(`${t}『${i}』の二重定義はできません。`,e);this.varsSet.names.add(i),"定数"===t&&this.varsSet.readonly.add(i);const o=this.varname(i);this.addCodeStr(`${o}=${n}.pop()`)}return this.addCodeStr(`delete ${n}//複数代入:掃除`),""}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n)throw new Error("[システムエラー] ジェネレーターでの文字列の展開はサポートしていません");return this.addCodeStr(`sys.__stack.push("${t}")//string`),'"'+t+'"'}convTryExcept(e){const t=this.makeLabel("エラー監視:ならば"),n=this.makeLabel("エラー監視:ここまで");this.addCode(new m(_,t.value)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(t),this._convGen(e.errBlock,!1),this.addCode(n)}}if("object"==typeof navigator&&"object"==typeof navigator.nako3){const e=navigator.nako3;e.addCodeGenerator&&e.addCodeGenerator("非同期モード",g)}},8775:function(e,t,n){n.r(t),n.d(t,{josiList:function(){return s},josiRE:function(){return c},removeJosiList:function(){return i},removeJosiMap:function(){return u},tararebaJosiList:function(){return r},tararebaMap:function(){return o}});const s=["について","くらい","なのか","までを","までの","による","とは","から","まで","だけ","より","ほど","など","いて","えて","きて","けて","して","って","にて","みて","めて","ねて","では","には","は~","んで","ずつ","は","を","に","へ","で","と","が","の"],r=["でなければ","なければ","ならば","なら","たら","れば"],i=["こと","である","です","します","でした"],o={};r.forEach((e=>{s.push(e),o[e]=!0}));const u={};i.forEach((e=>{s.push(e),u[e]=!0})),s.sort(((e,t)=>t.length-e.length));const c=new RegExp("^[\\t ]*("+s.join("|")+")")},515:function(e,t,n){n.r(t);t.default={"回":"回","回繰返":"回","間":"間","間繰返":"間","繰返":"繰返","増繰返":"増繰返","減繰返":"減繰返","後判定":"後判定","反復":"反復","抜":"抜ける","続":"続ける","戻":"戻る","先":"先に","次":"次に","代入":"代入","実行速度優先":"実行速度優先","パフォーマンスモニタ適用":"パフォーマンスモニタ適用","定":"定める","逐次実行":"逐次実行","条件分岐":"条件分岐","増":"増","減":"減","変数":"変数","定数":"定数","エラー監視":"エラー監視","エラー":"エラー","それ":"word","そう":"word","関数":"def_func","インデント構文":"インデント構文","非同期モード":"非同期モード","DNCLモード":"DNCLモード","モード設定":"モード設定","取込":"取込"}},6758:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){var _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(6297);__webpack_exports__.Z={meta:{type:"const",value:{pluginName:"plugin_system",pluginVersion:"3.3.38",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.3.38"}},"初期化":{type:"func",josi:[],pure:!1,fn:function(e){e.__v0["ナデシコバージョン"]=e.version,e.__v0["ナデシコ言語バージョン"]=e.coreVersion,e.__namespaceList=[],e.__findVar=function(t,n){if("function"==typeof t)return t;if(e.__locals[t])return e.__locals[t];if(t.indexOf("__")>=0){for(let n=2;n>=0;n--){const s=e.__varslist[n];if(s[t])return s[t]}return n}const s=e.__modList?e.__modList:[e.__modName];for(const n of s){const s=n+"__"+t;for(let t=2;t>=0;t--){const n=e.__varslist[t];if(n[s])return n[s]}}return n},e.__findFunc=function(t,n){const s=e.__findVar(t);if("function"==typeof s)return s;throw new Error(`『${n}』に実行できない関数が指定されました。`)},e.__exec=function(t,n){const s=e.__v0[t];if(s)return s.apply(this,n);const r=e.__findVar(t);if(!r)throw new Error("システム関数でエイリアスの指定ミス:"+t);return r.apply(this,n)},e.__timeout=[],e.__interval=[];const t=e.__zero2=e=>(e="00"+e).substring(e.length-2);e.__zero=(e,t)=>{let n="";for(let e=0;e<t;e++)n+="0";return(e=n+e).substring(e.length-t)},e.__formatDate=e=>e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),e.__formatTime=e=>t(e.getHours())+":"+t(e.getSeconds())+":"+t(e.getMinutes()),e.__formatDateTime=(e,n)=>{const s=e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),r=t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds());return n.match(/^\d+\/\d+\/\d+\s+\d+:\d+:\d+$/)?s+" "+r:n.match(/^\d+\/\d+\/\d+$/)?s:n.match(/^\d+:\d+:\d+$/)?r:s+" "+r},e.__str2date=e=>{if((e=(""+e).replace(/(^\s+|\s+$)/,"")).match(/^(\d+|\d+\.\d+)$/))return new Date(1e3*parseFloat(e));if(e.match(/^\d+:\d+(:\d+)?$/)){const t=new Date,n=(e+":0").split(":");return new Date(t.getFullYear(),t.getMonth(),t.getDate(),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}e=e.replace(/[\s:-]/g,"/");const t=(e+="/0/0/0").split("/");return new Date(parseInt(t[0]),parseInt(t[1])-1,parseInt(t[2]),parseInt(t[3]),parseInt(t[4]),parseInt(t[5]))},e.__printPool="",e.chk=(t,n)=>{if(void 0===t){const t=e.constPools[n];e.logger.warn(t.msg,{file:t.file,line:t.line})}return t}}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__exec&&e.__exec("全タイマー停止",[e]),"非同期モード"===e.__genMode&&e.__stopAsync(e),e.__v0["表示ログ"]=""}},"ナデシコバージョン":{type:"const",value:"?"},"ナデシコ言語バージョン":{type:"const",value:"?"},"ナデシコエンジン":{type:"const",value:"nadesi.com/v3"},"ナデシコ種類":{type:"const",value:"?"},"はい":{type:"const",value:1},"いいえ":{type:"const",value:0},"真":{type:"const",value:1},"偽":{type:"const",value:0},"永遠":{type:"const",value:1},"オン":{type:"const",value:1},"オフ":{type:"const",value:0},"改行":{type:"const",value:"\n"},"タブ":{type:"const",value:"\t"},"カッコ":{type:"const",value:"「"},"カッコ閉":{type:"const",value:"」"},"波カッコ":{type:"const",value:"{"},"波カッコ閉":{type:"const",value:"}"},OK:{type:"const",value:!0},NG:{type:"const",value:!1},"キャンセル":{type:"const",value:0},TRUE:{type:"const",value:!0},FALSE:{type:"const",value:!1},PI:{type:"const",value:Math.PI},"空":{type:"const",value:""},NULL:{type:"const",value:null},undefined:{type:"const",value:void 0},"未定義":{type:"const",value:void 0},"エラーメッセージ":{type:"const",value:""},"対象":{type:"const",value:""},"対象キー":{type:"const",value:""},"回数":{type:"const",value:""},CR:{type:"const",value:"\r"},LF:{type:"const",value:"\n"},"非数":{type:"const",value:NaN},"無限大":{type:"const",value:1/0},"空配列":{type:"func",josi:[],pure:!0,fn:function(){return[]}},"空辞書":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空ハッシュ":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空オブジェクト":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("空ハッシュ",[e])}},"表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){e=t.__printPool+e,t.__printPool="",t.__varslist[0]["表示ログ"]+=e+"\n",t.logger.send("stdout",e+"")},return_none:!0},"継続表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__printPool+=e},return_none:!0},"連続表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("表示",[n,t])},return_none:!0},"連続無改行表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("継続表示",[n,t])},return_none:!0},"表示ログ":{type:"const",value:""},"表示ログクリア":{type:"func",josi:[],pure:!0,fn:function(e){e.__varslist[0]["表示ログ"]=""},return_none:!0},"言":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.logger.send("stdout",e+"")},return_none:!0},"コンソール表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e){console.log(e)},return_none:!0},"足":{type:"func",josi:[["に","と"],["を"]],isVariableJosi:!1,pure:!0,fn:function(e,t){return e+t}},"引":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){return e-t}},"掛":{type:"func",josi:[["に","と"],["を"]],pure:!0,fn:function(e,t){if("number"==typeof e)return e*t;if("string"==typeof e){let n="";for(let s=0;s<parseInt(t);s++)n+=e;return n}if(e instanceof Array){const n=[];for(let s=0;s<parseInt(t);s++)n.push(...e);return n}return e*t}},"倍":{type:"func",josi:[["の"],[""]],pure:!0,fn:function(e,t){return e*t}},"割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e/t}},"割余":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e%t}},"偶数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==0}},"奇数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==1}},"二乗":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e*e}},"べき乗":{type:"func",josi:[["の"],["の"]],pure:!0,fn:function(e,t){return Math.pow(e,t)}},"以上":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>=t}},"以下":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<=t}},"未満":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<t}},"超":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>t}},"等":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e===t}},"等無":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e!==t}},"一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)===JSON.stringify(t)}return e===t}},"不一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)!==JSON.stringify(t)}return e!==t}},"範囲内":{type:"func",josi:[["が"],["から"],["の"]],pure:!0,fn:function(e,t,n){return t<=e&&e<=n}},"連続加算":{type:"func",josi:[["を"],["に","と"]],isVariableJosi:!0,pure:!0,fn:function(e,...t){return t.pop(),t.push(e),t.reduce(((e,t)=>e+t))}},"ください":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"お願":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"です":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"拝啓":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu=0},return_none:!0},"敬具":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu+=100},return_none:!0},"礼節レベル取得":{type:"func",josi:[],pure:!0,fn:function(e){return e.__reisetu||(e.__reisetu=0),e.__reisetu}},"JS実行":{type:"func",josi:[["を","で"]],pure:!0,fn:function(src,sys){return eval(src)}},"JSオブジェクト取得":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__findVar(e,null)}},"JS関数実行":{type:"func",josi:[["を"],["で"]],fn:function(name,args){if("string"==typeof name&&(name=eval(name)),"function"!=typeof name)throw new Error("JS関数取得で実行できません。");return args instanceof Array||(args=[args]),name.apply(null,args)}},"JSメソッド実行":{type:"func",josi:[["の"],["を"],["で"]],fn:function(obj,m,args){if("string"==typeof obj&&(obj=eval(obj)),"object"!=typeof obj)throw new Error("JSオブジェクトを取得できませんでした。");return"function"!=typeof m&&(m=obj[m]),args instanceof Array||(args=[args]),m.apply(obj,args)}},"ナデシコ":{type:"func",josi:[["を","で"]],pure:!1,fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ」は利用できません。");t.__varslist[0]["表示ログ"]="",t.__self.runEx(e,t.__modName,{resetEnv:!1,resetLog:!0});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"ナデシコ続":{type:"func",josi:[["を","で"]],fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ続」は利用できません。");t.__self.runEx(e,t.__modName,{resetEnv:!1,resetAll:!1});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"実行":{type:"func",josi:[["を","に","で"]],pure:!1,fn:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e){const n=t.__findFunc(e,"実行");if("function"==typeof n)return n(t)}return e}},"実行時間計測":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=t.__findFunc(e,"実行時間計測")),performance&&performance.now){const n=performance.now();e(t);return performance.now()-n}{const n=Date.now();e(t);return Date.now()-n}}},"終":{type:"func",josi:[],pure:!0,fn:function(e){if(e.__v0.forceClose=!0,!e.__v0.useDebug)throw new Error("__終わる__")}},"変数型確認":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},TYPEOF:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},"文字列変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},TOSTR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},"整数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},TOINT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},"実数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},TOFLOAT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},INT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e)}},FLOAT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseFloat(e)}},"NAN判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return isNaN(e)}},"非数判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Number.isNaN(e)}},HEX:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e).toString(16)}},"進数変換":{type:"func",josi:[["を","の"],[""]],pure:!0,fn:function(e,t){return parseInt(e).toString(t)}},"二進":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return parseInt(e).toString(2)}},"二進表示":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n=parseInt(e).toString(2);t.__exec("表示",[n,t])}},RGB:{type:"func",josi:[["と"],["の"],["で"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+parseInt(""+e).toString(16);return t.substring(t.length-2,t.length)};return"#"+s(e)+s(t)+s(n)}},"論理OR":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e||t}},"論理AND":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&&t}},"論理NOT":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e?0:1}},OR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e|t}},AND:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&t}},XOR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e^t}},NOT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return~e}},SHIFT_L:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e<<t}},SHIFT_R:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>t}},SHIFT_UR:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>>t}},"文字数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Array.from?Array.from(e).length:String(e).length}},"何文字目":{type:"func",josi:[["で","の"],["が"]],pure:!0,fn:function(e,t){return String(e).indexOf(t)+1}},CHR:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.fromCodePoint?String.fromCodePoint(e):String.fromCharCode(e)}},ASC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.prototype.codePointAt?String(e).codePointAt(0):String(e).charCodeAt(0)}},"文字挿入":{type:"func",josi:[["で","の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){t<=0&&(t=1);const s=String(e);return s.substring(0,t-1)+n+s.substring(t-1)}},"文字検索":{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){let s=String(e);s=s.substring(t);const r=s.indexOf(n);return-1===r?0:r+1+t}},"追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)}},"一行追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)+"\n"}},"文字列分解":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return Array.from?Array.from(e):String(e).split("")}},"リフレイン":{type:"func",josi:[["を","の"],["で"]],pure:!0,fn:function(e,t){let n="";for(let s=0;s<t;s++)n+=String(e);return n}},"出現回数":{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return(e=""+e).split(t=""+t).length-1}},MID:{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},"文字抜出":{type:"func",josi:[["で","の"],["から"],["を",""]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},LEFT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},"文字左部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},RIGHT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"文字右部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"区切":{type:"func",josi:[["の","を"],["で"]],pure:!0,fn:function(e,t){return(""+e).split(""+t)}},"文字列分割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=(e=""+e).indexOf(t=""+t);return n<0?[e]:[e.substring(0,n),e.substring(n+t.length)]}},"切取":{type:"func",josi:[["から","の"],["まで","を"]],pure:!0,fn:function(e,t,n){const s=(e=String(e)).indexOf(t);return s<0?(n.__v0["対象"]="",e):(n.__v0["対象"]=e.substring(s+t.length),e.substring(0,s))}},"文字削除":{type:"func",josi:[["の"],["から"],["だけ","を",""]],pure:!0,fn:function(e,t,n){return(e=""+e).substring(0,t-1)+e.substring(t-1+n)}},"置換":{type:"func",josi:[["の","で"],["を","から"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).split(t).join(n)}},"単置換":{type:"func",josi:[["の","で"],["を"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).replace(t,n)}},"トリム":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"空白除去":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"大文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toUpperCase()}},"小文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toLowerCase()}},"平仮名変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u30a1-\u30f6]/g,(function(e){const t=e.charCodeAt(0)-96;return String.fromCharCode(t)}))}},"カタカナ変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u3041-\u3096]/g,(function(e){const t=e.charCodeAt(0)+96;return String.fromCharCode(t)}))}},"英数全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"英数記号全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\x20-\x7F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数記号半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\uFF00-\uFF5F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"カタカナ全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];let o="",u=0;for(;u<e.length;){const t=e.substring(u,u+2),c=i.indexOf(t);if(c>=0){o+=r.charAt(c/2),u+=2;continue}const a=e.charAt(u),f=s.indexOf(a);f>=0?(o+=n.charAt(f),u++):(o+=a,u++)}return o}},"カタカナ半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];return e.split("").map((e=>{const t=n.indexOf(e);if(t>=0)return s.charAt(t);const o=r.indexOf(e);return o>=0?i.substring(2*o,2*o+2):e})).join("")}},"全角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ全角変換",[n,t]),n=t.__exec("英数記号全角変換",[n,t]),n}},"半角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ半角変換",[n,t]),n=t.__exec("英数記号半角変換",[n,t]),n}},"全角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」"},"全角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"半角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」゙゚"},"半角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"JSONエンコード":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e)}},"JSONエンコード整形":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e,null,2)}},"JSONデコード":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return JSON.parse(e)}},"正規表現マッチ":{type:"func",josi:[["を","が"],["で","に"]],pure:!0,fn:function(e,t,n){let s;const r=(""+t).match(/^\/(.+)\/([a-zA-Z]*)$/);s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]);const i=n.__varslist[0]["抽出文字列"]=[],o=String(e).match(s);let u=o;if(s.global);else if(o&&o.length>0){u=o[0];for(let e=1;e<o.length;e++)i[e-1]=o[e]}return u}},"抽出文字列":{type:"const",value:[]},"正規表現置換":{type:"func",josi:[["の"],["を","から"],["で","に","へ"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)/);return s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]),String(e).replace(s,n)}},"正規表現区切":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){let n;const s=t.match(/^\/(.+)\/([a-zA-Z]*)/);return n=null===s?new RegExp(t,"g"):new RegExp(s[1],s[2]),String(e).split(n)}},"通貨形式":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},"ゼロ埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n="0";for(let e=0;e<t;e++)n+="0";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"空白埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n=" ";for(let e=0;e<t;e++)n+=" ";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"かなか判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12353&&t<=12447}},"カタカナ判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12449&&t<=12538}},"数字判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){const t=String(e).charAt(0);return t>="0"&&t<="9"||t>="0"&&t<="9"}},"数列判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){return null!==String(e).match(/^[0-9.]+$/)}},"配列結合":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.join(""+t);return String(e).split("\n").join(""+t)}},"配列検索":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.indexOf(t):-1}},"配列要素数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e instanceof Array?e.length:e instanceof Object?Object.keys(e).length:1}},"要素数":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("配列要素数",[e])}},"配列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,0,n);throw new Error("『配列挿入』で配列以外の要素への挿入。")}},"配列一括挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array&&n instanceof Array){for(let s=0;s<n.length;s++)e.splice(t+s,0,n[s]);return e}throw new Error("『配列一括挿入』で配列以外の要素への挿入。")}},"配列ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列数値ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort(((e,t)=>parseFloat(e)-parseFloat(t)));throw new Error("『配列数値ソート』で配列以外が指定されました。")}},"配列カスタムソート":{type:"func",josi:[["で"],["の","を"]],pure:!1,fn:function(e,t,n){let s=e;if("string"==typeof e&&(s=n.__findFunc(e,"配列カスタムソート")),t instanceof Array)return t.sort(s);throw new Error("『配列カスタムソート』で配列以外が指定されました。")}},"配列逆順":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.reverse();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列シャッフル":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}throw new Error("『配列シャッフル』で配列以外が指定されました。")}},"配列削除":{type:"func",josi:[["の","から"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("配列切取",[e,t,n])}},"配列切取":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array){const n=e.splice(t,1);return n instanceof Array?n[0]:null}if(!(e instanceof Object&&"string"==typeof t))throw new Error("『配列切取』で配列以外を指定。");if(e[t]){const n=e[t];return delete e[t],n}}},"配列取出":{type:"func",josi:[["の"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,n);throw new Error("『配列取出』で配列以外を指定。")}},"配列ポップ":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if(e instanceof Array)return e.pop();throw new Error("『配列ポップ』で配列以外の処理。")}},"配列プッシュ":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t,n){return n.__exec("配列追加",[e,t,n])}},"配列追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.push(t),e;throw new Error("『配列追加』で配列以外の処理。")}},"配列複製":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return JSON.parse(JSON.stringify(e))}},"配列足":{type:"func",josi:[["に","へ","と"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.concat(t):JSON.parse(JSON.stringify(e))}},"配列最大値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.max(e,t)))}},"配列最小値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.min(e,t)))}},"配列合計":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(e instanceof Array){let t=0;return e.forEach((e=>{const n=parseFloat(e);isNaN(n)||(t+=n)})),t}throw new Error("『配列合計』で配列変数以外の値が指定されました。")}},"配列連番作成":{type:"func",josi:[["から"],["まで","の"]],pure:!0,fn:function(e,t){const n=[];for(let s=e;s<=t;s++)n.push(s);return n}},"配列要素作成":{type:"func",josi:[["を"],["だけ"]],pure:!0,fn:function(e,t){const n=[];for(let s=0;s<t;s++)n.push(e);return n}},"配列関数適用":{type:"func",josi:[["を"],["へ","に"]],pure:!0,fn:function(e,t,n){let s=e;"string"==typeof e&&(s=n.__findFunc(e,"配列関数適用"));const r=[];for(const e of t)r.push(s(e));return r}},"配列マップ":{type:"func",josi:[["を"],["へ","に"]],pure:!0,fn:function(e,t,n){return n.__exec("配列関数適用",[e,t,n])}},"配列フィルタ":{type:"func",josi:[["で","の"],["を","について"]],pure:!0,fn:function(e,t,n){let s=e;"string"==typeof e&&(s=n.__findFunc(e,"配列フィルタ"));const r=[];for(const e of t)s(e)&&r.push(e);return r}},"表ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>{const s=e[t],r=n[t];return s===r?0:s<r?-1:1})),e}},"表数値ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表数値ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>e[t]-n[t])),e}},"表ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表ピックアップ』には配列を指定する必要があります。");return e.filter((e=>String(e[t]).indexOf(n)>=0))}},"表完全一致ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表完全ピックアップ』には配列を指定する必要があります。");return e.filter((e=>e[t]===n))}},"表検索":{type:"func",josi:[["の"],["で","に"],["から"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表検索』には配列を指定する必要があります。");for(let r=n;r<e.length;r++)if(e[r][t]===s)return r;return-1}},"表列数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表列数』には配列を指定する必要があります。");let t=1;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);return t}},"表行数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表行数』には配列を指定する必要があります。");return e.length}},"表行列交換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表行列交換』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=void 0!==e[r][t]?e[r][t]:""}return r}},"表右回転":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表右回転』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=e[s-r-1][t]}return r}},"表重複削除":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表重複削除』には配列を指定する必要があります。");const n=[],s={};for(let r=0;r<e.length;r++){const i=e[r][t];void 0===s[i]&&(s[i]=!0,n.push(e[r]))}return n}},"表列取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列取得』には配列を指定する必要があります。");return e.map((e=>e[t]))}},"表列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列挿入』には配列を指定する必要があります。");const s=[];return e.forEach(((e,r)=>{let i=[];t>0&&(i=i.concat(e.slice(0,t))),i.push(n[r]),i=i.concat(e.slice(t)),s.push(i)})),s}},"表列削除":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列削除』には配列を指定する必要があります。");const n=[];return e.forEach((e=>{const s=e.slice(0);s.splice(t,1),n.push(s)})),n}},"表列合計":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列合計』には配列を指定する必要があります。");let n=0;return e.forEach((e=>{n+=e[t]})),n}},"表曖昧検索":{type:"func",josi:[["の"],["から"],["で"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表曖昧検索』には配列を指定する必要があります。");const r=new RegExp(s);for(let s=t;s<e.length;s++){const t=e[s];if(r.test(t[n]))return s}return-1}},"表正規表現ピックアップ":{type:"func",josi:[["の","で"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表正規表現ピックアップ』には配列を指定する必要があります。");const s=new RegExp(n),r=[];for(let n=0;n<e.length;n++){const i=e[n];s.test(i[t])&&r.push(i.slice(0))}return r}},"辞書キー列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(n);return t}if(e instanceof Array){for(let n=0;n<e.length;n++)t.push(n);return t}throw new Error("『辞書キー列挙』でハッシュ以外が与えられました。")}},"辞書キー削除":{type:"func",josi:[["から","の"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Object)return e[t]&&delete e[t],e;throw new Error("『辞書キー削除』でハッシュ以外が与えられました。")}},"辞書キー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"ハッシュキー列挙":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("辞書キー列挙",[e,t])}},"ハッシュ内容列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(e[n]);return t}throw new Error("『ハッシュ内容列挙』でハッシュ以外が与えられました。")}},"ハッシュキー削除":{type:"func",josi:[["から","の"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("辞書キー削除",[e,t,n])}},"ハッシュキー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"秒待":{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(e,t){return new Promise(((n,s)=>{try{const s=setTimeout((()=>{const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*parseFloat(e));t.__timeout.push(s)}catch(e){s(e)}}))},return_none:!0},"秒待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode){if(void 0===t.resolve)throw new Error("『秒待機』命令は『!非同期モード』で使ってください。");t.__exec("秒逐次待機",[e,t])}else{const n=t.setAsync(t);setTimeout((()=>{t.compAsync(t,n)}),1e3*e)}},return_none:!0},"秒逐次待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『秒逐次待機』命令は『逐次実行』構文と一緒に使ってください。");const n=t.resolve;t.resolveCount++;const s=setTimeout((function(){const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*e);t.__timeout.unshift(s)},return_none:!0},"秒後":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒後"));const s=setTimeout((()=>{const t=n.__timeout.indexOf(s);t>=0&&n.__timeout.splice(t,1),"非同期モード"===n.__genMode&&(n.newenv=!0);try{e(s,n)}catch(e){let t=e;e instanceof _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as||(t=new _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as(e,n.__varslist[0].line)),n.logger.error(t)}}),1e3*parseFloat(t));return n.__timeout.unshift(s),n.__v0["対象"]=s,s}},"秒毎":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒毎"));const s=setInterval((()=>{"非同期モード"===n.__genMode&&(n.newenv=!0),e(s,n)}),1e3*parseFloat(t));return n.__interval.unshift(s),n.__v0["対象"]=s,s}},"秒タイマー開始時":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){return n.__exec("秒毎",[e,t,n])}},"タイマー停止":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e,t){const n=t.__interval.indexOf(e);if(n>=0)return t.__interval.splice(n,1),clearInterval(e),!0;const s=t.__timeout.indexOf(e);return s>=0&&(t.__timeout.splice(s,1),clearTimeout(e),!0)},return_none:!1},"全タイマー停止":{type:"func",josi:[],pure:!0,fn:function(e){for(let t=0;t<e.__interval.length;t++){const n=e.__interval[t];clearInterval(n)}e.__interval=[];for(let t=0;t<e.__timeout.length;t++){const n=e.__timeout[t];clearTimeout(n)}e.__timeout=[]},return_none:!0},"元号データ":{type:"const",value:[{"元号":"令和","改元日":"2019/05/01"},{"元号":"平成","改元日":"1989/01/08"},{"元号":"昭和","改元日":"1926/12/25"},{"元号":"大正","改元日":"1912/07/30"},{"元号":"明治","改元日":"1868/10/23"}]},"今":{type:"func",josi:[],pure:!0,fn:function(){const e=e=>(e="00"+e).substring(e.length-2,e.length),t=new Date;return e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())}},"システム時間":{type:"func",josi:[],pure:!0,fn:function(){const e=new Date;return Math.floor(e.getTime()/1e3)}},"システム時間ミリ秒":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getTime()}},"今日":{type:"func",josi:[],pure:!0,fn:function(e){return e.__formatDate(new Date)}},"明日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()+864e5;return e.__formatDate(new Date(t))}},"昨日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()-864e5;return e.__formatDate(new Date(t))}},"今年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()}},"来年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()+1}},"去年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()-1}},"今月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+1}},"来月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+2}},"先月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()}},"曜日":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){const n=t.__str2date(e);return"日月火水木金土".charAt(n.getDay()%7)}},"曜日番号取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e.split("/");return new Date(t[0],t[1]-1,t[2]).getDay()}},"UNIXTIME変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"UNIX時間変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"日時変換":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e,t){const n=1e3*e;return t.__formatDateTime(new Date(n),"2022/01/01 00:00:00")}},"日時書式変換":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return t=t.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,(e=>{switch(e){case"YYYY":return s.getFullYear();case"YY":return(""+s.getFullYear()).substring(2);case"MM":return n.__zero2(s.getMonth()+1);case"DD":return n.__zero2(s.getDate());case"M":return s.getMonth()+1;case"D":return s.getDate();case"HH":return n.__zero2(s.getHours());case"mm":return n.__zero2(s.getMinutes());case"ss":return n.__zero2(s.getSeconds());case"ccc":return n.__zero(s.getMilliseconds(),3);case"H":return s.getHours();case"m":return s.getMinutes();case"s":return s.getSeconds();case"W":return"日月火水木金土".charAt(s.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][s.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s.getMonth()]}return e}))}},"和暦変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){const n=t.__str2date(e),s=n.getTime();for(const e of t.__v0["元号データ"]){const r=e["元号"],i=t.__str2date(e["改元日"]);if(i.getTime()<=s){let e=n.getFullYear()-i.getFullYear()+1;return 1===e&&(e="元"),r+e+"年"+t.__zero2(n.getMonth()+1)+"月"+t.__zero2(n.getDate())+"日"}}throw new Error("『和暦変換』は明示以前の日付には対応していません。")}},"年数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return n.__str2date(t).getFullYear()-s.getFullYear()}},"月数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e),r=n.__str2date(t);return 12*r.getFullYear()+r.getMonth()-(12*s.getFullYear()+s.getMonth())}},"日数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/86400)}},"時間差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/3600)}},"分差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/60)}},"秒差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil(r-s)}},"日時差":{type:"func",josi:[["と","から"],["の","までの"],["による"]],pure:!0,fn:function(e,t,n,s){switch(n){case"年":return s.__exec("年数差",[e,t,s]);case"月":return s.__exec("月数差",[e,t,s]);case"日":return s.__exec("日数差",[e,t,s]);case"時間":return s.__exec("時間差",[e,t,s]);case"分":return s.__exec("分差",[e,t,s]);case"秒":return s.__exec("秒差",[e,t,s])}throw new Error("『日時差』で不明な単位です。")}},"時間加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=t.charAt(0);"-"!==s&&"+"!==s||(t=t.substring(1));const r=n.__str2date(e),i=(t+":0:0").split(":");let o=60*parseInt(i[0])*60+60*parseInt(i[1])+parseInt(i[2]);"-"===s&&(o*=-1);const u=new Date(r.getTime()+1e3*o);return n.__formatDateTime(u,e)}},"日付加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=1;const r=t.charAt(0);"-"!==r&&"+"!==r||(t=t.substring(1),"-"===r&&(s*=-1));const i=n.__str2date(e),o=(t+"/0/0").split("/"),u=parseInt(o[0])*s,c=parseInt(o[1])*s,a=parseInt(o[2])*s;return i.setFullYear(i.getFullYear()+u),i.setMonth(i.getMonth()+c),i.setDate(i.getDate()+a),n.__formatDateTime(i,e)}},"日時加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=(""+t).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!s)throw new Error("『日付加算』は『(+|-)1(年|ヶ月|日|時間|分|秒)』の書式で指定します。");switch(s[3]){case"年":return n.__exec("日付加算",[e,`${s[1]}${s[2]}/0/0`,n]);case"ヶ月":return n.__exec("日付加算",[e,`${s[1]}0/${s[2]}/0`,n]);case"週間":return n.__exec("日付加算",[e,`${s[1]}0/0/${7*parseInt(s[2])}`,n]);case"日":return n.__exec("日付加算",[e,`${s[1]}0/0/${s[2]}`,n]);case"時間":return n.__exec("時間加算",[e,`${s[1]}${s[2]}:0:0`,n]);case"分":return n.__exec("時間加算",[e,`${s[1]}0:${s[2]}:0`,n]);case"秒":return n.__exec("時間加算",[e,`${s[1]}0:0:${s[2]}`,n])}}},"時間ミリ秒取得":{type:"func",josi:[],pure:!0,fn:function(){if(performance&&performance.now)return performance.now();if(Date.now)return Date.now();return(new Date).getTime()}},"エラー発生":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e){throw new Error(e)}},"グローバル関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[1],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[0],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数存在":{type:"func",josi:[["が","の"]],pure:!0,fn:function(e,t){return void 0!==t.__v0[e]}},"プラグイン一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.pluginfiles)t.push(n);return t}},"モジュール一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__module)t.push(n);return t}},"助詞一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,8775)).then((t=>{const n=Object.assign({},t);e(n.josiList)})).catch((e=>{t(e)}))}))}},"予約語一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,515)).then((t=>{const n=Object.assign({},t),s=[];for(const e in n.default)s.push(e);e(s)})).catch((e=>{t(e)}))}))}},"プラグイン名":{type:"const",value:"メイン"},"プラグイン名設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__v0["プラグイン名"]=e},return_none:!0},"名前空間":{type:"const",value:""},"名前空間設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__namespaceList.push([t.__v0["名前空間"],t.__v0["プラグイン名"]]),t.__v0["名前空間"]=e},return_none:!0},"名前空間ポップ":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__namespaceList.pop();t&&(e.__v0["名前空間"]=t[0],e.__v0["プラグイン名"]=t[1])},return_none:!0},"URLエンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){return encodeURIComponent(e)}},"URLデコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){return decodeURIComponent(e)}},"URLパラメータ解析":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n={};if("string"!=typeof e)return n;const s=e.split("?");if(s.length<=1)return n;const r=s[1].split("&");for(const e of r){const s=(e+"=").split("=");n[t.__exec("URLデコード",[s[0]])]=t.__exec("URLデコード",[s[1]])}return n}},"BASE64エンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.btoa){const t=(new TextEncoder).encode(e),n=String.fromCharCode.apply(null,t);return btoa(n)}if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("『BASE64エンコード』は利用できません。")}},"BASE64デコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.atob){const t=atob(e),n=Array.prototype.map.call(t,(e=>e.charCodeAt())),s=new Uint8Array(n);return new TextDecoder("UTF-8").decode(s)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString();throw new Error("『BASE64デコード』は利用できません。")}}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};!function(){const e={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"÷":5,"÷÷":5,"%":5,"^":6},t=["いて","えて","きて","けて","して","って","にて","みて","めて","ねて","には","んで"],n=[];for(const t in e)n.push(t);function s(e="?",t="",n=-1,s=0,r="main.nako3"){return{type:e,value:t,indent:n,line:s,column:0,file:r,josi:""}}var r=__webpack_require__(6297),i=__webpack_require__(515);function o(e){const t=e.charCodeAt(0);return"\t"===e?4:" "===e||"|"===e?1:"・"===e||" "===e||"⏋"===e||"⏌"===e||t>=9472&&t<=9599||t>=9120&&t<=9135||t>=9144&&t<=9151?2:0}var u=__webpack_require__(8775);const c=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,a=/^[ぁ-ん]/,f=/^[ぁ-ん]+$/,l=/^.+(以上|以下|超|未満)$/,h=e=>function(){throw new Error("突然の『"+e+"』があります。")},p=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|px|dot|pt|em|b|mb|kb|gb)/,d=[{name:"ここまで",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・|⎿ |└||)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:function(e){let t="";let n=0;const s=(e=e.substring(2)).indexOf("*/");s<0?(t=e,e=""):(t=e.substring(0,s),e=e.substring(s+2));for(let e=0;e<t.length;e++)"\n"===t.charAt(e)&&n++;return t=t.replace(/(^\s+|\s+$)/,""),{src:e,res:t,josi:"",numEOL:n}}},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:y},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:y},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:y},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:y},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:y},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:y},{name:"ここから",pattern:/^(ここから),?/},{name:"ここまで",pattern:/^(ここまで|💧)/},{name:"もし",pattern:/^もしも?/},{name:"違えば",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"←",pattern:/^(←|<--)/},{name:"eq",pattern:/^(==|🟰🟰)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい|DNCLモード|DNCL2モード|DNCL2)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&)/},{name:"or",pattern:/^(または|或いは|あるいは|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"*",pattern:/^(×|\*)/},{name:"÷÷",pattern:/^÷÷/},{name:"÷",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"string",pattern:/^🌿/,cbParser:e=>_("🌿","🌿",e)},{name:"string_ex",pattern:/^🌴/,cbParser:e=>_("🌴","🌴",e)},{name:"string_ex",pattern:/^「/,cbParser:e=>_("「","」",e)},{name:"string",pattern:/^『/,cbParser:e=>_("『","』",e)},{name:"string_ex",pattern:/^“/,cbParser:e=>_("“","”",e)},{name:"string_ex",pattern:/^"/,cbParser:e=>_('"','"',e)},{name:"string",pattern:/^'/,cbParser:e=>_("'","'",e)},{name:"」",pattern:/^」/,cbParser:h("」")},{name:"』",pattern:/^』/,cbParser:h("』")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:function(e,t=!0){let n="",s="";for(;""!==e;){if(n.length>0){const t=u.josiRE.exec(e);if(t){s=t[0].replace(/^\s+/,""),","===(e=e.substr(t[0].length)).charAt(0)&&(e=e.substr(1));break}}const t=c.exec(e);if(t){n+=t[0],e=e.substr(t[0].length);continue}if(!a.test(e))break;n+=e.charAt(0),e=e.substr(1)}/[ぁ-ん]間$/.test(n)&&(e=n.charAt(n.length-1)+e,n=n.slice(0,-1));const r=l.exec(n);r&&(e=r[1]+s+e,s="",n=n.substr(0,n.length-r[1].length));u.removeJosiMap[s]&&(s="");t&&(n=function(e){if(!a.test(e))return e.replace(/[ぁ-ん]+/g,"");if(f.test(e))return e;return e.replace(/[ぁ-ん]+$/g,"")}(n));""===n&&""!==s&&(n=s,s="");return{src:e,res:n,josi:s,numEOL:0}}}];function _(e,t,n){let s="",r="",i=0;const o=(n=n.substr(e.length)).indexOf(t);if(o<0)s=n,n="";else if(s=n.substr(0,o),n=n.substr(o+t.length),s.indexOf(e)>=0)throw"『"===e?new Error("「『」で始めた文字列の中に「『」を含めることはできません。"):new Error(`『${e}』で始めた文字列の中に『${e}』を含めることはできません。`);const c=u.josiRE.exec(n);c&&(r=c[0].replace(/^\s+/,""),","===(n=n.substr(c[0].length)).charAt(0)&&(n=n.substr(1))),u.removeJosiMap[r]&&(r="");for(let e=0;e<s.length;e++)"\n"===s.charAt(e)&&i++;return{src:n,res:s,josi:r,numEOL:i}}function y(e){return Number(e.replace(/_/g,""))}class m{constructor(e){this.logger=e,this.funclist={},this.modList=[],this.result=[],this.modName="main.nako3"}setFuncList(e){this.funclist=e}replaceTokens(e,t,n){if(this.result=e,this.modName=m.filenameToModName(n),m.preDefineFunc(e,this.logger,this.funclist),this._replaceWord(this.result),t)if(this.result.length>0){const e=this.result[this.result.length-1];this.result.push({type:"eol",line:e.line,column:0,indent:-1,file:e.file,josi:"",value:"---",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""}),this.result.push({type:"eof",line:e.line,indent:-1,column:0,file:e.file,josi:"",value:"",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,indent:-1,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,indent:-1,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,n){let s=0,r=!1;const o=()=>{const t=[],n={};if("("!==e[s].type)return[];for(s++;e[s];){const i=e[s];if(s++,")"===i.type)break;"func"===i.type?r=!0:"|"!==i.type&&"comma"!==i.type&&(r&&(i.funcPointer=!0,r=!1),t.push(i),n[i.value]||(n[i.value]=[]),n[i.value].push(i.josi))}const i=[],o=[],u=[],c={};for(const e of t)if(!c[e.value]){const t=n[e.value];u.push(t),i.push(e.value),e.funcPointer?o.push(e.value):o.push(null),c[e.value]=!0}return[u,i,o]};for(;s<e.length;){const r=e[s];if("word"===r.type&&"には"===r.josi||"word"===r.type&&"は~"===r.josi){r.josi="には",e.splice(s+1,0,{type:"def_func",value:"関数",indent:r.indent,line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset,endOffset:r.endOffset,rawJosi:"",tag:"無名関数"}),s++;continue}if("word"===r.type&&""===r.josi&&r.value.length>=2&&r.value.match(/回$/)){r.value=r.value.substring(0,r.value.length-1),r.endOffset||(r.endOffset=1);const t={type:"回",value:"回",indent:r.indent,line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset-1,endOffset:r.endOffset,rawJosi:""};e.splice(s+1,0,t),r.endOffset--,s++}if("word"===r.type&&i.default[r.value]&&(r.type=i.default[r.value],"そう"===r.value&&(r.value="それ")),"def_test"!==r.type&&"def_func"!==r.type){s++;continue}let u=!0,c={type:"eol"};s>=1&&(c=e[s-1]),"eol"===c.type&&(u=!1);const a=r;s++;let f=[],l=[],h=[],p="",d=null;if(e[s]&&"("===e[s].type&&([f,l,h]=o()),!u&&e[s]&&"word"===e[s].type&&(d=e[s++],p=d.value),0===f.length&&e[s]&&"("===e[s].type&&([f,l,h]=o()),""!==p&&d){if(p=m.filenameToModName(r.file)+"__"+p,p in n){const e=p.replace(/^main__/,"");t.warn(`関数『${e}』は既に定義されています。`,a)}d.value=p,n[p]={type:"func",josi:f,fn:null,asyncFn:!1,varnames:l,funcPointers:h}}a.meta={type:"func",josi:f,varnames:l,funcPointers:h}}}splitStringEx(e){const t=[],n=e.split(/[{{]/);t.push(n[0]);for(const e of n.slice(1)){const n=e.replace("}","}").indexOf("}");if(-1===n)return null;t.push(e.slice(0,n),e.slice(n+1))}return t}_replaceWord(t){let n=[],s=0;let r=t.length>0?m.filenameToModName(t[0].file):"main.nako3";for(;s<t.length;){const i=t[s];if("word"!==i.type&&"func"!==i.type||"名前空間設定"!==i.value||(r=t[s-1].value),"word"===i.type&&"それ"!==i.value){const e=i.value;if(e.indexOf("__")<0){const t=`${r}__${e}`,n=this.funclist[t];if(n&&"func"===n.type){i.type="func",i.meta=n,i.value=t;continue}for(const t of this.modList){const n=`${t}__${e}`,s=this.funclist[n];if(s&&"func"===s.type){i.type="func",i.meta=s,i.value=n;break}}if("func"===i.type)continue}const t=this.funclist[e];t&&"func"===t.type&&(i.type="func",i.meta=t)}if("-"===i.type&&t[s+1]&&"number"===t[s+1].type){const n=s<=0?"eol":t[s-1].type;("eol"===n||e[n]||""!==t[s-1].josi)&&(t.splice(s,1),t[s].value*=-1)}if(void 0===i.josi&&(i.josi=""),"は"!==i.josi)if("とは"!==i.josi)if(u.tararebaMap[i.josi]){const e="でなければ"===i.josi||"なければ"===i.josi?"でなければ":"ならば";i.rawJosi||(i.rawJosi=e);const n=void 0===i.endOffset?void 0:i.endOffset-i.rawJosi.length;t.splice(s+1,0,{type:"ならば",value:e,indent:i.indent,line:i.line,column:i.column,file:i.file,startOffset:n,endOffset:i.endOffset,josi:"",rawJosi:""}),i.josi=i.rawJosi="",i.endOffset=n,s+=2}else"_eol"!==i.type?"line_comment"!==i.type&&"range_comment"!==i.type?("eol"===i.type&&(i.value=n.join("/"),n=[]),s++):(n.push(i.value),t.splice(s,1)):t.splice(s,1);else{i.rawJosi||(i.rawJosi=i.josi);const e=void 0===i.endOffset?void 0:i.endOffset-i.rawJosi.length;t.splice(s+1,0,{type:i.josi,indent:i.indent,line:i.line,column:i.column,file:i.file,startOffset:e,endOffset:i.endOffset,josi:"",rawJosi:"",value:void 0}),i.josi=i.rawJosi="",i.endOffset=e,s+=2}else{i.rawJosi||(i.rawJosi=i.josi);const e=void 0===i.endOffset?void 0:i.endOffset-i.rawJosi.length;t.splice(s+1,0,{type:"eq",indent:i.indent,line:i.line,column:i.column,file:i.file,startOffset:e,endOffset:i.endOffset,josi:"",rawJosi:"",value:void 0}),s+=2,i.josi=i.rawJosi="",i.endOffset=e}}}countIndent(e){let t=0;for(let n=0;n<e.length;n++){const s=o(e.charAt(n));if(0===s)return[t,n];t+=s}return[t,e.length]}tokenize(e,t,n){const s=e.length,i=[];let o,c,a=1,f=!1,l=0;const h=this.countIndent(e);for(l=h[0],e=e.substring(h[1]),a+=h[1];""!==e;){let h=!1;for(const _ of d){const d=_.pattern.exec(e);if(!d)continue;if(h=!0,"space"===_.name){a+=d[0].length,e=e.substring(d[0].length);continue}if(_.cbParser){let u;if(f&&"word"===_.name)u=_.cbParser(e,!1);else try{u=_.cbParser(e)}catch(i){throw new r.tO(i.message,s-e.length,s-e.length+1,t,n)}if("string_ex"===_.name){const o=this.splitStringEx(u.res);if(null===o)throw new r.cg("展開あり文字列で値の埋め込み{...}が対応していません。",s-e.length,s-u.src.length,t,n);let c=0;for(let r=0;r<o.length;r++){const f=r===o.length-1?u.josi:"";r%2==0?(i.push({type:"string",value:o[r],file:n,josi:f,indent:l,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:o[r].length+2+f.length}),c+=o[r].length+2):(i.push({type:"&",value:"&",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:0}),i.push({type:"(",value:"(",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:0}),i.push({type:"code",value:o[r],josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c,preprocessedCodeLength:o[r].length}),i.push({type:")",value:")",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c+o[r].length,preprocessedCodeLength:0}),i.push({type:"&",value:"&",josi:"",indent:l,file:n,line:t,column:a,preprocessedCodeOffset:s-e.length+c+o[r].length,preprocessedCodeLength:0}),c+=o[r].length)}t+=u.numEOL,a+=e.length-u.src.length,e=u.src,u.numEOL>0&&(a=1);break}o=a,a+=e.length-u.src.length,i.push({type:_.name,value:u.res,josi:u.josi,indent:l,line:t,column:o,file:n,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-u.src.length}),e=u.src,t+=u.numEOL,u.numEOL>0&&(a=1);break}const y=s-e.length;let m=d[0];if(_.cb&&(m=_.cb(m)),o=a,c=t,a+=d[0].length,e=e.substring(d[0].length),("eol"===_.name&&"\n"===m||"_eol"===_.name)&&(m=t++,a=1),"number"===_.name){const t=p.exec(e);t&&(e=e.substring(t[0].length),a+=d[0].length)}let g="";if(_.readJosi){const t=u.josiRE.exec(e);t&&(g=t[0].replace(/^\s+/,""),a+=t[0].length,","===(e=e.substring(t[0].length)).charAt(0)&&(e=e.substring(1)),u.removeJosiMap[g]&&(g=""))}switch(_.name){case"def_test":f=!0;break;case"eol":f=!1}if("dec_lineno"!==_.name){if(i.push({type:_.name,value:m,indent:l,line:c,column:o,file:n,josi:g,preprocessedCodeOffset:y,preprocessedCodeLength:s-e.length-y}),"eol"===_.name&&1===a){const t=this.countIndent(e);l=t[0],a+=t[1],e=e.substring(t[1])}break}t--}if(!h)throw new r.cg("未知の語句: "+e.substring(0,3)+"...",s-e.length,s-s+3,t,n)}return i}static tokensToTypeStr(e,t){return e.map((e=>e.type)).join(t)}static filenameToModName(e){if(!e)return"main";if((e=e.replace(/[\\:]/g,"/")).indexOf("/")>=0){const t=e.split("/");e=t[t.length-1]}return e=e.replace(/\.nako3?$/,"")}}class g extends class{constructor(e){this.logger=e,this.stackList=[],this.tokens=[],this.usedFuncs=new Set,this.stack=[],this.index=0,this.y=[],this.modName="inline",this.modList=[],this.funclist={},this.funcLevel=0,this.usedAsyncFn=!1,this.localvars={"それ":{type:"var",value:""}},this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[],this.init()}init(){this.funclist={},this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}popStack(e){if(!e){const e=this.stack.pop();return e||null}for(let t=this.stack.length-1;t>=0;t--){const n=this.stack[t];if(0===e.length||e.indexOf(n.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(n)),n}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}findVar(e){if(this.localvars[e])return{name:e,scope:"local",info:this.localvars[e]};if(e.indexOf("__")>=0)return this.funclist[e]?{name:e,scope:"global",info:this.funclist[e]}:void 0;const t=`${this.modName}__${e}`;if(this.funclist[t])return{name:t,scope:"global",info:this.funclist[t]};for(const t of this.modList){const n=`${t}__${e}`;if(this.funclist[n])return{name:n,scope:"global",info:this.funclist[n]}}return this.funclist[e]?{name:e,scope:"system",info:this.funclist[e]}:void 0}pushStack(e){this.logger.trace("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}getIndex(){return this.index}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){const n=t+this.index;if(this.tokens.length<=n)return!1;if("*"===e[t])continue;const s=this.tokens[n];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1}else if(s.type!==e[t])return!1}return!0}checkTypes(e){const t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){const t=[],n=this.index,s=()=>(this.index=n,!1);for(let n=0;n<e.length;n++){if(this.isEOF())return s();const r=e[n];if(null==r)return s();if("string"!=typeof r)if("function"!=typeof r){if(!(r instanceof Array))throw new Error("System Error : accept broken : "+typeof r);if(!this.checkTypes(r))return s();t[n]=this.get()}else{const e=r.bind(this)(t);if(null===e)return s();t[n]=e}else{const e=this.get();if(e&&e.type!==r)return s();t[n]=e}}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}getCur(){if(this.isEOF())throw new Error("トークンが取得できません。");const e=this.tokens[this.index++];if(!e)throw new Error("トークンが取得できません。");return e}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekDef(e=null){return this.isEOF()?(e||(e=s()),e):this.tokens[this.index]}peekSourceMap(){const e=this.peek();return null===e?{startOffset:void 0,endOffset:void 0,file:void 0,line:0,column:0}:{startOffset:e.startOffset,endOffset:e.endOffset,file:e.file,line:e.line,column:e.column}}nodeToStr(e,t,n){const s=t.depth-1,r=e=>void 0!==t.typeName?t.typeName:e,i=n?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":if(s>=0){const t=e.value;return`${r("")}『${this.nodeToStr(t,{depth:s},n)}に演算子『not』を適用した式${i}』`}return`${r("演算子")}『not』`;case"op":{const t=e;let o=t.operator||"";const u={eq:"=",not:"!",gt:">",lt:"<",and:"かつ",or:"または"};if(o in u&&(o=u[o]),s>=0){const e=this.nodeToStr(t.left,{depth:s},n),u=this.nodeToStr(t.right,{depth:s},n);return"eq"===t.operator?`${r("")}『${e}と${u}が等しいかどうかの比較${i}』`:`${r("")}『${e}と${u}に演算子『${o}』を適用した式${i}』`}return`${r("演算子")}『${o}${i}』`}case"number":return`${r("数値")}${e.value}`;case"string":return`${r("文字列")}『${e.value}${i}』`;case"word":return`${r("単語")}『${e.value}${i}』`;case"func":return`${r("関数")}『${e.name||e.value}${i}』`;case"eol":return"行の末尾";case"eof":return"ファイルの末尾";default:{let t=e.name;return t&&(t=e.value),"string"!=typeof t&&(t=e.type),`${r("")}『${t}${i}』`}}}}{parse(e,t){return this.reset(),this.tokens=e,this.modName=m.filenameToModName(t),this.modList.push(this.modName),this.startParser()}startParser(){const e=this.ySentenceList(),t=this.get();if(t&&"eof"!==t.type)throw this.logger.debug(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!0)}の使い方が間違っています。`,t),r.ih.fromNode(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!1)}の使い方が間違っています。`,t);return e}ySentenceList(){const e=[];let t=-1;const n=this.peekSourceMap();for(;!this.isEOF();){const n=this.ySentence();if(!n)break;e.push(n),t<0&&(t=n.line)}if(0===e.length){const e=this.peek()||this.tokens[0];throw this.logger.debug("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!0),e),r.ih.fromNode("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!1),e)}return{type:"block",block:e,...n,end:this.peekSourceMap(),genMode:this.genMode}}yEOL(){const e=this.get();if(!e)return null;if(this.stack.length>0){const t=[];this.stack.forEach((e=>{let n=this.nodeToStr(e,{depth:1},!1);e.josi&&(n+=e.josi),t.push(n)}));const n=t.join(",");let s="";const i="A".charCodeAt(0);for(const e of this.recentlyCalledFunc){s+=" - ";let t=0;const n=e.josi;if(n)for(const e of n){s+=String.fromCharCode(i+t),1===e.length?s+=e[0]:s+=`(${e.join("|")})`,t++}s+=e.name+"\n"}throw r.ih.fromNode(`未解決の単語があります: [${n}]\n次の命令の可能性があります:\n${s}`,e)}return this.recentlyCalledFunc=[],e}ySentence(){const e=this.peekSourceMap();if(this.check("eol"))return this.yEOL();if(this.check("もし"))return this.yIF();if(this.check("後判定"))return this.yAtohantei();if(this.check("エラー監視"))return this.yTryExcept();if(this.check("逐次実行"))return this.yTikuji();if(this.accept(["抜ける"]))return{type:"break",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["続ける"]))return{type:"continue",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["require","string","取込"]))return this.yRequire();if(this.accept(["not","非同期モード"]))return this.yASyncMode();if(this.accept(["DNCLモード"]))return this.yDNCLMode(1);if(this.accept(["DNCL2モード"]))return this.yDNCLMode(2);if(this.accept(["not","string","モード設定"]))return this.ySetGenMode(this.y[1].value);if(this.check2(["func","←"]))return this.yCallOp();if(this.check2(["func","eq"])){const e=this.get()||s();throw r.ih.fromNode(`関数『${e.value}』に代入できません。『←』を使ってください。`,e)}if(this.accept([this.ySpeedMode]))return this.y[0];if(this.accept([this.yPerformanceMonitor]))return this.y[0];if(this.accept([this.yLet]))return this.y[0];if(this.accept([this.yDefTest]))return this.y[0];if(this.accept([this.yDefFunc]))return this.y[0];if(this.accept([this.yCall])){const t=this.y[0];if("して"===t.josi){const n=this.ySentence();if(null!==n)return{type:"block",block:[t,n],josi:n.josi,...e,end:this.peekSourceMap()}}return t}return null}yASyncMode(){const e=this.peekSourceMap();return this.genMode="非同期モード",{type:"eol",...e,end:this.peekSourceMap()}}yDNCLMode(e){const t=this.peekSourceMap();return 1===e&&(this.arrayIndexFrom=1,this.flagReverseArrayIndex=!0),this.flagCheckArrayInit=!0,{type:"eol",...t,end:this.peekSourceMap()}}ySetGenMode(e){const t=this.peekSourceMap();return this.genMode=e,{type:"eol",...t,end:this.peekSourceMap()}}yRequire(){const e=this.y[1].value,t=m.filenameToModName(e);if(this.modList.indexOf(t)<0){const e=this.modList.shift();e&&(this.modList.unshift(t),this.modList.unshift(e))}return{type:"require",value:e,josi:"",...this.peekSourceMap(),end:this.peekSourceMap()}}yBlock(){const e=this.peekSourceMap(),t=[];for(this.check("ここから")&&this.get();!this.isEOF()&&!this.checkTypes(["違えば","ここまで","エラー"])&&this.accept([this.ySentence]);)t.push(this.y[0]);return{type:"block",block:t,...e,end:this.peekSourceMap()}}yDefFuncReadArgs(){if(!this.check("("))return null;const e=[];for(this.get();!this.isEOF();){if(this.check(")")){this.get();break}const t=this.get();t&&e.push(t),this.check("comma")&&this.get()}return e}yDefTest(){return this.yDef("def_test")}yDefFunc(){return this.yDef("def_func")}yDef(e){if(!this.check(e))return null;const t=this.peekSourceMap(),n=this.get();if(!n)return null;let s=[];this.check("(")&&(s=this.yDefFuncReadArgs()||[]);const i=this.get();if(!i||"func"!==i.type)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言でエラー。",i),r.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言でエラー。",n);if(this.check("(")){if(s.length>0)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i),r.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i);s=this.yDefFuncReadArgs()||[]}this.check("とは")&&this.get();let o=null,u=!1,c=!1;this.check("ここから")&&(u=!0),this.check("eol")&&(u=!0);try{this.funcLevel++,this.usedAsyncFn=!1;const e=this.localvars;if(this.localvars={"それ":{type:"var",value:""}},u){this.saveStack();for(const e of s){const t=e.value?e.value+"":"";this.localvars[t]={type:"var",value:""}}if(o=this.yBlock(),!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。関数定義の末尾に必要です。",n);this.get(),this.loadStack()}else this.saveStack(),o=this.ySentence(),this.loadStack();this.funcLevel--,c=this.usedAsyncFn,this.localvars=e}catch(e){throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の定義で以下のエラーがありました。\n"+e.message,n),r.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の定義で以下のエラーがありました。\n"+e.message,n)}return{type:e,name:i,args:s,block:o||[],asyncFn:c,josi:"",...t,end:this.peekSourceMap()}}yIFCond(){const e=this.peekSourceMap();let t=this.yGetArg();if(!t)return null;if("ならば"===t.josi)return t;if("でなければ"===t.josi)return t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()},t;if(""!==t.josi&&this.check("func"))this.stack.push(t),t=this.yCall();else if("が"===t.josi){const n=this.index,s=this.yGetArg();if(!s)throw r.ih.fromNode("もし文の条件「AがBならば」でBがないか条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1),e);if(this.check("ならば")){const e=this.get()||{value:"ならば"};s.josi=e.value}if(s&&("ならば"===s.josi||"でなければ"===s.josi))return{type:"op",operator:"でなければ"===s.josi?"noteq":"eq",left:t,right:s,josi:"",...e,end:this.peekSourceMap()};this.index=n}if(this.check("ならば")||(this.stack.push(t),t=this.yCall()),!this.check("ならば")){const n=t||{type:"?",...e};throw this.logger.debug("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",n),r.ih.fromNode("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",n)}const n=this.get();return n&&"でなければ"===n.value&&(t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()}),t}yIF(){const e=this.peekSourceMap();if(!this.check("もし"))return null;const t=this.get();if(null==t)return null;for(;this.check("comma");)this.get();let n=null;try{n=this.yIFCond()}catch(e){throw r.ih.fromNode("『もし』文の条件で次のエラーがあります。\n"+e.message,t)}if(null===n)throw r.ih.fromNode("『もし』文で条件の指定が空です。",t);let s=null,i=null,o=!1;for(this.check("eol")?s=this.yBlock():(s=this.ySentence(),o=!0);this.check("eol");)this.get();if(this.check("違えば")){for(this.get();this.check("comma");)this.get();this.check("eol")?i=this.yBlock():(i=this.ySentence(),o=!0)}if(!1===o){if(!this.check("ここまで"))throw r.ih.fromNode("『もし』文で『ここまで』がありません。",t);this.get()}return{type:"if",expr:n||[],block:s||[],false_block:i||[],josi:"",...e,end:this.peekSourceMap()}}ySpeedMode(){const e=this.peekSourceMap();if(!this.check2(["string","実行速度優先"]))return null;const t=this.get();this.get();let n="";if(!t||!t.value)return null;n=t.value;const s={"行番号無し":!1,"暗黙の型変換無し":!1,"強制ピュア":!1,"それ無効":!1};for(const e of n.split("/")){if("全て"===e){for(const e of Object.keys(s))s[e]=!0;break}Object.keys(s).includes(e)?s[e]=!0:this.logger.warn(`実行速度優先文のオプション『${e}』は存在しません。`,t)}let r=!1;this.check("ここから")?(this.get(),r=!0):this.check("eol")&&(r=!0);let i=null;return r?(i=this.yBlock(),this.check("ここまで")&&this.get()):i=this.ySentence(),{type:"speed_mode",options:s,block:i||[],josi:"",...e}}yPerformanceMonitor(){const e=this.peekSourceMap();if(!this.check2(["string","パフォーマンスモニタ適用"]))return null;const t=this.get();if(!t)return null;this.get();const n={"ユーザ関数":!1,"システム関数本体":!1,"システム関数":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`パフォーマンスモニタ適用文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"performance_monitor",options:n,block:r||[],josi:"",...e}}yTikuji(){const e=this.peekSourceMap();if(!this.check("逐次実行"))return null;const t=this.getCur();this.logger.warn("『逐次実行』構文の使用は非推奨になりました(https://nadesi.com/v3/doc/go.php?944)。",t);const n=[];let s=null;if(!t||!this.check("eol"))throw r.ih.fromNode("『逐次実行』の直後は改行が必要です。",t);for(;!this.check("ここまで");){if(this.check("eol")){this.get();continue}if(this.check2(["エラー","ならば"])){this.get(),this.get(),s=this.yBlock();break}let t=null;if(this.check("先に")||this.check("次に")){const n=this.get();if(this.check("comma")&&this.get(),this.check("eol")){if(t=this.yBlock(),!this.check("ここまで")){let t="次に";throw null!=n&&(t=n.type),r.ih.fromNode(`『${t}』...『ここまで』を対応させてください。`,e)}this.get()}else t=this.ySentence()}else t=this.ySentence();null!=t&&n.push(t)}if(!this.check("ここまで"))throw console.log(n,this.peek()),r.ih.fromNode("『逐次実行』...『ここまで』を対応させてください。",t);return this.get(),{type:"tikuji",blocks:n||[],errorBlock:s||[],josi:"",...e,end:this.peekSourceMap()}}yGetArgOperator(t){const n=[t];for(;!this.isEOF();){let s=this.peek();if(!s||!e[s.type])break;{s=this.getCur(),n.push(s);const e=this.yValue();if(null===e)throw r.ih.fromNode(`計算式で演算子『${s.value}』後に値がありません`,t);n.push(e)}}return 0===n.length?null:1===n.length?n[0]:this.infixToAST(n)}yGetArg(){const e=this.yValue();return null===e?null:this.yGetArgOperator(e)}infixToPolish(t){const n=t=>e[t.type]?e[t.type]:10,s=[],r=[];for(;t.length>0;){const e=t.shift();if(!e)break;for(;s.length>0;){const t=s[s.length-1];if(n(e)>n(t))break;const i=s.pop();if(!i){this.logger.error("計算式に間違いがあります。",e);break}r.push(i)}s.push(e)}for(;s.length>0;){const e=s.pop();e&&r.push(e)}return r}infixToAST(t){if(0===t.length)return null;const n=t[t.length-1].josi,s=t[t.length-1],i=this.infixToPolish(t),o=[];for(const t of i){if(!e[t.type]){o.push(t);continue}const u=o.pop(),c=o.pop();if(void 0===c||void 0===u)throw this.logger.debug("--- 計算式(逆ポーランド) ---\n"+JSON.stringify(i)),r.ih.fromNode("計算式でエラー",s);const a={type:"op",operator:t.type,left:c,right:u,josi:n,startOffset:c.startOffset,endOffset:c.endOffset,line:c.line,column:c.column,file:c.file};o.push(a)}const u=o.pop();return u||null}yGetArgParen(e){let t=!1;const n=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}const e=this.yGetArg();if(!e)break;this.pushStack(e),this.check("comma")&&this.get()}if(!t)throw r.ih.fromNode(`C風関数『${e[0].value}』でカッコが閉じていません`,e[0]);const s=[];for(;n<this.stack.length;){const e=this.popStack();e&&s.unshift(e)}return s}yRepeatTime(){const e=this.peekSourceMap();if(!this.check("回"))return null;this.get(),this.check("comma")&&this.get(),this.check("繰返")&&this.get();let t=this.popStack([]),n=!1,s=null;if(null===t&&(t={type:"word",value:"それ",josi:"",...e,end:this.peekSourceMap()}),this.check("comma")&&this.get(),this.check("ここから")?(this.get(),n=!0):this.check("eol")&&(n=!0),n){if(s=this.yBlock(),!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『回』...『ここまで』を対応させてください。",e);this.get()}else s=this.ySentence();return{type:"repeat_times",value:t,block:s||[],josi:"",...e,end:this.peekSourceMap()}}yWhile(){const e=this.peekSourceMap();if(!this.check("間"))return null;for(this.get();this.check("comma");)this.get();this.check("繰返")&&this.get();const t=this.popStack();if(null===t)throw r.ih.fromNode("『間』で条件がありません。",e);if(this.check("comma")&&this.get(),!this.checkTypes(["ここから","eol"]))throw r.ih.fromNode("『間』の直後は改行が必要です",e);const n=this.yBlock();return this.check("ここまで")&&this.get(),{type:"while",cond:t,block:n,josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){const e=this.peekSourceMap();this.check("後判定")&&this.get(),this.check("繰返")&&this.get(),this.check("ここから")&&this.get();const t=this.yBlock();this.check("ここまで")&&this.get(),this.check("comma")&&this.get();let n=this.yGetArg(),s=!1;const r=this.peek();return!r||"なる"!==r.value||"まで"!==r.josi&&"までの"!==r.josi||(this.get(),s=!0),this.check("間")&&this.get(),s&&(n={type:"not",value:n,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",cond:n||[],block:t,josi:"",...e,end:this.peekSourceMap()}}yFor(){let e=!0;const t=this.peekSourceMap();if(!(this.check("繰返")||this.check("増繰返")||this.check("減繰返")))return null;const n=this.getCur(),s=this.stack.pop();s&&("word"!==s.type||"増"!==s.value&&"減"!==s.value?this.stack.push(s):("増"===s.value&&(e=!1),n.type=s.value+n.type));let i=null;"増繰返"!==n.type&&"減繰返"!==n.type||(i=this.popStack(["ずつ"]),"増繰返"===n.type&&(e=!1));const o=this.popStack(["まで"]),u=this.popStack(["から"]),c=this.popStack(["を","で"]);if(null===u||null===o)throw r.ih.fromNode("『繰り返す』文でAからBまでの指定がありません。",n);this.check("comma")&&this.get();let a=!1;(this.check("ここから")||this.check("eol"))&&(a=!0,this.get());let f=null;if(a){if(f=this.yBlock(),!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『繰り返す』...『ここまで』を対応させてください。",t);this.get()}else f=this.ySentence();return{type:"for",from:u,to:o,inc:i,flagDown:e,word:c,block:f||[],josi:"",...t,end:this.peekSourceMap()}}yReturn(){const e=this.peekSourceMap();if(!this.check("戻る"))return null;this.get();const t=this.popStack(["で","を"]);if(this.stack.length>0)throw r.ih.fromNode("『戻』文の直前に未解決の引数があります。『(式)を戻す』のように式をカッコで括ってください。",e);return{type:"return",value:t,josi:"",...e,end:this.peekSourceMap()}}yForEach(){const e=this.peekSourceMap();if(!this.check("反復"))return null;for(this.get();this.check("comma");)this.get();const t=this.popStack(["を"]),n=this.popStack(["で"]);let s=null,r=!1;return this.check("ここから")?(r=!0,this.get()):this.check("eol")&&(r=!0),r?(s=this.yBlock(),this.check("ここまで")&&this.get()):s=this.ySentence(),{type:"foreach",name:n,target:t,block:s||[],josi:"",...e,end:this.peekSourceMap()}}ySwitch(){const e=this.peekSourceMap();if(!this.check("条件分岐"))return null;const t=this.get();if(!t)return null;const n=this.get();if(!n)return null;const s=this.popStack(["で"]);if(!s)throw r.ih.fromNode("『(値)で条件分岐』のように記述してください。",t);if("eol"!==n.type)throw r.ih.fromNode("『条件分岐』の直後は改行してください。",t);let i=!1,o=!1;const u=[];for(;!this.isEOF();){if(this.check("ここまで")){if(o)throw r.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);this.get();break}if(this.check("eol")){this.get();continue}if(i)throw r.ih.fromNode("『条件分岐』で『違えば〜ここまで』の後に処理を続けることは出来ません。",t);let e=null;const n=this.peek();if(n&&"違えば"===n.type)o=!1,i=!0,e=this.get(),this.check("comma")&&this.get();else{if(o)throw r.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);if(e=this.yValue(),!e)throw r.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);const n=this.get();if(!n||"ならば"!==n.type)throw r.ih.fromNode("『条件分岐』で条件は**ならばと記述してください。",t);this.check("comma")&&this.get()}const s=this.yBlock(),c=this.peek();if(c&&"ここまで"===c.type)this.get();else{if(i)throw r.ih.fromNode("『条件分岐』は『違えば〜ここまで』と記述してください。",t);o=!0}u.push([e,s])}return{type:"switch",value:s,cases:u||[],josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){const e=this.peekSourceMap();if(!this.check("def_func"))return null;const t=this.get();if(!t)return null;let n=[];this.check("comma")&&this.get(),this.check("(")&&(n=this.yDefFuncReadArgs()||[]),this.check("comma")&&this.get(),this.funcLevel++,this.saveStack();const s=this.yBlock();if(!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『には』構文か無名関数の末尾に『ここまで』が必要です。",e);return this.get(),this.loadStack(),this.funcLevel--,{type:"func_obj",args:n,block:s,meta:t.meta,josi:"",...e,end:this.peekSourceMap()}}yDainyu(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const n=this.popStack(["を"]),s=this.popStack(["へ","に"]);if(!s||"word"!==s.type&&"func"!==s.type&&"配列参照"!==s.type)throw r.ih.fromNode("代入文で代入先の変数が見当たりません。『(変数名)に(値)を代入』のように使います。",t);if("配列参照"===s.type)return{type:"let_array",name:s.name,index:s.index,value:n,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()};return{type:"let",name:this.getVarName(s),value:n,josi:"",...e,end:this.peekSourceMap()}}ySadameru(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const n=this.popStack(["を"]),s=this.popStack(["へ","に"]);if(!n||"word"!==n.type&&"func"!==n.type&&"配列参照"!==n.type)throw r.ih.fromNode("『定める』文で定数が見当たりません。『(定数名)を(値)に定める』のように使います。",t);return{type:"def_local_var",name:this.getVarName(n),vartype:"定数",value:s,josi:"",...e,end:this.peekSourceMap()}}yIncDec(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;if(this.check("繰返"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap()}),this.yFor();let n=this.popStack(["だけ",""]);n||(n={type:"number",value:1,josi:"だけ",...e,end:this.peekSourceMap()});const s=this.popStack(["を"]);if(!s||"word"!==s.type&&"配列参照"!==s.type)throw r.ih.fromNode(`『${t.type}』文で定数が見当たりません。『(変数名)を(値)だけ${t.type}』のように使います。`,t);return"減"===t.value&&(n={type:"op",operator:"*",left:n,right:{type:"number",value:-1,line:t.line},josi:"",...e}),{type:"inc",name:s,value:n,josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("ここから")&&this.get(),this.check("代入"))return this.yDainyu();if(this.check("定める"))return this.ySadameru();if(this.check("回"))return this.yRepeatTime();if(this.check("間"))return this.yWhile();if(this.check("繰返")||this.check("増繰返")||this.check("減繰返"))return this.yFor();if(this.check("反復"))return this.yForEach();if(this.check("条件分岐"))return this.ySwitch();if(this.check("戻る"))return this.yReturn();if(this.check("増")||this.check("減"))return this.yIncDec();if(this.check2([["func","word"],"("])){const e=this.peek();if(e&&""===e.josi){const e=this.yValue();if(e){const n=e.josi||"";if("func"===e.type&&(""===e.josi||t.indexOf(n)>=0))return e.josi="",e;this.pushStack(e)}this.check("comma")&&this.get();continue}}if(this.check("func")){const e=this.yCallFunc();if(null===e)continue;if(this.check("間")){this.pushStack(e);continue}if(!this.checkTypes(n))return e;this.pushStack(this.yGetArgOperator(e));continue}const e=this.yGetArg();if(!e)break;this.pushStack(e)}if(this.stack.length>0){this.logger.debug("--- stack dump ---\n"+JSON.stringify(this.stack,null,2)+"\npeek: "+JSON.stringify(this.peek(),null,2));let e=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!0))).join("、")}が解決していません。`,t=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!1))).join("、")}が解決していません。`;for(const n of this.stack){const s=this.nodeToStr(n,{depth:0},!1),r=this.nodeToStr(n,{depth:1},!1);s!==r&&(e+=`${this.nodeToStr(n,{depth:0},!0)}は${this.nodeToStr(n,{depth:1},!0)}として使われています。`,t+=`${s}は${r}として使われています。`)}const n=this.stack[0],s=this.stack[this.stack.length-1];throw this.logger.debug(e,n),r.ih.fromNode(t,n,s)}return this.popStack([])}yCallFunc(){const e=this.peekSourceMap(),n=this.get();if(!n)return null;const s=n.meta,i=n.value;let o=null;if("には"===n.josi){try{o=this.yMumeiFunc()}catch(e){throw r.ih.fromNode(`『${n.value}には...』で無名関数の定義で以下の間違いがあります。\n${e.message}`,n)}if(null===o)throw r.ih.fromNode("『Fには』構文がありましたが、関数定義が見当たりません。",n)}if(!s||void 0===s.josi)throw r.ih.fromNode("関数の定義でエラー。",n);this.recentlyCalledFunc.push({name:i,...s}),s&&s.asyncFn&&(this.usedAsyncFn=!0);const u=[];let c=0,a=0;for(let e=s.josi.length-1;e>=0;e--)for(;;){let t=this.popStack(s.josi[e]);if(null!==t)a++;else{if(!(e<s.josi.length-1)&&s.isVariableJosi)break;c++,t=o}if(null!==t&&void 0!==s.funcPointers&&null!==s.funcPointers[e]){if("func"!==t.type){const t=s.varnames?s.varnames[e]:`${e+1}番目の引数`;throw r.ih.fromNode(`関数『${n.value}』の引数『${t}』には関数オブジェクトが必要です。`,n)}t.type="func_pointer"}if(u.unshift(t),e<s.josi.length-1||!s.isVariableJosi)break}if(c>=2&&(a>0||""===n.josi||t.indexOf(n.josi)>=0))throw r.ih.fromNode(`関数『${n.value}』の引数が不足しています。`,n);this.usedFuncs.add(n.value);const f={type:"func",name:n.value,args:u,josi:n.josi,...e,end:this.peekSourceMap()};if("プラグイン名設定"===f.name&&u.length>0&&u[0]){let e=""+u[0].value;"メイン"===e&&(e=""+u[0].file),this.modName=m.filenameToModName(e)}return""===n.josi?f:t.indexOf(n.josi)>=0?(f.josi="して",f):(f.meta=s,this.pushStack(f),null)}yCallOp(){if(!this.check2(["func","←"]))return null;const e=this.peekSourceMap(),t=this.get();if(null==t)throw new Error("関数が取得できません。");try{if(null==this.get())throw new Error("関数呼び出し演算子が取得できません。");const n=t.value;if(!t.meta)throw new Error("関数本体を取得できません。");if(!t.meta.josi)throw new Error("関数の引数情報を取得できません。");const s=t.meta.josi.length;if(0===s)throw r.ih.fromNode(`引数がない関数『${n}』を関数呼び出し演算子で呼び出すことはできません。`,t);const i=this.stack.length;for(;!this.isEOF();){const e=this.yGetArg();if(!e)break;if(this.pushStack(e),this.stack.length-i===s)break}const o=this.stack.length-i;if(o!==s)throw r.ih.fromNode(`関数『${n}』呼び出しで引数の数(${o})が定義(${s})と違います。`,t);const u=this.stack.splice(i,s);let c=u;if(s>=2){c=[];t.meta.josi.forEach(((e,t)=>{for(let n=0;n<u.length;n++){const s=u[n];if(e.indexOf(s.josi)>=0)return void(c[t]=s)}const n=e.join(",");throw new Error(`助詞『${n}』が見当たりません。`)}))}return this.usedFuncs.add(n),{type:"func",name:n,args:c,setter:!0,josi:"",...e,end:this.peekSourceMap()}}catch(e){throw this.logger.debug(`${this.nodeToStr(t,{depth:0},!0)}の関数呼び出しで引数(『←』以降)が読み取れません。`,t),r.ih.fromNode(`${this.nodeToStr(t,{depth:0},!1)}の関数呼び出しでエラーがあります。\n${e.message}`,t)}}yLet(){const e=this.peekSourceMap();if(this.check2(["word","eq"])){const t=this.peek();let n=!1;try{if(this.accept(["word","eq",this.yCalc])||this.accept(["word","eq",this.ySentence])){if("eol"===this.y[2].type)throw new Error("値が空です。");this.check("comma")&&this.get();const t=this.getVarName(this.y[0]);return{type:"let",name:t,value:this.y[2],...e,end:this.peekSourceMap()}}throw n=!0,this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に書き間違いがあります。`,t),r.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に書き間違いがあります。`,e)}catch(s){if(n)throw s;throw this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に以下の書き間違いがあります。\n${s.message}`,t),r.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に以下の書き間違いがあります。\n${s.message}`,e)}}if(this.check2(["word","@"])){const t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){const t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","とは"])){const t=this.getVarName(this.y[0]);if(!this.checkTypes(["変数","定数"]))throw r.ih.fromNode("ローカル変数『"+t.value+"』の定義エラー",t);const n=this.getCur();let s=null;return this.check("eq")&&(this.get(),s=this.yCalc()),this.check("comma")&&this.get(),{type:"def_local_var",name:t,vartype:n.type,value:s,...e,end:this.peekSourceMap()}}if(this.accept(["変数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw r.ih.fromNode("複数定数の代入文でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw r.ih.fromNode(`複数定数の代入文${e+1}番目でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["変数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw r.ih.fromNode("複数変数の代入文でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw r.ih.fromNode(`複数変数の代入文${e+1}番目でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[4],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[6],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[8],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[10],...e,end:this.peekSourceMap()}}}return null}checkArrayIndex(e){return 0===this.arrayIndexFrom?e:{...e,type:"op",operator:"-",left:e,right:{...e,type:"number",value:this.arrayIndexFrom}}}checkArrayReverse(e){return e?this.flagReverseArrayIndex?e.length<=1?e:e.reverse():e:[]}yLetArrayAt(e){return this.accept(["word","@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[4],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:null}yLetArrayBracket(e){return this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[5],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),value:this.y[8],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[7],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]),value:this.y[11],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[9],...e,end:this.peekSourceMap()}:null}yCalc(){const e=this.peekSourceMap();if(this.check("eol"))return null;const t=this.yGetArg();if(!t)return null;if(""===t.josi)return t;this.pushStack(t);const n=this.yCall();if(!n)return this.popStack();if("して"!==n.josi)return n;const s=this.yCalc();return s?{type:"renbun",left:n,right:s,josi:s.josi,...e,end:this.peekSourceMap()}:n}yValueKakko(){if(!this.check("("))return null;const e=this.get();if(!e)throw new Error("[System Error] check したのに get できない");this.saveStack();const t=this.yCalc()||this.ySentence();if(null===t){const t=this.get();throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),r.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e)}if(!this.check(")"))throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),r.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e);const n=this.get();return this.loadStack(),n&&(t.josi=n.josi),t}yValue(){const e=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","string"]))return this.getCur();if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){const t=this.get(),n=this.yValue(),s=n&&n.josi?n.josi:"";return{type:"op",operator:"*",left:{type:"number",value:-1,line:t&&t.line?t.line:0},right:n||[],josi:s,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();const t=this.yValue();return{type:"not",value:t,josi:t&&t.josi?t.josi:"",...e,end:this.peekSourceMap()}}const t=this.yJSONArray();if(t)return t;const i=this.yJSONObject();if(i)return i;const o=n.concat(["eol",")","]","ならば","回","間","反復","条件分岐"]);if(this.check2(["func",o])){const t=this.get();if(!t)throw new Error("[System Error] 正しく値が取れませんでした。");const n=this.getVarNameRef(t);return this.usedFuncs.add(n.value),{type:"func",name:n.value,args:[],josi:n.josi,...e,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&""===this.peekDef().josi){const t=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"])){const t=this.getVarNameRef(this.y[0]).value;return this.usedFuncs.add(t),{type:"func",name:t,args:this.y[2],josi:this.y[3].josi,...e,end:this.peekSourceMap()}}throw r.ih.fromNode("C風関数呼び出しのエラー",t||s())}if(this.check2(["func","←"]))return this.yCallOp();if(this.check("def_func"))return this.yMumeiFunc();const u=this.yValueWord();return u||null}yValueWordGetIndex(e){if(e.index||(e.index=[]),this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw r.ih.fromNode("変数の後ろの『@要素』の指定が不正です。",e)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,!0;if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])];return e.index=this.checkArrayReverse(t),e.josi=this.y[4].josi,!0}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])];return e.index=this.checkArrayReverse(t),e.josi=this.y[6].josi,!0}return!1}yValueWord(){const e=this.peekSourceMap();if(this.check("word")){const t=this.getCur(),n=this.getVarNameRef(t);if(""===n.josi&&this.checkTypes(["[","@"])){const t={type:"配列参照",name:n,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(t););if(t.index&&0===t.index.length)throw r.ih.fromNode(`配列『${n.value}』アクセスで指定ミス`,n);return t}return n}return null}getVarName(e){const t=this.findVar(e.value);if(t)t&&"global"===t.scope&&(e.value=t.name);else if(0===this.funcLevel){let t=e.value;t.indexOf("__")<0&&(t=this.modName+"__"+e.value),this.funclist[t]={type:"var",value:""},e.value=t}else this.localvars[e.value]={type:"var",value:""};return e}getVarNameRef(e){const t=this.findVar(e.value);return t?t&&"global"===t.scope&&(e.value=t.name):0===this.funcLevel&&e.value.indexOf("__")<0&&(e.value=this.modName+"__"+e.value),e}getVarNameList(e){for(let t=0;t<e.length;t++)e[t]=this.getVarName(e[t]);return e}yJSONObjectValue(){const e=[],t=this.peek();if(!t)return null;for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push({key:this.y[0],value:this.y[2]});else if(this.accept(["string",":",this.yCalc]))e.push({key:this.y[0],value:this.y[2]});else if(this.check("word")){const t=this.getCur();t.type="string",e.push({key:t,value:t})}else{if(!this.checkTypes(["string","number"]))throw r.ih.fromNode("辞書オブジェクトの宣言で末尾の『}』がありません。",t);{const t=this.getCur();e.push({key:t,value:t})}}this.check("comma")&&this.get()}return e}yJSONObject(){const e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw r.ih.fromNode("辞書型変数の初期化が『}』で閉じられていません。",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();const e=this.yCalc();if(null===e)return null;this.check("comma")&&this.get();const t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){const e=this.yCalc();if(null===e)break;this.check("comma")&&this.get(),t.push(e)}return t}yJSONArray(){const e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw r.ih.fromNode("配列変数の初期化が『]』で閉じられていません。",this.y[1]);return null}yTryExcept(){const e=this.peekSourceMap();if(!this.check("エラー監視"))return null;const t=this.getCur(),n=this.yBlock();if(!this.check2(["エラー","ならば"]))throw r.ih.fromNode("エラー構文で『エラーならば』がありません。『エラー監視..エラーならば..ここまで』を対で記述します。",t);this.get(),this.get();const s=this.yBlock();if(!this.check("ここまで"))throw r.ih.fromNode("『ここまで』がありません。『エラー監視』...『エラーならば』...『ここまで』を対応させてください。",e);return this.get(),{type:"try_except",block:n,errBlock:s||[],josi:"",...e,end:this.peekSourceMap()}}}class v{constructor(e,t,n){this.from=e,this.to=t,this.index=n}}class b{constructor(e,t){this.text=e,this.sourcePosition=t}}class k{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){const n=this.getText().indexOf(e);if(-1===n)break;e.length!==t.length&&this.history.unshift(new v(e.length,t.length,n)),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(const t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(e=t.to>=2&&e===t.index+t.to-1?t.index+t.from-1:t.index);return e}}class w{constructor(){this.convertTable=new Map([[8208,"-"],[8209,"-"],[8211,"-"],[8212,"-"],[8213,"-"],[8722,"-"],[732,"~"],[759,"~"],[8275,"~"],[8764,"~"],[12316,"~"],[65374,"~"],[8192," "],[8194," "],[8195," "],[8196," "],[8197," "],[8198," "],[8199," "],[8201," "],[8202," "],[8203," "],[8239," "],[8287," "],[12288," "],[12644," "],[8251,"#"],[12290,";"],[12304,"["],[12305,"]"],[12289,","],[65292,","],[10006,"*"],[10133,"+"],[10134,"-"],[10135,"÷"]])}static getInstance(){return w._instance||(w._instance=new w),w._instance}convert1ch(e){if(!e)return"";const t=e.codePointAt(0)||0,n=this.convertTable.get(t)||"";if(n)return n;if(t<127)return e;if(t>=65281&&t<=65374){const e=t-65248;return String.fromCodePoint(e)}return e}convert(e){if(!e)return[];const t=new k(e);t.replaceAll("\r\n","\n"),t.replaceAll("\r","\n");let n=!1,s=!1,r="";const i=[];let o=0,u="",c=0;for(;c<t.getText().length;){const e=t.getText().charAt(c),a=t.getText().substr(c,2);if(n){if(e===r){n=!1,i.push(new b(u+r,t.getSourcePosition(o))),c++,o=c;continue}u+=e,c++;continue}if(s){if(a===r){s=!1,"*/"===r&&(r="*/"),i.push(new b(u+r,t.getSourcePosition(o))),c+=2,o=c;continue}u+=e,c++;continue}if("「"===e){i.push(new b(e,t.getSourcePosition(o))),c++,o=c,n=!0,r="」",u="";continue}if("『"===e){i.push(new b(e,t.getSourcePosition(o))),c++,o=c,n=!0,r="』",u="";continue}if("“"===e){i.push(new b(e,t.getSourcePosition(o))),c++,o=c,n=!0,r="”",u="";continue}if("🌴"===a||"🌿"===a){i.push(new b(a,t.getSourcePosition(o))),c+=2,o=c,s=!0,r=a,u="";continue}const f=this.convert1ch(e);'"'!==f&&"'"!==f?"#"!==f?"//"!==a&&"//"!==a?"/*"!==a?"/*"!==a?(i.push(new b(f,t.getSourcePosition(o))),c++,o=c):(i.push(new b(a,t.getSourcePosition(o))),c+=2,o=c,s=!0,r="*/",u=""):(i.push(new b("/*",t.getSourcePosition(o))),c+=2,o=c,s=!0,r="*/",u=""):(i.push(new b("//",t.getSourcePosition(o))),c+=2,o=c,n=!0,r="\n",u=""):(i.push(new b(f,t.getSourcePosition(o))),c++,o=c,n=!0,r="\n",u=""):(i.push(new b(f,t.getSourcePosition(o))),c++,o=c,n=!0,r=e,u="")}return(n||s)&&i.push(new b(u+r,t.getSourcePosition(o))),i}}var S=__webpack_require__(9485),j=__webpack_require__(8801);let $=s();function O(e,t,n){n&&($=n);return s(e,t,$.indent,$.line,$.file)}function x(e){return"違えば"===e.type||"word"===e.type&&"エラー"===e.value&&"ならば"===e.josi}function A(e){const t=[];for(const n of e)for(const e of n)t.push(e);return t}function C(e){const t=e.length;if(0===t)return s("?");let n=e[t-1];return"eol"===n.type&&t>=2&&(n=e[t-2]),n}function F(e,t){const n=[];let s=[],r=0;for(const i of e)s.push(i),"{"===i.type?r++:"}"===i.type?r--:0===r&&i.type===t&&(n.push(s),s=[]);return s.length>0&&n.push(s),n}function N(e){if(0===e.length)return!0;for(let t=0;t<e.length;t++){const n=e[t].type;if("eol"!==n&&"line_comment"!==n&&"range_comment"!==n)return!1}return!0}function M(e){for(let t=0;t<e.length;t++){const n=e[t].type;if("eol"!==n&&"line_comment"!==n&&"range_comment"!==n)return e[t]}return e[0]}const L=["!インデント構文","!ここまでだるい","💡インデント構文","💡ここまでだるい"];function E(e){if(!function(e){for(let t=0;t<e.length&&!(t>100);t++){const n=e[t];if("line_comment"===n.type&&L.indexOf(n.value)>=0)return!0}return!1}(e))return e;for(const t of e)if("ここまで"===t.type)throw new r.t5("インデント構文が有効化されているときに『ここまで』を使うことはできません。",t.line,t.file);let t=0,n=0;const s=e=>{e.forEach((e=>{"{"===e.type&&t++,"}"===e.type&&t--,"["===e.type&&n++,"]"===e.type&&n--}))},i=[],o=F(e,"eol");let u=0;for(let e=0;e<o.length;e++){const r=o[e];if(N(r))continue;if(n>0||t>0){s(r);continue}const c=M(r),a=c.indent;if(a!==u){if(u>=0)for(;u>a;){const t=i[i.length-1][1];if(x(c)&&t===a);else{const t=o[e-1][0];o[e-1].push(O("ここまで","ここまで",t)),o[e-1].push(O("eol","\n",t))}if(i.pop(),!(i.length>0)){u=0;break}u=i[i.length-1][0]}n>0||t>0||(s(r),a>u&&(i.push([a,u]),u=a))}}for(let t=0;t<i.length;t++){let t=e[0];for(let e=o.length-1;e>=0;e--){const n=o[e];if(n.length>0){t=n[n.length-1];break}}o[o.length-1].push(O("ここまで","ここまで",t)),o[o.length-1].push(O("eol","\n",t))}return A(o)}const T=["!DNCLモード","💡DNCLモード"],I={"←:←":["eq","="],"÷:÷":["÷÷","÷÷"],"{:{":["[","["],"}:}":["]","]"],"word:を実行":["ここまで","ここまで"],"word:乱数":["word","乱数範囲"],"word:表示":["word","連続表示"]};function P(e){if(!function(e){for(let t=0;t<e.length&&!(t>100);t++){const n=e[t];if("line_comment"===n.type&&T.indexOf(n.value)>=0)return n.type="DNCLモード",!0}return!1}(e))return e;const t=F(e,"eol");for(let e=0;e<t.length;e++){const n=t[e];if(n.length<=1)continue;for(let e=0;e<n.length&&"|"===n[e].type;e++)n[e].type="range_comment";const r=n[0];"word"===r.type&&"繰返"===r.value&&n.splice(0,n.length,s("word","後判定",r.indent,r.line,r.file),s("word","繰返",r.indent,r.line,r.file));const i=G(n,["word:なる","word:繰返"]);i>0&&D(n,i);const o=G(n,["word:なる","word:実行"]);o>0&&D(n,o);const u=G(n,["word:ない"]);if(u>=1){"ならば"===n[u].josi&&(n[u-1].josi="でなければ",n.splice(u,1))}for(;;){const e=G(n,["word:二進","word:表示"]);if(e<0)break;n[e].value="二進表示",n[e].josi="",n.splice(e+1,1)}for(;;){const e=G(n,["word:改行","word:表示"]);if(e<0)break;const t=n[e];t.value="連続無改行表示",t.josi="",n.splice(e+1,1)}for(;;){const e=G(n,["word:を実行","comma:,","word:そう"]);if(e<0)break;const t=n[e+2];if("でなければ"!==t.josi){if("で"===t.josi){const r=n[e+3];if("なくもし"===r.value.substring(0,4)){if(t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t),r.value.length>4){const t=r.value.substring(4),i=s("word",t,r.indent,r.line,r.file);t.match(/^\d/)&&(i.type="number"),n.splice(e+2,0,i),r.value=r.value.substring(0,4)}r.type="もし",r.value="もし",r.josi="";continue}}break}t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t)}for(;;){const e=G(n,["word:増","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="増繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=G(n,["word:減","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="減繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=G(n,["word:を繰り返"]);if(e<0)break;const t=n[e];t.type="ここまで",t.value="ここまで",t.josi=""}for(;;){const e=G(n,["word:すべて","word:要素"]);if(!(e>=1))break;J(n,e)}for(;;){const e=G(n,["word:すべて","word:値"]);if(!(e>=1))break;J(n,e)}let c=0;for(;c<n.length;){const e=n[c];if("word"===e.type&&e.value.length>=2){const t=e.value.charAt(e.value.length-1);"減"!==t&&"増"!==t||(e.value=e.value.substring(0,e.value.length-1),e.josi="だけ",n.splice(c+1,0,s("word",t,e.indent,e.line,e.file))),c++}else c++}}for(let t=0;t<e.length;t++){const n=e[t],s=I[n.type+":"+n.value];void 0!==s&&(n.type=s[0],n.value=s[1])}return e=A(t)}function J(e,t){const n=e[t];e[t-1].josi="";const r=s("eq","=",n.indent,n.line,n.file),i=s("[","[",n.indent,n.line,n.file),o=s("]","]",n.indent,n.line,n.file);o.josi="に";const u=e[t+2];u.josi="";const c=s("number",100,n.indent,n.line,n.file);c.josi="を";const a=s("word","掛",n.indent,n.line,n.file);e.splice(t,4,r,i,u,o,c,a)}function D(e,t){const n=G(e,["word:を"]);n>=0&&(e[n].type="ここまで",e[n].value="ここまで");const s=G(e,["word:が"]);s>=0&&(e[s].type="ここまで",e[s].value="ここまで"),e[t+1].value="間"}function G(e,t){const n=t.map((e=>e.split(":")));for(let t=0;t<e.length;t++){let s=!0;for(let r=0;r<n.length;r++){const i=n[r],o=t+r;if(o>=e.length)return-1;if(e[o].type!==i[0]||e[o].value!==i[1]){s=!1;break}}if(s)return t}return-1}const R=["!DNCL2モード","💡DNCL2モード","!DNCL2","💡DNCL2"],V={"←:←":["eq","="],"÷:÷":["÷÷","÷÷"],"{:{":["[","["],"}:}":["]","]"],"word:and":["and","かつ"],"word:or":["or","または"],"word:not":["not","!"],"word:乱数":["word","乱数範囲"],"word:表示":["word","連続表示"]};function q(e){if(!function(e){for(let t=0;t<e.length&&!(t>100);t++){const n=e[t];if("line_comment"===n.type&&R.indexOf(n.value)>=0)return n.type="DNCL2モード",!0}return!1}(e))return e;const t=F(e,"eol");for(let e=0;e<t.length;e++){const n=t[e];if(n.length<=1)continue;const r=U(n,["word:ない"]);if(r>=1){"ならば"===n[r].josi&&(n[r-1].josi="でなければ",n.splice(r,1))}for(let e=0;e<n.length;e++){const t=n[e];"そう"===t.value&&"でなければ"===t.josi&&(t.type="違えば",t.value="違えば",t.josi="")}for(;;){const e=U(n,["word:を実行","comma:,","word:そう"]);if(e<0)break;const t=n[e+2];if("でなければ"!==t.josi){if("で"===t.josi){const r=n[e+3];if("なくもし"===r.value.substring(0,4)){if(t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t),r.value.length>4){const t=r.value.substring(4),i=s("word",t,r.indent,r.line,r.file);t.match(/^\d/)&&(i.type="number"),n.splice(e+2,0,i),r.value=r.value.substring(0,4)}r.type="もし",r.value="もし",r.josi="";continue}}break}t.type="違えば",t.value="違えば",t.josi="",n.splice(e,3,t)}for(;;){const e=U(n,["word:増","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="増繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=U(n,["word:減","word:ら"]);if(e<0)break;const t=n[e];t.type="word",t.value="減繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=U(n,["word:増","word:ら繰り返"]);if(e<0)break;const t=n[e];t.type="word",t.value="増繰返",t.josi="",n.splice(e,2,t)}for(;;){const e=U(n,["word:減","word:ら繰り返"]);if(e<0)break;const t=n[e];t.type="word",t.value="減繰返",t.josi="",n.splice(e,2,t)}for(let e=0;e<n.length;e++){if(B([["word:配列","word:配列変数"],"word","word:すべて",["word:要素","word:値"],"*","word:代入"],n,e)){const t=n[e+1];t.josi="";const s=n[e+4];s.josi="",n.splice(e,6,t,O("eq","=",t),O("word","掛"),O("(","("),O("[","["),s,O("]","]"),O("comma",","),O("number",30),O(")",")")),e+=6}if(B(["word","word:すべて",["word:要素","word:値"],["number","string","word"],"word:する"],n,e)){const t=n[e];t.josi="";const s=n[e+3];s.josi="",n.splice(e,5,t,O("eq","=",t),O("word","掛"),O("(","("),O("[","["),s,O("]","]"),O("comma",","),O("number",30),O(")",")"))}if(B([["word:配列変数","word:配列"],"word","word:初期化"],n,e)){const t=n[e+1];t.josi="",n.splice(e,3,t,O("eq","=",t),O("word","掛"),O("(","("),O("[","["),O("number",0),O("]","]"),O("comma",","),O("number",30),O(")",")"))}}for(;;){const e=U(n,["word:二進","word:表示"]);if(e<0)break;n[e].value="二進表示",n[e].josi="",n.splice(e+1,1)}for(;;){const e=U(n,["word:改行","word:表示"]);if(e<0)break;const t=n[e];t.value="連続無改行表示",t.josi="",n.splice(e+1,1)}let i=0;for(;i<n.length;){const e=n[i];if("word"===e.type&&e.value.length>=2){const t=e.value.charAt(e.value.length-1);"減"!==t&&"増"!==t||(e.value=e.value.substring(0,e.value.length-1),e.josi="だけ",n.splice(i+1,0,s("word",t,e.indent,e.line,e.file))),i++}else i++}}for(let t=0;t<e.length;t++){const n=e[t],s=V[n.type+":"+n.value];void 0!==s&&(n.type=s[0],n.value=s[1])}return e=A(t)}function B(e,t,n){const s=(e,t)=>{if(e instanceof Array){for(let n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}if("*"===e)return!0;if(e.indexOf(":")<0)return e===t.type;return e===`${t.type}:${t.value}`};for(let r=0;r<e.length;r++){const i=r+n;if(i>=t.length)return!1;const o=e[r],u=t[i];if(!s(o,u))return!1}return!0}function U(e,t){const n=t.map((e=>e.split(":")));for(let t=0;t<e.length;t++){let s=!0;for(let r=0;r<n.length;r++){const i=n[r],o=t+r;if(o>=e.length)return-1;if(e[o].type!==i[0]||e[o].value!==i[1]){s=!1;break}}if(s)return t}return-1}class W{constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let n=0;this.cumulativeSum=[];for(const e of t)this.cumulativeSum.push(n),n+=e.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){const t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}}class X{constructor(e,t,n){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=n;let s=0;for(const t of e.split("\n"))this.lines.push({offset:s,len:t.length}),s+=t.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){if(null===e)return{startOffset:e,endOffset:t};const n=this.getLineNumber(e);for(const s of this.linesInsertedByIndentationSyntax){if(n===s){e=null,t=null;break}n>s&&(e-=this.lines[s].len+1,null!==t&&(t-=this.lines[s].len+1))}for(const s of this.linesDeletedByIndentationSyntax)n>=s.lineNumber&&(null!==e&&(e+=s.len+1),null!==t&&(t+=s.len+1));return{startOffset:e,endOffset:t}}getLineNumber(e){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let t=this.lastLineNumber;t<this.lines.length-1;t++)if(e<this.lines[t+1].offset)return this.lastLineNumber=t,t;return this.lastLineNumber=this.lines.length-1,this.lines.length-1}}class Y{constructor(e){this.lineOffsets=[];let t=0;for(const n of e.split("\n"))this.lineOffsets.push(t),t+=n.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let n=this.lastLineNumber;n<this.lineOffsets.length-1;n++)if(e<this.lineOffsets[n+1])return this.lastLineNumber=n,{line:n+(t?1:0),column:e-this.lineOffsets[n]};return this.lastLineNumber=this.lineOffsets.length-1,{line:this.lineOffsets.length-1+(t?1:0),column:e-this.lineOffsets[this.lineOffsets.length-1]}}}function z(e,t){if("number"==typeof e.startOffset&&(e.startOffset-=t.length),"number"==typeof e.endOffset&&(e.endOffset-=t.length),""!==t){const n=t.split("\n");"number"==typeof e.line&&(e.line-=n.length-1),0===e.line&&"number"==typeof e.column&&(e.column-=n[n.length-1].length)}return e}const H=["black","red","green","yellow","blue","magenta","cyan","white"],Z=e=>{const t=e.replace(/\x1b\[\d+m/g,""),n=[];let s="inherit",r="inherit";const i=e===t?t:e.replace(/\x1b\[(\d+)m/g,((e,t)=>{const i=+t;return 0===i&&(s="inherit",r="inherit"),1===i&&(r="bold"),i>=30&&i<=37&&(s=H[i-30]),n.push(`color: ${s}; font-weight: ${r};`),"%c"}));let o="inherit",u="inherit";var c;return{noColor:t,nodeConsole:e===t?t:e+"[0m",html:e===t?t:"<span>"+(c=e,c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")).replace(/\x1b\[(\d+)m/g,((e,t)=>{const n=+t;return 0===n&&(o="inherit",u="inherit"),1===n&&(u="bold"),n>=30&&n<=37&&(o=H[n-30]),`</span><span style="color: ${o}; font-weight: ${u};">`}))+"</span>",browserConsole:[i,...n]}},K={reset:"[0m",bold:"[1m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m"};class Q{static fromS(e){let t=Q.trace;switch(e){case"all":t=Q.all;break;case"trace":t=Q.trace;break;case"debug":t=Q.debug;break;case"info":t=Q.info;break;case"warn":t=Q.warn;break;case"error":t=Q.error;break;case"stdout":t=Q.stdout;break;default:throw new Error("[NakoLogger] unknown logger level:"+e)}return t}static toString(e){return["all","trace","debug","info","warn","error","stdout"][e]}}function ee(e){return e?`${e.file||""}${void 0===e.line?"":`(${e.line+1}行目): `}`:""}Q.all=0,Q.trace=1,Q.debug=2,Q.info=3,Q.warn=4,Q.error=5,Q.stdout=6;class te{constructor(){this.listeners=[],this.logs="",this.position=""}getErrorLogs(){return[this.logs.replace(/\s+$/,""),this.position]}clear(){this.logs="",this.position=""}addListener(e,t){const n=Q.fromS(e);this.listeners.push({level:n,callback:t})}removeListener(e){this.listeners=this.listeners.filter((t=>t.callback!==e))}trace(e,t=null){this.sendI(Q.trace,`${K.bold}[デバッグ情報(詳細)]${K.reset}${ee(t)}${e}`,t)}debug(e,t=null){this.sendI(Q.debug,`${K.bold}[デバッグ情報]${K.reset}${ee(t)}${e}`,t)}info(e,t=null){this.sendI(Q.info,`${K.bold}${K.blue}[情報]${K.reset}${ee(t)}${e}`,t)}warn(e,t=null){this.sendI(Q.warn,`${K.bold}${K.green}[警告]${K.reset}${ee(t)}${e}`,t)}error(e,t=null){if(e instanceof Error&&"string"==typeof e.type){switch(e.type){case"NakoRuntimeError":case"NakoError":if(e instanceof r.k){const n=e;let s=t;return null==s&&(s={file:n.file,line:n.line||0,startOffset:0,endOffset:0}),void this.sendI(Q.error,n.message,s)}}}e instanceof Error&&(e=e.message),this.sendI(Q.error,`${K.bold}${K.red}[エラー]${K.reset}${ee(t)}${e}`,t)}runtimeError(e,t){return new r.as(e,t)}stdout(e,t=null){this.sendI(Q.stdout,`${e}`,t)}send(e,t,n,s=null,r=null){const i=Q.fromS(e);this.sendI(i,t,n,s,r)}sendI(e,t,n,s=null,r=null){const i=()=>{const i=Z(t);let o="";t.includes("\n")&&(o+="border-top: 1px solid #8080806b; border-bottom: 1px solid #8080806b;");return{noColor:i.noColor,nodeConsole:i.nodeConsole,browserConsole:r||i.browserConsole,html:`<div style="${o}">`+(s||i.html)+"</div>",level:Q.toString(e),position:n}};if(e===Q.error){const e=i();this.logs+=e.noColor+"\n",n&&null!==this.position&&(this.position=`l${n.line}:${n.file}`)}for(const t of this.listeners)if(t.level<=e){const e=i();t.callback(e)}}}class ne{constructor(e,t,n=0){this.guid=n,this.lastJSCode="",this.__locals={},this.__varslist=[{...e.__varslist[0]},{...e.__varslist[1]},{...e.__varslist[2]}],this.numFailures=0,this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.version=e.version,this.coreVersion=e.coreVersion,this.__module={...e.__module},this.pluginfiles={...e.getPluginfiles()},this.gen=t,this.logger=e.getLogger(),this.compiler=e}clearLog(){this.__varslist[0]["表示ログ"]=""}get log(){let e=this.__varslist[0]["表示ログ"];return e=e.replace(/\s+$/,""),e}runEx(e,t,n,s=""){return n.preCode=s,n.nakoGlobal=this,this.compiler.runSync(e,t,n)}async runAsync(e,t,n,s=""){return n.preCode=s,n.nakoGlobal=this,await this.compiler.runAsync(e,t,n)}_runTests(e){let t=`${K.bold}テストの実行結果${K.reset}\n`,n=0,s=0;for(const r of e)try{r.f(),t+=`${K.green}✔${K.reset} ${r.name}\n`,n++}catch(e){t+=`${K.red}☓${K.reset} ${r.name}: ${e.message}\n`,s++}t+=s>0?`${K.green}成功 ${n}件 ${K.red}失敗 ${s}件`:`${K.green}成功 ${n}件`,this.numFailures=s,this.logger.stdout(t)}clearPlugins(){for(const e in this.pluginfiles){const t=this.__module[e];t["!クリア"]&&t["!クリア"].fn&&t["!クリア"].fn(this)}}reset(){this.clearPlugins()}destroy(){this.reset()}}var se=__webpack_require__(4228),re=__webpack_require__(6758),ie={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},SIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sin(e)}},COS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.cos(e)}},TAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.tan(e)}},ARCSIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.asin(e)}},ARCCOS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.acos(e)}},ARCTAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.atan(e)}},ATAN2:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.atan2(e,t)}},"座標角度計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 180*Math.atan2(e[1],e[0])/Math.PI}},RAD2DEG:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},DEG2RAD:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},"度変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},"ラジアン変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},SIGN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 0===parseFloat(e)?0:e>0?1:-1}},"符号":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("SIGN",[e])}},ABS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},"絶対値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},EXP:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.exp(e)}},HYPOT:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},"斜辺":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},LN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOG:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOGN:{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return 2===e?Math.LOG2E*Math.log(t):10===e?Math.LOG10E*Math.log(t):Math.log(t)/Math.log(e)}},FRAC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"小数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"整数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.trunc(e)}},"乱数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.floor(Math.random()*e)}},"乱数範囲":{type:"func",josi:[["から"],["までの","の"]],pure:!0,fn:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},SQRT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},"平方根":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},ROUND:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.round(e)}},"四捨五入":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return Math.round(e)}},"小数点切上":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.ceil(e*n)/n}},"小数点切下":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.floor(e*n)/n}},"小数点四捨五入":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}},CEIL:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},"切上":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},FLOOR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}},"切捨":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}}};const oe={delimiter:",",eol:"\r\n"};function ue(e,t){void 0===t&&(t=oe.delimiter),e=(e=(e+="\n").replace(/(\r\n|\r)/g,"\n")).replace(/\s+$/,"")+"\n";const n=new RegExp("^(.*?)([\\"+t+"\\n])"),s=function(e){return"string"==typeof e&&e.search(/^[0-9.]+$/)>=0&&(e=parseFloat(e)),e},r=[];let i=[],o="";for(;""!==e;){if(o=e.charAt(0),o===t){e=e.substring(1),i.push("");continue}if("\n"===o){i.push(""),r.push(i),i=[],e=e.substring(1);continue}if(o=(e=e.replace(/^\s+/,"")).charAt(0),o===t){console.log("delimiter"),i.push(""),e=e.substring(t.length);continue}if("="===o&&'"'===e.charAt(1)){e=e.substring(1);continue}if('"'!==o){const o=n.exec(e);if(!o){i.push(s(e)),r.push(i),i=[];break}"\n"===o[2]?(i.push(s(o[1])),r.push(i),i=[]):o[2]===t&&i.push(s(o[1])),e=e.substring(o[0].length);continue}if('""'===e.substring(0,2)){i.push(""),e=e.substring(2);continue}let u=1,c="";for(;u<e.length;){const n=e.charAt(u),o=e.charAt(u+1);if('"'!==n||'"'!==o)if('"'!==n)c+=n,u++;else{if(u++,o===t){u++,i.push(s(c)),c="";break}if("\n"===o){u++,i.push(s(c)),r.push(i),i=[];break}u++}else u+=2,c+='"'}e=e.substr(u)}return i.length>0&&r.push(i),r}function ce(e,t,n){void 0===t&&(t=oe.delimiter),void 0===n&&(n=oe.eol);const s=function(e){return function(t){let n=!1;return((t=""+t).indexOf("\n")>=0||t.indexOf("\r")>=0)&&(n=!0),t.indexOf(e)>=0&&(n=!0),t.indexOf('"')>=0&&(n=!0,t=t.replace(/"/g,'""')),n&&(t='"'+t+'"'),t}}(t);if(void 0===e)return"";let r="";for(let i=0;i<e.length;i++){const o=e[i];if(void 0!==o){for(let e=0;e<o.length;e++)o[e]=s(o[e]);r+=o.join(t)+n}else r+=n}return r=r.replace(/(\r\n|\r|\n)/g,n),r}var ae={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},"CSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return oe.delimiter=",",ue(e)}},"TSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return oe.delimiter="\t",ue(e)}},"表CSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return oe.delimiter=",",ce(e)}},"表TSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return oe.delimiter="\t",ce(e)}}},fe={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){null==e.__promise&&(e.__promise={setLastPromise:function(t){return e.__v0["そ"]=t,t}})}},"そ":{type:"const",value:""},"動時":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){return t.__promise.setLastPromise(new Promise(((t,n)=>e(t,n))))},return_none:!1},"成功時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"処理時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(!0,t,n))),(t=>(n.__v0["対象"]=t,e(!1,t,n)))))},return_none:!1},"失敗時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.catch((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"終了時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.finally((()=>e())))},return_none:!1},"束":{type:"func",josi:[["と","を"]],pure:!0,fn:function(...e){return e.pop().__promise.setLastPromise(Promise.all(e))},return_none:!1}},le={"ASSERT等":{type:"func",josi:[["と"],["が"]],pure:!0,fn:function(e,t){if(e!==t)throw new Error(`不一致 [実際]${e} [期待]${t}`);return!0}},"テスト実行":{type:"func",josi:[["と"],["で"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}},"テスト等":{type:"func",josi:[["と"],["が"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}}};const he=e=>JSON.parse(JSON.stringify(e));function pe(e={}){return"object"!=typeof e&&(e={}),e.testOnly=e.testOnly||!1,e.resetEnv=e.resetEnv||!1,e.resetAll=e.resetAll||!1,e.preCode=e.preCode||"",e.nakoGlobal=e.nakoGlobal||null,e}class de{constructor(e){void 0===e&&(e={useBasicPlugin:!0}),this.__varslist=[{},{},{}],this.__locals={},this.__self=this,this.__vars=this.__varslist[2],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.version=se.Z.version,this.coreVersion=se.Z.version,this.__globals=[],this.__globalObj=null,this.__module={},this.pluginFunclist={},this.funclist={},this.pluginfiles={},this.commandlist=new Set,this.nakoFuncList={},this.eventList=[],this.codeGenerateor={},this.debugOption={useDebug:!1,waitTime:0},this.logger=new te,this.filename="main.nako3",this.dependencies={},this.usedFuncs=new Set,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins(),this.prepare=w.getInstance(),this.parser=new g(this.logger),this.lexer=new m(this.logger),this.lexer.setFuncList(this.funclist)}getModList(){return this.lexer.modList}getLogger(){return this.logger}getNakoFuncList(){return this.nakoFuncList}getNakoFunc(e){return this.nakoFuncList[e]}getPluginfiles(){return this.pluginfiles}addBasicPlugins(){this.addPluginObject("PluginSystem",re.Z),this.addPluginObject("PluginMath",ie),this.addPluginObject("PluginPromise",fe),this.addPluginObject("PluginAssert",le),this.addPluginObject("PluginCSV",ae)}replaceLogger(){return this.lexer.logger=this.parser.logger=this.logger=new te}static listRequireStatements(e){const t=[];for(let n=0;n+2<e.length;n++)"not"!==e[n].type||"string"!==e[n+1].type&&"string_ex"!==e[n+1].type||"取込"!==e[n+2].value||(t.push({...e[n],start:n,end:n+3,value:e[n+1].value+"",firstToken:e[n],lastToken:e[n+2]}),n+=2);return t}_loadDependencies(e,t,n,s){const i={},o=new de({useBasicPlugin:!0}),u=(e,t)=>{const n=s.readJs(e.filePath,e.firstToken);t.push(n.task.then((t=>{const n=t();this.addPluginFile(e.value,e.filePath,n,!1),i[e.filePath].funclist=n,i[e.filePath].addPluginFile=()=>{this.addPluginFile(e.value,e.filePath,n,!1)}})))},c=(e,t)=>{const n=s.readNako3(e.filePath,e.firstToken),r=t=>{const n=m.filenameToModName(e.filePath);t=`『${n}』に名前空間設定;『${n}』にプラグイン名設定;`+t+";名前空間ポップ;";const s=this.rawtokenize(t,0,e.filePath);i[e.filePath].tokens=s;const r={};return m.preDefineFunc(he(s),this.logger,r),i[e.filePath].funclist=r,a(t,e.filePath,"")};t.push(n.task.then((e=>r(e))))},a=(e,t,n)=>{const a=[],f=de.listRequireStatements(o.rawtokenize(e,0,t,n)).map((e=>({...e,...s.resolvePath(e.value,e.firstToken,t)})));for(const e of f)if(i.hasOwnProperty(e.filePath))i[e.filePath].alias.add(e.value);else if(i[e.filePath]={tokens:[],alias:new Set([e.value]),addPluginFile:()=>{},funclist:{}},"js"===e.type||"mjs"===e.type)u(e,a);else{if("nako3"!==e.type)throw new r.l0(`ファイル『${e.value}』を読み込めません。ファイルが存在しないか未対応の拡張子です。`,e.firstToken.file,e.firstToken.line);c(e,a)}if(a.length>0)return Promise.all(a)};try{const s=a(e,t,n);return void 0!==s&&s.catch((e=>{this.logger.error(e.msg),this.numFailures++})),this.dependencies=i,s}catch(e){throw this.logger.error(""+e),e}}rawtokenize(e,t,n,s=""){if(!e.startsWith(s))throw new Error("codeの先頭にはpreCodeを含める必要があります。");const i=m.filenameToModName(n),o=this.getModList();o.indexOf(i)<0&&o.unshift(i);const u=this.prepare.convert(e),c=new W(e.length,u),a=new X(e,[],[]),f=new Y(e);let l;try{l=this.lexer.tokenize(u.map((e=>e.text)).join(""),t,n)}catch(e){if(!(e instanceof r.cg))throw e;const t=a.map(c.map(e.preprocessedCodeStartOffset),c.map(e.preprocessedCodeEndOffset)),i=null===t.startOffset?e.line:f.map(t.startOffset,!1).line,o=z({...t,line:i},s);throw new r.tO(e.msg,o.startOffset,o.endOffset,o.line,n)}return l=q(l),l=P(l),l=E(l),l=function(e){const t=F(e,"eol"),n=[];let s=-1,r=0,i=0;const o=e=>{e.forEach((e=>{"{"===e.type&&r++,"}"===e.type&&r--,"["===e.type&&i++,"]"===e.type&&i--}))};for(let e=0;e<t.length;e++){const u=t[e];if(N(u))continue;const c=M(u);if(r>0||i>0){o(u);continue}if(s>=0){const r=c.indent;for(;s>=r;){const i=c;if(x(i)&&s===r||(t[e-1].push(O("ここまで","ここまで",i)),t[e-1].push(O("eol","\n",i))),n.pop(),!(n.length>0)){s=-1;break}s=n[n.length-1]}}if(o(u),r>0||i>0)continue;const a=C(u);":"===a.type&&(t[e]=t[e].filter((e=>e!==a)),s=a.indent,n.push(s))}if(t.length>0&&n.length>0){let s=e[0];for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.length>0){s=n[n.length-1];break}}for(let e=0;e<n.length;e++)t[t.length-1].push(O("ここまで","ここまで",s)),t[t.length-1].push(O("eol","\n",s))}return A(t)}(l),l=l.map((e=>{const t=a.map(c.map(e.preprocessedCodeOffset||0),c.map((e.preprocessedCodeOffset||0)+(e.preprocessedCodeLength||0)));let n=e.line,r=0;if("eol"===e.type&&null!==t.endOffset){const e=f.map(t.endOffset,!1);n=e.line,r=e.column}else if(null!==t.startOffset){const e=f.map(t.startOffset,!1);n=e.line,r=e.column}return{...e,...z({line:n,column:r,startOffset:t.startOffset,endOffset:t.endOffset},s),rawJosi:e.josi}})),l}converttoken(e,t,n){return this.lexer.replaceTokens(e,t,n)}reset(e){e&&!e.needToClearPlugin||this.clearPlugins(),this.__varslist=[this.__varslist[0],{},{}],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals={},this.funclist={};for(const e of Object.keys(this.__v0)){const t=this.pluginFunclist[e];t&&(this.funclist[e]=JSON.parse(JSON.stringify(t)))}this.lexer.setFuncList(this.funclist),this.logger.clear()}lexCodeToken(e,t,n,s){let r=this.rawtokenize(e,t,n,"");if(null===s)for(const e of r)e.startOffset=void 0,e.endOffset=void 0;else for(const e of r)void 0!==e.startOffset&&(e.startOffset+=s),void 0!==e.endOffset&&(e.endOffset+=s);const i=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));return r=this.converttoken(r,!1,n),{tokens:r,commentTokens:i}}replaceRequireStatements(e,t=new Set){const n=[];for(const s of de.listRequireStatements(e).reverse()){if(t.has(s.value)){n.push(...e.splice(s.start||0,(s.end||0)-(s.start||0)));continue}const i=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(s.value)));if(void 0===i){if(!s.firstToken)throw new Error(`ファイル『${s.value}』が読み込まれていません。`);throw new r.tO(`ファイル『${s.value}』が読み込まれていません。`,s.firstToken.startOffset||0,s.firstToken.endOffset||0,s.firstToken.line,s.firstToken.file)}this.dependencies[i].addPluginFile();const o=he(this.dependencies[i].tokens);t.add(s.value),n.push(...this.replaceRequireStatements(o,t)),n.push(...e.splice(s.start||0,(s.end||0)-(s.start||0),...o))}return n}removeRequireStatements(e){const t=[];for(const n of de.listRequireStatements(e).reverse()){const s=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(n.value)));void 0!==s&&this.dependencies[s].addPluginFile(),t.push(...e.splice(n.start||0,(n.end||0)-(n.start||0)))}return t}lex(e,t="main.nako3",n="",s=!1){let r=this.rawtokenize(e,0,t,n);const i=s?this.removeRequireStatements(r):this.replaceRequireStatements(r,void 0);for(const e of i)"word"!==e.type&&"not"!==e.type||(e.type="require");if(i.length>=3)for(let e=0;e<i.length;e+=3){let t=i[e+1].value;t=m.filenameToModName(t),this.lexer.modList.indexOf(t)<0&&this.lexer.modList.push(t)}const o=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));r=this.converttoken(r,!0,t);for(let e=0;e<r.length;e++)if(r[e]&&"code"===r[e].type){const n=this.lexCodeToken(r[e].value,r[e].line,t,r[e].startOffset||0);o.push(...n.commentTokens),r.splice(e,1,...n.tokens),e--}return this.logger.trace("--- lex ---\n"+JSON.stringify(r,null,2)),{commentTokens:o,tokens:r,requireTokens:i}}parse(e,t,n=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist);const s=this.lex(e,t,n);let i;try{this.parser.genMode="sync",i=this.parser.parse(s.tokens,t)}catch(e){if("number"!=typeof e.startOffset)throw r.ih.fromNode(e.message,s.tokens[this.parser.getIndex()]);throw e}return this.usedFuncs=this.parser.usedFuncs,this.deleteUnNakoFuncs(),this.logger.trace("--- ast ---\n"+JSON.stringify(i,null,2)),i}getUsedFuncs(e){const t=[e];for(this.usedFuncs=new Set;t.length>0;){const e=t.pop();null!=e&&null!==e.block&&void 0!==e.block&&this.getUsedAndDefFuncs(t,JSON.parse(JSON.stringify(e.block)))}return this.deleteUnNakoFuncs()}getUsedAndDefFuncs(e,t){for(;t.length>0;){const n=t.pop();null!=n&&this.getUsedAndDefFunc(n,e,t)}}getUsedAndDefFunc(e,t,n){["func","func_pointer"].includes(e.type)&&null!==e.name&&void 0!==e.name&&this.usedFuncs.add(e.name),t.push([e,e.block]),n.push.apply(n,[e.value].concat(e.args))}deleteUnNakoFuncs(){for(const e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,n=!1,s=""){const r=pe();r.testOnly=n,r.preCode=s;return this.compileFromCode(e,t,r).runtimeEnv}compileFromCode(e,t,n){""===t&&(t="main.nako3"),void 0===n&&(n=pe());try{n.resetEnv&&this.reset(),n.resetAll&&this.clearPlugins(),this.eventList.filter((e=>"beforeParse"===e.eventName)).map((t=>t.callback(e)));const s=this.parse(e,t,n.preCode);this.eventList.filter((e=>"beforeGenerate"===e.eventName)).map((e=>e.callback(s)));const r=this.generateCode(s,new S.un(n.testOnly));return this.eventList.filter((e=>"afterGenerate"===e.eventName)).map((e=>e.callback(r))),r}catch(e){throw this.logger.error(e),e}}generateCode(e,t){const n=e.genMode||"";if("sync"===n)return(0,S.Im)(this,e,t);if("非同期モード"===n)return this.logger.warn("『!非同期モード』の利用は非推奨です。[詳細](https://github.com/kujirahand/nadesiko3/issues/1164)"),j.g.generate(this,e,t.isTest);const s=this.codeGenerateor[n];if(!s)throw new Error(`コードジェネレータの「${n}」はサポートされていません。`);return s.generate(this,e,t.isTest)}addCodeGenerator(e,t){this.codeGenerateor[e]=t}async _run(e,t,n,s,r=""){const i=pe({resetEnv:n,resetAll:n,testOnly:s,preCode:r});return this._runEx(e,t,i)}clearPlugins(){this.__globals.forEach((e=>{e.__varslist[0].forceClose=!0,e.reset()})),this.__globals=[]}evalJS(e,t){this.eventList.filter((e=>"beforeRun"===e.eventName)).map((e=>e.callback(t))),this.__globalObj=t,this.__globalObj.lastJSCode=e;try{new Function(e).apply(t)}catch(e){throw t.numFailures++,this.getLogger().error(e),e}this.eventList.filter((e=>"finish"===e.eventName)).map((e=>e.callback(t)))}runSync(e,t,n){n=pe(n);const s=this.compileFromCode(e,t,n),r=this.getNakoGlobal(n,s.gen,t);return this.evalJS(s.runtimeEnv,r),r}async runAsync(e,t,n){n=pe(n);const s=this.compileFromCode(e,t,n),r=this.getNakoGlobal(n,s.gen,t);return this.evalJS(s.runtimeEnv,r),r}getNakoGlobal(e,t,n){let s=e.nakoGlobal;return s||(s=this.__globals.length>0&&!1===e.resetAll&&!1===e.resetEnv?this.__globals[this.__globals.length-1]:new ne(this,t,this.__globals.length+1),s.__varslist[0]["名前空間"]=m.filenameToModName(n)),this.__globals.indexOf(s)<0&&this.__globals.push(s),s}addListener(e,t){this.eventList.push({eventName:e,callback:t})}test(e,t,n="",s=!1){const r=pe();return r.preCode=n,r.testOnly=s,this.runSync(e,t,r)}run(e,t="main.nako3",n=""){const s=pe();return s.preCode=n,this.runSync(e,t,s)}compileStandalone(e,t,n=null){null===n&&(n=new S.un);const s=this.parse(e,t);return this.generateCode(s,n).standalone}addPlugin(e,t=!0){const n=this.__varslist[0];void 0===n.meta&&(n.meta={});for(const s in e){const r=e[s];if(this.funclist[s]=r,t&&(this.pluginFunclist[s]=JSON.parse(JSON.stringify(r))),"func"===r.type)n[s]=r.fn;else{if("const"!==r.type&&"var"!==r.type)throw console.error("[プラグイン追加エラー]",r),new Error("プラグインの追加でエラー。");n[s]=r.value,n.meta[s]={readonly:"const"===r.type}}"初期化"!==s&&"!"!==s.substring(0,1)&&this.commandlist.add(s)}}addPluginObject(e,t,n=!0){if(this.__module[e]=t,this.pluginfiles[e]="*","object"==typeof t["初期化"]){const n=t["初期化"];delete t["初期化"];t[`!${e}:初期化`]=n}if(t.meta&&t.meta.value&&"object"==typeof t.meta){const n=t.meta;delete t.meta;t[`__${n.value.pluginName||e}`.replace("-","__")]=n}this.addPlugin(t,n)}addPluginFile(e,t,n,s=!0){e.indexOf("\\")>=0&&(e=e.replace(/\\/g,"/")),this.addPluginObject(e,n,s),void 0===this.pluginfiles[e]&&(this.pluginfiles[e]=t)}addFunc(e,t,n,s=!0,r=!1){this.funclist[e]={josi:t,fn:n,type:"func",return_none:s,asyncFn:r},this.pluginFunclist[e]=he(this.funclist[e]),this.__varslist[0][e]=n}setFunc(e,t,n,s=!0,r=!1){this.addFunc(e,t,n,s,r)}getFunc(e){return this.funclist[e]}_runEx(e,t,n,s="",r){return n.preCode=s,r&&(n.nakoGlobal=r),this.runSync(e,t,n)}runEx(e,t,n,s=""){return this._runEx(e,t,n,s)}async runReset(e,t="main.nako3",n=""){const s=pe({resetAll:!0,resetEnv:!0});return this._runEx(e,t,s,n)}}var _e={"HTTP取得":{type:"func",josi:[["の","から","を"]],pure:!0,asyncFn:!0,fn:async function(e,t){return t.__exec("AJAXテキスト取得",[e,t])}},"AJAX受信":{type:"func",josi:[["から","を"]],pure:!0,asyncFn:!0,fn:async function(e,t){return t.__exec("AJAXテキスト取得",[e,t])}},"AJAX受信時":{type:"func",josi:[["で"],["から","を"]],pure:!0,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"AJAX送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,asyncFn:!0,fn:async function(e,t){return t.__exec("AJAXテキスト取得",[e,t])}},"AJAX送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!0,fn:function(e,t,n){let s=n.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(t,s).then((e=>200!==e.status?n.__v0["AJAX:ONERROR"](e.status):e.text())).then((t=>{n.__v0["対象"]=t,e(t,n)})).catch((e=>{n.__v0["AJAX:ONERROR"](e)}))},return_none:!0},"AJAXオプション":{type:"const",value:""},"AJAXオプション設定":{type:"func",josi:[["に","へ","と"]],pure:!0,fn:function(e,t){t.__v0["AJAXオプション"]=e},return_none:!0},"AJAXオプションPOST設定":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){const n={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.__exec("POSTデータ生成",[e,t])};t.__v0["AJAXオプション"]=n},return_none:!0},"AJAX失敗時":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){t.__v0["AJAX:ONERROR"]=e}},"AJAXテキスト取得":{type:"func",josi:[["から","を"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.text()},return_none:!1},"AJAX_JSON取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.json()},return_none:!1},"AJAXバイナリ取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.blob()},return_none:!1},"GET送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!1,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"POST送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n,s){const r=s.__exec("POSTデータ生成",[n,s]);fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTフォーム送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n,s){const r=new FormData;for(const e in n)r.set(e,n[e]);fetch(t,{method:"POST",body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTデータ生成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=[];for(const t in e){const s=e[t],r=encodeURIComponent(t)+"="+encodeURIComponent(s);n.push(r)}return n.join("&")}},"POST送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,asyncFn:!0,fn:function(e,t,n){return new Promise(((s,r)=>{const i=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then((e=>e.text())).then((e=>{s(e)})).catch((e=>{r(e.message)}))}))}},"POSTフォーム送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,asyncFn:!0,fn:function(e,t,n){return new Promise(((n,s)=>{const r=new FormData;for(const e in t)r.set(e,t[e]);fetch(e,{method:"POST",body:r}).then((e=>e.text())).then((e=>{n(e)})).catch((e=>{s(e.message)}))}))}},"AJAX保障送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){let n=t.__v0["AJAXオプション"];return""===n&&(n={method:"GET"}),fetch(e,n)},return_none:!1},"HTTP保障取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){return t.__exec("AJAX保障送信",[e,t])},return_none:!1},"POST保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=n.__exec("POSTデータ生成",[t,n]);return fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})},return_none:!1},"POSTフォーム保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=new FormData;for(const e in t)s.set(e,t[e]);return fetch(e,{method:"POST",body:s})},return_none:!1},"AJAX内容取得":{type:"func",josi:[["から"],["で"]],pure:!0,fn:function(e,t,n){return"TEXT"===(t=t.toString().toUpperCase())||"テキスト"===t?e.text():"JSON"===t?e.json():"BLOB"===t?e.blob():"ARRAY"===t||"配列"===t?e.arrayBuffer():"BODY"===t||"本体"===t?e.body:e.body()},return_none:!1},"BLOB作成":{type:"func",josi:[["を","から"],["で"]],pure:!0,fn:function(e,t){return e instanceof Array||(e=[e]),new Blob(e,t)}},"AJAX逐次送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX逐次送信』は『逐次実行』構文内で利用する必要があります。");t.resolveCount++;const n=t.resolve,s=t.reject;let r=t.__v0["AJAXオプション"];""===r&&(r={method:"GET"}),fetch(e,r).then((e=>e.text())).then((e=>{t.__v0["対象"]=e,n()})).catch((e=>{s(e.message)}))},return_none:!0},"HTTP逐次取得":{type:"func",josi:[["の","から","を"]],pure:!1,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP逐次取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"POST逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POSTフォーム逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム逐次送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=new FormData;for(const e in t)i.set(e,t[e]);fetch(e,{method:"POST",body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0}};const ye={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){"undefined"==typeof self&&(self={}),"undefined"==typeof navigator&&(navigator={}),e.__v0["AJAX:ONERROR"]=e=>{console.log(e)},e.__v0.SELF=self,e.__v0.NAVIGATOR=navigator}}};[{"水色":{type:"const",value:"aqua"},"紫色":{type:"const",value:"fuchsia"},"緑色":{type:"const",value:"lime"},"青色":{type:"const",value:"blue"},"赤色":{type:"const",value:"red"},"黄色":{type:"const",value:"yellow"},"黒色":{type:"const",value:"black"},"白色":{type:"const",value:"white"},"茶色":{type:"const",value:"maroon"},"灰色":{type:"const",value:"gray"},"金色":{type:"const",value:"gold"},"黄金色":{type:"const",value:"gold"},"銀色":{type:"const",value:"silver"},"白金色":{type:"const",value:"silver"},"オリーブ色":{type:"const",value:"olive"},"ベージュ色":{type:"const",value:"beige"},"アリスブルー色":{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["と"],["と"],["で","の"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)},return_none:!1},"色混":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};if(!e)throw new Error("『色混ぜる』の引数には配列を指定します");if(e.length<3)throw new Error("『色混ぜる』の引数には[RR,GG,BB]形式の配列を指定します");return"#"+t(e[0])+t(e[1])+t(e[2])},return_none:!1}},_e,{"HTML変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}},"クリップボード設定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){if(navigator.clipboard)navigator.clipboard.writeText(e);else{const t=document.createElement("div"),n=document.createElement("pre");n.style.webkitUserSelect="auto",n.style.userSelect="auto",t.appendChild(n).textContent=e,t.style.position="fixed",t.right="200%",document.body.appendChild(t),document.getSelection().selectAllChildren(t),document.execCommand("copy"),document.body.removeChild(t)}},return_none:!0},"クリップボード取得時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!navigator.clipboard)throw new Error("Clipbard APIが利用できません。");"string"==typeof e&&(e=t.__findFunc(e,"クリップボード取得時"));navigator.clipboard.readText().then((n=>{t.__v0["対象"]=n,e(t)}))}}},{"WS接続完了時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONOPEN"]=e},return_none:!0},"WS受信時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONMESSAGE"]=e},return_none:!0},"WSエラー発生時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONERROR"]=e},return_none:!0},"WS接続":{type:"func",josi:[["に","へ","の"]],pure:!0,fn:function(e,t){const n=new WebSocket(e);return n.onopen=()=>{const e=t.__v0["WS:ONOPEN"];e&&e(t)},n.onerror=e=>{const n=t.__v0["WS:ONERROR"];n&&n(e,t),console.log("WSエラー",e)},n.onmessage=e=>{t.__v0["対象"]=e.data;const n=t.__v0["WS:ONMESSAGE"];n&&n(t)},t.__v0["WS:SOCKET"]=n,n}},"WS送信":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__v0["WS:SOCKET"].send(e)}},"WS切断":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0["WS:SOCKET"].close()}}}].forEach((e=>{const t={};Object.assign(t,e),void 0!==t["初期化"]&&delete t["初期化"],Object.assign(ye,t)}));var me=ye;var ge={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0.SELF=self||{},e.__v0["依頼主"]=self||{}}},"対象イベント":{type:"const",value:""},"受信データ":{type:"const",value:""},SELF:{type:"const",value:""},"依頼主":{type:"const",value:""},"NAKOワーカーデータ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),t.__varslist[0]["PluginWorker:ondata"]=(n,s)=>(t.__v0["受信データ"]=n,t.__v0["対象イベント"]=s,e(s,t))},return_none:!0},"ワーカーメッセージ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),self.onmessage=n=>(t.__v0["受信データ"]=n.data,t.__v0["対象イベント"]=n,e(n,t))},return_none:!0},"NAKOワーカーデータ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"data",data:e})},return_none:!0},"ワーカーメッセージ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage(e)},return_none:!0},"表示":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"output",data:e})},return_none:!0},"終了":{type:"func",josi:[],pure:!0,fn:function(e){close()},return_none:!0}};class ve extends de{constructor(){super(),this.__varslist[0]["ナデシコ種類"]="wwnako3",this.__varslist[0]["PluginWorker:ondata"]=(e,t)=>{throw new Error("『NAKOワーカーデータ受信時』が呼ばれていません。")}}}if("object"==typeof navigator&&self&&self instanceof WorkerGlobalScope){const e=navigator.nako3=new ve;let t=e;e.addPluginObject("PluginBrowserInWorker",me),e.addPluginObject("PluginWorker",ge),e.getLogger().addListener("error",(function(e){self.postMessage({type:"error",data:e})}),!1),self.onmessage=n=>{const s=n.data||{type:"",data:""},r=s.type||"",i=s.data||"";switch(r){case"reset":e.reset();break;case"close":self.close();break;case"run":t=t.runEx(i,"_webworker.nako3",{resetEnv:!1,resetLog:!1});break;case"trans":i.forEach((t=>{"func"===t.type?(e.nakoFuncList[t.name]=t.content.meta,e.funclist[t.name]=t.content.func,e.__varslist[1][t.name]=()=>{}):"val"===t.type&&(e.__varslist[2][t.name]=t.content)}));break;case"data":t.__varslist[0]["PluginWorker:ondata"]&&t.__varslist[0]["PluginWorker:ondata"].apply(t,[i,n])}}}}()})();
|